Skip to main content

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

1// This file is @generated by prost-build.
2/// An argument to a programmable transaction command.
3#[non_exhaustive]
4#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct Argument {
6    #[prost(enumeration = "argument::ArgumentKind", optional, tag = "1")]
7    pub kind: ::core::option::Option<i32>,
8    /// Index of an input when `kind` is `INPUT`.
9    #[prost(uint32, optional, tag = "2")]
10    pub input: ::core::option::Option<u32>,
11    /// Index of a result when `kind` is `RESULT`.
12    #[prost(uint32, optional, tag = "3")]
13    pub result: ::core::option::Option<u32>,
14    /// Used to access a nested result when `kind` is `RESULT`.
15    #[prost(uint32, optional, tag = "4")]
16    pub subresult: ::core::option::Option<u32>,
17}
18/// Nested message and enum types in `Argument`.
19pub mod argument {
20    #[non_exhaustive]
21    #[derive(
22        Clone,
23        Copy,
24        Debug,
25        PartialEq,
26        Eq,
27        Hash,
28        PartialOrd,
29        Ord,
30        ::prost::Enumeration
31    )]
32    #[repr(i32)]
33    pub enum ArgumentKind {
34        Unknown = 0,
35        /// The gas coin.
36        Gas = 1,
37        /// One of the input objects or primitive values (from
38        /// `ProgrammableTransaction` inputs).
39        Input = 2,
40        /// The result of another command (from `ProgrammableTransaction` commands).
41        Result = 3,
42    }
43    impl ArgumentKind {
44        /// String value of the enum field names used in the ProtoBuf definition.
45        ///
46        /// The values are not transformed in any way and thus are considered stable
47        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
48        pub fn as_str_name(&self) -> &'static str {
49            match self {
50                Self::Unknown => "ARGUMENT_KIND_UNKNOWN",
51                Self::Gas => "GAS",
52                Self::Input => "INPUT",
53                Self::Result => "RESULT",
54            }
55        }
56        /// Creates an enum from field names used in the ProtoBuf definition.
57        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
58            match value {
59                "ARGUMENT_KIND_UNKNOWN" => Some(Self::Unknown),
60                "GAS" => Some(Self::Gas),
61                "INPUT" => Some(Self::Input),
62                "RESULT" => Some(Self::Result),
63                _ => None,
64            }
65        }
66    }
67}
68/// The delta, or change, in balance for an address for a particular `Coin` type.
69#[non_exhaustive]
70#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
71pub struct BalanceChange {
72    /// The account address that is affected by this balance change event.
73    #[prost(string, optional, tag = "1")]
74    pub address: ::core::option::Option<::prost::alloc::string::String>,
75    /// The `Coin` type of this balance change event.
76    #[prost(string, optional, tag = "2")]
77    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
78    /// The amount or change in balance.
79    #[prost(string, optional, tag = "3")]
80    pub amount: ::core::option::Option<::prost::alloc::string::String>,
81}
82/// `Bcs` contains an arbitrary type that is serialized using the
83/// [BCS](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/index.html#bcs>)
84/// format as well as a name that identifies the type of the serialized value.
85#[non_exhaustive]
86#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
87pub struct Bcs {
88    /// Name that identifies the type of the serialized value.
89    #[prost(string, optional, tag = "1")]
90    pub name: ::core::option::Option<::prost::alloc::string::String>,
91    /// Bytes of a BCS serialized value.
92    #[prost(bytes = "bytes", optional, tag = "2")]
93    pub value: ::core::option::Option<::prost::bytes::Bytes>,
94}
95#[non_exhaustive]
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct Checkpoint {
98    /// The height of this checkpoint.
99    #[prost(uint64, optional, tag = "1")]
100    pub sequence_number: ::core::option::Option<u64>,
101    /// The digest of this Checkpoint's CheckpointSummary.
102    #[prost(string, optional, tag = "2")]
103    pub digest: ::core::option::Option<::prost::alloc::string::String>,
104    /// The `CheckpointSummary` for this checkpoint.
105    #[prost(message, optional, tag = "3")]
106    pub summary: ::core::option::Option<CheckpointSummary>,
107    /// An aggregated quorum signature from the validator committee that
108    /// certified this checkpoint.
109    #[prost(message, optional, tag = "4")]
110    pub signature: ::core::option::Option<ValidatorAggregatedSignature>,
111    /// The `CheckpointContents` for this checkpoint.
112    #[prost(message, optional, tag = "5")]
113    pub contents: ::core::option::Option<CheckpointContents>,
114    /// List of transactions included in this checkpoint.
115    #[prost(message, repeated, tag = "6")]
116    pub transactions: ::prost::alloc::vec::Vec<ExecutedTransaction>,
117    /// Set of objects either referenced as inputs or produced as
118    /// outputs by transactions included in this checkpoint.
119    ///
120    /// In order to benefit from deduplication of objects that
121    /// appear in multiple transactions in this checkpoint, objects
122    /// will only be present here and the `transactions.objects`
123    /// field will not be populated.
124    #[prost(message, optional, tag = "7")]
125    pub objects: ::core::option::Option<ObjectSet>,
126}
127/// The committed to contents of a checkpoint.
128#[non_exhaustive]
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct CheckpointContents {
131    /// This CheckpointContents serialized as BCS.
132    #[prost(message, optional, tag = "1")]
133    pub bcs: ::core::option::Option<Bcs>,
134    /// The digest of this CheckpointContents.
135    #[prost(string, optional, tag = "2")]
136    pub digest: ::core::option::Option<::prost::alloc::string::String>,
137    /// Version of this CheckpointContents
138    #[prost(int32, optional, tag = "3")]
139    pub version: ::core::option::Option<i32>,
140    /// Set of transactions committed to in this checkpoint.
141    #[prost(message, repeated, tag = "4")]
142    pub transactions: ::prost::alloc::vec::Vec<CheckpointedTransactionInfo>,
143}
144/// Transaction information committed to in a checkpoint.
145#[non_exhaustive]
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct CheckpointedTransactionInfo {
148    /// Digest of the transaction.
149    #[prost(string, optional, tag = "1")]
150    pub transaction: ::core::option::Option<::prost::alloc::string::String>,
151    /// Digest of the effects.
152    #[prost(string, optional, tag = "2")]
153    pub effects: ::core::option::Option<::prost::alloc::string::String>,
154    /// Set of user signatures that authorized the transaction.
155    #[prost(message, repeated, tag = "3")]
156    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
157    /// The `AddressAliases` object version, if any, that was used to verify the
158    /// UserSignature at the same position in `signatures`.
159    ///
160    /// This field is present when CheckpointContents.version is >= 2.
161    #[prost(message, repeated, tag = "4")]
162    pub address_aliases_versions: ::prost::alloc::vec::Vec<AddressAliasesVersion>,
163}
164#[non_exhaustive]
165#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
166pub struct AddressAliasesVersion {
167    #[prost(uint64, optional, tag = "1")]
168    pub version: ::core::option::Option<u64>,
169}
170/// A header for a checkpoint on the Sui blockchain.
171///
172/// On the Sui network, checkpoints define the history of the blockchain. They are quite similar to
173/// the concept of blocks used by other blockchains like Bitcoin or Ethereum. The Sui blockchain,
174/// however, forms checkpoints after transaction execution has already happened to provide a
175/// certified history of the chain, instead of being formed before execution.
176///
177/// Checkpoints commit to a variety of state, including but not limited to:
178///
179/// * The hash of the previous checkpoint.
180/// * The set of transaction digests, their corresponding effects digests, as well as the set of
181///   user signatures that authorized its execution.
182/// * The objects produced by a transaction.
183/// * The set of live objects that make up the current state of the chain.
184/// * On epoch transitions, the next validator committee.
185///
186/// `CheckpointSummary`s themselves don't directly include all of the previous information but they
187/// are the top-level type by which all the information is committed to transitively via cryptographic
188/// hashes included in the summary. `CheckpointSummary`s are signed and certified by a quorum of
189/// the validator committee in a given epoch to allow verification of the chain's state.
190#[non_exhaustive]
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct CheckpointSummary {
193    /// This CheckpointSummary serialized as BCS.
194    #[prost(message, optional, tag = "1")]
195    pub bcs: ::core::option::Option<Bcs>,
196    /// The digest of this CheckpointSummary.
197    #[prost(string, optional, tag = "2")]
198    pub digest: ::core::option::Option<::prost::alloc::string::String>,
199    /// Epoch that this checkpoint belongs to.
200    #[prost(uint64, optional, tag = "3")]
201    pub epoch: ::core::option::Option<u64>,
202    /// The height of this checkpoint.
203    #[prost(uint64, optional, tag = "4")]
204    pub sequence_number: ::core::option::Option<u64>,
205    /// Total number of transactions committed since genesis, including those in this
206    /// checkpoint.
207    #[prost(uint64, optional, tag = "5")]
208    pub total_network_transactions: ::core::option::Option<u64>,
209    /// The hash of the `CheckpointContents` for this checkpoint.
210    #[prost(string, optional, tag = "6")]
211    pub content_digest: ::core::option::Option<::prost::alloc::string::String>,
212    /// The hash of the previous `CheckpointSummary`.
213    ///
214    /// This will be `None` only for the first, or genesis, checkpoint.
215    #[prost(string, optional, tag = "7")]
216    pub previous_digest: ::core::option::Option<::prost::alloc::string::String>,
217    /// The running total gas costs of all transactions included in the current epoch so far
218    /// until this checkpoint.
219    #[prost(message, optional, tag = "8")]
220    pub epoch_rolling_gas_cost_summary: ::core::option::Option<GasCostSummary>,
221    /// Timestamp of the checkpoint - number of milliseconds from the Unix epoch
222    /// Checkpoint timestamps are monotonic, but not strongly monotonic - subsequent
223    /// checkpoints can have the same timestamp if they originate from the same underlining consensus commit.
224    #[prost(message, optional, tag = "9")]
225    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
226    /// Commitments to checkpoint-specific state.
227    #[prost(message, repeated, tag = "10")]
228    pub commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
229    /// Extra data only present in the final checkpoint of an epoch.
230    #[prost(message, optional, tag = "11")]
231    pub end_of_epoch_data: ::core::option::Option<EndOfEpochData>,
232    /// `CheckpointSummary` is not an evolvable structure - it must be readable by any version of
233    /// the code. Therefore, to allow extensions to be added to `CheckpointSummary`,
234    /// opaque data can be added to checkpoints, which can be deserialized based on the current
235    /// protocol version.
236    #[prost(bytes = "bytes", optional, tag = "12")]
237    pub version_specific_data: ::core::option::Option<::prost::bytes::Bytes>,
238}
239/// Data, which when included in a `CheckpointSummary`, signals the end of an `Epoch`.
240#[non_exhaustive]
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct EndOfEpochData {
243    /// The set of validators that will be in the `ValidatorCommittee` for the next epoch.
244    #[prost(message, repeated, tag = "1")]
245    pub next_epoch_committee: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
246    /// The protocol version that is in effect during the next epoch.
247    #[prost(uint64, optional, tag = "2")]
248    pub next_epoch_protocol_version: ::core::option::Option<u64>,
249    /// Commitments to epoch specific state (live object set)
250    #[prost(message, repeated, tag = "3")]
251    pub epoch_commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
252}
253/// A commitment made by a checkpoint.
254#[non_exhaustive]
255#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
256pub struct CheckpointCommitment {
257    #[prost(
258        enumeration = "checkpoint_commitment::CheckpointCommitmentKind",
259        optional,
260        tag = "1"
261    )]
262    pub kind: ::core::option::Option<i32>,
263    #[prost(string, optional, tag = "2")]
264    pub digest: ::core::option::Option<::prost::alloc::string::String>,
265}
266/// Nested message and enum types in `CheckpointCommitment`.
267pub mod checkpoint_commitment {
268    #[non_exhaustive]
269    #[derive(
270        Clone,
271        Copy,
272        Debug,
273        PartialEq,
274        Eq,
275        Hash,
276        PartialOrd,
277        Ord,
278        ::prost::Enumeration
279    )]
280    #[repr(i32)]
281    pub enum CheckpointCommitmentKind {
282        Unknown = 0,
283        /// An elliptic curve multiset hash attesting to the set of objects that
284        /// comprise the live state of the Sui blockchain.
285        EcmhLiveObjectSet = 1,
286        /// Digest of the checkpoint artifacts.
287        CheckpointArtifacts = 2,
288    }
289    impl CheckpointCommitmentKind {
290        /// String value of the enum field names used in the ProtoBuf definition.
291        ///
292        /// The values are not transformed in any way and thus are considered stable
293        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
294        pub fn as_str_name(&self) -> &'static str {
295            match self {
296                Self::Unknown => "CHECKPOINT_COMMITMENT_KIND_UNKNOWN",
297                Self::EcmhLiveObjectSet => "ECMH_LIVE_OBJECT_SET",
298                Self::CheckpointArtifacts => "CHECKPOINT_ARTIFACTS",
299            }
300        }
301        /// Creates an enum from field names used in the ProtoBuf definition.
302        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
303            match value {
304                "CHECKPOINT_COMMITMENT_KIND_UNKNOWN" => Some(Self::Unknown),
305                "ECMH_LIVE_OBJECT_SET" => Some(Self::EcmhLiveObjectSet),
306                "CHECKPOINT_ARTIFACTS" => Some(Self::CheckpointArtifacts),
307                _ => None,
308            }
309        }
310    }
311}
312/// The effects of executing a transaction.
313#[non_exhaustive]
314#[derive(Clone, PartialEq, ::prost::Message)]
315pub struct TransactionEffects {
316    /// This TransactionEffects serialized as BCS.
317    #[prost(message, optional, tag = "1")]
318    pub bcs: ::core::option::Option<Bcs>,
319    /// The digest of this TransactionEffects.
320    #[prost(string, optional, tag = "2")]
321    pub digest: ::core::option::Option<::prost::alloc::string::String>,
322    /// Version of this TransactionEffects.
323    #[prost(int32, optional, tag = "3")]
324    pub version: ::core::option::Option<i32>,
325    /// The status of the execution.
326    #[prost(message, optional, tag = "4")]
327    pub status: ::core::option::Option<ExecutionStatus>,
328    /// The epoch when this transaction was executed.
329    #[prost(uint64, optional, tag = "5")]
330    pub epoch: ::core::option::Option<u64>,
331    /// The gas used by this transaction.
332    #[prost(message, optional, tag = "6")]
333    pub gas_used: ::core::option::Option<GasCostSummary>,
334    /// The transaction digest.
335    #[prost(string, optional, tag = "7")]
336    pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
337    /// Information about the gas object. Also present in the `changed_objects` vector.
338    ///
339    /// System transactions that don't require gas will leave this as `None`.
340    #[prost(message, optional, tag = "8")]
341    pub gas_object: ::core::option::Option<ChangedObject>,
342    /// The digest of the events emitted during execution,
343    /// can be `None` if the transaction does not emit any event.
344    #[prost(string, optional, tag = "9")]
345    pub events_digest: ::core::option::Option<::prost::alloc::string::String>,
346    /// The set of transaction digests this transaction depends on.
347    #[prost(string, repeated, tag = "10")]
348    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
349    /// The version number of all the written objects (excluding packages) by this transaction.
350    #[prost(uint64, optional, tag = "11")]
351    pub lamport_version: ::core::option::Option<u64>,
352    /// Objects whose state are changed by this transaction.
353    #[prost(message, repeated, tag = "12")]
354    pub changed_objects: ::prost::alloc::vec::Vec<ChangedObject>,
355    /// Consensus objects that are not mutated in this transaction. Unlike owned objects,
356    /// read-only consensus objects' version are not committed in the transaction,
357    /// and in order for a node to catch up and execute it without consensus sequencing,
358    /// the version needs to be committed in the effects.
359    #[prost(message, repeated, tag = "13")]
360    pub unchanged_consensus_objects: ::prost::alloc::vec::Vec<UnchangedConsensusObject>,
361    /// Auxiliary data that are not protocol-critical, generated as part of the effects but are stored separately.
362    /// Storing it separately allows us to avoid bloating the effects with data that are not critical.
363    /// It also provides more flexibility on the format and type of the data.
364    #[prost(string, optional, tag = "14")]
365    pub auxiliary_data_digest: ::core::option::Option<::prost::alloc::string::String>,
366    #[prost(message, repeated, tag = "15")]
367    pub unchanged_loaded_runtime_objects: ::prost::alloc::vec::Vec<ObjectReference>,
368}
369/// Input/output state of an object that was changed during execution.
370#[non_exhaustive]
371#[derive(Clone, PartialEq, ::prost::Message)]
372pub struct ChangedObject {
373    /// ID of the object.
374    #[prost(string, optional, tag = "1")]
375    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
376    #[prost(enumeration = "changed_object::InputObjectState", optional, tag = "2")]
377    pub input_state: ::core::option::Option<i32>,
378    /// Version of the object before this transaction executed.
379    #[prost(uint64, optional, tag = "3")]
380    pub input_version: ::core::option::Option<u64>,
381    /// Digest of the object before this transaction executed.
382    #[prost(string, optional, tag = "4")]
383    pub input_digest: ::core::option::Option<::prost::alloc::string::String>,
384    /// Owner of the object before this transaction executed.
385    #[prost(message, optional, tag = "5")]
386    pub input_owner: ::core::option::Option<Owner>,
387    #[prost(enumeration = "changed_object::OutputObjectState", optional, tag = "6")]
388    pub output_state: ::core::option::Option<i32>,
389    /// Version of the object after this transaction executed.
390    #[prost(uint64, optional, tag = "7")]
391    pub output_version: ::core::option::Option<u64>,
392    /// Digest of the object after this transaction executed.
393    #[prost(string, optional, tag = "8")]
394    pub output_digest: ::core::option::Option<::prost::alloc::string::String>,
395    /// Owner of the object after this transaction executed.
396    #[prost(message, optional, tag = "9")]
397    pub output_owner: ::core::option::Option<Owner>,
398    /// The contents of the accumulator write when `output_state` is `OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE`
399    #[prost(message, optional, tag = "12")]
400    pub accumulator_write: ::core::option::Option<AccumulatorWrite>,
401    /// What happened to an `ObjectId` during execution.
402    #[prost(enumeration = "changed_object::IdOperation", optional, tag = "10")]
403    pub id_operation: ::core::option::Option<i32>,
404    /// Type information is not provided by the effects structure but is instead
405    /// provided by an indexing layer
406    #[prost(string, optional, tag = "11")]
407    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
408}
409/// Nested message and enum types in `ChangedObject`.
410pub mod changed_object {
411    #[non_exhaustive]
412    #[derive(
413        Clone,
414        Copy,
415        Debug,
416        PartialEq,
417        Eq,
418        Hash,
419        PartialOrd,
420        Ord,
421        ::prost::Enumeration
422    )]
423    #[repr(i32)]
424    pub enum InputObjectState {
425        Unknown = 0,
426        DoesNotExist = 1,
427        Exists = 2,
428    }
429    impl InputObjectState {
430        /// String value of the enum field names used in the ProtoBuf definition.
431        ///
432        /// The values are not transformed in any way and thus are considered stable
433        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
434        pub fn as_str_name(&self) -> &'static str {
435            match self {
436                Self::Unknown => "INPUT_OBJECT_STATE_UNKNOWN",
437                Self::DoesNotExist => "INPUT_OBJECT_STATE_DOES_NOT_EXIST",
438                Self::Exists => "INPUT_OBJECT_STATE_EXISTS",
439            }
440        }
441        /// Creates an enum from field names used in the ProtoBuf definition.
442        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
443            match value {
444                "INPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
445                "INPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
446                "INPUT_OBJECT_STATE_EXISTS" => Some(Self::Exists),
447                _ => None,
448            }
449        }
450    }
451    #[non_exhaustive]
452    #[derive(
453        Clone,
454        Copy,
455        Debug,
456        PartialEq,
457        Eq,
458        Hash,
459        PartialOrd,
460        Ord,
461        ::prost::Enumeration
462    )]
463    #[repr(i32)]
464    pub enum OutputObjectState {
465        Unknown = 0,
466        DoesNotExist = 1,
467        ObjectWrite = 2,
468        PackageWrite = 3,
469        AccumulatorWrite = 4,
470    }
471    impl OutputObjectState {
472        /// String value of the enum field names used in the ProtoBuf definition.
473        ///
474        /// The values are not transformed in any way and thus are considered stable
475        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
476        pub fn as_str_name(&self) -> &'static str {
477            match self {
478                Self::Unknown => "OUTPUT_OBJECT_STATE_UNKNOWN",
479                Self::DoesNotExist => "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST",
480                Self::ObjectWrite => "OUTPUT_OBJECT_STATE_OBJECT_WRITE",
481                Self::PackageWrite => "OUTPUT_OBJECT_STATE_PACKAGE_WRITE",
482                Self::AccumulatorWrite => "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE",
483            }
484        }
485        /// Creates an enum from field names used in the ProtoBuf definition.
486        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
487            match value {
488                "OUTPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
489                "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
490                "OUTPUT_OBJECT_STATE_OBJECT_WRITE" => Some(Self::ObjectWrite),
491                "OUTPUT_OBJECT_STATE_PACKAGE_WRITE" => Some(Self::PackageWrite),
492                "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE" => Some(Self::AccumulatorWrite),
493                _ => None,
494            }
495        }
496    }
497    #[non_exhaustive]
498    #[derive(
499        Clone,
500        Copy,
501        Debug,
502        PartialEq,
503        Eq,
504        Hash,
505        PartialOrd,
506        Ord,
507        ::prost::Enumeration
508    )]
509    #[repr(i32)]
510    pub enum IdOperation {
511        Unknown = 0,
512        None = 1,
513        Created = 2,
514        Deleted = 3,
515    }
516    impl IdOperation {
517        /// String value of the enum field names used in the ProtoBuf definition.
518        ///
519        /// The values are not transformed in any way and thus are considered stable
520        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
521        pub fn as_str_name(&self) -> &'static str {
522            match self {
523                Self::Unknown => "ID_OPERATION_UNKNOWN",
524                Self::None => "NONE",
525                Self::Created => "CREATED",
526                Self::Deleted => "DELETED",
527            }
528        }
529        /// Creates an enum from field names used in the ProtoBuf definition.
530        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
531            match value {
532                "ID_OPERATION_UNKNOWN" => Some(Self::Unknown),
533                "NONE" => Some(Self::None),
534                "CREATED" => Some(Self::Created),
535                "DELETED" => Some(Self::Deleted),
536                _ => None,
537            }
538        }
539    }
540}
541/// An entry in an event digest accumulator value.
542#[non_exhaustive]
543#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
544pub struct EventDigestEntry {
545    /// Index of the event within its transaction.
546    #[prost(uint64, optional, tag = "1")]
547    pub event_index: ::core::option::Option<u64>,
548    /// Digest of the event.
549    #[prost(string, optional, tag = "2")]
550    pub digest: ::core::option::Option<::prost::alloc::string::String>,
551}
552#[non_exhaustive]
553#[derive(Clone, PartialEq, ::prost::Message)]
554pub struct AccumulatorWrite {
555    #[prost(string, optional, tag = "1")]
556    pub address: ::core::option::Option<::prost::alloc::string::String>,
557    #[prost(string, optional, tag = "2")]
558    pub accumulator_type: ::core::option::Option<::prost::alloc::string::String>,
559    #[prost(
560        enumeration = "accumulator_write::AccumulatorOperation",
561        optional,
562        tag = "3"
563    )]
564    pub operation: ::core::option::Option<i32>,
565    #[prost(enumeration = "accumulator_write::AccumulatorValue", optional, tag = "4")]
566    pub value_kind: ::core::option::Option<i32>,
567    /// Set when the accumulator value is an integer (value_kind = INTEGER).
568    #[prost(uint64, optional, tag = "5")]
569    pub integer_value: ::core::option::Option<u64>,
570    /// Set, with len 2, when the accumulator value is an integer tuple
571    /// (value_kind = INTEGER_TUPLE).
572    #[prost(uint64, repeated, tag = "6")]
573    pub integer_tuple: ::prost::alloc::vec::Vec<u64>,
574    /// Set when the accumulator value is an event digest list (value_kind = EVENT_DIGEST).
575    /// Contains a non-empty list of (event_index, digest) pairs representing
576    /// authenticated event stream entries within a transaction.
577    #[prost(message, repeated, tag = "7")]
578    pub event_digest_value: ::prost::alloc::vec::Vec<EventDigestEntry>,
579}
580/// Nested message and enum types in `AccumulatorWrite`.
581pub mod accumulator_write {
582    #[non_exhaustive]
583    #[derive(
584        Clone,
585        Copy,
586        Debug,
587        PartialEq,
588        Eq,
589        Hash,
590        PartialOrd,
591        Ord,
592        ::prost::Enumeration
593    )]
594    #[repr(i32)]
595    pub enum AccumulatorOperation {
596        Unknown = 0,
597        Merge = 1,
598        Split = 2,
599    }
600    impl AccumulatorOperation {
601        /// String value of the enum field names used in the ProtoBuf definition.
602        ///
603        /// The values are not transformed in any way and thus are considered stable
604        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
605        pub fn as_str_name(&self) -> &'static str {
606            match self {
607                Self::Unknown => "ACCUMULATOR_OPERATION_UNKNOWN",
608                Self::Merge => "MERGE",
609                Self::Split => "SPLIT",
610            }
611        }
612        /// Creates an enum from field names used in the ProtoBuf definition.
613        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
614            match value {
615                "ACCUMULATOR_OPERATION_UNKNOWN" => Some(Self::Unknown),
616                "MERGE" => Some(Self::Merge),
617                "SPLIT" => Some(Self::Split),
618                _ => None,
619            }
620        }
621    }
622    #[non_exhaustive]
623    #[derive(
624        Clone,
625        Copy,
626        Debug,
627        PartialEq,
628        Eq,
629        Hash,
630        PartialOrd,
631        Ord,
632        ::prost::Enumeration
633    )]
634    #[repr(i32)]
635    pub enum AccumulatorValue {
636        Unknown = 0,
637        Integer = 1,
638        IntegerTuple = 2,
639        EventDigest = 3,
640    }
641    impl AccumulatorValue {
642        /// String value of the enum field names used in the ProtoBuf definition.
643        ///
644        /// The values are not transformed in any way and thus are considered stable
645        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
646        pub fn as_str_name(&self) -> &'static str {
647            match self {
648                Self::Unknown => "ACCUMULATOR_VALUE_UNKNOWN",
649                Self::Integer => "INTEGER",
650                Self::IntegerTuple => "INTEGER_TUPLE",
651                Self::EventDigest => "EVENT_DIGEST",
652            }
653        }
654        /// Creates an enum from field names used in the ProtoBuf definition.
655        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
656            match value {
657                "ACCUMULATOR_VALUE_UNKNOWN" => Some(Self::Unknown),
658                "INTEGER" => Some(Self::Integer),
659                "INTEGER_TUPLE" => Some(Self::IntegerTuple),
660                "EVENT_DIGEST" => Some(Self::EventDigest),
661                _ => None,
662            }
663        }
664    }
665}
666/// A consensus object that wasn't changed during execution.
667#[non_exhaustive]
668#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
669pub struct UnchangedConsensusObject {
670    #[prost(
671        enumeration = "unchanged_consensus_object::UnchangedConsensusObjectKind",
672        optional,
673        tag = "1"
674    )]
675    pub kind: ::core::option::Option<i32>,
676    /// ObjectId of the consensus object.
677    #[prost(string, optional, tag = "2")]
678    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
679    /// Version of the consensus object.
680    #[prost(uint64, optional, tag = "3")]
681    pub version: ::core::option::Option<u64>,
682    /// Digest of the consensus object.
683    #[prost(string, optional, tag = "4")]
684    pub digest: ::core::option::Option<::prost::alloc::string::String>,
685    /// Type information is not provided by the effects structure but is instead
686    /// provided by an indexing layer
687    #[prost(string, optional, tag = "5")]
688    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
689}
690/// Nested message and enum types in `UnchangedConsensusObject`.
691pub mod unchanged_consensus_object {
692    #[non_exhaustive]
693    #[derive(
694        Clone,
695        Copy,
696        Debug,
697        PartialEq,
698        Eq,
699        Hash,
700        PartialOrd,
701        Ord,
702        ::prost::Enumeration
703    )]
704    #[repr(i32)]
705    pub enum UnchangedConsensusObjectKind {
706        Unknown = 0,
707        /// Read-only consensus object from the input.
708        ReadOnlyRoot = 1,
709        /// Objects with ended consensus streams that appear mutably/owned in the input.
710        MutateConsensusStreamEnded = 2,
711        /// Objects with ended consensus streams objects that appear as read-only in the input.
712        ReadConsensusStreamEnded = 3,
713        /// Consensus objects that were congested and resulted in this transaction being
714        /// canceled.
715        Canceled = 4,
716        /// Read of a per-epoch config object that should remain the same during an
717        /// epoch. This optionally will indicate the sequence number of the config
718        /// object at the start of the epoch.
719        PerEpochConfig = 5,
720    }
721    impl UnchangedConsensusObjectKind {
722        /// String value of the enum field names used in the ProtoBuf definition.
723        ///
724        /// The values are not transformed in any way and thus are considered stable
725        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
726        pub fn as_str_name(&self) -> &'static str {
727            match self {
728                Self::Unknown => "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN",
729                Self::ReadOnlyRoot => "READ_ONLY_ROOT",
730                Self::MutateConsensusStreamEnded => "MUTATE_CONSENSUS_STREAM_ENDED",
731                Self::ReadConsensusStreamEnded => "READ_CONSENSUS_STREAM_ENDED",
732                Self::Canceled => "CANCELED",
733                Self::PerEpochConfig => "PER_EPOCH_CONFIG",
734            }
735        }
736        /// Creates an enum from field names used in the ProtoBuf definition.
737        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
738            match value {
739                "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN" => Some(Self::Unknown),
740                "READ_ONLY_ROOT" => Some(Self::ReadOnlyRoot),
741                "MUTATE_CONSENSUS_STREAM_ENDED" => Some(Self::MutateConsensusStreamEnded),
742                "READ_CONSENSUS_STREAM_ENDED" => Some(Self::ReadConsensusStreamEnded),
743                "CANCELED" => Some(Self::Canceled),
744                "PER_EPOCH_CONFIG" => Some(Self::PerEpochConfig),
745                _ => None,
746            }
747        }
748    }
749}
750#[non_exhaustive]
751#[derive(Clone, PartialEq, ::prost::Message)]
752pub struct Epoch {
753    #[prost(uint64, optional, tag = "1")]
754    pub epoch: ::core::option::Option<u64>,
755    /// The committee governing this epoch.
756    #[prost(message, optional, tag = "2")]
757    pub committee: ::core::option::Option<ValidatorCommittee>,
758    /// Snapshot of Sui's SystemState (`0x3::sui_system::SystemState`) at the
759    /// beginning of the epoch, for past epochs, or the current state for the
760    /// current epoch.
761    #[prost(message, optional, boxed, tag = "3")]
762    pub system_state: ::core::option::Option<::prost::alloc::boxed::Box<SystemState>>,
763    #[prost(uint64, optional, tag = "4")]
764    pub first_checkpoint: ::core::option::Option<u64>,
765    #[prost(uint64, optional, tag = "5")]
766    pub last_checkpoint: ::core::option::Option<u64>,
767    #[prost(message, optional, tag = "6")]
768    pub start: ::core::option::Option<::prost_types::Timestamp>,
769    #[prost(message, optional, tag = "7")]
770    pub end: ::core::option::Option<::prost_types::Timestamp>,
771    /// Reference gas price denominated in MIST
772    #[prost(uint64, optional, tag = "8")]
773    pub reference_gas_price: ::core::option::Option<u64>,
774    #[prost(message, optional, tag = "9")]
775    pub protocol_config: ::core::option::Option<ProtocolConfig>,
776}
777#[non_exhaustive]
778#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
779#[repr(i32)]
780pub enum ErrorReason {
781    Unknown = 0,
782    FieldInvalid = 1,
783    FieldMissing = 2,
784}
785impl ErrorReason {
786    /// String value of the enum field names used in the ProtoBuf definition.
787    ///
788    /// The values are not transformed in any way and thus are considered stable
789    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
790    pub fn as_str_name(&self) -> &'static str {
791        match self {
792            Self::Unknown => "ERROR_REASON_UNKNOWN",
793            Self::FieldInvalid => "FIELD_INVALID",
794            Self::FieldMissing => "FIELD_MISSING",
795        }
796    }
797    /// Creates an enum from field names used in the ProtoBuf definition.
798    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
799        match value {
800            "ERROR_REASON_UNKNOWN" => Some(Self::Unknown),
801            "FIELD_INVALID" => Some(Self::FieldInvalid),
802            "FIELD_MISSING" => Some(Self::FieldMissing),
803            _ => None,
804        }
805    }
806}
807/// Events emitted during the successful execution of a transaction.
808#[non_exhaustive]
809#[derive(Clone, PartialEq, ::prost::Message)]
810pub struct TransactionEvents {
811    /// This TransactionEvents serialized as BCS.
812    #[prost(message, optional, tag = "1")]
813    pub bcs: ::core::option::Option<Bcs>,
814    /// The digest of this TransactionEvents.
815    #[prost(string, optional, tag = "2")]
816    pub digest: ::core::option::Option<::prost::alloc::string::String>,
817    /// Set of events emitted by a transaction.
818    #[prost(message, repeated, tag = "3")]
819    pub events: ::prost::alloc::vec::Vec<Event>,
820}
821/// An event.
822#[non_exhaustive]
823#[derive(Clone, PartialEq, ::prost::Message)]
824pub struct Event {
825    /// Package ID of the top-level function invoked by a `MoveCall` command that triggered this
826    /// event to be emitted.
827    #[prost(string, optional, tag = "1")]
828    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
829    /// Module name of the top-level function invoked by a `MoveCall` command that triggered this
830    /// event to be emitted.
831    #[prost(string, optional, tag = "2")]
832    pub module: ::core::option::Option<::prost::alloc::string::String>,
833    /// Address of the account that sent the transaction where this event was emitted.
834    #[prost(string, optional, tag = "3")]
835    pub sender: ::core::option::Option<::prost::alloc::string::String>,
836    /// The type of the event emitted.
837    #[prost(string, optional, tag = "4")]
838    pub event_type: ::core::option::Option<::prost::alloc::string::String>,
839    /// BCS serialized bytes of the event.
840    #[prost(message, optional, tag = "5")]
841    pub contents: ::core::option::Option<Bcs>,
842    /// JSON rendering of the event.
843    #[prost(message, optional, boxed, tag = "6")]
844    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
845    /// The sequence number of the checkpoint that includes the transaction
846    /// that emitted this event. Populated when the event is delivered on its
847    /// own (for example via `LedgerService.ListEvents`); left unset when the
848    /// event is carried inside its transaction's `events` list, where the
849    /// enclosing `ExecutedTransaction` already provides this context.
850    #[prost(uint64, optional, tag = "7")]
851    pub checkpoint: ::core::option::Option<u64>,
852    /// The digest of the transaction that emitted this event.
853    #[prost(string, optional, tag = "8")]
854    pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
855    /// Zero-based position of the emitting transaction within its containing
856    /// checkpoint. For clients verifying authenticated event streams this
857    /// index is part of the BCS-encoded `EventCommitment` leaf used to
858    /// construct the per-checkpoint merkle root.
859    #[prost(uint64, optional, tag = "9")]
860    pub transaction_index: ::core::option::Option<u64>,
861    /// Zero-based index of this event within its transaction's event list.
862    #[prost(uint32, optional, tag = "10")]
863    pub event_index: ::core::option::Option<u32>,
864}
865#[non_exhaustive]
866#[derive(Clone, PartialEq, ::prost::Message)]
867pub struct ExecutedTransaction {
868    /// The digest of this Transaction.
869    #[prost(string, optional, tag = "1")]
870    pub digest: ::core::option::Option<::prost::alloc::string::String>,
871    /// The transaction itself.
872    #[prost(message, optional, tag = "2")]
873    pub transaction: ::core::option::Option<Transaction>,
874    /// List of user signatures that are used to authorize the
875    /// execution of this transaction.
876    #[prost(message, repeated, tag = "3")]
877    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
878    /// The `TransactionEffects` for this transaction.
879    #[prost(message, optional, tag = "4")]
880    pub effects: ::core::option::Option<TransactionEffects>,
881    /// The `TransactionEvents` for this transaction.
882    ///
883    /// This field might be empty, even if it was explicitly requested, if the
884    /// transaction didn't produce any events.
885    /// `sui.types.TransactionEffects.events_digest` is populated if the
886    /// transaction produced any events.
887    #[prost(message, optional, tag = "5")]
888    pub events: ::core::option::Option<TransactionEvents>,
889    /// The sequence number for the checkpoint that includes this transaction.
890    #[prost(uint64, optional, tag = "6")]
891    pub checkpoint: ::core::option::Option<u64>,
892    /// The Unix timestamp of the checkpoint that includes this transaction.
893    #[prost(message, optional, tag = "7")]
894    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
895    #[prost(message, repeated, tag = "8")]
896    pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
897    /// Set of objects either referenced as inputs or produced as
898    /// outputs from this Transaction.
899    #[prost(message, optional, tag = "9")]
900    pub objects: ::core::option::Option<ObjectSet>,
901    /// Zero-based position of this transaction within the checkpoint that
902    /// includes it.
903    #[prost(uint64, optional, tag = "10")]
904    pub transaction_index: ::core::option::Option<u64>,
905}
906/// The status of an executed transaction.
907#[non_exhaustive]
908#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
909pub struct ExecutionStatus {
910    /// Indicates if the transaction was successful or not.
911    #[prost(bool, optional, tag = "1")]
912    pub success: ::core::option::Option<bool>,
913    /// The error if `success` is false.
914    #[prost(message, optional, tag = "2")]
915    pub error: ::core::option::Option<ExecutionError>,
916}
917/// An error that can occur during the execution of a transaction.
918#[non_exhaustive]
919#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
920pub struct ExecutionError {
921    /// A human readable description of the error
922    #[prost(string, optional, tag = "1")]
923    pub description: ::core::option::Option<::prost::alloc::string::String>,
924    /// The command, if any, during which the error occurred.
925    #[prost(uint64, optional, tag = "2")]
926    pub command: ::core::option::Option<u64>,
927    #[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
928    pub kind: ::core::option::Option<i32>,
929    #[prost(
930        oneof = "execution_error::ErrorDetails",
931        tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
932    )]
933    pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
934}
935/// Nested message and enum types in `ExecutionError`.
936pub mod execution_error {
937    #[non_exhaustive]
938    #[derive(
939        Clone,
940        Copy,
941        Debug,
942        PartialEq,
943        Eq,
944        Hash,
945        PartialOrd,
946        Ord,
947        ::prost::Enumeration
948    )]
949    #[repr(i32)]
950    pub enum ExecutionErrorKind {
951        Unknown = 0,
952        /// Insufficient gas.
953        InsufficientGas = 1,
954        /// Invalid `Gas` object.
955        InvalidGasObject = 2,
956        /// Invariant violation.
957        InvariantViolation = 3,
958        /// Attempted to use feature that is not supported yet.
959        FeatureNotYetSupported = 4,
960        /// Move object is larger than the maximum allowed size.
961        ObjectTooBig = 5,
962        /// Package is larger than the maximum allowed size.
963        PackageTooBig = 6,
964        /// Circular object ownership.
965        CircularObjectOwnership = 7,
966        /// Insufficient coin balance for requested operation.
967        InsufficientCoinBalance = 8,
968        /// Coin balance overflowed an u64.
969        CoinBalanceOverflow = 9,
970        /// Publish error, non-zero address.
971        /// The modules in the package must have their self-addresses set to zero.
972        PublishErrorNonZeroAddress = 10,
973        /// Sui Move bytecode verification error.
974        SuiMoveVerificationError = 11,
975        /// Error from a non-abort instruction.
976        /// Possible causes:
977        /// Arithmetic error, stack overflow, max value depth, or similar.
978        MovePrimitiveRuntimeError = 12,
979        /// Move runtime abort.
980        MoveAbort = 13,
981        /// Bytecode verification error.
982        VmVerificationOrDeserializationError = 14,
983        /// MoveVm invariant violation.
984        VmInvariantViolation = 15,
985        /// Function not found.
986        FunctionNotFound = 16,
987        /// Parity mismatch for Move function.
988        /// The number of arguments does not match the number of parameters.
989        ArityMismatch = 17,
990        /// Type parity mismatch for Move function.
991        /// Mismatch between the number of actual versus expected type arguments.
992        TypeArityMismatch = 18,
993        /// Non-entry function invoked. Move Call must start with an entry function.
994        NonEntryFunctionInvoked = 19,
995        /// Invalid command argument.
996        CommandArgumentError = 20,
997        /// Type argument error.
998        TypeArgumentError = 21,
999        /// Unused result without the drop ability.
1000        UnusedValueWithoutDrop = 22,
1001        /// Invalid public Move function signature.
1002        /// Unsupported return type for return value.
1003        InvalidPublicFunctionReturnType = 23,
1004        /// Invalid transfer object, object does not have public transfer.
1005        InvalidTransferObject = 24,
1006        /// Effects from the transaction are too large.
1007        EffectsTooLarge = 25,
1008        /// Publish or Upgrade is missing dependency.
1009        PublishUpgradeMissingDependency = 26,
1010        /// Publish or upgrade dependency downgrade.
1011        ///
1012        /// Indirect (transitive) dependency of published or upgraded package has been assigned an
1013        /// on-chain version that is less than the version required by one of the package's
1014        /// transitive dependencies.
1015        PublishUpgradeDependencyDowngrade = 27,
1016        /// Invalid package upgrade.
1017        PackageUpgradeError = 28,
1018        /// Indicates the transaction tried to write objects too large to storage.
1019        WrittenObjectsTooLarge = 29,
1020        /// Certificate is on the deny list.
1021        CertificateDenied = 30,
1022        /// Sui Move bytecode verification timed out.
1023        SuiMoveVerificationTimedout = 31,
1024        /// The requested consensus object operation is not allowed.
1025        ConsensusObjectOperationNotAllowed = 32,
1026        /// Requested consensus object has been deleted.
1027        InputObjectDeleted = 33,
1028        /// Certificate is canceled due to congestion on consensus objects.
1029        ExecutionCanceledDueToConsensusObjectCongestion = 34,
1030        /// Address is denied for this coin type.
1031        AddressDeniedForCoin = 35,
1032        /// Coin type is globally paused for use.
1033        CoinTypeGlobalPause = 36,
1034        /// Certificate is canceled because randomness could not be generated this epoch.
1035        ExecutionCanceledDueToRandomnessUnavailable = 37,
1036        /// Move vector element (passed to MakeMoveVec) with size {value_size} is larger
1037        /// than the maximum size {max_scaled_size}. Note that this maximum is scaled based on the
1038        /// type of the vector element.
1039        MoveVectorElemTooBig = 38,
1040        /// Move value (possibly an upgrade ticket or a dev-inspect value) with size {value_size}
1041        /// is larger than the maximum size  {max_scaled_size}. Note that this maximum is scaled based
1042        /// on the type of the value.
1043        MoveRawValueTooBig = 39,
1044        /// A valid linkage was unable to be determined for the transaction or one of its commands.
1045        InvalidLinkage = 40,
1046        /// Insufficient funds for transaction withdrawal
1047        InsufficientFundsForWithdraw = 41,
1048        /// An input object with non-exclusive write mutability was modified
1049        NonExclusiveWriteInputObjectModified = 42,
1050    }
1051    impl ExecutionErrorKind {
1052        /// String value of the enum field names used in the ProtoBuf definition.
1053        ///
1054        /// The values are not transformed in any way and thus are considered stable
1055        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1056        pub fn as_str_name(&self) -> &'static str {
1057            match self {
1058                Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
1059                Self::InsufficientGas => "INSUFFICIENT_GAS",
1060                Self::InvalidGasObject => "INVALID_GAS_OBJECT",
1061                Self::InvariantViolation => "INVARIANT_VIOLATION",
1062                Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
1063                Self::ObjectTooBig => "OBJECT_TOO_BIG",
1064                Self::PackageTooBig => "PACKAGE_TOO_BIG",
1065                Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
1066                Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
1067                Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
1068                Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
1069                Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
1070                Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
1071                Self::MoveAbort => "MOVE_ABORT",
1072                Self::VmVerificationOrDeserializationError => {
1073                    "VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
1074                }
1075                Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
1076                Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
1077                Self::ArityMismatch => "ARITY_MISMATCH",
1078                Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
1079                Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
1080                Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
1081                Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
1082                Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
1083                Self::InvalidPublicFunctionReturnType => {
1084                    "INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
1085                }
1086                Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1087                Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
1088                Self::PublishUpgradeMissingDependency => {
1089                    "PUBLISH_UPGRADE_MISSING_DEPENDENCY"
1090                }
1091                Self::PublishUpgradeDependencyDowngrade => {
1092                    "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
1093                }
1094                Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
1095                Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
1096                Self::CertificateDenied => "CERTIFICATE_DENIED",
1097                Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
1098                Self::ConsensusObjectOperationNotAllowed => {
1099                    "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1100                }
1101                Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
1102                Self::ExecutionCanceledDueToConsensusObjectCongestion => {
1103                    "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION"
1104                }
1105                Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
1106                Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
1107                Self::ExecutionCanceledDueToRandomnessUnavailable => {
1108                    "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
1109                }
1110                Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
1111                Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
1112                Self::InvalidLinkage => "INVALID_LINKAGE",
1113                Self::InsufficientFundsForWithdraw => "INSUFFICIENT_FUNDS_FOR_WITHDRAW",
1114                Self::NonExclusiveWriteInputObjectModified => {
1115                    "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED"
1116                }
1117            }
1118        }
1119        /// Creates an enum from field names used in the ProtoBuf definition.
1120        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1121            match value {
1122                "EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1123                "INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
1124                "INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
1125                "INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
1126                "FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
1127                "OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
1128                "PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
1129                "CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
1130                "INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
1131                "COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
1132                "PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
1133                    Some(Self::PublishErrorNonZeroAddress)
1134                }
1135                "SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
1136                "MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
1137                "MOVE_ABORT" => Some(Self::MoveAbort),
1138                "VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
1139                    Some(Self::VmVerificationOrDeserializationError)
1140                }
1141                "VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
1142                "FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
1143                "ARITY_MISMATCH" => Some(Self::ArityMismatch),
1144                "TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
1145                "NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
1146                "COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
1147                "TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
1148                "UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
1149                "INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
1150                    Some(Self::InvalidPublicFunctionReturnType)
1151                }
1152                "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1153                "EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
1154                "PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
1155                    Some(Self::PublishUpgradeMissingDependency)
1156                }
1157                "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
1158                    Some(Self::PublishUpgradeDependencyDowngrade)
1159                }
1160                "PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
1161                "WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
1162                "CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
1163                "SUI_MOVE_VERIFICATION_TIMEDOUT" => {
1164                    Some(Self::SuiMoveVerificationTimedout)
1165                }
1166                "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1167                    Some(Self::ConsensusObjectOperationNotAllowed)
1168                }
1169                "INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
1170                "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION" => {
1171                    Some(Self::ExecutionCanceledDueToConsensusObjectCongestion)
1172                }
1173                "ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
1174                "COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
1175                "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
1176                    Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
1177                }
1178                "MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
1179                "MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
1180                "INVALID_LINKAGE" => Some(Self::InvalidLinkage),
1181                "INSUFFICIENT_FUNDS_FOR_WITHDRAW" => {
1182                    Some(Self::InsufficientFundsForWithdraw)
1183                }
1184                "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED" => {
1185                    Some(Self::NonExclusiveWriteInputObjectModified)
1186                }
1187                _ => None,
1188            }
1189        }
1190    }
1191    #[non_exhaustive]
1192    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1193    pub enum ErrorDetails {
1194        #[prost(message, tag = "4")]
1195        Abort(super::MoveAbort),
1196        #[prost(message, tag = "5")]
1197        SizeError(super::SizeError),
1198        #[prost(message, tag = "6")]
1199        CommandArgumentError(super::CommandArgumentError),
1200        #[prost(message, tag = "7")]
1201        TypeArgumentError(super::TypeArgumentError),
1202        #[prost(message, tag = "8")]
1203        PackageUpgradeError(super::PackageUpgradeError),
1204        #[prost(message, tag = "9")]
1205        IndexError(super::IndexError),
1206        #[prost(string, tag = "10")]
1207        ObjectId(::prost::alloc::string::String),
1208        #[prost(message, tag = "11")]
1209        CoinDenyListError(super::CoinDenyListError),
1210        /// Set of objects that were congested, leading to the transaction's cancellation.
1211        #[prost(message, tag = "12")]
1212        CongestedObjects(super::CongestedObjects),
1213    }
1214}
1215#[non_exhaustive]
1216#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1217pub struct MoveAbort {
1218    #[prost(uint64, optional, tag = "1")]
1219    pub abort_code: ::core::option::Option<u64>,
1220    /// Location in Move where the error occurred.
1221    #[prost(message, optional, tag = "2")]
1222    pub location: ::core::option::Option<MoveLocation>,
1223    /// Extra error information if abort code is a "Clever Error"
1224    #[prost(message, optional, tag = "3")]
1225    pub clever_error: ::core::option::Option<CleverError>,
1226}
1227/// Location in Move bytecode where an error occurred.
1228#[non_exhaustive]
1229#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1230pub struct MoveLocation {
1231    /// The package ID.
1232    #[prost(string, optional, tag = "1")]
1233    pub package: ::core::option::Option<::prost::alloc::string::String>,
1234    /// The module name.
1235    #[prost(string, optional, tag = "2")]
1236    pub module: ::core::option::Option<::prost::alloc::string::String>,
1237    /// The function index.
1238    #[prost(uint32, optional, tag = "3")]
1239    pub function: ::core::option::Option<u32>,
1240    /// Offset of the instruction where the error occurred.
1241    #[prost(uint32, optional, tag = "4")]
1242    pub instruction: ::core::option::Option<u32>,
1243    /// The name of the function, if available.
1244    #[prost(string, optional, tag = "5")]
1245    pub function_name: ::core::option::Option<::prost::alloc::string::String>,
1246}
1247#[non_exhaustive]
1248#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1249pub struct CleverError {
1250    #[prost(uint64, optional, tag = "1")]
1251    pub error_code: ::core::option::Option<u64>,
1252    #[prost(uint64, optional, tag = "2")]
1253    pub line_number: ::core::option::Option<u64>,
1254    #[prost(string, optional, tag = "3")]
1255    pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
1256    #[prost(string, optional, tag = "4")]
1257    pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
1258    #[prost(oneof = "clever_error::Value", tags = "5, 6")]
1259    pub value: ::core::option::Option<clever_error::Value>,
1260}
1261/// Nested message and enum types in `CleverError`.
1262pub mod clever_error {
1263    #[non_exhaustive]
1264    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1265    pub enum Value {
1266        #[prost(string, tag = "5")]
1267        Rendered(::prost::alloc::string::String),
1268        #[prost(bytes, tag = "6")]
1269        Raw(::prost::bytes::Bytes),
1270    }
1271}
1272/// A size error.
1273#[non_exhaustive]
1274#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1275pub struct SizeError {
1276    /// The offending size.
1277    #[prost(uint64, optional, tag = "1")]
1278    pub size: ::core::option::Option<u64>,
1279    /// The maximum allowable size.
1280    #[prost(uint64, optional, tag = "2")]
1281    pub max_size: ::core::option::Option<u64>,
1282}
1283#[non_exhaustive]
1284#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1285pub struct IndexError {
1286    /// Index of an input or result.
1287    #[prost(uint32, optional, tag = "1")]
1288    pub index: ::core::option::Option<u32>,
1289    /// Index of a subresult.
1290    #[prost(uint32, optional, tag = "2")]
1291    pub subresult: ::core::option::Option<u32>,
1292}
1293#[non_exhaustive]
1294#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1295pub struct CoinDenyListError {
1296    /// Denied address.
1297    #[prost(string, optional, tag = "1")]
1298    pub address: ::core::option::Option<::prost::alloc::string::String>,
1299    /// Coin type.
1300    #[prost(string, optional, tag = "2")]
1301    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1302}
1303/// Set of objects that were congested, leading to the transaction's cancellation.
1304#[non_exhaustive]
1305#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1306pub struct CongestedObjects {
1307    #[prost(string, repeated, tag = "1")]
1308    pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1309}
1310/// An error with an argument to a command.
1311#[non_exhaustive]
1312#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1313pub struct CommandArgumentError {
1314    /// Position of the problematic argument.
1315    #[prost(uint32, optional, tag = "1")]
1316    pub argument: ::core::option::Option<u32>,
1317    #[prost(
1318        enumeration = "command_argument_error::CommandArgumentErrorKind",
1319        optional,
1320        tag = "2"
1321    )]
1322    pub kind: ::core::option::Option<i32>,
1323    #[prost(message, optional, tag = "3")]
1324    pub index_error: ::core::option::Option<IndexError>,
1325}
1326/// Nested message and enum types in `CommandArgumentError`.
1327pub mod command_argument_error {
1328    #[non_exhaustive]
1329    #[derive(
1330        Clone,
1331        Copy,
1332        Debug,
1333        PartialEq,
1334        Eq,
1335        Hash,
1336        PartialOrd,
1337        Ord,
1338        ::prost::Enumeration
1339    )]
1340    #[repr(i32)]
1341    pub enum CommandArgumentErrorKind {
1342        Unknown = 0,
1343        /// The type of the value does not match the expected type.
1344        TypeMismatch = 1,
1345        /// The argument cannot be deserialized into a value of the specified type.
1346        InvalidBcsBytes = 2,
1347        /// The argument cannot be instantiated from raw bytes.
1348        InvalidUsageOfPureArgument = 3,
1349        /// Invalid argument to private entry function.
1350        /// Private entry functions cannot take arguments from other Move functions.
1351        InvalidArgumentToPrivateEntryFunction = 4,
1352        /// Out of bounds access to input or results.
1353        ///
1354        /// `index` field will be set indicating the invalid index value.
1355        IndexOutOfBounds = 5,
1356        /// Out of bounds access to subresult.
1357        ///
1358        /// `index` and `subresult` fields will be set indicating the invalid index value.
1359        SecondaryIndexOutOfBounds = 6,
1360        /// Invalid usage of result.
1361        /// Expected a single result but found either no return value or multiple.
1362        /// `index` field will be set indicating the invalid index value.
1363        InvalidResultArity = 7,
1364        /// Invalid usage of gas coin.
1365        /// The gas coin can only be used by-value with a `TransferObject` command.
1366        InvalidGasCoinUsage = 8,
1367        /// Invalid usage of Move value.
1368        /// - Mutably borrowed values require unique usage.
1369        /// - Immutably borrowed values cannot be taken or borrowed mutably.
1370        /// - Taken values cannot be used again.
1371        InvalidValueUsage = 9,
1372        /// Immutable objects cannot be passed by-value.
1373        InvalidObjectByValue = 10,
1374        /// Immutable objects cannot be passed by mutable reference, `&mut`.
1375        InvalidObjectByMutRef = 11,
1376        /// Consensus object operations such as wrapping, freezing, or converting to owned are not
1377        /// allowed.
1378        ConsensusObjectOperationNotAllowed = 12,
1379        /// Invalid argument arity. Expected a single argument but found a result that expanded to
1380        /// multiple arguments.
1381        InvalidArgumentArity = 13,
1382        /// Object passed to TransferObject does not have public transfer, i.e. the `store` ability
1383        InvalidTransferObject = 14,
1384        /// First argument to MakeMoveVec is not an object. If no type is specified for MakeMoveVec,
1385        /// all arguments must be the same object type.
1386        InvalidMakeMoveVecNonObjectArgument = 15,
1387        /// Specified argument location does not have a value and cannot be used
1388        ArgumentWithoutValue = 16,
1389        /// Cannot move a borrowed value. The value's type does resulted in this argument usage being
1390        /// inferred as a move. This is likely due to the type not having the `copy` ability; although
1391        /// in rare cases, it could also be this is the last usage of a value without the `drop`
1392        /// ability.
1393        CannotMoveBorrowedValue = 17,
1394        /// Cannot write to an argument location that is still borrowed, and where that borrow is an
1395        /// extension of that reference. This is likely due to this argument being used in a Move call
1396        /// that returns a reference, and that reference is used in a later command.
1397        CannotWriteToExtendedReference = 18,
1398        /// The argument specified cannot be used as a reference argument in the Move call. Either the
1399        /// argument is a mutable reference and it conflicts with another argument to the call, or the
1400        /// argument is mutable and another reference extends it and will be used in a later command.
1401        InvalidReferenceArgument = 19,
1402        /// Invalid usage of TxContext in the function signature. TxContext can only be used by
1403        /// reference, `&TxContext` or `&mut TxContext`. If used mutably, it must be the only
1404        /// TxContext parameter, and TxContext can never be returned from a Move call.
1405        InvalidTxContext = 20,
1406    }
1407    impl CommandArgumentErrorKind {
1408        /// String value of the enum field names used in the ProtoBuf definition.
1409        ///
1410        /// The values are not transformed in any way and thus are considered stable
1411        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1412        pub fn as_str_name(&self) -> &'static str {
1413            match self {
1414                Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1415                Self::TypeMismatch => "TYPE_MISMATCH",
1416                Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1417                Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1418                Self::InvalidArgumentToPrivateEntryFunction => {
1419                    "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1420                }
1421                Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1422                Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1423                Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1424                Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1425                Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1426                Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1427                Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1428                Self::ConsensusObjectOperationNotAllowed => {
1429                    "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1430                }
1431                Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1432                Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1433                Self::InvalidMakeMoveVecNonObjectArgument => {
1434                    "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1435                }
1436                Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1437                Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1438                Self::CannotWriteToExtendedReference => {
1439                    "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1440                }
1441                Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1442                Self::InvalidTxContext => "INVALID_TX_CONTEXT",
1443            }
1444        }
1445        /// Creates an enum from field names used in the ProtoBuf definition.
1446        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1447            match value {
1448                "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1449                "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1450                "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1451                "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1452                    Some(Self::InvalidUsageOfPureArgument)
1453                }
1454                "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1455                    Some(Self::InvalidArgumentToPrivateEntryFunction)
1456                }
1457                "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1458                "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1459                "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1460                "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1461                "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1462                "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1463                "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1464                "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1465                    Some(Self::ConsensusObjectOperationNotAllowed)
1466                }
1467                "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1468                "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1469                "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1470                    Some(Self::InvalidMakeMoveVecNonObjectArgument)
1471                }
1472                "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1473                "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1474                "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1475                    Some(Self::CannotWriteToExtendedReference)
1476                }
1477                "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1478                "INVALID_TX_CONTEXT" => Some(Self::InvalidTxContext),
1479                _ => None,
1480            }
1481        }
1482    }
1483}
1484/// An error with upgrading a package.
1485#[non_exhaustive]
1486#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1487pub struct PackageUpgradeError {
1488    #[prost(
1489        enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1490        optional,
1491        tag = "1"
1492    )]
1493    pub kind: ::core::option::Option<i32>,
1494    /// The Package Id.
1495    #[prost(string, optional, tag = "2")]
1496    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1497    /// A digest.
1498    #[prost(string, optional, tag = "3")]
1499    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1500    /// The policy.
1501    #[prost(uint32, optional, tag = "4")]
1502    pub policy: ::core::option::Option<u32>,
1503    /// The ticket Id.
1504    #[prost(string, optional, tag = "5")]
1505    pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1506}
1507/// Nested message and enum types in `PackageUpgradeError`.
1508pub mod package_upgrade_error {
1509    #[non_exhaustive]
1510    #[derive(
1511        Clone,
1512        Copy,
1513        Debug,
1514        PartialEq,
1515        Eq,
1516        Hash,
1517        PartialOrd,
1518        Ord,
1519        ::prost::Enumeration
1520    )]
1521    #[repr(i32)]
1522    pub enum PackageUpgradeErrorKind {
1523        Unknown = 0,
1524        /// Unable to fetch package.
1525        UnableToFetchPackage = 1,
1526        /// Object is not a package.
1527        NotAPackage = 2,
1528        /// Package upgrade is incompatible with previous version.
1529        IncompatibleUpgrade = 3,
1530        /// Digest in upgrade ticket and computed digest differ.
1531        DigestDoesNotMatch = 4,
1532        /// Upgrade policy is not valid.
1533        UnknownUpgradePolicy = 5,
1534        /// Package ID does not match `PackageId` in upgrade ticket.
1535        PackageIdDoesNotMatch = 6,
1536    }
1537    impl PackageUpgradeErrorKind {
1538        /// String value of the enum field names used in the ProtoBuf definition.
1539        ///
1540        /// The values are not transformed in any way and thus are considered stable
1541        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1542        pub fn as_str_name(&self) -> &'static str {
1543            match self {
1544                Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1545                Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1546                Self::NotAPackage => "NOT_A_PACKAGE",
1547                Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1548                Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1549                Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1550                Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1551            }
1552        }
1553        /// Creates an enum from field names used in the ProtoBuf definition.
1554        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1555            match value {
1556                "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1557                "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1558                "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1559                "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1560                "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1561                "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1562                "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1563                _ => None,
1564            }
1565        }
1566    }
1567}
1568/// Type argument error.
1569#[non_exhaustive]
1570#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1571pub struct TypeArgumentError {
1572    /// Index of the problematic type argument.
1573    #[prost(uint32, optional, tag = "1")]
1574    pub type_argument: ::core::option::Option<u32>,
1575    #[prost(
1576        enumeration = "type_argument_error::TypeArgumentErrorKind",
1577        optional,
1578        tag = "2"
1579    )]
1580    pub kind: ::core::option::Option<i32>,
1581}
1582/// Nested message and enum types in `TypeArgumentError`.
1583pub mod type_argument_error {
1584    #[non_exhaustive]
1585    #[derive(
1586        Clone,
1587        Copy,
1588        Debug,
1589        PartialEq,
1590        Eq,
1591        Hash,
1592        PartialOrd,
1593        Ord,
1594        ::prost::Enumeration
1595    )]
1596    #[repr(i32)]
1597    pub enum TypeArgumentErrorKind {
1598        Unknown = 0,
1599        /// A type was not found in the module specified.
1600        TypeNotFound = 1,
1601        /// A type provided did not match the specified constraint.
1602        ConstraintNotSatisfied = 2,
1603    }
1604    impl TypeArgumentErrorKind {
1605        /// String value of the enum field names used in the ProtoBuf definition.
1606        ///
1607        /// The values are not transformed in any way and thus are considered stable
1608        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1609        pub fn as_str_name(&self) -> &'static str {
1610            match self {
1611                Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1612                Self::TypeNotFound => "TYPE_NOT_FOUND",
1613                Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1614            }
1615        }
1616        /// Creates an enum from field names used in the ProtoBuf definition.
1617        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1618            match value {
1619                "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1620                "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1621                "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1622                _ => None,
1623            }
1624        }
1625    }
1626}
1627/// DNF filter for transactions: any term may match, and each term is an AND
1628/// of signed literals.
1629/// An absent filter matches everything. A present filter must have at least one
1630/// term.
1631#[derive(Eq, Hash)]
1632#[non_exhaustive]
1633#[derive(Clone, PartialEq, ::prost::Message)]
1634pub struct TransactionFilter {
1635    /// Terms are ORed together.
1636    #[prost(message, repeated, tag = "1")]
1637    pub terms: ::prost::alloc::vec::Vec<TransactionTerm>,
1638}
1639/// One conjunction in a transaction DNF filter.
1640#[derive(Eq, Hash)]
1641#[non_exhaustive]
1642#[derive(Clone, PartialEq, ::prost::Message)]
1643pub struct TransactionTerm {
1644    /// Literals are ANDed together.
1645    #[prost(message, repeated, tag = "1")]
1646    pub literals: ::prost::alloc::vec::Vec<TransactionLiteral>,
1647}
1648/// One signed transaction predicate literal: a predicate, optionally negated.
1649#[non_exhaustive]
1650#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1651pub struct TransactionLiteral {
1652    /// When true, the literal matches transactions that the predicate does *not*
1653    /// match.
1654    #[prost(bool, tag = "1")]
1655    pub negated: bool,
1656    /// The transaction-index predicate to match.
1657    #[prost(oneof = "transaction_literal::Predicate", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
1658    pub predicate: ::core::option::Option<transaction_literal::Predicate>,
1659}
1660/// Nested message and enum types in `TransactionLiteral`.
1661pub mod transaction_literal {
1662    /// The transaction-index predicate to match.
1663    #[non_exhaustive]
1664    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1665    pub enum Predicate {
1666        /// Match transactions sent by the specified address.
1667        #[prost(message, tag = "2")]
1668        Sender(super::SenderFilter),
1669        /// Match transactions where the specified address's state moved as a side
1670        /// effect: it owns an object after the txn, owned an object before the
1671        /// txn that was mutated/transferred away/deleted/wrapped, or its
1672        /// address-balance changed via an accumulator event.
1673        #[prost(message, tag = "3")]
1674        AffectedAddress(super::AffectedAddressFilter),
1675        /// Match transactions whose effects include a change for the specified
1676        /// object.
1677        #[prost(message, tag = "4")]
1678        AffectedObject(super::AffectedObjectFilter),
1679        /// Match transactions that made a Move call matching the specified filter.
1680        #[prost(message, tag = "5")]
1681        MoveCall(super::MoveCallFilter),
1682        /// Match transactions that emitted an event whose package/module fields
1683        /// match the specified filter.
1684        #[prost(message, tag = "6")]
1685        EmitModule(super::EmitModuleFilter),
1686        /// Match transactions that emitted an event with a type matching the
1687        /// specified filter.
1688        #[prost(message, tag = "7")]
1689        EventType(super::EventTypeFilter),
1690        /// Match transactions that wrote to the specified authenticated event
1691        /// stream head.
1692        #[prost(message, tag = "8")]
1693        EventStreamHead(super::EventStreamHeadFilter),
1694        /// Match transactions that wrote a Move package — a first publish or an
1695        /// upgrade, of any package.
1696        #[prost(message, tag = "9")]
1697        PackageWrite(super::PackageWriteFilter),
1698    }
1699}
1700/// DNF filter for events: any term may match, and each term is an AND of
1701/// signed literals. Sender predicates match all events from matching
1702/// transactions; emit-module, event-type, and event-stream-head predicates match
1703/// individual event-space dimensions. An absent filter matches everything. A
1704/// present filter must have at least one term.
1705#[non_exhaustive]
1706#[derive(Clone, PartialEq, ::prost::Message)]
1707pub struct EventFilter {
1708    /// Terms are ORed together.
1709    #[prost(message, repeated, tag = "1")]
1710    pub terms: ::prost::alloc::vec::Vec<EventTerm>,
1711}
1712/// One conjunction in an event DNF filter.
1713#[non_exhaustive]
1714#[derive(Clone, PartialEq, ::prost::Message)]
1715pub struct EventTerm {
1716    /// Literals are ANDed together.
1717    #[prost(message, repeated, tag = "1")]
1718    pub literals: ::prost::alloc::vec::Vec<EventLiteral>,
1719}
1720/// One signed event predicate literal: a predicate, optionally negated.
1721#[non_exhaustive]
1722#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1723pub struct EventLiteral {
1724    /// When true, the literal matches events that the predicate does *not* match.
1725    #[prost(bool, tag = "1")]
1726    pub negated: bool,
1727    /// The event-index predicate to match.
1728    #[prost(oneof = "event_literal::Predicate", tags = "2, 3, 4, 5")]
1729    pub predicate: ::core::option::Option<event_literal::Predicate>,
1730}
1731/// Nested message and enum types in `EventLiteral`.
1732pub mod event_literal {
1733    /// The event-index predicate to match.
1734    #[non_exhaustive]
1735    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1736    pub enum Predicate {
1737        /// Match events from transactions sent by the specified address.
1738        #[prost(message, tag = "2")]
1739        Sender(super::SenderFilter),
1740        /// Match events whose package/module fields match the specified filter.
1741        #[prost(message, tag = "3")]
1742        EmitModule(super::EmitModuleFilter),
1743        /// Match events whose type matches the specified filter.
1744        #[prost(message, tag = "4")]
1745        EventType(super::EventTypeFilter),
1746        /// Match events committed to the specified authenticated event stream head.
1747        #[prost(message, tag = "5")]
1748        EventStreamHead(super::EventStreamHeadFilter),
1749    }
1750}
1751/// Match by transaction sender address.
1752#[non_exhaustive]
1753#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1754pub struct SenderFilter {
1755    /// The sender address (hex-encoded).
1756    #[prost(string, optional, tag = "1")]
1757    pub address: ::core::option::Option<::prost::alloc::string::String>,
1758}
1759/// Match by any address whose state moved as a side effect of the
1760/// transaction: object ownership changes (in either direction), prior
1761/// owners of removed/wrapped objects, and address-balance changes via
1762/// accumulator events.
1763#[non_exhaustive]
1764#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1765pub struct AffectedAddressFilter {
1766    /// The affected address (hex-encoded).
1767    #[prost(string, optional, tag = "1")]
1768    pub address: ::core::option::Option<::prost::alloc::string::String>,
1769}
1770/// Match by changed object ID.
1771#[non_exhaustive]
1772#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1773pub struct AffectedObjectFilter {
1774    /// The changed object ID (hex-encoded).
1775    #[prost(string, optional, tag = "1")]
1776    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1777}
1778/// Match by Move function call, specified as a `::`-delimited Move path.
1779///
1780/// Specificity levels:
1781/// "0xpkg"                        -> matches any call in the package
1782/// "0xpkg::module"                -> matches any call in the module
1783/// "0xpkg::module::function"      -> matches calls to the exact function
1784#[non_exhaustive]
1785#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1786pub struct MoveCallFilter {
1787    /// Required. Move path of the form `package\[::module[::function]\]`.
1788    #[prost(string, optional, tag = "1")]
1789    pub function: ::core::option::Option<::prost::alloc::string::String>,
1790}
1791/// Match by an event's package/module fields, specified as a `::`-delimited
1792/// Move path. These identify the top-level Move call that triggered the event.
1793///
1794/// Specificity levels:
1795/// "0xpkg"               -> matches events with this package_id
1796/// "0xpkg::module"       -> matches events with this package_id and module
1797#[non_exhaustive]
1798#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1799pub struct EmitModuleFilter {
1800    /// Required. Move path of the form `package\[::module\]`.
1801    #[prost(string, optional, tag = "1")]
1802    pub module: ::core::option::Option<::prost::alloc::string::String>,
1803}
1804/// Match by event struct type, specified as a Move type string.
1805///
1806/// Specificity levels:
1807/// "0xaddr"                              -> matches events whose type is defined at this address
1808/// "0xaddr::module"                      -> matches events whose type is in this module
1809/// "0xaddr::module::Name"                -> matches events with this type name (any instantiation)
1810/// "0xaddr::module::Name\<T1, T2>"        -> matches events with this exact generic instantiation
1811#[non_exhaustive]
1812#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1813pub struct EventTypeFilter {
1814    /// Required. Move type string of the form
1815    /// `address\[::module[::Name[<type_params>]\]]`.
1816    #[prost(string, optional, tag = "1")]
1817    pub event_type: ::core::option::Option<::prost::alloc::string::String>,
1818}
1819/// Match by authenticated event stream head.
1820#[non_exhaustive]
1821#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1822pub struct EventStreamHeadFilter {
1823    /// The stream id address (hex-encoded).
1824    #[prost(string, optional, tag = "1")]
1825    pub stream_id: ::core::option::Option<::prost::alloc::string::String>,
1826}
1827/// Match transactions that wrote a Move package.
1828#[non_exhaustive]
1829#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1830pub struct PackageWriteFilter {}
1831/// Summary of gas charges.
1832#[non_exhaustive]
1833#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1834pub struct GasCostSummary {
1835    /// Cost of computation/execution.
1836    #[prost(uint64, optional, tag = "1")]
1837    pub computation_cost: ::core::option::Option<u64>,
1838    /// Storage cost, it's the sum of all storage cost for all objects created or mutated.
1839    #[prost(uint64, optional, tag = "2")]
1840    pub storage_cost: ::core::option::Option<u64>,
1841    /// The amount of storage cost refunded to the user for all objects deleted or mutated in the
1842    /// transaction.
1843    #[prost(uint64, optional, tag = "3")]
1844    pub storage_rebate: ::core::option::Option<u64>,
1845    /// The fee for the rebate. The portion of the storage rebate kept by the system.
1846    #[prost(uint64, optional, tag = "4")]
1847    pub non_refundable_storage_fee: ::core::option::Option<u64>,
1848}
1849/// An input to a user transaction.
1850#[non_exhaustive]
1851#[derive(Clone, PartialEq, ::prost::Message)]
1852pub struct Input {
1853    #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1854    pub kind: ::core::option::Option<i32>,
1855    /// A move value serialized as BCS.
1856    ///
1857    /// For normal operations this is required to be a move primitive type and not contain structs
1858    /// or objects.
1859    #[prost(bytes = "bytes", optional, tag = "2")]
1860    pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1861    /// `ObjectId` of the object input.
1862    #[prost(string, optional, tag = "3")]
1863    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1864    /// Requested version of the input object when `kind` is `IMMUTABLE_OR_OWNED`
1865    /// or `RECEIVING` or if `kind` is `SHARED` this is the initial version of the
1866    /// object when it was shared
1867    #[prost(uint64, optional, tag = "4")]
1868    pub version: ::core::option::Option<u64>,
1869    /// The digest of this object.
1870    #[prost(string, optional, tag = "5")]
1871    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1872    /// Controls whether the caller asks for a mutable reference to the shared
1873    /// object.
1874    #[prost(bool, optional, tag = "6")]
1875    pub mutable: ::core::option::Option<bool>,
1876    /// NOTE: For backwards compatibility purposes the addition of the new
1877    /// `NON_EXCLUSIVE_WRITE` mutability variant requires providing a new field.
1878    /// The old `mutable` field will continue to be populated and respected as an
1879    /// input for the time being.
1880    #[prost(enumeration = "input::Mutability", optional, tag = "7")]
1881    pub mutability: ::core::option::Option<i32>,
1882    /// Fund Reservation information if `kind` is `FUNDS_WITHDRAWAL`.
1883    #[prost(message, optional, tag = "8")]
1884    pub funds_withdrawal: ::core::option::Option<FundsWithdrawal>,
1885    /// A literal value
1886    ///
1887    /// INPUT ONLY
1888    #[prost(message, optional, boxed, tag = "1000")]
1889    pub literal: ::core::option::Option<
1890        ::prost::alloc::boxed::Box<::prost_types::Value>,
1891    >,
1892}
1893/// Nested message and enum types in `Input`.
1894pub mod input {
1895    #[non_exhaustive]
1896    #[derive(
1897        Clone,
1898        Copy,
1899        Debug,
1900        PartialEq,
1901        Eq,
1902        Hash,
1903        PartialOrd,
1904        Ord,
1905        ::prost::Enumeration
1906    )]
1907    #[repr(i32)]
1908    pub enum InputKind {
1909        Unknown = 0,
1910        /// A move value serialized as BCS.
1911        Pure = 1,
1912        /// A Move object that is either immutable or address owned.
1913        ImmutableOrOwned = 2,
1914        /// A Move object whose owner is "Shared".
1915        Shared = 3,
1916        /// A Move object that is attempted to be received in this transaction.
1917        Receiving = 4,
1918        /// Reservation to withdraw balance from a funds accumulator
1919        FundsWithdrawal = 5,
1920    }
1921    impl InputKind {
1922        /// String value of the enum field names used in the ProtoBuf definition.
1923        ///
1924        /// The values are not transformed in any way and thus are considered stable
1925        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1926        pub fn as_str_name(&self) -> &'static str {
1927            match self {
1928                Self::Unknown => "INPUT_KIND_UNKNOWN",
1929                Self::Pure => "PURE",
1930                Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
1931                Self::Shared => "SHARED",
1932                Self::Receiving => "RECEIVING",
1933                Self::FundsWithdrawal => "FUNDS_WITHDRAWAL",
1934            }
1935        }
1936        /// Creates an enum from field names used in the ProtoBuf definition.
1937        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1938            match value {
1939                "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
1940                "PURE" => Some(Self::Pure),
1941                "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
1942                "SHARED" => Some(Self::Shared),
1943                "RECEIVING" => Some(Self::Receiving),
1944                "FUNDS_WITHDRAWAL" => Some(Self::FundsWithdrawal),
1945                _ => None,
1946            }
1947        }
1948    }
1949    #[non_exhaustive]
1950    #[derive(
1951        Clone,
1952        Copy,
1953        Debug,
1954        PartialEq,
1955        Eq,
1956        Hash,
1957        PartialOrd,
1958        Ord,
1959        ::prost::Enumeration
1960    )]
1961    #[repr(i32)]
1962    pub enum Mutability {
1963        Unknown = 0,
1964        Immutable = 1,
1965        Mutable = 2,
1966        /// Non-exclusive write is used to allow multiple transactions to
1967        /// simultaneously add disjoint dynamic fields to an object.
1968        /// (Currently only used by settlement transactions).
1969        NonExclusiveWrite = 3,
1970    }
1971    impl Mutability {
1972        /// String value of the enum field names used in the ProtoBuf definition.
1973        ///
1974        /// The values are not transformed in any way and thus are considered stable
1975        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1976        pub fn as_str_name(&self) -> &'static str {
1977            match self {
1978                Self::Unknown => "MUTABILITY_UNKNOWN",
1979                Self::Immutable => "IMMUTABLE",
1980                Self::Mutable => "MUTABLE",
1981                Self::NonExclusiveWrite => "NON_EXCLUSIVE_WRITE",
1982            }
1983        }
1984        /// Creates an enum from field names used in the ProtoBuf definition.
1985        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1986            match value {
1987                "MUTABILITY_UNKNOWN" => Some(Self::Unknown),
1988                "IMMUTABLE" => Some(Self::Immutable),
1989                "MUTABLE" => Some(Self::Mutable),
1990                "NON_EXCLUSIVE_WRITE" => Some(Self::NonExclusiveWrite),
1991                _ => None,
1992            }
1993        }
1994    }
1995}
1996#[non_exhaustive]
1997#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1998pub struct FundsWithdrawal {
1999    #[prost(uint64, optional, tag = "1")]
2000    pub amount: ::core::option::Option<u64>,
2001    #[prost(string, optional, tag = "2")]
2002    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
2003    #[prost(enumeration = "funds_withdrawal::Source", optional, tag = "3")]
2004    pub source: ::core::option::Option<i32>,
2005    /// The address whose balance is debited if `source` is `SENDER_ALLOWANCE`.
2006    #[prost(string, optional, tag = "4")]
2007    pub funder: ::core::option::Option<::prost::alloc::string::String>,
2008    /// `ObjectId` of the allowance object authorizing the withdrawal if `source`
2009    /// is `SENDER_ALLOWANCE`.
2010    #[prost(string, optional, tag = "5")]
2011    pub allowance: ::core::option::Option<::prost::alloc::string::String>,
2012}
2013/// Nested message and enum types in `FundsWithdrawal`.
2014pub mod funds_withdrawal {
2015    #[non_exhaustive]
2016    #[derive(
2017        Clone,
2018        Copy,
2019        Debug,
2020        PartialEq,
2021        Eq,
2022        Hash,
2023        PartialOrd,
2024        Ord,
2025        ::prost::Enumeration
2026    )]
2027    #[repr(i32)]
2028    pub enum Source {
2029        Unknown = 0,
2030        Sender = 1,
2031        Sponsor = 2,
2032        /// Withdraw from `funder`'s balance under the `allowance` object, granted
2033        /// to the sender of the transaction.
2034        SenderAllowance = 3,
2035    }
2036    impl Source {
2037        /// String value of the enum field names used in the ProtoBuf definition.
2038        ///
2039        /// The values are not transformed in any way and thus are considered stable
2040        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2041        pub fn as_str_name(&self) -> &'static str {
2042            match self {
2043                Self::Unknown => "SOURCE_UNKNOWN",
2044                Self::Sender => "SENDER",
2045                Self::Sponsor => "SPONSOR",
2046                Self::SenderAllowance => "SENDER_ALLOWANCE",
2047            }
2048        }
2049        /// Creates an enum from field names used in the ProtoBuf definition.
2050        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2051            match value {
2052                "SOURCE_UNKNOWN" => Some(Self::Unknown),
2053                "SENDER" => Some(Self::Sender),
2054                "SPONSOR" => Some(Self::Sponsor),
2055                "SENDER_ALLOWANCE" => Some(Self::SenderAllowance),
2056                _ => None,
2057            }
2058        }
2059    }
2060}
2061/// Key to uniquely identify a JWK.
2062#[non_exhaustive]
2063#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2064pub struct JwkId {
2065    /// The issuer or identity of the OIDC provider.
2066    #[prost(string, optional, tag = "1")]
2067    pub iss: ::core::option::Option<::prost::alloc::string::String>,
2068    /// A key ID used to uniquely identify a key from an OIDC provider.
2069    #[prost(string, optional, tag = "2")]
2070    pub kid: ::core::option::Option<::prost::alloc::string::String>,
2071}
2072/// A JSON web key.
2073///
2074/// Struct that contains info for a JWK. A list of them for different kinds can
2075/// be retrieved from the JWK endpoint (for example, <<https://www.googleapis.com/oauth2/v3/certs>>).
2076/// The JWK is used to verify the JWT token.
2077#[non_exhaustive]
2078#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2079pub struct Jwk {
2080    /// Key type parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.1.>
2081    #[prost(string, optional, tag = "1")]
2082    pub kty: ::core::option::Option<::prost::alloc::string::String>,
2083    /// RSA public exponent, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
2084    #[prost(string, optional, tag = "2")]
2085    pub e: ::core::option::Option<::prost::alloc::string::String>,
2086    /// RSA modulus, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
2087    #[prost(string, optional, tag = "3")]
2088    pub n: ::core::option::Option<::prost::alloc::string::String>,
2089    /// Algorithm parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.4.>
2090    #[prost(string, optional, tag = "4")]
2091    pub alg: ::core::option::Option<::prost::alloc::string::String>,
2092}
2093#[non_exhaustive]
2094#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2095pub struct GetServiceInfoRequest {}
2096#[non_exhaustive]
2097#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2098pub struct GetServiceInfoResponse {
2099    /// The chain identifier of the chain that this node is on.
2100    ///
2101    /// The chain identifier is the digest of the genesis checkpoint, the
2102    /// checkpoint with sequence number 0.
2103    #[prost(string, optional, tag = "1")]
2104    pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
2105    /// Human-readable name of the chain that this node is on.
2106    ///
2107    /// This is intended to be a human-readable name like `mainnet`, `testnet`, and so on.
2108    #[prost(string, optional, tag = "2")]
2109    pub chain: ::core::option::Option<::prost::alloc::string::String>,
2110    /// Current epoch of the node based on its highest executed checkpoint.
2111    #[prost(uint64, optional, tag = "3")]
2112    pub epoch: ::core::option::Option<u64>,
2113    /// Checkpoint height of the most recently executed checkpoint.
2114    #[prost(uint64, optional, tag = "4")]
2115    pub checkpoint_height: ::core::option::Option<u64>,
2116    /// Unix timestamp of the most recently executed checkpoint.
2117    #[prost(message, optional, tag = "5")]
2118    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
2119    /// The lowest checkpoint for which checkpoints and transaction data are available.
2120    #[prost(uint64, optional, tag = "6")]
2121    pub lowest_available_checkpoint: ::core::option::Option<u64>,
2122    /// The lowest checkpoint for which object data is available.
2123    #[prost(uint64, optional, tag = "7")]
2124    pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
2125    /// Software version of the service. Similar to the `server` http header.
2126    #[prost(string, optional, tag = "8")]
2127    pub server: ::core::option::Option<::prost::alloc::string::String>,
2128}
2129#[non_exhaustive]
2130#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2131pub struct GetObjectRequest {
2132    /// Required. The `ObjectId` of the requested object.
2133    #[prost(string, optional, tag = "1")]
2134    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2135    /// Request a specific version of the object.
2136    /// If no version is specified, and the object is live, then the latest
2137    /// version of the object is returned.
2138    #[prost(uint64, optional, tag = "2")]
2139    pub version: ::core::option::Option<u64>,
2140    /// Mask specifying which fields to read.
2141    /// If no mask is specified, defaults to `object_id,version,digest`.
2142    #[prost(message, optional, tag = "3")]
2143    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2144}
2145#[non_exhaustive]
2146#[derive(Clone, PartialEq, ::prost::Message)]
2147pub struct GetObjectResponse {
2148    #[prost(message, optional, tag = "1")]
2149    pub object: ::core::option::Option<Object>,
2150}
2151#[non_exhaustive]
2152#[derive(Clone, PartialEq, ::prost::Message)]
2153pub struct BatchGetObjectsRequest {
2154    #[prost(message, repeated, tag = "1")]
2155    pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
2156    /// Mask specifying which fields to read.
2157    /// If no mask is specified, defaults to `object_id,version,digest`.
2158    #[prost(message, optional, tag = "2")]
2159    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2160}
2161#[non_exhaustive]
2162#[derive(Clone, PartialEq, ::prost::Message)]
2163pub struct BatchGetObjectsResponse {
2164    #[prost(message, repeated, tag = "1")]
2165    pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
2166}
2167#[non_exhaustive]
2168#[derive(Clone, PartialEq, ::prost::Message)]
2169pub struct GetObjectResult {
2170    #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
2171    pub result: ::core::option::Option<get_object_result::Result>,
2172}
2173/// Nested message and enum types in `GetObjectResult`.
2174pub mod get_object_result {
2175    #[non_exhaustive]
2176    #[derive(Clone, PartialEq, ::prost::Oneof)]
2177    pub enum Result {
2178        #[prost(message, tag = "1")]
2179        Object(super::Object),
2180        #[prost(message, tag = "2")]
2181        Error(super::super::super::super::google::rpc::Status),
2182    }
2183}
2184#[non_exhaustive]
2185#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2186pub struct GetTransactionRequest {
2187    /// Required. The digest of the requested transaction.
2188    #[prost(string, optional, tag = "1")]
2189    pub digest: ::core::option::Option<::prost::alloc::string::String>,
2190    /// Mask specifying which fields to read.
2191    /// If no mask is specified, defaults to `digest`.
2192    #[prost(message, optional, tag = "2")]
2193    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2194}
2195#[non_exhaustive]
2196#[derive(Clone, PartialEq, ::prost::Message)]
2197pub struct GetTransactionResponse {
2198    #[prost(message, optional, tag = "1")]
2199    pub transaction: ::core::option::Option<ExecutedTransaction>,
2200}
2201#[non_exhaustive]
2202#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2203pub struct BatchGetTransactionsRequest {
2204    /// Required. The digests of the requested transactions.
2205    #[prost(string, repeated, tag = "1")]
2206    pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2207    /// Mask specifying which fields to read.
2208    /// If no mask is specified, defaults to `digest`.
2209    #[prost(message, optional, tag = "2")]
2210    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2211}
2212#[non_exhaustive]
2213#[derive(Clone, PartialEq, ::prost::Message)]
2214pub struct BatchGetTransactionsResponse {
2215    #[prost(message, repeated, tag = "1")]
2216    pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
2217}
2218#[non_exhaustive]
2219#[derive(Clone, PartialEq, ::prost::Message)]
2220pub struct GetTransactionResult {
2221    #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
2222    pub result: ::core::option::Option<get_transaction_result::Result>,
2223}
2224/// Nested message and enum types in `GetTransactionResult`.
2225pub mod get_transaction_result {
2226    #[non_exhaustive]
2227    #[derive(Clone, PartialEq, ::prost::Oneof)]
2228    pub enum Result {
2229        #[prost(message, tag = "1")]
2230        Transaction(super::ExecutedTransaction),
2231        #[prost(message, tag = "2")]
2232        Error(super::super::super::super::google::rpc::Status),
2233    }
2234}
2235#[non_exhaustive]
2236#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2237pub struct GetCheckpointRequest {
2238    /// Mask specifying which fields to read.
2239    /// If no mask is specified, defaults to `sequence_number,digest`.
2240    #[prost(message, optional, tag = "3")]
2241    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2242    /// If neither is provided, return the latest
2243    #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
2244    pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
2245}
2246/// Nested message and enum types in `GetCheckpointRequest`.
2247pub mod get_checkpoint_request {
2248    /// If neither is provided, return the latest
2249    #[non_exhaustive]
2250    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2251    pub enum CheckpointId {
2252        /// The sequence number of the requested checkpoint.
2253        #[prost(uint64, tag = "1")]
2254        SequenceNumber(u64),
2255        /// The digest of the requested checkpoint.
2256        #[prost(string, tag = "2")]
2257        Digest(::prost::alloc::string::String),
2258    }
2259}
2260#[non_exhaustive]
2261#[derive(Clone, PartialEq, ::prost::Message)]
2262pub struct GetCheckpointResponse {
2263    #[prost(message, optional, tag = "1")]
2264    pub checkpoint: ::core::option::Option<Checkpoint>,
2265}
2266#[non_exhaustive]
2267#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2268pub struct GetEpochRequest {
2269    /// The requested epoch.
2270    /// If no epoch is provided the current epoch will be returned.
2271    #[prost(uint64, optional, tag = "1")]
2272    pub epoch: ::core::option::Option<u64>,
2273    /// Mask specifying which fields to read.
2274    /// If no mask is specified, defaults to `epoch`.
2275    #[prost(message, optional, tag = "2")]
2276    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2277}
2278#[non_exhaustive]
2279#[derive(Clone, PartialEq, ::prost::Message)]
2280pub struct GetEpochResponse {
2281    #[prost(message, optional, tag = "1")]
2282    pub epoch: ::core::option::Option<Epoch>,
2283}
2284/// Request message for LedgerService.ListCheckpoints.
2285#[non_exhaustive]
2286#[derive(Clone, PartialEq, ::prost::Message)]
2287pub struct ListCheckpointsRequest {
2288    /// Optional. Mask for specifying which parts of the Checkpoint should be
2289    /// returned (e.g. summary, contents, signatures).
2290    #[prost(message, optional, tag = "1")]
2291    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2292    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2293    /// genesis.
2294    #[prost(uint64, optional, tag = "2")]
2295    pub start_checkpoint: ::core::option::Option<u64>,
2296    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2297    /// current indexed ledger tip.
2298    #[prost(uint64, optional, tag = "3")]
2299    pub end_checkpoint: ::core::option::Option<u64>,
2300    /// Optional. DNF filter over indexed transaction dimensions. A checkpoint
2301    /// matches if any transaction it contains satisfies the filter. If absent,
2302    /// all checkpoints in the range are returned.
2303    #[prost(message, optional, tag = "4")]
2304    pub filter: ::core::option::Option<TransactionFilter>,
2305    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2306    /// order with the default item limit. The server enforces a maximum item
2307    /// limit and silently coerces larger values down to it. To paginate, pass
2308    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2309    /// `options.before` (descending) on the next request.
2310    #[prost(message, optional, tag = "5")]
2311    pub options: ::core::option::Option<QueryOptions>,
2312}
2313/// Response message for LedgerService.ListCheckpoints.
2314///
2315/// Every frame carries a `watermark` with a safe resume cursor. A frame
2316/// with `checkpoint` set delivers one matching item; a frame without it reports
2317/// scan progress or terminal completion. Watermarks never regress in the
2318/// requested ordering but may repeat.
2319///
2320/// `end` is set exactly once, on the final frame of a successful stream. For
2321/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2322/// every other end reason, the final frame has no `checkpoint` payload.
2323#[non_exhaustive]
2324#[derive(Clone, PartialEq, ::prost::Message)]
2325pub struct ListCheckpointsResponse {
2326    /// One matching checkpoint.
2327    #[prost(message, optional, tag = "1")]
2328    pub checkpoint: ::core::option::Option<Checkpoint>,
2329    /// Progress watermark as of this frame. Present on every frame. A
2330    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2331    /// its authoritative scan frontier was already emitted.
2332    #[prost(message, optional, tag = "2")]
2333    pub watermark: ::core::option::Option<Watermark>,
2334    /// Set exactly once, on the final frame of a successful query stream.
2335    #[prost(message, optional, tag = "3")]
2336    pub end: ::core::option::Option<QueryEnd>,
2337}
2338/// Request message for LedgerService.ListTransactions.
2339#[non_exhaustive]
2340#[derive(Clone, PartialEq, ::prost::Message)]
2341pub struct ListTransactionsRequest {
2342    /// Optional. Mask for specifying which parts of the ExecutedTransaction
2343    /// should be returned.
2344    #[prost(message, optional, tag = "1")]
2345    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2346    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2347    /// genesis.
2348    #[prost(uint64, optional, tag = "2")]
2349    pub start_checkpoint: ::core::option::Option<u64>,
2350    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2351    /// current indexed ledger tip.
2352    #[prost(uint64, optional, tag = "3")]
2353    pub end_checkpoint: ::core::option::Option<u64>,
2354    /// Optional. DNF filter over indexed dimensions.
2355    /// If absent, all transactions in the range are returned.
2356    #[prost(message, optional, tag = "4")]
2357    pub filter: ::core::option::Option<TransactionFilter>,
2358    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2359    /// order with the default item limit. The server enforces a maximum item
2360    /// limit and silently coerces larger values down to it. To paginate, pass
2361    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2362    /// `options.before` (descending) on the next request.
2363    #[prost(message, optional, tag = "5")]
2364    pub options: ::core::option::Option<QueryOptions>,
2365}
2366/// Response message for LedgerService.ListTransactions.
2367///
2368/// Every frame carries a `watermark` with a safe resume cursor. A frame
2369/// with `transaction` set delivers one matching item; a frame without it reports
2370/// scan progress or terminal completion. Watermarks never regress in the
2371/// requested ordering but may repeat.
2372///
2373/// `end` is set exactly once, on the final frame of a successful stream. For
2374/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2375/// every other end reason, the final frame has no `transaction` payload.
2376#[non_exhaustive]
2377#[derive(Clone, PartialEq, ::prost::Message)]
2378pub struct ListTransactionsResponse {
2379    /// One matching transaction. Its position within the containing checkpoint
2380    /// is reported by `ExecutedTransaction.transaction_index`.
2381    #[prost(message, optional, tag = "1")]
2382    pub transaction: ::core::option::Option<ExecutedTransaction>,
2383    /// Progress watermark as of this frame. Present on every frame. A
2384    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2385    /// its authoritative scan frontier was already emitted.
2386    #[prost(message, optional, tag = "2")]
2387    pub watermark: ::core::option::Option<Watermark>,
2388    /// Set exactly once, on the final frame of a successful query stream.
2389    #[prost(message, optional, tag = "3")]
2390    pub end: ::core::option::Option<QueryEnd>,
2391}
2392/// Request message for LedgerService.ListEvents.
2393#[non_exhaustive]
2394#[derive(Clone, PartialEq, ::prost::Message)]
2395pub struct ListEventsRequest {
2396    /// Optional. Mask for specifying which parts of the Event should be returned.
2397    #[prost(message, optional, tag = "1")]
2398    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2399    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2400    /// genesis.
2401    #[prost(uint64, optional, tag = "2")]
2402    pub start_checkpoint: ::core::option::Option<u64>,
2403    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2404    /// current indexed ledger tip.
2405    #[prost(uint64, optional, tag = "3")]
2406    pub end_checkpoint: ::core::option::Option<u64>,
2407    /// Optional. DNF filter over indexed dimensions.
2408    /// If absent, all events in the range are returned.
2409    #[prost(message, optional, tag = "4")]
2410    pub filter: ::core::option::Option<EventFilter>,
2411    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2412    /// order with the default item limit. The server enforces a maximum item
2413    /// limit and silently coerces larger values down to it. To paginate, pass
2414    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2415    /// `options.before` (descending) on the next request.
2416    #[prost(message, optional, tag = "5")]
2417    pub options: ::core::option::Option<QueryOptions>,
2418}
2419/// Response message for LedgerService.ListEvents.
2420///
2421/// Every frame carries a `watermark` with a safe resume cursor. A frame
2422/// with `event` set delivers one matching item; a frame without it reports scan
2423/// progress or terminal completion. Watermarks never regress in the requested
2424/// ordering but may repeat.
2425///
2426/// `end` is set exactly once, on the final frame of a successful stream. For
2427/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2428/// every other end reason, the final frame has no `event` payload.
2429#[non_exhaustive]
2430#[derive(Clone, PartialEq, ::prost::Message)]
2431pub struct ListEventsResponse {
2432    /// One matching event. Its ledger position -- containing checkpoint,
2433    /// emitting transaction digest and offset, and index within that
2434    /// transaction's event list -- is reported by the corresponding fields on
2435    /// `Event`.
2436    #[prost(message, optional, tag = "1")]
2437    pub event: ::core::option::Option<Event>,
2438    /// Progress watermark as of this frame. Present on every frame. A
2439    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2440    /// its authoritative scan frontier was already emitted.
2441    #[prost(message, optional, tag = "2")]
2442    pub watermark: ::core::option::Option<Watermark>,
2443    /// Set exactly once, on the final frame of a successful query stream.
2444    #[prost(message, optional, tag = "3")]
2445    pub end: ::core::option::Option<QueryEnd>,
2446}
2447/// Generated client implementations.
2448pub mod ledger_service_client {
2449    #![allow(
2450        unused_variables,
2451        dead_code,
2452        missing_docs,
2453        clippy::wildcard_imports,
2454        clippy::let_unit_value,
2455    )]
2456    use tonic::codegen::*;
2457    use tonic::codegen::http::Uri;
2458    #[derive(Debug, Clone)]
2459    pub struct LedgerServiceClient<T> {
2460        inner: tonic::client::Grpc<T>,
2461    }
2462    impl LedgerServiceClient<tonic::transport::Channel> {
2463        /// Attempt to create a new client by connecting to a given endpoint.
2464        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2465        where
2466            D: TryInto<tonic::transport::Endpoint>,
2467            D::Error: Into<StdError>,
2468        {
2469            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2470            Ok(Self::new(conn))
2471        }
2472    }
2473    impl<T> LedgerServiceClient<T>
2474    where
2475        T: tonic::client::GrpcService<tonic::body::Body>,
2476        T::Error: Into<StdError>,
2477        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2478        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2479    {
2480        pub fn new(inner: T) -> Self {
2481            let inner = tonic::client::Grpc::new(inner);
2482            Self { inner }
2483        }
2484        pub fn with_origin(inner: T, origin: Uri) -> Self {
2485            let inner = tonic::client::Grpc::with_origin(inner, origin);
2486            Self { inner }
2487        }
2488        pub fn with_interceptor<F>(
2489            inner: T,
2490            interceptor: F,
2491        ) -> LedgerServiceClient<InterceptedService<T, F>>
2492        where
2493            F: tonic::service::Interceptor,
2494            T::ResponseBody: Default,
2495            T: tonic::codegen::Service<
2496                http::Request<tonic::body::Body>,
2497                Response = http::Response<
2498                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2499                >,
2500            >,
2501            <T as tonic::codegen::Service<
2502                http::Request<tonic::body::Body>,
2503            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2504        {
2505            LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
2506        }
2507        /// Compress requests with the given encoding.
2508        ///
2509        /// This requires the server to support it otherwise it might respond with an
2510        /// error.
2511        #[must_use]
2512        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2513            self.inner = self.inner.send_compressed(encoding);
2514            self
2515        }
2516        /// Enable decompressing responses.
2517        #[must_use]
2518        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2519            self.inner = self.inner.accept_compressed(encoding);
2520            self
2521        }
2522        /// Limits the maximum size of a decoded message.
2523        ///
2524        /// Default: `4MB`
2525        #[must_use]
2526        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2527            self.inner = self.inner.max_decoding_message_size(limit);
2528            self
2529        }
2530        /// Limits the maximum size of an encoded message.
2531        ///
2532        /// Default: `usize::MAX`
2533        #[must_use]
2534        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2535            self.inner = self.inner.max_encoding_message_size(limit);
2536            self
2537        }
2538        /// Query the service for general information about its current state.
2539        pub async fn get_service_info(
2540            &mut self,
2541            request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
2542        ) -> std::result::Result<
2543            tonic::Response<super::GetServiceInfoResponse>,
2544            tonic::Status,
2545        > {
2546            self.inner
2547                .ready()
2548                .await
2549                .map_err(|e| {
2550                    tonic::Status::unknown(
2551                        format!("Service was not ready: {}", e.into()),
2552                    )
2553                })?;
2554            let codec = tonic_prost::ProstCodec::default();
2555            let path = http::uri::PathAndQuery::from_static(
2556                "/sui.rpc.v2.LedgerService/GetServiceInfo",
2557            );
2558            let mut req = request.into_request();
2559            req.extensions_mut()
2560                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
2561            self.inner.unary(req, path, codec).await
2562        }
2563        pub async fn get_object(
2564            &mut self,
2565            request: impl tonic::IntoRequest<super::GetObjectRequest>,
2566        ) -> std::result::Result<
2567            tonic::Response<super::GetObjectResponse>,
2568            tonic::Status,
2569        > {
2570            self.inner
2571                .ready()
2572                .await
2573                .map_err(|e| {
2574                    tonic::Status::unknown(
2575                        format!("Service was not ready: {}", e.into()),
2576                    )
2577                })?;
2578            let codec = tonic_prost::ProstCodec::default();
2579            let path = http::uri::PathAndQuery::from_static(
2580                "/sui.rpc.v2.LedgerService/GetObject",
2581            );
2582            let mut req = request.into_request();
2583            req.extensions_mut()
2584                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
2585            self.inner.unary(req, path, codec).await
2586        }
2587        pub async fn batch_get_objects(
2588            &mut self,
2589            request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
2590        ) -> std::result::Result<
2591            tonic::Response<super::BatchGetObjectsResponse>,
2592            tonic::Status,
2593        > {
2594            self.inner
2595                .ready()
2596                .await
2597                .map_err(|e| {
2598                    tonic::Status::unknown(
2599                        format!("Service was not ready: {}", e.into()),
2600                    )
2601                })?;
2602            let codec = tonic_prost::ProstCodec::default();
2603            let path = http::uri::PathAndQuery::from_static(
2604                "/sui.rpc.v2.LedgerService/BatchGetObjects",
2605            );
2606            let mut req = request.into_request();
2607            req.extensions_mut()
2608                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
2609            self.inner.unary(req, path, codec).await
2610        }
2611        pub async fn get_transaction(
2612            &mut self,
2613            request: impl tonic::IntoRequest<super::GetTransactionRequest>,
2614        ) -> std::result::Result<
2615            tonic::Response<super::GetTransactionResponse>,
2616            tonic::Status,
2617        > {
2618            self.inner
2619                .ready()
2620                .await
2621                .map_err(|e| {
2622                    tonic::Status::unknown(
2623                        format!("Service was not ready: {}", e.into()),
2624                    )
2625                })?;
2626            let codec = tonic_prost::ProstCodec::default();
2627            let path = http::uri::PathAndQuery::from_static(
2628                "/sui.rpc.v2.LedgerService/GetTransaction",
2629            );
2630            let mut req = request.into_request();
2631            req.extensions_mut()
2632                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
2633            self.inner.unary(req, path, codec).await
2634        }
2635        pub async fn batch_get_transactions(
2636            &mut self,
2637            request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
2638        ) -> std::result::Result<
2639            tonic::Response<super::BatchGetTransactionsResponse>,
2640            tonic::Status,
2641        > {
2642            self.inner
2643                .ready()
2644                .await
2645                .map_err(|e| {
2646                    tonic::Status::unknown(
2647                        format!("Service was not ready: {}", e.into()),
2648                    )
2649                })?;
2650            let codec = tonic_prost::ProstCodec::default();
2651            let path = http::uri::PathAndQuery::from_static(
2652                "/sui.rpc.v2.LedgerService/BatchGetTransactions",
2653            );
2654            let mut req = request.into_request();
2655            req.extensions_mut()
2656                .insert(
2657                    GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
2658                );
2659            self.inner.unary(req, path, codec).await
2660        }
2661        pub async fn get_checkpoint(
2662            &mut self,
2663            request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
2664        ) -> std::result::Result<
2665            tonic::Response<super::GetCheckpointResponse>,
2666            tonic::Status,
2667        > {
2668            self.inner
2669                .ready()
2670                .await
2671                .map_err(|e| {
2672                    tonic::Status::unknown(
2673                        format!("Service was not ready: {}", e.into()),
2674                    )
2675                })?;
2676            let codec = tonic_prost::ProstCodec::default();
2677            let path = http::uri::PathAndQuery::from_static(
2678                "/sui.rpc.v2.LedgerService/GetCheckpoint",
2679            );
2680            let mut req = request.into_request();
2681            req.extensions_mut()
2682                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
2683            self.inner.unary(req, path, codec).await
2684        }
2685        pub async fn get_epoch(
2686            &mut self,
2687            request: impl tonic::IntoRequest<super::GetEpochRequest>,
2688        ) -> std::result::Result<
2689            tonic::Response<super::GetEpochResponse>,
2690            tonic::Status,
2691        > {
2692            self.inner
2693                .ready()
2694                .await
2695                .map_err(|e| {
2696                    tonic::Status::unknown(
2697                        format!("Service was not ready: {}", e.into()),
2698                    )
2699                })?;
2700            let codec = tonic_prost::ProstCodec::default();
2701            let path = http::uri::PathAndQuery::from_static(
2702                "/sui.rpc.v2.LedgerService/GetEpoch",
2703            );
2704            let mut req = request.into_request();
2705            req.extensions_mut()
2706                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
2707            self.inner.unary(req, path, codec).await
2708        }
2709        /// List checkpoints matching the provided filters.
2710        ///
2711        /// Checkpoints are returned in ascending or descending checkpoint sequence
2712        /// number order according to the query options ordering.
2713        /// A checkpoint matches if any transaction it contains satisfies the filter.
2714        pub async fn list_checkpoints(
2715            &mut self,
2716            request: impl tonic::IntoRequest<super::ListCheckpointsRequest>,
2717        ) -> std::result::Result<
2718            tonic::Response<tonic::codec::Streaming<super::ListCheckpointsResponse>>,
2719            tonic::Status,
2720        > {
2721            self.inner
2722                .ready()
2723                .await
2724                .map_err(|e| {
2725                    tonic::Status::unknown(
2726                        format!("Service was not ready: {}", e.into()),
2727                    )
2728                })?;
2729            let codec = tonic_prost::ProstCodec::default();
2730            let path = http::uri::PathAndQuery::from_static(
2731                "/sui.rpc.v2.LedgerService/ListCheckpoints",
2732            );
2733            let mut req = request.into_request();
2734            req.extensions_mut()
2735                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListCheckpoints"));
2736            self.inner.server_streaming(req, path, codec).await
2737        }
2738        /// List transactions matching the provided filters.
2739        ///
2740        /// Transactions are returned in ascending or descending transaction sequence
2741        /// order according to the query options ordering.
2742        pub async fn list_transactions(
2743            &mut self,
2744            request: impl tonic::IntoRequest<super::ListTransactionsRequest>,
2745        ) -> std::result::Result<
2746            tonic::Response<tonic::codec::Streaming<super::ListTransactionsResponse>>,
2747            tonic::Status,
2748        > {
2749            self.inner
2750                .ready()
2751                .await
2752                .map_err(|e| {
2753                    tonic::Status::unknown(
2754                        format!("Service was not ready: {}", e.into()),
2755                    )
2756                })?;
2757            let codec = tonic_prost::ProstCodec::default();
2758            let path = http::uri::PathAndQuery::from_static(
2759                "/sui.rpc.v2.LedgerService/ListTransactions",
2760            );
2761            let mut req = request.into_request();
2762            req.extensions_mut()
2763                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListTransactions"));
2764            self.inner.server_streaming(req, path, codec).await
2765        }
2766        /// List events matching the provided filters.
2767        ///
2768        /// Events are returned in ascending or descending packed event sequence order
2769        /// according to the query options ordering.
2770        pub async fn list_events(
2771            &mut self,
2772            request: impl tonic::IntoRequest<super::ListEventsRequest>,
2773        ) -> std::result::Result<
2774            tonic::Response<tonic::codec::Streaming<super::ListEventsResponse>>,
2775            tonic::Status,
2776        > {
2777            self.inner
2778                .ready()
2779                .await
2780                .map_err(|e| {
2781                    tonic::Status::unknown(
2782                        format!("Service was not ready: {}", e.into()),
2783                    )
2784                })?;
2785            let codec = tonic_prost::ProstCodec::default();
2786            let path = http::uri::PathAndQuery::from_static(
2787                "/sui.rpc.v2.LedgerService/ListEvents",
2788            );
2789            let mut req = request.into_request();
2790            req.extensions_mut()
2791                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListEvents"));
2792            self.inner.server_streaming(req, path, codec).await
2793        }
2794    }
2795}
2796/// Generated server implementations.
2797pub mod ledger_service_server {
2798    #![allow(
2799        unused_variables,
2800        dead_code,
2801        missing_docs,
2802        clippy::wildcard_imports,
2803        clippy::let_unit_value,
2804    )]
2805    use tonic::codegen::*;
2806    /// Generated trait containing gRPC methods that should be implemented for use with LedgerServiceServer.
2807    #[async_trait]
2808    pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2809        /// Query the service for general information about its current state.
2810        async fn get_service_info(
2811            &self,
2812            request: tonic::Request<super::GetServiceInfoRequest>,
2813        ) -> std::result::Result<
2814            tonic::Response<super::GetServiceInfoResponse>,
2815            tonic::Status,
2816        > {
2817            Err(tonic::Status::unimplemented("Not yet implemented"))
2818        }
2819        async fn get_object(
2820            &self,
2821            request: tonic::Request<super::GetObjectRequest>,
2822        ) -> std::result::Result<
2823            tonic::Response<super::GetObjectResponse>,
2824            tonic::Status,
2825        > {
2826            Err(tonic::Status::unimplemented("Not yet implemented"))
2827        }
2828        async fn batch_get_objects(
2829            &self,
2830            request: tonic::Request<super::BatchGetObjectsRequest>,
2831        ) -> std::result::Result<
2832            tonic::Response<super::BatchGetObjectsResponse>,
2833            tonic::Status,
2834        > {
2835            Err(tonic::Status::unimplemented("Not yet implemented"))
2836        }
2837        async fn get_transaction(
2838            &self,
2839            request: tonic::Request<super::GetTransactionRequest>,
2840        ) -> std::result::Result<
2841            tonic::Response<super::GetTransactionResponse>,
2842            tonic::Status,
2843        > {
2844            Err(tonic::Status::unimplemented("Not yet implemented"))
2845        }
2846        async fn batch_get_transactions(
2847            &self,
2848            request: tonic::Request<super::BatchGetTransactionsRequest>,
2849        ) -> std::result::Result<
2850            tonic::Response<super::BatchGetTransactionsResponse>,
2851            tonic::Status,
2852        > {
2853            Err(tonic::Status::unimplemented("Not yet implemented"))
2854        }
2855        async fn get_checkpoint(
2856            &self,
2857            request: tonic::Request<super::GetCheckpointRequest>,
2858        ) -> std::result::Result<
2859            tonic::Response<super::GetCheckpointResponse>,
2860            tonic::Status,
2861        > {
2862            Err(tonic::Status::unimplemented("Not yet implemented"))
2863        }
2864        async fn get_epoch(
2865            &self,
2866            request: tonic::Request<super::GetEpochRequest>,
2867        ) -> std::result::Result<
2868            tonic::Response<super::GetEpochResponse>,
2869            tonic::Status,
2870        > {
2871            Err(tonic::Status::unimplemented("Not yet implemented"))
2872        }
2873        /// List checkpoints matching the provided filters.
2874        ///
2875        /// Checkpoints are returned in ascending or descending checkpoint sequence
2876        /// number order according to the query options ordering.
2877        /// A checkpoint matches if any transaction it contains satisfies the filter.
2878        async fn list_checkpoints(
2879            &self,
2880            request: tonic::Request<super::ListCheckpointsRequest>,
2881        ) -> std::result::Result<
2882            tonic::Response<BoxStream<super::ListCheckpointsResponse>>,
2883            tonic::Status,
2884        > {
2885            Err(tonic::Status::unimplemented("Not yet implemented"))
2886        }
2887        /// List transactions matching the provided filters.
2888        ///
2889        /// Transactions are returned in ascending or descending transaction sequence
2890        /// order according to the query options ordering.
2891        async fn list_transactions(
2892            &self,
2893            request: tonic::Request<super::ListTransactionsRequest>,
2894        ) -> std::result::Result<
2895            tonic::Response<BoxStream<super::ListTransactionsResponse>>,
2896            tonic::Status,
2897        > {
2898            Err(tonic::Status::unimplemented("Not yet implemented"))
2899        }
2900        /// List events matching the provided filters.
2901        ///
2902        /// Events are returned in ascending or descending packed event sequence order
2903        /// according to the query options ordering.
2904        async fn list_events(
2905            &self,
2906            request: tonic::Request<super::ListEventsRequest>,
2907        ) -> std::result::Result<
2908            tonic::Response<BoxStream<super::ListEventsResponse>>,
2909            tonic::Status,
2910        > {
2911            Err(tonic::Status::unimplemented("Not yet implemented"))
2912        }
2913    }
2914    #[derive(Debug)]
2915    pub struct LedgerServiceServer<T> {
2916        inner: Arc<T>,
2917        accept_compression_encodings: EnabledCompressionEncodings,
2918        send_compression_encodings: EnabledCompressionEncodings,
2919        max_decoding_message_size: Option<usize>,
2920        max_encoding_message_size: Option<usize>,
2921    }
2922    impl<T> LedgerServiceServer<T> {
2923        pub fn new(inner: T) -> Self {
2924            Self::from_arc(Arc::new(inner))
2925        }
2926        pub fn from_arc(inner: Arc<T>) -> Self {
2927            Self {
2928                inner,
2929                accept_compression_encodings: Default::default(),
2930                send_compression_encodings: Default::default(),
2931                max_decoding_message_size: None,
2932                max_encoding_message_size: None,
2933            }
2934        }
2935        pub fn with_interceptor<F>(
2936            inner: T,
2937            interceptor: F,
2938        ) -> InterceptedService<Self, F>
2939        where
2940            F: tonic::service::Interceptor,
2941        {
2942            InterceptedService::new(Self::new(inner), interceptor)
2943        }
2944        /// Enable decompressing requests with the given encoding.
2945        #[must_use]
2946        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2947            self.accept_compression_encodings.enable(encoding);
2948            self
2949        }
2950        /// Compress responses with the given encoding, if the client supports it.
2951        #[must_use]
2952        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2953            self.send_compression_encodings.enable(encoding);
2954            self
2955        }
2956        /// Limits the maximum size of a decoded message.
2957        ///
2958        /// Default: `4MB`
2959        #[must_use]
2960        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2961            self.max_decoding_message_size = Some(limit);
2962            self
2963        }
2964        /// Limits the maximum size of an encoded message.
2965        ///
2966        /// Default: `usize::MAX`
2967        #[must_use]
2968        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2969            self.max_encoding_message_size = Some(limit);
2970            self
2971        }
2972    }
2973    impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
2974    where
2975        T: LedgerService,
2976        B: Body + std::marker::Send + 'static,
2977        B::Error: Into<StdError> + std::marker::Send + 'static,
2978    {
2979        type Response = http::Response<tonic::body::Body>;
2980        type Error = std::convert::Infallible;
2981        type Future = BoxFuture<Self::Response, Self::Error>;
2982        fn poll_ready(
2983            &mut self,
2984            _cx: &mut Context<'_>,
2985        ) -> Poll<std::result::Result<(), Self::Error>> {
2986            Poll::Ready(Ok(()))
2987        }
2988        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2989            match req.uri().path() {
2990                "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
2991                    #[allow(non_camel_case_types)]
2992                    struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
2993                    impl<
2994                        T: LedgerService,
2995                    > tonic::server::UnaryService<super::GetServiceInfoRequest>
2996                    for GetServiceInfoSvc<T> {
2997                        type Response = super::GetServiceInfoResponse;
2998                        type Future = BoxFuture<
2999                            tonic::Response<Self::Response>,
3000                            tonic::Status,
3001                        >;
3002                        fn call(
3003                            &mut self,
3004                            request: tonic::Request<super::GetServiceInfoRequest>,
3005                        ) -> Self::Future {
3006                            let inner = Arc::clone(&self.0);
3007                            let fut = async move {
3008                                <T as LedgerService>::get_service_info(&inner, request)
3009                                    .await
3010                            };
3011                            Box::pin(fut)
3012                        }
3013                    }
3014                    let accept_compression_encodings = self.accept_compression_encodings;
3015                    let send_compression_encodings = self.send_compression_encodings;
3016                    let max_decoding_message_size = self.max_decoding_message_size;
3017                    let max_encoding_message_size = self.max_encoding_message_size;
3018                    let inner = self.inner.clone();
3019                    let fut = async move {
3020                        let method = GetServiceInfoSvc(inner);
3021                        let codec = tonic_prost::ProstCodec::default();
3022                        let mut grpc = tonic::server::Grpc::new(codec)
3023                            .apply_compression_config(
3024                                accept_compression_encodings,
3025                                send_compression_encodings,
3026                            )
3027                            .apply_max_message_size_config(
3028                                max_decoding_message_size,
3029                                max_encoding_message_size,
3030                            );
3031                        let res = grpc.unary(method, req).await;
3032                        Ok(res)
3033                    };
3034                    Box::pin(fut)
3035                }
3036                "/sui.rpc.v2.LedgerService/GetObject" => {
3037                    #[allow(non_camel_case_types)]
3038                    struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
3039                    impl<
3040                        T: LedgerService,
3041                    > tonic::server::UnaryService<super::GetObjectRequest>
3042                    for GetObjectSvc<T> {
3043                        type Response = super::GetObjectResponse;
3044                        type Future = BoxFuture<
3045                            tonic::Response<Self::Response>,
3046                            tonic::Status,
3047                        >;
3048                        fn call(
3049                            &mut self,
3050                            request: tonic::Request<super::GetObjectRequest>,
3051                        ) -> Self::Future {
3052                            let inner = Arc::clone(&self.0);
3053                            let fut = async move {
3054                                <T as LedgerService>::get_object(&inner, request).await
3055                            };
3056                            Box::pin(fut)
3057                        }
3058                    }
3059                    let accept_compression_encodings = self.accept_compression_encodings;
3060                    let send_compression_encodings = self.send_compression_encodings;
3061                    let max_decoding_message_size = self.max_decoding_message_size;
3062                    let max_encoding_message_size = self.max_encoding_message_size;
3063                    let inner = self.inner.clone();
3064                    let fut = async move {
3065                        let method = GetObjectSvc(inner);
3066                        let codec = tonic_prost::ProstCodec::default();
3067                        let mut grpc = tonic::server::Grpc::new(codec)
3068                            .apply_compression_config(
3069                                accept_compression_encodings,
3070                                send_compression_encodings,
3071                            )
3072                            .apply_max_message_size_config(
3073                                max_decoding_message_size,
3074                                max_encoding_message_size,
3075                            );
3076                        let res = grpc.unary(method, req).await;
3077                        Ok(res)
3078                    };
3079                    Box::pin(fut)
3080                }
3081                "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
3082                    #[allow(non_camel_case_types)]
3083                    struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
3084                    impl<
3085                        T: LedgerService,
3086                    > tonic::server::UnaryService<super::BatchGetObjectsRequest>
3087                    for BatchGetObjectsSvc<T> {
3088                        type Response = super::BatchGetObjectsResponse;
3089                        type Future = BoxFuture<
3090                            tonic::Response<Self::Response>,
3091                            tonic::Status,
3092                        >;
3093                        fn call(
3094                            &mut self,
3095                            request: tonic::Request<super::BatchGetObjectsRequest>,
3096                        ) -> Self::Future {
3097                            let inner = Arc::clone(&self.0);
3098                            let fut = async move {
3099                                <T as LedgerService>::batch_get_objects(&inner, request)
3100                                    .await
3101                            };
3102                            Box::pin(fut)
3103                        }
3104                    }
3105                    let accept_compression_encodings = self.accept_compression_encodings;
3106                    let send_compression_encodings = self.send_compression_encodings;
3107                    let max_decoding_message_size = self.max_decoding_message_size;
3108                    let max_encoding_message_size = self.max_encoding_message_size;
3109                    let inner = self.inner.clone();
3110                    let fut = async move {
3111                        let method = BatchGetObjectsSvc(inner);
3112                        let codec = tonic_prost::ProstCodec::default();
3113                        let mut grpc = tonic::server::Grpc::new(codec)
3114                            .apply_compression_config(
3115                                accept_compression_encodings,
3116                                send_compression_encodings,
3117                            )
3118                            .apply_max_message_size_config(
3119                                max_decoding_message_size,
3120                                max_encoding_message_size,
3121                            );
3122                        let res = grpc.unary(method, req).await;
3123                        Ok(res)
3124                    };
3125                    Box::pin(fut)
3126                }
3127                "/sui.rpc.v2.LedgerService/GetTransaction" => {
3128                    #[allow(non_camel_case_types)]
3129                    struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
3130                    impl<
3131                        T: LedgerService,
3132                    > tonic::server::UnaryService<super::GetTransactionRequest>
3133                    for GetTransactionSvc<T> {
3134                        type Response = super::GetTransactionResponse;
3135                        type Future = BoxFuture<
3136                            tonic::Response<Self::Response>,
3137                            tonic::Status,
3138                        >;
3139                        fn call(
3140                            &mut self,
3141                            request: tonic::Request<super::GetTransactionRequest>,
3142                        ) -> Self::Future {
3143                            let inner = Arc::clone(&self.0);
3144                            let fut = async move {
3145                                <T as LedgerService>::get_transaction(&inner, request).await
3146                            };
3147                            Box::pin(fut)
3148                        }
3149                    }
3150                    let accept_compression_encodings = self.accept_compression_encodings;
3151                    let send_compression_encodings = self.send_compression_encodings;
3152                    let max_decoding_message_size = self.max_decoding_message_size;
3153                    let max_encoding_message_size = self.max_encoding_message_size;
3154                    let inner = self.inner.clone();
3155                    let fut = async move {
3156                        let method = GetTransactionSvc(inner);
3157                        let codec = tonic_prost::ProstCodec::default();
3158                        let mut grpc = tonic::server::Grpc::new(codec)
3159                            .apply_compression_config(
3160                                accept_compression_encodings,
3161                                send_compression_encodings,
3162                            )
3163                            .apply_max_message_size_config(
3164                                max_decoding_message_size,
3165                                max_encoding_message_size,
3166                            );
3167                        let res = grpc.unary(method, req).await;
3168                        Ok(res)
3169                    };
3170                    Box::pin(fut)
3171                }
3172                "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
3173                    #[allow(non_camel_case_types)]
3174                    struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
3175                    impl<
3176                        T: LedgerService,
3177                    > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
3178                    for BatchGetTransactionsSvc<T> {
3179                        type Response = super::BatchGetTransactionsResponse;
3180                        type Future = BoxFuture<
3181                            tonic::Response<Self::Response>,
3182                            tonic::Status,
3183                        >;
3184                        fn call(
3185                            &mut self,
3186                            request: tonic::Request<super::BatchGetTransactionsRequest>,
3187                        ) -> Self::Future {
3188                            let inner = Arc::clone(&self.0);
3189                            let fut = async move {
3190                                <T as LedgerService>::batch_get_transactions(
3191                                        &inner,
3192                                        request,
3193                                    )
3194                                    .await
3195                            };
3196                            Box::pin(fut)
3197                        }
3198                    }
3199                    let accept_compression_encodings = self.accept_compression_encodings;
3200                    let send_compression_encodings = self.send_compression_encodings;
3201                    let max_decoding_message_size = self.max_decoding_message_size;
3202                    let max_encoding_message_size = self.max_encoding_message_size;
3203                    let inner = self.inner.clone();
3204                    let fut = async move {
3205                        let method = BatchGetTransactionsSvc(inner);
3206                        let codec = tonic_prost::ProstCodec::default();
3207                        let mut grpc = tonic::server::Grpc::new(codec)
3208                            .apply_compression_config(
3209                                accept_compression_encodings,
3210                                send_compression_encodings,
3211                            )
3212                            .apply_max_message_size_config(
3213                                max_decoding_message_size,
3214                                max_encoding_message_size,
3215                            );
3216                        let res = grpc.unary(method, req).await;
3217                        Ok(res)
3218                    };
3219                    Box::pin(fut)
3220                }
3221                "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
3222                    #[allow(non_camel_case_types)]
3223                    struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
3224                    impl<
3225                        T: LedgerService,
3226                    > tonic::server::UnaryService<super::GetCheckpointRequest>
3227                    for GetCheckpointSvc<T> {
3228                        type Response = super::GetCheckpointResponse;
3229                        type Future = BoxFuture<
3230                            tonic::Response<Self::Response>,
3231                            tonic::Status,
3232                        >;
3233                        fn call(
3234                            &mut self,
3235                            request: tonic::Request<super::GetCheckpointRequest>,
3236                        ) -> Self::Future {
3237                            let inner = Arc::clone(&self.0);
3238                            let fut = async move {
3239                                <T as LedgerService>::get_checkpoint(&inner, request).await
3240                            };
3241                            Box::pin(fut)
3242                        }
3243                    }
3244                    let accept_compression_encodings = self.accept_compression_encodings;
3245                    let send_compression_encodings = self.send_compression_encodings;
3246                    let max_decoding_message_size = self.max_decoding_message_size;
3247                    let max_encoding_message_size = self.max_encoding_message_size;
3248                    let inner = self.inner.clone();
3249                    let fut = async move {
3250                        let method = GetCheckpointSvc(inner);
3251                        let codec = tonic_prost::ProstCodec::default();
3252                        let mut grpc = tonic::server::Grpc::new(codec)
3253                            .apply_compression_config(
3254                                accept_compression_encodings,
3255                                send_compression_encodings,
3256                            )
3257                            .apply_max_message_size_config(
3258                                max_decoding_message_size,
3259                                max_encoding_message_size,
3260                            );
3261                        let res = grpc.unary(method, req).await;
3262                        Ok(res)
3263                    };
3264                    Box::pin(fut)
3265                }
3266                "/sui.rpc.v2.LedgerService/GetEpoch" => {
3267                    #[allow(non_camel_case_types)]
3268                    struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
3269                    impl<
3270                        T: LedgerService,
3271                    > tonic::server::UnaryService<super::GetEpochRequest>
3272                    for GetEpochSvc<T> {
3273                        type Response = super::GetEpochResponse;
3274                        type Future = BoxFuture<
3275                            tonic::Response<Self::Response>,
3276                            tonic::Status,
3277                        >;
3278                        fn call(
3279                            &mut self,
3280                            request: tonic::Request<super::GetEpochRequest>,
3281                        ) -> Self::Future {
3282                            let inner = Arc::clone(&self.0);
3283                            let fut = async move {
3284                                <T as LedgerService>::get_epoch(&inner, request).await
3285                            };
3286                            Box::pin(fut)
3287                        }
3288                    }
3289                    let accept_compression_encodings = self.accept_compression_encodings;
3290                    let send_compression_encodings = self.send_compression_encodings;
3291                    let max_decoding_message_size = self.max_decoding_message_size;
3292                    let max_encoding_message_size = self.max_encoding_message_size;
3293                    let inner = self.inner.clone();
3294                    let fut = async move {
3295                        let method = GetEpochSvc(inner);
3296                        let codec = tonic_prost::ProstCodec::default();
3297                        let mut grpc = tonic::server::Grpc::new(codec)
3298                            .apply_compression_config(
3299                                accept_compression_encodings,
3300                                send_compression_encodings,
3301                            )
3302                            .apply_max_message_size_config(
3303                                max_decoding_message_size,
3304                                max_encoding_message_size,
3305                            );
3306                        let res = grpc.unary(method, req).await;
3307                        Ok(res)
3308                    };
3309                    Box::pin(fut)
3310                }
3311                "/sui.rpc.v2.LedgerService/ListCheckpoints" => {
3312                    #[allow(non_camel_case_types)]
3313                    struct ListCheckpointsSvc<T: LedgerService>(pub Arc<T>);
3314                    impl<
3315                        T: LedgerService,
3316                    > tonic::server::ServerStreamingService<
3317                        super::ListCheckpointsRequest,
3318                    > for ListCheckpointsSvc<T> {
3319                        type Response = super::ListCheckpointsResponse;
3320                        type ResponseStream = BoxStream<super::ListCheckpointsResponse>;
3321                        type Future = BoxFuture<
3322                            tonic::Response<Self::ResponseStream>,
3323                            tonic::Status,
3324                        >;
3325                        fn call(
3326                            &mut self,
3327                            request: tonic::Request<super::ListCheckpointsRequest>,
3328                        ) -> Self::Future {
3329                            let inner = Arc::clone(&self.0);
3330                            let fut = async move {
3331                                <T as LedgerService>::list_checkpoints(&inner, request)
3332                                    .await
3333                            };
3334                            Box::pin(fut)
3335                        }
3336                    }
3337                    let accept_compression_encodings = self.accept_compression_encodings;
3338                    let send_compression_encodings = self.send_compression_encodings;
3339                    let max_decoding_message_size = self.max_decoding_message_size;
3340                    let max_encoding_message_size = self.max_encoding_message_size;
3341                    let inner = self.inner.clone();
3342                    let fut = async move {
3343                        let method = ListCheckpointsSvc(inner);
3344                        let codec = tonic_prost::ProstCodec::default();
3345                        let mut grpc = tonic::server::Grpc::new(codec)
3346                            .apply_compression_config(
3347                                accept_compression_encodings,
3348                                send_compression_encodings,
3349                            )
3350                            .apply_max_message_size_config(
3351                                max_decoding_message_size,
3352                                max_encoding_message_size,
3353                            );
3354                        let res = grpc.server_streaming(method, req).await;
3355                        Ok(res)
3356                    };
3357                    Box::pin(fut)
3358                }
3359                "/sui.rpc.v2.LedgerService/ListTransactions" => {
3360                    #[allow(non_camel_case_types)]
3361                    struct ListTransactionsSvc<T: LedgerService>(pub Arc<T>);
3362                    impl<
3363                        T: LedgerService,
3364                    > tonic::server::ServerStreamingService<
3365                        super::ListTransactionsRequest,
3366                    > for ListTransactionsSvc<T> {
3367                        type Response = super::ListTransactionsResponse;
3368                        type ResponseStream = BoxStream<super::ListTransactionsResponse>;
3369                        type Future = BoxFuture<
3370                            tonic::Response<Self::ResponseStream>,
3371                            tonic::Status,
3372                        >;
3373                        fn call(
3374                            &mut self,
3375                            request: tonic::Request<super::ListTransactionsRequest>,
3376                        ) -> Self::Future {
3377                            let inner = Arc::clone(&self.0);
3378                            let fut = async move {
3379                                <T as LedgerService>::list_transactions(&inner, request)
3380                                    .await
3381                            };
3382                            Box::pin(fut)
3383                        }
3384                    }
3385                    let accept_compression_encodings = self.accept_compression_encodings;
3386                    let send_compression_encodings = self.send_compression_encodings;
3387                    let max_decoding_message_size = self.max_decoding_message_size;
3388                    let max_encoding_message_size = self.max_encoding_message_size;
3389                    let inner = self.inner.clone();
3390                    let fut = async move {
3391                        let method = ListTransactionsSvc(inner);
3392                        let codec = tonic_prost::ProstCodec::default();
3393                        let mut grpc = tonic::server::Grpc::new(codec)
3394                            .apply_compression_config(
3395                                accept_compression_encodings,
3396                                send_compression_encodings,
3397                            )
3398                            .apply_max_message_size_config(
3399                                max_decoding_message_size,
3400                                max_encoding_message_size,
3401                            );
3402                        let res = grpc.server_streaming(method, req).await;
3403                        Ok(res)
3404                    };
3405                    Box::pin(fut)
3406                }
3407                "/sui.rpc.v2.LedgerService/ListEvents" => {
3408                    #[allow(non_camel_case_types)]
3409                    struct ListEventsSvc<T: LedgerService>(pub Arc<T>);
3410                    impl<
3411                        T: LedgerService,
3412                    > tonic::server::ServerStreamingService<super::ListEventsRequest>
3413                    for ListEventsSvc<T> {
3414                        type Response = super::ListEventsResponse;
3415                        type ResponseStream = BoxStream<super::ListEventsResponse>;
3416                        type Future = BoxFuture<
3417                            tonic::Response<Self::ResponseStream>,
3418                            tonic::Status,
3419                        >;
3420                        fn call(
3421                            &mut self,
3422                            request: tonic::Request<super::ListEventsRequest>,
3423                        ) -> Self::Future {
3424                            let inner = Arc::clone(&self.0);
3425                            let fut = async move {
3426                                <T as LedgerService>::list_events(&inner, request).await
3427                            };
3428                            Box::pin(fut)
3429                        }
3430                    }
3431                    let accept_compression_encodings = self.accept_compression_encodings;
3432                    let send_compression_encodings = self.send_compression_encodings;
3433                    let max_decoding_message_size = self.max_decoding_message_size;
3434                    let max_encoding_message_size = self.max_encoding_message_size;
3435                    let inner = self.inner.clone();
3436                    let fut = async move {
3437                        let method = ListEventsSvc(inner);
3438                        let codec = tonic_prost::ProstCodec::default();
3439                        let mut grpc = tonic::server::Grpc::new(codec)
3440                            .apply_compression_config(
3441                                accept_compression_encodings,
3442                                send_compression_encodings,
3443                            )
3444                            .apply_max_message_size_config(
3445                                max_decoding_message_size,
3446                                max_encoding_message_size,
3447                            );
3448                        let res = grpc.server_streaming(method, req).await;
3449                        Ok(res)
3450                    };
3451                    Box::pin(fut)
3452                }
3453                _ => {
3454                    Box::pin(async move {
3455                        let mut response = http::Response::new(
3456                            tonic::body::Body::default(),
3457                        );
3458                        let headers = response.headers_mut();
3459                        headers
3460                            .insert(
3461                                tonic::Status::GRPC_STATUS,
3462                                (tonic::Code::Unimplemented as i32).into(),
3463                            );
3464                        headers
3465                            .insert(
3466                                http::header::CONTENT_TYPE,
3467                                tonic::metadata::GRPC_CONTENT_TYPE,
3468                            );
3469                        Ok(response)
3470                    })
3471                }
3472            }
3473        }
3474    }
3475    impl<T> Clone for LedgerServiceServer<T> {
3476        fn clone(&self) -> Self {
3477            let inner = self.inner.clone();
3478            Self {
3479                inner,
3480                accept_compression_encodings: self.accept_compression_encodings,
3481                send_compression_encodings: self.send_compression_encodings,
3482                max_decoding_message_size: self.max_decoding_message_size,
3483                max_encoding_message_size: self.max_encoding_message_size,
3484            }
3485        }
3486    }
3487    /// Generated gRPC service name
3488    pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
3489    impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
3490        const NAME: &'static str = SERVICE_NAME;
3491    }
3492}
3493/// A Move Package
3494#[non_exhaustive]
3495#[derive(Clone, PartialEq, ::prost::Message)]
3496pub struct Package {
3497    /// The PackageId of this package
3498    ///
3499    /// A package's `storage_id` is the Sui ObjectId of the package on-chain.
3500    /// Outside of system packages the `storage_id` for every package version is
3501    /// different.
3502    #[prost(string, optional, tag = "1")]
3503    pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
3504    /// The PackageId of the first published version of this package.
3505    ///
3506    /// A package's `original_id` (sometimes also called its `runtime_id`) is the
3507    /// `storage_id` of the first version of this package that has been published.
3508    /// The `original_id`/`runtime_id` is stable across all versions of the
3509    /// package and does not ever change.
3510    #[prost(string, optional, tag = "2")]
3511    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3512    /// The version of this package
3513    #[prost(uint64, optional, tag = "3")]
3514    pub version: ::core::option::Option<u64>,
3515    /// The modules defined by this package
3516    #[prost(message, repeated, tag = "4")]
3517    pub modules: ::prost::alloc::vec::Vec<Module>,
3518    /// List of datatype origins for mapping datatypes to a package version where
3519    /// it was first defined
3520    #[prost(message, repeated, tag = "5")]
3521    pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
3522    /// The package's transitive dependencies as a mapping from the package's
3523    /// runtime Id (the Id it is referred to by in other packages) to its
3524    /// storage Id (the Id it is loaded from on chain).
3525    #[prost(message, repeated, tag = "6")]
3526    pub linkage: ::prost::alloc::vec::Vec<Linkage>,
3527}
3528/// A Move Module.
3529#[non_exhaustive]
3530#[derive(Clone, PartialEq, ::prost::Message)]
3531pub struct Module {
3532    /// Name of this module.
3533    #[prost(string, optional, tag = "1")]
3534    pub name: ::core::option::Option<::prost::alloc::string::String>,
3535    /// Serialized bytecode of the module.
3536    #[prost(bytes = "bytes", optional, tag = "2")]
3537    pub contents: ::core::option::Option<::prost::bytes::Bytes>,
3538    /// List of DataTypes defined by this module.
3539    #[prost(message, repeated, tag = "3")]
3540    pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
3541    /// List of Functions defined by this module.
3542    #[prost(message, repeated, tag = "4")]
3543    pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
3544}
3545/// Describes a Move Datatype.
3546#[non_exhaustive]
3547#[derive(Clone, PartialEq, ::prost::Message)]
3548pub struct DatatypeDescriptor {
3549    /// Fully qualified name of this Datatype.
3550    ///
3551    /// This is `<defining_id>::<module>::<name>`
3552    #[prost(string, optional, tag = "1")]
3553    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3554    /// PackageId of the package where this Datatype is defined.
3555    ///
3556    /// A type's `defining_id` is the `storage_id` of the package version that first introduced or added that type.
3557    #[prost(string, optional, tag = "2")]
3558    pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
3559    /// Name of the module where this Datatype is defined
3560    #[prost(string, optional, tag = "3")]
3561    pub module: ::core::option::Option<::prost::alloc::string::String>,
3562    /// Name of this Datatype
3563    #[prost(string, optional, tag = "4")]
3564    pub name: ::core::option::Option<::prost::alloc::string::String>,
3565    /// This type's abilities
3566    #[prost(enumeration = "Ability", repeated, tag = "5")]
3567    pub abilities: ::prost::alloc::vec::Vec<i32>,
3568    /// Ability constraints and phantom status for this type's generic type parameters
3569    #[prost(message, repeated, tag = "6")]
3570    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3571    /// Indicates whether this datatype is a 'STRUCT' or an 'ENUM'
3572    #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
3573    pub kind: ::core::option::Option<i32>,
3574    /// Set of fields if this Datatype is a struct.
3575    ///
3576    /// The order of the entries is the order of how the fields are defined.
3577    #[prost(message, repeated, tag = "8")]
3578    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3579    /// Set of variants if this Datatype is an enum.
3580    ///
3581    /// The order of the entries is the order of how the variants are defined.
3582    #[prost(message, repeated, tag = "9")]
3583    pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
3584}
3585/// Nested message and enum types in `DatatypeDescriptor`.
3586pub mod datatype_descriptor {
3587    #[non_exhaustive]
3588    #[derive(
3589        Clone,
3590        Copy,
3591        Debug,
3592        PartialEq,
3593        Eq,
3594        Hash,
3595        PartialOrd,
3596        Ord,
3597        ::prost::Enumeration
3598    )]
3599    #[repr(i32)]
3600    pub enum DatatypeKind {
3601        Unknown = 0,
3602        Struct = 1,
3603        Enum = 2,
3604    }
3605    impl DatatypeKind {
3606        /// String value of the enum field names used in the ProtoBuf definition.
3607        ///
3608        /// The values are not transformed in any way and thus are considered stable
3609        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3610        pub fn as_str_name(&self) -> &'static str {
3611            match self {
3612                Self::Unknown => "DATATYPE_KIND_UNKNOWN",
3613                Self::Struct => "STRUCT",
3614                Self::Enum => "ENUM",
3615            }
3616        }
3617        /// Creates an enum from field names used in the ProtoBuf definition.
3618        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3619            match value {
3620                "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
3621                "STRUCT" => Some(Self::Struct),
3622                "ENUM" => Some(Self::Enum),
3623                _ => None,
3624            }
3625        }
3626    }
3627}
3628/// A generic type parameter used in the declaration of a struct or enum.
3629#[non_exhaustive]
3630#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3631pub struct TypeParameter {
3632    /// The type parameter constraints
3633    #[prost(enumeration = "Ability", repeated, tag = "1")]
3634    pub constraints: ::prost::alloc::vec::Vec<i32>,
3635    /// Whether the parameter is declared as phantom
3636    #[prost(bool, optional, tag = "2")]
3637    pub is_phantom: ::core::option::Option<bool>,
3638}
3639/// Descriptor of a field that belongs to a struct or enum variant
3640#[non_exhaustive]
3641#[derive(Clone, PartialEq, ::prost::Message)]
3642pub struct FieldDescriptor {
3643    /// Name of the field
3644    #[prost(string, optional, tag = "1")]
3645    pub name: ::core::option::Option<::prost::alloc::string::String>,
3646    /// Order or position of the field in the struct or enum variant definition.
3647    #[prost(uint32, optional, tag = "2")]
3648    pub position: ::core::option::Option<u32>,
3649    /// The type of the field
3650    #[prost(message, optional, tag = "3")]
3651    pub r#type: ::core::option::Option<OpenSignatureBody>,
3652}
3653/// Descriptor of an enum variant
3654#[non_exhaustive]
3655#[derive(Clone, PartialEq, ::prost::Message)]
3656pub struct VariantDescriptor {
3657    /// Name of the variant
3658    #[prost(string, optional, tag = "1")]
3659    pub name: ::core::option::Option<::prost::alloc::string::String>,
3660    /// Order or position of the variant in the enum definition.
3661    #[prost(uint32, optional, tag = "2")]
3662    pub position: ::core::option::Option<u32>,
3663    /// Set of fields defined by this variant.
3664    #[prost(message, repeated, tag = "3")]
3665    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3666}
3667/// Representation of a type signature that could appear as a field type for a struct or enum
3668#[non_exhaustive]
3669#[derive(Clone, PartialEq, ::prost::Message)]
3670pub struct OpenSignatureBody {
3671    /// Type of this signature
3672    #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
3673    pub r#type: ::core::option::Option<i32>,
3674    /// Fully qualified name of the datatype when `type` is `DATATYPE`
3675    #[prost(string, optional, tag = "2")]
3676    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3677    /// Set when `type` is `VECTOR` or `DATATYPE`
3678    #[prost(message, repeated, tag = "3")]
3679    pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
3680    /// Position of the type parameter as defined in the containing data type descriptor when `type` is `TYPE_PARAMETER`
3681    #[prost(uint32, optional, tag = "4")]
3682    pub type_parameter: ::core::option::Option<u32>,
3683}
3684/// Nested message and enum types in `OpenSignatureBody`.
3685pub mod open_signature_body {
3686    #[non_exhaustive]
3687    #[derive(
3688        Clone,
3689        Copy,
3690        Debug,
3691        PartialEq,
3692        Eq,
3693        Hash,
3694        PartialOrd,
3695        Ord,
3696        ::prost::Enumeration
3697    )]
3698    #[repr(i32)]
3699    pub enum Type {
3700        Unknown = 0,
3701        Address = 1,
3702        Bool = 2,
3703        U8 = 3,
3704        U16 = 4,
3705        U32 = 5,
3706        U64 = 6,
3707        U128 = 7,
3708        U256 = 8,
3709        Vector = 9,
3710        Datatype = 10,
3711        Parameter = 11,
3712    }
3713    impl Type {
3714        /// String value of the enum field names used in the ProtoBuf definition.
3715        ///
3716        /// The values are not transformed in any way and thus are considered stable
3717        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3718        pub fn as_str_name(&self) -> &'static str {
3719            match self {
3720                Self::Unknown => "TYPE_UNKNOWN",
3721                Self::Address => "ADDRESS",
3722                Self::Bool => "BOOL",
3723                Self::U8 => "U8",
3724                Self::U16 => "U16",
3725                Self::U32 => "U32",
3726                Self::U64 => "U64",
3727                Self::U128 => "U128",
3728                Self::U256 => "U256",
3729                Self::Vector => "VECTOR",
3730                Self::Datatype => "DATATYPE",
3731                Self::Parameter => "TYPE_PARAMETER",
3732            }
3733        }
3734        /// Creates an enum from field names used in the ProtoBuf definition.
3735        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3736            match value {
3737                "TYPE_UNKNOWN" => Some(Self::Unknown),
3738                "ADDRESS" => Some(Self::Address),
3739                "BOOL" => Some(Self::Bool),
3740                "U8" => Some(Self::U8),
3741                "U16" => Some(Self::U16),
3742                "U32" => Some(Self::U32),
3743                "U64" => Some(Self::U64),
3744                "U128" => Some(Self::U128),
3745                "U256" => Some(Self::U256),
3746                "VECTOR" => Some(Self::Vector),
3747                "DATATYPE" => Some(Self::Datatype),
3748                "TYPE_PARAMETER" => Some(Self::Parameter),
3749                _ => None,
3750            }
3751        }
3752    }
3753}
3754/// Descriptor of a Move function
3755#[non_exhaustive]
3756#[derive(Clone, PartialEq, ::prost::Message)]
3757pub struct FunctionDescriptor {
3758    /// Name of the function
3759    #[prost(string, optional, tag = "1")]
3760    pub name: ::core::option::Option<::prost::alloc::string::String>,
3761    /// Whether the function is `public`, `private` or `public(friend)`
3762    #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
3763    pub visibility: ::core::option::Option<i32>,
3764    /// Whether the function is marked `entry` or not.
3765    #[prost(bool, optional, tag = "6")]
3766    pub is_entry: ::core::option::Option<bool>,
3767    /// Ability constraints for type parameters
3768    #[prost(message, repeated, tag = "7")]
3769    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3770    /// Formal parameter types.
3771    #[prost(message, repeated, tag = "8")]
3772    pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
3773    /// Return types.
3774    #[prost(message, repeated, tag = "9")]
3775    pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
3776}
3777/// Nested message and enum types in `FunctionDescriptor`.
3778pub mod function_descriptor {
3779    #[non_exhaustive]
3780    #[derive(
3781        Clone,
3782        Copy,
3783        Debug,
3784        PartialEq,
3785        Eq,
3786        Hash,
3787        PartialOrd,
3788        Ord,
3789        ::prost::Enumeration
3790    )]
3791    #[repr(i32)]
3792    pub enum Visibility {
3793        Unknown = 0,
3794        Private = 1,
3795        Public = 2,
3796        Friend = 3,
3797    }
3798    impl Visibility {
3799        /// String value of the enum field names used in the ProtoBuf definition.
3800        ///
3801        /// The values are not transformed in any way and thus are considered stable
3802        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3803        pub fn as_str_name(&self) -> &'static str {
3804            match self {
3805                Self::Unknown => "VISIBILITY_UNKNOWN",
3806                Self::Private => "PRIVATE",
3807                Self::Public => "PUBLIC",
3808                Self::Friend => "FRIEND",
3809            }
3810        }
3811        /// Creates an enum from field names used in the ProtoBuf definition.
3812        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3813            match value {
3814                "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
3815                "PRIVATE" => Some(Self::Private),
3816                "PUBLIC" => Some(Self::Public),
3817                "FRIEND" => Some(Self::Friend),
3818                _ => None,
3819            }
3820        }
3821    }
3822}
3823/// Representation of a type signature that could appear as a function parameter or return value.
3824#[non_exhaustive]
3825#[derive(Clone, PartialEq, ::prost::Message)]
3826pub struct OpenSignature {
3827    #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
3828    pub reference: ::core::option::Option<i32>,
3829    #[prost(message, optional, tag = "2")]
3830    pub body: ::core::option::Option<OpenSignatureBody>,
3831}
3832/// Nested message and enum types in `OpenSignature`.
3833pub mod open_signature {
3834    #[non_exhaustive]
3835    #[derive(
3836        Clone,
3837        Copy,
3838        Debug,
3839        PartialEq,
3840        Eq,
3841        Hash,
3842        PartialOrd,
3843        Ord,
3844        ::prost::Enumeration
3845    )]
3846    #[repr(i32)]
3847    pub enum Reference {
3848        Unknown = 0,
3849        Immutable = 1,
3850        Mutable = 2,
3851    }
3852    impl Reference {
3853        /// String value of the enum field names used in the ProtoBuf definition.
3854        ///
3855        /// The values are not transformed in any way and thus are considered stable
3856        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3857        pub fn as_str_name(&self) -> &'static str {
3858            match self {
3859                Self::Unknown => "REFERENCE_UNKNOWN",
3860                Self::Immutable => "IMMUTABLE",
3861                Self::Mutable => "MUTABLE",
3862            }
3863        }
3864        /// Creates an enum from field names used in the ProtoBuf definition.
3865        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3866            match value {
3867                "REFERENCE_UNKNOWN" => Some(Self::Unknown),
3868                "IMMUTABLE" => Some(Self::Immutable),
3869                "MUTABLE" => Some(Self::Mutable),
3870                _ => None,
3871            }
3872        }
3873    }
3874}
3875/// Identifies a struct and the module it was defined in.
3876#[non_exhaustive]
3877#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3878pub struct TypeOrigin {
3879    #[prost(string, optional, tag = "1")]
3880    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3881    #[prost(string, optional, tag = "2")]
3882    pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
3883    #[prost(string, optional, tag = "3")]
3884    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3885}
3886/// Upgraded package info for the linkage table.
3887#[non_exhaustive]
3888#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3889pub struct Linkage {
3890    /// Id of the original package.
3891    #[prost(string, optional, tag = "1")]
3892    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3893    /// Id of the upgraded package.
3894    #[prost(string, optional, tag = "2")]
3895    pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
3896    /// Version of the upgraded package.
3897    #[prost(uint64, optional, tag = "3")]
3898    pub upgraded_version: ::core::option::Option<u64>,
3899}
3900/// An `Ability` classifies what operations are permitted for a given type
3901#[non_exhaustive]
3902#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3903#[repr(i32)]
3904pub enum Ability {
3905    Unknown = 0,
3906    /// Allows values of types with this ability to be copied
3907    Copy = 1,
3908    /// Allows values of types with this ability to be dropped.
3909    Drop = 2,
3910    /// Allows values of types with this ability to exist inside a struct in global storage
3911    Store = 3,
3912    /// Allows the type to serve as a key for global storage operations
3913    Key = 4,
3914}
3915impl Ability {
3916    /// String value of the enum field names used in the ProtoBuf definition.
3917    ///
3918    /// The values are not transformed in any way and thus are considered stable
3919    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3920    pub fn as_str_name(&self) -> &'static str {
3921        match self {
3922            Self::Unknown => "ABILITY_UNKNOWN",
3923            Self::Copy => "COPY",
3924            Self::Drop => "DROP",
3925            Self::Store => "STORE",
3926            Self::Key => "KEY",
3927        }
3928    }
3929    /// Creates an enum from field names used in the ProtoBuf definition.
3930    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3931        match value {
3932            "ABILITY_UNKNOWN" => Some(Self::Unknown),
3933            "COPY" => Some(Self::Copy),
3934            "DROP" => Some(Self::Drop),
3935            "STORE" => Some(Self::Store),
3936            "KEY" => Some(Self::Key),
3937            _ => None,
3938        }
3939    }
3940}
3941#[non_exhaustive]
3942#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3943pub struct GetPackageRequest {
3944    /// Required. The `storage_id` of the requested package.
3945    #[prost(string, optional, tag = "1")]
3946    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3947}
3948#[non_exhaustive]
3949#[derive(Clone, PartialEq, ::prost::Message)]
3950pub struct GetPackageResponse {
3951    /// The package.
3952    #[prost(message, optional, tag = "1")]
3953    pub package: ::core::option::Option<Package>,
3954}
3955#[non_exhaustive]
3956#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3957pub struct GetDatatypeRequest {
3958    /// Required. The `storage_id` of the requested package.
3959    #[prost(string, optional, tag = "1")]
3960    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3961    /// Required. The name of the requested module.
3962    #[prost(string, optional, tag = "2")]
3963    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3964    /// Required. The name of the requested datatype.
3965    #[prost(string, optional, tag = "3")]
3966    pub name: ::core::option::Option<::prost::alloc::string::String>,
3967}
3968#[non_exhaustive]
3969#[derive(Clone, PartialEq, ::prost::Message)]
3970pub struct GetDatatypeResponse {
3971    /// The datatype.
3972    #[prost(message, optional, tag = "1")]
3973    pub datatype: ::core::option::Option<DatatypeDescriptor>,
3974}
3975#[non_exhaustive]
3976#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3977pub struct GetFunctionRequest {
3978    /// Required. The `storage_id` of the requested package.
3979    #[prost(string, optional, tag = "1")]
3980    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3981    /// Required. The name of the requested module.
3982    #[prost(string, optional, tag = "2")]
3983    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3984    /// Required. The name of the requested function.
3985    #[prost(string, optional, tag = "3")]
3986    pub name: ::core::option::Option<::prost::alloc::string::String>,
3987}
3988#[non_exhaustive]
3989#[derive(Clone, PartialEq, ::prost::Message)]
3990pub struct GetFunctionResponse {
3991    /// The function.
3992    #[prost(message, optional, tag = "1")]
3993    pub function: ::core::option::Option<FunctionDescriptor>,
3994}
3995#[non_exhaustive]
3996#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3997pub struct ListPackageVersionsRequest {
3998    /// Required. The `storage_id` of any version of the package.
3999    #[prost(string, optional, tag = "1")]
4000    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4001    /// The maximum number of versions to return. The service may return fewer than this value.
4002    /// If unspecified, at most `1000` entries will be returned.
4003    /// The maximum value is `10000`; values above `10000` will be coerced to `10000`.
4004    #[prost(uint32, optional, tag = "2")]
4005    pub page_size: ::core::option::Option<u32>,
4006    /// A page token, received from a previous `ListPackageVersions` call.
4007    /// Provide this to retrieve the subsequent page.
4008    ///
4009    /// When paginating, all other parameters provided to `ListPackageVersions` must
4010    /// match the call that provided the page token.
4011    #[prost(bytes = "bytes", optional, tag = "3")]
4012    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
4013}
4014#[non_exhaustive]
4015#[derive(Clone, PartialEq, ::prost::Message)]
4016pub struct ListPackageVersionsResponse {
4017    /// List of all package versions, ordered by version.
4018    #[prost(message, repeated, tag = "1")]
4019    pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
4020    /// A token, which can be sent as `page_token` to retrieve the next page.
4021    /// If this field is omitted, there are no subsequent pages.
4022    #[prost(bytes = "bytes", optional, tag = "2")]
4023    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
4024}
4025/// A simplified representation of a package version
4026#[non_exhaustive]
4027#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4028pub struct PackageVersion {
4029    /// The storage ID of this package version
4030    #[prost(string, optional, tag = "1")]
4031    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4032    /// The version number
4033    #[prost(uint64, optional, tag = "2")]
4034    pub version: ::core::option::Option<u64>,
4035}
4036/// Generated client implementations.
4037pub mod move_package_service_client {
4038    #![allow(
4039        unused_variables,
4040        dead_code,
4041        missing_docs,
4042        clippy::wildcard_imports,
4043        clippy::let_unit_value,
4044    )]
4045    use tonic::codegen::*;
4046    use tonic::codegen::http::Uri;
4047    #[derive(Debug, Clone)]
4048    pub struct MovePackageServiceClient<T> {
4049        inner: tonic::client::Grpc<T>,
4050    }
4051    impl MovePackageServiceClient<tonic::transport::Channel> {
4052        /// Attempt to create a new client by connecting to a given endpoint.
4053        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4054        where
4055            D: TryInto<tonic::transport::Endpoint>,
4056            D::Error: Into<StdError>,
4057        {
4058            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4059            Ok(Self::new(conn))
4060        }
4061    }
4062    impl<T> MovePackageServiceClient<T>
4063    where
4064        T: tonic::client::GrpcService<tonic::body::Body>,
4065        T::Error: Into<StdError>,
4066        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4067        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4068    {
4069        pub fn new(inner: T) -> Self {
4070            let inner = tonic::client::Grpc::new(inner);
4071            Self { inner }
4072        }
4073        pub fn with_origin(inner: T, origin: Uri) -> Self {
4074            let inner = tonic::client::Grpc::with_origin(inner, origin);
4075            Self { inner }
4076        }
4077        pub fn with_interceptor<F>(
4078            inner: T,
4079            interceptor: F,
4080        ) -> MovePackageServiceClient<InterceptedService<T, F>>
4081        where
4082            F: tonic::service::Interceptor,
4083            T::ResponseBody: Default,
4084            T: tonic::codegen::Service<
4085                http::Request<tonic::body::Body>,
4086                Response = http::Response<
4087                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4088                >,
4089            >,
4090            <T as tonic::codegen::Service<
4091                http::Request<tonic::body::Body>,
4092            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4093        {
4094            MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
4095        }
4096        /// Compress requests with the given encoding.
4097        ///
4098        /// This requires the server to support it otherwise it might respond with an
4099        /// error.
4100        #[must_use]
4101        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4102            self.inner = self.inner.send_compressed(encoding);
4103            self
4104        }
4105        /// Enable decompressing responses.
4106        #[must_use]
4107        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4108            self.inner = self.inner.accept_compressed(encoding);
4109            self
4110        }
4111        /// Limits the maximum size of a decoded message.
4112        ///
4113        /// Default: `4MB`
4114        #[must_use]
4115        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4116            self.inner = self.inner.max_decoding_message_size(limit);
4117            self
4118        }
4119        /// Limits the maximum size of an encoded message.
4120        ///
4121        /// Default: `usize::MAX`
4122        #[must_use]
4123        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4124            self.inner = self.inner.max_encoding_message_size(limit);
4125            self
4126        }
4127        pub async fn get_package(
4128            &mut self,
4129            request: impl tonic::IntoRequest<super::GetPackageRequest>,
4130        ) -> std::result::Result<
4131            tonic::Response<super::GetPackageResponse>,
4132            tonic::Status,
4133        > {
4134            self.inner
4135                .ready()
4136                .await
4137                .map_err(|e| {
4138                    tonic::Status::unknown(
4139                        format!("Service was not ready: {}", e.into()),
4140                    )
4141                })?;
4142            let codec = tonic_prost::ProstCodec::default();
4143            let path = http::uri::PathAndQuery::from_static(
4144                "/sui.rpc.v2.MovePackageService/GetPackage",
4145            );
4146            let mut req = request.into_request();
4147            req.extensions_mut()
4148                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
4149            self.inner.unary(req, path, codec).await
4150        }
4151        pub async fn get_datatype(
4152            &mut self,
4153            request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
4154        ) -> std::result::Result<
4155            tonic::Response<super::GetDatatypeResponse>,
4156            tonic::Status,
4157        > {
4158            self.inner
4159                .ready()
4160                .await
4161                .map_err(|e| {
4162                    tonic::Status::unknown(
4163                        format!("Service was not ready: {}", e.into()),
4164                    )
4165                })?;
4166            let codec = tonic_prost::ProstCodec::default();
4167            let path = http::uri::PathAndQuery::from_static(
4168                "/sui.rpc.v2.MovePackageService/GetDatatype",
4169            );
4170            let mut req = request.into_request();
4171            req.extensions_mut()
4172                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
4173            self.inner.unary(req, path, codec).await
4174        }
4175        pub async fn get_function(
4176            &mut self,
4177            request: impl tonic::IntoRequest<super::GetFunctionRequest>,
4178        ) -> std::result::Result<
4179            tonic::Response<super::GetFunctionResponse>,
4180            tonic::Status,
4181        > {
4182            self.inner
4183                .ready()
4184                .await
4185                .map_err(|e| {
4186                    tonic::Status::unknown(
4187                        format!("Service was not ready: {}", e.into()),
4188                    )
4189                })?;
4190            let codec = tonic_prost::ProstCodec::default();
4191            let path = http::uri::PathAndQuery::from_static(
4192                "/sui.rpc.v2.MovePackageService/GetFunction",
4193            );
4194            let mut req = request.into_request();
4195            req.extensions_mut()
4196                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
4197            self.inner.unary(req, path, codec).await
4198        }
4199        pub async fn list_package_versions(
4200            &mut self,
4201            request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
4202        ) -> std::result::Result<
4203            tonic::Response<super::ListPackageVersionsResponse>,
4204            tonic::Status,
4205        > {
4206            self.inner
4207                .ready()
4208                .await
4209                .map_err(|e| {
4210                    tonic::Status::unknown(
4211                        format!("Service was not ready: {}", e.into()),
4212                    )
4213                })?;
4214            let codec = tonic_prost::ProstCodec::default();
4215            let path = http::uri::PathAndQuery::from_static(
4216                "/sui.rpc.v2.MovePackageService/ListPackageVersions",
4217            );
4218            let mut req = request.into_request();
4219            req.extensions_mut()
4220                .insert(
4221                    GrpcMethod::new(
4222                        "sui.rpc.v2.MovePackageService",
4223                        "ListPackageVersions",
4224                    ),
4225                );
4226            self.inner.unary(req, path, codec).await
4227        }
4228    }
4229}
4230/// Generated server implementations.
4231pub mod move_package_service_server {
4232    #![allow(
4233        unused_variables,
4234        dead_code,
4235        missing_docs,
4236        clippy::wildcard_imports,
4237        clippy::let_unit_value,
4238    )]
4239    use tonic::codegen::*;
4240    /// Generated trait containing gRPC methods that should be implemented for use with MovePackageServiceServer.
4241    #[async_trait]
4242    pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
4243        async fn get_package(
4244            &self,
4245            request: tonic::Request<super::GetPackageRequest>,
4246        ) -> std::result::Result<
4247            tonic::Response<super::GetPackageResponse>,
4248            tonic::Status,
4249        > {
4250            Err(tonic::Status::unimplemented("Not yet implemented"))
4251        }
4252        async fn get_datatype(
4253            &self,
4254            request: tonic::Request<super::GetDatatypeRequest>,
4255        ) -> std::result::Result<
4256            tonic::Response<super::GetDatatypeResponse>,
4257            tonic::Status,
4258        > {
4259            Err(tonic::Status::unimplemented("Not yet implemented"))
4260        }
4261        async fn get_function(
4262            &self,
4263            request: tonic::Request<super::GetFunctionRequest>,
4264        ) -> std::result::Result<
4265            tonic::Response<super::GetFunctionResponse>,
4266            tonic::Status,
4267        > {
4268            Err(tonic::Status::unimplemented("Not yet implemented"))
4269        }
4270        async fn list_package_versions(
4271            &self,
4272            request: tonic::Request<super::ListPackageVersionsRequest>,
4273        ) -> std::result::Result<
4274            tonic::Response<super::ListPackageVersionsResponse>,
4275            tonic::Status,
4276        > {
4277            Err(tonic::Status::unimplemented("Not yet implemented"))
4278        }
4279    }
4280    #[derive(Debug)]
4281    pub struct MovePackageServiceServer<T> {
4282        inner: Arc<T>,
4283        accept_compression_encodings: EnabledCompressionEncodings,
4284        send_compression_encodings: EnabledCompressionEncodings,
4285        max_decoding_message_size: Option<usize>,
4286        max_encoding_message_size: Option<usize>,
4287    }
4288    impl<T> MovePackageServiceServer<T> {
4289        pub fn new(inner: T) -> Self {
4290            Self::from_arc(Arc::new(inner))
4291        }
4292        pub fn from_arc(inner: Arc<T>) -> Self {
4293            Self {
4294                inner,
4295                accept_compression_encodings: Default::default(),
4296                send_compression_encodings: Default::default(),
4297                max_decoding_message_size: None,
4298                max_encoding_message_size: None,
4299            }
4300        }
4301        pub fn with_interceptor<F>(
4302            inner: T,
4303            interceptor: F,
4304        ) -> InterceptedService<Self, F>
4305        where
4306            F: tonic::service::Interceptor,
4307        {
4308            InterceptedService::new(Self::new(inner), interceptor)
4309        }
4310        /// Enable decompressing requests with the given encoding.
4311        #[must_use]
4312        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4313            self.accept_compression_encodings.enable(encoding);
4314            self
4315        }
4316        /// Compress responses with the given encoding, if the client supports it.
4317        #[must_use]
4318        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4319            self.send_compression_encodings.enable(encoding);
4320            self
4321        }
4322        /// Limits the maximum size of a decoded message.
4323        ///
4324        /// Default: `4MB`
4325        #[must_use]
4326        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4327            self.max_decoding_message_size = Some(limit);
4328            self
4329        }
4330        /// Limits the maximum size of an encoded message.
4331        ///
4332        /// Default: `usize::MAX`
4333        #[must_use]
4334        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4335            self.max_encoding_message_size = Some(limit);
4336            self
4337        }
4338    }
4339    impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
4340    where
4341        T: MovePackageService,
4342        B: Body + std::marker::Send + 'static,
4343        B::Error: Into<StdError> + std::marker::Send + 'static,
4344    {
4345        type Response = http::Response<tonic::body::Body>;
4346        type Error = std::convert::Infallible;
4347        type Future = BoxFuture<Self::Response, Self::Error>;
4348        fn poll_ready(
4349            &mut self,
4350            _cx: &mut Context<'_>,
4351        ) -> Poll<std::result::Result<(), Self::Error>> {
4352            Poll::Ready(Ok(()))
4353        }
4354        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4355            match req.uri().path() {
4356                "/sui.rpc.v2.MovePackageService/GetPackage" => {
4357                    #[allow(non_camel_case_types)]
4358                    struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
4359                    impl<
4360                        T: MovePackageService,
4361                    > tonic::server::UnaryService<super::GetPackageRequest>
4362                    for GetPackageSvc<T> {
4363                        type Response = super::GetPackageResponse;
4364                        type Future = BoxFuture<
4365                            tonic::Response<Self::Response>,
4366                            tonic::Status,
4367                        >;
4368                        fn call(
4369                            &mut self,
4370                            request: tonic::Request<super::GetPackageRequest>,
4371                        ) -> Self::Future {
4372                            let inner = Arc::clone(&self.0);
4373                            let fut = async move {
4374                                <T as MovePackageService>::get_package(&inner, request)
4375                                    .await
4376                            };
4377                            Box::pin(fut)
4378                        }
4379                    }
4380                    let accept_compression_encodings = self.accept_compression_encodings;
4381                    let send_compression_encodings = self.send_compression_encodings;
4382                    let max_decoding_message_size = self.max_decoding_message_size;
4383                    let max_encoding_message_size = self.max_encoding_message_size;
4384                    let inner = self.inner.clone();
4385                    let fut = async move {
4386                        let method = GetPackageSvc(inner);
4387                        let codec = tonic_prost::ProstCodec::default();
4388                        let mut grpc = tonic::server::Grpc::new(codec)
4389                            .apply_compression_config(
4390                                accept_compression_encodings,
4391                                send_compression_encodings,
4392                            )
4393                            .apply_max_message_size_config(
4394                                max_decoding_message_size,
4395                                max_encoding_message_size,
4396                            );
4397                        let res = grpc.unary(method, req).await;
4398                        Ok(res)
4399                    };
4400                    Box::pin(fut)
4401                }
4402                "/sui.rpc.v2.MovePackageService/GetDatatype" => {
4403                    #[allow(non_camel_case_types)]
4404                    struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
4405                    impl<
4406                        T: MovePackageService,
4407                    > tonic::server::UnaryService<super::GetDatatypeRequest>
4408                    for GetDatatypeSvc<T> {
4409                        type Response = super::GetDatatypeResponse;
4410                        type Future = BoxFuture<
4411                            tonic::Response<Self::Response>,
4412                            tonic::Status,
4413                        >;
4414                        fn call(
4415                            &mut self,
4416                            request: tonic::Request<super::GetDatatypeRequest>,
4417                        ) -> Self::Future {
4418                            let inner = Arc::clone(&self.0);
4419                            let fut = async move {
4420                                <T as MovePackageService>::get_datatype(&inner, request)
4421                                    .await
4422                            };
4423                            Box::pin(fut)
4424                        }
4425                    }
4426                    let accept_compression_encodings = self.accept_compression_encodings;
4427                    let send_compression_encodings = self.send_compression_encodings;
4428                    let max_decoding_message_size = self.max_decoding_message_size;
4429                    let max_encoding_message_size = self.max_encoding_message_size;
4430                    let inner = self.inner.clone();
4431                    let fut = async move {
4432                        let method = GetDatatypeSvc(inner);
4433                        let codec = tonic_prost::ProstCodec::default();
4434                        let mut grpc = tonic::server::Grpc::new(codec)
4435                            .apply_compression_config(
4436                                accept_compression_encodings,
4437                                send_compression_encodings,
4438                            )
4439                            .apply_max_message_size_config(
4440                                max_decoding_message_size,
4441                                max_encoding_message_size,
4442                            );
4443                        let res = grpc.unary(method, req).await;
4444                        Ok(res)
4445                    };
4446                    Box::pin(fut)
4447                }
4448                "/sui.rpc.v2.MovePackageService/GetFunction" => {
4449                    #[allow(non_camel_case_types)]
4450                    struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
4451                    impl<
4452                        T: MovePackageService,
4453                    > tonic::server::UnaryService<super::GetFunctionRequest>
4454                    for GetFunctionSvc<T> {
4455                        type Response = super::GetFunctionResponse;
4456                        type Future = BoxFuture<
4457                            tonic::Response<Self::Response>,
4458                            tonic::Status,
4459                        >;
4460                        fn call(
4461                            &mut self,
4462                            request: tonic::Request<super::GetFunctionRequest>,
4463                        ) -> Self::Future {
4464                            let inner = Arc::clone(&self.0);
4465                            let fut = async move {
4466                                <T as MovePackageService>::get_function(&inner, request)
4467                                    .await
4468                            };
4469                            Box::pin(fut)
4470                        }
4471                    }
4472                    let accept_compression_encodings = self.accept_compression_encodings;
4473                    let send_compression_encodings = self.send_compression_encodings;
4474                    let max_decoding_message_size = self.max_decoding_message_size;
4475                    let max_encoding_message_size = self.max_encoding_message_size;
4476                    let inner = self.inner.clone();
4477                    let fut = async move {
4478                        let method = GetFunctionSvc(inner);
4479                        let codec = tonic_prost::ProstCodec::default();
4480                        let mut grpc = tonic::server::Grpc::new(codec)
4481                            .apply_compression_config(
4482                                accept_compression_encodings,
4483                                send_compression_encodings,
4484                            )
4485                            .apply_max_message_size_config(
4486                                max_decoding_message_size,
4487                                max_encoding_message_size,
4488                            );
4489                        let res = grpc.unary(method, req).await;
4490                        Ok(res)
4491                    };
4492                    Box::pin(fut)
4493                }
4494                "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
4495                    #[allow(non_camel_case_types)]
4496                    struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
4497                    impl<
4498                        T: MovePackageService,
4499                    > tonic::server::UnaryService<super::ListPackageVersionsRequest>
4500                    for ListPackageVersionsSvc<T> {
4501                        type Response = super::ListPackageVersionsResponse;
4502                        type Future = BoxFuture<
4503                            tonic::Response<Self::Response>,
4504                            tonic::Status,
4505                        >;
4506                        fn call(
4507                            &mut self,
4508                            request: tonic::Request<super::ListPackageVersionsRequest>,
4509                        ) -> Self::Future {
4510                            let inner = Arc::clone(&self.0);
4511                            let fut = async move {
4512                                <T as MovePackageService>::list_package_versions(
4513                                        &inner,
4514                                        request,
4515                                    )
4516                                    .await
4517                            };
4518                            Box::pin(fut)
4519                        }
4520                    }
4521                    let accept_compression_encodings = self.accept_compression_encodings;
4522                    let send_compression_encodings = self.send_compression_encodings;
4523                    let max_decoding_message_size = self.max_decoding_message_size;
4524                    let max_encoding_message_size = self.max_encoding_message_size;
4525                    let inner = self.inner.clone();
4526                    let fut = async move {
4527                        let method = ListPackageVersionsSvc(inner);
4528                        let codec = tonic_prost::ProstCodec::default();
4529                        let mut grpc = tonic::server::Grpc::new(codec)
4530                            .apply_compression_config(
4531                                accept_compression_encodings,
4532                                send_compression_encodings,
4533                            )
4534                            .apply_max_message_size_config(
4535                                max_decoding_message_size,
4536                                max_encoding_message_size,
4537                            );
4538                        let res = grpc.unary(method, req).await;
4539                        Ok(res)
4540                    };
4541                    Box::pin(fut)
4542                }
4543                _ => {
4544                    Box::pin(async move {
4545                        let mut response = http::Response::new(
4546                            tonic::body::Body::default(),
4547                        );
4548                        let headers = response.headers_mut();
4549                        headers
4550                            .insert(
4551                                tonic::Status::GRPC_STATUS,
4552                                (tonic::Code::Unimplemented as i32).into(),
4553                            );
4554                        headers
4555                            .insert(
4556                                http::header::CONTENT_TYPE,
4557                                tonic::metadata::GRPC_CONTENT_TYPE,
4558                            );
4559                        Ok(response)
4560                    })
4561                }
4562            }
4563        }
4564    }
4565    impl<T> Clone for MovePackageServiceServer<T> {
4566        fn clone(&self) -> Self {
4567            let inner = self.inner.clone();
4568            Self {
4569                inner,
4570                accept_compression_encodings: self.accept_compression_encodings,
4571                send_compression_encodings: self.send_compression_encodings,
4572                max_decoding_message_size: self.max_decoding_message_size,
4573                max_encoding_message_size: self.max_encoding_message_size,
4574            }
4575        }
4576    }
4577    /// Generated gRPC service name
4578    pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
4579    impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
4580        const NAME: &'static str = SERVICE_NAME;
4581    }
4582}
4583#[non_exhaustive]
4584#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4585pub struct LookupNameRequest {
4586    /// Required. The SuiNS name to lookup.
4587    ///
4588    /// Supports both `@name` as well as `name.sui` formats.
4589    #[prost(string, optional, tag = "1")]
4590    pub name: ::core::option::Option<::prost::alloc::string::String>,
4591}
4592#[non_exhaustive]
4593#[derive(Clone, PartialEq, ::prost::Message)]
4594pub struct LookupNameResponse {
4595    /// The record for the requested name
4596    #[prost(message, optional, tag = "1")]
4597    pub record: ::core::option::Option<NameRecord>,
4598}
4599#[non_exhaustive]
4600#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4601pub struct ReverseLookupNameRequest {
4602    /// Required. The address to perform a reverse lookup for.
4603    #[prost(string, optional, tag = "1")]
4604    pub address: ::core::option::Option<::prost::alloc::string::String>,
4605}
4606#[non_exhaustive]
4607#[derive(Clone, PartialEq, ::prost::Message)]
4608pub struct ReverseLookupNameResponse {
4609    /// The record for the SuiNS name linked to the requested address
4610    #[prost(message, optional, tag = "1")]
4611    pub record: ::core::option::Option<NameRecord>,
4612}
4613#[non_exhaustive]
4614#[derive(Clone, PartialEq, ::prost::Message)]
4615pub struct NameRecord {
4616    /// Id of this record.
4617    ///
4618    /// Note that records are stored on chain as dynamic fields of the type
4619    /// `Field<Domain,NameRecord>`.
4620    #[prost(string, optional, tag = "1")]
4621    pub id: ::core::option::Option<::prost::alloc::string::String>,
4622    /// The SuiNS name of this record
4623    #[prost(string, optional, tag = "2")]
4624    pub name: ::core::option::Option<::prost::alloc::string::String>,
4625    /// The ID of the `RegistrationNFT` assigned to this record.
4626    ///
4627    /// The owner of the corresponding `RegistrationNFT` has the rights to
4628    /// be able to change and adjust the `target_address` of this domain.
4629    ///
4630    /// It is possible that the ID changes if the record expires and is
4631    /// purchased by someone else.
4632    #[prost(string, optional, tag = "3")]
4633    pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
4634    /// Timestamp when the record expires.
4635    ///
4636    /// This is either the expiration of the record itself or the expiration of
4637    /// this record's parent if this is a leaf record.
4638    #[prost(message, optional, tag = "4")]
4639    pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
4640    /// The target address that this name points to
4641    #[prost(string, optional, tag = "5")]
4642    pub target_address: ::core::option::Option<::prost::alloc::string::String>,
4643    /// Additional data which may be stored in a record
4644    #[prost(btree_map = "string, string", tag = "6")]
4645    pub data: ::prost::alloc::collections::BTreeMap<
4646        ::prost::alloc::string::String,
4647        ::prost::alloc::string::String,
4648    >,
4649}
4650/// Generated client implementations.
4651pub mod name_service_client {
4652    #![allow(
4653        unused_variables,
4654        dead_code,
4655        missing_docs,
4656        clippy::wildcard_imports,
4657        clippy::let_unit_value,
4658    )]
4659    use tonic::codegen::*;
4660    use tonic::codegen::http::Uri;
4661    #[derive(Debug, Clone)]
4662    pub struct NameServiceClient<T> {
4663        inner: tonic::client::Grpc<T>,
4664    }
4665    impl NameServiceClient<tonic::transport::Channel> {
4666        /// Attempt to create a new client by connecting to a given endpoint.
4667        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4668        where
4669            D: TryInto<tonic::transport::Endpoint>,
4670            D::Error: Into<StdError>,
4671        {
4672            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4673            Ok(Self::new(conn))
4674        }
4675    }
4676    impl<T> NameServiceClient<T>
4677    where
4678        T: tonic::client::GrpcService<tonic::body::Body>,
4679        T::Error: Into<StdError>,
4680        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4681        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4682    {
4683        pub fn new(inner: T) -> Self {
4684            let inner = tonic::client::Grpc::new(inner);
4685            Self { inner }
4686        }
4687        pub fn with_origin(inner: T, origin: Uri) -> Self {
4688            let inner = tonic::client::Grpc::with_origin(inner, origin);
4689            Self { inner }
4690        }
4691        pub fn with_interceptor<F>(
4692            inner: T,
4693            interceptor: F,
4694        ) -> NameServiceClient<InterceptedService<T, F>>
4695        where
4696            F: tonic::service::Interceptor,
4697            T::ResponseBody: Default,
4698            T: tonic::codegen::Service<
4699                http::Request<tonic::body::Body>,
4700                Response = http::Response<
4701                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4702                >,
4703            >,
4704            <T as tonic::codegen::Service<
4705                http::Request<tonic::body::Body>,
4706            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4707        {
4708            NameServiceClient::new(InterceptedService::new(inner, interceptor))
4709        }
4710        /// Compress requests with the given encoding.
4711        ///
4712        /// This requires the server to support it otherwise it might respond with an
4713        /// error.
4714        #[must_use]
4715        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4716            self.inner = self.inner.send_compressed(encoding);
4717            self
4718        }
4719        /// Enable decompressing responses.
4720        #[must_use]
4721        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4722            self.inner = self.inner.accept_compressed(encoding);
4723            self
4724        }
4725        /// Limits the maximum size of a decoded message.
4726        ///
4727        /// Default: `4MB`
4728        #[must_use]
4729        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4730            self.inner = self.inner.max_decoding_message_size(limit);
4731            self
4732        }
4733        /// Limits the maximum size of an encoded message.
4734        ///
4735        /// Default: `usize::MAX`
4736        #[must_use]
4737        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4738            self.inner = self.inner.max_encoding_message_size(limit);
4739            self
4740        }
4741        pub async fn lookup_name(
4742            &mut self,
4743            request: impl tonic::IntoRequest<super::LookupNameRequest>,
4744        ) -> std::result::Result<
4745            tonic::Response<super::LookupNameResponse>,
4746            tonic::Status,
4747        > {
4748            self.inner
4749                .ready()
4750                .await
4751                .map_err(|e| {
4752                    tonic::Status::unknown(
4753                        format!("Service was not ready: {}", e.into()),
4754                    )
4755                })?;
4756            let codec = tonic_prost::ProstCodec::default();
4757            let path = http::uri::PathAndQuery::from_static(
4758                "/sui.rpc.v2.NameService/LookupName",
4759            );
4760            let mut req = request.into_request();
4761            req.extensions_mut()
4762                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
4763            self.inner.unary(req, path, codec).await
4764        }
4765        pub async fn reverse_lookup_name(
4766            &mut self,
4767            request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
4768        ) -> std::result::Result<
4769            tonic::Response<super::ReverseLookupNameResponse>,
4770            tonic::Status,
4771        > {
4772            self.inner
4773                .ready()
4774                .await
4775                .map_err(|e| {
4776                    tonic::Status::unknown(
4777                        format!("Service was not ready: {}", e.into()),
4778                    )
4779                })?;
4780            let codec = tonic_prost::ProstCodec::default();
4781            let path = http::uri::PathAndQuery::from_static(
4782                "/sui.rpc.v2.NameService/ReverseLookupName",
4783            );
4784            let mut req = request.into_request();
4785            req.extensions_mut()
4786                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
4787            self.inner.unary(req, path, codec).await
4788        }
4789    }
4790}
4791/// Generated server implementations.
4792pub mod name_service_server {
4793    #![allow(
4794        unused_variables,
4795        dead_code,
4796        missing_docs,
4797        clippy::wildcard_imports,
4798        clippy::let_unit_value,
4799    )]
4800    use tonic::codegen::*;
4801    /// Generated trait containing gRPC methods that should be implemented for use with NameServiceServer.
4802    #[async_trait]
4803    pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
4804        async fn lookup_name(
4805            &self,
4806            request: tonic::Request<super::LookupNameRequest>,
4807        ) -> std::result::Result<
4808            tonic::Response<super::LookupNameResponse>,
4809            tonic::Status,
4810        > {
4811            Err(tonic::Status::unimplemented("Not yet implemented"))
4812        }
4813        async fn reverse_lookup_name(
4814            &self,
4815            request: tonic::Request<super::ReverseLookupNameRequest>,
4816        ) -> std::result::Result<
4817            tonic::Response<super::ReverseLookupNameResponse>,
4818            tonic::Status,
4819        > {
4820            Err(tonic::Status::unimplemented("Not yet implemented"))
4821        }
4822    }
4823    #[derive(Debug)]
4824    pub struct NameServiceServer<T> {
4825        inner: Arc<T>,
4826        accept_compression_encodings: EnabledCompressionEncodings,
4827        send_compression_encodings: EnabledCompressionEncodings,
4828        max_decoding_message_size: Option<usize>,
4829        max_encoding_message_size: Option<usize>,
4830    }
4831    impl<T> NameServiceServer<T> {
4832        pub fn new(inner: T) -> Self {
4833            Self::from_arc(Arc::new(inner))
4834        }
4835        pub fn from_arc(inner: Arc<T>) -> Self {
4836            Self {
4837                inner,
4838                accept_compression_encodings: Default::default(),
4839                send_compression_encodings: Default::default(),
4840                max_decoding_message_size: None,
4841                max_encoding_message_size: None,
4842            }
4843        }
4844        pub fn with_interceptor<F>(
4845            inner: T,
4846            interceptor: F,
4847        ) -> InterceptedService<Self, F>
4848        where
4849            F: tonic::service::Interceptor,
4850        {
4851            InterceptedService::new(Self::new(inner), interceptor)
4852        }
4853        /// Enable decompressing requests with the given encoding.
4854        #[must_use]
4855        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4856            self.accept_compression_encodings.enable(encoding);
4857            self
4858        }
4859        /// Compress responses with the given encoding, if the client supports it.
4860        #[must_use]
4861        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4862            self.send_compression_encodings.enable(encoding);
4863            self
4864        }
4865        /// Limits the maximum size of a decoded message.
4866        ///
4867        /// Default: `4MB`
4868        #[must_use]
4869        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4870            self.max_decoding_message_size = Some(limit);
4871            self
4872        }
4873        /// Limits the maximum size of an encoded message.
4874        ///
4875        /// Default: `usize::MAX`
4876        #[must_use]
4877        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4878            self.max_encoding_message_size = Some(limit);
4879            self
4880        }
4881    }
4882    impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
4883    where
4884        T: NameService,
4885        B: Body + std::marker::Send + 'static,
4886        B::Error: Into<StdError> + std::marker::Send + 'static,
4887    {
4888        type Response = http::Response<tonic::body::Body>;
4889        type Error = std::convert::Infallible;
4890        type Future = BoxFuture<Self::Response, Self::Error>;
4891        fn poll_ready(
4892            &mut self,
4893            _cx: &mut Context<'_>,
4894        ) -> Poll<std::result::Result<(), Self::Error>> {
4895            Poll::Ready(Ok(()))
4896        }
4897        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4898            match req.uri().path() {
4899                "/sui.rpc.v2.NameService/LookupName" => {
4900                    #[allow(non_camel_case_types)]
4901                    struct LookupNameSvc<T: NameService>(pub Arc<T>);
4902                    impl<
4903                        T: NameService,
4904                    > tonic::server::UnaryService<super::LookupNameRequest>
4905                    for LookupNameSvc<T> {
4906                        type Response = super::LookupNameResponse;
4907                        type Future = BoxFuture<
4908                            tonic::Response<Self::Response>,
4909                            tonic::Status,
4910                        >;
4911                        fn call(
4912                            &mut self,
4913                            request: tonic::Request<super::LookupNameRequest>,
4914                        ) -> Self::Future {
4915                            let inner = Arc::clone(&self.0);
4916                            let fut = async move {
4917                                <T as NameService>::lookup_name(&inner, request).await
4918                            };
4919                            Box::pin(fut)
4920                        }
4921                    }
4922                    let accept_compression_encodings = self.accept_compression_encodings;
4923                    let send_compression_encodings = self.send_compression_encodings;
4924                    let max_decoding_message_size = self.max_decoding_message_size;
4925                    let max_encoding_message_size = self.max_encoding_message_size;
4926                    let inner = self.inner.clone();
4927                    let fut = async move {
4928                        let method = LookupNameSvc(inner);
4929                        let codec = tonic_prost::ProstCodec::default();
4930                        let mut grpc = tonic::server::Grpc::new(codec)
4931                            .apply_compression_config(
4932                                accept_compression_encodings,
4933                                send_compression_encodings,
4934                            )
4935                            .apply_max_message_size_config(
4936                                max_decoding_message_size,
4937                                max_encoding_message_size,
4938                            );
4939                        let res = grpc.unary(method, req).await;
4940                        Ok(res)
4941                    };
4942                    Box::pin(fut)
4943                }
4944                "/sui.rpc.v2.NameService/ReverseLookupName" => {
4945                    #[allow(non_camel_case_types)]
4946                    struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
4947                    impl<
4948                        T: NameService,
4949                    > tonic::server::UnaryService<super::ReverseLookupNameRequest>
4950                    for ReverseLookupNameSvc<T> {
4951                        type Response = super::ReverseLookupNameResponse;
4952                        type Future = BoxFuture<
4953                            tonic::Response<Self::Response>,
4954                            tonic::Status,
4955                        >;
4956                        fn call(
4957                            &mut self,
4958                            request: tonic::Request<super::ReverseLookupNameRequest>,
4959                        ) -> Self::Future {
4960                            let inner = Arc::clone(&self.0);
4961                            let fut = async move {
4962                                <T as NameService>::reverse_lookup_name(&inner, request)
4963                                    .await
4964                            };
4965                            Box::pin(fut)
4966                        }
4967                    }
4968                    let accept_compression_encodings = self.accept_compression_encodings;
4969                    let send_compression_encodings = self.send_compression_encodings;
4970                    let max_decoding_message_size = self.max_decoding_message_size;
4971                    let max_encoding_message_size = self.max_encoding_message_size;
4972                    let inner = self.inner.clone();
4973                    let fut = async move {
4974                        let method = ReverseLookupNameSvc(inner);
4975                        let codec = tonic_prost::ProstCodec::default();
4976                        let mut grpc = tonic::server::Grpc::new(codec)
4977                            .apply_compression_config(
4978                                accept_compression_encodings,
4979                                send_compression_encodings,
4980                            )
4981                            .apply_max_message_size_config(
4982                                max_decoding_message_size,
4983                                max_encoding_message_size,
4984                            );
4985                        let res = grpc.unary(method, req).await;
4986                        Ok(res)
4987                    };
4988                    Box::pin(fut)
4989                }
4990                _ => {
4991                    Box::pin(async move {
4992                        let mut response = http::Response::new(
4993                            tonic::body::Body::default(),
4994                        );
4995                        let headers = response.headers_mut();
4996                        headers
4997                            .insert(
4998                                tonic::Status::GRPC_STATUS,
4999                                (tonic::Code::Unimplemented as i32).into(),
5000                            );
5001                        headers
5002                            .insert(
5003                                http::header::CONTENT_TYPE,
5004                                tonic::metadata::GRPC_CONTENT_TYPE,
5005                            );
5006                        Ok(response)
5007                    })
5008                }
5009            }
5010        }
5011    }
5012    impl<T> Clone for NameServiceServer<T> {
5013        fn clone(&self) -> Self {
5014            let inner = self.inner.clone();
5015            Self {
5016                inner,
5017                accept_compression_encodings: self.accept_compression_encodings,
5018                send_compression_encodings: self.send_compression_encodings,
5019                max_decoding_message_size: self.max_decoding_message_size,
5020                max_encoding_message_size: self.max_encoding_message_size,
5021            }
5022        }
5023    }
5024    /// Generated gRPC service name
5025    pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
5026    impl<T> tonic::server::NamedService for NameServiceServer<T> {
5027        const NAME: &'static str = SERVICE_NAME;
5028    }
5029}
5030/// An object on the Sui blockchain.
5031#[non_exhaustive]
5032#[derive(Clone, PartialEq, ::prost::Message)]
5033pub struct Object {
5034    /// This Object serialized as BCS.
5035    #[prost(message, optional, tag = "1")]
5036    pub bcs: ::core::option::Option<Bcs>,
5037    /// `ObjectId` for this object.
5038    #[prost(string, optional, tag = "2")]
5039    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5040    /// Version of the object.
5041    #[prost(uint64, optional, tag = "3")]
5042    pub version: ::core::option::Option<u64>,
5043    /// The digest of this Object.
5044    #[prost(string, optional, tag = "4")]
5045    pub digest: ::core::option::Option<::prost::alloc::string::String>,
5046    /// Owner of the object.
5047    #[prost(message, optional, tag = "5")]
5048    pub owner: ::core::option::Option<Owner>,
5049    /// The type of this object.
5050    ///
5051    /// This will be 'package' for packages and a StructTag for move structs.
5052    #[prost(string, optional, tag = "6")]
5053    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5054    /// DEPRECATED this field is no longer used to determine whether a tx can transfer this
5055    /// object. Instead, it is always calculated from the objects type when loaded in execution.
5056    ///
5057    /// Only set for Move structs
5058    #[prost(bool, optional, tag = "7")]
5059    pub has_public_transfer: ::core::option::Option<bool>,
5060    /// BCS bytes of a Move struct value.
5061    ///
5062    /// Only set for Move structs
5063    #[prost(message, optional, tag = "8")]
5064    pub contents: ::core::option::Option<Bcs>,
5065    /// Package information for Move Packages
5066    #[prost(message, optional, tag = "9")]
5067    pub package: ::core::option::Option<Package>,
5068    /// The digest of the transaction that created or last mutated this object
5069    #[prost(string, optional, tag = "10")]
5070    pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
5071    /// The amount of SUI to rebate if this object gets deleted.
5072    /// This number is re-calculated each time the object is mutated based on
5073    /// the present storage gas price.
5074    #[prost(uint64, optional, tag = "11")]
5075    pub storage_rebate: ::core::option::Option<u64>,
5076    /// JSON rendering of the object.
5077    #[prost(message, optional, boxed, tag = "100")]
5078    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
5079    /// Current balance if this object is a `0x2::coin::Coin<T>`
5080    #[prost(uint64, optional, tag = "101")]
5081    pub balance: ::core::option::Option<u64>,
5082    /// JSON rendering of the object based on an on-chain template.
5083    /// This will not be set if the value's type does not have an associated `Display` template.
5084    #[prost(message, optional, boxed, tag = "102")]
5085    pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
5086}
5087/// Set of Objects
5088#[non_exhaustive]
5089#[derive(Clone, PartialEq, ::prost::Message)]
5090pub struct ObjectSet {
5091    /// Objects are sorted by the key `(object_id, version)`.
5092    #[prost(message, repeated, tag = "1")]
5093    pub objects: ::prost::alloc::vec::Vec<Object>,
5094}
5095/// A rendered JSON blob based on an on-chain template.
5096#[non_exhaustive]
5097#[derive(Clone, PartialEq, ::prost::Message)]
5098pub struct Display {
5099    /// Output for all successfully substituted display fields. Unsuccessful
5100    /// fields will be `null`, and will be accompanied by a field in `errors`,
5101    /// explaining the error.
5102    #[prost(message, optional, tag = "1")]
5103    pub output: ::core::option::Option<::prost_types::Value>,
5104    /// If any fields failed to render, this will contain a mapping from failed
5105    /// field names to error messages. If all fields succeed, this will either be
5106    /// `null` or not set.
5107    #[prost(message, optional, tag = "2")]
5108    pub errors: ::core::option::Option<::prost_types::Value>,
5109}
5110/// Reference to an object.
5111#[non_exhaustive]
5112#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5113pub struct ObjectReference {
5114    /// The object id of this object.
5115    #[prost(string, optional, tag = "1")]
5116    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5117    /// The version of this object.
5118    #[prost(uint64, optional, tag = "2")]
5119    pub version: ::core::option::Option<u64>,
5120    /// The digest of this object.
5121    #[prost(string, optional, tag = "3")]
5122    pub digest: ::core::option::Option<::prost::alloc::string::String>,
5123}
5124/// Enum of different types of ownership for an object.
5125#[non_exhaustive]
5126#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5127pub struct Owner {
5128    #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
5129    pub kind: ::core::option::Option<i32>,
5130    /// Address or ObjectId of the owner
5131    #[prost(string, optional, tag = "2")]
5132    pub address: ::core::option::Option<::prost::alloc::string::String>,
5133    /// The `initial_shared_version` if kind is `SHARED` or `start_version` if kind `CONSENSUS_ADDRESS`.
5134    #[prost(uint64, optional, tag = "3")]
5135    pub version: ::core::option::Option<u64>,
5136}
5137/// Nested message and enum types in `Owner`.
5138pub mod owner {
5139    #[non_exhaustive]
5140    #[derive(
5141        Clone,
5142        Copy,
5143        Debug,
5144        PartialEq,
5145        Eq,
5146        Hash,
5147        PartialOrd,
5148        Ord,
5149        ::prost::Enumeration
5150    )]
5151    #[repr(i32)]
5152    pub enum OwnerKind {
5153        Unknown = 0,
5154        Address = 1,
5155        Object = 2,
5156        Shared = 3,
5157        Immutable = 4,
5158        ConsensusAddress = 5,
5159    }
5160    impl OwnerKind {
5161        /// String value of the enum field names used in the ProtoBuf definition.
5162        ///
5163        /// The values are not transformed in any way and thus are considered stable
5164        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5165        pub fn as_str_name(&self) -> &'static str {
5166            match self {
5167                Self::Unknown => "OWNER_KIND_UNKNOWN",
5168                Self::Address => "ADDRESS",
5169                Self::Object => "OBJECT",
5170                Self::Shared => "SHARED",
5171                Self::Immutable => "IMMUTABLE",
5172                Self::ConsensusAddress => "CONSENSUS_ADDRESS",
5173            }
5174        }
5175        /// Creates an enum from field names used in the ProtoBuf definition.
5176        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5177            match value {
5178                "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
5179                "ADDRESS" => Some(Self::Address),
5180                "OBJECT" => Some(Self::Object),
5181                "SHARED" => Some(Self::Shared),
5182                "IMMUTABLE" => Some(Self::Immutable),
5183                "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
5184                _ => None,
5185            }
5186        }
5187    }
5188}
5189#[non_exhaustive]
5190#[derive(Clone, PartialEq, ::prost::Message)]
5191pub struct ProtocolConfig {
5192    #[prost(uint64, optional, tag = "1")]
5193    pub protocol_version: ::core::option::Option<u64>,
5194    /// Deprecated in favor of the lossless `configs` field.
5195    #[prost(btree_map = "string, bool", tag = "2")]
5196    pub feature_flags: ::prost::alloc::collections::BTreeMap<
5197        ::prost::alloc::string::String,
5198        bool,
5199    >,
5200    /// Deprecated in favor of the lossless `configs` field.
5201    #[prost(btree_map = "string, string", tag = "3")]
5202    pub attributes: ::prost::alloc::collections::BTreeMap<
5203        ::prost::alloc::string::String,
5204        ::prost::alloc::string::String,
5205    >,
5206    #[prost(btree_map = "string, message", tag = "4")]
5207    pub configs: ::prost::alloc::collections::BTreeMap<
5208        ::prost::alloc::string::String,
5209        ::prost_types::Value,
5210    >,
5211}
5212/// Cursor-bounded query options.
5213///
5214/// `after` and `before` are canonical ledger-position bounds, not
5215/// ordering-relative cursors. `after` always excludes items at or below that
5216/// cursor, and `before` always excludes items at or above that cursor. Ordering
5217/// only controls the order of returned items within the resulting open interval.
5218///
5219/// When a request also specifies a checkpoint range, cursor bounds and
5220/// checkpoint bounds compose by intersection: results come only from ledger
5221/// positions inside both. Checkpoint bounds are likewise canonical and
5222/// ordering-independent.
5223///
5224/// For example, with `after = A`, `before = B`, `ordering = DESCENDING`, and
5225/// `limit = N`, the response contains up to N matching items in descending
5226/// order from the interval `(A, B)`. If the response ends with
5227/// `QUERY_END_REASON_ITEM_LIMIT`, resume by keeping `after = A` and setting
5228/// `before` to the last `Watermark.cursor` received. That cursor is the
5229/// lowest position reached in ledger order, so it becomes the next exclusive
5230/// upper bound.
5231#[non_exhaustive]
5232#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5233pub struct QueryOptions {
5234    /// The maximum number of items to return. Each method applies its own default
5235    /// and maximum. QueryEnd does not count against this limit.
5236    #[prost(uint32, optional, tag = "1")]
5237    pub limit: ::core::option::Option<u32>,
5238    /// Opaque exclusive lower bound. Results must be strictly after this cursor in
5239    /// canonical ledger order.
5240    #[prost(bytes = "bytes", optional, tag = "2")]
5241    pub after: ::core::option::Option<::prost::bytes::Bytes>,
5242    /// Opaque exclusive upper bound. Results must be strictly before this cursor
5243    /// in canonical ledger order.
5244    #[prost(bytes = "bytes", optional, tag = "3")]
5245    pub before: ::core::option::Option<::prost::bytes::Bytes>,
5246    /// Ordering for returned results. Defaults to ASCENDING.
5247    ///
5248    /// Ordering only controls the order of results within the bounded interval;
5249    /// cursor bounds keep the same meaning for ascending and descending reads.
5250    #[prost(enumeration = "Ordering", optional, tag = "4")]
5251    pub ordering: ::core::option::Option<i32>,
5252}
5253/// Progress marker for a query scan. Carried on every response frame, whether or
5254/// not the frame delivers a matching item. Watermarks never regress in the
5255/// requested ordering, but consecutive frames may carry the same watermark when
5256/// additional work does not advance the safe resume frontier.
5257#[non_exhaustive]
5258#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5259pub struct Watermark {
5260    /// Opaque cursor at this scan position. Set on every watermark. Use as
5261    /// `options.after` (ascending) or `options.before` (descending) on the next
5262    /// request to resume from here. The most recently received cursor is always
5263    /// the safe resume point.
5264    #[prost(bytes = "bytes", optional, tag = "1")]
5265    pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
5266    /// The inclusive boundary checkpoint that the scan has fully covered within
5267    /// the request's effective interval, in the request's ordering direction: an
5268    /// ascending scan has emitted every matching item in the interval at
5269    /// checkpoints `<= checkpoint` (strictly greater ones may still hold
5270    /// matches); a descending scan has emitted every matching item in the
5271    /// interval at checkpoints `>= checkpoint`. This boundary never regresses in
5272    /// the scan direction, but it may repeat while the cursor advances.
5273    ///
5274    /// Unset until the scan's first checkpoint is fully covered. For example, a
5275    /// scan resumed from a cursor that lands mid-checkpoint leaves this unset
5276    /// until the next checkpoint boundary in the scan direction is fully covered.
5277    /// A watermark still has a valid resume cursor while this field is unset.
5278    #[prost(uint64, optional, tag = "2")]
5279    pub checkpoint: ::core::option::Option<u64>,
5280}
5281/// Marker for the final frame of a successful query stream. Every successful
5282/// stream sets `QueryEnd` on exactly one frame, after which no further frames
5283/// are sent. That frame always carries the final watermark. For `ItemLimit`, it
5284/// also carries the final matching item; for every other reason it carries no
5285/// item. A ScanLimit terminal watermark may repeat the previous frame's cursor
5286/// when its authoritative scan frontier was already emitted; this does not
5287/// repeat an item.
5288///
5289/// A stream that fails or is cancelled terminates with a gRPC status and does
5290/// not send `QueryEnd`.
5291#[non_exhaustive]
5292#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5293pub struct QueryEnd {
5294    /// Reason this response stopped.
5295    #[prost(enumeration = "QueryEndReason", optional, tag = "1")]
5296    pub reason: ::core::option::Option<i32>,
5297}
5298/// Ordering for the returned result set.
5299#[non_exhaustive]
5300#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5301#[repr(i32)]
5302pub enum Ordering {
5303    /// Return results in increasing cursor order.
5304    Ascending = 0,
5305    /// Return results in decreasing cursor order.
5306    Descending = 1,
5307}
5308impl Ordering {
5309    /// String value of the enum field names used in the ProtoBuf definition.
5310    ///
5311    /// The values are not transformed in any way and thus are considered stable
5312    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5313    pub fn as_str_name(&self) -> &'static str {
5314        match self {
5315            Self::Ascending => "ORDERING_ASCENDING",
5316            Self::Descending => "ORDERING_DESCENDING",
5317        }
5318    }
5319    /// Creates an enum from field names used in the ProtoBuf definition.
5320    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5321        match value {
5322            "ORDERING_ASCENDING" => Some(Self::Ascending),
5323            "ORDERING_DESCENDING" => Some(Self::Descending),
5324            _ => None,
5325        }
5326    }
5327}
5328/// Reason the server stopped this query response.
5329#[non_exhaustive]
5330#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5331#[repr(i32)]
5332pub enum QueryEndReason {
5333    /// The stop reason was not specified.
5334    Unknown = 0,
5335    /// The response reached the requested item limit. The final matching item's
5336    /// frame carries `QueryEnd` and the final watermark. Resume from that frame's
5337    /// `Watermark.cursor` to continue reading the same effective interval.
5338    ItemLimit = 1,
5339    /// The response reached the server's per-request bucket-fetch budget for
5340    /// filtered scans before reaching the effective interval bound. The terminal
5341    /// frame carries no item. Its watermark cursor is the authoritative scan
5342    /// frontier from which to resume.
5343    ScanLimit = 2,
5344    /// The scan reached a requested checkpoint range bound. The terminal frame
5345    /// carries no item.
5346    CheckpointBound = 3,
5347    /// The scan reached an exclusive cursor bound. The terminal frame carries no
5348    /// item. Its watermark cursor represents that resolved bound without claiming
5349    /// that its containing checkpoint was fully covered.
5350    CursorBound = 4,
5351    /// The scan reached the currently indexed ledger tip. The terminal frame
5352    /// carries no item.
5353    LedgerTip = 5,
5354}
5355impl QueryEndReason {
5356    /// String value of the enum field names used in the ProtoBuf definition.
5357    ///
5358    /// The values are not transformed in any way and thus are considered stable
5359    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5360    pub fn as_str_name(&self) -> &'static str {
5361        match self {
5362            Self::Unknown => "QUERY_END_REASON_UNKNOWN",
5363            Self::ItemLimit => "QUERY_END_REASON_ITEM_LIMIT",
5364            Self::ScanLimit => "QUERY_END_REASON_SCAN_LIMIT",
5365            Self::CheckpointBound => "QUERY_END_REASON_CHECKPOINT_BOUND",
5366            Self::CursorBound => "QUERY_END_REASON_CURSOR_BOUND",
5367            Self::LedgerTip => "QUERY_END_REASON_LEDGER_TIP",
5368        }
5369    }
5370    /// Creates an enum from field names used in the ProtoBuf definition.
5371    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5372        match value {
5373            "QUERY_END_REASON_UNKNOWN" => Some(Self::Unknown),
5374            "QUERY_END_REASON_ITEM_LIMIT" => Some(Self::ItemLimit),
5375            "QUERY_END_REASON_SCAN_LIMIT" => Some(Self::ScanLimit),
5376            "QUERY_END_REASON_CHECKPOINT_BOUND" => Some(Self::CheckpointBound),
5377            "QUERY_END_REASON_CURSOR_BOUND" => Some(Self::CursorBound),
5378            "QUERY_END_REASON_LEDGER_TIP" => Some(Self::LedgerTip),
5379            _ => None,
5380        }
5381    }
5382}
5383/// A signature from a user.
5384#[non_exhaustive]
5385#[derive(Clone, PartialEq, ::prost::Message)]
5386pub struct UserSignature {
5387    /// This signature serialized as as BCS.
5388    ///
5389    /// When provided as input this will support both the form that is length
5390    /// prefixed as well as not length prefixed.
5391    #[prost(message, optional, tag = "1")]
5392    pub bcs: ::core::option::Option<Bcs>,
5393    /// The signature scheme of this signature.
5394    #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
5395    pub scheme: ::core::option::Option<i32>,
5396    #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
5397    pub signature: ::core::option::Option<user_signature::Signature>,
5398}
5399/// Nested message and enum types in `UserSignature`.
5400pub mod user_signature {
5401    #[non_exhaustive]
5402    #[derive(Clone, PartialEq, ::prost::Oneof)]
5403    pub enum Signature {
5404        /// Simple signature if scheme is ed25519 | secp256k1 | secp256r1.
5405        #[prost(message, tag = "3")]
5406        Simple(super::SimpleSignature),
5407        /// The multisig aggregated signature if scheme is `MULTISIG`.
5408        #[prost(message, tag = "4")]
5409        Multisig(super::MultisigAggregatedSignature),
5410        /// The zklogin authenticator if scheme is `ZKLOGIN`.
5411        #[prost(message, tag = "5")]
5412        Zklogin(super::ZkLoginAuthenticator),
5413        /// The passkey authenticator if scheme is `PASSKEY`.
5414        #[prost(message, tag = "6")]
5415        Passkey(super::PasskeyAuthenticator),
5416    }
5417}
5418/// Either an ed25519, secp256k1 or secp256r1 signature
5419#[non_exhaustive]
5420#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5421pub struct SimpleSignature {
5422    /// The signature scheme of this signature.
5423    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5424    pub scheme: ::core::option::Option<i32>,
5425    /// Signature bytes
5426    #[prost(bytes = "bytes", optional, tag = "2")]
5427    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5428    /// Public key bytes
5429    #[prost(bytes = "bytes", optional, tag = "3")]
5430    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5431}
5432/// Public key equivalent for zklogin authenticators.
5433#[non_exhaustive]
5434#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5435pub struct ZkLoginPublicIdentifier {
5436    #[prost(string, optional, tag = "1")]
5437    pub iss: ::core::option::Option<::prost::alloc::string::String>,
5438    /// base10 encoded Bn254FieldElement
5439    #[prost(string, optional, tag = "2")]
5440    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5441}
5442/// Set of valid public keys for multisig committee members.
5443#[non_exhaustive]
5444#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5445pub struct MultisigMemberPublicKey {
5446    /// The signature scheme of this public key.
5447    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5448    pub scheme: ::core::option::Option<i32>,
5449    /// Public key bytes if scheme is ed25519 | secp256k1 | secp256r1 | passkey.
5450    #[prost(bytes = "bytes", optional, tag = "2")]
5451    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5452    /// A zklogin public identifier if scheme is zklogin.
5453    #[prost(message, optional, tag = "3")]
5454    pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
5455}
5456/// A member in a multisig committee.
5457#[non_exhaustive]
5458#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5459pub struct MultisigMember {
5460    /// The public key of the committee member.
5461    #[prost(message, optional, tag = "1")]
5462    pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
5463    /// The weight of this member's signature.
5464    #[prost(uint32, optional, tag = "2")]
5465    pub weight: ::core::option::Option<u32>,
5466}
5467/// A multisig committee.
5468#[non_exhaustive]
5469#[derive(Clone, PartialEq, ::prost::Message)]
5470pub struct MultisigCommittee {
5471    /// A list of committee members and their corresponding weight.
5472    #[prost(message, repeated, tag = "1")]
5473    pub members: ::prost::alloc::vec::Vec<MultisigMember>,
5474    /// The threshold of signatures needed to validate a signature from
5475    /// this committee.
5476    #[prost(uint32, optional, tag = "2")]
5477    pub threshold: ::core::option::Option<u32>,
5478}
5479/// Aggregated signature from members of a multisig committee.
5480#[non_exhaustive]
5481#[derive(Clone, PartialEq, ::prost::Message)]
5482pub struct MultisigAggregatedSignature {
5483    /// The plain signatures encoded with signature scheme.
5484    ///
5485    /// The signatures must be in the same order as they are listed in the committee.
5486    #[prost(message, repeated, tag = "1")]
5487    pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
5488    /// Bitmap indicating which committee members contributed to the
5489    /// signature.
5490    #[prost(uint32, optional, tag = "2")]
5491    pub bitmap: ::core::option::Option<u32>,
5492    /// If present, means this signature's on-chain format uses the old
5493    /// legacy multisig format.
5494    #[prost(bytes = "bytes", optional, tag = "3")]
5495    pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5496    /// The committee to use to validate this signature.
5497    #[prost(message, optional, tag = "4")]
5498    pub committee: ::core::option::Option<MultisigCommittee>,
5499}
5500/// A signature from a member of a multisig committee.
5501#[non_exhaustive]
5502#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5503pub struct MultisigMemberSignature {
5504    /// The signature scheme of this signature.
5505    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5506    pub scheme: ::core::option::Option<i32>,
5507    /// Signature bytes if scheme is ed25519 | secp256k1 | secp256r1.
5508    #[prost(bytes = "bytes", optional, tag = "2")]
5509    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5510    /// The zklogin authenticator if scheme is `ZKLOGIN`.
5511    #[prost(message, optional, tag = "3")]
5512    pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
5513    /// The passkey authenticator if scheme is `PASSKEY`.
5514    #[prost(message, optional, tag = "4")]
5515    pub passkey: ::core::option::Option<PasskeyAuthenticator>,
5516}
5517/// A zklogin authenticator.
5518#[non_exhaustive]
5519#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5520pub struct ZkLoginAuthenticator {
5521    /// Zklogin proof and inputs required to perform proof verification.
5522    #[prost(message, optional, tag = "1")]
5523    pub inputs: ::core::option::Option<ZkLoginInputs>,
5524    /// Maximum epoch for which the proof is valid.
5525    #[prost(uint64, optional, tag = "2")]
5526    pub max_epoch: ::core::option::Option<u64>,
5527    /// User signature with the public key attested to by the provided proof.
5528    #[prost(message, optional, tag = "3")]
5529    pub signature: ::core::option::Option<SimpleSignature>,
5530    /// The public identifier (similar to a public key) for this zklogin authenticator
5531    #[prost(message, optional, tag = "4")]
5532    pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
5533    /// The id of the JWK used to authorize this zklogin authenticator
5534    #[prost(message, optional, tag = "5")]
5535    pub jwk_id: ::core::option::Option<JwkId>,
5536}
5537/// A zklogin groth16 proof and the required inputs to perform proof verification.
5538#[non_exhaustive]
5539#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5540pub struct ZkLoginInputs {
5541    #[prost(message, optional, tag = "1")]
5542    pub proof_points: ::core::option::Option<ZkLoginProof>,
5543    #[prost(message, optional, tag = "2")]
5544    pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
5545    #[prost(string, optional, tag = "3")]
5546    pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
5547    /// base10 encoded Bn254FieldElement
5548    #[prost(string, optional, tag = "4")]
5549    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5550}
5551/// A zklogin groth16 proof.
5552#[non_exhaustive]
5553#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5554pub struct ZkLoginProof {
5555    #[prost(message, optional, tag = "1")]
5556    pub a: ::core::option::Option<CircomG1>,
5557    #[prost(message, optional, tag = "2")]
5558    pub b: ::core::option::Option<CircomG2>,
5559    #[prost(message, optional, tag = "3")]
5560    pub c: ::core::option::Option<CircomG1>,
5561}
5562/// A claim of the iss in a zklogin proof.
5563#[non_exhaustive]
5564#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5565pub struct ZkLoginClaim {
5566    #[prost(string, optional, tag = "1")]
5567    pub value: ::core::option::Option<::prost::alloc::string::String>,
5568    #[prost(uint32, optional, tag = "2")]
5569    pub index_mod_4: ::core::option::Option<u32>,
5570}
5571/// A G1 point.
5572#[non_exhaustive]
5573#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5574pub struct CircomG1 {
5575    /// base10 encoded Bn254FieldElement
5576    #[prost(string, optional, tag = "1")]
5577    pub e0: ::core::option::Option<::prost::alloc::string::String>,
5578    /// base10 encoded Bn254FieldElement
5579    #[prost(string, optional, tag = "2")]
5580    pub e1: ::core::option::Option<::prost::alloc::string::String>,
5581    /// base10 encoded Bn254FieldElement
5582    #[prost(string, optional, tag = "3")]
5583    pub e2: ::core::option::Option<::prost::alloc::string::String>,
5584}
5585/// A G2 point.
5586#[non_exhaustive]
5587#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5588pub struct CircomG2 {
5589    /// base10 encoded Bn254FieldElement
5590    #[prost(string, optional, tag = "1")]
5591    pub e00: ::core::option::Option<::prost::alloc::string::String>,
5592    /// base10 encoded Bn254FieldElement
5593    #[prost(string, optional, tag = "2")]
5594    pub e01: ::core::option::Option<::prost::alloc::string::String>,
5595    /// base10 encoded Bn254FieldElement
5596    #[prost(string, optional, tag = "3")]
5597    pub e10: ::core::option::Option<::prost::alloc::string::String>,
5598    /// base10 encoded Bn254FieldElement
5599    #[prost(string, optional, tag = "4")]
5600    pub e11: ::core::option::Option<::prost::alloc::string::String>,
5601    /// base10 encoded Bn254FieldElement
5602    #[prost(string, optional, tag = "5")]
5603    pub e20: ::core::option::Option<::prost::alloc::string::String>,
5604    /// base10 encoded Bn254FieldElement
5605    #[prost(string, optional, tag = "6")]
5606    pub e21: ::core::option::Option<::prost::alloc::string::String>,
5607}
5608/// A passkey authenticator.
5609///
5610/// See
5611/// [struct.PasskeyAuthenticator](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/struct.PasskeyAuthenticator.html#bcs>)
5612/// for more information on the requirements on the shape of the
5613/// `client_data_json` field.
5614#[non_exhaustive]
5615#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5616pub struct PasskeyAuthenticator {
5617    /// Opaque authenticator data for this passkey signature.
5618    ///
5619    /// See [Authenticator Data](<https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data>) for
5620    /// more information on this field.
5621    #[prost(bytes = "bytes", optional, tag = "1")]
5622    pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
5623    /// Structured, unparsed, JSON for this passkey signature.
5624    ///
5625    /// See [CollectedClientData](<https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata>)
5626    /// for more information on this field.
5627    #[prost(string, optional, tag = "2")]
5628    pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
5629    /// A secp256r1 signature.
5630    #[prost(message, optional, tag = "3")]
5631    pub signature: ::core::option::Option<SimpleSignature>,
5632}
5633/// The validator set for a particular epoch.
5634#[non_exhaustive]
5635#[derive(Clone, PartialEq, ::prost::Message)]
5636pub struct ValidatorCommittee {
5637    /// The epoch where this committee governs.
5638    #[prost(uint64, optional, tag = "1")]
5639    pub epoch: ::core::option::Option<u64>,
5640    /// The committee members.
5641    #[prost(message, repeated, tag = "2")]
5642    pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
5643}
5644/// A member of a validator committee.
5645#[non_exhaustive]
5646#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5647pub struct ValidatorCommitteeMember {
5648    /// The 96-byte Bls12381 public key for this validator.
5649    #[prost(bytes = "bytes", optional, tag = "1")]
5650    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5651    /// voting weight this validator possesses.
5652    #[prost(uint64, optional, tag = "2")]
5653    pub weight: ::core::option::Option<u64>,
5654}
5655/// / An aggregated signature from multiple validators.
5656#[non_exhaustive]
5657#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5658pub struct ValidatorAggregatedSignature {
5659    /// The epoch when this signature was produced.
5660    ///
5661    /// This can be used to lookup the `ValidatorCommittee` from this epoch
5662    /// to verify this signature.
5663    #[prost(uint64, optional, tag = "1")]
5664    pub epoch: ::core::option::Option<u64>,
5665    /// The 48-byte Bls12381 aggregated signature.
5666    #[prost(bytes = "bytes", optional, tag = "2")]
5667    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5668    /// Bitmap indicating which members of the committee contributed to
5669    /// this signature.
5670    #[prost(bytes = "bytes", optional, tag = "3")]
5671    pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5672}
5673/// Flag use to disambiguate the signature schemes supported by Sui.
5674///
5675/// Note: the enum values defined by this proto message exactly match their
5676/// expected BCS serialized values when serialized as a u8. See
5677/// [enum.SignatureScheme](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/enum.SignatureScheme.html>)
5678/// for more information about signature schemes.
5679#[non_exhaustive]
5680#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5681#[repr(i32)]
5682pub enum SignatureScheme {
5683    Ed25519 = 0,
5684    Secp256k1 = 1,
5685    Secp256r1 = 2,
5686    Multisig = 3,
5687    Bls12381 = 4,
5688    Zklogin = 5,
5689    Passkey = 6,
5690}
5691impl SignatureScheme {
5692    /// String value of the enum field names used in the ProtoBuf definition.
5693    ///
5694    /// The values are not transformed in any way and thus are considered stable
5695    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5696    pub fn as_str_name(&self) -> &'static str {
5697        match self {
5698            Self::Ed25519 => "ED25519",
5699            Self::Secp256k1 => "SECP256K1",
5700            Self::Secp256r1 => "SECP256R1",
5701            Self::Multisig => "MULTISIG",
5702            Self::Bls12381 => "BLS12381",
5703            Self::Zklogin => "ZKLOGIN",
5704            Self::Passkey => "PASSKEY",
5705        }
5706    }
5707    /// Creates an enum from field names used in the ProtoBuf definition.
5708    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5709        match value {
5710            "ED25519" => Some(Self::Ed25519),
5711            "SECP256K1" => Some(Self::Secp256k1),
5712            "SECP256R1" => Some(Self::Secp256r1),
5713            "MULTISIG" => Some(Self::Multisig),
5714            "BLS12381" => Some(Self::Bls12381),
5715            "ZKLOGIN" => Some(Self::Zklogin),
5716            "PASSKEY" => Some(Self::Passkey),
5717            _ => None,
5718        }
5719    }
5720}
5721#[non_exhaustive]
5722#[derive(Clone, PartialEq, ::prost::Message)]
5723pub struct VerifySignatureRequest {
5724    /// The message to verify against.
5725    ///
5726    /// Today the only supported message types are `PersonalMessage` and
5727    /// `TransactionData` and the `Bcs.name` must be set to indicate which type of
5728    /// message is being verified.
5729    #[prost(message, optional, tag = "1")]
5730    pub message: ::core::option::Option<Bcs>,
5731    /// The signature to verify.
5732    #[prost(message, optional, tag = "2")]
5733    pub signature: ::core::option::Option<UserSignature>,
5734    /// Optional. Address to validate against the provided signature.
5735    ///
5736    /// If provided, this address will be compared against the the address derived
5737    /// from the provide signature and a successful response will only be returned
5738    /// if they match.
5739    #[prost(string, optional, tag = "3")]
5740    pub address: ::core::option::Option<::prost::alloc::string::String>,
5741    /// The set of JWKs to use when verifying Zklogin signatures.
5742    /// If this is empty the current set of valid JWKs stored onchain will be used
5743    #[prost(message, repeated, tag = "4")]
5744    pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
5745}
5746#[non_exhaustive]
5747#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5748pub struct VerifySignatureResponse {
5749    /// Indicates if the provided signature was valid given the requested parameters.
5750    #[prost(bool, optional, tag = "1")]
5751    pub is_valid: ::core::option::Option<bool>,
5752    /// If `is_valid` is `false`, this is the reason for why the signature verification failed.
5753    #[prost(string, optional, tag = "2")]
5754    pub reason: ::core::option::Option<::prost::alloc::string::String>,
5755}
5756/// Generated client implementations.
5757pub mod signature_verification_service_client {
5758    #![allow(
5759        unused_variables,
5760        dead_code,
5761        missing_docs,
5762        clippy::wildcard_imports,
5763        clippy::let_unit_value,
5764    )]
5765    use tonic::codegen::*;
5766    use tonic::codegen::http::Uri;
5767    #[derive(Debug, Clone)]
5768    pub struct SignatureVerificationServiceClient<T> {
5769        inner: tonic::client::Grpc<T>,
5770    }
5771    impl SignatureVerificationServiceClient<tonic::transport::Channel> {
5772        /// Attempt to create a new client by connecting to a given endpoint.
5773        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5774        where
5775            D: TryInto<tonic::transport::Endpoint>,
5776            D::Error: Into<StdError>,
5777        {
5778            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5779            Ok(Self::new(conn))
5780        }
5781    }
5782    impl<T> SignatureVerificationServiceClient<T>
5783    where
5784        T: tonic::client::GrpcService<tonic::body::Body>,
5785        T::Error: Into<StdError>,
5786        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5787        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5788    {
5789        pub fn new(inner: T) -> Self {
5790            let inner = tonic::client::Grpc::new(inner);
5791            Self { inner }
5792        }
5793        pub fn with_origin(inner: T, origin: Uri) -> Self {
5794            let inner = tonic::client::Grpc::with_origin(inner, origin);
5795            Self { inner }
5796        }
5797        pub fn with_interceptor<F>(
5798            inner: T,
5799            interceptor: F,
5800        ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
5801        where
5802            F: tonic::service::Interceptor,
5803            T::ResponseBody: Default,
5804            T: tonic::codegen::Service<
5805                http::Request<tonic::body::Body>,
5806                Response = http::Response<
5807                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5808                >,
5809            >,
5810            <T as tonic::codegen::Service<
5811                http::Request<tonic::body::Body>,
5812            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5813        {
5814            SignatureVerificationServiceClient::new(
5815                InterceptedService::new(inner, interceptor),
5816            )
5817        }
5818        /// Compress requests with the given encoding.
5819        ///
5820        /// This requires the server to support it otherwise it might respond with an
5821        /// error.
5822        #[must_use]
5823        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5824            self.inner = self.inner.send_compressed(encoding);
5825            self
5826        }
5827        /// Enable decompressing responses.
5828        #[must_use]
5829        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5830            self.inner = self.inner.accept_compressed(encoding);
5831            self
5832        }
5833        /// Limits the maximum size of a decoded message.
5834        ///
5835        /// Default: `4MB`
5836        #[must_use]
5837        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5838            self.inner = self.inner.max_decoding_message_size(limit);
5839            self
5840        }
5841        /// Limits the maximum size of an encoded message.
5842        ///
5843        /// Default: `usize::MAX`
5844        #[must_use]
5845        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5846            self.inner = self.inner.max_encoding_message_size(limit);
5847            self
5848        }
5849        /// Perform signature verification of a UserSignature against the provided message.
5850        pub async fn verify_signature(
5851            &mut self,
5852            request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
5853        ) -> std::result::Result<
5854            tonic::Response<super::VerifySignatureResponse>,
5855            tonic::Status,
5856        > {
5857            self.inner
5858                .ready()
5859                .await
5860                .map_err(|e| {
5861                    tonic::Status::unknown(
5862                        format!("Service was not ready: {}", e.into()),
5863                    )
5864                })?;
5865            let codec = tonic_prost::ProstCodec::default();
5866            let path = http::uri::PathAndQuery::from_static(
5867                "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
5868            );
5869            let mut req = request.into_request();
5870            req.extensions_mut()
5871                .insert(
5872                    GrpcMethod::new(
5873                        "sui.rpc.v2.SignatureVerificationService",
5874                        "VerifySignature",
5875                    ),
5876                );
5877            self.inner.unary(req, path, codec).await
5878        }
5879    }
5880}
5881/// Generated server implementations.
5882pub mod signature_verification_service_server {
5883    #![allow(
5884        unused_variables,
5885        dead_code,
5886        missing_docs,
5887        clippy::wildcard_imports,
5888        clippy::let_unit_value,
5889    )]
5890    use tonic::codegen::*;
5891    /// Generated trait containing gRPC methods that should be implemented for use with SignatureVerificationServiceServer.
5892    #[async_trait]
5893    pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
5894        /// Perform signature verification of a UserSignature against the provided message.
5895        async fn verify_signature(
5896            &self,
5897            request: tonic::Request<super::VerifySignatureRequest>,
5898        ) -> std::result::Result<
5899            tonic::Response<super::VerifySignatureResponse>,
5900            tonic::Status,
5901        > {
5902            Err(tonic::Status::unimplemented("Not yet implemented"))
5903        }
5904    }
5905    #[derive(Debug)]
5906    pub struct SignatureVerificationServiceServer<T> {
5907        inner: Arc<T>,
5908        accept_compression_encodings: EnabledCompressionEncodings,
5909        send_compression_encodings: EnabledCompressionEncodings,
5910        max_decoding_message_size: Option<usize>,
5911        max_encoding_message_size: Option<usize>,
5912    }
5913    impl<T> SignatureVerificationServiceServer<T> {
5914        pub fn new(inner: T) -> Self {
5915            Self::from_arc(Arc::new(inner))
5916        }
5917        pub fn from_arc(inner: Arc<T>) -> Self {
5918            Self {
5919                inner,
5920                accept_compression_encodings: Default::default(),
5921                send_compression_encodings: Default::default(),
5922                max_decoding_message_size: None,
5923                max_encoding_message_size: None,
5924            }
5925        }
5926        pub fn with_interceptor<F>(
5927            inner: T,
5928            interceptor: F,
5929        ) -> InterceptedService<Self, F>
5930        where
5931            F: tonic::service::Interceptor,
5932        {
5933            InterceptedService::new(Self::new(inner), interceptor)
5934        }
5935        /// Enable decompressing requests with the given encoding.
5936        #[must_use]
5937        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5938            self.accept_compression_encodings.enable(encoding);
5939            self
5940        }
5941        /// Compress responses with the given encoding, if the client supports it.
5942        #[must_use]
5943        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5944            self.send_compression_encodings.enable(encoding);
5945            self
5946        }
5947        /// Limits the maximum size of a decoded message.
5948        ///
5949        /// Default: `4MB`
5950        #[must_use]
5951        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5952            self.max_decoding_message_size = Some(limit);
5953            self
5954        }
5955        /// Limits the maximum size of an encoded message.
5956        ///
5957        /// Default: `usize::MAX`
5958        #[must_use]
5959        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5960            self.max_encoding_message_size = Some(limit);
5961            self
5962        }
5963    }
5964    impl<T, B> tonic::codegen::Service<http::Request<B>>
5965    for SignatureVerificationServiceServer<T>
5966    where
5967        T: SignatureVerificationService,
5968        B: Body + std::marker::Send + 'static,
5969        B::Error: Into<StdError> + std::marker::Send + 'static,
5970    {
5971        type Response = http::Response<tonic::body::Body>;
5972        type Error = std::convert::Infallible;
5973        type Future = BoxFuture<Self::Response, Self::Error>;
5974        fn poll_ready(
5975            &mut self,
5976            _cx: &mut Context<'_>,
5977        ) -> Poll<std::result::Result<(), Self::Error>> {
5978            Poll::Ready(Ok(()))
5979        }
5980        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5981            match req.uri().path() {
5982                "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
5983                    #[allow(non_camel_case_types)]
5984                    struct VerifySignatureSvc<T: SignatureVerificationService>(
5985                        pub Arc<T>,
5986                    );
5987                    impl<
5988                        T: SignatureVerificationService,
5989                    > tonic::server::UnaryService<super::VerifySignatureRequest>
5990                    for VerifySignatureSvc<T> {
5991                        type Response = super::VerifySignatureResponse;
5992                        type Future = BoxFuture<
5993                            tonic::Response<Self::Response>,
5994                            tonic::Status,
5995                        >;
5996                        fn call(
5997                            &mut self,
5998                            request: tonic::Request<super::VerifySignatureRequest>,
5999                        ) -> Self::Future {
6000                            let inner = Arc::clone(&self.0);
6001                            let fut = async move {
6002                                <T as SignatureVerificationService>::verify_signature(
6003                                        &inner,
6004                                        request,
6005                                    )
6006                                    .await
6007                            };
6008                            Box::pin(fut)
6009                        }
6010                    }
6011                    let accept_compression_encodings = self.accept_compression_encodings;
6012                    let send_compression_encodings = self.send_compression_encodings;
6013                    let max_decoding_message_size = self.max_decoding_message_size;
6014                    let max_encoding_message_size = self.max_encoding_message_size;
6015                    let inner = self.inner.clone();
6016                    let fut = async move {
6017                        let method = VerifySignatureSvc(inner);
6018                        let codec = tonic_prost::ProstCodec::default();
6019                        let mut grpc = tonic::server::Grpc::new(codec)
6020                            .apply_compression_config(
6021                                accept_compression_encodings,
6022                                send_compression_encodings,
6023                            )
6024                            .apply_max_message_size_config(
6025                                max_decoding_message_size,
6026                                max_encoding_message_size,
6027                            );
6028                        let res = grpc.unary(method, req).await;
6029                        Ok(res)
6030                    };
6031                    Box::pin(fut)
6032                }
6033                _ => {
6034                    Box::pin(async move {
6035                        let mut response = http::Response::new(
6036                            tonic::body::Body::default(),
6037                        );
6038                        let headers = response.headers_mut();
6039                        headers
6040                            .insert(
6041                                tonic::Status::GRPC_STATUS,
6042                                (tonic::Code::Unimplemented as i32).into(),
6043                            );
6044                        headers
6045                            .insert(
6046                                http::header::CONTENT_TYPE,
6047                                tonic::metadata::GRPC_CONTENT_TYPE,
6048                            );
6049                        Ok(response)
6050                    })
6051                }
6052            }
6053        }
6054    }
6055    impl<T> Clone for SignatureVerificationServiceServer<T> {
6056        fn clone(&self) -> Self {
6057            let inner = self.inner.clone();
6058            Self {
6059                inner,
6060                accept_compression_encodings: self.accept_compression_encodings,
6061                send_compression_encodings: self.send_compression_encodings,
6062                max_decoding_message_size: self.max_decoding_message_size,
6063                max_encoding_message_size: self.max_encoding_message_size,
6064            }
6065        }
6066    }
6067    /// Generated gRPC service name
6068    pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
6069    impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
6070        const NAME: &'static str = SERVICE_NAME;
6071    }
6072}
6073/// Request message for `NodeService.GetCoinInfo`.
6074#[non_exhaustive]
6075#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6076pub struct GetCoinInfoRequest {
6077    /// The coin type to request information about
6078    #[prost(string, optional, tag = "1")]
6079    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6080}
6081/// Response message for `NodeService.GetCoinInfo`.
6082#[non_exhaustive]
6083#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6084pub struct GetCoinInfoResponse {
6085    /// Required. The coin type.
6086    #[prost(string, optional, tag = "1")]
6087    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6088    /// This field will be populated with information about this coin
6089    /// type's `0x2::coin::CoinMetadata` if it exists and has not been wrapped.
6090    #[prost(message, optional, tag = "2")]
6091    pub metadata: ::core::option::Option<CoinMetadata>,
6092    /// This field will be populated with information about this coin
6093    /// type's `0x2::coin::TreasuryCap` if it exists and has not been wrapped.
6094    #[prost(message, optional, tag = "3")]
6095    pub treasury: ::core::option::Option<CoinTreasury>,
6096    /// If this coin type is a regulated coin, this field will be
6097    /// populated with information either from its Currency object
6098    /// in the CoinRegistry, or from its `0x2::coin::RegulatedCoinMetadata`
6099    /// object for coins that have not been migrated to the CoinRegistry
6100    ///
6101    /// If this coin is not known to be regulated, only the
6102    /// coin_regulated_state field will be populated.
6103    #[prost(message, optional, tag = "4")]
6104    pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
6105}
6106/// Metadata for a coin type
6107#[non_exhaustive]
6108#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6109pub struct CoinMetadata {
6110    /// ObjectId of the `0x2::coin::CoinMetadata` object or
6111    /// 0x2::sui::coin_registry::Currency object (when registered with CoinRegistry).
6112    #[prost(string, optional, tag = "1")]
6113    pub id: ::core::option::Option<::prost::alloc::string::String>,
6114    /// Number of decimal places to coin uses.
6115    #[prost(uint32, optional, tag = "2")]
6116    pub decimals: ::core::option::Option<u32>,
6117    /// Name for the token
6118    #[prost(string, optional, tag = "3")]
6119    pub name: ::core::option::Option<::prost::alloc::string::String>,
6120    /// Symbol for the token
6121    #[prost(string, optional, tag = "4")]
6122    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
6123    /// Description of the token
6124    #[prost(string, optional, tag = "5")]
6125    pub description: ::core::option::Option<::prost::alloc::string::String>,
6126    /// URL for the token logo
6127    #[prost(string, optional, tag = "6")]
6128    pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
6129    /// The MetadataCap ID if it has been claimed for this coin type.
6130    /// This capability allows updating the coin's metadata fields.
6131    /// Only populated when metadata is from CoinRegistry.
6132    #[prost(string, optional, tag = "7")]
6133    pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6134    /// State of the MetadataCap for this coin type.
6135    #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
6136    pub metadata_cap_state: ::core::option::Option<i32>,
6137}
6138/// Nested message and enum types in `CoinMetadata`.
6139pub mod coin_metadata {
6140    /// Information about the state of the coin's MetadataCap
6141    #[non_exhaustive]
6142    #[derive(
6143        Clone,
6144        Copy,
6145        Debug,
6146        PartialEq,
6147        Eq,
6148        Hash,
6149        PartialOrd,
6150        Ord,
6151        ::prost::Enumeration
6152    )]
6153    #[repr(i32)]
6154    pub enum MetadataCapState {
6155        /// Indicates the state of the MetadataCap is unknown.
6156        /// Set when the coin has not been migrated to the CoinRegistry.
6157        Unknown = 0,
6158        /// Indicates the MetadataCap has been claimed.
6159        Claimed = 1,
6160        /// Indicates the MetadataCap has not been claimed.
6161        Unclaimed = 2,
6162        /// Indicates the MetadataCap has been deleted.
6163        Deleted = 3,
6164    }
6165    impl MetadataCapState {
6166        /// String value of the enum field names used in the ProtoBuf definition.
6167        ///
6168        /// The values are not transformed in any way and thus are considered stable
6169        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6170        pub fn as_str_name(&self) -> &'static str {
6171            match self {
6172                Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
6173                Self::Claimed => "CLAIMED",
6174                Self::Unclaimed => "UNCLAIMED",
6175                Self::Deleted => "DELETED",
6176            }
6177        }
6178        /// Creates an enum from field names used in the ProtoBuf definition.
6179        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6180            match value {
6181                "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
6182                "CLAIMED" => Some(Self::Claimed),
6183                "UNCLAIMED" => Some(Self::Unclaimed),
6184                "DELETED" => Some(Self::Deleted),
6185                _ => None,
6186            }
6187        }
6188    }
6189}
6190/// Information about a coin type's `0x2::coin::TreasuryCap` and its total available supply
6191#[non_exhaustive]
6192#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6193pub struct CoinTreasury {
6194    /// ObjectId of the `0x2::coin::TreasuryCap` object.
6195    #[prost(string, optional, tag = "1")]
6196    pub id: ::core::option::Option<::prost::alloc::string::String>,
6197    /// Total available supply for this coin type.
6198    #[prost(uint64, optional, tag = "2")]
6199    pub total_supply: ::core::option::Option<u64>,
6200    /// Supply state indicating if the supply is fixed or can still be minted
6201    #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
6202    pub supply_state: ::core::option::Option<i32>,
6203}
6204/// Nested message and enum types in `CoinTreasury`.
6205pub mod coin_treasury {
6206    /// Supply state of a coin, matching the Move SupplyState enum
6207    #[non_exhaustive]
6208    #[derive(
6209        Clone,
6210        Copy,
6211        Debug,
6212        PartialEq,
6213        Eq,
6214        Hash,
6215        PartialOrd,
6216        Ord,
6217        ::prost::Enumeration
6218    )]
6219    #[repr(i32)]
6220    pub enum SupplyState {
6221        /// Supply is unknown or TreasuryCap still exists (minting still possible)
6222        Unknown = 0,
6223        /// Supply is fixed (TreasuryCap consumed, no more minting possible)
6224        Fixed = 1,
6225        /// Supply can only decrease (burning allowed, minting not allowed)
6226        BurnOnly = 2,
6227    }
6228    impl SupplyState {
6229        /// String value of the enum field names used in the ProtoBuf definition.
6230        ///
6231        /// The values are not transformed in any way and thus are considered stable
6232        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6233        pub fn as_str_name(&self) -> &'static str {
6234            match self {
6235                Self::Unknown => "SUPPLY_STATE_UNKNOWN",
6236                Self::Fixed => "FIXED",
6237                Self::BurnOnly => "BURN_ONLY",
6238            }
6239        }
6240        /// Creates an enum from field names used in the ProtoBuf definition.
6241        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6242            match value {
6243                "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
6244                "FIXED" => Some(Self::Fixed),
6245                "BURN_ONLY" => Some(Self::BurnOnly),
6246                _ => None,
6247            }
6248        }
6249    }
6250}
6251/// Information about a regulated coin, which indicates that it makes use of the transfer deny list.
6252#[non_exhaustive]
6253#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6254pub struct RegulatedCoinMetadata {
6255    /// ObjectId of the `0x2::coin::RegulatedCoinMetadata` object.
6256    /// Only present for coins that have not been migrated to CoinRegistry.
6257    #[prost(string, optional, tag = "1")]
6258    pub id: ::core::option::Option<::prost::alloc::string::String>,
6259    /// The ID of the coin's `CoinMetadata` or `CoinData` object.
6260    #[prost(string, optional, tag = "2")]
6261    pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
6262    /// The ID of the coin's `DenyCap` object.
6263    #[prost(string, optional, tag = "3")]
6264    pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
6265    /// Whether the coin can be globally paused
6266    #[prost(bool, optional, tag = "4")]
6267    pub allow_global_pause: ::core::option::Option<bool>,
6268    /// Variant of the regulated coin metadata
6269    #[prost(uint32, optional, tag = "5")]
6270    pub variant: ::core::option::Option<u32>,
6271    /// Indicates the coin's regulated state.
6272    #[prost(
6273        enumeration = "regulated_coin_metadata::CoinRegulatedState",
6274        optional,
6275        tag = "6"
6276    )]
6277    pub coin_regulated_state: ::core::option::Option<i32>,
6278}
6279/// Nested message and enum types in `RegulatedCoinMetadata`.
6280pub mod regulated_coin_metadata {
6281    /// Indicates the state of the regulation of the coin.
6282    #[non_exhaustive]
6283    #[derive(
6284        Clone,
6285        Copy,
6286        Debug,
6287        PartialEq,
6288        Eq,
6289        Hash,
6290        PartialOrd,
6291        Ord,
6292        ::prost::Enumeration
6293    )]
6294    #[repr(i32)]
6295    pub enum CoinRegulatedState {
6296        /// Indicates the regulation state of the coin is unknown.
6297        /// This is set when a coin has not been migrated to the
6298        /// coin registry and has no `0x2::coin::RegulatedCoinMetadata`
6299        /// object.
6300        Unknown = 0,
6301        /// Indicates a coin is regulated. RegulatedCoinMetadata will be populated.
6302        Regulated = 1,
6303        /// Indicates a coin is unregulated.
6304        Unregulated = 2,
6305    }
6306    impl CoinRegulatedState {
6307        /// String value of the enum field names used in the ProtoBuf definition.
6308        ///
6309        /// The values are not transformed in any way and thus are considered stable
6310        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6311        pub fn as_str_name(&self) -> &'static str {
6312            match self {
6313                Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
6314                Self::Regulated => "REGULATED",
6315                Self::Unregulated => "UNREGULATED",
6316            }
6317        }
6318        /// Creates an enum from field names used in the ProtoBuf definition.
6319        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6320            match value {
6321                "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
6322                "REGULATED" => Some(Self::Regulated),
6323                "UNREGULATED" => Some(Self::Unregulated),
6324                _ => None,
6325            }
6326        }
6327    }
6328}
6329/// Request message for `LiveDataService.GetBalance`.
6330#[non_exhaustive]
6331#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6332pub struct GetBalanceRequest {
6333    /// Required. The owner's Sui address.
6334    #[prost(string, optional, tag = "1")]
6335    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6336    /// Required. The type names for the coin (e.g., 0x2::sui::SUI).
6337    #[prost(string, optional, tag = "2")]
6338    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6339}
6340/// Response message for `LiveDataService.GetBalance`.
6341/// Return the total coin balance for one coin type, owned by the address owner.
6342#[non_exhaustive]
6343#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6344pub struct GetBalanceResponse {
6345    /// The balance information for the requested coin type.
6346    #[prost(message, optional, tag = "1")]
6347    pub balance: ::core::option::Option<Balance>,
6348}
6349/// Request message for `LiveDataService.ListBalances`.
6350#[non_exhaustive]
6351#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6352pub struct ListBalancesRequest {
6353    /// Required. The owner's Sui address.
6354    #[prost(string, optional, tag = "1")]
6355    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6356    /// The maximum number of balance entries to return. The service may return fewer than this value.
6357    /// If unspecified, at most `50` entries will be returned.
6358    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6359    #[prost(uint32, optional, tag = "2")]
6360    pub page_size: ::core::option::Option<u32>,
6361    /// A page token, received from a previous `ListBalances` call.
6362    /// Provide this to retrieve the subsequent page.
6363    ///
6364    /// When paginating, all other parameters provided to `ListBalances` must
6365    /// match the call that provided the page token.
6366    #[prost(bytes = "bytes", optional, tag = "3")]
6367    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6368}
6369/// Response message for `LiveDataService.ListBalances`.
6370/// Return the total coin balance for all coin types, owned by the address owner.
6371#[non_exhaustive]
6372#[derive(Clone, PartialEq, ::prost::Message)]
6373pub struct ListBalancesResponse {
6374    /// The list of coin types and their respective balances.
6375    #[prost(message, repeated, tag = "1")]
6376    pub balances: ::prost::alloc::vec::Vec<Balance>,
6377    /// A token, which can be sent as `page_token` to retrieve the next page.
6378    /// If this field is omitted, there are no subsequent pages.
6379    #[prost(bytes = "bytes", optional, tag = "2")]
6380    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6381}
6382/// Balance information for a specific coin type.
6383#[non_exhaustive]
6384#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6385pub struct Balance {
6386    /// The type of the coin (e.g., 0x2::sui::SUI).
6387    #[prost(string, optional, tag = "1")]
6388    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6389    /// The total balance of `coin_type` in its smallest unit.
6390    /// This is the sum of all spendable amounts of `coin_type` (`address_balance`
6391    /// and `coin_balance`).
6392    #[prost(uint64, optional, tag = "3")]
6393    pub balance: ::core::option::Option<u64>,
6394    /// The balance of `Balance<T>` in this address's Address Balance.
6395    #[prost(uint64, optional, tag = "4")]
6396    pub address_balance: ::core::option::Option<u64>,
6397    /// The balance of all `Coin<T>` objects owned by this address.
6398    #[prost(uint64, optional, tag = "5")]
6399    pub coin_balance: ::core::option::Option<u64>,
6400}
6401/// Request message for `NodeService.ListDynamicFields`
6402#[non_exhaustive]
6403#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6404pub struct ListDynamicFieldsRequest {
6405    /// Required. The `UID` of the parent, which owns the collections of dynamic fields.
6406    #[prost(string, optional, tag = "1")]
6407    pub parent: ::core::option::Option<::prost::alloc::string::String>,
6408    /// The maximum number of dynamic fields to return. The service may return fewer than this value.
6409    /// If unspecified, at most `50` entries will be returned.
6410    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6411    #[prost(uint32, optional, tag = "2")]
6412    pub page_size: ::core::option::Option<u32>,
6413    /// A page token, received from a previous `ListDynamicFields` call.
6414    /// Provide this to retrieve the subsequent page.
6415    ///
6416    /// When paginating, all other parameters provided to `ListDynamicFields` must
6417    /// match the call that provided the page token.
6418    #[prost(bytes = "bytes", optional, tag = "3")]
6419    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6420    /// Mask specifying which fields to read.
6421    /// If no mask is specified, defaults to `parent,field_id`.
6422    #[prost(message, optional, tag = "4")]
6423    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6424}
6425/// Response message for `NodeService.ListDynamicFields`
6426#[non_exhaustive]
6427#[derive(Clone, PartialEq, ::prost::Message)]
6428pub struct ListDynamicFieldsResponse {
6429    /// Page of dynamic fields owned by the specified parent.
6430    #[prost(message, repeated, tag = "1")]
6431    pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
6432    /// A token, which can be sent as `page_token` to retrieve the next page.
6433    /// If this field is omitted, there are no subsequent pages.
6434    #[prost(bytes = "bytes", optional, tag = "2")]
6435    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6436}
6437#[non_exhaustive]
6438#[derive(Clone, PartialEq, ::prost::Message)]
6439pub struct DynamicField {
6440    #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
6441    pub kind: ::core::option::Option<i32>,
6442    /// ObjectId of this dynamic field's parent.
6443    #[prost(string, optional, tag = "2")]
6444    pub parent: ::core::option::Option<::prost::alloc::string::String>,
6445    /// ObjectId of this dynamic field.
6446    #[prost(string, optional, tag = "3")]
6447    pub field_id: ::core::option::Option<::prost::alloc::string::String>,
6448    /// The field object itself
6449    #[prost(message, optional, tag = "4")]
6450    pub field_object: ::core::option::Option<Object>,
6451    /// The dynamic field's "name"
6452    #[prost(message, optional, tag = "5")]
6453    pub name: ::core::option::Option<Bcs>,
6454    /// The dynamic field's "value"
6455    #[prost(message, optional, tag = "6")]
6456    pub value: ::core::option::Option<Bcs>,
6457    /// The type of the dynamic field "value".
6458    ///
6459    /// If this is a dynamic object field then this is the type of the object
6460    /// itself (which is a child of this field), otherwise this is the type of the
6461    /// value of this field.
6462    #[prost(string, optional, tag = "7")]
6463    pub value_type: ::core::option::Option<::prost::alloc::string::String>,
6464    /// The ObjectId of the child object when a child is a dynamic
6465    /// object field.
6466    ///
6467    /// The presence or absence of this field can be used to determine if a child
6468    /// is a dynamic field or a dynamic child object
6469    #[prost(string, optional, tag = "8")]
6470    pub child_id: ::core::option::Option<::prost::alloc::string::String>,
6471    /// The object itself when a child is a dynamic object field.
6472    #[prost(message, optional, tag = "9")]
6473    pub child_object: ::core::option::Option<Object>,
6474}
6475/// Nested message and enum types in `DynamicField`.
6476pub mod dynamic_field {
6477    #[non_exhaustive]
6478    #[derive(
6479        Clone,
6480        Copy,
6481        Debug,
6482        PartialEq,
6483        Eq,
6484        Hash,
6485        PartialOrd,
6486        Ord,
6487        ::prost::Enumeration
6488    )]
6489    #[repr(i32)]
6490    pub enum DynamicFieldKind {
6491        Unknown = 0,
6492        Field = 1,
6493        Object = 2,
6494    }
6495    impl DynamicFieldKind {
6496        /// String value of the enum field names used in the ProtoBuf definition.
6497        ///
6498        /// The values are not transformed in any way and thus are considered stable
6499        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6500        pub fn as_str_name(&self) -> &'static str {
6501            match self {
6502                Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
6503                Self::Field => "FIELD",
6504                Self::Object => "OBJECT",
6505            }
6506        }
6507        /// Creates an enum from field names used in the ProtoBuf definition.
6508        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6509            match value {
6510                "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
6511                "FIELD" => Some(Self::Field),
6512                "OBJECT" => Some(Self::Object),
6513                _ => None,
6514            }
6515        }
6516    }
6517}
6518#[non_exhaustive]
6519#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6520pub struct ListOwnedObjectsRequest {
6521    /// Required. The address of the account that owns the objects.
6522    #[prost(string, optional, tag = "1")]
6523    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6524    /// The maximum number of entries return. The service may return fewer than this value.
6525    /// If unspecified, at most `50` entries will be returned.
6526    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6527    #[prost(uint32, optional, tag = "2")]
6528    pub page_size: ::core::option::Option<u32>,
6529    /// A page token, received from a previous `ListOwnedObjects` call.
6530    /// Provide this to retrieve the subsequent page.
6531    ///
6532    /// When paginating, all other parameters provided to `ListOwnedObjects` must
6533    /// match the call that provided the page token.
6534    #[prost(bytes = "bytes", optional, tag = "3")]
6535    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6536    /// Mask specifying which fields to read.
6537    /// If no mask is specified, defaults to `object_id,version,object_type`.
6538    #[prost(message, optional, tag = "4")]
6539    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6540    /// Optional type filter to limit the types of objects listed.
6541    ///
6542    /// Providing an object type with no type params will return objects of that
6543    /// type with any type parameter, e.g. `0x2::coin::Coin` will return all
6544    /// `Coin<T>` objects regardless of the type parameter `T`. Providing a type
6545    /// with a type param will restrict the returned objects to only those objects
6546    /// that match the provided type parameters, e.g.
6547    /// `0x2::coin::Coin<0x2::sui::SUI>` will only return `Coin<SUI>` objects.
6548    #[prost(string, optional, tag = "5")]
6549    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
6550}
6551#[non_exhaustive]
6552#[derive(Clone, PartialEq, ::prost::Message)]
6553pub struct ListOwnedObjectsResponse {
6554    /// Page of dynamic fields owned by the specified parent.
6555    #[prost(message, repeated, tag = "1")]
6556    pub objects: ::prost::alloc::vec::Vec<Object>,
6557    /// A token, which can be sent as `page_token` to retrieve the next page.
6558    /// If this field is omitted, there are no subsequent pages.
6559    #[prost(bytes = "bytes", optional, tag = "2")]
6560    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6561}
6562/// Generated client implementations.
6563pub mod state_service_client {
6564    #![allow(
6565        unused_variables,
6566        dead_code,
6567        missing_docs,
6568        clippy::wildcard_imports,
6569        clippy::let_unit_value,
6570    )]
6571    use tonic::codegen::*;
6572    use tonic::codegen::http::Uri;
6573    #[derive(Debug, Clone)]
6574    pub struct StateServiceClient<T> {
6575        inner: tonic::client::Grpc<T>,
6576    }
6577    impl StateServiceClient<tonic::transport::Channel> {
6578        /// Attempt to create a new client by connecting to a given endpoint.
6579        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6580        where
6581            D: TryInto<tonic::transport::Endpoint>,
6582            D::Error: Into<StdError>,
6583        {
6584            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6585            Ok(Self::new(conn))
6586        }
6587    }
6588    impl<T> StateServiceClient<T>
6589    where
6590        T: tonic::client::GrpcService<tonic::body::Body>,
6591        T::Error: Into<StdError>,
6592        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6593        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6594    {
6595        pub fn new(inner: T) -> Self {
6596            let inner = tonic::client::Grpc::new(inner);
6597            Self { inner }
6598        }
6599        pub fn with_origin(inner: T, origin: Uri) -> Self {
6600            let inner = tonic::client::Grpc::with_origin(inner, origin);
6601            Self { inner }
6602        }
6603        pub fn with_interceptor<F>(
6604            inner: T,
6605            interceptor: F,
6606        ) -> StateServiceClient<InterceptedService<T, F>>
6607        where
6608            F: tonic::service::Interceptor,
6609            T::ResponseBody: Default,
6610            T: tonic::codegen::Service<
6611                http::Request<tonic::body::Body>,
6612                Response = http::Response<
6613                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6614                >,
6615            >,
6616            <T as tonic::codegen::Service<
6617                http::Request<tonic::body::Body>,
6618            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6619        {
6620            StateServiceClient::new(InterceptedService::new(inner, interceptor))
6621        }
6622        /// Compress requests with the given encoding.
6623        ///
6624        /// This requires the server to support it otherwise it might respond with an
6625        /// error.
6626        #[must_use]
6627        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6628            self.inner = self.inner.send_compressed(encoding);
6629            self
6630        }
6631        /// Enable decompressing responses.
6632        #[must_use]
6633        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6634            self.inner = self.inner.accept_compressed(encoding);
6635            self
6636        }
6637        /// Limits the maximum size of a decoded message.
6638        ///
6639        /// Default: `4MB`
6640        #[must_use]
6641        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6642            self.inner = self.inner.max_decoding_message_size(limit);
6643            self
6644        }
6645        /// Limits the maximum size of an encoded message.
6646        ///
6647        /// Default: `usize::MAX`
6648        #[must_use]
6649        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6650            self.inner = self.inner.max_encoding_message_size(limit);
6651            self
6652        }
6653        pub async fn list_dynamic_fields(
6654            &mut self,
6655            request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
6656        ) -> std::result::Result<
6657            tonic::Response<super::ListDynamicFieldsResponse>,
6658            tonic::Status,
6659        > {
6660            self.inner
6661                .ready()
6662                .await
6663                .map_err(|e| {
6664                    tonic::Status::unknown(
6665                        format!("Service was not ready: {}", e.into()),
6666                    )
6667                })?;
6668            let codec = tonic_prost::ProstCodec::default();
6669            let path = http::uri::PathAndQuery::from_static(
6670                "/sui.rpc.v2.StateService/ListDynamicFields",
6671            );
6672            let mut req = request.into_request();
6673            req.extensions_mut()
6674                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
6675            self.inner.unary(req, path, codec).await
6676        }
6677        pub async fn list_owned_objects(
6678            &mut self,
6679            request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
6680        ) -> std::result::Result<
6681            tonic::Response<super::ListOwnedObjectsResponse>,
6682            tonic::Status,
6683        > {
6684            self.inner
6685                .ready()
6686                .await
6687                .map_err(|e| {
6688                    tonic::Status::unknown(
6689                        format!("Service was not ready: {}", e.into()),
6690                    )
6691                })?;
6692            let codec = tonic_prost::ProstCodec::default();
6693            let path = http::uri::PathAndQuery::from_static(
6694                "/sui.rpc.v2.StateService/ListOwnedObjects",
6695            );
6696            let mut req = request.into_request();
6697            req.extensions_mut()
6698                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
6699            self.inner.unary(req, path, codec).await
6700        }
6701        pub async fn get_coin_info(
6702            &mut self,
6703            request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
6704        ) -> std::result::Result<
6705            tonic::Response<super::GetCoinInfoResponse>,
6706            tonic::Status,
6707        > {
6708            self.inner
6709                .ready()
6710                .await
6711                .map_err(|e| {
6712                    tonic::Status::unknown(
6713                        format!("Service was not ready: {}", e.into()),
6714                    )
6715                })?;
6716            let codec = tonic_prost::ProstCodec::default();
6717            let path = http::uri::PathAndQuery::from_static(
6718                "/sui.rpc.v2.StateService/GetCoinInfo",
6719            );
6720            let mut req = request.into_request();
6721            req.extensions_mut()
6722                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
6723            self.inner.unary(req, path, codec).await
6724        }
6725        pub async fn get_balance(
6726            &mut self,
6727            request: impl tonic::IntoRequest<super::GetBalanceRequest>,
6728        ) -> std::result::Result<
6729            tonic::Response<super::GetBalanceResponse>,
6730            tonic::Status,
6731        > {
6732            self.inner
6733                .ready()
6734                .await
6735                .map_err(|e| {
6736                    tonic::Status::unknown(
6737                        format!("Service was not ready: {}", e.into()),
6738                    )
6739                })?;
6740            let codec = tonic_prost::ProstCodec::default();
6741            let path = http::uri::PathAndQuery::from_static(
6742                "/sui.rpc.v2.StateService/GetBalance",
6743            );
6744            let mut req = request.into_request();
6745            req.extensions_mut()
6746                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
6747            self.inner.unary(req, path, codec).await
6748        }
6749        pub async fn list_balances(
6750            &mut self,
6751            request: impl tonic::IntoRequest<super::ListBalancesRequest>,
6752        ) -> std::result::Result<
6753            tonic::Response<super::ListBalancesResponse>,
6754            tonic::Status,
6755        > {
6756            self.inner
6757                .ready()
6758                .await
6759                .map_err(|e| {
6760                    tonic::Status::unknown(
6761                        format!("Service was not ready: {}", e.into()),
6762                    )
6763                })?;
6764            let codec = tonic_prost::ProstCodec::default();
6765            let path = http::uri::PathAndQuery::from_static(
6766                "/sui.rpc.v2.StateService/ListBalances",
6767            );
6768            let mut req = request.into_request();
6769            req.extensions_mut()
6770                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
6771            self.inner.unary(req, path, codec).await
6772        }
6773    }
6774}
6775/// Generated server implementations.
6776pub mod state_service_server {
6777    #![allow(
6778        unused_variables,
6779        dead_code,
6780        missing_docs,
6781        clippy::wildcard_imports,
6782        clippy::let_unit_value,
6783    )]
6784    use tonic::codegen::*;
6785    /// Generated trait containing gRPC methods that should be implemented for use with StateServiceServer.
6786    #[async_trait]
6787    pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
6788        async fn list_dynamic_fields(
6789            &self,
6790            request: tonic::Request<super::ListDynamicFieldsRequest>,
6791        ) -> std::result::Result<
6792            tonic::Response<super::ListDynamicFieldsResponse>,
6793            tonic::Status,
6794        > {
6795            Err(tonic::Status::unimplemented("Not yet implemented"))
6796        }
6797        async fn list_owned_objects(
6798            &self,
6799            request: tonic::Request<super::ListOwnedObjectsRequest>,
6800        ) -> std::result::Result<
6801            tonic::Response<super::ListOwnedObjectsResponse>,
6802            tonic::Status,
6803        > {
6804            Err(tonic::Status::unimplemented("Not yet implemented"))
6805        }
6806        async fn get_coin_info(
6807            &self,
6808            request: tonic::Request<super::GetCoinInfoRequest>,
6809        ) -> std::result::Result<
6810            tonic::Response<super::GetCoinInfoResponse>,
6811            tonic::Status,
6812        > {
6813            Err(tonic::Status::unimplemented("Not yet implemented"))
6814        }
6815        async fn get_balance(
6816            &self,
6817            request: tonic::Request<super::GetBalanceRequest>,
6818        ) -> std::result::Result<
6819            tonic::Response<super::GetBalanceResponse>,
6820            tonic::Status,
6821        > {
6822            Err(tonic::Status::unimplemented("Not yet implemented"))
6823        }
6824        async fn list_balances(
6825            &self,
6826            request: tonic::Request<super::ListBalancesRequest>,
6827        ) -> std::result::Result<
6828            tonic::Response<super::ListBalancesResponse>,
6829            tonic::Status,
6830        > {
6831            Err(tonic::Status::unimplemented("Not yet implemented"))
6832        }
6833    }
6834    #[derive(Debug)]
6835    pub struct StateServiceServer<T> {
6836        inner: Arc<T>,
6837        accept_compression_encodings: EnabledCompressionEncodings,
6838        send_compression_encodings: EnabledCompressionEncodings,
6839        max_decoding_message_size: Option<usize>,
6840        max_encoding_message_size: Option<usize>,
6841    }
6842    impl<T> StateServiceServer<T> {
6843        pub fn new(inner: T) -> Self {
6844            Self::from_arc(Arc::new(inner))
6845        }
6846        pub fn from_arc(inner: Arc<T>) -> Self {
6847            Self {
6848                inner,
6849                accept_compression_encodings: Default::default(),
6850                send_compression_encodings: Default::default(),
6851                max_decoding_message_size: None,
6852                max_encoding_message_size: None,
6853            }
6854        }
6855        pub fn with_interceptor<F>(
6856            inner: T,
6857            interceptor: F,
6858        ) -> InterceptedService<Self, F>
6859        where
6860            F: tonic::service::Interceptor,
6861        {
6862            InterceptedService::new(Self::new(inner), interceptor)
6863        }
6864        /// Enable decompressing requests with the given encoding.
6865        #[must_use]
6866        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6867            self.accept_compression_encodings.enable(encoding);
6868            self
6869        }
6870        /// Compress responses with the given encoding, if the client supports it.
6871        #[must_use]
6872        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6873            self.send_compression_encodings.enable(encoding);
6874            self
6875        }
6876        /// Limits the maximum size of a decoded message.
6877        ///
6878        /// Default: `4MB`
6879        #[must_use]
6880        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6881            self.max_decoding_message_size = Some(limit);
6882            self
6883        }
6884        /// Limits the maximum size of an encoded message.
6885        ///
6886        /// Default: `usize::MAX`
6887        #[must_use]
6888        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6889            self.max_encoding_message_size = Some(limit);
6890            self
6891        }
6892    }
6893    impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
6894    where
6895        T: StateService,
6896        B: Body + std::marker::Send + 'static,
6897        B::Error: Into<StdError> + std::marker::Send + 'static,
6898    {
6899        type Response = http::Response<tonic::body::Body>;
6900        type Error = std::convert::Infallible;
6901        type Future = BoxFuture<Self::Response, Self::Error>;
6902        fn poll_ready(
6903            &mut self,
6904            _cx: &mut Context<'_>,
6905        ) -> Poll<std::result::Result<(), Self::Error>> {
6906            Poll::Ready(Ok(()))
6907        }
6908        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6909            match req.uri().path() {
6910                "/sui.rpc.v2.StateService/ListDynamicFields" => {
6911                    #[allow(non_camel_case_types)]
6912                    struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
6913                    impl<
6914                        T: StateService,
6915                    > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
6916                    for ListDynamicFieldsSvc<T> {
6917                        type Response = super::ListDynamicFieldsResponse;
6918                        type Future = BoxFuture<
6919                            tonic::Response<Self::Response>,
6920                            tonic::Status,
6921                        >;
6922                        fn call(
6923                            &mut self,
6924                            request: tonic::Request<super::ListDynamicFieldsRequest>,
6925                        ) -> Self::Future {
6926                            let inner = Arc::clone(&self.0);
6927                            let fut = async move {
6928                                <T as StateService>::list_dynamic_fields(&inner, request)
6929                                    .await
6930                            };
6931                            Box::pin(fut)
6932                        }
6933                    }
6934                    let accept_compression_encodings = self.accept_compression_encodings;
6935                    let send_compression_encodings = self.send_compression_encodings;
6936                    let max_decoding_message_size = self.max_decoding_message_size;
6937                    let max_encoding_message_size = self.max_encoding_message_size;
6938                    let inner = self.inner.clone();
6939                    let fut = async move {
6940                        let method = ListDynamicFieldsSvc(inner);
6941                        let codec = tonic_prost::ProstCodec::default();
6942                        let mut grpc = tonic::server::Grpc::new(codec)
6943                            .apply_compression_config(
6944                                accept_compression_encodings,
6945                                send_compression_encodings,
6946                            )
6947                            .apply_max_message_size_config(
6948                                max_decoding_message_size,
6949                                max_encoding_message_size,
6950                            );
6951                        let res = grpc.unary(method, req).await;
6952                        Ok(res)
6953                    };
6954                    Box::pin(fut)
6955                }
6956                "/sui.rpc.v2.StateService/ListOwnedObjects" => {
6957                    #[allow(non_camel_case_types)]
6958                    struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
6959                    impl<
6960                        T: StateService,
6961                    > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
6962                    for ListOwnedObjectsSvc<T> {
6963                        type Response = super::ListOwnedObjectsResponse;
6964                        type Future = BoxFuture<
6965                            tonic::Response<Self::Response>,
6966                            tonic::Status,
6967                        >;
6968                        fn call(
6969                            &mut self,
6970                            request: tonic::Request<super::ListOwnedObjectsRequest>,
6971                        ) -> Self::Future {
6972                            let inner = Arc::clone(&self.0);
6973                            let fut = async move {
6974                                <T as StateService>::list_owned_objects(&inner, request)
6975                                    .await
6976                            };
6977                            Box::pin(fut)
6978                        }
6979                    }
6980                    let accept_compression_encodings = self.accept_compression_encodings;
6981                    let send_compression_encodings = self.send_compression_encodings;
6982                    let max_decoding_message_size = self.max_decoding_message_size;
6983                    let max_encoding_message_size = self.max_encoding_message_size;
6984                    let inner = self.inner.clone();
6985                    let fut = async move {
6986                        let method = ListOwnedObjectsSvc(inner);
6987                        let codec = tonic_prost::ProstCodec::default();
6988                        let mut grpc = tonic::server::Grpc::new(codec)
6989                            .apply_compression_config(
6990                                accept_compression_encodings,
6991                                send_compression_encodings,
6992                            )
6993                            .apply_max_message_size_config(
6994                                max_decoding_message_size,
6995                                max_encoding_message_size,
6996                            );
6997                        let res = grpc.unary(method, req).await;
6998                        Ok(res)
6999                    };
7000                    Box::pin(fut)
7001                }
7002                "/sui.rpc.v2.StateService/GetCoinInfo" => {
7003                    #[allow(non_camel_case_types)]
7004                    struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
7005                    impl<
7006                        T: StateService,
7007                    > tonic::server::UnaryService<super::GetCoinInfoRequest>
7008                    for GetCoinInfoSvc<T> {
7009                        type Response = super::GetCoinInfoResponse;
7010                        type Future = BoxFuture<
7011                            tonic::Response<Self::Response>,
7012                            tonic::Status,
7013                        >;
7014                        fn call(
7015                            &mut self,
7016                            request: tonic::Request<super::GetCoinInfoRequest>,
7017                        ) -> Self::Future {
7018                            let inner = Arc::clone(&self.0);
7019                            let fut = async move {
7020                                <T as StateService>::get_coin_info(&inner, request).await
7021                            };
7022                            Box::pin(fut)
7023                        }
7024                    }
7025                    let accept_compression_encodings = self.accept_compression_encodings;
7026                    let send_compression_encodings = self.send_compression_encodings;
7027                    let max_decoding_message_size = self.max_decoding_message_size;
7028                    let max_encoding_message_size = self.max_encoding_message_size;
7029                    let inner = self.inner.clone();
7030                    let fut = async move {
7031                        let method = GetCoinInfoSvc(inner);
7032                        let codec = tonic_prost::ProstCodec::default();
7033                        let mut grpc = tonic::server::Grpc::new(codec)
7034                            .apply_compression_config(
7035                                accept_compression_encodings,
7036                                send_compression_encodings,
7037                            )
7038                            .apply_max_message_size_config(
7039                                max_decoding_message_size,
7040                                max_encoding_message_size,
7041                            );
7042                        let res = grpc.unary(method, req).await;
7043                        Ok(res)
7044                    };
7045                    Box::pin(fut)
7046                }
7047                "/sui.rpc.v2.StateService/GetBalance" => {
7048                    #[allow(non_camel_case_types)]
7049                    struct GetBalanceSvc<T: StateService>(pub Arc<T>);
7050                    impl<
7051                        T: StateService,
7052                    > tonic::server::UnaryService<super::GetBalanceRequest>
7053                    for GetBalanceSvc<T> {
7054                        type Response = super::GetBalanceResponse;
7055                        type Future = BoxFuture<
7056                            tonic::Response<Self::Response>,
7057                            tonic::Status,
7058                        >;
7059                        fn call(
7060                            &mut self,
7061                            request: tonic::Request<super::GetBalanceRequest>,
7062                        ) -> Self::Future {
7063                            let inner = Arc::clone(&self.0);
7064                            let fut = async move {
7065                                <T as StateService>::get_balance(&inner, request).await
7066                            };
7067                            Box::pin(fut)
7068                        }
7069                    }
7070                    let accept_compression_encodings = self.accept_compression_encodings;
7071                    let send_compression_encodings = self.send_compression_encodings;
7072                    let max_decoding_message_size = self.max_decoding_message_size;
7073                    let max_encoding_message_size = self.max_encoding_message_size;
7074                    let inner = self.inner.clone();
7075                    let fut = async move {
7076                        let method = GetBalanceSvc(inner);
7077                        let codec = tonic_prost::ProstCodec::default();
7078                        let mut grpc = tonic::server::Grpc::new(codec)
7079                            .apply_compression_config(
7080                                accept_compression_encodings,
7081                                send_compression_encodings,
7082                            )
7083                            .apply_max_message_size_config(
7084                                max_decoding_message_size,
7085                                max_encoding_message_size,
7086                            );
7087                        let res = grpc.unary(method, req).await;
7088                        Ok(res)
7089                    };
7090                    Box::pin(fut)
7091                }
7092                "/sui.rpc.v2.StateService/ListBalances" => {
7093                    #[allow(non_camel_case_types)]
7094                    struct ListBalancesSvc<T: StateService>(pub Arc<T>);
7095                    impl<
7096                        T: StateService,
7097                    > tonic::server::UnaryService<super::ListBalancesRequest>
7098                    for ListBalancesSvc<T> {
7099                        type Response = super::ListBalancesResponse;
7100                        type Future = BoxFuture<
7101                            tonic::Response<Self::Response>,
7102                            tonic::Status,
7103                        >;
7104                        fn call(
7105                            &mut self,
7106                            request: tonic::Request<super::ListBalancesRequest>,
7107                        ) -> Self::Future {
7108                            let inner = Arc::clone(&self.0);
7109                            let fut = async move {
7110                                <T as StateService>::list_balances(&inner, request).await
7111                            };
7112                            Box::pin(fut)
7113                        }
7114                    }
7115                    let accept_compression_encodings = self.accept_compression_encodings;
7116                    let send_compression_encodings = self.send_compression_encodings;
7117                    let max_decoding_message_size = self.max_decoding_message_size;
7118                    let max_encoding_message_size = self.max_encoding_message_size;
7119                    let inner = self.inner.clone();
7120                    let fut = async move {
7121                        let method = ListBalancesSvc(inner);
7122                        let codec = tonic_prost::ProstCodec::default();
7123                        let mut grpc = tonic::server::Grpc::new(codec)
7124                            .apply_compression_config(
7125                                accept_compression_encodings,
7126                                send_compression_encodings,
7127                            )
7128                            .apply_max_message_size_config(
7129                                max_decoding_message_size,
7130                                max_encoding_message_size,
7131                            );
7132                        let res = grpc.unary(method, req).await;
7133                        Ok(res)
7134                    };
7135                    Box::pin(fut)
7136                }
7137                _ => {
7138                    Box::pin(async move {
7139                        let mut response = http::Response::new(
7140                            tonic::body::Body::default(),
7141                        );
7142                        let headers = response.headers_mut();
7143                        headers
7144                            .insert(
7145                                tonic::Status::GRPC_STATUS,
7146                                (tonic::Code::Unimplemented as i32).into(),
7147                            );
7148                        headers
7149                            .insert(
7150                                http::header::CONTENT_TYPE,
7151                                tonic::metadata::GRPC_CONTENT_TYPE,
7152                            );
7153                        Ok(response)
7154                    })
7155                }
7156            }
7157        }
7158    }
7159    impl<T> Clone for StateServiceServer<T> {
7160        fn clone(&self) -> Self {
7161            let inner = self.inner.clone();
7162            Self {
7163                inner,
7164                accept_compression_encodings: self.accept_compression_encodings,
7165                send_compression_encodings: self.send_compression_encodings,
7166                max_decoding_message_size: self.max_decoding_message_size,
7167                max_encoding_message_size: self.max_encoding_message_size,
7168            }
7169        }
7170    }
7171    /// Generated gRPC service name
7172    pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
7173    impl<T> tonic::server::NamedService for StateServiceServer<T> {
7174        const NAME: &'static str = SERVICE_NAME;
7175    }
7176}
7177/// Request message for SubscriptionService.SubscribeCheckpoints.
7178#[derive(Eq, Hash)]
7179#[non_exhaustive]
7180#[derive(Clone, PartialEq, ::prost::Message)]
7181pub struct SubscribeCheckpointsRequest {
7182    /// Optional. Mask for specifying which parts of the Checkpoint should be
7183    /// returned (e.g. summary, contents, signatures). `cursor` is always
7184    /// populated and is not subject to the mask.
7185    #[prost(message, optional, tag = "1")]
7186    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7187    /// Optional. DNF filter over indexed transaction dimensions. A checkpoint
7188    /// matches if any transaction it contains satisfies the filter. If absent,
7189    /// every checkpoint is streamed.
7190    #[prost(message, optional, tag = "2")]
7191    pub filter: ::core::option::Option<TransactionFilter>,
7192}
7193/// Response message for SubscriptionService.SubscribeCheckpoints.
7194///
7195/// A checkpoint stream's position is checkpoint-granular, so the `cursor`
7196/// sequence number stands in for the `Watermark` message the other
7197/// subscription responses carry. Progress-only frames (with `checkpoint`
7198/// unset) occur only on filtered streams: on an unfiltered stream every frame
7199/// carries both fields, in order and without gaps.
7200#[non_exhaustive]
7201#[derive(Clone, PartialEq, ::prost::Message)]
7202pub struct SubscribeCheckpointsResponse {
7203    /// Required. The checkpoint sequence number the stream has fully covered,
7204    /// inclusive: every matching checkpoint from the stream's start position
7205    /// through `cursor` has been delivered. Present on every frame and
7206    /// advances monotonically.
7207    #[prost(uint64, optional, tag = "1")]
7208    pub cursor: ::core::option::Option<u64>,
7209    /// The matching checkpoint. Unset when this frame only advances the
7210    /// cursor past non-matching checkpoints.
7211    #[prost(message, optional, tag = "2")]
7212    pub checkpoint: ::core::option::Option<Checkpoint>,
7213}
7214/// Request message for SubscriptionService.SubscribeTransactions.
7215#[non_exhaustive]
7216#[derive(Clone, PartialEq, ::prost::Message)]
7217pub struct SubscribeTransactionsRequest {
7218    /// Optional. Mask for specifying which parts of the ExecutedTransaction
7219    /// should be returned.
7220    #[prost(message, optional, tag = "1")]
7221    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7222    /// Optional. DNF filter over indexed dimensions. If absent, every
7223    /// transaction is streamed.
7224    #[prost(message, optional, tag = "2")]
7225    pub filter: ::core::option::Option<TransactionFilter>,
7226}
7227/// Response message for SubscriptionService.SubscribeTransactions.
7228///
7229/// Mirrors ListTransactionsResponse, except there is no `end` field: a
7230/// subscription stream has no successful end.
7231#[non_exhaustive]
7232#[derive(Clone, PartialEq, ::prost::Message)]
7233pub struct SubscribeTransactionsResponse {
7234    /// One matching transaction. Its position within the containing checkpoint
7235    /// is reported by `ExecutedTransaction.transaction_index`.
7236    #[prost(message, optional, tag = "1")]
7237    pub transaction: ::core::option::Option<ExecutedTransaction>,
7238    /// Progress watermark as of this frame. Present on every frame.
7239    #[prost(message, optional, tag = "2")]
7240    pub watermark: ::core::option::Option<Watermark>,
7241}
7242/// Request message for SubscriptionService.SubscribeEvents.
7243#[non_exhaustive]
7244#[derive(Clone, PartialEq, ::prost::Message)]
7245pub struct SubscribeEventsRequest {
7246    /// Optional. Mask for specifying which parts of the Event should be
7247    /// returned.
7248    #[prost(message, optional, tag = "1")]
7249    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7250    /// Optional. DNF filter over indexed dimensions. If absent, every event is
7251    /// streamed.
7252    #[prost(message, optional, tag = "2")]
7253    pub filter: ::core::option::Option<EventFilter>,
7254}
7255/// Response message for SubscriptionService.SubscribeEvents.
7256///
7257/// Mirrors ListEventsResponse, except there is no `end` field: a subscription
7258/// stream has no successful end.
7259#[non_exhaustive]
7260#[derive(Clone, PartialEq, ::prost::Message)]
7261pub struct SubscribeEventsResponse {
7262    /// One matching event. Its ledger position -- containing checkpoint,
7263    /// emitting transaction digest and offset, and index within that
7264    /// transaction's event list -- is reported by the corresponding fields on
7265    /// `Event`.
7266    #[prost(message, optional, tag = "1")]
7267    pub event: ::core::option::Option<Event>,
7268    /// Progress watermark as of this frame. Present on every frame.
7269    #[prost(message, optional, tag = "2")]
7270    pub watermark: ::core::option::Option<Watermark>,
7271}
7272/// Generated client implementations.
7273pub mod subscription_service_client {
7274    #![allow(
7275        unused_variables,
7276        dead_code,
7277        missing_docs,
7278        clippy::wildcard_imports,
7279        clippy::let_unit_value,
7280    )]
7281    use tonic::codegen::*;
7282    use tonic::codegen::http::Uri;
7283    /// SubscriptionService provides filtered, real-time streams of checkpoints,
7284    /// transactions, and events.
7285    ///
7286    /// Each Subscribe API pairs with the LedgerService List API of the same name:
7287    /// requests take the same filter message, and responses carry the same item
7288    /// and watermark shapes with identical cursor semantics.
7289    ///
7290    /// Subscriptions do not support resumption. A new subscription always begins
7291    /// at the current tip of the chain as seen by the server (the latest executed
7292    /// checkpoint). To recover data missed between subscriptions, replay the gap
7293    /// with the paired List API: pass the last received `Watermark.cursor` as
7294    /// `options.after` on the List request (for checkpoints, pass the last
7295    /// received `cursor + 1` as `start_checkpoint`). The List scan reads from the
7296    /// indexed tip, which may trail the subscription's start position; repeat the
7297    /// List call as the index advances until the replay reaches the position
7298    /// established by the subscription's first frame.
7299    ///
7300    /// A subscription behaves like an unbounded ascending scan: every frame
7301    /// carries the subscriber's resume point, and progress advances as
7302    /// checkpoints are fully covered. Two delivery guarantees keep sparse
7303    /// filters live: the first frame on a filtered subscription is a
7304    /// progress-only frame establishing the stream's start position, and
7305    /// progress continues to advance with bounded staleness even when no item
7306    /// matches.
7307    ///
7308    /// Subscription streams have no successful end: they run until cancelled by
7309    /// the client or terminated by the server with a gRPC status.
7310    #[derive(Debug, Clone)]
7311    pub struct SubscriptionServiceClient<T> {
7312        inner: tonic::client::Grpc<T>,
7313    }
7314    impl SubscriptionServiceClient<tonic::transport::Channel> {
7315        /// Attempt to create a new client by connecting to a given endpoint.
7316        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7317        where
7318            D: TryInto<tonic::transport::Endpoint>,
7319            D::Error: Into<StdError>,
7320        {
7321            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7322            Ok(Self::new(conn))
7323        }
7324    }
7325    impl<T> SubscriptionServiceClient<T>
7326    where
7327        T: tonic::client::GrpcService<tonic::body::Body>,
7328        T::Error: Into<StdError>,
7329        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7330        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7331    {
7332        pub fn new(inner: T) -> Self {
7333            let inner = tonic::client::Grpc::new(inner);
7334            Self { inner }
7335        }
7336        pub fn with_origin(inner: T, origin: Uri) -> Self {
7337            let inner = tonic::client::Grpc::with_origin(inner, origin);
7338            Self { inner }
7339        }
7340        pub fn with_interceptor<F>(
7341            inner: T,
7342            interceptor: F,
7343        ) -> SubscriptionServiceClient<InterceptedService<T, F>>
7344        where
7345            F: tonic::service::Interceptor,
7346            T::ResponseBody: Default,
7347            T: tonic::codegen::Service<
7348                http::Request<tonic::body::Body>,
7349                Response = http::Response<
7350                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7351                >,
7352            >,
7353            <T as tonic::codegen::Service<
7354                http::Request<tonic::body::Body>,
7355            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7356        {
7357            SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
7358        }
7359        /// Compress requests with the given encoding.
7360        ///
7361        /// This requires the server to support it otherwise it might respond with an
7362        /// error.
7363        #[must_use]
7364        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7365            self.inner = self.inner.send_compressed(encoding);
7366            self
7367        }
7368        /// Enable decompressing responses.
7369        #[must_use]
7370        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7371            self.inner = self.inner.accept_compressed(encoding);
7372            self
7373        }
7374        /// Limits the maximum size of a decoded message.
7375        ///
7376        /// Default: `4MB`
7377        #[must_use]
7378        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7379            self.inner = self.inner.max_decoding_message_size(limit);
7380            self
7381        }
7382        /// Limits the maximum size of an encoded message.
7383        ///
7384        /// Default: `usize::MAX`
7385        #[must_use]
7386        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7387            self.inner = self.inner.max_encoding_message_size(limit);
7388            self
7389        }
7390        /// Subscribe to the stream of checkpoints.
7391        ///
7392        /// The stream begins at the latest executed checkpoint as seen by the
7393        /// server and yields checkpoints matching the filter as they are executed.
7394        /// A checkpoint matches if any transaction it contains satisfies the
7395        /// filter.
7396        pub async fn subscribe_checkpoints(
7397            &mut self,
7398            request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
7399        ) -> std::result::Result<
7400            tonic::Response<
7401                tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
7402            >,
7403            tonic::Status,
7404        > {
7405            self.inner
7406                .ready()
7407                .await
7408                .map_err(|e| {
7409                    tonic::Status::unknown(
7410                        format!("Service was not ready: {}", e.into()),
7411                    )
7412                })?;
7413            let codec = tonic_prost::ProstCodec::default();
7414            let path = http::uri::PathAndQuery::from_static(
7415                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
7416            );
7417            let mut req = request.into_request();
7418            req.extensions_mut()
7419                .insert(
7420                    GrpcMethod::new(
7421                        "sui.rpc.v2.SubscriptionService",
7422                        "SubscribeCheckpoints",
7423                    ),
7424                );
7425            self.inner.server_streaming(req, path, codec).await
7426        }
7427        /// Subscribe to the stream of transactions.
7428        ///
7429        /// The stream begins at the latest executed checkpoint as seen by the
7430        /// server and yields transactions matching the filter as they are executed.
7431        pub async fn subscribe_transactions(
7432            &mut self,
7433            request: impl tonic::IntoRequest<super::SubscribeTransactionsRequest>,
7434        ) -> std::result::Result<
7435            tonic::Response<
7436                tonic::codec::Streaming<super::SubscribeTransactionsResponse>,
7437            >,
7438            tonic::Status,
7439        > {
7440            self.inner
7441                .ready()
7442                .await
7443                .map_err(|e| {
7444                    tonic::Status::unknown(
7445                        format!("Service was not ready: {}", e.into()),
7446                    )
7447                })?;
7448            let codec = tonic_prost::ProstCodec::default();
7449            let path = http::uri::PathAndQuery::from_static(
7450                "/sui.rpc.v2.SubscriptionService/SubscribeTransactions",
7451            );
7452            let mut req = request.into_request();
7453            req.extensions_mut()
7454                .insert(
7455                    GrpcMethod::new(
7456                        "sui.rpc.v2.SubscriptionService",
7457                        "SubscribeTransactions",
7458                    ),
7459                );
7460            self.inner.server_streaming(req, path, codec).await
7461        }
7462        /// Subscribe to the stream of events.
7463        ///
7464        /// The stream begins at the latest executed checkpoint as seen by the
7465        /// server and yields events matching the filter as they are emitted.
7466        pub async fn subscribe_events(
7467            &mut self,
7468            request: impl tonic::IntoRequest<super::SubscribeEventsRequest>,
7469        ) -> std::result::Result<
7470            tonic::Response<tonic::codec::Streaming<super::SubscribeEventsResponse>>,
7471            tonic::Status,
7472        > {
7473            self.inner
7474                .ready()
7475                .await
7476                .map_err(|e| {
7477                    tonic::Status::unknown(
7478                        format!("Service was not ready: {}", e.into()),
7479                    )
7480                })?;
7481            let codec = tonic_prost::ProstCodec::default();
7482            let path = http::uri::PathAndQuery::from_static(
7483                "/sui.rpc.v2.SubscriptionService/SubscribeEvents",
7484            );
7485            let mut req = request.into_request();
7486            req.extensions_mut()
7487                .insert(
7488                    GrpcMethod::new("sui.rpc.v2.SubscriptionService", "SubscribeEvents"),
7489                );
7490            self.inner.server_streaming(req, path, codec).await
7491        }
7492    }
7493}
7494/// Generated server implementations.
7495pub mod subscription_service_server {
7496    #![allow(
7497        unused_variables,
7498        dead_code,
7499        missing_docs,
7500        clippy::wildcard_imports,
7501        clippy::let_unit_value,
7502    )]
7503    use tonic::codegen::*;
7504    /// Generated trait containing gRPC methods that should be implemented for use with SubscriptionServiceServer.
7505    #[async_trait]
7506    pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
7507        /// Subscribe to the stream of checkpoints.
7508        ///
7509        /// The stream begins at the latest executed checkpoint as seen by the
7510        /// server and yields checkpoints matching the filter as they are executed.
7511        /// A checkpoint matches if any transaction it contains satisfies the
7512        /// filter.
7513        async fn subscribe_checkpoints(
7514            &self,
7515            request: tonic::Request<super::SubscribeCheckpointsRequest>,
7516        ) -> std::result::Result<
7517            tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
7518            tonic::Status,
7519        > {
7520            Err(tonic::Status::unimplemented("Not yet implemented"))
7521        }
7522        /// Subscribe to the stream of transactions.
7523        ///
7524        /// The stream begins at the latest executed checkpoint as seen by the
7525        /// server and yields transactions matching the filter as they are executed.
7526        async fn subscribe_transactions(
7527            &self,
7528            request: tonic::Request<super::SubscribeTransactionsRequest>,
7529        ) -> std::result::Result<
7530            tonic::Response<BoxStream<super::SubscribeTransactionsResponse>>,
7531            tonic::Status,
7532        > {
7533            Err(tonic::Status::unimplemented("Not yet implemented"))
7534        }
7535        /// Subscribe to the stream of events.
7536        ///
7537        /// The stream begins at the latest executed checkpoint as seen by the
7538        /// server and yields events matching the filter as they are emitted.
7539        async fn subscribe_events(
7540            &self,
7541            request: tonic::Request<super::SubscribeEventsRequest>,
7542        ) -> std::result::Result<
7543            tonic::Response<BoxStream<super::SubscribeEventsResponse>>,
7544            tonic::Status,
7545        > {
7546            Err(tonic::Status::unimplemented("Not yet implemented"))
7547        }
7548    }
7549    /// SubscriptionService provides filtered, real-time streams of checkpoints,
7550    /// transactions, and events.
7551    ///
7552    /// Each Subscribe API pairs with the LedgerService List API of the same name:
7553    /// requests take the same filter message, and responses carry the same item
7554    /// and watermark shapes with identical cursor semantics.
7555    ///
7556    /// Subscriptions do not support resumption. A new subscription always begins
7557    /// at the current tip of the chain as seen by the server (the latest executed
7558    /// checkpoint). To recover data missed between subscriptions, replay the gap
7559    /// with the paired List API: pass the last received `Watermark.cursor` as
7560    /// `options.after` on the List request (for checkpoints, pass the last
7561    /// received `cursor + 1` as `start_checkpoint`). The List scan reads from the
7562    /// indexed tip, which may trail the subscription's start position; repeat the
7563    /// List call as the index advances until the replay reaches the position
7564    /// established by the subscription's first frame.
7565    ///
7566    /// A subscription behaves like an unbounded ascending scan: every frame
7567    /// carries the subscriber's resume point, and progress advances as
7568    /// checkpoints are fully covered. Two delivery guarantees keep sparse
7569    /// filters live: the first frame on a filtered subscription is a
7570    /// progress-only frame establishing the stream's start position, and
7571    /// progress continues to advance with bounded staleness even when no item
7572    /// matches.
7573    ///
7574    /// Subscription streams have no successful end: they run until cancelled by
7575    /// the client or terminated by the server with a gRPC status.
7576    #[derive(Debug)]
7577    pub struct SubscriptionServiceServer<T> {
7578        inner: Arc<T>,
7579        accept_compression_encodings: EnabledCompressionEncodings,
7580        send_compression_encodings: EnabledCompressionEncodings,
7581        max_decoding_message_size: Option<usize>,
7582        max_encoding_message_size: Option<usize>,
7583    }
7584    impl<T> SubscriptionServiceServer<T> {
7585        pub fn new(inner: T) -> Self {
7586            Self::from_arc(Arc::new(inner))
7587        }
7588        pub fn from_arc(inner: Arc<T>) -> Self {
7589            Self {
7590                inner,
7591                accept_compression_encodings: Default::default(),
7592                send_compression_encodings: Default::default(),
7593                max_decoding_message_size: None,
7594                max_encoding_message_size: None,
7595            }
7596        }
7597        pub fn with_interceptor<F>(
7598            inner: T,
7599            interceptor: F,
7600        ) -> InterceptedService<Self, F>
7601        where
7602            F: tonic::service::Interceptor,
7603        {
7604            InterceptedService::new(Self::new(inner), interceptor)
7605        }
7606        /// Enable decompressing requests with the given encoding.
7607        #[must_use]
7608        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7609            self.accept_compression_encodings.enable(encoding);
7610            self
7611        }
7612        /// Compress responses with the given encoding, if the client supports it.
7613        #[must_use]
7614        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7615            self.send_compression_encodings.enable(encoding);
7616            self
7617        }
7618        /// Limits the maximum size of a decoded message.
7619        ///
7620        /// Default: `4MB`
7621        #[must_use]
7622        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7623            self.max_decoding_message_size = Some(limit);
7624            self
7625        }
7626        /// Limits the maximum size of an encoded message.
7627        ///
7628        /// Default: `usize::MAX`
7629        #[must_use]
7630        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7631            self.max_encoding_message_size = Some(limit);
7632            self
7633        }
7634    }
7635    impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
7636    where
7637        T: SubscriptionService,
7638        B: Body + std::marker::Send + 'static,
7639        B::Error: Into<StdError> + std::marker::Send + 'static,
7640    {
7641        type Response = http::Response<tonic::body::Body>;
7642        type Error = std::convert::Infallible;
7643        type Future = BoxFuture<Self::Response, Self::Error>;
7644        fn poll_ready(
7645            &mut self,
7646            _cx: &mut Context<'_>,
7647        ) -> Poll<std::result::Result<(), Self::Error>> {
7648            Poll::Ready(Ok(()))
7649        }
7650        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7651            match req.uri().path() {
7652                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
7653                    #[allow(non_camel_case_types)]
7654                    struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
7655                    impl<
7656                        T: SubscriptionService,
7657                    > tonic::server::ServerStreamingService<
7658                        super::SubscribeCheckpointsRequest,
7659                    > for SubscribeCheckpointsSvc<T> {
7660                        type Response = super::SubscribeCheckpointsResponse;
7661                        type ResponseStream = BoxStream<
7662                            super::SubscribeCheckpointsResponse,
7663                        >;
7664                        type Future = BoxFuture<
7665                            tonic::Response<Self::ResponseStream>,
7666                            tonic::Status,
7667                        >;
7668                        fn call(
7669                            &mut self,
7670                            request: tonic::Request<super::SubscribeCheckpointsRequest>,
7671                        ) -> Self::Future {
7672                            let inner = Arc::clone(&self.0);
7673                            let fut = async move {
7674                                <T as SubscriptionService>::subscribe_checkpoints(
7675                                        &inner,
7676                                        request,
7677                                    )
7678                                    .await
7679                            };
7680                            Box::pin(fut)
7681                        }
7682                    }
7683                    let accept_compression_encodings = self.accept_compression_encodings;
7684                    let send_compression_encodings = self.send_compression_encodings;
7685                    let max_decoding_message_size = self.max_decoding_message_size;
7686                    let max_encoding_message_size = self.max_encoding_message_size;
7687                    let inner = self.inner.clone();
7688                    let fut = async move {
7689                        let method = SubscribeCheckpointsSvc(inner);
7690                        let codec = tonic_prost::ProstCodec::default();
7691                        let mut grpc = tonic::server::Grpc::new(codec)
7692                            .apply_compression_config(
7693                                accept_compression_encodings,
7694                                send_compression_encodings,
7695                            )
7696                            .apply_max_message_size_config(
7697                                max_decoding_message_size,
7698                                max_encoding_message_size,
7699                            );
7700                        let res = grpc.server_streaming(method, req).await;
7701                        Ok(res)
7702                    };
7703                    Box::pin(fut)
7704                }
7705                "/sui.rpc.v2.SubscriptionService/SubscribeTransactions" => {
7706                    #[allow(non_camel_case_types)]
7707                    struct SubscribeTransactionsSvc<T: SubscriptionService>(pub Arc<T>);
7708                    impl<
7709                        T: SubscriptionService,
7710                    > tonic::server::ServerStreamingService<
7711                        super::SubscribeTransactionsRequest,
7712                    > for SubscribeTransactionsSvc<T> {
7713                        type Response = super::SubscribeTransactionsResponse;
7714                        type ResponseStream = BoxStream<
7715                            super::SubscribeTransactionsResponse,
7716                        >;
7717                        type Future = BoxFuture<
7718                            tonic::Response<Self::ResponseStream>,
7719                            tonic::Status,
7720                        >;
7721                        fn call(
7722                            &mut self,
7723                            request: tonic::Request<super::SubscribeTransactionsRequest>,
7724                        ) -> Self::Future {
7725                            let inner = Arc::clone(&self.0);
7726                            let fut = async move {
7727                                <T as SubscriptionService>::subscribe_transactions(
7728                                        &inner,
7729                                        request,
7730                                    )
7731                                    .await
7732                            };
7733                            Box::pin(fut)
7734                        }
7735                    }
7736                    let accept_compression_encodings = self.accept_compression_encodings;
7737                    let send_compression_encodings = self.send_compression_encodings;
7738                    let max_decoding_message_size = self.max_decoding_message_size;
7739                    let max_encoding_message_size = self.max_encoding_message_size;
7740                    let inner = self.inner.clone();
7741                    let fut = async move {
7742                        let method = SubscribeTransactionsSvc(inner);
7743                        let codec = tonic_prost::ProstCodec::default();
7744                        let mut grpc = tonic::server::Grpc::new(codec)
7745                            .apply_compression_config(
7746                                accept_compression_encodings,
7747                                send_compression_encodings,
7748                            )
7749                            .apply_max_message_size_config(
7750                                max_decoding_message_size,
7751                                max_encoding_message_size,
7752                            );
7753                        let res = grpc.server_streaming(method, req).await;
7754                        Ok(res)
7755                    };
7756                    Box::pin(fut)
7757                }
7758                "/sui.rpc.v2.SubscriptionService/SubscribeEvents" => {
7759                    #[allow(non_camel_case_types)]
7760                    struct SubscribeEventsSvc<T: SubscriptionService>(pub Arc<T>);
7761                    impl<
7762                        T: SubscriptionService,
7763                    > tonic::server::ServerStreamingService<
7764                        super::SubscribeEventsRequest,
7765                    > for SubscribeEventsSvc<T> {
7766                        type Response = super::SubscribeEventsResponse;
7767                        type ResponseStream = BoxStream<super::SubscribeEventsResponse>;
7768                        type Future = BoxFuture<
7769                            tonic::Response<Self::ResponseStream>,
7770                            tonic::Status,
7771                        >;
7772                        fn call(
7773                            &mut self,
7774                            request: tonic::Request<super::SubscribeEventsRequest>,
7775                        ) -> Self::Future {
7776                            let inner = Arc::clone(&self.0);
7777                            let fut = async move {
7778                                <T as SubscriptionService>::subscribe_events(
7779                                        &inner,
7780                                        request,
7781                                    )
7782                                    .await
7783                            };
7784                            Box::pin(fut)
7785                        }
7786                    }
7787                    let accept_compression_encodings = self.accept_compression_encodings;
7788                    let send_compression_encodings = self.send_compression_encodings;
7789                    let max_decoding_message_size = self.max_decoding_message_size;
7790                    let max_encoding_message_size = self.max_encoding_message_size;
7791                    let inner = self.inner.clone();
7792                    let fut = async move {
7793                        let method = SubscribeEventsSvc(inner);
7794                        let codec = tonic_prost::ProstCodec::default();
7795                        let mut grpc = tonic::server::Grpc::new(codec)
7796                            .apply_compression_config(
7797                                accept_compression_encodings,
7798                                send_compression_encodings,
7799                            )
7800                            .apply_max_message_size_config(
7801                                max_decoding_message_size,
7802                                max_encoding_message_size,
7803                            );
7804                        let res = grpc.server_streaming(method, req).await;
7805                        Ok(res)
7806                    };
7807                    Box::pin(fut)
7808                }
7809                _ => {
7810                    Box::pin(async move {
7811                        let mut response = http::Response::new(
7812                            tonic::body::Body::default(),
7813                        );
7814                        let headers = response.headers_mut();
7815                        headers
7816                            .insert(
7817                                tonic::Status::GRPC_STATUS,
7818                                (tonic::Code::Unimplemented as i32).into(),
7819                            );
7820                        headers
7821                            .insert(
7822                                http::header::CONTENT_TYPE,
7823                                tonic::metadata::GRPC_CONTENT_TYPE,
7824                            );
7825                        Ok(response)
7826                    })
7827                }
7828            }
7829        }
7830    }
7831    impl<T> Clone for SubscriptionServiceServer<T> {
7832        fn clone(&self) -> Self {
7833            let inner = self.inner.clone();
7834            Self {
7835                inner,
7836                accept_compression_encodings: self.accept_compression_encodings,
7837                send_compression_encodings: self.send_compression_encodings,
7838                max_decoding_message_size: self.max_decoding_message_size,
7839                max_encoding_message_size: self.max_encoding_message_size,
7840            }
7841        }
7842    }
7843    /// Generated gRPC service name
7844    pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
7845    impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
7846        const NAME: &'static str = SERVICE_NAME;
7847    }
7848}
7849#[non_exhaustive]
7850#[derive(Clone, PartialEq, ::prost::Message)]
7851pub struct SystemState {
7852    /// The version of the system state data structure type.
7853    #[prost(uint64, optional, tag = "1")]
7854    pub version: ::core::option::Option<u64>,
7855    /// The epoch id
7856    #[prost(uint64, optional, tag = "2")]
7857    pub epoch: ::core::option::Option<u64>,
7858    /// The protocol version
7859    #[prost(uint64, optional, tag = "3")]
7860    pub protocol_version: ::core::option::Option<u64>,
7861    /// Information about the validators
7862    #[prost(message, optional, tag = "4")]
7863    pub validators: ::core::option::Option<ValidatorSet>,
7864    /// Storage Fund info
7865    #[prost(message, optional, tag = "5")]
7866    pub storage_fund: ::core::option::Option<StorageFund>,
7867    /// Set of system config parameters
7868    #[prost(message, optional, tag = "6")]
7869    pub parameters: ::core::option::Option<SystemParameters>,
7870    /// The reference gas price for this epoch
7871    #[prost(uint64, optional, tag = "7")]
7872    pub reference_gas_price: ::core::option::Option<u64>,
7873    /// A list of the records of validator reporting each other.
7874    ///
7875    /// There is an entry in this list for each validator that has been reported
7876    /// at least once. Each record contains all the validators that reported
7877    /// them. If a validator has never been reported they don't have a record in this list.
7878    /// This lists persists across epoch: a peer continues being in a reported state until the
7879    /// reporter doesn't explicitly remove their report.
7880    #[prost(message, repeated, tag = "8")]
7881    pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
7882    /// Schedule of stake subsidies given out each epoch.
7883    #[prost(message, optional, tag = "9")]
7884    pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
7885    /// Whether the system is running in a downgraded safe mode due to a non-recoverable bug.
7886    /// This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode.
7887    /// It can be reset once we are able to successfully execute advance_epoch.
7888    /// The rest of the fields starting with `safe_mode_` are accumulated during safe mode
7889    /// when advance_epoch_safe_mode is executed. They will eventually be processed once we
7890    /// are out of safe mode.
7891    #[prost(bool, optional, tag = "10")]
7892    pub safe_mode: ::core::option::Option<bool>,
7893    /// Storage rewards accumulated during safe_mode
7894    #[prost(uint64, optional, tag = "11")]
7895    pub safe_mode_storage_rewards: ::core::option::Option<u64>,
7896    /// Computation rewards accumulated during safe_mode
7897    #[prost(uint64, optional, tag = "12")]
7898    pub safe_mode_computation_rewards: ::core::option::Option<u64>,
7899    /// Storage rebates paid out during safe_mode
7900    #[prost(uint64, optional, tag = "13")]
7901    pub safe_mode_storage_rebates: ::core::option::Option<u64>,
7902    /// Nonrefundable storage fees accumulated during safe_mode
7903    #[prost(uint64, optional, tag = "14")]
7904    pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
7905    /// Unix timestamp of when this this epoch started
7906    #[prost(uint64, optional, tag = "15")]
7907    pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
7908    /// Any extra fields that's not defined statically.
7909    #[prost(message, optional, tag = "16")]
7910    pub extra_fields: ::core::option::Option<MoveTable>,
7911}
7912#[non_exhaustive]
7913#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7914pub struct ValidatorReportRecord {
7915    /// The address of the validator being reported
7916    #[prost(string, optional, tag = "1")]
7917    pub reported: ::core::option::Option<::prost::alloc::string::String>,
7918    /// The list of validator (addresses) that are reporting on the validator specified by `reported`
7919    #[prost(string, repeated, tag = "2")]
7920    pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7921}
7922#[non_exhaustive]
7923#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7924pub struct SystemParameters {
7925    /// The duration of an epoch, in milliseconds.
7926    #[prost(uint64, optional, tag = "1")]
7927    pub epoch_duration_ms: ::core::option::Option<u64>,
7928    /// The starting epoch in which stake subsidies start being paid out
7929    #[prost(uint64, optional, tag = "2")]
7930    pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
7931    /// Minimum number of active validators at any moment.
7932    #[prost(uint64, optional, tag = "3")]
7933    pub min_validator_count: ::core::option::Option<u64>,
7934    /// Maximum number of active validators at any moment.
7935    /// We do not allow the number of validators in any epoch to go above this.
7936    #[prost(uint64, optional, tag = "4")]
7937    pub max_validator_count: ::core::option::Option<u64>,
7938    /// Deprecated.
7939    /// Lower-bound on the amount of stake required to become a validator.
7940    #[prost(uint64, optional, tag = "5")]
7941    pub min_validator_joining_stake: ::core::option::Option<u64>,
7942    /// Deprecated.
7943    /// Validators with stake amount below `validator_low_stake_threshold` are considered to
7944    /// have low stake and will be escorted out of the validator set after being below this
7945    /// threshold for more than `validator_low_stake_grace_period` number of epochs.
7946    #[prost(uint64, optional, tag = "6")]
7947    pub validator_low_stake_threshold: ::core::option::Option<u64>,
7948    /// Deprecated.
7949    /// Validators with stake below `validator_very_low_stake_threshold` will be removed
7950    /// immediately at epoch change, no grace period.
7951    #[prost(uint64, optional, tag = "7")]
7952    pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
7953    /// A validator can have stake below `validator_low_stake_threshold`
7954    /// for this many epochs before being kicked out.
7955    #[prost(uint64, optional, tag = "8")]
7956    pub validator_low_stake_grace_period: ::core::option::Option<u64>,
7957    /// Any extra fields that are not defined statically.
7958    #[prost(message, optional, tag = "9")]
7959    pub extra_fields: ::core::option::Option<MoveTable>,
7960}
7961/// A message that represents a Move `0x2::table::Table` or `0x2::bag::Bag`
7962#[non_exhaustive]
7963#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7964pub struct MoveTable {
7965    /// The UID of the table or bag
7966    #[prost(string, optional, tag = "1")]
7967    pub id: ::core::option::Option<::prost::alloc::string::String>,
7968    /// The size or number of key-value pairs in the table or bag
7969    #[prost(uint64, optional, tag = "2")]
7970    pub size: ::core::option::Option<u64>,
7971}
7972#[non_exhaustive]
7973#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7974pub struct StakeSubsidy {
7975    /// Balance of SUI set aside for stake subsidies that will be drawn down over time.
7976    #[prost(uint64, optional, tag = "1")]
7977    pub balance: ::core::option::Option<u64>,
7978    /// Count of the number of times stake subsidies have been distributed.
7979    #[prost(uint64, optional, tag = "2")]
7980    pub distribution_counter: ::core::option::Option<u64>,
7981    /// The amount of stake subsidy to be drawn down per distribution.
7982    /// This amount decays and decreases over time.
7983    #[prost(uint64, optional, tag = "3")]
7984    pub current_distribution_amount: ::core::option::Option<u64>,
7985    /// Number of distributions to occur before the distribution amount decays.
7986    #[prost(uint64, optional, tag = "4")]
7987    pub stake_subsidy_period_length: ::core::option::Option<u64>,
7988    /// The rate at which the distribution amount decays at the end of each
7989    /// period. Expressed in basis points.
7990    #[prost(uint32, optional, tag = "5")]
7991    pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
7992    /// Any extra fields that's not defined statically.
7993    #[prost(message, optional, tag = "6")]
7994    pub extra_fields: ::core::option::Option<MoveTable>,
7995}
7996/// Struct representing the onchain storage fund.
7997#[non_exhaustive]
7998#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7999pub struct StorageFund {
8000    /// This is the sum of `storage_rebate` of
8001    /// all objects currently stored on-chain. To maintain this invariant, the only inflow of this
8002    /// balance is storage charges collected from transactions, and the only outflow is storage rebates
8003    /// of transactions, including both the portion refunded to the transaction senders as well as
8004    /// the non-refundable portion taken out and put into `non_refundable_balance`.
8005    #[prost(uint64, optional, tag = "1")]
8006    pub total_object_storage_rebates: ::core::option::Option<u64>,
8007    /// Represents any remaining inflow of the storage fund that should not
8008    /// be taken out of the fund.
8009    #[prost(uint64, optional, tag = "2")]
8010    pub non_refundable_balance: ::core::option::Option<u64>,
8011}
8012#[non_exhaustive]
8013#[derive(Clone, PartialEq, ::prost::Message)]
8014pub struct ValidatorSet {
8015    /// Total amount of stake from all active validators at the beginning of the epoch.
8016    /// Written only once per epoch, in `advance_epoch` function.
8017    #[prost(uint64, optional, tag = "1")]
8018    pub total_stake: ::core::option::Option<u64>,
8019    /// The current list of active validators.
8020    #[prost(message, repeated, tag = "2")]
8021    pub active_validators: ::prost::alloc::vec::Vec<Validator>,
8022    /// List of new validator candidates added during the current epoch.
8023    /// They will be processed at the end of the epoch.
8024    ///
8025    /// key: u64 (index), value: 0x3::validator::Validator
8026    #[prost(message, optional, tag = "3")]
8027    pub pending_active_validators: ::core::option::Option<MoveTable>,
8028    /// Removal requests from the validators. Each element is an index
8029    /// pointing to `active_validators`.
8030    #[prost(uint64, repeated, tag = "4")]
8031    pub pending_removals: ::prost::alloc::vec::Vec<u64>,
8032    /// Mappings from staking pool's ID to the sui address of a validator.
8033    ///
8034    /// key: address (staking pool Id), value: address (sui address of the validator)
8035    #[prost(message, optional, tag = "5")]
8036    pub staking_pool_mappings: ::core::option::Option<MoveTable>,
8037    /// Mapping from a staking pool ID to the inactive validator that has that pool as its staking pool.
8038    /// When a validator is deactivated the validator is removed from `active_validators` it
8039    /// is added to this table so that stakers can continue to withdraw their stake from it.
8040    ///
8041    /// key: address (staking pool Id), value: 0x3::validator_wrapper::ValidatorWrapper
8042    #[prost(message, optional, tag = "6")]
8043    pub inactive_validators: ::core::option::Option<MoveTable>,
8044    /// Table storing preactive/candidate validators, mapping their addresses to their `Validator ` structs.
8045    /// When an address calls `request_add_validator_candidate`, they get added to this table and become a preactive
8046    /// validator.
8047    /// When the candidate has met the min stake requirement, they can call `request_add_validator` to
8048    /// officially add them to the active validator set `active_validators` next epoch.
8049    ///
8050    /// key: address (sui address of the validator), value: 0x3::validator_wrapper::ValidatorWrapper
8051    #[prost(message, optional, tag = "7")]
8052    pub validator_candidates: ::core::option::Option<MoveTable>,
8053    /// Table storing the number of epochs during which a validator's stake has been below the low stake threshold.
8054    #[prost(btree_map = "string, uint64", tag = "8")]
8055    pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
8056        ::prost::alloc::string::String,
8057        u64,
8058    >,
8059    /// Any extra fields that's not defined statically.
8060    #[prost(message, optional, tag = "9")]
8061    pub extra_fields: ::core::option::Option<MoveTable>,
8062}
8063/// Definition of a Validator in the system contracts
8064///
8065/// Note: fields of ValidatorMetadata are flattened into this type
8066#[non_exhaustive]
8067#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8068pub struct Validator {
8069    /// A unique human-readable name of this validator.
8070    #[prost(string, optional, tag = "1")]
8071    pub name: ::core::option::Option<::prost::alloc::string::String>,
8072    /// The Sui Address of the validator. This is the sender that created the Validator object,
8073    /// and also the address to send validator/coins to during withdraws.
8074    #[prost(string, optional, tag = "2")]
8075    pub address: ::core::option::Option<::prost::alloc::string::String>,
8076    #[prost(string, optional, tag = "3")]
8077    pub description: ::core::option::Option<::prost::alloc::string::String>,
8078    #[prost(string, optional, tag = "4")]
8079    pub image_url: ::core::option::Option<::prost::alloc::string::String>,
8080    #[prost(string, optional, tag = "5")]
8081    pub project_url: ::core::option::Option<::prost::alloc::string::String>,
8082    /// The public key bytes corresponding to the private key that the validator
8083    /// holds to sign transactions. For now, this is the same as AuthorityName.
8084    #[prost(bytes = "bytes", optional, tag = "7")]
8085    pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8086    /// This is a proof that the validator has ownership of the protocol private key
8087    #[prost(bytes = "bytes", optional, tag = "8")]
8088    pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8089    /// The public key bytes corresponding to the private key that the validator
8090    /// uses to establish TLS connections
8091    #[prost(bytes = "bytes", optional, tag = "10")]
8092    pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8093    /// The public key bytes corresponding to the Narwhal Worker
8094    #[prost(bytes = "bytes", optional, tag = "12")]
8095    pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8096    /// The network address of the validator (could also contain extra info such as port, DNS and etc.).
8097    #[prost(string, optional, tag = "13")]
8098    pub network_address: ::core::option::Option<::prost::alloc::string::String>,
8099    /// The address of the validator used for p2p activities such as state sync (could also contain extra info such as port, DNS and etc.).
8100    #[prost(string, optional, tag = "14")]
8101    pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8102    /// The address of the narwhal primary
8103    #[prost(string, optional, tag = "15")]
8104    pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
8105    /// The address of the narwhal worker
8106    #[prost(string, optional, tag = "16")]
8107    pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
8108    #[prost(bytes = "bytes", optional, tag = "18")]
8109    pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8110    #[prost(bytes = "bytes", optional, tag = "19")]
8111    pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8112    #[prost(bytes = "bytes", optional, tag = "21")]
8113    pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8114    #[prost(bytes = "bytes", optional, tag = "23")]
8115    pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8116    #[prost(string, optional, tag = "24")]
8117    pub next_epoch_network_address: ::core::option::Option<
8118        ::prost::alloc::string::String,
8119    >,
8120    #[prost(string, optional, tag = "25")]
8121    pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8122    #[prost(string, optional, tag = "26")]
8123    pub next_epoch_primary_address: ::core::option::Option<
8124        ::prost::alloc::string::String,
8125    >,
8126    #[prost(string, optional, tag = "27")]
8127    pub next_epoch_worker_address: ::core::option::Option<
8128        ::prost::alloc::string::String,
8129    >,
8130    /// Any extra fields that's not defined statically in the `ValidatorMetadata` struct
8131    #[prost(message, optional, tag = "28")]
8132    pub metadata_extra_fields: ::core::option::Option<MoveTable>,
8133    /// The voting power of this validator, which might be different from its
8134    /// stake amount.
8135    #[prost(uint64, optional, tag = "29")]
8136    pub voting_power: ::core::option::Option<u64>,
8137    /// The ID of this validator's current valid `UnverifiedValidatorOperationCap`
8138    #[prost(string, optional, tag = "30")]
8139    pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
8140    /// Gas price quote, updated only at end of epoch.
8141    #[prost(uint64, optional, tag = "31")]
8142    pub gas_price: ::core::option::Option<u64>,
8143    /// Staking pool for this validator.
8144    #[prost(message, optional, tag = "32")]
8145    pub staking_pool: ::core::option::Option<StakingPool>,
8146    /// Commission rate of the validator, in basis point.
8147    #[prost(uint64, optional, tag = "33")]
8148    pub commission_rate: ::core::option::Option<u64>,
8149    /// Total amount of stake that would be active in the next epoch.
8150    #[prost(uint64, optional, tag = "34")]
8151    pub next_epoch_stake: ::core::option::Option<u64>,
8152    /// This validator's gas price quote for the next epoch.
8153    #[prost(uint64, optional, tag = "35")]
8154    pub next_epoch_gas_price: ::core::option::Option<u64>,
8155    /// The commission rate of the validator starting the next epoch, in basis point.
8156    #[prost(uint64, optional, tag = "36")]
8157    pub next_epoch_commission_rate: ::core::option::Option<u64>,
8158    /// Any extra fields that's not defined statically.
8159    #[prost(message, optional, tag = "37")]
8160    pub extra_fields: ::core::option::Option<MoveTable>,
8161}
8162/// A staking pool embedded in each validator struct in the system state object.
8163#[non_exhaustive]
8164#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8165pub struct StakingPool {
8166    /// UID of the StakingPool object
8167    #[prost(string, optional, tag = "1")]
8168    pub id: ::core::option::Option<::prost::alloc::string::String>,
8169    /// The epoch at which this pool became active.
8170    /// The value is `None` if the pool is pre-active and `Some(<epoch_number>)` if active or inactive.
8171    #[prost(uint64, optional, tag = "2")]
8172    pub activation_epoch: ::core::option::Option<u64>,
8173    /// The epoch at which this staking pool ceased to be active. `None` = {pre-active, active},
8174    /// `Some(<epoch_number>)` if in-active, and it was de-activated at epoch `<epoch_number>`.
8175    #[prost(uint64, optional, tag = "3")]
8176    pub deactivation_epoch: ::core::option::Option<u64>,
8177    /// The total number of SUI tokens in this pool, including the SUI in the rewards_pool, as well as in all the principal
8178    /// in the `StakedSui` object, updated at epoch boundaries.
8179    #[prost(uint64, optional, tag = "4")]
8180    pub sui_balance: ::core::option::Option<u64>,
8181    /// The epoch stake rewards will be added here at the end of each epoch.
8182    #[prost(uint64, optional, tag = "5")]
8183    pub rewards_pool: ::core::option::Option<u64>,
8184    /// Total number of pool tokens issued by the pool.
8185    #[prost(uint64, optional, tag = "6")]
8186    pub pool_token_balance: ::core::option::Option<u64>,
8187    /// Exchange rate history of previous epochs.
8188    ///
8189    /// The entries start from the `activation_epoch` of this pool and contains exchange rates at the beginning of each epoch,
8190    /// i.e., right after the rewards for the previous epoch have been deposited into the pool.
8191    ///
8192    /// key: u64 (epoch number), value: PoolTokenExchangeRate
8193    #[prost(message, optional, tag = "7")]
8194    pub exchange_rates: ::core::option::Option<MoveTable>,
8195    /// Pending stake amount for this epoch, emptied at epoch boundaries.
8196    #[prost(uint64, optional, tag = "8")]
8197    pub pending_stake: ::core::option::Option<u64>,
8198    /// Pending stake withdrawn during the current epoch, emptied at epoch boundaries.
8199    /// This includes both the principal and rewards SUI withdrawn.
8200    #[prost(uint64, optional, tag = "9")]
8201    pub pending_total_sui_withdraw: ::core::option::Option<u64>,
8202    /// Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.
8203    #[prost(uint64, optional, tag = "10")]
8204    pub pending_pool_token_withdraw: ::core::option::Option<u64>,
8205    /// Any extra fields that's not defined statically.
8206    #[prost(message, optional, tag = "11")]
8207    pub extra_fields: ::core::option::Option<MoveTable>,
8208}
8209/// A transaction.
8210#[non_exhaustive]
8211#[derive(Clone, PartialEq, ::prost::Message)]
8212pub struct Transaction {
8213    /// This Transaction serialized as BCS.
8214    #[prost(message, optional, tag = "1")]
8215    pub bcs: ::core::option::Option<Bcs>,
8216    /// The digest of this Transaction.
8217    #[prost(string, optional, tag = "2")]
8218    pub digest: ::core::option::Option<::prost::alloc::string::String>,
8219    /// Version of this Transaction.
8220    #[prost(int32, optional, tag = "3")]
8221    pub version: ::core::option::Option<i32>,
8222    #[prost(message, optional, tag = "4")]
8223    pub kind: ::core::option::Option<TransactionKind>,
8224    #[prost(string, optional, tag = "5")]
8225    pub sender: ::core::option::Option<::prost::alloc::string::String>,
8226    #[prost(message, optional, tag = "6")]
8227    pub gas_payment: ::core::option::Option<GasPayment>,
8228    #[prost(message, optional, tag = "7")]
8229    pub expiration: ::core::option::Option<TransactionExpiration>,
8230}
8231/// Payment information for executing a transaction.
8232#[non_exhaustive]
8233#[derive(Clone, PartialEq, ::prost::Message)]
8234pub struct GasPayment {
8235    /// Set of gas objects to use for payment.
8236    #[prost(message, repeated, tag = "1")]
8237    pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
8238    /// Owner of the gas objects, either the transaction sender or a sponsor.
8239    #[prost(string, optional, tag = "2")]
8240    pub owner: ::core::option::Option<::prost::alloc::string::String>,
8241    /// Gas unit price to use when charging for computation.
8242    ///
8243    /// Must be greater than or equal to the network's current RGP (reference gas price).
8244    #[prost(uint64, optional, tag = "3")]
8245    pub price: ::core::option::Option<u64>,
8246    /// Total budget willing to spend for the execution of a transaction.
8247    #[prost(uint64, optional, tag = "4")]
8248    pub budget: ::core::option::Option<u64>,
8249}
8250/// A TTL for a transaction.
8251#[non_exhaustive]
8252#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8253pub struct TransactionExpiration {
8254    #[prost(
8255        enumeration = "transaction_expiration::TransactionExpirationKind",
8256        optional,
8257        tag = "1"
8258    )]
8259    pub kind: ::core::option::Option<i32>,
8260    /// Maximum epoch in which a transaction can be executed. The provided maximal epoch
8261    /// must be greater than or equal to the current epoch for a transaction to execute.
8262    #[prost(uint64, optional, tag = "2")]
8263    pub epoch: ::core::option::Option<u64>,
8264    /// Minimal epoch in which a transaction can be executed. The provided minimal epoch
8265    /// must be less than or equal to the current epoch for a transaction to execute.
8266    #[prost(uint64, optional, tag = "3")]
8267    pub min_epoch: ::core::option::Option<u64>,
8268    /// Minimal UNIX timestamp in which a transaction can be executed. The
8269    /// provided minimal timestamp must be less than or equal to the current
8270    /// clock.
8271    #[prost(message, optional, tag = "4")]
8272    pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8273    /// Maximum UNIX timestamp in which a transaction can be executed. The
8274    /// provided maximal timestamp must be greater than or equal to the current
8275    /// clock.
8276    #[prost(message, optional, tag = "5")]
8277    pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8278    /// ChainId of the network this transaction is intended for in order to prevent cross-chain replay
8279    #[prost(string, optional, tag = "6")]
8280    pub chain: ::core::option::Option<::prost::alloc::string::String>,
8281    /// User-provided uniqueness identifier to differentiate otherwise identical transactions
8282    #[prost(uint32, optional, tag = "7")]
8283    pub nonce: ::core::option::Option<u32>,
8284    /// The validators allowed to propose this transaction in consensus. Only set when `kind`
8285    /// is `VALIDITY`. Leave unset to let any validator propose the transaction.
8286    #[prost(message, optional, tag = "8")]
8287    pub allowed_proposers: ::core::option::Option<AllowedProposers>,
8288}
8289/// Nested message and enum types in `TransactionExpiration`.
8290pub mod transaction_expiration {
8291    #[non_exhaustive]
8292    #[derive(
8293        Clone,
8294        Copy,
8295        Debug,
8296        PartialEq,
8297        Eq,
8298        Hash,
8299        PartialOrd,
8300        Ord,
8301        ::prost::Enumeration
8302    )]
8303    #[repr(i32)]
8304    pub enum TransactionExpirationKind {
8305        Unknown = 0,
8306        /// The transaction has no expiration.
8307        None = 1,
8308        /// Validators won't sign and execute transaction unless the expiration epoch
8309        /// is greater than or equal to the current epoch.
8310        Epoch = 2,
8311        /// This variant enables gas payments from address balances.
8312        ///
8313        /// When transactions use address balances for gas payment instead of explicit gas coins,
8314        /// we lose the natural transaction uniqueness and replay prevention that comes from
8315        /// mutation of gas coin objects.
8316        ///
8317        /// By bounding expiration and providing a nonce, validators must only retain
8318        /// executed digests for the maximum possible expiry range to differentiate
8319        /// retries from unique transactions with otherwise identical inputs.
8320        ValidDuring = 3,
8321        /// Everything in VALID_DURING, plus a restriction on which validators may
8322        /// propose the transaction in consensus.
8323        Validity = 4,
8324    }
8325    impl TransactionExpirationKind {
8326        /// String value of the enum field names used in the ProtoBuf definition.
8327        ///
8328        /// The values are not transformed in any way and thus are considered stable
8329        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8330        pub fn as_str_name(&self) -> &'static str {
8331            match self {
8332                Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
8333                Self::None => "NONE",
8334                Self::Epoch => "EPOCH",
8335                Self::ValidDuring => "VALID_DURING",
8336                Self::Validity => "VALIDITY",
8337            }
8338        }
8339        /// Creates an enum from field names used in the ProtoBuf definition.
8340        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8341            match value {
8342                "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
8343                "NONE" => Some(Self::None),
8344                "EPOCH" => Some(Self::Epoch),
8345                "VALID_DURING" => Some(Self::ValidDuring),
8346                "VALIDITY" => Some(Self::Validity),
8347                _ => None,
8348            }
8349        }
8350    }
8351}
8352/// The validators allowed to propose a transaction in consensus.
8353///
8354/// Proposal by any other validator is byzantine behavior and invalidates the whole block.
8355#[non_exhaustive]
8356#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8357pub struct AllowedProposers {
8358    /// The epoch whose committee `proposers` indexes into.
8359    ///
8360    /// Committee indices are only meaningful against one committee, so a set recorded for any
8361    /// other epoch is ignored and the transaction is treated as naming no proposers.
8362    #[prost(uint64, optional, tag = "1")]
8363    pub epoch: ::core::option::Option<u64>,
8364    /// Committee indices of the allowed proposers, strictly increasing and non-empty.
8365    ///
8366    /// An empty list names no validator and is rejected; omit `allowed_proposers` entirely to
8367    /// let any validator propose the transaction.
8368    #[prost(uint32, repeated, tag = "2")]
8369    pub proposers: ::prost::alloc::vec::Vec<u32>,
8370}
8371/// Transaction type.
8372#[non_exhaustive]
8373#[derive(Clone, PartialEq, ::prost::Message)]
8374pub struct TransactionKind {
8375    #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
8376    pub kind: ::core::option::Option<i32>,
8377    #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
8378    pub data: ::core::option::Option<transaction_kind::Data>,
8379}
8380/// Nested message and enum types in `TransactionKind`.
8381pub mod transaction_kind {
8382    #[non_exhaustive]
8383    #[derive(
8384        Clone,
8385        Copy,
8386        Debug,
8387        PartialEq,
8388        Eq,
8389        Hash,
8390        PartialOrd,
8391        Ord,
8392        ::prost::Enumeration
8393    )]
8394    #[repr(i32)]
8395    pub enum Kind {
8396        Unknown = 0,
8397        /// A user transaction comprised of a list of native commands and Move calls.
8398        ProgrammableTransaction = 1,
8399        /// System transaction used to end an epoch.
8400        ///
8401        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
8402        /// `EndOfEpochTransaction`).
8403        ChangeEpoch = 2,
8404        /// Transaction used to initialize the chain state.
8405        ///
8406        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
8407        /// executed on the chain.
8408        Genesis = 3,
8409        /// V1 consensus commit update.
8410        ConsensusCommitPrologueV1 = 4,
8411        /// Update set of valid JWKs used for zklogin.
8412        AuthenticatorStateUpdate = 5,
8413        /// Set of operations to run at the end of the epoch to close out the current epoch and start
8414        /// the next one.
8415        EndOfEpoch = 6,
8416        /// Randomness update.
8417        RandomnessStateUpdate = 7,
8418        /// V2 consensus commit update.
8419        ConsensusCommitPrologueV2 = 8,
8420        /// V3 consensus commit update.
8421        ConsensusCommitPrologueV3 = 9,
8422        /// V4 consensus commit update.
8423        ConsensusCommitPrologueV4 = 10,
8424        /// A system transaction comprised of a list of native commands and Move calls.
8425        ProgrammableSystemTransaction = 11,
8426    }
8427    impl Kind {
8428        /// String value of the enum field names used in the ProtoBuf definition.
8429        ///
8430        /// The values are not transformed in any way and thus are considered stable
8431        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8432        pub fn as_str_name(&self) -> &'static str {
8433            match self {
8434                Self::Unknown => "KIND_UNKNOWN",
8435                Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
8436                Self::ChangeEpoch => "CHANGE_EPOCH",
8437                Self::Genesis => "GENESIS",
8438                Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
8439                Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
8440                Self::EndOfEpoch => "END_OF_EPOCH",
8441                Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
8442                Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
8443                Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
8444                Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
8445                Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
8446            }
8447        }
8448        /// Creates an enum from field names used in the ProtoBuf definition.
8449        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8450            match value {
8451                "KIND_UNKNOWN" => Some(Self::Unknown),
8452                "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
8453                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8454                "GENESIS" => Some(Self::Genesis),
8455                "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
8456                "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
8457                "END_OF_EPOCH" => Some(Self::EndOfEpoch),
8458                "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
8459                "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
8460                "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
8461                "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
8462                "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
8463                    Some(Self::ProgrammableSystemTransaction)
8464                }
8465                _ => None,
8466            }
8467        }
8468    }
8469    #[non_exhaustive]
8470    #[derive(Clone, PartialEq, ::prost::Oneof)]
8471    pub enum Data {
8472        /// A transaction comprised of a list of native commands and Move calls.
8473        #[prost(message, tag = "2")]
8474        ProgrammableTransaction(super::ProgrammableTransaction),
8475        /// System transaction used to end an epoch.
8476        ///
8477        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
8478        /// `EndOfEpochTransaction`).
8479        #[prost(message, tag = "3")]
8480        ChangeEpoch(super::ChangeEpoch),
8481        /// Transaction used to initialize the chain state.
8482        ///
8483        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
8484        /// executed on the chain.
8485        #[prost(message, tag = "4")]
8486        Genesis(super::GenesisTransaction),
8487        /// consensus commit update info
8488        #[prost(message, tag = "5")]
8489        ConsensusCommitPrologue(super::ConsensusCommitPrologue),
8490        /// Update set of valid JWKs used for zklogin.
8491        #[prost(message, tag = "6")]
8492        AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
8493        /// Set of operations to run at the end of the epoch to close out the current epoch and start
8494        /// the next one.
8495        #[prost(message, tag = "7")]
8496        EndOfEpoch(super::EndOfEpochTransaction),
8497        /// Randomness update.
8498        #[prost(message, tag = "8")]
8499        RandomnessStateUpdate(super::RandomnessStateUpdate),
8500    }
8501}
8502/// A user transaction.
8503///
8504/// Contains a series of native commands and Move calls where the results of one command can be
8505/// used in future commands.
8506#[non_exhaustive]
8507#[derive(Clone, PartialEq, ::prost::Message)]
8508pub struct ProgrammableTransaction {
8509    /// Input objects or primitive values.
8510    #[prost(message, repeated, tag = "1")]
8511    pub inputs: ::prost::alloc::vec::Vec<Input>,
8512    /// The commands to be executed sequentially. A failure in any command
8513    /// results in the failure of the entire transaction.
8514    #[prost(message, repeated, tag = "2")]
8515    pub commands: ::prost::alloc::vec::Vec<Command>,
8516}
8517/// A single command in a programmable transaction.
8518#[non_exhaustive]
8519#[derive(Clone, PartialEq, ::prost::Message)]
8520pub struct Command {
8521    #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
8522    pub command: ::core::option::Option<command::Command>,
8523}
8524/// Nested message and enum types in `Command`.
8525pub mod command {
8526    #[non_exhaustive]
8527    #[derive(Clone, PartialEq, ::prost::Oneof)]
8528    pub enum Command {
8529        /// A call to either an entry or a public Move function.
8530        #[prost(message, tag = "1")]
8531        MoveCall(super::MoveCall),
8532        /// `(Vec<forall T:key+store. T>, address)`
8533        /// It sends n-objects to the specified address. These objects must have store
8534        /// (public transfer) and either the previous owner must be an address or the object must
8535        /// be newly created.
8536        #[prost(message, tag = "2")]
8537        TransferObjects(super::TransferObjects),
8538        /// `(&mut Coin<T>, Vec<u64>)` -> `Vec<Coin<T>>`
8539        /// It splits off some amounts into new coins with those amounts.
8540        #[prost(message, tag = "3")]
8541        SplitCoins(super::SplitCoins),
8542        /// `(&mut Coin<T>, Vec<Coin<T>>)`
8543        /// It merges n-coins into the first coin.
8544        #[prost(message, tag = "4")]
8545        MergeCoins(super::MergeCoins),
8546        /// Publishes a Move package. It takes the package bytes and a list of the package's transitive
8547        /// dependencies to link against on chain.
8548        #[prost(message, tag = "5")]
8549        Publish(super::Publish),
8550        /// `forall T: Vec<T> -> vector<T>`
8551        /// Given n-values of the same type, it constructs a vector. For non-objects or an empty vector,
8552        /// the type tag must be specified.
8553        #[prost(message, tag = "6")]
8554        MakeMoveVector(super::MakeMoveVector),
8555        /// Upgrades a Move package.
8556        /// Takes (in order):
8557        ///
8558        /// 1. A vector of serialized modules for the package.
8559        /// 1. A vector of object ids for the transitive dependencies of the new package.
8560        /// 1. The object ID of the package being upgraded.
8561        /// 1. An argument holding the `UpgradeTicket` that must have been produced from an earlier command in the same
8562        ///    programmable transaction.
8563        #[prost(message, tag = "7")]
8564        Upgrade(super::Upgrade),
8565    }
8566}
8567/// Command to call a Move function.
8568///
8569/// Functions that can be called by a `MoveCall` command are those that have a function signature
8570/// that is either `entry` or `public` (which don't have a reference return type).
8571#[non_exhaustive]
8572#[derive(Clone, PartialEq, ::prost::Message)]
8573pub struct MoveCall {
8574    /// The package containing the module and function.
8575    #[prost(string, optional, tag = "1")]
8576    pub package: ::core::option::Option<::prost::alloc::string::String>,
8577    /// The specific module in the package containing the function.
8578    #[prost(string, optional, tag = "2")]
8579    pub module: ::core::option::Option<::prost::alloc::string::String>,
8580    /// The function to be called.
8581    #[prost(string, optional, tag = "3")]
8582    pub function: ::core::option::Option<::prost::alloc::string::String>,
8583    /// The type arguments to the function.
8584    #[prost(string, repeated, tag = "4")]
8585    pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8586    /// The arguments to the function.
8587    #[prost(message, repeated, tag = "5")]
8588    pub arguments: ::prost::alloc::vec::Vec<Argument>,
8589}
8590/// Command to transfer ownership of a set of objects to an address.
8591#[non_exhaustive]
8592#[derive(Clone, PartialEq, ::prost::Message)]
8593pub struct TransferObjects {
8594    /// Set of objects to transfer.
8595    #[prost(message, repeated, tag = "1")]
8596    pub objects: ::prost::alloc::vec::Vec<Argument>,
8597    /// The address to transfer ownership to.
8598    #[prost(message, optional, tag = "2")]
8599    pub address: ::core::option::Option<Argument>,
8600}
8601/// Command to split a single coin object into multiple coins.
8602#[non_exhaustive]
8603#[derive(Clone, PartialEq, ::prost::Message)]
8604pub struct SplitCoins {
8605    /// The coin to split.
8606    #[prost(message, optional, tag = "1")]
8607    pub coin: ::core::option::Option<Argument>,
8608    /// The amounts to split off.
8609    #[prost(message, repeated, tag = "2")]
8610    pub amounts: ::prost::alloc::vec::Vec<Argument>,
8611}
8612/// Command to merge multiple coins of the same type into a single coin.
8613#[non_exhaustive]
8614#[derive(Clone, PartialEq, ::prost::Message)]
8615pub struct MergeCoins {
8616    /// Coin to merge coins into.
8617    #[prost(message, optional, tag = "1")]
8618    pub coin: ::core::option::Option<Argument>,
8619    /// Set of coins to merge into `coin`.
8620    ///
8621    /// All listed coins must be of the same type and be the same type as `coin`
8622    #[prost(message, repeated, tag = "2")]
8623    pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
8624}
8625/// Command to publish a new Move package.
8626#[non_exhaustive]
8627#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8628pub struct Publish {
8629    /// The serialized Move modules.
8630    #[prost(bytes = "bytes", repeated, tag = "1")]
8631    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8632    /// Set of packages that the to-be published package depends on.
8633    #[prost(string, repeated, tag = "2")]
8634    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8635}
8636/// Command to build a Move vector out of a set of individual elements.
8637#[non_exhaustive]
8638#[derive(Clone, PartialEq, ::prost::Message)]
8639pub struct MakeMoveVector {
8640    /// Type of the individual elements.
8641    ///
8642    /// This is required to be set when the type can't be inferred, for example when the set of
8643    /// provided arguments are all pure input values.
8644    #[prost(string, optional, tag = "1")]
8645    pub element_type: ::core::option::Option<::prost::alloc::string::String>,
8646    /// The set individual elements to build the vector with.
8647    #[prost(message, repeated, tag = "2")]
8648    pub elements: ::prost::alloc::vec::Vec<Argument>,
8649}
8650/// Command to upgrade an already published package.
8651#[non_exhaustive]
8652#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8653pub struct Upgrade {
8654    /// The serialized Move modules.
8655    #[prost(bytes = "bytes", repeated, tag = "1")]
8656    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8657    /// Set of packages that the to-be published package depends on.
8658    #[prost(string, repeated, tag = "2")]
8659    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8660    /// Package ID of the package to upgrade.
8661    #[prost(string, optional, tag = "3")]
8662    pub package: ::core::option::Option<::prost::alloc::string::String>,
8663    /// Ticket authorizing the upgrade.
8664    #[prost(message, optional, tag = "4")]
8665    pub ticket: ::core::option::Option<Argument>,
8666}
8667/// Randomness update.
8668#[non_exhaustive]
8669#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8670pub struct RandomnessStateUpdate {
8671    /// Epoch of the randomness state update transaction.
8672    #[prost(uint64, optional, tag = "1")]
8673    pub epoch: ::core::option::Option<u64>,
8674    /// Randomness round of the update.
8675    #[prost(uint64, optional, tag = "2")]
8676    pub randomness_round: ::core::option::Option<u64>,
8677    /// Updated random bytes.
8678    #[prost(bytes = "bytes", optional, tag = "3")]
8679    pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
8680    /// The initial version of the randomness object that it was shared at.
8681    #[prost(uint64, optional, tag = "4")]
8682    pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
8683}
8684/// System transaction used to change the epoch.
8685#[non_exhaustive]
8686#[derive(Clone, PartialEq, ::prost::Message)]
8687pub struct ChangeEpoch {
8688    /// The next (to become) epoch ID.
8689    #[prost(uint64, optional, tag = "1")]
8690    pub epoch: ::core::option::Option<u64>,
8691    /// The protocol version in effect in the new epoch.
8692    #[prost(uint64, optional, tag = "2")]
8693    pub protocol_version: ::core::option::Option<u64>,
8694    /// The total amount of gas charged for storage during the epoch.
8695    #[prost(uint64, optional, tag = "3")]
8696    pub storage_charge: ::core::option::Option<u64>,
8697    /// The total amount of gas charged for computation during the epoch.
8698    #[prost(uint64, optional, tag = "4")]
8699    pub computation_charge: ::core::option::Option<u64>,
8700    /// The amount of storage rebate refunded to the txn senders.
8701    #[prost(uint64, optional, tag = "5")]
8702    pub storage_rebate: ::core::option::Option<u64>,
8703    /// The non-refundable storage fee.
8704    #[prost(uint64, optional, tag = "6")]
8705    pub non_refundable_storage_fee: ::core::option::Option<u64>,
8706    /// Unix timestamp when epoch started.
8707    #[prost(message, optional, tag = "7")]
8708    pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8709    /// System packages (specifically framework and Move stdlib) that are written before the new
8710    /// epoch starts. This tracks framework upgrades on chain. When executing the `ChangeEpoch` txn,
8711    /// the validator must write out the following modules.  Modules are provided with the version they
8712    /// will be upgraded to, their modules in serialized form (which include their package ID), and
8713    /// a list of their transitive dependencies.
8714    #[prost(message, repeated, tag = "8")]
8715    pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
8716}
8717/// System package.
8718#[non_exhaustive]
8719#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8720pub struct SystemPackage {
8721    /// Version of the package.
8722    #[prost(uint64, optional, tag = "1")]
8723    pub version: ::core::option::Option<u64>,
8724    /// Move modules.
8725    #[prost(bytes = "bytes", repeated, tag = "2")]
8726    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8727    /// Package dependencies.
8728    #[prost(string, repeated, tag = "3")]
8729    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8730}
8731/// The genesis transaction.
8732#[non_exhaustive]
8733#[derive(Clone, PartialEq, ::prost::Message)]
8734pub struct GenesisTransaction {
8735    /// Set of genesis objects.
8736    #[prost(message, repeated, tag = "1")]
8737    pub objects: ::prost::alloc::vec::Vec<Object>,
8738}
8739/// Consensus commit prologue system transaction.
8740///
8741/// This message can represent V1, V2, and V3 prologue types.
8742#[non_exhaustive]
8743#[derive(Clone, PartialEq, ::prost::Message)]
8744pub struct ConsensusCommitPrologue {
8745    /// Epoch of the commit prologue transaction.
8746    ///
8747    /// Present in V1, V2, V3, V4.
8748    #[prost(uint64, optional, tag = "1")]
8749    pub epoch: ::core::option::Option<u64>,
8750    /// Consensus round of the commit.
8751    ///
8752    /// Present in V1, V2, V3, V4.
8753    #[prost(uint64, optional, tag = "2")]
8754    pub round: ::core::option::Option<u64>,
8755    /// Unix timestamp from consensus.
8756    ///
8757    /// Present in V1, V2, V3, V4.
8758    #[prost(message, optional, tag = "3")]
8759    pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8760    /// Digest of consensus output.
8761    ///
8762    /// Present in V2, V3, V4.
8763    #[prost(string, optional, tag = "4")]
8764    pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
8765    /// The sub DAG index of the consensus commit. This field is populated if there
8766    /// are multiple consensus commits per round.
8767    ///
8768    /// Present in V3, V4.
8769    #[prost(uint64, optional, tag = "5")]
8770    pub sub_dag_index: ::core::option::Option<u64>,
8771    /// Stores consensus handler determined consensus object version assignments.
8772    ///
8773    /// Present in V3, V4.
8774    #[prost(message, optional, tag = "6")]
8775    pub consensus_determined_version_assignments: ::core::option::Option<
8776        ConsensusDeterminedVersionAssignments,
8777    >,
8778    /// Digest of any additional state computed by the consensus handler.
8779    /// Used to detect forking bugs as early as possible.
8780    ///
8781    /// Present in V4.
8782    #[prost(string, optional, tag = "7")]
8783    pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
8784}
8785/// Object version assignment from consensus.
8786#[non_exhaustive]
8787#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8788pub struct VersionAssignment {
8789    /// `ObjectId` of the object.
8790    #[prost(string, optional, tag = "1")]
8791    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
8792    /// start version of the consensus stream for this object
8793    #[prost(uint64, optional, tag = "2")]
8794    pub start_version: ::core::option::Option<u64>,
8795    /// Assigned version.
8796    #[prost(uint64, optional, tag = "3")]
8797    pub version: ::core::option::Option<u64>,
8798}
8799/// A transaction that was canceled.
8800#[non_exhaustive]
8801#[derive(Clone, PartialEq, ::prost::Message)]
8802pub struct CanceledTransaction {
8803    /// Digest of the canceled transaction.
8804    #[prost(string, optional, tag = "1")]
8805    pub digest: ::core::option::Option<::prost::alloc::string::String>,
8806    /// List of object version assignments.
8807    #[prost(message, repeated, tag = "2")]
8808    pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
8809}
8810/// Version assignments performed by consensus.
8811#[non_exhaustive]
8812#[derive(Clone, PartialEq, ::prost::Message)]
8813pub struct ConsensusDeterminedVersionAssignments {
8814    /// Version of this message
8815    #[prost(int32, optional, tag = "1")]
8816    pub version: ::core::option::Option<i32>,
8817    /// Canceled transaction version assignment.
8818    #[prost(message, repeated, tag = "3")]
8819    pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
8820}
8821/// Update the set of valid JWKs.
8822#[non_exhaustive]
8823#[derive(Clone, PartialEq, ::prost::Message)]
8824pub struct AuthenticatorStateUpdate {
8825    /// Epoch of the authenticator state update transaction.
8826    #[prost(uint64, optional, tag = "1")]
8827    pub epoch: ::core::option::Option<u64>,
8828    /// Consensus round of the authenticator state update.
8829    #[prost(uint64, optional, tag = "2")]
8830    pub round: ::core::option::Option<u64>,
8831    /// Newly active JWKs.
8832    #[prost(message, repeated, tag = "3")]
8833    pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
8834    /// The initial version of the authenticator object that it was shared at.
8835    #[prost(uint64, optional, tag = "4")]
8836    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
8837}
8838/// A new JWK.
8839#[non_exhaustive]
8840#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8841pub struct ActiveJwk {
8842    /// Identifier used to uniquely identify a JWK.
8843    #[prost(message, optional, tag = "1")]
8844    pub id: ::core::option::Option<JwkId>,
8845    /// The JWK.
8846    #[prost(message, optional, tag = "2")]
8847    pub jwk: ::core::option::Option<Jwk>,
8848    /// Most recent epoch in which the JWK was validated.
8849    #[prost(uint64, optional, tag = "3")]
8850    pub epoch: ::core::option::Option<u64>,
8851}
8852/// Set of operations run at the end of the epoch to close out the current epoch
8853/// and start the next one.
8854#[non_exhaustive]
8855#[derive(Clone, PartialEq, ::prost::Message)]
8856pub struct EndOfEpochTransaction {
8857    #[prost(message, repeated, tag = "1")]
8858    pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
8859}
8860/// Operation run at the end of an epoch.
8861#[non_exhaustive]
8862#[derive(Clone, PartialEq, ::prost::Message)]
8863pub struct EndOfEpochTransactionKind {
8864    #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
8865    pub kind: ::core::option::Option<i32>,
8866    #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
8867    pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
8868}
8869/// Nested message and enum types in `EndOfEpochTransactionKind`.
8870pub mod end_of_epoch_transaction_kind {
8871    #[non_exhaustive]
8872    #[derive(
8873        Clone,
8874        Copy,
8875        Debug,
8876        PartialEq,
8877        Eq,
8878        Hash,
8879        PartialOrd,
8880        Ord,
8881        ::prost::Enumeration
8882    )]
8883    #[repr(i32)]
8884    pub enum Kind {
8885        Unknown = 0,
8886        /// End the epoch and start the next one.
8887        ChangeEpoch = 1,
8888        /// Create and initialize the authenticator object used for zklogin.
8889        AuthenticatorStateCreate = 2,
8890        /// Expire JWKs used for zklogin.
8891        AuthenticatorStateExpire = 3,
8892        /// Create and initialize the randomness object.
8893        RandomnessStateCreate = 4,
8894        /// Create and initialize the deny list object.
8895        DenyListStateCreate = 5,
8896        /// Create and initialize the bridge object.
8897        BridgeStateCreate = 6,
8898        /// Initialize the bridge committee.
8899        BridgeCommitteeInit = 7,
8900        /// Execution time observations from the committee to preserve cross epoch
8901        StoreExecutionTimeObservations = 8,
8902        /// Create the accumulator root object.
8903        AccumulatorRootCreate = 9,
8904        /// Create and initialize the Coin Registry object.
8905        CoinRegistryCreate = 10,
8906        /// Create and initialize the Display Registry object.
8907        DisplayRegistryCreate = 11,
8908        /// Create and initialize the Address Alias State object.
8909        AddressAliasStateCreate = 12,
8910        /// Write the end-of-epoch-computed storage cost for accumulator objects.
8911        WriteAccumulatorStorageCost = 13,
8912        /// Create and initialize the Forwarding Address Registry object.
8913        ForwardingAddressRegistryCreate = 14,
8914    }
8915    impl Kind {
8916        /// String value of the enum field names used in the ProtoBuf definition.
8917        ///
8918        /// The values are not transformed in any way and thus are considered stable
8919        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8920        pub fn as_str_name(&self) -> &'static str {
8921            match self {
8922                Self::Unknown => "KIND_UNKNOWN",
8923                Self::ChangeEpoch => "CHANGE_EPOCH",
8924                Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
8925                Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
8926                Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
8927                Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
8928                Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
8929                Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
8930                Self::StoreExecutionTimeObservations => {
8931                    "STORE_EXECUTION_TIME_OBSERVATIONS"
8932                }
8933                Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
8934                Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
8935                Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
8936                Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
8937                Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
8938                Self::ForwardingAddressRegistryCreate => {
8939                    "FORWARDING_ADDRESS_REGISTRY_CREATE"
8940                }
8941            }
8942        }
8943        /// Creates an enum from field names used in the ProtoBuf definition.
8944        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8945            match value {
8946                "KIND_UNKNOWN" => Some(Self::Unknown),
8947                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8948                "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
8949                "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
8950                "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
8951                "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
8952                "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
8953                "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
8954                "STORE_EXECUTION_TIME_OBSERVATIONS" => {
8955                    Some(Self::StoreExecutionTimeObservations)
8956                }
8957                "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
8958                "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
8959                "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
8960                "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
8961                "WRITE_ACCUMULATOR_STORAGE_COST" => {
8962                    Some(Self::WriteAccumulatorStorageCost)
8963                }
8964                "FORWARDING_ADDRESS_REGISTRY_CREATE" => {
8965                    Some(Self::ForwardingAddressRegistryCreate)
8966                }
8967                _ => None,
8968            }
8969        }
8970    }
8971    #[non_exhaustive]
8972    #[derive(Clone, PartialEq, ::prost::Oneof)]
8973    pub enum Data {
8974        /// End the epoch and start the next one.
8975        #[prost(message, tag = "2")]
8976        ChangeEpoch(super::ChangeEpoch),
8977        /// Expire JWKs used for zklogin.
8978        #[prost(message, tag = "3")]
8979        AuthenticatorStateExpire(super::AuthenticatorStateExpire),
8980        /// Execution time observations from the committee to preserve cross epoch
8981        #[prost(message, tag = "4")]
8982        ExecutionTimeObservations(super::ExecutionTimeObservations),
8983        /// ChainId used when initializing the bridge
8984        #[prost(string, tag = "5")]
8985        BridgeChainId(::prost::alloc::string::String),
8986        /// Start version of the Bridge object
8987        #[prost(uint64, tag = "6")]
8988        BridgeObjectVersion(u64),
8989        /// Contains the end-of-epoch-computed storage cost for accumulator objects.
8990        #[prost(uint64, tag = "7")]
8991        StorageCost(u64),
8992    }
8993}
8994/// Expire old JWKs.
8995#[non_exhaustive]
8996#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8997pub struct AuthenticatorStateExpire {
8998    /// Expire JWKs that have a lower epoch than this.
8999    #[prost(uint64, optional, tag = "1")]
9000    pub min_epoch: ::core::option::Option<u64>,
9001    /// The initial version of the authenticator object that it was shared at.
9002    #[prost(uint64, optional, tag = "2")]
9003    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
9004}
9005#[non_exhaustive]
9006#[derive(Clone, PartialEq, ::prost::Message)]
9007pub struct ExecutionTimeObservations {
9008    /// Version of this ExecutionTimeObservations
9009    #[prost(int32, optional, tag = "1")]
9010    pub version: ::core::option::Option<i32>,
9011    #[prost(message, repeated, tag = "2")]
9012    pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
9013}
9014#[non_exhaustive]
9015#[derive(Clone, PartialEq, ::prost::Message)]
9016pub struct ExecutionTimeObservation {
9017    #[prost(
9018        enumeration = "execution_time_observation::ExecutionTimeObservationKind",
9019        optional,
9020        tag = "1"
9021    )]
9022    pub kind: ::core::option::Option<i32>,
9023    #[prost(message, optional, tag = "2")]
9024    pub move_entry_point: ::core::option::Option<MoveCall>,
9025    #[prost(message, repeated, tag = "3")]
9026    pub validator_observations: ::prost::alloc::vec::Vec<
9027        ValidatorExecutionTimeObservation,
9028    >,
9029}
9030/// Nested message and enum types in `ExecutionTimeObservation`.
9031pub mod execution_time_observation {
9032    #[non_exhaustive]
9033    #[derive(
9034        Clone,
9035        Copy,
9036        Debug,
9037        PartialEq,
9038        Eq,
9039        Hash,
9040        PartialOrd,
9041        Ord,
9042        ::prost::Enumeration
9043    )]
9044    #[repr(i32)]
9045    pub enum ExecutionTimeObservationKind {
9046        Unknown = 0,
9047        MoveEntryPoint = 1,
9048        TransferObjects = 2,
9049        SplitCoins = 3,
9050        MergeCoins = 4,
9051        Publish = 5,
9052        MakeMoveVector = 6,
9053        Upgrade = 7,
9054    }
9055    impl ExecutionTimeObservationKind {
9056        /// String value of the enum field names used in the ProtoBuf definition.
9057        ///
9058        /// The values are not transformed in any way and thus are considered stable
9059        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
9060        pub fn as_str_name(&self) -> &'static str {
9061            match self {
9062                Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
9063                Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
9064                Self::TransferObjects => "TRANSFER_OBJECTS",
9065                Self::SplitCoins => "SPLIT_COINS",
9066                Self::MergeCoins => "MERGE_COINS",
9067                Self::Publish => "PUBLISH",
9068                Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
9069                Self::Upgrade => "UPGRADE",
9070            }
9071        }
9072        /// Creates an enum from field names used in the ProtoBuf definition.
9073        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9074            match value {
9075                "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
9076                "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
9077                "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
9078                "SPLIT_COINS" => Some(Self::SplitCoins),
9079                "MERGE_COINS" => Some(Self::MergeCoins),
9080                "PUBLISH" => Some(Self::Publish),
9081                "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
9082                "UPGRADE" => Some(Self::Upgrade),
9083                _ => None,
9084            }
9085        }
9086    }
9087}
9088#[non_exhaustive]
9089#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9090pub struct ValidatorExecutionTimeObservation {
9091    /// Bls12381 public key of the validator
9092    #[prost(bytes = "bytes", optional, tag = "1")]
9093    pub validator: ::core::option::Option<::prost::bytes::Bytes>,
9094    /// Duration of an execution observation
9095    #[prost(message, optional, tag = "2")]
9096    pub duration: ::core::option::Option<::prost_types::Duration>,
9097}
9098#[non_exhaustive]
9099#[derive(Clone, PartialEq, ::prost::Message)]
9100pub struct ExecuteTransactionRequest {
9101    /// The transaction to execute.
9102    #[prost(message, optional, tag = "1")]
9103    pub transaction: ::core::option::Option<Transaction>,
9104    /// Set of `UserSignature`s authorizing the execution of the provided
9105    /// transaction.
9106    #[prost(message, repeated, tag = "2")]
9107    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
9108    /// Mask specifying which fields to read.
9109    /// If no mask is specified, defaults to `effects.status,checkpoint`.
9110    #[prost(message, optional, tag = "3")]
9111    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9112}
9113/// Response message for `NodeService.ExecuteTransaction`.
9114#[non_exhaustive]
9115#[derive(Clone, PartialEq, ::prost::Message)]
9116pub struct ExecuteTransactionResponse {
9117    #[prost(message, optional, tag = "1")]
9118    pub transaction: ::core::option::Option<ExecutedTransaction>,
9119}
9120#[non_exhaustive]
9121#[derive(Clone, PartialEq, ::prost::Message)]
9122pub struct SimulateTransactionRequest {
9123    #[prost(message, optional, tag = "1")]
9124    pub transaction: ::core::option::Option<Transaction>,
9125    /// Mask specifying which fields to read.
9126    #[prost(message, optional, tag = "2")]
9127    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9128    /// Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction
9129    #[prost(
9130        enumeration = "simulate_transaction_request::TransactionChecks",
9131        optional,
9132        tag = "3"
9133    )]
9134    pub checks: ::core::option::Option<i32>,
9135    /// Perform gas selection based on a budget estimation and include the
9136    /// selected gas payment and budget in the response.
9137    ///
9138    /// This option will be ignored if `checks` is `DISABLED`.
9139    #[prost(bool, optional, tag = "4")]
9140    pub do_gas_selection: ::core::option::Option<bool>,
9141}
9142/// Nested message and enum types in `SimulateTransactionRequest`.
9143pub mod simulate_transaction_request {
9144    /// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
9145    #[non_exhaustive]
9146    #[derive(
9147        Clone,
9148        Copy,
9149        Debug,
9150        PartialEq,
9151        Eq,
9152        Hash,
9153        PartialOrd,
9154        Ord,
9155        ::prost::Enumeration
9156    )]
9157    #[repr(i32)]
9158    pub enum TransactionChecks {
9159        Enabled = 0,
9160        Disabled = 1,
9161    }
9162    impl TransactionChecks {
9163        /// String value of the enum field names used in the ProtoBuf definition.
9164        ///
9165        /// The values are not transformed in any way and thus are considered stable
9166        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
9167        pub fn as_str_name(&self) -> &'static str {
9168            match self {
9169                Self::Enabled => "ENABLED",
9170                Self::Disabled => "DISABLED",
9171            }
9172        }
9173        /// Creates an enum from field names used in the ProtoBuf definition.
9174        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9175            match value {
9176                "ENABLED" => Some(Self::Enabled),
9177                "DISABLED" => Some(Self::Disabled),
9178                _ => None,
9179            }
9180        }
9181    }
9182}
9183#[non_exhaustive]
9184#[derive(Clone, PartialEq, ::prost::Message)]
9185pub struct SimulateTransactionResponse {
9186    #[prost(message, optional, tag = "1")]
9187    pub transaction: ::core::option::Option<ExecutedTransaction>,
9188    #[prost(message, repeated, tag = "2")]
9189    pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
9190    /// A suggested gas price to use, that is above RGP, in order to provide a
9191    /// better chance of the transaction being included in the presence of
9192    /// congested objects.
9193    #[prost(uint64, optional, tag = "3")]
9194    pub suggested_gas_price: ::core::option::Option<u64>,
9195}
9196/// An intermediate result/output from the execution of a single command
9197#[non_exhaustive]
9198#[derive(Clone, PartialEq, ::prost::Message)]
9199pub struct CommandResult {
9200    #[prost(message, repeated, tag = "1")]
9201    pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
9202    #[prost(message, repeated, tag = "2")]
9203    pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
9204}
9205#[non_exhaustive]
9206#[derive(Clone, PartialEq, ::prost::Message)]
9207pub struct CommandOutput {
9208    #[prost(message, optional, tag = "1")]
9209    pub argument: ::core::option::Option<Argument>,
9210    #[prost(message, optional, tag = "2")]
9211    pub value: ::core::option::Option<Bcs>,
9212    /// JSON rendering of the output.
9213    #[prost(message, optional, boxed, tag = "3")]
9214    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
9215}
9216/// Generated client implementations.
9217pub mod transaction_execution_service_client {
9218    #![allow(
9219        unused_variables,
9220        dead_code,
9221        missing_docs,
9222        clippy::wildcard_imports,
9223        clippy::let_unit_value,
9224    )]
9225    use tonic::codegen::*;
9226    use tonic::codegen::http::Uri;
9227    #[derive(Debug, Clone)]
9228    pub struct TransactionExecutionServiceClient<T> {
9229        inner: tonic::client::Grpc<T>,
9230    }
9231    impl TransactionExecutionServiceClient<tonic::transport::Channel> {
9232        /// Attempt to create a new client by connecting to a given endpoint.
9233        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9234        where
9235            D: TryInto<tonic::transport::Endpoint>,
9236            D::Error: Into<StdError>,
9237        {
9238            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9239            Ok(Self::new(conn))
9240        }
9241    }
9242    impl<T> TransactionExecutionServiceClient<T>
9243    where
9244        T: tonic::client::GrpcService<tonic::body::Body>,
9245        T::Error: Into<StdError>,
9246        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9247        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9248    {
9249        pub fn new(inner: T) -> Self {
9250            let inner = tonic::client::Grpc::new(inner);
9251            Self { inner }
9252        }
9253        pub fn with_origin(inner: T, origin: Uri) -> Self {
9254            let inner = tonic::client::Grpc::with_origin(inner, origin);
9255            Self { inner }
9256        }
9257        pub fn with_interceptor<F>(
9258            inner: T,
9259            interceptor: F,
9260        ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
9261        where
9262            F: tonic::service::Interceptor,
9263            T::ResponseBody: Default,
9264            T: tonic::codegen::Service<
9265                http::Request<tonic::body::Body>,
9266                Response = http::Response<
9267                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9268                >,
9269            >,
9270            <T as tonic::codegen::Service<
9271                http::Request<tonic::body::Body>,
9272            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9273        {
9274            TransactionExecutionServiceClient::new(
9275                InterceptedService::new(inner, interceptor),
9276            )
9277        }
9278        /// Compress requests with the given encoding.
9279        ///
9280        /// This requires the server to support it otherwise it might respond with an
9281        /// error.
9282        #[must_use]
9283        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9284            self.inner = self.inner.send_compressed(encoding);
9285            self
9286        }
9287        /// Enable decompressing responses.
9288        #[must_use]
9289        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9290            self.inner = self.inner.accept_compressed(encoding);
9291            self
9292        }
9293        /// Limits the maximum size of a decoded message.
9294        ///
9295        /// Default: `4MB`
9296        #[must_use]
9297        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9298            self.inner = self.inner.max_decoding_message_size(limit);
9299            self
9300        }
9301        /// Limits the maximum size of an encoded message.
9302        ///
9303        /// Default: `usize::MAX`
9304        #[must_use]
9305        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9306            self.inner = self.inner.max_encoding_message_size(limit);
9307            self
9308        }
9309        pub async fn execute_transaction(
9310            &mut self,
9311            request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
9312        ) -> std::result::Result<
9313            tonic::Response<super::ExecuteTransactionResponse>,
9314            tonic::Status,
9315        > {
9316            self.inner
9317                .ready()
9318                .await
9319                .map_err(|e| {
9320                    tonic::Status::unknown(
9321                        format!("Service was not ready: {}", e.into()),
9322                    )
9323                })?;
9324            let codec = tonic_prost::ProstCodec::default();
9325            let path = http::uri::PathAndQuery::from_static(
9326                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
9327            );
9328            let mut req = request.into_request();
9329            req.extensions_mut()
9330                .insert(
9331                    GrpcMethod::new(
9332                        "sui.rpc.v2.TransactionExecutionService",
9333                        "ExecuteTransaction",
9334                    ),
9335                );
9336            self.inner.unary(req, path, codec).await
9337        }
9338        pub async fn simulate_transaction(
9339            &mut self,
9340            request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
9341        ) -> std::result::Result<
9342            tonic::Response<super::SimulateTransactionResponse>,
9343            tonic::Status,
9344        > {
9345            self.inner
9346                .ready()
9347                .await
9348                .map_err(|e| {
9349                    tonic::Status::unknown(
9350                        format!("Service was not ready: {}", e.into()),
9351                    )
9352                })?;
9353            let codec = tonic_prost::ProstCodec::default();
9354            let path = http::uri::PathAndQuery::from_static(
9355                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
9356            );
9357            let mut req = request.into_request();
9358            req.extensions_mut()
9359                .insert(
9360                    GrpcMethod::new(
9361                        "sui.rpc.v2.TransactionExecutionService",
9362                        "SimulateTransaction",
9363                    ),
9364                );
9365            self.inner.unary(req, path, codec).await
9366        }
9367    }
9368}
9369/// Generated server implementations.
9370pub mod transaction_execution_service_server {
9371    #![allow(
9372        unused_variables,
9373        dead_code,
9374        missing_docs,
9375        clippy::wildcard_imports,
9376        clippy::let_unit_value,
9377    )]
9378    use tonic::codegen::*;
9379    /// Generated trait containing gRPC methods that should be implemented for use with TransactionExecutionServiceServer.
9380    #[async_trait]
9381    pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
9382        async fn execute_transaction(
9383            &self,
9384            request: tonic::Request<super::ExecuteTransactionRequest>,
9385        ) -> std::result::Result<
9386            tonic::Response<super::ExecuteTransactionResponse>,
9387            tonic::Status,
9388        > {
9389            Err(tonic::Status::unimplemented("Not yet implemented"))
9390        }
9391        async fn simulate_transaction(
9392            &self,
9393            request: tonic::Request<super::SimulateTransactionRequest>,
9394        ) -> std::result::Result<
9395            tonic::Response<super::SimulateTransactionResponse>,
9396            tonic::Status,
9397        > {
9398            Err(tonic::Status::unimplemented("Not yet implemented"))
9399        }
9400    }
9401    #[derive(Debug)]
9402    pub struct TransactionExecutionServiceServer<T> {
9403        inner: Arc<T>,
9404        accept_compression_encodings: EnabledCompressionEncodings,
9405        send_compression_encodings: EnabledCompressionEncodings,
9406        max_decoding_message_size: Option<usize>,
9407        max_encoding_message_size: Option<usize>,
9408    }
9409    impl<T> TransactionExecutionServiceServer<T> {
9410        pub fn new(inner: T) -> Self {
9411            Self::from_arc(Arc::new(inner))
9412        }
9413        pub fn from_arc(inner: Arc<T>) -> Self {
9414            Self {
9415                inner,
9416                accept_compression_encodings: Default::default(),
9417                send_compression_encodings: Default::default(),
9418                max_decoding_message_size: None,
9419                max_encoding_message_size: None,
9420            }
9421        }
9422        pub fn with_interceptor<F>(
9423            inner: T,
9424            interceptor: F,
9425        ) -> InterceptedService<Self, F>
9426        where
9427            F: tonic::service::Interceptor,
9428        {
9429            InterceptedService::new(Self::new(inner), interceptor)
9430        }
9431        /// Enable decompressing requests with the given encoding.
9432        #[must_use]
9433        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9434            self.accept_compression_encodings.enable(encoding);
9435            self
9436        }
9437        /// Compress responses with the given encoding, if the client supports it.
9438        #[must_use]
9439        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9440            self.send_compression_encodings.enable(encoding);
9441            self
9442        }
9443        /// Limits the maximum size of a decoded message.
9444        ///
9445        /// Default: `4MB`
9446        #[must_use]
9447        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9448            self.max_decoding_message_size = Some(limit);
9449            self
9450        }
9451        /// Limits the maximum size of an encoded message.
9452        ///
9453        /// Default: `usize::MAX`
9454        #[must_use]
9455        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9456            self.max_encoding_message_size = Some(limit);
9457            self
9458        }
9459    }
9460    impl<T, B> tonic::codegen::Service<http::Request<B>>
9461    for TransactionExecutionServiceServer<T>
9462    where
9463        T: TransactionExecutionService,
9464        B: Body + std::marker::Send + 'static,
9465        B::Error: Into<StdError> + std::marker::Send + 'static,
9466    {
9467        type Response = http::Response<tonic::body::Body>;
9468        type Error = std::convert::Infallible;
9469        type Future = BoxFuture<Self::Response, Self::Error>;
9470        fn poll_ready(
9471            &mut self,
9472            _cx: &mut Context<'_>,
9473        ) -> Poll<std::result::Result<(), Self::Error>> {
9474            Poll::Ready(Ok(()))
9475        }
9476        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9477            match req.uri().path() {
9478                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
9479                    #[allow(non_camel_case_types)]
9480                    struct ExecuteTransactionSvc<T: TransactionExecutionService>(
9481                        pub Arc<T>,
9482                    );
9483                    impl<
9484                        T: TransactionExecutionService,
9485                    > tonic::server::UnaryService<super::ExecuteTransactionRequest>
9486                    for ExecuteTransactionSvc<T> {
9487                        type Response = super::ExecuteTransactionResponse;
9488                        type Future = BoxFuture<
9489                            tonic::Response<Self::Response>,
9490                            tonic::Status,
9491                        >;
9492                        fn call(
9493                            &mut self,
9494                            request: tonic::Request<super::ExecuteTransactionRequest>,
9495                        ) -> Self::Future {
9496                            let inner = Arc::clone(&self.0);
9497                            let fut = async move {
9498                                <T as TransactionExecutionService>::execute_transaction(
9499                                        &inner,
9500                                        request,
9501                                    )
9502                                    .await
9503                            };
9504                            Box::pin(fut)
9505                        }
9506                    }
9507                    let accept_compression_encodings = self.accept_compression_encodings;
9508                    let send_compression_encodings = self.send_compression_encodings;
9509                    let max_decoding_message_size = self.max_decoding_message_size;
9510                    let max_encoding_message_size = self.max_encoding_message_size;
9511                    let inner = self.inner.clone();
9512                    let fut = async move {
9513                        let method = ExecuteTransactionSvc(inner);
9514                        let codec = tonic_prost::ProstCodec::default();
9515                        let mut grpc = tonic::server::Grpc::new(codec)
9516                            .apply_compression_config(
9517                                accept_compression_encodings,
9518                                send_compression_encodings,
9519                            )
9520                            .apply_max_message_size_config(
9521                                max_decoding_message_size,
9522                                max_encoding_message_size,
9523                            );
9524                        let res = grpc.unary(method, req).await;
9525                        Ok(res)
9526                    };
9527                    Box::pin(fut)
9528                }
9529                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
9530                    #[allow(non_camel_case_types)]
9531                    struct SimulateTransactionSvc<T: TransactionExecutionService>(
9532                        pub Arc<T>,
9533                    );
9534                    impl<
9535                        T: TransactionExecutionService,
9536                    > tonic::server::UnaryService<super::SimulateTransactionRequest>
9537                    for SimulateTransactionSvc<T> {
9538                        type Response = super::SimulateTransactionResponse;
9539                        type Future = BoxFuture<
9540                            tonic::Response<Self::Response>,
9541                            tonic::Status,
9542                        >;
9543                        fn call(
9544                            &mut self,
9545                            request: tonic::Request<super::SimulateTransactionRequest>,
9546                        ) -> Self::Future {
9547                            let inner = Arc::clone(&self.0);
9548                            let fut = async move {
9549                                <T as TransactionExecutionService>::simulate_transaction(
9550                                        &inner,
9551                                        request,
9552                                    )
9553                                    .await
9554                            };
9555                            Box::pin(fut)
9556                        }
9557                    }
9558                    let accept_compression_encodings = self.accept_compression_encodings;
9559                    let send_compression_encodings = self.send_compression_encodings;
9560                    let max_decoding_message_size = self.max_decoding_message_size;
9561                    let max_encoding_message_size = self.max_encoding_message_size;
9562                    let inner = self.inner.clone();
9563                    let fut = async move {
9564                        let method = SimulateTransactionSvc(inner);
9565                        let codec = tonic_prost::ProstCodec::default();
9566                        let mut grpc = tonic::server::Grpc::new(codec)
9567                            .apply_compression_config(
9568                                accept_compression_encodings,
9569                                send_compression_encodings,
9570                            )
9571                            .apply_max_message_size_config(
9572                                max_decoding_message_size,
9573                                max_encoding_message_size,
9574                            );
9575                        let res = grpc.unary(method, req).await;
9576                        Ok(res)
9577                    };
9578                    Box::pin(fut)
9579                }
9580                _ => {
9581                    Box::pin(async move {
9582                        let mut response = http::Response::new(
9583                            tonic::body::Body::default(),
9584                        );
9585                        let headers = response.headers_mut();
9586                        headers
9587                            .insert(
9588                                tonic::Status::GRPC_STATUS,
9589                                (tonic::Code::Unimplemented as i32).into(),
9590                            );
9591                        headers
9592                            .insert(
9593                                http::header::CONTENT_TYPE,
9594                                tonic::metadata::GRPC_CONTENT_TYPE,
9595                            );
9596                        Ok(response)
9597                    })
9598                }
9599            }
9600        }
9601    }
9602    impl<T> Clone for TransactionExecutionServiceServer<T> {
9603        fn clone(&self) -> Self {
9604            let inner = self.inner.clone();
9605            Self {
9606                inner,
9607                accept_compression_encodings: self.accept_compression_encodings,
9608                send_compression_encodings: self.send_compression_encodings,
9609                max_decoding_message_size: self.max_decoding_message_size,
9610                max_encoding_message_size: self.max_encoding_message_size,
9611            }
9612        }
9613    }
9614    /// Generated gRPC service name
9615    pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
9616    impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
9617        const NAME: &'static str = SERVICE_NAME;
9618    }
9619}