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