Skip to main content

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

1// This file is @generated by prost-build.
2/// An argument to a programmable transaction command.
3#[non_exhaustive]
4#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct Argument {
6    #[prost(enumeration = "argument::ArgumentKind", optional, tag = "1")]
7    pub kind: ::core::option::Option<i32>,
8    /// Index of an input when `kind` is `INPUT`.
9    #[prost(uint32, optional, tag = "2")]
10    pub input: ::core::option::Option<u32>,
11    /// Index of a result when `kind` is `RESULT`.
12    #[prost(uint32, optional, tag = "3")]
13    pub result: ::core::option::Option<u32>,
14    /// Used to access a nested result when `kind` is `RESULT`.
15    #[prost(uint32, optional, tag = "4")]
16    pub subresult: ::core::option::Option<u32>,
17}
18/// Nested message and enum types in `Argument`.
19pub mod argument {
20    #[non_exhaustive]
21    #[derive(
22        Clone,
23        Copy,
24        Debug,
25        PartialEq,
26        Eq,
27        Hash,
28        PartialOrd,
29        Ord,
30        ::prost::Enumeration
31    )]
32    #[repr(i32)]
33    pub enum ArgumentKind {
34        Unknown = 0,
35        /// The gas coin.
36        Gas = 1,
37        /// One of the input objects or primitive values (from
38        /// `ProgrammableTransaction` inputs).
39        Input = 2,
40        /// The result of another command (from `ProgrammableTransaction` commands).
41        Result = 3,
42    }
43    impl ArgumentKind {
44        /// String value of the enum field names used in the ProtoBuf definition.
45        ///
46        /// The values are not transformed in any way and thus are considered stable
47        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
48        pub fn as_str_name(&self) -> &'static str {
49            match self {
50                Self::Unknown => "ARGUMENT_KIND_UNKNOWN",
51                Self::Gas => "GAS",
52                Self::Input => "INPUT",
53                Self::Result => "RESULT",
54            }
55        }
56        /// Creates an enum from field names used in the ProtoBuf definition.
57        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
58            match value {
59                "ARGUMENT_KIND_UNKNOWN" => Some(Self::Unknown),
60                "GAS" => Some(Self::Gas),
61                "INPUT" => Some(Self::Input),
62                "RESULT" => Some(Self::Result),
63                _ => None,
64            }
65        }
66    }
67}
68/// The delta, or change, in balance for an address for a particular `Coin` type.
69#[non_exhaustive]
70#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
71pub struct BalanceChange {
72    /// The account address that is affected by this balance change event.
73    #[prost(string, optional, tag = "1")]
74    pub address: ::core::option::Option<::prost::alloc::string::String>,
75    /// The `Coin` type of this balance change event.
76    #[prost(string, optional, tag = "2")]
77    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
78    /// The amount or change in balance.
79    #[prost(string, optional, tag = "3")]
80    pub amount: ::core::option::Option<::prost::alloc::string::String>,
81}
82/// `Bcs` contains an arbitrary type that is serialized using the
83/// [BCS](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/index.html#bcs>)
84/// format as well as a name that identifies the type of the serialized value.
85#[non_exhaustive]
86#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
87pub struct Bcs {
88    /// Name that identifies the type of the serialized value.
89    #[prost(string, optional, tag = "1")]
90    pub name: ::core::option::Option<::prost::alloc::string::String>,
91    /// Bytes of a BCS serialized value.
92    #[prost(bytes = "bytes", optional, tag = "2")]
93    pub value: ::core::option::Option<::prost::bytes::Bytes>,
94}
95#[non_exhaustive]
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct Checkpoint {
98    /// The height of this checkpoint.
99    #[prost(uint64, optional, tag = "1")]
100    pub sequence_number: ::core::option::Option<u64>,
101    /// The digest of this Checkpoint's CheckpointSummary.
102    #[prost(string, optional, tag = "2")]
103    pub digest: ::core::option::Option<::prost::alloc::string::String>,
104    /// The `CheckpointSummary` for this checkpoint.
105    #[prost(message, optional, tag = "3")]
106    pub summary: ::core::option::Option<CheckpointSummary>,
107    /// An aggregated quorum signature from the validator committee that
108    /// certified this checkpoint.
109    #[prost(message, optional, tag = "4")]
110    pub signature: ::core::option::Option<ValidatorAggregatedSignature>,
111    /// The `CheckpointContents` for this checkpoint.
112    #[prost(message, optional, tag = "5")]
113    pub contents: ::core::option::Option<CheckpointContents>,
114    /// List of transactions included in this checkpoint.
115    #[prost(message, repeated, tag = "6")]
116    pub transactions: ::prost::alloc::vec::Vec<ExecutedTransaction>,
117    /// Set of objects either referenced as inputs or produced as
118    /// outputs by transactions included in this checkpoint.
119    ///
120    /// In order to benefit from deduplication of objects that
121    /// appear in multiple transactions in this checkpoint, objects
122    /// will only be present here and the `transactions.objects`
123    /// field will not be populated.
124    #[prost(message, optional, tag = "7")]
125    pub objects: ::core::option::Option<ObjectSet>,
126}
127/// The committed to contents of a checkpoint.
128#[non_exhaustive]
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct CheckpointContents {
131    /// This CheckpointContents serialized as BCS.
132    #[prost(message, optional, tag = "1")]
133    pub bcs: ::core::option::Option<Bcs>,
134    /// The digest of this CheckpointContents.
135    #[prost(string, optional, tag = "2")]
136    pub digest: ::core::option::Option<::prost::alloc::string::String>,
137    /// Version of this CheckpointContents
138    #[prost(int32, optional, tag = "3")]
139    pub version: ::core::option::Option<i32>,
140    /// Set of transactions committed to in this checkpoint.
141    #[prost(message, repeated, tag = "4")]
142    pub transactions: ::prost::alloc::vec::Vec<CheckpointedTransactionInfo>,
143}
144/// Transaction information committed to in a checkpoint.
145#[non_exhaustive]
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct CheckpointedTransactionInfo {
148    /// Digest of the transaction.
149    #[prost(string, optional, tag = "1")]
150    pub transaction: ::core::option::Option<::prost::alloc::string::String>,
151    /// Digest of the effects.
152    #[prost(string, optional, tag = "2")]
153    pub effects: ::core::option::Option<::prost::alloc::string::String>,
154    /// Set of user signatures that authorized the transaction.
155    #[prost(message, repeated, tag = "3")]
156    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
157    /// The `AddressAliases` object version, if any, that was used to verify the
158    /// UserSignature at the same position in `signatures`.
159    ///
160    /// This field is present when CheckpointContents.version is >= 2.
161    #[prost(message, repeated, tag = "4")]
162    pub address_aliases_versions: ::prost::alloc::vec::Vec<AddressAliasesVersion>,
163}
164#[non_exhaustive]
165#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
166pub struct AddressAliasesVersion {
167    #[prost(uint64, optional, tag = "1")]
168    pub version: ::core::option::Option<u64>,
169}
170/// A header for a checkpoint on the Sui blockchain.
171///
172/// On the Sui network, checkpoints define the history of the blockchain. They are quite similar to
173/// the concept of blocks used by other blockchains like Bitcoin or Ethereum. The Sui blockchain,
174/// however, forms checkpoints after transaction execution has already happened to provide a
175/// certified history of the chain, instead of being formed before execution.
176///
177/// Checkpoints commit to a variety of state, including but not limited to:
178///
179/// * The hash of the previous checkpoint.
180/// * The set of transaction digests, their corresponding effects digests, as well as the set of
181///   user signatures that authorized its execution.
182/// * The objects produced by a transaction.
183/// * The set of live objects that make up the current state of the chain.
184/// * On epoch transitions, the next validator committee.
185///
186/// `CheckpointSummary`s themselves don't directly include all of the previous information but they
187/// are the top-level type by which all the information is committed to transitively via cryptographic
188/// hashes included in the summary. `CheckpointSummary`s are signed and certified by a quorum of
189/// the validator committee in a given epoch to allow verification of the chain's state.
190#[non_exhaustive]
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct CheckpointSummary {
193    /// This CheckpointSummary serialized as BCS.
194    #[prost(message, optional, tag = "1")]
195    pub bcs: ::core::option::Option<Bcs>,
196    /// The digest of this CheckpointSummary.
197    #[prost(string, optional, tag = "2")]
198    pub digest: ::core::option::Option<::prost::alloc::string::String>,
199    /// Epoch that this checkpoint belongs to.
200    #[prost(uint64, optional, tag = "3")]
201    pub epoch: ::core::option::Option<u64>,
202    /// The height of this checkpoint.
203    #[prost(uint64, optional, tag = "4")]
204    pub sequence_number: ::core::option::Option<u64>,
205    /// Total number of transactions committed since genesis, including those in this
206    /// checkpoint.
207    #[prost(uint64, optional, tag = "5")]
208    pub total_network_transactions: ::core::option::Option<u64>,
209    /// The hash of the `CheckpointContents` for this checkpoint.
210    #[prost(string, optional, tag = "6")]
211    pub content_digest: ::core::option::Option<::prost::alloc::string::String>,
212    /// The hash of the previous `CheckpointSummary`.
213    ///
214    /// This will be `None` only for the first, or genesis, checkpoint.
215    #[prost(string, optional, tag = "7")]
216    pub previous_digest: ::core::option::Option<::prost::alloc::string::String>,
217    /// The running total gas costs of all transactions included in the current epoch so far
218    /// until this checkpoint.
219    #[prost(message, optional, tag = "8")]
220    pub epoch_rolling_gas_cost_summary: ::core::option::Option<GasCostSummary>,
221    /// Timestamp of the checkpoint - number of milliseconds from the Unix epoch
222    /// Checkpoint timestamps are monotonic, but not strongly monotonic - subsequent
223    /// checkpoints can have the same timestamp if they originate from the same underlining consensus commit.
224    #[prost(message, optional, tag = "9")]
225    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
226    /// Commitments to checkpoint-specific state.
227    #[prost(message, repeated, tag = "10")]
228    pub commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
229    /// Extra data only present in the final checkpoint of an epoch.
230    #[prost(message, optional, tag = "11")]
231    pub end_of_epoch_data: ::core::option::Option<EndOfEpochData>,
232    /// `CheckpointSummary` is not an evolvable structure - it must be readable by any version of
233    /// the code. Therefore, to allow extensions to be added to `CheckpointSummary`,
234    /// opaque data can be added to checkpoints, which can be deserialized based on the current
235    /// protocol version.
236    #[prost(bytes = "bytes", optional, tag = "12")]
237    pub version_specific_data: ::core::option::Option<::prost::bytes::Bytes>,
238}
239/// Data, which when included in a `CheckpointSummary`, signals the end of an `Epoch`.
240#[non_exhaustive]
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct EndOfEpochData {
243    /// The set of validators that will be in the `ValidatorCommittee` for the next epoch.
244    #[prost(message, repeated, tag = "1")]
245    pub next_epoch_committee: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
246    /// The protocol version that is in effect during the next epoch.
247    #[prost(uint64, optional, tag = "2")]
248    pub next_epoch_protocol_version: ::core::option::Option<u64>,
249    /// Commitments to epoch specific state (live object set)
250    #[prost(message, repeated, tag = "3")]
251    pub epoch_commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
252}
253/// A commitment made by a checkpoint.
254#[non_exhaustive]
255#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
256pub struct CheckpointCommitment {
257    #[prost(
258        enumeration = "checkpoint_commitment::CheckpointCommitmentKind",
259        optional,
260        tag = "1"
261    )]
262    pub kind: ::core::option::Option<i32>,
263    #[prost(string, optional, tag = "2")]
264    pub digest: ::core::option::Option<::prost::alloc::string::String>,
265}
266/// Nested message and enum types in `CheckpointCommitment`.
267pub mod checkpoint_commitment {
268    #[non_exhaustive]
269    #[derive(
270        Clone,
271        Copy,
272        Debug,
273        PartialEq,
274        Eq,
275        Hash,
276        PartialOrd,
277        Ord,
278        ::prost::Enumeration
279    )]
280    #[repr(i32)]
281    pub enum CheckpointCommitmentKind {
282        Unknown = 0,
283        /// An elliptic curve multiset hash attesting to the set of objects that
284        /// comprise the live state of the Sui blockchain.
285        EcmhLiveObjectSet = 1,
286        /// Digest of the checkpoint artifacts.
287        CheckpointArtifacts = 2,
288    }
289    impl CheckpointCommitmentKind {
290        /// String value of the enum field names used in the ProtoBuf definition.
291        ///
292        /// The values are not transformed in any way and thus are considered stable
293        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
294        pub fn as_str_name(&self) -> &'static str {
295            match self {
296                Self::Unknown => "CHECKPOINT_COMMITMENT_KIND_UNKNOWN",
297                Self::EcmhLiveObjectSet => "ECMH_LIVE_OBJECT_SET",
298                Self::CheckpointArtifacts => "CHECKPOINT_ARTIFACTS",
299            }
300        }
301        /// Creates an enum from field names used in the ProtoBuf definition.
302        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
303            match value {
304                "CHECKPOINT_COMMITMENT_KIND_UNKNOWN" => Some(Self::Unknown),
305                "ECMH_LIVE_OBJECT_SET" => Some(Self::EcmhLiveObjectSet),
306                "CHECKPOINT_ARTIFACTS" => Some(Self::CheckpointArtifacts),
307                _ => None,
308            }
309        }
310    }
311}
312/// The effects of executing a transaction.
313#[non_exhaustive]
314#[derive(Clone, PartialEq, ::prost::Message)]
315pub struct TransactionEffects {
316    /// This TransactionEffects serialized as BCS.
317    #[prost(message, optional, tag = "1")]
318    pub bcs: ::core::option::Option<Bcs>,
319    /// The digest of this TransactionEffects.
320    #[prost(string, optional, tag = "2")]
321    pub digest: ::core::option::Option<::prost::alloc::string::String>,
322    /// Version of this TransactionEffects.
323    #[prost(int32, optional, tag = "3")]
324    pub version: ::core::option::Option<i32>,
325    /// The status of the execution.
326    #[prost(message, optional, tag = "4")]
327    pub status: ::core::option::Option<ExecutionStatus>,
328    /// The epoch when this transaction was executed.
329    #[prost(uint64, optional, tag = "5")]
330    pub epoch: ::core::option::Option<u64>,
331    /// The gas used by this transaction.
332    #[prost(message, optional, tag = "6")]
333    pub gas_used: ::core::option::Option<GasCostSummary>,
334    /// The transaction digest.
335    #[prost(string, optional, tag = "7")]
336    pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
337    /// Information about the gas object. Also present in the `changed_objects` vector.
338    ///
339    /// System transactions that don't require gas will leave this as `None`.
340    #[prost(message, optional, tag = "8")]
341    pub gas_object: ::core::option::Option<ChangedObject>,
342    /// The digest of the events emitted during execution,
343    /// can be `None` if the transaction does not emit any event.
344    #[prost(string, optional, tag = "9")]
345    pub events_digest: ::core::option::Option<::prost::alloc::string::String>,
346    /// The set of transaction digests this transaction depends on.
347    #[prost(string, repeated, tag = "10")]
348    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
349    /// The version number of all the written objects (excluding packages) by this transaction.
350    #[prost(uint64, optional, tag = "11")]
351    pub lamport_version: ::core::option::Option<u64>,
352    /// Objects whose state are changed by this transaction.
353    #[prost(message, repeated, tag = "12")]
354    pub changed_objects: ::prost::alloc::vec::Vec<ChangedObject>,
355    /// Consensus objects that are not mutated in this transaction. Unlike owned objects,
356    /// read-only consensus objects' version are not committed in the transaction,
357    /// and in order for a node to catch up and execute it without consensus sequencing,
358    /// the version needs to be committed in the effects.
359    #[prost(message, repeated, tag = "13")]
360    pub unchanged_consensus_objects: ::prost::alloc::vec::Vec<UnchangedConsensusObject>,
361    /// Auxiliary data that are not protocol-critical, generated as part of the effects but are stored separately.
362    /// Storing it separately allows us to avoid bloating the effects with data that are not critical.
363    /// It also provides more flexibility on the format and type of the data.
364    #[prost(string, optional, tag = "14")]
365    pub auxiliary_data_digest: ::core::option::Option<::prost::alloc::string::String>,
366    #[prost(message, repeated, tag = "15")]
367    pub unchanged_loaded_runtime_objects: ::prost::alloc::vec::Vec<ObjectReference>,
368}
369/// Input/output state of an object that was changed during execution.
370#[non_exhaustive]
371#[derive(Clone, PartialEq, ::prost::Message)]
372pub struct ChangedObject {
373    /// ID of the object.
374    #[prost(string, optional, tag = "1")]
375    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
376    #[prost(enumeration = "changed_object::InputObjectState", optional, tag = "2")]
377    pub input_state: ::core::option::Option<i32>,
378    /// Version of the object before this transaction executed.
379    #[prost(uint64, optional, tag = "3")]
380    pub input_version: ::core::option::Option<u64>,
381    /// Digest of the object before this transaction executed.
382    #[prost(string, optional, tag = "4")]
383    pub input_digest: ::core::option::Option<::prost::alloc::string::String>,
384    /// Owner of the object before this transaction executed.
385    #[prost(message, optional, tag = "5")]
386    pub input_owner: ::core::option::Option<Owner>,
387    #[prost(enumeration = "changed_object::OutputObjectState", optional, tag = "6")]
388    pub output_state: ::core::option::Option<i32>,
389    /// Version of the object after this transaction executed.
390    #[prost(uint64, optional, tag = "7")]
391    pub output_version: ::core::option::Option<u64>,
392    /// Digest of the object after this transaction executed.
393    #[prost(string, optional, tag = "8")]
394    pub output_digest: ::core::option::Option<::prost::alloc::string::String>,
395    /// Owner of the object after this transaction executed.
396    #[prost(message, optional, tag = "9")]
397    pub output_owner: ::core::option::Option<Owner>,
398    /// The contents of the accumulator write when `output_state` is `OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE`
399    #[prost(message, optional, tag = "12")]
400    pub accumulator_write: ::core::option::Option<AccumulatorWrite>,
401    /// What happened to an `ObjectId` during execution.
402    #[prost(enumeration = "changed_object::IdOperation", optional, tag = "10")]
403    pub id_operation: ::core::option::Option<i32>,
404    /// Type information is not provided by the effects structure but is instead
405    /// provided by an indexing layer
406    #[prost(string, optional, tag = "11")]
407    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
408}
409/// Nested message and enum types in `ChangedObject`.
410pub mod changed_object {
411    #[non_exhaustive]
412    #[derive(
413        Clone,
414        Copy,
415        Debug,
416        PartialEq,
417        Eq,
418        Hash,
419        PartialOrd,
420        Ord,
421        ::prost::Enumeration
422    )]
423    #[repr(i32)]
424    pub enum InputObjectState {
425        Unknown = 0,
426        DoesNotExist = 1,
427        Exists = 2,
428    }
429    impl InputObjectState {
430        /// String value of the enum field names used in the ProtoBuf definition.
431        ///
432        /// The values are not transformed in any way and thus are considered stable
433        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
434        pub fn as_str_name(&self) -> &'static str {
435            match self {
436                Self::Unknown => "INPUT_OBJECT_STATE_UNKNOWN",
437                Self::DoesNotExist => "INPUT_OBJECT_STATE_DOES_NOT_EXIST",
438                Self::Exists => "INPUT_OBJECT_STATE_EXISTS",
439            }
440        }
441        /// Creates an enum from field names used in the ProtoBuf definition.
442        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
443            match value {
444                "INPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
445                "INPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
446                "INPUT_OBJECT_STATE_EXISTS" => Some(Self::Exists),
447                _ => None,
448            }
449        }
450    }
451    #[non_exhaustive]
452    #[derive(
453        Clone,
454        Copy,
455        Debug,
456        PartialEq,
457        Eq,
458        Hash,
459        PartialOrd,
460        Ord,
461        ::prost::Enumeration
462    )]
463    #[repr(i32)]
464    pub enum OutputObjectState {
465        Unknown = 0,
466        DoesNotExist = 1,
467        ObjectWrite = 2,
468        PackageWrite = 3,
469        AccumulatorWrite = 4,
470    }
471    impl OutputObjectState {
472        /// String value of the enum field names used in the ProtoBuf definition.
473        ///
474        /// The values are not transformed in any way and thus are considered stable
475        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
476        pub fn as_str_name(&self) -> &'static str {
477            match self {
478                Self::Unknown => "OUTPUT_OBJECT_STATE_UNKNOWN",
479                Self::DoesNotExist => "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST",
480                Self::ObjectWrite => "OUTPUT_OBJECT_STATE_OBJECT_WRITE",
481                Self::PackageWrite => "OUTPUT_OBJECT_STATE_PACKAGE_WRITE",
482                Self::AccumulatorWrite => "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE",
483            }
484        }
485        /// Creates an enum from field names used in the ProtoBuf definition.
486        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
487            match value {
488                "OUTPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
489                "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
490                "OUTPUT_OBJECT_STATE_OBJECT_WRITE" => Some(Self::ObjectWrite),
491                "OUTPUT_OBJECT_STATE_PACKAGE_WRITE" => Some(Self::PackageWrite),
492                "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE" => Some(Self::AccumulatorWrite),
493                _ => None,
494            }
495        }
496    }
497    #[non_exhaustive]
498    #[derive(
499        Clone,
500        Copy,
501        Debug,
502        PartialEq,
503        Eq,
504        Hash,
505        PartialOrd,
506        Ord,
507        ::prost::Enumeration
508    )]
509    #[repr(i32)]
510    pub enum IdOperation {
511        Unknown = 0,
512        None = 1,
513        Created = 2,
514        Deleted = 3,
515    }
516    impl IdOperation {
517        /// String value of the enum field names used in the ProtoBuf definition.
518        ///
519        /// The values are not transformed in any way and thus are considered stable
520        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
521        pub fn as_str_name(&self) -> &'static str {
522            match self {
523                Self::Unknown => "ID_OPERATION_UNKNOWN",
524                Self::None => "NONE",
525                Self::Created => "CREATED",
526                Self::Deleted => "DELETED",
527            }
528        }
529        /// Creates an enum from field names used in the ProtoBuf definition.
530        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
531            match value {
532                "ID_OPERATION_UNKNOWN" => Some(Self::Unknown),
533                "NONE" => Some(Self::None),
534                "CREATED" => Some(Self::Created),
535                "DELETED" => Some(Self::Deleted),
536                _ => None,
537            }
538        }
539    }
540}
541/// An entry in an event digest accumulator value.
542#[non_exhaustive]
543#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
544pub struct EventDigestEntry {
545    /// Index of the event within its transaction.
546    #[prost(uint64, optional, tag = "1")]
547    pub event_index: ::core::option::Option<u64>,
548    /// Digest of the event.
549    #[prost(string, optional, tag = "2")]
550    pub digest: ::core::option::Option<::prost::alloc::string::String>,
551}
552#[non_exhaustive]
553#[derive(Clone, PartialEq, ::prost::Message)]
554pub struct AccumulatorWrite {
555    #[prost(string, optional, tag = "1")]
556    pub address: ::core::option::Option<::prost::alloc::string::String>,
557    #[prost(string, optional, tag = "2")]
558    pub accumulator_type: ::core::option::Option<::prost::alloc::string::String>,
559    #[prost(
560        enumeration = "accumulator_write::AccumulatorOperation",
561        optional,
562        tag = "3"
563    )]
564    pub operation: ::core::option::Option<i32>,
565    #[prost(enumeration = "accumulator_write::AccumulatorValue", optional, tag = "4")]
566    pub value_kind: ::core::option::Option<i32>,
567    /// Set when the accumulator value is an integer (value_kind = INTEGER).
568    #[prost(uint64, optional, tag = "5")]
569    pub integer_value: ::core::option::Option<u64>,
570    /// Set, with len 2, when the accumulator value is an integer tuple
571    /// (value_kind = INTEGER_TUPLE).
572    #[prost(uint64, repeated, tag = "6")]
573    pub integer_tuple: ::prost::alloc::vec::Vec<u64>,
574    /// Set when the accumulator value is an event digest list (value_kind = EVENT_DIGEST).
575    /// Contains a non-empty list of (event_index, digest) pairs representing
576    /// authenticated event stream entries within a transaction.
577    #[prost(message, repeated, tag = "7")]
578    pub event_digest_value: ::prost::alloc::vec::Vec<EventDigestEntry>,
579}
580/// Nested message and enum types in `AccumulatorWrite`.
581pub mod accumulator_write {
582    #[non_exhaustive]
583    #[derive(
584        Clone,
585        Copy,
586        Debug,
587        PartialEq,
588        Eq,
589        Hash,
590        PartialOrd,
591        Ord,
592        ::prost::Enumeration
593    )]
594    #[repr(i32)]
595    pub enum AccumulatorOperation {
596        Unknown = 0,
597        Merge = 1,
598        Split = 2,
599    }
600    impl AccumulatorOperation {
601        /// String value of the enum field names used in the ProtoBuf definition.
602        ///
603        /// The values are not transformed in any way and thus are considered stable
604        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
605        pub fn as_str_name(&self) -> &'static str {
606            match self {
607                Self::Unknown => "ACCUMULATOR_OPERATION_UNKNOWN",
608                Self::Merge => "MERGE",
609                Self::Split => "SPLIT",
610            }
611        }
612        /// Creates an enum from field names used in the ProtoBuf definition.
613        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
614            match value {
615                "ACCUMULATOR_OPERATION_UNKNOWN" => Some(Self::Unknown),
616                "MERGE" => Some(Self::Merge),
617                "SPLIT" => Some(Self::Split),
618                _ => None,
619            }
620        }
621    }
622    #[non_exhaustive]
623    #[derive(
624        Clone,
625        Copy,
626        Debug,
627        PartialEq,
628        Eq,
629        Hash,
630        PartialOrd,
631        Ord,
632        ::prost::Enumeration
633    )]
634    #[repr(i32)]
635    pub enum AccumulatorValue {
636        Unknown = 0,
637        Integer = 1,
638        IntegerTuple = 2,
639        EventDigest = 3,
640    }
641    impl AccumulatorValue {
642        /// String value of the enum field names used in the ProtoBuf definition.
643        ///
644        /// The values are not transformed in any way and thus are considered stable
645        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
646        pub fn as_str_name(&self) -> &'static str {
647            match self {
648                Self::Unknown => "ACCUMULATOR_VALUE_UNKNOWN",
649                Self::Integer => "INTEGER",
650                Self::IntegerTuple => "INTEGER_TUPLE",
651                Self::EventDigest => "EVENT_DIGEST",
652            }
653        }
654        /// Creates an enum from field names used in the ProtoBuf definition.
655        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
656            match value {
657                "ACCUMULATOR_VALUE_UNKNOWN" => Some(Self::Unknown),
658                "INTEGER" => Some(Self::Integer),
659                "INTEGER_TUPLE" => Some(Self::IntegerTuple),
660                "EVENT_DIGEST" => Some(Self::EventDigest),
661                _ => None,
662            }
663        }
664    }
665}
666/// A consensus object that wasn't changed during execution.
667#[non_exhaustive]
668#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
669pub struct UnchangedConsensusObject {
670    #[prost(
671        enumeration = "unchanged_consensus_object::UnchangedConsensusObjectKind",
672        optional,
673        tag = "1"
674    )]
675    pub kind: ::core::option::Option<i32>,
676    /// ObjectId of the consensus object.
677    #[prost(string, optional, tag = "2")]
678    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
679    /// Version of the consensus object.
680    #[prost(uint64, optional, tag = "3")]
681    pub version: ::core::option::Option<u64>,
682    /// Digest of the consensus object.
683    #[prost(string, optional, tag = "4")]
684    pub digest: ::core::option::Option<::prost::alloc::string::String>,
685    /// Type information is not provided by the effects structure but is instead
686    /// provided by an indexing layer
687    #[prost(string, optional, tag = "5")]
688    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
689}
690/// Nested message and enum types in `UnchangedConsensusObject`.
691pub mod unchanged_consensus_object {
692    #[non_exhaustive]
693    #[derive(
694        Clone,
695        Copy,
696        Debug,
697        PartialEq,
698        Eq,
699        Hash,
700        PartialOrd,
701        Ord,
702        ::prost::Enumeration
703    )]
704    #[repr(i32)]
705    pub enum UnchangedConsensusObjectKind {
706        Unknown = 0,
707        /// Read-only consensus object from the input.
708        ReadOnlyRoot = 1,
709        /// Objects with ended consensus streams that appear mutably/owned in the input.
710        MutateConsensusStreamEnded = 2,
711        /// Objects with ended consensus streams objects that appear as read-only in the input.
712        ReadConsensusStreamEnded = 3,
713        /// Consensus objects that were congested and resulted in this transaction being
714        /// canceled.
715        Canceled = 4,
716        /// Read of a per-epoch config object that should remain the same during an
717        /// epoch. This optionally will indicate the sequence number of the config
718        /// object at the start of the epoch.
719        PerEpochConfig = 5,
720    }
721    impl UnchangedConsensusObjectKind {
722        /// String value of the enum field names used in the ProtoBuf definition.
723        ///
724        /// The values are not transformed in any way and thus are considered stable
725        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
726        pub fn as_str_name(&self) -> &'static str {
727            match self {
728                Self::Unknown => "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN",
729                Self::ReadOnlyRoot => "READ_ONLY_ROOT",
730                Self::MutateConsensusStreamEnded => "MUTATE_CONSENSUS_STREAM_ENDED",
731                Self::ReadConsensusStreamEnded => "READ_CONSENSUS_STREAM_ENDED",
732                Self::Canceled => "CANCELED",
733                Self::PerEpochConfig => "PER_EPOCH_CONFIG",
734            }
735        }
736        /// Creates an enum from field names used in the ProtoBuf definition.
737        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
738            match value {
739                "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN" => Some(Self::Unknown),
740                "READ_ONLY_ROOT" => Some(Self::ReadOnlyRoot),
741                "MUTATE_CONSENSUS_STREAM_ENDED" => Some(Self::MutateConsensusStreamEnded),
742                "READ_CONSENSUS_STREAM_ENDED" => Some(Self::ReadConsensusStreamEnded),
743                "CANCELED" => Some(Self::Canceled),
744                "PER_EPOCH_CONFIG" => Some(Self::PerEpochConfig),
745                _ => None,
746            }
747        }
748    }
749}
750#[non_exhaustive]
751#[derive(Clone, PartialEq, ::prost::Message)]
752pub struct Epoch {
753    #[prost(uint64, optional, tag = "1")]
754    pub epoch: ::core::option::Option<u64>,
755    /// The committee governing this epoch.
756    #[prost(message, optional, tag = "2")]
757    pub committee: ::core::option::Option<ValidatorCommittee>,
758    /// Snapshot of Sui's SystemState (`0x3::sui_system::SystemState`) at the
759    /// beginning of the epoch, for past epochs, or the current state for the
760    /// current epoch.
761    #[prost(message, optional, boxed, tag = "3")]
762    pub system_state: ::core::option::Option<::prost::alloc::boxed::Box<SystemState>>,
763    #[prost(uint64, optional, tag = "4")]
764    pub first_checkpoint: ::core::option::Option<u64>,
765    #[prost(uint64, optional, tag = "5")]
766    pub last_checkpoint: ::core::option::Option<u64>,
767    #[prost(message, optional, tag = "6")]
768    pub start: ::core::option::Option<::prost_types::Timestamp>,
769    #[prost(message, optional, tag = "7")]
770    pub end: ::core::option::Option<::prost_types::Timestamp>,
771    /// Reference gas price denominated in MIST
772    #[prost(uint64, optional, tag = "8")]
773    pub reference_gas_price: ::core::option::Option<u64>,
774    #[prost(message, optional, tag = "9")]
775    pub protocol_config: ::core::option::Option<ProtocolConfig>,
776}
777#[non_exhaustive]
778#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
779#[repr(i32)]
780pub enum ErrorReason {
781    Unknown = 0,
782    FieldInvalid = 1,
783    FieldMissing = 2,
784}
785impl ErrorReason {
786    /// String value of the enum field names used in the ProtoBuf definition.
787    ///
788    /// The values are not transformed in any way and thus are considered stable
789    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
790    pub fn as_str_name(&self) -> &'static str {
791        match self {
792            Self::Unknown => "ERROR_REASON_UNKNOWN",
793            Self::FieldInvalid => "FIELD_INVALID",
794            Self::FieldMissing => "FIELD_MISSING",
795        }
796    }
797    /// Creates an enum from field names used in the ProtoBuf definition.
798    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
799        match value {
800            "ERROR_REASON_UNKNOWN" => Some(Self::Unknown),
801            "FIELD_INVALID" => Some(Self::FieldInvalid),
802            "FIELD_MISSING" => Some(Self::FieldMissing),
803            _ => None,
804        }
805    }
806}
807/// Events emitted during the successful execution of a transaction.
808#[non_exhaustive]
809#[derive(Clone, PartialEq, ::prost::Message)]
810pub struct TransactionEvents {
811    /// This TransactionEvents serialized as BCS.
812    #[prost(message, optional, tag = "1")]
813    pub bcs: ::core::option::Option<Bcs>,
814    /// The digest of this TransactionEvents.
815    #[prost(string, optional, tag = "2")]
816    pub digest: ::core::option::Option<::prost::alloc::string::String>,
817    /// Set of events emitted by a transaction.
818    #[prost(message, repeated, tag = "3")]
819    pub events: ::prost::alloc::vec::Vec<Event>,
820}
821/// An event.
822#[non_exhaustive]
823#[derive(Clone, PartialEq, ::prost::Message)]
824pub struct Event {
825    /// Package ID of the top-level function invoked by a `MoveCall` command that triggered this
826    /// event to be emitted.
827    #[prost(string, optional, tag = "1")]
828    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
829    /// Module name of the top-level function invoked by a `MoveCall` command that triggered this
830    /// event to be emitted.
831    #[prost(string, optional, tag = "2")]
832    pub module: ::core::option::Option<::prost::alloc::string::String>,
833    /// Address of the account that sent the transaction where this event was emitted.
834    #[prost(string, optional, tag = "3")]
835    pub sender: ::core::option::Option<::prost::alloc::string::String>,
836    /// The type of the event emitted.
837    #[prost(string, optional, tag = "4")]
838    pub event_type: ::core::option::Option<::prost::alloc::string::String>,
839    /// BCS serialized bytes of the event.
840    #[prost(message, optional, tag = "5")]
841    pub contents: ::core::option::Option<Bcs>,
842    /// JSON rendering of the event.
843    #[prost(message, optional, boxed, tag = "6")]
844    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
845    /// The sequence number of the checkpoint that includes the transaction
846    /// that emitted this event. Populated when the event is delivered on its
847    /// own (for example via `LedgerService.ListEvents`); left unset when the
848    /// event is carried inside its transaction's `events` list, where the
849    /// enclosing `ExecutedTransaction` already provides this context.
850    #[prost(uint64, optional, tag = "7")]
851    pub checkpoint: ::core::option::Option<u64>,
852    /// The digest of the transaction that emitted this event.
853    #[prost(string, optional, tag = "8")]
854    pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
855    /// Zero-based position of the emitting transaction within its containing
856    /// checkpoint. For clients verifying authenticated event streams this
857    /// index is part of the BCS-encoded `EventCommitment` leaf used to
858    /// construct the per-checkpoint merkle root.
859    #[prost(uint64, optional, tag = "9")]
860    pub transaction_index: ::core::option::Option<u64>,
861    /// Zero-based index of this event within its transaction's event list.
862    #[prost(uint32, optional, tag = "10")]
863    pub event_index: ::core::option::Option<u32>,
864}
865#[non_exhaustive]
866#[derive(Clone, PartialEq, ::prost::Message)]
867pub struct ExecutedTransaction {
868    /// The digest of this Transaction.
869    #[prost(string, optional, tag = "1")]
870    pub digest: ::core::option::Option<::prost::alloc::string::String>,
871    /// The transaction itself.
872    #[prost(message, optional, tag = "2")]
873    pub transaction: ::core::option::Option<Transaction>,
874    /// List of user signatures that are used to authorize the
875    /// execution of this transaction.
876    #[prost(message, repeated, tag = "3")]
877    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
878    /// The `TransactionEffects` for this transaction.
879    #[prost(message, optional, tag = "4")]
880    pub effects: ::core::option::Option<TransactionEffects>,
881    /// The `TransactionEvents` for this transaction.
882    ///
883    /// This field might be empty, even if it was explicitly requested, if the
884    /// transaction didn't produce any events.
885    /// `sui.types.TransactionEffects.events_digest` is populated if the
886    /// transaction produced any events.
887    #[prost(message, optional, tag = "5")]
888    pub events: ::core::option::Option<TransactionEvents>,
889    /// The sequence number for the checkpoint that includes this transaction.
890    #[prost(uint64, optional, tag = "6")]
891    pub checkpoint: ::core::option::Option<u64>,
892    /// The Unix timestamp of the checkpoint that includes this transaction.
893    #[prost(message, optional, tag = "7")]
894    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
895    #[prost(message, repeated, tag = "8")]
896    pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
897    /// Set of objects either referenced as inputs or produced as
898    /// outputs from this Transaction.
899    #[prost(message, optional, tag = "9")]
900    pub objects: ::core::option::Option<ObjectSet>,
901    /// Zero-based position of this transaction within the checkpoint that
902    /// includes it.
903    #[prost(uint64, optional, tag = "10")]
904    pub transaction_index: ::core::option::Option<u64>,
905}
906/// The status of an executed transaction.
907#[non_exhaustive]
908#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
909pub struct ExecutionStatus {
910    /// Indicates if the transaction was successful or not.
911    #[prost(bool, optional, tag = "1")]
912    pub success: ::core::option::Option<bool>,
913    /// The error if `success` is false.
914    #[prost(message, optional, tag = "2")]
915    pub error: ::core::option::Option<ExecutionError>,
916}
917/// An error that can occur during the execution of a transaction.
918#[non_exhaustive]
919#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
920pub struct ExecutionError {
921    /// A human readable description of the error
922    #[prost(string, optional, tag = "1")]
923    pub description: ::core::option::Option<::prost::alloc::string::String>,
924    /// The command, if any, during which the error occurred.
925    #[prost(uint64, optional, tag = "2")]
926    pub command: ::core::option::Option<u64>,
927    #[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
928    pub kind: ::core::option::Option<i32>,
929    #[prost(
930        oneof = "execution_error::ErrorDetails",
931        tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
932    )]
933    pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
934}
935/// Nested message and enum types in `ExecutionError`.
936pub mod execution_error {
937    #[non_exhaustive]
938    #[derive(
939        Clone,
940        Copy,
941        Debug,
942        PartialEq,
943        Eq,
944        Hash,
945        PartialOrd,
946        Ord,
947        ::prost::Enumeration
948    )]
949    #[repr(i32)]
950    pub enum ExecutionErrorKind {
951        Unknown = 0,
952        /// Insufficient gas.
953        InsufficientGas = 1,
954        /// Invalid `Gas` object.
955        InvalidGasObject = 2,
956        /// Invariant violation.
957        InvariantViolation = 3,
958        /// Attempted to use feature that is not supported yet.
959        FeatureNotYetSupported = 4,
960        /// Move object is larger than the maximum allowed size.
961        ObjectTooBig = 5,
962        /// Package is larger than the maximum allowed size.
963        PackageTooBig = 6,
964        /// Circular object ownership.
965        CircularObjectOwnership = 7,
966        /// Insufficient coin balance for requested operation.
967        InsufficientCoinBalance = 8,
968        /// Coin balance overflowed an u64.
969        CoinBalanceOverflow = 9,
970        /// Publish error, non-zero address.
971        /// The modules in the package must have their self-addresses set to zero.
972        PublishErrorNonZeroAddress = 10,
973        /// Sui Move bytecode verification error.
974        SuiMoveVerificationError = 11,
975        /// Error from a non-abort instruction.
976        /// Possible causes:
977        /// Arithmetic error, stack overflow, max value depth, or similar.
978        MovePrimitiveRuntimeError = 12,
979        /// Move runtime abort.
980        MoveAbort = 13,
981        /// Bytecode verification error.
982        VmVerificationOrDeserializationError = 14,
983        /// MoveVm invariant violation.
984        VmInvariantViolation = 15,
985        /// Function not found.
986        FunctionNotFound = 16,
987        /// Parity mismatch for Move function.
988        /// The number of arguments does not match the number of parameters.
989        ArityMismatch = 17,
990        /// Type parity mismatch for Move function.
991        /// Mismatch between the number of actual versus expected type arguments.
992        TypeArityMismatch = 18,
993        /// Non-entry function invoked. Move Call must start with an entry function.
994        NonEntryFunctionInvoked = 19,
995        /// Invalid command argument.
996        CommandArgumentError = 20,
997        /// Type argument error.
998        TypeArgumentError = 21,
999        /// Unused result without the drop ability.
1000        UnusedValueWithoutDrop = 22,
1001        /// Invalid public Move function signature.
1002        /// Unsupported return type for return value.
1003        InvalidPublicFunctionReturnType = 23,
1004        /// Invalid transfer object, object does not have public transfer.
1005        InvalidTransferObject = 24,
1006        /// Effects from the transaction are too large.
1007        EffectsTooLarge = 25,
1008        /// Publish or Upgrade is missing dependency.
1009        PublishUpgradeMissingDependency = 26,
1010        /// Publish or upgrade dependency downgrade.
1011        ///
1012        /// Indirect (transitive) dependency of published or upgraded package has been assigned an
1013        /// on-chain version that is less than the version required by one of the package's
1014        /// transitive dependencies.
1015        PublishUpgradeDependencyDowngrade = 27,
1016        /// Invalid package upgrade.
1017        PackageUpgradeError = 28,
1018        /// Indicates the transaction tried to write objects too large to storage.
1019        WrittenObjectsTooLarge = 29,
1020        /// Certificate is on the deny list.
1021        CertificateDenied = 30,
1022        /// Sui Move bytecode verification timed out.
1023        SuiMoveVerificationTimedout = 31,
1024        /// The requested consensus object operation is not allowed.
1025        ConsensusObjectOperationNotAllowed = 32,
1026        /// Requested consensus object has been deleted.
1027        InputObjectDeleted = 33,
1028        /// Certificate is canceled due to congestion on consensus objects.
1029        ExecutionCanceledDueToConsensusObjectCongestion = 34,
1030        /// Address is denied for this coin type.
1031        AddressDeniedForCoin = 35,
1032        /// Coin type is globally paused for use.
1033        CoinTypeGlobalPause = 36,
1034        /// Certificate is canceled because randomness could not be generated this epoch.
1035        ExecutionCanceledDueToRandomnessUnavailable = 37,
1036        /// Move vector element (passed to MakeMoveVec) with size {value_size} is larger
1037        /// than the maximum size {max_scaled_size}. Note that this maximum is scaled based on the
1038        /// type of the vector element.
1039        MoveVectorElemTooBig = 38,
1040        /// Move value (possibly an upgrade ticket or a dev-inspect value) with size {value_size}
1041        /// is larger than the maximum size  {max_scaled_size}. Note that this maximum is scaled based
1042        /// on the type of the value.
1043        MoveRawValueTooBig = 39,
1044        /// A valid linkage was unable to be determined for the transaction or one of its commands.
1045        InvalidLinkage = 40,
1046        /// Insufficient funds for transaction withdrawal
1047        InsufficientFundsForWithdraw = 41,
1048        /// An input object with non-exclusive write mutability was modified
1049        NonExclusiveWriteInputObjectModified = 42,
1050    }
1051    impl ExecutionErrorKind {
1052        /// String value of the enum field names used in the ProtoBuf definition.
1053        ///
1054        /// The values are not transformed in any way and thus are considered stable
1055        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1056        pub fn as_str_name(&self) -> &'static str {
1057            match self {
1058                Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
1059                Self::InsufficientGas => "INSUFFICIENT_GAS",
1060                Self::InvalidGasObject => "INVALID_GAS_OBJECT",
1061                Self::InvariantViolation => "INVARIANT_VIOLATION",
1062                Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
1063                Self::ObjectTooBig => "OBJECT_TOO_BIG",
1064                Self::PackageTooBig => "PACKAGE_TOO_BIG",
1065                Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
1066                Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
1067                Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
1068                Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
1069                Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
1070                Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
1071                Self::MoveAbort => "MOVE_ABORT",
1072                Self::VmVerificationOrDeserializationError => {
1073                    "VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
1074                }
1075                Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
1076                Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
1077                Self::ArityMismatch => "ARITY_MISMATCH",
1078                Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
1079                Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
1080                Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
1081                Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
1082                Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
1083                Self::InvalidPublicFunctionReturnType => {
1084                    "INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
1085                }
1086                Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1087                Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
1088                Self::PublishUpgradeMissingDependency => {
1089                    "PUBLISH_UPGRADE_MISSING_DEPENDENCY"
1090                }
1091                Self::PublishUpgradeDependencyDowngrade => {
1092                    "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
1093                }
1094                Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
1095                Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
1096                Self::CertificateDenied => "CERTIFICATE_DENIED",
1097                Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
1098                Self::ConsensusObjectOperationNotAllowed => {
1099                    "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1100                }
1101                Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
1102                Self::ExecutionCanceledDueToConsensusObjectCongestion => {
1103                    "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION"
1104                }
1105                Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
1106                Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
1107                Self::ExecutionCanceledDueToRandomnessUnavailable => {
1108                    "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
1109                }
1110                Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
1111                Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
1112                Self::InvalidLinkage => "INVALID_LINKAGE",
1113                Self::InsufficientFundsForWithdraw => "INSUFFICIENT_FUNDS_FOR_WITHDRAW",
1114                Self::NonExclusiveWriteInputObjectModified => {
1115                    "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED"
1116                }
1117            }
1118        }
1119        /// Creates an enum from field names used in the ProtoBuf definition.
1120        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1121            match value {
1122                "EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1123                "INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
1124                "INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
1125                "INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
1126                "FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
1127                "OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
1128                "PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
1129                "CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
1130                "INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
1131                "COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
1132                "PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
1133                    Some(Self::PublishErrorNonZeroAddress)
1134                }
1135                "SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
1136                "MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
1137                "MOVE_ABORT" => Some(Self::MoveAbort),
1138                "VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
1139                    Some(Self::VmVerificationOrDeserializationError)
1140                }
1141                "VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
1142                "FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
1143                "ARITY_MISMATCH" => Some(Self::ArityMismatch),
1144                "TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
1145                "NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
1146                "COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
1147                "TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
1148                "UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
1149                "INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
1150                    Some(Self::InvalidPublicFunctionReturnType)
1151                }
1152                "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1153                "EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
1154                "PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
1155                    Some(Self::PublishUpgradeMissingDependency)
1156                }
1157                "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
1158                    Some(Self::PublishUpgradeDependencyDowngrade)
1159                }
1160                "PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
1161                "WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
1162                "CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
1163                "SUI_MOVE_VERIFICATION_TIMEDOUT" => {
1164                    Some(Self::SuiMoveVerificationTimedout)
1165                }
1166                "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1167                    Some(Self::ConsensusObjectOperationNotAllowed)
1168                }
1169                "INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
1170                "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION" => {
1171                    Some(Self::ExecutionCanceledDueToConsensusObjectCongestion)
1172                }
1173                "ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
1174                "COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
1175                "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
1176                    Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
1177                }
1178                "MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
1179                "MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
1180                "INVALID_LINKAGE" => Some(Self::InvalidLinkage),
1181                "INSUFFICIENT_FUNDS_FOR_WITHDRAW" => {
1182                    Some(Self::InsufficientFundsForWithdraw)
1183                }
1184                "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED" => {
1185                    Some(Self::NonExclusiveWriteInputObjectModified)
1186                }
1187                _ => None,
1188            }
1189        }
1190    }
1191    #[non_exhaustive]
1192    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1193    pub enum ErrorDetails {
1194        #[prost(message, tag = "4")]
1195        Abort(super::MoveAbort),
1196        #[prost(message, tag = "5")]
1197        SizeError(super::SizeError),
1198        #[prost(message, tag = "6")]
1199        CommandArgumentError(super::CommandArgumentError),
1200        #[prost(message, tag = "7")]
1201        TypeArgumentError(super::TypeArgumentError),
1202        #[prost(message, tag = "8")]
1203        PackageUpgradeError(super::PackageUpgradeError),
1204        #[prost(message, tag = "9")]
1205        IndexError(super::IndexError),
1206        #[prost(string, tag = "10")]
1207        ObjectId(::prost::alloc::string::String),
1208        #[prost(message, tag = "11")]
1209        CoinDenyListError(super::CoinDenyListError),
1210        /// Set of objects that were congested, leading to the transaction's cancellation.
1211        #[prost(message, tag = "12")]
1212        CongestedObjects(super::CongestedObjects),
1213    }
1214}
1215#[non_exhaustive]
1216#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1217pub struct MoveAbort {
1218    #[prost(uint64, optional, tag = "1")]
1219    pub abort_code: ::core::option::Option<u64>,
1220    /// Location in Move where the error occurred.
1221    #[prost(message, optional, tag = "2")]
1222    pub location: ::core::option::Option<MoveLocation>,
1223    /// Extra error information if abort code is a "Clever Error"
1224    #[prost(message, optional, tag = "3")]
1225    pub clever_error: ::core::option::Option<CleverError>,
1226}
1227/// Location in Move bytecode where an error occurred.
1228#[non_exhaustive]
1229#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1230pub struct MoveLocation {
1231    /// The package ID.
1232    #[prost(string, optional, tag = "1")]
1233    pub package: ::core::option::Option<::prost::alloc::string::String>,
1234    /// The module name.
1235    #[prost(string, optional, tag = "2")]
1236    pub module: ::core::option::Option<::prost::alloc::string::String>,
1237    /// The function index.
1238    #[prost(uint32, optional, tag = "3")]
1239    pub function: ::core::option::Option<u32>,
1240    /// Offset of the instruction where the error occurred.
1241    #[prost(uint32, optional, tag = "4")]
1242    pub instruction: ::core::option::Option<u32>,
1243    /// The name of the function, if available.
1244    #[prost(string, optional, tag = "5")]
1245    pub function_name: ::core::option::Option<::prost::alloc::string::String>,
1246}
1247#[non_exhaustive]
1248#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1249pub struct CleverError {
1250    #[prost(uint64, optional, tag = "1")]
1251    pub error_code: ::core::option::Option<u64>,
1252    #[prost(uint64, optional, tag = "2")]
1253    pub line_number: ::core::option::Option<u64>,
1254    #[prost(string, optional, tag = "3")]
1255    pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
1256    #[prost(string, optional, tag = "4")]
1257    pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
1258    #[prost(oneof = "clever_error::Value", tags = "5, 6")]
1259    pub value: ::core::option::Option<clever_error::Value>,
1260}
1261/// Nested message and enum types in `CleverError`.
1262pub mod clever_error {
1263    #[non_exhaustive]
1264    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1265    pub enum Value {
1266        #[prost(string, tag = "5")]
1267        Rendered(::prost::alloc::string::String),
1268        #[prost(bytes, tag = "6")]
1269        Raw(::prost::bytes::Bytes),
1270    }
1271}
1272/// A size error.
1273#[non_exhaustive]
1274#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1275pub struct SizeError {
1276    /// The offending size.
1277    #[prost(uint64, optional, tag = "1")]
1278    pub size: ::core::option::Option<u64>,
1279    /// The maximum allowable size.
1280    #[prost(uint64, optional, tag = "2")]
1281    pub max_size: ::core::option::Option<u64>,
1282}
1283#[non_exhaustive]
1284#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1285pub struct IndexError {
1286    /// Index of an input or result.
1287    #[prost(uint32, optional, tag = "1")]
1288    pub index: ::core::option::Option<u32>,
1289    /// Index of a subresult.
1290    #[prost(uint32, optional, tag = "2")]
1291    pub subresult: ::core::option::Option<u32>,
1292}
1293#[non_exhaustive]
1294#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1295pub struct CoinDenyListError {
1296    /// Denied address.
1297    #[prost(string, optional, tag = "1")]
1298    pub address: ::core::option::Option<::prost::alloc::string::String>,
1299    /// Coin type.
1300    #[prost(string, optional, tag = "2")]
1301    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1302}
1303/// Set of objects that were congested, leading to the transaction's cancellation.
1304#[non_exhaustive]
1305#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1306pub struct CongestedObjects {
1307    #[prost(string, repeated, tag = "1")]
1308    pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1309}
1310/// An error with an argument to a command.
1311#[non_exhaustive]
1312#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1313pub struct CommandArgumentError {
1314    /// Position of the problematic argument.
1315    #[prost(uint32, optional, tag = "1")]
1316    pub argument: ::core::option::Option<u32>,
1317    #[prost(
1318        enumeration = "command_argument_error::CommandArgumentErrorKind",
1319        optional,
1320        tag = "2"
1321    )]
1322    pub kind: ::core::option::Option<i32>,
1323    #[prost(message, optional, tag = "3")]
1324    pub index_error: ::core::option::Option<IndexError>,
1325}
1326/// Nested message and enum types in `CommandArgumentError`.
1327pub mod command_argument_error {
1328    #[non_exhaustive]
1329    #[derive(
1330        Clone,
1331        Copy,
1332        Debug,
1333        PartialEq,
1334        Eq,
1335        Hash,
1336        PartialOrd,
1337        Ord,
1338        ::prost::Enumeration
1339    )]
1340    #[repr(i32)]
1341    pub enum CommandArgumentErrorKind {
1342        Unknown = 0,
1343        /// The type of the value does not match the expected type.
1344        TypeMismatch = 1,
1345        /// The argument cannot be deserialized into a value of the specified type.
1346        InvalidBcsBytes = 2,
1347        /// The argument cannot be instantiated from raw bytes.
1348        InvalidUsageOfPureArgument = 3,
1349        /// Invalid argument to private entry function.
1350        /// Private entry functions cannot take arguments from other Move functions.
1351        InvalidArgumentToPrivateEntryFunction = 4,
1352        /// Out of bounds access to input or results.
1353        ///
1354        /// `index` field will be set indicating the invalid index value.
1355        IndexOutOfBounds = 5,
1356        /// Out of bounds access to subresult.
1357        ///
1358        /// `index` and `subresult` fields will be set indicating the invalid index value.
1359        SecondaryIndexOutOfBounds = 6,
1360        /// Invalid usage of result.
1361        /// Expected a single result but found either no return value or multiple.
1362        /// `index` field will be set indicating the invalid index value.
1363        InvalidResultArity = 7,
1364        /// Invalid usage of gas coin.
1365        /// The gas coin can only be used by-value with a `TransferObject` command.
1366        InvalidGasCoinUsage = 8,
1367        /// Invalid usage of Move value.
1368        /// - Mutably borrowed values require unique usage.
1369        /// - Immutably borrowed values cannot be taken or borrowed mutably.
1370        /// - Taken values cannot be used again.
1371        InvalidValueUsage = 9,
1372        /// Immutable objects cannot be passed by-value.
1373        InvalidObjectByValue = 10,
1374        /// Immutable objects cannot be passed by mutable reference, `&mut`.
1375        InvalidObjectByMutRef = 11,
1376        /// Consensus object operations such as wrapping, freezing, or converting to owned are not
1377        /// allowed.
1378        ConsensusObjectOperationNotAllowed = 12,
1379        /// Invalid argument arity. Expected a single argument but found a result that expanded to
1380        /// multiple arguments.
1381        InvalidArgumentArity = 13,
1382        /// Object passed to TransferObject does not have public transfer, i.e. the `store` ability
1383        InvalidTransferObject = 14,
1384        /// First argument to MakeMoveVec is not an object. If no type is specified for MakeMoveVec,
1385        /// all arguments must be the same object type.
1386        InvalidMakeMoveVecNonObjectArgument = 15,
1387        /// Specified argument location does not have a value and cannot be used
1388        ArgumentWithoutValue = 16,
1389        /// Cannot move a borrowed value. The value's type does resulted in this argument usage being
1390        /// inferred as a move. This is likely due to the type not having the `copy` ability; although
1391        /// in rare cases, it could also be this is the last usage of a value without the `drop`
1392        /// ability.
1393        CannotMoveBorrowedValue = 17,
1394        /// Cannot write to an argument location that is still borrowed, and where that borrow is an
1395        /// extension of that reference. This is likely due to this argument being used in a Move call
1396        /// that returns a reference, and that reference is used in a later command.
1397        CannotWriteToExtendedReference = 18,
1398        /// The argument specified cannot be used as a reference argument in the Move call. Either the
1399        /// argument is a mutable reference and it conflicts with another argument to the call, or the
1400        /// argument is mutable and another reference extends it and will be used in a later command.
1401        InvalidReferenceArgument = 19,
1402        /// Invalid usage of TxContext in the function signature. TxContext can only be used by
1403        /// reference, `&TxContext` or `&mut TxContext`. If used mutably, it must be the only
1404        /// TxContext parameter, and TxContext can never be returned from a Move call.
1405        InvalidTxContext = 20,
1406    }
1407    impl CommandArgumentErrorKind {
1408        /// String value of the enum field names used in the ProtoBuf definition.
1409        ///
1410        /// The values are not transformed in any way and thus are considered stable
1411        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1412        pub fn as_str_name(&self) -> &'static str {
1413            match self {
1414                Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1415                Self::TypeMismatch => "TYPE_MISMATCH",
1416                Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1417                Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1418                Self::InvalidArgumentToPrivateEntryFunction => {
1419                    "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1420                }
1421                Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1422                Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1423                Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1424                Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1425                Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1426                Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1427                Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1428                Self::ConsensusObjectOperationNotAllowed => {
1429                    "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1430                }
1431                Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1432                Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1433                Self::InvalidMakeMoveVecNonObjectArgument => {
1434                    "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1435                }
1436                Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1437                Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1438                Self::CannotWriteToExtendedReference => {
1439                    "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1440                }
1441                Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1442                Self::InvalidTxContext => "INVALID_TX_CONTEXT",
1443            }
1444        }
1445        /// Creates an enum from field names used in the ProtoBuf definition.
1446        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1447            match value {
1448                "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1449                "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1450                "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1451                "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1452                    Some(Self::InvalidUsageOfPureArgument)
1453                }
1454                "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1455                    Some(Self::InvalidArgumentToPrivateEntryFunction)
1456                }
1457                "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1458                "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1459                "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1460                "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1461                "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1462                "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1463                "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1464                "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1465                    Some(Self::ConsensusObjectOperationNotAllowed)
1466                }
1467                "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1468                "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1469                "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1470                    Some(Self::InvalidMakeMoveVecNonObjectArgument)
1471                }
1472                "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1473                "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1474                "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1475                    Some(Self::CannotWriteToExtendedReference)
1476                }
1477                "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1478                "INVALID_TX_CONTEXT" => Some(Self::InvalidTxContext),
1479                _ => None,
1480            }
1481        }
1482    }
1483}
1484/// An error with upgrading a package.
1485#[non_exhaustive]
1486#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1487pub struct PackageUpgradeError {
1488    #[prost(
1489        enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1490        optional,
1491        tag = "1"
1492    )]
1493    pub kind: ::core::option::Option<i32>,
1494    /// The Package Id.
1495    #[prost(string, optional, tag = "2")]
1496    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1497    /// A digest.
1498    #[prost(string, optional, tag = "3")]
1499    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1500    /// The policy.
1501    #[prost(uint32, optional, tag = "4")]
1502    pub policy: ::core::option::Option<u32>,
1503    /// The ticket Id.
1504    #[prost(string, optional, tag = "5")]
1505    pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1506}
1507/// Nested message and enum types in `PackageUpgradeError`.
1508pub mod package_upgrade_error {
1509    #[non_exhaustive]
1510    #[derive(
1511        Clone,
1512        Copy,
1513        Debug,
1514        PartialEq,
1515        Eq,
1516        Hash,
1517        PartialOrd,
1518        Ord,
1519        ::prost::Enumeration
1520    )]
1521    #[repr(i32)]
1522    pub enum PackageUpgradeErrorKind {
1523        Unknown = 0,
1524        /// Unable to fetch package.
1525        UnableToFetchPackage = 1,
1526        /// Object is not a package.
1527        NotAPackage = 2,
1528        /// Package upgrade is incompatible with previous version.
1529        IncompatibleUpgrade = 3,
1530        /// Digest in upgrade ticket and computed digest differ.
1531        DigestDoesNotMatch = 4,
1532        /// Upgrade policy is not valid.
1533        UnknownUpgradePolicy = 5,
1534        /// Package ID does not match `PackageId` in upgrade ticket.
1535        PackageIdDoesNotMatch = 6,
1536    }
1537    impl PackageUpgradeErrorKind {
1538        /// String value of the enum field names used in the ProtoBuf definition.
1539        ///
1540        /// The values are not transformed in any way and thus are considered stable
1541        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1542        pub fn as_str_name(&self) -> &'static str {
1543            match self {
1544                Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1545                Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1546                Self::NotAPackage => "NOT_A_PACKAGE",
1547                Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1548                Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1549                Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1550                Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1551            }
1552        }
1553        /// Creates an enum from field names used in the ProtoBuf definition.
1554        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1555            match value {
1556                "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1557                "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1558                "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1559                "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1560                "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1561                "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1562                "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1563                _ => None,
1564            }
1565        }
1566    }
1567}
1568/// Type argument error.
1569#[non_exhaustive]
1570#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1571pub struct TypeArgumentError {
1572    /// Index of the problematic type argument.
1573    #[prost(uint32, optional, tag = "1")]
1574    pub type_argument: ::core::option::Option<u32>,
1575    #[prost(
1576        enumeration = "type_argument_error::TypeArgumentErrorKind",
1577        optional,
1578        tag = "2"
1579    )]
1580    pub kind: ::core::option::Option<i32>,
1581}
1582/// Nested message and enum types in `TypeArgumentError`.
1583pub mod type_argument_error {
1584    #[non_exhaustive]
1585    #[derive(
1586        Clone,
1587        Copy,
1588        Debug,
1589        PartialEq,
1590        Eq,
1591        Hash,
1592        PartialOrd,
1593        Ord,
1594        ::prost::Enumeration
1595    )]
1596    #[repr(i32)]
1597    pub enum TypeArgumentErrorKind {
1598        Unknown = 0,
1599        /// A type was not found in the module specified.
1600        TypeNotFound = 1,
1601        /// A type provided did not match the specified constraint.
1602        ConstraintNotSatisfied = 2,
1603    }
1604    impl TypeArgumentErrorKind {
1605        /// String value of the enum field names used in the ProtoBuf definition.
1606        ///
1607        /// The values are not transformed in any way and thus are considered stable
1608        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1609        pub fn as_str_name(&self) -> &'static str {
1610            match self {
1611                Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1612                Self::TypeNotFound => "TYPE_NOT_FOUND",
1613                Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1614            }
1615        }
1616        /// Creates an enum from field names used in the ProtoBuf definition.
1617        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1618            match value {
1619                "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1620                "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1621                "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1622                _ => None,
1623            }
1624        }
1625    }
1626}
1627/// DNF filter for transactions: any term may match, and each term is an AND
1628/// of signed literals.
1629/// An absent filter matches everything. A present filter must have at least one
1630/// term.
1631#[derive(Eq, Hash)]
1632#[non_exhaustive]
1633#[derive(Clone, PartialEq, ::prost::Message)]
1634pub struct TransactionFilter {
1635    /// Terms are ORed together.
1636    #[prost(message, repeated, tag = "1")]
1637    pub terms: ::prost::alloc::vec::Vec<TransactionTerm>,
1638}
1639/// One conjunction in a transaction DNF filter.
1640#[derive(Eq, Hash)]
1641#[non_exhaustive]
1642#[derive(Clone, PartialEq, ::prost::Message)]
1643pub struct TransactionTerm {
1644    /// Literals are ANDed together.
1645    #[prost(message, repeated, tag = "1")]
1646    pub literals: ::prost::alloc::vec::Vec<TransactionLiteral>,
1647}
1648/// One signed transaction predicate literal: a predicate, optionally negated.
1649#[non_exhaustive]
1650#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1651pub struct TransactionLiteral {
1652    /// When true, the literal matches transactions that the predicate does *not*
1653    /// match.
1654    #[prost(bool, tag = "1")]
1655    pub negated: bool,
1656    /// The transaction-index predicate to match.
1657    #[prost(oneof = "transaction_literal::Predicate", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
1658    pub predicate: ::core::option::Option<transaction_literal::Predicate>,
1659}
1660/// Nested message and enum types in `TransactionLiteral`.
1661pub mod transaction_literal {
1662    /// The transaction-index predicate to match.
1663    #[non_exhaustive]
1664    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1665    pub enum Predicate {
1666        /// Match transactions sent by the specified address.
1667        #[prost(message, tag = "2")]
1668        Sender(super::SenderFilter),
1669        /// Match transactions where the specified address's state moved as a side
1670        /// effect: it owns an object after the txn, owned an object before the
1671        /// txn that was mutated/transferred away/deleted/wrapped, or its
1672        /// address-balance changed via an accumulator event.
1673        #[prost(message, tag = "3")]
1674        AffectedAddress(super::AffectedAddressFilter),
1675        /// Match transactions whose effects include a change for the specified
1676        /// object.
1677        #[prost(message, tag = "4")]
1678        AffectedObject(super::AffectedObjectFilter),
1679        /// Match transactions that made a Move call matching the specified filter.
1680        #[prost(message, tag = "5")]
1681        MoveCall(super::MoveCallFilter),
1682        /// Match transactions that emitted an event whose package/module fields
1683        /// match the specified filter.
1684        #[prost(message, tag = "6")]
1685        EmitModule(super::EmitModuleFilter),
1686        /// Match transactions that emitted an event with a type matching the
1687        /// specified filter.
1688        #[prost(message, tag = "7")]
1689        EventType(super::EventTypeFilter),
1690        /// Match transactions that wrote to the specified authenticated event
1691        /// stream head.
1692        #[prost(message, tag = "8")]
1693        EventStreamHead(super::EventStreamHeadFilter),
1694        /// Match transactions that wrote a Move package — a first publish or an
1695        /// upgrade, of any package.
1696        #[prost(message, tag = "9")]
1697        PackageWrite(super::PackageWriteFilter),
1698    }
1699}
1700/// DNF filter for events: any term may match, and each term is an AND of
1701/// signed literals. Sender predicates match all events from matching
1702/// transactions; emit-module, event-type, and event-stream-head predicates match
1703/// individual event-space dimensions. An absent filter matches everything. A
1704/// present filter must have at least one term.
1705#[non_exhaustive]
1706#[derive(Clone, PartialEq, ::prost::Message)]
1707pub struct EventFilter {
1708    /// Terms are ORed together.
1709    #[prost(message, repeated, tag = "1")]
1710    pub terms: ::prost::alloc::vec::Vec<EventTerm>,
1711}
1712/// One conjunction in an event DNF filter.
1713#[non_exhaustive]
1714#[derive(Clone, PartialEq, ::prost::Message)]
1715pub struct EventTerm {
1716    /// Literals are ANDed together.
1717    #[prost(message, repeated, tag = "1")]
1718    pub literals: ::prost::alloc::vec::Vec<EventLiteral>,
1719}
1720/// One signed event predicate literal: a predicate, optionally negated.
1721#[non_exhaustive]
1722#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1723pub struct EventLiteral {
1724    /// When true, the literal matches events that the predicate does *not* match.
1725    #[prost(bool, tag = "1")]
1726    pub negated: bool,
1727    /// The event-index predicate to match.
1728    #[prost(oneof = "event_literal::Predicate", tags = "2, 3, 4, 5")]
1729    pub predicate: ::core::option::Option<event_literal::Predicate>,
1730}
1731/// Nested message and enum types in `EventLiteral`.
1732pub mod event_literal {
1733    /// The event-index predicate to match.
1734    #[non_exhaustive]
1735    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1736    pub enum Predicate {
1737        /// Match events from transactions sent by the specified address.
1738        #[prost(message, tag = "2")]
1739        Sender(super::SenderFilter),
1740        /// Match events whose package/module fields match the specified filter.
1741        #[prost(message, tag = "3")]
1742        EmitModule(super::EmitModuleFilter),
1743        /// Match events whose type matches the specified filter.
1744        #[prost(message, tag = "4")]
1745        EventType(super::EventTypeFilter),
1746        /// Match events committed to the specified authenticated event stream head.
1747        #[prost(message, tag = "5")]
1748        EventStreamHead(super::EventStreamHeadFilter),
1749    }
1750}
1751/// Match by transaction sender address.
1752#[non_exhaustive]
1753#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1754pub struct SenderFilter {
1755    /// The sender address (hex-encoded).
1756    #[prost(string, optional, tag = "1")]
1757    pub address: ::core::option::Option<::prost::alloc::string::String>,
1758}
1759/// Match by any address whose state moved as a side effect of the
1760/// transaction: object ownership changes (in either direction), prior
1761/// owners of removed/wrapped objects, and address-balance changes via
1762/// accumulator events.
1763#[non_exhaustive]
1764#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1765pub struct AffectedAddressFilter {
1766    /// The affected address (hex-encoded).
1767    #[prost(string, optional, tag = "1")]
1768    pub address: ::core::option::Option<::prost::alloc::string::String>,
1769}
1770/// Match by changed object ID.
1771#[non_exhaustive]
1772#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1773pub struct AffectedObjectFilter {
1774    /// The changed object ID (hex-encoded).
1775    #[prost(string, optional, tag = "1")]
1776    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1777}
1778/// Match by Move function call, specified as a `::`-delimited Move path.
1779///
1780/// Specificity levels:
1781/// "0xpkg"                        -> matches any call in the package
1782/// "0xpkg::module"                -> matches any call in the module
1783/// "0xpkg::module::function"      -> matches calls to the exact function
1784#[non_exhaustive]
1785#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1786pub struct MoveCallFilter {
1787    /// Required. Move path of the form `package\[::module[::function]\]`.
1788    #[prost(string, optional, tag = "1")]
1789    pub function: ::core::option::Option<::prost::alloc::string::String>,
1790}
1791/// Match by an event's package/module fields, specified as a `::`-delimited
1792/// Move path. These identify the top-level Move call that triggered the event.
1793///
1794/// Specificity levels:
1795/// "0xpkg"               -> matches events with this package_id
1796/// "0xpkg::module"       -> matches events with this package_id and module
1797#[non_exhaustive]
1798#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1799pub struct EmitModuleFilter {
1800    /// Required. Move path of the form `package\[::module\]`.
1801    #[prost(string, optional, tag = "1")]
1802    pub module: ::core::option::Option<::prost::alloc::string::String>,
1803}
1804/// Match by event struct type, specified as a Move type string.
1805///
1806/// Specificity levels:
1807/// "0xaddr"                              -> matches events whose type is defined at this address
1808/// "0xaddr::module"                      -> matches events whose type is in this module
1809/// "0xaddr::module::Name"                -> matches events with this type name (any instantiation)
1810/// "0xaddr::module::Name\<T1, T2>"        -> matches events with this exact generic instantiation
1811#[non_exhaustive]
1812#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1813pub struct EventTypeFilter {
1814    /// Required. Move type string of the form
1815    /// `address\[::module[::Name[<type_params>]\]]`.
1816    #[prost(string, optional, tag = "1")]
1817    pub event_type: ::core::option::Option<::prost::alloc::string::String>,
1818}
1819/// Match by authenticated event stream head.
1820#[non_exhaustive]
1821#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1822pub struct EventStreamHeadFilter {
1823    /// The stream id address (hex-encoded).
1824    #[prost(string, optional, tag = "1")]
1825    pub stream_id: ::core::option::Option<::prost::alloc::string::String>,
1826}
1827/// Match transactions that wrote a Move package.
1828#[non_exhaustive]
1829#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1830pub struct PackageWriteFilter {}
1831/// Summary of gas charges.
1832#[non_exhaustive]
1833#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1834pub struct GasCostSummary {
1835    /// Cost of computation/execution.
1836    #[prost(uint64, optional, tag = "1")]
1837    pub computation_cost: ::core::option::Option<u64>,
1838    /// Storage cost, it's the sum of all storage cost for all objects created or mutated.
1839    #[prost(uint64, optional, tag = "2")]
1840    pub storage_cost: ::core::option::Option<u64>,
1841    /// The amount of storage cost refunded to the user for all objects deleted or mutated in the
1842    /// transaction.
1843    #[prost(uint64, optional, tag = "3")]
1844    pub storage_rebate: ::core::option::Option<u64>,
1845    /// The fee for the rebate. The portion of the storage rebate kept by the system.
1846    #[prost(uint64, optional, tag = "4")]
1847    pub non_refundable_storage_fee: ::core::option::Option<u64>,
1848}
1849/// An input to a user transaction.
1850#[non_exhaustive]
1851#[derive(Clone, PartialEq, ::prost::Message)]
1852pub struct Input {
1853    #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1854    pub kind: ::core::option::Option<i32>,
1855    /// A move value serialized as BCS.
1856    ///
1857    /// For normal operations this is required to be a move primitive type and not contain structs
1858    /// or objects.
1859    #[prost(bytes = "bytes", optional, tag = "2")]
1860    pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1861    /// `ObjectId` of the object input.
1862    #[prost(string, optional, tag = "3")]
1863    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1864    /// Requested version of the input object when `kind` is `IMMUTABLE_OR_OWNED`
1865    /// or `RECEIVING` or if `kind` is `SHARED` this is the initial version of the
1866    /// object when it was shared
1867    #[prost(uint64, optional, tag = "4")]
1868    pub version: ::core::option::Option<u64>,
1869    /// The digest of this object.
1870    #[prost(string, optional, tag = "5")]
1871    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1872    /// Controls whether the caller asks for a mutable reference to the shared
1873    /// object.
1874    #[prost(bool, optional, tag = "6")]
1875    pub mutable: ::core::option::Option<bool>,
1876    /// NOTE: For backwards compatibility purposes the addition of the new
1877    /// `NON_EXCLUSIVE_WRITE` mutability variant requires providing a new field.
1878    /// The old `mutable` field will continue to be populated and respected as an
1879    /// input for the time being.
1880    #[prost(enumeration = "input::Mutability", optional, tag = "7")]
1881    pub mutability: ::core::option::Option<i32>,
1882    /// Fund Reservation information if `kind` is `FUNDS_WITHDRAWAL`.
1883    #[prost(message, optional, tag = "8")]
1884    pub funds_withdrawal: ::core::option::Option<FundsWithdrawal>,
1885    /// A literal value
1886    ///
1887    /// INPUT ONLY
1888    #[prost(message, optional, boxed, tag = "1000")]
1889    pub literal: ::core::option::Option<
1890        ::prost::alloc::boxed::Box<::prost_types::Value>,
1891    >,
1892}
1893/// Nested message and enum types in `Input`.
1894pub mod input {
1895    #[non_exhaustive]
1896    #[derive(
1897        Clone,
1898        Copy,
1899        Debug,
1900        PartialEq,
1901        Eq,
1902        Hash,
1903        PartialOrd,
1904        Ord,
1905        ::prost::Enumeration
1906    )]
1907    #[repr(i32)]
1908    pub enum InputKind {
1909        Unknown = 0,
1910        /// A move value serialized as BCS.
1911        Pure = 1,
1912        /// A Move object that is either immutable or address owned.
1913        ImmutableOrOwned = 2,
1914        /// A Move object whose owner is "Shared".
1915        Shared = 3,
1916        /// A Move object that is attempted to be received in this transaction.
1917        Receiving = 4,
1918        /// Reservation to withdraw balance from a funds accumulator
1919        FundsWithdrawal = 5,
1920    }
1921    impl InputKind {
1922        /// String value of the enum field names used in the ProtoBuf definition.
1923        ///
1924        /// The values are not transformed in any way and thus are considered stable
1925        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1926        pub fn as_str_name(&self) -> &'static str {
1927            match self {
1928                Self::Unknown => "INPUT_KIND_UNKNOWN",
1929                Self::Pure => "PURE",
1930                Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
1931                Self::Shared => "SHARED",
1932                Self::Receiving => "RECEIVING",
1933                Self::FundsWithdrawal => "FUNDS_WITHDRAWAL",
1934            }
1935        }
1936        /// Creates an enum from field names used in the ProtoBuf definition.
1937        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1938            match value {
1939                "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
1940                "PURE" => Some(Self::Pure),
1941                "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
1942                "SHARED" => Some(Self::Shared),
1943                "RECEIVING" => Some(Self::Receiving),
1944                "FUNDS_WITHDRAWAL" => Some(Self::FundsWithdrawal),
1945                _ => None,
1946            }
1947        }
1948    }
1949    #[non_exhaustive]
1950    #[derive(
1951        Clone,
1952        Copy,
1953        Debug,
1954        PartialEq,
1955        Eq,
1956        Hash,
1957        PartialOrd,
1958        Ord,
1959        ::prost::Enumeration
1960    )]
1961    #[repr(i32)]
1962    pub enum Mutability {
1963        Unknown = 0,
1964        Immutable = 1,
1965        Mutable = 2,
1966        /// Non-exclusive write is used to allow multiple transactions to
1967        /// simultaneously add disjoint dynamic fields to an object.
1968        /// (Currently only used by settlement transactions).
1969        NonExclusiveWrite = 3,
1970    }
1971    impl Mutability {
1972        /// String value of the enum field names used in the ProtoBuf definition.
1973        ///
1974        /// The values are not transformed in any way and thus are considered stable
1975        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1976        pub fn as_str_name(&self) -> &'static str {
1977            match self {
1978                Self::Unknown => "MUTABILITY_UNKNOWN",
1979                Self::Immutable => "IMMUTABLE",
1980                Self::Mutable => "MUTABLE",
1981                Self::NonExclusiveWrite => "NON_EXCLUSIVE_WRITE",
1982            }
1983        }
1984        /// Creates an enum from field names used in the ProtoBuf definition.
1985        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1986            match value {
1987                "MUTABILITY_UNKNOWN" => Some(Self::Unknown),
1988                "IMMUTABLE" => Some(Self::Immutable),
1989                "MUTABLE" => Some(Self::Mutable),
1990                "NON_EXCLUSIVE_WRITE" => Some(Self::NonExclusiveWrite),
1991                _ => None,
1992            }
1993        }
1994    }
1995}
1996#[non_exhaustive]
1997#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1998pub struct FundsWithdrawal {
1999    #[prost(uint64, optional, tag = "1")]
2000    pub amount: ::core::option::Option<u64>,
2001    #[prost(string, optional, tag = "2")]
2002    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
2003    #[prost(enumeration = "funds_withdrawal::Source", optional, tag = "3")]
2004    pub source: ::core::option::Option<i32>,
2005    /// The address whose balance is debited if `source` is `SENDER_ALLOWANCE`.
2006    #[prost(string, optional, tag = "4")]
2007    pub funder: ::core::option::Option<::prost::alloc::string::String>,
2008    /// `ObjectId` of the allowance object authorizing the withdrawal if `source`
2009    /// is `SENDER_ALLOWANCE`.
2010    #[prost(string, optional, tag = "5")]
2011    pub allowance: ::core::option::Option<::prost::alloc::string::String>,
2012}
2013/// Nested message and enum types in `FundsWithdrawal`.
2014pub mod funds_withdrawal {
2015    #[non_exhaustive]
2016    #[derive(
2017        Clone,
2018        Copy,
2019        Debug,
2020        PartialEq,
2021        Eq,
2022        Hash,
2023        PartialOrd,
2024        Ord,
2025        ::prost::Enumeration
2026    )]
2027    #[repr(i32)]
2028    pub enum Source {
2029        Unknown = 0,
2030        Sender = 1,
2031        Sponsor = 2,
2032        /// Withdraw from `funder`'s balance under the `allowance` object, granted
2033        /// to the sender of the transaction.
2034        SenderAllowance = 3,
2035    }
2036    impl Source {
2037        /// String value of the enum field names used in the ProtoBuf definition.
2038        ///
2039        /// The values are not transformed in any way and thus are considered stable
2040        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2041        pub fn as_str_name(&self) -> &'static str {
2042            match self {
2043                Self::Unknown => "SOURCE_UNKNOWN",
2044                Self::Sender => "SENDER",
2045                Self::Sponsor => "SPONSOR",
2046                Self::SenderAllowance => "SENDER_ALLOWANCE",
2047            }
2048        }
2049        /// Creates an enum from field names used in the ProtoBuf definition.
2050        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2051            match value {
2052                "SOURCE_UNKNOWN" => Some(Self::Unknown),
2053                "SENDER" => Some(Self::Sender),
2054                "SPONSOR" => Some(Self::Sponsor),
2055                "SENDER_ALLOWANCE" => Some(Self::SenderAllowance),
2056                _ => None,
2057            }
2058        }
2059    }
2060}
2061/// Key to uniquely identify a JWK.
2062#[non_exhaustive]
2063#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2064pub struct JwkId {
2065    /// The issuer or identity of the OIDC provider.
2066    #[prost(string, optional, tag = "1")]
2067    pub iss: ::core::option::Option<::prost::alloc::string::String>,
2068    /// A key ID used to uniquely identify a key from an OIDC provider.
2069    #[prost(string, optional, tag = "2")]
2070    pub kid: ::core::option::Option<::prost::alloc::string::String>,
2071}
2072/// A JSON web key.
2073///
2074/// Struct that contains info for a JWK. A list of them for different kinds can
2075/// be retrieved from the JWK endpoint (for example, <<https://www.googleapis.com/oauth2/v3/certs>>).
2076/// The JWK is used to verify the JWT token.
2077#[non_exhaustive]
2078#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2079pub struct Jwk {
2080    /// Key type parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.1.>
2081    #[prost(string, optional, tag = "1")]
2082    pub kty: ::core::option::Option<::prost::alloc::string::String>,
2083    /// RSA public exponent, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
2084    #[prost(string, optional, tag = "2")]
2085    pub e: ::core::option::Option<::prost::alloc::string::String>,
2086    /// RSA modulus, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
2087    #[prost(string, optional, tag = "3")]
2088    pub n: ::core::option::Option<::prost::alloc::string::String>,
2089    /// Algorithm parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.4.>
2090    #[prost(string, optional, tag = "4")]
2091    pub alg: ::core::option::Option<::prost::alloc::string::String>,
2092}
2093#[non_exhaustive]
2094#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2095pub struct GetServiceInfoRequest {}
2096#[non_exhaustive]
2097#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2098pub struct GetServiceInfoResponse {
2099    /// The chain identifier of the chain that this node is on.
2100    ///
2101    /// The chain identifier is the digest of the genesis checkpoint, the
2102    /// checkpoint with sequence number 0.
2103    #[prost(string, optional, tag = "1")]
2104    pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
2105    /// Human-readable name of the chain that this node is on.
2106    ///
2107    /// This is intended to be a human-readable name like `mainnet`, `testnet`, and so on.
2108    #[prost(string, optional, tag = "2")]
2109    pub chain: ::core::option::Option<::prost::alloc::string::String>,
2110    /// Current epoch of the node based on its highest executed checkpoint.
2111    #[prost(uint64, optional, tag = "3")]
2112    pub epoch: ::core::option::Option<u64>,
2113    /// Checkpoint height of the most recently executed checkpoint.
2114    #[prost(uint64, optional, tag = "4")]
2115    pub checkpoint_height: ::core::option::Option<u64>,
2116    /// Unix timestamp of the most recently executed checkpoint.
2117    #[prost(message, optional, tag = "5")]
2118    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
2119    /// The lowest checkpoint for which checkpoints and transaction data are available.
2120    #[prost(uint64, optional, tag = "6")]
2121    pub lowest_available_checkpoint: ::core::option::Option<u64>,
2122    /// The lowest checkpoint for which object data is available.
2123    #[prost(uint64, optional, tag = "7")]
2124    pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
2125    /// Software version of the service. Similar to the `server` http header.
2126    #[prost(string, optional, tag = "8")]
2127    pub server: ::core::option::Option<::prost::alloc::string::String>,
2128}
2129#[non_exhaustive]
2130#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2131pub struct GetObjectRequest {
2132    /// Required. The `ObjectId` of the requested object.
2133    #[prost(string, optional, tag = "1")]
2134    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2135    /// Request a specific version of the object.
2136    /// If no version is specified, and the object is live, then the latest
2137    /// version of the object is returned.
2138    #[prost(uint64, optional, tag = "2")]
2139    pub version: ::core::option::Option<u64>,
2140    /// Mask specifying which fields to read.
2141    /// If no mask is specified, defaults to `object_id,version,digest`.
2142    #[prost(message, optional, tag = "3")]
2143    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2144}
2145#[non_exhaustive]
2146#[derive(Clone, PartialEq, ::prost::Message)]
2147pub struct GetObjectResponse {
2148    #[prost(message, optional, tag = "1")]
2149    pub object: ::core::option::Option<Object>,
2150}
2151#[non_exhaustive]
2152#[derive(Clone, PartialEq, ::prost::Message)]
2153pub struct BatchGetObjectsRequest {
2154    #[prost(message, repeated, tag = "1")]
2155    pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
2156    /// Mask specifying which fields to read.
2157    /// If no mask is specified, defaults to `object_id,version,digest`.
2158    #[prost(message, optional, tag = "2")]
2159    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2160}
2161#[non_exhaustive]
2162#[derive(Clone, PartialEq, ::prost::Message)]
2163pub struct BatchGetObjectsResponse {
2164    #[prost(message, repeated, tag = "1")]
2165    pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
2166}
2167#[non_exhaustive]
2168#[derive(Clone, PartialEq, ::prost::Message)]
2169pub struct GetObjectResult {
2170    #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
2171    pub result: ::core::option::Option<get_object_result::Result>,
2172}
2173/// Nested message and enum types in `GetObjectResult`.
2174pub mod get_object_result {
2175    #[non_exhaustive]
2176    #[derive(Clone, PartialEq, ::prost::Oneof)]
2177    pub enum Result {
2178        #[prost(message, tag = "1")]
2179        Object(super::Object),
2180        #[prost(message, tag = "2")]
2181        Error(super::super::super::super::google::rpc::Status),
2182    }
2183}
2184#[non_exhaustive]
2185#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2186pub struct GetTransactionRequest {
2187    /// Required. The digest of the requested transaction.
2188    #[prost(string, optional, tag = "1")]
2189    pub digest: ::core::option::Option<::prost::alloc::string::String>,
2190    /// Mask specifying which fields to read.
2191    /// If no mask is specified, defaults to `digest`.
2192    #[prost(message, optional, tag = "2")]
2193    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2194}
2195#[non_exhaustive]
2196#[derive(Clone, PartialEq, ::prost::Message)]
2197pub struct GetTransactionResponse {
2198    #[prost(message, optional, tag = "1")]
2199    pub transaction: ::core::option::Option<ExecutedTransaction>,
2200}
2201#[non_exhaustive]
2202#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2203pub struct BatchGetTransactionsRequest {
2204    /// Required. The digests of the requested transactions.
2205    #[prost(string, repeated, tag = "1")]
2206    pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2207    /// Mask specifying which fields to read.
2208    /// If no mask is specified, defaults to `digest`.
2209    #[prost(message, optional, tag = "2")]
2210    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2211}
2212#[non_exhaustive]
2213#[derive(Clone, PartialEq, ::prost::Message)]
2214pub struct BatchGetTransactionsResponse {
2215    #[prost(message, repeated, tag = "1")]
2216    pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
2217}
2218#[non_exhaustive]
2219#[derive(Clone, PartialEq, ::prost::Message)]
2220pub struct GetTransactionResult {
2221    #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
2222    pub result: ::core::option::Option<get_transaction_result::Result>,
2223}
2224/// Nested message and enum types in `GetTransactionResult`.
2225pub mod get_transaction_result {
2226    #[non_exhaustive]
2227    #[derive(Clone, PartialEq, ::prost::Oneof)]
2228    pub enum Result {
2229        #[prost(message, tag = "1")]
2230        Transaction(super::ExecutedTransaction),
2231        #[prost(message, tag = "2")]
2232        Error(super::super::super::super::google::rpc::Status),
2233    }
2234}
2235#[non_exhaustive]
2236#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2237pub struct GetCheckpointRequest {
2238    /// Mask specifying which fields to read.
2239    /// If no mask is specified, defaults to `sequence_number,digest`.
2240    #[prost(message, optional, tag = "3")]
2241    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2242    /// If neither is provided, return the latest
2243    #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
2244    pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
2245}
2246/// Nested message and enum types in `GetCheckpointRequest`.
2247pub mod get_checkpoint_request {
2248    /// If neither is provided, return the latest
2249    #[non_exhaustive]
2250    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2251    pub enum CheckpointId {
2252        /// The sequence number of the requested checkpoint.
2253        #[prost(uint64, tag = "1")]
2254        SequenceNumber(u64),
2255        /// The digest of the requested checkpoint.
2256        #[prost(string, tag = "2")]
2257        Digest(::prost::alloc::string::String),
2258    }
2259}
2260#[non_exhaustive]
2261#[derive(Clone, PartialEq, ::prost::Message)]
2262pub struct GetCheckpointResponse {
2263    #[prost(message, optional, tag = "1")]
2264    pub checkpoint: ::core::option::Option<Checkpoint>,
2265}
2266#[non_exhaustive]
2267#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2268pub struct GetEpochRequest {
2269    /// The requested epoch.
2270    /// If no epoch is provided the current epoch will be returned.
2271    #[prost(uint64, optional, tag = "1")]
2272    pub epoch: ::core::option::Option<u64>,
2273    /// Mask specifying which fields to read.
2274    /// If no mask is specified, defaults to `epoch`.
2275    #[prost(message, optional, tag = "2")]
2276    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2277}
2278#[non_exhaustive]
2279#[derive(Clone, PartialEq, ::prost::Message)]
2280pub struct GetEpochResponse {
2281    #[prost(message, optional, tag = "1")]
2282    pub epoch: ::core::option::Option<Epoch>,
2283}
2284/// Request message for LedgerService.ListCheckpoints.
2285#[non_exhaustive]
2286#[derive(Clone, PartialEq, ::prost::Message)]
2287pub struct ListCheckpointsRequest {
2288    /// Optional. Mask for specifying which parts of the Checkpoint should be
2289    /// returned (e.g. summary, contents, signatures).
2290    #[prost(message, optional, tag = "1")]
2291    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2292    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2293    /// genesis.
2294    #[prost(uint64, optional, tag = "2")]
2295    pub start_checkpoint: ::core::option::Option<u64>,
2296    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2297    /// current indexed ledger tip.
2298    #[prost(uint64, optional, tag = "3")]
2299    pub end_checkpoint: ::core::option::Option<u64>,
2300    /// Optional. DNF filter over indexed transaction dimensions. A checkpoint
2301    /// matches if any transaction it contains satisfies the filter. If absent,
2302    /// all checkpoints in the range are returned.
2303    #[prost(message, optional, tag = "4")]
2304    pub filter: ::core::option::Option<TransactionFilter>,
2305    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2306    /// order with the default item limit. The server enforces a maximum item
2307    /// limit and silently coerces larger values down to it. To paginate, pass
2308    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2309    /// `options.before` (descending) on the next request.
2310    #[prost(message, optional, tag = "5")]
2311    pub options: ::core::option::Option<QueryOptions>,
2312}
2313/// Response message for LedgerService.ListCheckpoints.
2314///
2315/// Every frame carries a `watermark` with a safe resume cursor. A frame
2316/// with `checkpoint` set delivers one matching item; a frame without it reports
2317/// scan progress or terminal completion. Watermarks never regress in the
2318/// requested ordering but may repeat.
2319///
2320/// `end` is set exactly once, on the final frame of a successful stream. For
2321/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2322/// every other end reason, the final frame has no `checkpoint` payload.
2323#[non_exhaustive]
2324#[derive(Clone, PartialEq, ::prost::Message)]
2325pub struct ListCheckpointsResponse {
2326    /// One matching checkpoint.
2327    #[prost(message, optional, tag = "1")]
2328    pub checkpoint: ::core::option::Option<Checkpoint>,
2329    /// Progress watermark as of this frame. Present on every frame. A
2330    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2331    /// its authoritative scan frontier was already emitted.
2332    #[prost(message, optional, tag = "2")]
2333    pub watermark: ::core::option::Option<Watermark>,
2334    /// Set exactly once, on the final frame of a successful query stream.
2335    #[prost(message, optional, tag = "3")]
2336    pub end: ::core::option::Option<QueryEnd>,
2337}
2338/// Request message for LedgerService.ListTransactions.
2339#[non_exhaustive]
2340#[derive(Clone, PartialEq, ::prost::Message)]
2341pub struct ListTransactionsRequest {
2342    /// Optional. Mask for specifying which parts of the ExecutedTransaction
2343    /// should be returned.
2344    #[prost(message, optional, tag = "1")]
2345    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2346    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2347    /// genesis.
2348    #[prost(uint64, optional, tag = "2")]
2349    pub start_checkpoint: ::core::option::Option<u64>,
2350    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2351    /// current indexed ledger tip.
2352    #[prost(uint64, optional, tag = "3")]
2353    pub end_checkpoint: ::core::option::Option<u64>,
2354    /// Optional. DNF filter over indexed dimensions.
2355    /// If absent, all transactions in the range are returned.
2356    #[prost(message, optional, tag = "4")]
2357    pub filter: ::core::option::Option<TransactionFilter>,
2358    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2359    /// order with the default item limit. The server enforces a maximum item
2360    /// limit and silently coerces larger values down to it. To paginate, pass
2361    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2362    /// `options.before` (descending) on the next request.
2363    #[prost(message, optional, tag = "5")]
2364    pub options: ::core::option::Option<QueryOptions>,
2365}
2366/// Response message for LedgerService.ListTransactions.
2367///
2368/// Every frame carries a `watermark` with a safe resume cursor. A frame
2369/// with `transaction` set delivers one matching item; a frame without it reports
2370/// scan progress or terminal completion. Watermarks never regress in the
2371/// requested ordering but may repeat.
2372///
2373/// `end` is set exactly once, on the final frame of a successful stream. For
2374/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2375/// every other end reason, the final frame has no `transaction` payload.
2376#[non_exhaustive]
2377#[derive(Clone, PartialEq, ::prost::Message)]
2378pub struct ListTransactionsResponse {
2379    /// One matching transaction. Its position within the containing checkpoint
2380    /// is reported by `ExecutedTransaction.transaction_index`.
2381    #[prost(message, optional, tag = "1")]
2382    pub transaction: ::core::option::Option<ExecutedTransaction>,
2383    /// Progress watermark as of this frame. Present on every frame. A
2384    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2385    /// its authoritative scan frontier was already emitted.
2386    #[prost(message, optional, tag = "2")]
2387    pub watermark: ::core::option::Option<Watermark>,
2388    /// Set exactly once, on the final frame of a successful query stream.
2389    #[prost(message, optional, tag = "3")]
2390    pub end: ::core::option::Option<QueryEnd>,
2391}
2392/// Request message for LedgerService.ListEvents.
2393#[non_exhaustive]
2394#[derive(Clone, PartialEq, ::prost::Message)]
2395pub struct ListEventsRequest {
2396    /// Optional. Mask for specifying which parts of the Event should be returned.
2397    #[prost(message, optional, tag = "1")]
2398    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2399    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2400    /// genesis.
2401    #[prost(uint64, optional, tag = "2")]
2402    pub start_checkpoint: ::core::option::Option<u64>,
2403    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2404    /// current indexed ledger tip.
2405    #[prost(uint64, optional, tag = "3")]
2406    pub end_checkpoint: ::core::option::Option<u64>,
2407    /// Optional. DNF filter over indexed dimensions.
2408    /// If absent, all events in the range are returned.
2409    #[prost(message, optional, tag = "4")]
2410    pub filter: ::core::option::Option<EventFilter>,
2411    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2412    /// order with the default item limit. The server enforces a maximum item
2413    /// limit and silently coerces larger values down to it. To paginate, pass
2414    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2415    /// `options.before` (descending) on the next request.
2416    #[prost(message, optional, tag = "5")]
2417    pub options: ::core::option::Option<QueryOptions>,
2418}
2419/// Response message for LedgerService.ListEvents.
2420///
2421/// Every frame carries a `watermark` with a safe resume cursor. A frame
2422/// with `event` set delivers one matching item; a frame without it reports scan
2423/// progress or terminal completion. Watermarks never regress in the requested
2424/// ordering but may repeat.
2425///
2426/// `end` is set exactly once, on the final frame of a successful stream. For
2427/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2428/// every other end reason, the final frame has no `event` payload.
2429#[non_exhaustive]
2430#[derive(Clone, PartialEq, ::prost::Message)]
2431pub struct ListEventsResponse {
2432    /// One matching event. Its ledger position -- containing checkpoint,
2433    /// emitting transaction digest and offset, and index within that
2434    /// transaction's event list -- is reported by the corresponding fields on
2435    /// `Event`.
2436    #[prost(message, optional, tag = "1")]
2437    pub event: ::core::option::Option<Event>,
2438    /// Progress watermark as of this frame. Present on every frame. A
2439    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2440    /// its authoritative scan frontier was already emitted.
2441    #[prost(message, optional, tag = "2")]
2442    pub watermark: ::core::option::Option<Watermark>,
2443    /// Set exactly once, on the final frame of a successful query stream.
2444    #[prost(message, optional, tag = "3")]
2445    pub end: ::core::option::Option<QueryEnd>,
2446}
2447/// Generated client implementations.
2448pub mod ledger_service_client {
2449    #![allow(
2450        unused_variables,
2451        dead_code,
2452        missing_docs,
2453        clippy::wildcard_imports,
2454        clippy::let_unit_value,
2455    )]
2456    use tonic::codegen::*;
2457    use tonic::codegen::http::Uri;
2458    #[derive(Debug, Clone)]
2459    pub struct LedgerServiceClient<T> {
2460        inner: tonic::client::Grpc<T>,
2461    }
2462    impl LedgerServiceClient<tonic::transport::Channel> {
2463        /// Attempt to create a new client by connecting to a given endpoint.
2464        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2465        where
2466            D: TryInto<tonic::transport::Endpoint>,
2467            D::Error: Into<StdError>,
2468        {
2469            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2470            Ok(Self::new(conn))
2471        }
2472    }
2473    impl<T> LedgerServiceClient<T>
2474    where
2475        T: tonic::client::GrpcService<tonic::body::Body>,
2476        T::Error: Into<StdError>,
2477        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2478        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2479    {
2480        pub fn new(inner: T) -> Self {
2481            let inner = tonic::client::Grpc::new(inner);
2482            Self { inner }
2483        }
2484        pub fn with_origin(inner: T, origin: Uri) -> Self {
2485            let inner = tonic::client::Grpc::with_origin(inner, origin);
2486            Self { inner }
2487        }
2488        pub fn with_interceptor<F>(
2489            inner: T,
2490            interceptor: F,
2491        ) -> LedgerServiceClient<InterceptedService<T, F>>
2492        where
2493            F: tonic::service::Interceptor,
2494            T::ResponseBody: Default,
2495            T: tonic::codegen::Service<
2496                http::Request<tonic::body::Body>,
2497                Response = http::Response<
2498                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2499                >,
2500            >,
2501            <T as tonic::codegen::Service<
2502                http::Request<tonic::body::Body>,
2503            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2504        {
2505            LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
2506        }
2507        /// Compress requests with the given encoding.
2508        ///
2509        /// This requires the server to support it otherwise it might respond with an
2510        /// error.
2511        #[must_use]
2512        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2513            self.inner = self.inner.send_compressed(encoding);
2514            self
2515        }
2516        /// Enable decompressing responses.
2517        #[must_use]
2518        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2519            self.inner = self.inner.accept_compressed(encoding);
2520            self
2521        }
2522        /// Limits the maximum size of a decoded message.
2523        ///
2524        /// Default: `4MB`
2525        #[must_use]
2526        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2527            self.inner = self.inner.max_decoding_message_size(limit);
2528            self
2529        }
2530        /// Limits the maximum size of an encoded message.
2531        ///
2532        /// Default: `usize::MAX`
2533        #[must_use]
2534        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2535            self.inner = self.inner.max_encoding_message_size(limit);
2536            self
2537        }
2538        /// Query the service for general information about its current state.
2539        pub async fn get_service_info(
2540            &mut self,
2541            request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
2542        ) -> std::result::Result<
2543            tonic::Response<super::GetServiceInfoResponse>,
2544            tonic::Status,
2545        > {
2546            self.inner
2547                .ready()
2548                .await
2549                .map_err(|e| {
2550                    tonic::Status::unknown(
2551                        format!("Service was not ready: {}", e.into()),
2552                    )
2553                })?;
2554            let codec = tonic_prost::ProstCodec::default();
2555            let path = http::uri::PathAndQuery::from_static(
2556                "/sui.rpc.v2.LedgerService/GetServiceInfo",
2557            );
2558            let mut req = request.into_request();
2559            req.extensions_mut()
2560                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
2561            self.inner.unary(req, path, codec).await
2562        }
2563        pub async fn get_object(
2564            &mut self,
2565            request: impl tonic::IntoRequest<super::GetObjectRequest>,
2566        ) -> std::result::Result<
2567            tonic::Response<super::GetObjectResponse>,
2568            tonic::Status,
2569        > {
2570            self.inner
2571                .ready()
2572                .await
2573                .map_err(|e| {
2574                    tonic::Status::unknown(
2575                        format!("Service was not ready: {}", e.into()),
2576                    )
2577                })?;
2578            let codec = tonic_prost::ProstCodec::default();
2579            let path = http::uri::PathAndQuery::from_static(
2580                "/sui.rpc.v2.LedgerService/GetObject",
2581            );
2582            let mut req = request.into_request();
2583            req.extensions_mut()
2584                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
2585            self.inner.unary(req, path, codec).await
2586        }
2587        pub async fn batch_get_objects(
2588            &mut self,
2589            request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
2590        ) -> std::result::Result<
2591            tonic::Response<super::BatchGetObjectsResponse>,
2592            tonic::Status,
2593        > {
2594            self.inner
2595                .ready()
2596                .await
2597                .map_err(|e| {
2598                    tonic::Status::unknown(
2599                        format!("Service was not ready: {}", e.into()),
2600                    )
2601                })?;
2602            let codec = tonic_prost::ProstCodec::default();
2603            let path = http::uri::PathAndQuery::from_static(
2604                "/sui.rpc.v2.LedgerService/BatchGetObjects",
2605            );
2606            let mut req = request.into_request();
2607            req.extensions_mut()
2608                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
2609            self.inner.unary(req, path, codec).await
2610        }
2611        pub async fn get_transaction(
2612            &mut self,
2613            request: impl tonic::IntoRequest<super::GetTransactionRequest>,
2614        ) -> std::result::Result<
2615            tonic::Response<super::GetTransactionResponse>,
2616            tonic::Status,
2617        > {
2618            self.inner
2619                .ready()
2620                .await
2621                .map_err(|e| {
2622                    tonic::Status::unknown(
2623                        format!("Service was not ready: {}", e.into()),
2624                    )
2625                })?;
2626            let codec = tonic_prost::ProstCodec::default();
2627            let path = http::uri::PathAndQuery::from_static(
2628                "/sui.rpc.v2.LedgerService/GetTransaction",
2629            );
2630            let mut req = request.into_request();
2631            req.extensions_mut()
2632                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
2633            self.inner.unary(req, path, codec).await
2634        }
2635        pub async fn batch_get_transactions(
2636            &mut self,
2637            request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
2638        ) -> std::result::Result<
2639            tonic::Response<super::BatchGetTransactionsResponse>,
2640            tonic::Status,
2641        > {
2642            self.inner
2643                .ready()
2644                .await
2645                .map_err(|e| {
2646                    tonic::Status::unknown(
2647                        format!("Service was not ready: {}", e.into()),
2648                    )
2649                })?;
2650            let codec = tonic_prost::ProstCodec::default();
2651            let path = http::uri::PathAndQuery::from_static(
2652                "/sui.rpc.v2.LedgerService/BatchGetTransactions",
2653            );
2654            let mut req = request.into_request();
2655            req.extensions_mut()
2656                .insert(
2657                    GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
2658                );
2659            self.inner.unary(req, path, codec).await
2660        }
2661        pub async fn get_checkpoint(
2662            &mut self,
2663            request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
2664        ) -> std::result::Result<
2665            tonic::Response<super::GetCheckpointResponse>,
2666            tonic::Status,
2667        > {
2668            self.inner
2669                .ready()
2670                .await
2671                .map_err(|e| {
2672                    tonic::Status::unknown(
2673                        format!("Service was not ready: {}", e.into()),
2674                    )
2675                })?;
2676            let codec = tonic_prost::ProstCodec::default();
2677            let path = http::uri::PathAndQuery::from_static(
2678                "/sui.rpc.v2.LedgerService/GetCheckpoint",
2679            );
2680            let mut req = request.into_request();
2681            req.extensions_mut()
2682                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
2683            self.inner.unary(req, path, codec).await
2684        }
2685        pub async fn get_epoch(
2686            &mut self,
2687            request: impl tonic::IntoRequest<super::GetEpochRequest>,
2688        ) -> std::result::Result<
2689            tonic::Response<super::GetEpochResponse>,
2690            tonic::Status,
2691        > {
2692            self.inner
2693                .ready()
2694                .await
2695                .map_err(|e| {
2696                    tonic::Status::unknown(
2697                        format!("Service was not ready: {}", e.into()),
2698                    )
2699                })?;
2700            let codec = tonic_prost::ProstCodec::default();
2701            let path = http::uri::PathAndQuery::from_static(
2702                "/sui.rpc.v2.LedgerService/GetEpoch",
2703            );
2704            let mut req = request.into_request();
2705            req.extensions_mut()
2706                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
2707            self.inner.unary(req, path, codec).await
2708        }
2709        /// List checkpoints matching the provided filters.
2710        ///
2711        /// Checkpoints are returned in ascending or descending checkpoint sequence
2712        /// number order according to the query options ordering.
2713        /// A checkpoint matches if any transaction it contains satisfies the filter.
2714        pub async fn list_checkpoints(
2715            &mut self,
2716            request: impl tonic::IntoRequest<super::ListCheckpointsRequest>,
2717        ) -> std::result::Result<
2718            tonic::Response<tonic::codec::Streaming<super::ListCheckpointsResponse>>,
2719            tonic::Status,
2720        > {
2721            self.inner
2722                .ready()
2723                .await
2724                .map_err(|e| {
2725                    tonic::Status::unknown(
2726                        format!("Service was not ready: {}", e.into()),
2727                    )
2728                })?;
2729            let codec = tonic_prost::ProstCodec::default();
2730            let path = http::uri::PathAndQuery::from_static(
2731                "/sui.rpc.v2.LedgerService/ListCheckpoints",
2732            );
2733            let mut req = request.into_request();
2734            req.extensions_mut()
2735                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListCheckpoints"));
2736            self.inner.server_streaming(req, path, codec).await
2737        }
2738        /// List transactions matching the provided filters.
2739        ///
2740        /// Transactions are returned in ascending or descending transaction sequence
2741        /// order according to the query options ordering.
2742        pub async fn list_transactions(
2743            &mut self,
2744            request: impl tonic::IntoRequest<super::ListTransactionsRequest>,
2745        ) -> std::result::Result<
2746            tonic::Response<tonic::codec::Streaming<super::ListTransactionsResponse>>,
2747            tonic::Status,
2748        > {
2749            self.inner
2750                .ready()
2751                .await
2752                .map_err(|e| {
2753                    tonic::Status::unknown(
2754                        format!("Service was not ready: {}", e.into()),
2755                    )
2756                })?;
2757            let codec = tonic_prost::ProstCodec::default();
2758            let path = http::uri::PathAndQuery::from_static(
2759                "/sui.rpc.v2.LedgerService/ListTransactions",
2760            );
2761            let mut req = request.into_request();
2762            req.extensions_mut()
2763                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListTransactions"));
2764            self.inner.server_streaming(req, path, codec).await
2765        }
2766        /// List events matching the provided filters.
2767        ///
2768        /// Events are returned in ascending or descending packed event sequence order
2769        /// according to the query options ordering.
2770        pub async fn list_events(
2771            &mut self,
2772            request: impl tonic::IntoRequest<super::ListEventsRequest>,
2773        ) -> std::result::Result<
2774            tonic::Response<tonic::codec::Streaming<super::ListEventsResponse>>,
2775            tonic::Status,
2776        > {
2777            self.inner
2778                .ready()
2779                .await
2780                .map_err(|e| {
2781                    tonic::Status::unknown(
2782                        format!("Service was not ready: {}", e.into()),
2783                    )
2784                })?;
2785            let codec = tonic_prost::ProstCodec::default();
2786            let path = http::uri::PathAndQuery::from_static(
2787                "/sui.rpc.v2.LedgerService/ListEvents",
2788            );
2789            let mut req = request.into_request();
2790            req.extensions_mut()
2791                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListEvents"));
2792            self.inner.server_streaming(req, path, codec).await
2793        }
2794    }
2795}
2796/// Generated server implementations.
2797pub mod ledger_service_server {
2798    #![allow(
2799        unused_variables,
2800        dead_code,
2801        missing_docs,
2802        clippy::wildcard_imports,
2803        clippy::let_unit_value,
2804    )]
2805    use tonic::codegen::*;
2806    /// Generated trait containing gRPC methods that should be implemented for use with LedgerServiceServer.
2807    #[async_trait]
2808    pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2809        /// Query the service for general information about its current state.
2810        async fn get_service_info(
2811            &self,
2812            request: tonic::Request<super::GetServiceInfoRequest>,
2813        ) -> std::result::Result<
2814            tonic::Response<super::GetServiceInfoResponse>,
2815            tonic::Status,
2816        > {
2817            Err(tonic::Status::unimplemented("Not yet implemented"))
2818        }
2819        async fn get_object(
2820            &self,
2821            request: tonic::Request<super::GetObjectRequest>,
2822        ) -> std::result::Result<
2823            tonic::Response<super::GetObjectResponse>,
2824            tonic::Status,
2825        > {
2826            Err(tonic::Status::unimplemented("Not yet implemented"))
2827        }
2828        async fn batch_get_objects(
2829            &self,
2830            request: tonic::Request<super::BatchGetObjectsRequest>,
2831        ) -> std::result::Result<
2832            tonic::Response<super::BatchGetObjectsResponse>,
2833            tonic::Status,
2834        > {
2835            Err(tonic::Status::unimplemented("Not yet implemented"))
2836        }
2837        async fn get_transaction(
2838            &self,
2839            request: tonic::Request<super::GetTransactionRequest>,
2840        ) -> std::result::Result<
2841            tonic::Response<super::GetTransactionResponse>,
2842            tonic::Status,
2843        > {
2844            Err(tonic::Status::unimplemented("Not yet implemented"))
2845        }
2846        async fn batch_get_transactions(
2847            &self,
2848            request: tonic::Request<super::BatchGetTransactionsRequest>,
2849        ) -> std::result::Result<
2850            tonic::Response<super::BatchGetTransactionsResponse>,
2851            tonic::Status,
2852        > {
2853            Err(tonic::Status::unimplemented("Not yet implemented"))
2854        }
2855        async fn get_checkpoint(
2856            &self,
2857            request: tonic::Request<super::GetCheckpointRequest>,
2858        ) -> std::result::Result<
2859            tonic::Response<super::GetCheckpointResponse>,
2860            tonic::Status,
2861        > {
2862            Err(tonic::Status::unimplemented("Not yet implemented"))
2863        }
2864        async fn get_epoch(
2865            &self,
2866            request: tonic::Request<super::GetEpochRequest>,
2867        ) -> std::result::Result<
2868            tonic::Response<super::GetEpochResponse>,
2869            tonic::Status,
2870        > {
2871            Err(tonic::Status::unimplemented("Not yet implemented"))
2872        }
2873        /// List checkpoints matching the provided filters.
2874        ///
2875        /// Checkpoints are returned in ascending or descending checkpoint sequence
2876        /// number order according to the query options ordering.
2877        /// A checkpoint matches if any transaction it contains satisfies the filter.
2878        async fn list_checkpoints(
2879            &self,
2880            request: tonic::Request<super::ListCheckpointsRequest>,
2881        ) -> std::result::Result<
2882            tonic::Response<BoxStream<super::ListCheckpointsResponse>>,
2883            tonic::Status,
2884        > {
2885            Err(tonic::Status::unimplemented("Not yet implemented"))
2886        }
2887        /// List transactions matching the provided filters.
2888        ///
2889        /// Transactions are returned in ascending or descending transaction sequence
2890        /// order according to the query options ordering.
2891        async fn list_transactions(
2892            &self,
2893            request: tonic::Request<super::ListTransactionsRequest>,
2894        ) -> std::result::Result<
2895            tonic::Response<BoxStream<super::ListTransactionsResponse>>,
2896            tonic::Status,
2897        > {
2898            Err(tonic::Status::unimplemented("Not yet implemented"))
2899        }
2900        /// List events matching the provided filters.
2901        ///
2902        /// Events are returned in ascending or descending packed event sequence order
2903        /// according to the query options ordering.
2904        async fn list_events(
2905            &self,
2906            request: tonic::Request<super::ListEventsRequest>,
2907        ) -> std::result::Result<
2908            tonic::Response<BoxStream<super::ListEventsResponse>>,
2909            tonic::Status,
2910        > {
2911            Err(tonic::Status::unimplemented("Not yet implemented"))
2912        }
2913    }
2914    #[derive(Debug)]
2915    pub struct LedgerServiceServer<T> {
2916        inner: Arc<T>,
2917        accept_compression_encodings: EnabledCompressionEncodings,
2918        send_compression_encodings: EnabledCompressionEncodings,
2919        max_decoding_message_size: Option<usize>,
2920        max_encoding_message_size: Option<usize>,
2921    }
2922    impl<T> LedgerServiceServer<T> {
2923        pub fn new(inner: T) -> Self {
2924            Self::from_arc(Arc::new(inner))
2925        }
2926        pub fn from_arc(inner: Arc<T>) -> Self {
2927            Self {
2928                inner,
2929                accept_compression_encodings: Default::default(),
2930                send_compression_encodings: Default::default(),
2931                max_decoding_message_size: None,
2932                max_encoding_message_size: None,
2933            }
2934        }
2935        pub fn with_interceptor<F>(
2936            inner: T,
2937            interceptor: F,
2938        ) -> InterceptedService<Self, F>
2939        where
2940            F: tonic::service::Interceptor,
2941        {
2942            InterceptedService::new(Self::new(inner), interceptor)
2943        }
2944        /// Enable decompressing requests with the given encoding.
2945        #[must_use]
2946        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2947            self.accept_compression_encodings.enable(encoding);
2948            self
2949        }
2950        /// Compress responses with the given encoding, if the client supports it.
2951        #[must_use]
2952        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2953            self.send_compression_encodings.enable(encoding);
2954            self
2955        }
2956        /// Limits the maximum size of a decoded message.
2957        ///
2958        /// Default: `4MB`
2959        #[must_use]
2960        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2961            self.max_decoding_message_size = Some(limit);
2962            self
2963        }
2964        /// Limits the maximum size of an encoded message.
2965        ///
2966        /// Default: `usize::MAX`
2967        #[must_use]
2968        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2969            self.max_encoding_message_size = Some(limit);
2970            self
2971        }
2972    }
2973    impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
2974    where
2975        T: LedgerService,
2976        B: Body + std::marker::Send + 'static,
2977        B::Error: Into<StdError> + std::marker::Send + 'static,
2978    {
2979        type Response = http::Response<tonic::body::Body>;
2980        type Error = std::convert::Infallible;
2981        type Future = BoxFuture<Self::Response, Self::Error>;
2982        fn poll_ready(
2983            &mut self,
2984            _cx: &mut Context<'_>,
2985        ) -> Poll<std::result::Result<(), Self::Error>> {
2986            Poll::Ready(Ok(()))
2987        }
2988        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2989            match req.uri().path() {
2990                "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
2991                    #[allow(non_camel_case_types)]
2992                    struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
2993                    impl<
2994                        T: LedgerService,
2995                    > tonic::server::UnaryService<super::GetServiceInfoRequest>
2996                    for GetServiceInfoSvc<T> {
2997                        type Response = super::GetServiceInfoResponse;
2998                        type Future = BoxFuture<
2999                            tonic::Response<Self::Response>,
3000                            tonic::Status,
3001                        >;
3002                        fn call(
3003                            &mut self,
3004                            request: tonic::Request<super::GetServiceInfoRequest>,
3005                        ) -> Self::Future {
3006                            let inner = Arc::clone(&self.0);
3007                            let fut = async move {
3008                                <T as LedgerService>::get_service_info(&inner, request)
3009                                    .await
3010                            };
3011                            Box::pin(fut)
3012                        }
3013                    }
3014                    let accept_compression_encodings = self.accept_compression_encodings;
3015                    let send_compression_encodings = self.send_compression_encodings;
3016                    let max_decoding_message_size = self.max_decoding_message_size;
3017                    let max_encoding_message_size = self.max_encoding_message_size;
3018                    let inner = self.inner.clone();
3019                    let fut = async move {
3020                        let method = GetServiceInfoSvc(inner);
3021                        let codec = tonic_prost::ProstCodec::default();
3022                        let mut grpc = tonic::server::Grpc::new(codec)
3023                            .apply_compression_config(
3024                                accept_compression_encodings,
3025                                send_compression_encodings,
3026                            )
3027                            .apply_max_message_size_config(
3028                                max_decoding_message_size,
3029                                max_encoding_message_size,
3030                            );
3031                        let res = grpc.unary(method, req).await;
3032                        Ok(res)
3033                    };
3034                    Box::pin(fut)
3035                }
3036                "/sui.rpc.v2.LedgerService/GetObject" => {
3037                    #[allow(non_camel_case_types)]
3038                    struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
3039                    impl<
3040                        T: LedgerService,
3041                    > tonic::server::UnaryService<super::GetObjectRequest>
3042                    for GetObjectSvc<T> {
3043                        type Response = super::GetObjectResponse;
3044                        type Future = BoxFuture<
3045                            tonic::Response<Self::Response>,
3046                            tonic::Status,
3047                        >;
3048                        fn call(
3049                            &mut self,
3050                            request: tonic::Request<super::GetObjectRequest>,
3051                        ) -> Self::Future {
3052                            let inner = Arc::clone(&self.0);
3053                            let fut = async move {
3054                                <T as LedgerService>::get_object(&inner, request).await
3055                            };
3056                            Box::pin(fut)
3057                        }
3058                    }
3059                    let accept_compression_encodings = self.accept_compression_encodings;
3060                    let send_compression_encodings = self.send_compression_encodings;
3061                    let max_decoding_message_size = self.max_decoding_message_size;
3062                    let max_encoding_message_size = self.max_encoding_message_size;
3063                    let inner = self.inner.clone();
3064                    let fut = async move {
3065                        let method = GetObjectSvc(inner);
3066                        let codec = tonic_prost::ProstCodec::default();
3067                        let mut grpc = tonic::server::Grpc::new(codec)
3068                            .apply_compression_config(
3069                                accept_compression_encodings,
3070                                send_compression_encodings,
3071                            )
3072                            .apply_max_message_size_config(
3073                                max_decoding_message_size,
3074                                max_encoding_message_size,
3075                            );
3076                        let res = grpc.unary(method, req).await;
3077                        Ok(res)
3078                    };
3079                    Box::pin(fut)
3080                }
3081                "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
3082                    #[allow(non_camel_case_types)]
3083                    struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
3084                    impl<
3085                        T: LedgerService,
3086                    > tonic::server::UnaryService<super::BatchGetObjectsRequest>
3087                    for BatchGetObjectsSvc<T> {
3088                        type Response = super::BatchGetObjectsResponse;
3089                        type Future = BoxFuture<
3090                            tonic::Response<Self::Response>,
3091                            tonic::Status,
3092                        >;
3093                        fn call(
3094                            &mut self,
3095                            request: tonic::Request<super::BatchGetObjectsRequest>,
3096                        ) -> Self::Future {
3097                            let inner = Arc::clone(&self.0);
3098                            let fut = async move {
3099                                <T as LedgerService>::batch_get_objects(&inner, request)
3100                                    .await
3101                            };
3102                            Box::pin(fut)
3103                        }
3104                    }
3105                    let accept_compression_encodings = self.accept_compression_encodings;
3106                    let send_compression_encodings = self.send_compression_encodings;
3107                    let max_decoding_message_size = self.max_decoding_message_size;
3108                    let max_encoding_message_size = self.max_encoding_message_size;
3109                    let inner = self.inner.clone();
3110                    let fut = async move {
3111                        let method = BatchGetObjectsSvc(inner);
3112                        let codec = tonic_prost::ProstCodec::default();
3113                        let mut grpc = tonic::server::Grpc::new(codec)
3114                            .apply_compression_config(
3115                                accept_compression_encodings,
3116                                send_compression_encodings,
3117                            )
3118                            .apply_max_message_size_config(
3119                                max_decoding_message_size,
3120                                max_encoding_message_size,
3121                            );
3122                        let res = grpc.unary(method, req).await;
3123                        Ok(res)
3124                    };
3125                    Box::pin(fut)
3126                }
3127                "/sui.rpc.v2.LedgerService/GetTransaction" => {
3128                    #[allow(non_camel_case_types)]
3129                    struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
3130                    impl<
3131                        T: LedgerService,
3132                    > tonic::server::UnaryService<super::GetTransactionRequest>
3133                    for GetTransactionSvc<T> {
3134                        type Response = super::GetTransactionResponse;
3135                        type Future = BoxFuture<
3136                            tonic::Response<Self::Response>,
3137                            tonic::Status,
3138                        >;
3139                        fn call(
3140                            &mut self,
3141                            request: tonic::Request<super::GetTransactionRequest>,
3142                        ) -> Self::Future {
3143                            let inner = Arc::clone(&self.0);
3144                            let fut = async move {
3145                                <T as LedgerService>::get_transaction(&inner, request).await
3146                            };
3147                            Box::pin(fut)
3148                        }
3149                    }
3150                    let accept_compression_encodings = self.accept_compression_encodings;
3151                    let send_compression_encodings = self.send_compression_encodings;
3152                    let max_decoding_message_size = self.max_decoding_message_size;
3153                    let max_encoding_message_size = self.max_encoding_message_size;
3154                    let inner = self.inner.clone();
3155                    let fut = async move {
3156                        let method = GetTransactionSvc(inner);
3157                        let codec = tonic_prost::ProstCodec::default();
3158                        let mut grpc = tonic::server::Grpc::new(codec)
3159                            .apply_compression_config(
3160                                accept_compression_encodings,
3161                                send_compression_encodings,
3162                            )
3163                            .apply_max_message_size_config(
3164                                max_decoding_message_size,
3165                                max_encoding_message_size,
3166                            );
3167                        let res = grpc.unary(method, req).await;
3168                        Ok(res)
3169                    };
3170                    Box::pin(fut)
3171                }
3172                "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
3173                    #[allow(non_camel_case_types)]
3174                    struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
3175                    impl<
3176                        T: LedgerService,
3177                    > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
3178                    for BatchGetTransactionsSvc<T> {
3179                        type Response = super::BatchGetTransactionsResponse;
3180                        type Future = BoxFuture<
3181                            tonic::Response<Self::Response>,
3182                            tonic::Status,
3183                        >;
3184                        fn call(
3185                            &mut self,
3186                            request: tonic::Request<super::BatchGetTransactionsRequest>,
3187                        ) -> Self::Future {
3188                            let inner = Arc::clone(&self.0);
3189                            let fut = async move {
3190                                <T as LedgerService>::batch_get_transactions(
3191                                        &inner,
3192                                        request,
3193                                    )
3194                                    .await
3195                            };
3196                            Box::pin(fut)
3197                        }
3198                    }
3199                    let accept_compression_encodings = self.accept_compression_encodings;
3200                    let send_compression_encodings = self.send_compression_encodings;
3201                    let max_decoding_message_size = self.max_decoding_message_size;
3202                    let max_encoding_message_size = self.max_encoding_message_size;
3203                    let inner = self.inner.clone();
3204                    let fut = async move {
3205                        let method = BatchGetTransactionsSvc(inner);
3206                        let codec = tonic_prost::ProstCodec::default();
3207                        let mut grpc = tonic::server::Grpc::new(codec)
3208                            .apply_compression_config(
3209                                accept_compression_encodings,
3210                                send_compression_encodings,
3211                            )
3212                            .apply_max_message_size_config(
3213                                max_decoding_message_size,
3214                                max_encoding_message_size,
3215                            );
3216                        let res = grpc.unary(method, req).await;
3217                        Ok(res)
3218                    };
3219                    Box::pin(fut)
3220                }
3221                "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
3222                    #[allow(non_camel_case_types)]
3223                    struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
3224                    impl<
3225                        T: LedgerService,
3226                    > tonic::server::UnaryService<super::GetCheckpointRequest>
3227                    for GetCheckpointSvc<T> {
3228                        type Response = super::GetCheckpointResponse;
3229                        type Future = BoxFuture<
3230                            tonic::Response<Self::Response>,
3231                            tonic::Status,
3232                        >;
3233                        fn call(
3234                            &mut self,
3235                            request: tonic::Request<super::GetCheckpointRequest>,
3236                        ) -> Self::Future {
3237                            let inner = Arc::clone(&self.0);
3238                            let fut = async move {
3239                                <T as LedgerService>::get_checkpoint(&inner, request).await
3240                            };
3241                            Box::pin(fut)
3242                        }
3243                    }
3244                    let accept_compression_encodings = self.accept_compression_encodings;
3245                    let send_compression_encodings = self.send_compression_encodings;
3246                    let max_decoding_message_size = self.max_decoding_message_size;
3247                    let max_encoding_message_size = self.max_encoding_message_size;
3248                    let inner = self.inner.clone();
3249                    let fut = async move {
3250                        let method = GetCheckpointSvc(inner);
3251                        let codec = tonic_prost::ProstCodec::default();
3252                        let mut grpc = tonic::server::Grpc::new(codec)
3253                            .apply_compression_config(
3254                                accept_compression_encodings,
3255                                send_compression_encodings,
3256                            )
3257                            .apply_max_message_size_config(
3258                                max_decoding_message_size,
3259                                max_encoding_message_size,
3260                            );
3261                        let res = grpc.unary(method, req).await;
3262                        Ok(res)
3263                    };
3264                    Box::pin(fut)
3265                }
3266                "/sui.rpc.v2.LedgerService/GetEpoch" => {
3267                    #[allow(non_camel_case_types)]
3268                    struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
3269                    impl<
3270                        T: LedgerService,
3271                    > tonic::server::UnaryService<super::GetEpochRequest>
3272                    for GetEpochSvc<T> {
3273                        type Response = super::GetEpochResponse;
3274                        type Future = BoxFuture<
3275                            tonic::Response<Self::Response>,
3276                            tonic::Status,
3277                        >;
3278                        fn call(
3279                            &mut self,
3280                            request: tonic::Request<super::GetEpochRequest>,
3281                        ) -> Self::Future {
3282                            let inner = Arc::clone(&self.0);
3283                            let fut = async move {
3284                                <T as LedgerService>::get_epoch(&inner, request).await
3285                            };
3286                            Box::pin(fut)
3287                        }
3288                    }
3289                    let accept_compression_encodings = self.accept_compression_encodings;
3290                    let send_compression_encodings = self.send_compression_encodings;
3291                    let max_decoding_message_size = self.max_decoding_message_size;
3292                    let max_encoding_message_size = self.max_encoding_message_size;
3293                    let inner = self.inner.clone();
3294                    let fut = async move {
3295                        let method = GetEpochSvc(inner);
3296                        let codec = tonic_prost::ProstCodec::default();
3297                        let mut grpc = tonic::server::Grpc::new(codec)
3298                            .apply_compression_config(
3299                                accept_compression_encodings,
3300                                send_compression_encodings,
3301                            )
3302                            .apply_max_message_size_config(
3303                                max_decoding_message_size,
3304                                max_encoding_message_size,
3305                            );
3306                        let res = grpc.unary(method, req).await;
3307                        Ok(res)
3308                    };
3309                    Box::pin(fut)
3310                }
3311                "/sui.rpc.v2.LedgerService/ListCheckpoints" => {
3312                    #[allow(non_camel_case_types)]
3313                    struct ListCheckpointsSvc<T: LedgerService>(pub Arc<T>);
3314                    impl<
3315                        T: LedgerService,
3316                    > tonic::server::ServerStreamingService<
3317                        super::ListCheckpointsRequest,
3318                    > for ListCheckpointsSvc<T> {
3319                        type Response = super::ListCheckpointsResponse;
3320                        type ResponseStream = BoxStream<super::ListCheckpointsResponse>;
3321                        type Future = BoxFuture<
3322                            tonic::Response<Self::ResponseStream>,
3323                            tonic::Status,
3324                        >;
3325                        fn call(
3326                            &mut self,
3327                            request: tonic::Request<super::ListCheckpointsRequest>,
3328                        ) -> Self::Future {
3329                            let inner = Arc::clone(&self.0);
3330                            let fut = async move {
3331                                <T as LedgerService>::list_checkpoints(&inner, request)
3332                                    .await
3333                            };
3334                            Box::pin(fut)
3335                        }
3336                    }
3337                    let accept_compression_encodings = self.accept_compression_encodings;
3338                    let send_compression_encodings = self.send_compression_encodings;
3339                    let max_decoding_message_size = self.max_decoding_message_size;
3340                    let max_encoding_message_size = self.max_encoding_message_size;
3341                    let inner = self.inner.clone();
3342                    let fut = async move {
3343                        let method = ListCheckpointsSvc(inner);
3344                        let codec = tonic_prost::ProstCodec::default();
3345                        let mut grpc = tonic::server::Grpc::new(codec)
3346                            .apply_compression_config(
3347                                accept_compression_encodings,
3348                                send_compression_encodings,
3349                            )
3350                            .apply_max_message_size_config(
3351                                max_decoding_message_size,
3352                                max_encoding_message_size,
3353                            );
3354                        let res = grpc.server_streaming(method, req).await;
3355                        Ok(res)
3356                    };
3357                    Box::pin(fut)
3358                }
3359                "/sui.rpc.v2.LedgerService/ListTransactions" => {
3360                    #[allow(non_camel_case_types)]
3361                    struct ListTransactionsSvc<T: LedgerService>(pub Arc<T>);
3362                    impl<
3363                        T: LedgerService,
3364                    > tonic::server::ServerStreamingService<
3365                        super::ListTransactionsRequest,
3366                    > for ListTransactionsSvc<T> {
3367                        type Response = super::ListTransactionsResponse;
3368                        type ResponseStream = BoxStream<super::ListTransactionsResponse>;
3369                        type Future = BoxFuture<
3370                            tonic::Response<Self::ResponseStream>,
3371                            tonic::Status,
3372                        >;
3373                        fn call(
3374                            &mut self,
3375                            request: tonic::Request<super::ListTransactionsRequest>,
3376                        ) -> Self::Future {
3377                            let inner = Arc::clone(&self.0);
3378                            let fut = async move {
3379                                <T as LedgerService>::list_transactions(&inner, request)
3380                                    .await
3381                            };
3382                            Box::pin(fut)
3383                        }
3384                    }
3385                    let accept_compression_encodings = self.accept_compression_encodings;
3386                    let send_compression_encodings = self.send_compression_encodings;
3387                    let max_decoding_message_size = self.max_decoding_message_size;
3388                    let max_encoding_message_size = self.max_encoding_message_size;
3389                    let inner = self.inner.clone();
3390                    let fut = async move {
3391                        let method = ListTransactionsSvc(inner);
3392                        let codec = tonic_prost::ProstCodec::default();
3393                        let mut grpc = tonic::server::Grpc::new(codec)
3394                            .apply_compression_config(
3395                                accept_compression_encodings,
3396                                send_compression_encodings,
3397                            )
3398                            .apply_max_message_size_config(
3399                                max_decoding_message_size,
3400                                max_encoding_message_size,
3401                            );
3402                        let res = grpc.server_streaming(method, req).await;
3403                        Ok(res)
3404                    };
3405                    Box::pin(fut)
3406                }
3407                "/sui.rpc.v2.LedgerService/ListEvents" => {
3408                    #[allow(non_camel_case_types)]
3409                    struct ListEventsSvc<T: LedgerService>(pub Arc<T>);
3410                    impl<
3411                        T: LedgerService,
3412                    > tonic::server::ServerStreamingService<super::ListEventsRequest>
3413                    for ListEventsSvc<T> {
3414                        type Response = super::ListEventsResponse;
3415                        type ResponseStream = BoxStream<super::ListEventsResponse>;
3416                        type Future = BoxFuture<
3417                            tonic::Response<Self::ResponseStream>,
3418                            tonic::Status,
3419                        >;
3420                        fn call(
3421                            &mut self,
3422                            request: tonic::Request<super::ListEventsRequest>,
3423                        ) -> Self::Future {
3424                            let inner = Arc::clone(&self.0);
3425                            let fut = async move {
3426                                <T as LedgerService>::list_events(&inner, request).await
3427                            };
3428                            Box::pin(fut)
3429                        }
3430                    }
3431                    let accept_compression_encodings = self.accept_compression_encodings;
3432                    let send_compression_encodings = self.send_compression_encodings;
3433                    let max_decoding_message_size = self.max_decoding_message_size;
3434                    let max_encoding_message_size = self.max_encoding_message_size;
3435                    let inner = self.inner.clone();
3436                    let fut = async move {
3437                        let method = ListEventsSvc(inner);
3438                        let codec = tonic_prost::ProstCodec::default();
3439                        let mut grpc = tonic::server::Grpc::new(codec)
3440                            .apply_compression_config(
3441                                accept_compression_encodings,
3442                                send_compression_encodings,
3443                            )
3444                            .apply_max_message_size_config(
3445                                max_decoding_message_size,
3446                                max_encoding_message_size,
3447                            );
3448                        let res = grpc.server_streaming(method, req).await;
3449                        Ok(res)
3450                    };
3451                    Box::pin(fut)
3452                }
3453                _ => {
3454                    Box::pin(async move {
3455                        let mut response = http::Response::new(
3456                            tonic::body::Body::default(),
3457                        );
3458                        let headers = response.headers_mut();
3459                        headers
3460                            .insert(
3461                                tonic::Status::GRPC_STATUS,
3462                                (tonic::Code::Unimplemented as i32).into(),
3463                            );
3464                        headers
3465                            .insert(
3466                                http::header::CONTENT_TYPE,
3467                                tonic::metadata::GRPC_CONTENT_TYPE,
3468                            );
3469                        Ok(response)
3470                    })
3471                }
3472            }
3473        }
3474    }
3475    impl<T> Clone for LedgerServiceServer<T> {
3476        fn clone(&self) -> Self {
3477            let inner = self.inner.clone();
3478            Self {
3479                inner,
3480                accept_compression_encodings: self.accept_compression_encodings,
3481                send_compression_encodings: self.send_compression_encodings,
3482                max_decoding_message_size: self.max_decoding_message_size,
3483                max_encoding_message_size: self.max_encoding_message_size,
3484            }
3485        }
3486    }
3487    /// Generated gRPC service name
3488    pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
3489    impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
3490        const NAME: &'static str = SERVICE_NAME;
3491    }
3492}
3493/// A Move Package
3494#[non_exhaustive]
3495#[derive(Clone, PartialEq, ::prost::Message)]
3496pub struct Package {
3497    /// The PackageId of this package
3498    ///
3499    /// A package's `storage_id` is the Sui ObjectId of the package on-chain.
3500    /// Outside of system packages the `storage_id` for every package version is
3501    /// different.
3502    #[prost(string, optional, tag = "1")]
3503    pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
3504    /// The PackageId of the first published version of this package.
3505    ///
3506    /// A package's `original_id` (sometimes also called its `runtime_id`) is the
3507    /// `storage_id` of the first version of this package that has been published.
3508    /// The `original_id`/`runtime_id` is stable across all versions of the
3509    /// package and does not ever change.
3510    #[prost(string, optional, tag = "2")]
3511    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3512    /// The version of this package
3513    #[prost(uint64, optional, tag = "3")]
3514    pub version: ::core::option::Option<u64>,
3515    /// The modules defined by this package
3516    #[prost(message, repeated, tag = "4")]
3517    pub modules: ::prost::alloc::vec::Vec<Module>,
3518    /// List of datatype origins for mapping datatypes to a package version where
3519    /// it was first defined
3520    #[prost(message, repeated, tag = "5")]
3521    pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
3522    /// The package's transitive dependencies as a mapping from the package's
3523    /// runtime Id (the Id it is referred to by in other packages) to its
3524    /// storage Id (the Id it is loaded from on chain).
3525    #[prost(message, repeated, tag = "6")]
3526    pub linkage: ::prost::alloc::vec::Vec<Linkage>,
3527}
3528/// A Move Module.
3529#[non_exhaustive]
3530#[derive(Clone, PartialEq, ::prost::Message)]
3531pub struct Module {
3532    /// Name of this module.
3533    #[prost(string, optional, tag = "1")]
3534    pub name: ::core::option::Option<::prost::alloc::string::String>,
3535    /// Serialized bytecode of the module.
3536    #[prost(bytes = "bytes", optional, tag = "2")]
3537    pub contents: ::core::option::Option<::prost::bytes::Bytes>,
3538    /// List of DataTypes defined by this module.
3539    #[prost(message, repeated, tag = "3")]
3540    pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
3541    /// List of Functions defined by this module.
3542    #[prost(message, repeated, tag = "4")]
3543    pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
3544}
3545/// Describes a Move Datatype.
3546#[non_exhaustive]
3547#[derive(Clone, PartialEq, ::prost::Message)]
3548pub struct DatatypeDescriptor {
3549    /// Fully qualified name of this Datatype.
3550    ///
3551    /// This is `<defining_id>::<module>::<name>`
3552    #[prost(string, optional, tag = "1")]
3553    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3554    /// PackageId of the package where this Datatype is defined.
3555    ///
3556    /// A type's `defining_id` is the `storage_id` of the package version that first introduced or added that type.
3557    #[prost(string, optional, tag = "2")]
3558    pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
3559    /// Name of the module where this Datatype is defined
3560    #[prost(string, optional, tag = "3")]
3561    pub module: ::core::option::Option<::prost::alloc::string::String>,
3562    /// Name of this Datatype
3563    #[prost(string, optional, tag = "4")]
3564    pub name: ::core::option::Option<::prost::alloc::string::String>,
3565    /// This type's abilities
3566    #[prost(enumeration = "Ability", repeated, tag = "5")]
3567    pub abilities: ::prost::alloc::vec::Vec<i32>,
3568    /// Ability constraints and phantom status for this type's generic type parameters
3569    #[prost(message, repeated, tag = "6")]
3570    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3571    /// Indicates whether this datatype is a 'STRUCT' or an 'ENUM'
3572    #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
3573    pub kind: ::core::option::Option<i32>,
3574    /// Set of fields if this Datatype is a struct.
3575    ///
3576    /// The order of the entries is the order of how the fields are defined.
3577    #[prost(message, repeated, tag = "8")]
3578    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3579    /// Set of variants if this Datatype is an enum.
3580    ///
3581    /// The order of the entries is the order of how the variants are defined.
3582    #[prost(message, repeated, tag = "9")]
3583    pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
3584}
3585/// Nested message and enum types in `DatatypeDescriptor`.
3586pub mod datatype_descriptor {
3587    #[non_exhaustive]
3588    #[derive(
3589        Clone,
3590        Copy,
3591        Debug,
3592        PartialEq,
3593        Eq,
3594        Hash,
3595        PartialOrd,
3596        Ord,
3597        ::prost::Enumeration
3598    )]
3599    #[repr(i32)]
3600    pub enum DatatypeKind {
3601        Unknown = 0,
3602        Struct = 1,
3603        Enum = 2,
3604    }
3605    impl DatatypeKind {
3606        /// String value of the enum field names used in the ProtoBuf definition.
3607        ///
3608        /// The values are not transformed in any way and thus are considered stable
3609        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3610        pub fn as_str_name(&self) -> &'static str {
3611            match self {
3612                Self::Unknown => "DATATYPE_KIND_UNKNOWN",
3613                Self::Struct => "STRUCT",
3614                Self::Enum => "ENUM",
3615            }
3616        }
3617        /// Creates an enum from field names used in the ProtoBuf definition.
3618        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3619            match value {
3620                "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
3621                "STRUCT" => Some(Self::Struct),
3622                "ENUM" => Some(Self::Enum),
3623                _ => None,
3624            }
3625        }
3626    }
3627}
3628/// A generic type parameter used in the declaration of a struct or enum.
3629#[non_exhaustive]
3630#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3631pub struct TypeParameter {
3632    /// The type parameter constraints
3633    #[prost(enumeration = "Ability", repeated, tag = "1")]
3634    pub constraints: ::prost::alloc::vec::Vec<i32>,
3635    /// Whether the parameter is declared as phantom
3636    #[prost(bool, optional, tag = "2")]
3637    pub is_phantom: ::core::option::Option<bool>,
3638}
3639/// Descriptor of a field that belongs to a struct or enum variant
3640#[non_exhaustive]
3641#[derive(Clone, PartialEq, ::prost::Message)]
3642pub struct FieldDescriptor {
3643    /// Name of the field
3644    #[prost(string, optional, tag = "1")]
3645    pub name: ::core::option::Option<::prost::alloc::string::String>,
3646    /// Order or position of the field in the struct or enum variant definition.
3647    #[prost(uint32, optional, tag = "2")]
3648    pub position: ::core::option::Option<u32>,
3649    /// The type of the field
3650    #[prost(message, optional, tag = "3")]
3651    pub r#type: ::core::option::Option<OpenSignatureBody>,
3652}
3653/// Descriptor of an enum variant
3654#[non_exhaustive]
3655#[derive(Clone, PartialEq, ::prost::Message)]
3656pub struct VariantDescriptor {
3657    /// Name of the variant
3658    #[prost(string, optional, tag = "1")]
3659    pub name: ::core::option::Option<::prost::alloc::string::String>,
3660    /// Order or position of the variant in the enum definition.
3661    #[prost(uint32, optional, tag = "2")]
3662    pub position: ::core::option::Option<u32>,
3663    /// Set of fields defined by this variant.
3664    #[prost(message, repeated, tag = "3")]
3665    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3666}
3667/// Representation of a type signature that could appear as a field type for a struct or enum
3668#[non_exhaustive]
3669#[derive(Clone, PartialEq, ::prost::Message)]
3670pub struct OpenSignatureBody {
3671    /// Type of this signature
3672    #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
3673    pub r#type: ::core::option::Option<i32>,
3674    /// Fully qualified name of the datatype when `type` is `DATATYPE`
3675    #[prost(string, optional, tag = "2")]
3676    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3677    /// Set when `type` is `VECTOR` or `DATATYPE`
3678    #[prost(message, repeated, tag = "3")]
3679    pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
3680    /// Position of the type parameter as defined in the containing data type descriptor when `type` is `TYPE_PARAMETER`
3681    #[prost(uint32, optional, tag = "4")]
3682    pub type_parameter: ::core::option::Option<u32>,
3683}
3684/// Nested message and enum types in `OpenSignatureBody`.
3685pub mod open_signature_body {
3686    #[non_exhaustive]
3687    #[derive(
3688        Clone,
3689        Copy,
3690        Debug,
3691        PartialEq,
3692        Eq,
3693        Hash,
3694        PartialOrd,
3695        Ord,
3696        ::prost::Enumeration
3697    )]
3698    #[repr(i32)]
3699    pub enum Type {
3700        Unknown = 0,
3701        Address = 1,
3702        Bool = 2,
3703        U8 = 3,
3704        U16 = 4,
3705        U32 = 5,
3706        U64 = 6,
3707        U128 = 7,
3708        U256 = 8,
3709        Vector = 9,
3710        Datatype = 10,
3711        Parameter = 11,
3712    }
3713    impl Type {
3714        /// String value of the enum field names used in the ProtoBuf definition.
3715        ///
3716        /// The values are not transformed in any way and thus are considered stable
3717        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3718        pub fn as_str_name(&self) -> &'static str {
3719            match self {
3720                Self::Unknown => "TYPE_UNKNOWN",
3721                Self::Address => "ADDRESS",
3722                Self::Bool => "BOOL",
3723                Self::U8 => "U8",
3724                Self::U16 => "U16",
3725                Self::U32 => "U32",
3726                Self::U64 => "U64",
3727                Self::U128 => "U128",
3728                Self::U256 => "U256",
3729                Self::Vector => "VECTOR",
3730                Self::Datatype => "DATATYPE",
3731                Self::Parameter => "TYPE_PARAMETER",
3732            }
3733        }
3734        /// Creates an enum from field names used in the ProtoBuf definition.
3735        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3736            match value {
3737                "TYPE_UNKNOWN" => Some(Self::Unknown),
3738                "ADDRESS" => Some(Self::Address),
3739                "BOOL" => Some(Self::Bool),
3740                "U8" => Some(Self::U8),
3741                "U16" => Some(Self::U16),
3742                "U32" => Some(Self::U32),
3743                "U64" => Some(Self::U64),
3744                "U128" => Some(Self::U128),
3745                "U256" => Some(Self::U256),
3746                "VECTOR" => Some(Self::Vector),
3747                "DATATYPE" => Some(Self::Datatype),
3748                "TYPE_PARAMETER" => Some(Self::Parameter),
3749                _ => None,
3750            }
3751        }
3752    }
3753}
3754/// Descriptor of a Move function
3755#[non_exhaustive]
3756#[derive(Clone, PartialEq, ::prost::Message)]
3757pub struct FunctionDescriptor {
3758    /// Name of the function
3759    #[prost(string, optional, tag = "1")]
3760    pub name: ::core::option::Option<::prost::alloc::string::String>,
3761    /// Whether the function is `public`, `private` or `public(friend)`
3762    #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
3763    pub visibility: ::core::option::Option<i32>,
3764    /// Whether the function is marked `entry` or not.
3765    #[prost(bool, optional, tag = "6")]
3766    pub is_entry: ::core::option::Option<bool>,
3767    /// Ability constraints for type parameters
3768    #[prost(message, repeated, tag = "7")]
3769    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3770    /// Formal parameter types.
3771    #[prost(message, repeated, tag = "8")]
3772    pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
3773    /// Return types.
3774    #[prost(message, repeated, tag = "9")]
3775    pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
3776}
3777/// Nested message and enum types in `FunctionDescriptor`.
3778pub mod function_descriptor {
3779    #[non_exhaustive]
3780    #[derive(
3781        Clone,
3782        Copy,
3783        Debug,
3784        PartialEq,
3785        Eq,
3786        Hash,
3787        PartialOrd,
3788        Ord,
3789        ::prost::Enumeration
3790    )]
3791    #[repr(i32)]
3792    pub enum Visibility {
3793        Unknown = 0,
3794        Private = 1,
3795        Public = 2,
3796        Friend = 3,
3797    }
3798    impl Visibility {
3799        /// String value of the enum field names used in the ProtoBuf definition.
3800        ///
3801        /// The values are not transformed in any way and thus are considered stable
3802        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3803        pub fn as_str_name(&self) -> &'static str {
3804            match self {
3805                Self::Unknown => "VISIBILITY_UNKNOWN",
3806                Self::Private => "PRIVATE",
3807                Self::Public => "PUBLIC",
3808                Self::Friend => "FRIEND",
3809            }
3810        }
3811        /// Creates an enum from field names used in the ProtoBuf definition.
3812        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3813            match value {
3814                "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
3815                "PRIVATE" => Some(Self::Private),
3816                "PUBLIC" => Some(Self::Public),
3817                "FRIEND" => Some(Self::Friend),
3818                _ => None,
3819            }
3820        }
3821    }
3822}
3823/// Representation of a type signature that could appear as a function parameter or return value.
3824#[non_exhaustive]
3825#[derive(Clone, PartialEq, ::prost::Message)]
3826pub struct OpenSignature {
3827    #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
3828    pub reference: ::core::option::Option<i32>,
3829    #[prost(message, optional, tag = "2")]
3830    pub body: ::core::option::Option<OpenSignatureBody>,
3831}
3832/// Nested message and enum types in `OpenSignature`.
3833pub mod open_signature {
3834    #[non_exhaustive]
3835    #[derive(
3836        Clone,
3837        Copy,
3838        Debug,
3839        PartialEq,
3840        Eq,
3841        Hash,
3842        PartialOrd,
3843        Ord,
3844        ::prost::Enumeration
3845    )]
3846    #[repr(i32)]
3847    pub enum Reference {
3848        Unknown = 0,
3849        Immutable = 1,
3850        Mutable = 2,
3851    }
3852    impl Reference {
3853        /// String value of the enum field names used in the ProtoBuf definition.
3854        ///
3855        /// The values are not transformed in any way and thus are considered stable
3856        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3857        pub fn as_str_name(&self) -> &'static str {
3858            match self {
3859                Self::Unknown => "REFERENCE_UNKNOWN",
3860                Self::Immutable => "IMMUTABLE",
3861                Self::Mutable => "MUTABLE",
3862            }
3863        }
3864        /// Creates an enum from field names used in the ProtoBuf definition.
3865        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3866            match value {
3867                "REFERENCE_UNKNOWN" => Some(Self::Unknown),
3868                "IMMUTABLE" => Some(Self::Immutable),
3869                "MUTABLE" => Some(Self::Mutable),
3870                _ => None,
3871            }
3872        }
3873    }
3874}
3875/// Identifies a struct and the module it was defined in.
3876#[non_exhaustive]
3877#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3878pub struct TypeOrigin {
3879    #[prost(string, optional, tag = "1")]
3880    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3881    #[prost(string, optional, tag = "2")]
3882    pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
3883    #[prost(string, optional, tag = "3")]
3884    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3885}
3886/// Upgraded package info for the linkage table.
3887#[non_exhaustive]
3888#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3889pub struct Linkage {
3890    /// Id of the original package.
3891    #[prost(string, optional, tag = "1")]
3892    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3893    /// Id of the upgraded package.
3894    #[prost(string, optional, tag = "2")]
3895    pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
3896    /// Version of the upgraded package.
3897    #[prost(uint64, optional, tag = "3")]
3898    pub upgraded_version: ::core::option::Option<u64>,
3899}
3900/// An `Ability` classifies what operations are permitted for a given type
3901#[non_exhaustive]
3902#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3903#[repr(i32)]
3904pub enum Ability {
3905    Unknown = 0,
3906    /// Allows values of types with this ability to be copied
3907    Copy = 1,
3908    /// Allows values of types with this ability to be dropped.
3909    Drop = 2,
3910    /// Allows values of types with this ability to exist inside a struct in global storage
3911    Store = 3,
3912    /// Allows the type to serve as a key for global storage operations
3913    Key = 4,
3914}
3915impl Ability {
3916    /// String value of the enum field names used in the ProtoBuf definition.
3917    ///
3918    /// The values are not transformed in any way and thus are considered stable
3919    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3920    pub fn as_str_name(&self) -> &'static str {
3921        match self {
3922            Self::Unknown => "ABILITY_UNKNOWN",
3923            Self::Copy => "COPY",
3924            Self::Drop => "DROP",
3925            Self::Store => "STORE",
3926            Self::Key => "KEY",
3927        }
3928    }
3929    /// Creates an enum from field names used in the ProtoBuf definition.
3930    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3931        match value {
3932            "ABILITY_UNKNOWN" => Some(Self::Unknown),
3933            "COPY" => Some(Self::Copy),
3934            "DROP" => Some(Self::Drop),
3935            "STORE" => Some(Self::Store),
3936            "KEY" => Some(Self::Key),
3937            _ => None,
3938        }
3939    }
3940}
3941#[non_exhaustive]
3942#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3943pub struct GetPackageRequest {
3944    /// Required. The `storage_id` of any version of the requested package.
3945    ///
3946    /// When no `selector` is set, the package stored at exactly this id is
3947    /// returned. When a `selector` is set, `package_id` only identifies the
3948    /// package's upgrade lineage (via its original id), and the selected
3949    /// version within that lineage is returned.
3950    #[prost(string, optional, tag = "1")]
3951    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3952    /// Optional. Return the package in `package_id`'s upgrade lineage that
3953    /// matches one of the following:
3954    ///
3955    /// * `version`: the package with exactly this version.
3956    /// * `at_checkpoint`: the latest package that existed at or before this
3957    ///   checkpoint. The checkpoint must be at or below the highest checkpoint
3958    ///   the server has indexed; larger values fail with `NOT_FOUND` instead of
3959    ///   resolving to the latest known version, so a successful response is
3960    ///   exact as of `at_checkpoint`. Servers that prune history may also fail
3961    ///   with `NOT_FOUND` for checkpoints below their lowest available one.
3962    ///
3963    /// If neither is set, the package stored at `package_id` is returned.
3964    #[prost(oneof = "get_package_request::Selector", tags = "2, 3")]
3965    pub selector: ::core::option::Option<get_package_request::Selector>,
3966}
3967/// Nested message and enum types in `GetPackageRequest`.
3968pub mod get_package_request {
3969    /// Optional. Return the package in `package_id`'s upgrade lineage that
3970    /// matches one of the following:
3971    ///
3972    /// * `version`: the package with exactly this version.
3973    /// * `at_checkpoint`: the latest package that existed at or before this
3974    ///   checkpoint. The checkpoint must be at or below the highest checkpoint
3975    ///   the server has indexed; larger values fail with `NOT_FOUND` instead of
3976    ///   resolving to the latest known version, so a successful response is
3977    ///   exact as of `at_checkpoint`. Servers that prune history may also fail
3978    ///   with `NOT_FOUND` for checkpoints below their lowest available one.
3979    ///
3980    /// If neither is set, the package stored at `package_id` is returned.
3981    #[non_exhaustive]
3982    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
3983    pub enum Selector {
3984        #[prost(uint64, tag = "2")]
3985        Version(u64),
3986        #[prost(uint64, tag = "3")]
3987        AtCheckpoint(u64),
3988    }
3989}
3990#[non_exhaustive]
3991#[derive(Clone, PartialEq, ::prost::Message)]
3992pub struct GetPackageResponse {
3993    /// The package.
3994    #[prost(message, optional, tag = "1")]
3995    pub package: ::core::option::Option<Package>,
3996}
3997#[non_exhaustive]
3998#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3999pub struct GetDatatypeRequest {
4000    /// Required. The `storage_id` of the requested package.
4001    #[prost(string, optional, tag = "1")]
4002    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4003    /// Required. The name of the requested module.
4004    #[prost(string, optional, tag = "2")]
4005    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4006    /// Required. The name of the requested datatype.
4007    #[prost(string, optional, tag = "3")]
4008    pub name: ::core::option::Option<::prost::alloc::string::String>,
4009}
4010#[non_exhaustive]
4011#[derive(Clone, PartialEq, ::prost::Message)]
4012pub struct GetDatatypeResponse {
4013    /// The datatype.
4014    #[prost(message, optional, tag = "1")]
4015    pub datatype: ::core::option::Option<DatatypeDescriptor>,
4016}
4017#[non_exhaustive]
4018#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4019pub struct GetFunctionRequest {
4020    /// Required. The `storage_id` of the requested package.
4021    #[prost(string, optional, tag = "1")]
4022    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4023    /// Required. The name of the requested module.
4024    #[prost(string, optional, tag = "2")]
4025    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4026    /// Required. The name of the requested function.
4027    #[prost(string, optional, tag = "3")]
4028    pub name: ::core::option::Option<::prost::alloc::string::String>,
4029}
4030#[non_exhaustive]
4031#[derive(Clone, PartialEq, ::prost::Message)]
4032pub struct GetFunctionResponse {
4033    /// The function.
4034    #[prost(message, optional, tag = "1")]
4035    pub function: ::core::option::Option<FunctionDescriptor>,
4036}
4037#[non_exhaustive]
4038#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4039pub struct ListPackageVersionsRequest {
4040    /// Required. The `storage_id` of any version of the package.
4041    #[prost(string, optional, tag = "1")]
4042    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4043    /// The maximum number of versions to return. The service may return fewer than this value.
4044    /// If unspecified, at most `1000` entries will be returned.
4045    /// The maximum value is `10000`; values above `10000` will be coerced to `10000`.
4046    #[prost(uint32, optional, tag = "2")]
4047    pub page_size: ::core::option::Option<u32>,
4048    /// A page token, received from a previous `ListPackageVersions` call.
4049    /// Provide this to retrieve the subsequent page.
4050    ///
4051    /// When paginating, all other parameters provided to `ListPackageVersions` must
4052    /// match the call that provided the page token.
4053    #[prost(bytes = "bytes", optional, tag = "3")]
4054    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
4055}
4056#[non_exhaustive]
4057#[derive(Clone, PartialEq, ::prost::Message)]
4058pub struct ListPackageVersionsResponse {
4059    /// List of all package versions, ordered by version.
4060    #[prost(message, repeated, tag = "1")]
4061    pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
4062    /// A token, which can be sent as `page_token` to retrieve the next page.
4063    /// If this field is omitted, there are no subsequent pages.
4064    #[prost(bytes = "bytes", optional, tag = "2")]
4065    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
4066}
4067/// A simplified representation of a package version
4068#[non_exhaustive]
4069#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4070pub struct PackageVersion {
4071    /// The storage ID of this package version
4072    #[prost(string, optional, tag = "1")]
4073    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4074    /// The version number
4075    #[prost(uint64, optional, tag = "2")]
4076    pub version: ::core::option::Option<u64>,
4077}
4078/// Generated client implementations.
4079pub mod move_package_service_client {
4080    #![allow(
4081        unused_variables,
4082        dead_code,
4083        missing_docs,
4084        clippy::wildcard_imports,
4085        clippy::let_unit_value,
4086    )]
4087    use tonic::codegen::*;
4088    use tonic::codegen::http::Uri;
4089    #[derive(Debug, Clone)]
4090    pub struct MovePackageServiceClient<T> {
4091        inner: tonic::client::Grpc<T>,
4092    }
4093    impl MovePackageServiceClient<tonic::transport::Channel> {
4094        /// Attempt to create a new client by connecting to a given endpoint.
4095        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4096        where
4097            D: TryInto<tonic::transport::Endpoint>,
4098            D::Error: Into<StdError>,
4099        {
4100            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4101            Ok(Self::new(conn))
4102        }
4103    }
4104    impl<T> MovePackageServiceClient<T>
4105    where
4106        T: tonic::client::GrpcService<tonic::body::Body>,
4107        T::Error: Into<StdError>,
4108        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4109        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4110    {
4111        pub fn new(inner: T) -> Self {
4112            let inner = tonic::client::Grpc::new(inner);
4113            Self { inner }
4114        }
4115        pub fn with_origin(inner: T, origin: Uri) -> Self {
4116            let inner = tonic::client::Grpc::with_origin(inner, origin);
4117            Self { inner }
4118        }
4119        pub fn with_interceptor<F>(
4120            inner: T,
4121            interceptor: F,
4122        ) -> MovePackageServiceClient<InterceptedService<T, F>>
4123        where
4124            F: tonic::service::Interceptor,
4125            T::ResponseBody: Default,
4126            T: tonic::codegen::Service<
4127                http::Request<tonic::body::Body>,
4128                Response = http::Response<
4129                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4130                >,
4131            >,
4132            <T as tonic::codegen::Service<
4133                http::Request<tonic::body::Body>,
4134            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4135        {
4136            MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
4137        }
4138        /// Compress requests with the given encoding.
4139        ///
4140        /// This requires the server to support it otherwise it might respond with an
4141        /// error.
4142        #[must_use]
4143        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4144            self.inner = self.inner.send_compressed(encoding);
4145            self
4146        }
4147        /// Enable decompressing responses.
4148        #[must_use]
4149        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4150            self.inner = self.inner.accept_compressed(encoding);
4151            self
4152        }
4153        /// Limits the maximum size of a decoded message.
4154        ///
4155        /// Default: `4MB`
4156        #[must_use]
4157        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4158            self.inner = self.inner.max_decoding_message_size(limit);
4159            self
4160        }
4161        /// Limits the maximum size of an encoded message.
4162        ///
4163        /// Default: `usize::MAX`
4164        #[must_use]
4165        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4166            self.inner = self.inner.max_encoding_message_size(limit);
4167            self
4168        }
4169        pub async fn get_package(
4170            &mut self,
4171            request: impl tonic::IntoRequest<super::GetPackageRequest>,
4172        ) -> std::result::Result<
4173            tonic::Response<super::GetPackageResponse>,
4174            tonic::Status,
4175        > {
4176            self.inner
4177                .ready()
4178                .await
4179                .map_err(|e| {
4180                    tonic::Status::unknown(
4181                        format!("Service was not ready: {}", e.into()),
4182                    )
4183                })?;
4184            let codec = tonic_prost::ProstCodec::default();
4185            let path = http::uri::PathAndQuery::from_static(
4186                "/sui.rpc.v2.MovePackageService/GetPackage",
4187            );
4188            let mut req = request.into_request();
4189            req.extensions_mut()
4190                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
4191            self.inner.unary(req, path, codec).await
4192        }
4193        pub async fn get_datatype(
4194            &mut self,
4195            request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
4196        ) -> std::result::Result<
4197            tonic::Response<super::GetDatatypeResponse>,
4198            tonic::Status,
4199        > {
4200            self.inner
4201                .ready()
4202                .await
4203                .map_err(|e| {
4204                    tonic::Status::unknown(
4205                        format!("Service was not ready: {}", e.into()),
4206                    )
4207                })?;
4208            let codec = tonic_prost::ProstCodec::default();
4209            let path = http::uri::PathAndQuery::from_static(
4210                "/sui.rpc.v2.MovePackageService/GetDatatype",
4211            );
4212            let mut req = request.into_request();
4213            req.extensions_mut()
4214                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
4215            self.inner.unary(req, path, codec).await
4216        }
4217        pub async fn get_function(
4218            &mut self,
4219            request: impl tonic::IntoRequest<super::GetFunctionRequest>,
4220        ) -> std::result::Result<
4221            tonic::Response<super::GetFunctionResponse>,
4222            tonic::Status,
4223        > {
4224            self.inner
4225                .ready()
4226                .await
4227                .map_err(|e| {
4228                    tonic::Status::unknown(
4229                        format!("Service was not ready: {}", e.into()),
4230                    )
4231                })?;
4232            let codec = tonic_prost::ProstCodec::default();
4233            let path = http::uri::PathAndQuery::from_static(
4234                "/sui.rpc.v2.MovePackageService/GetFunction",
4235            );
4236            let mut req = request.into_request();
4237            req.extensions_mut()
4238                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
4239            self.inner.unary(req, path, codec).await
4240        }
4241        pub async fn list_package_versions(
4242            &mut self,
4243            request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
4244        ) -> std::result::Result<
4245            tonic::Response<super::ListPackageVersionsResponse>,
4246            tonic::Status,
4247        > {
4248            self.inner
4249                .ready()
4250                .await
4251                .map_err(|e| {
4252                    tonic::Status::unknown(
4253                        format!("Service was not ready: {}", e.into()),
4254                    )
4255                })?;
4256            let codec = tonic_prost::ProstCodec::default();
4257            let path = http::uri::PathAndQuery::from_static(
4258                "/sui.rpc.v2.MovePackageService/ListPackageVersions",
4259            );
4260            let mut req = request.into_request();
4261            req.extensions_mut()
4262                .insert(
4263                    GrpcMethod::new(
4264                        "sui.rpc.v2.MovePackageService",
4265                        "ListPackageVersions",
4266                    ),
4267                );
4268            self.inner.unary(req, path, codec).await
4269        }
4270    }
4271}
4272/// Generated server implementations.
4273pub mod move_package_service_server {
4274    #![allow(
4275        unused_variables,
4276        dead_code,
4277        missing_docs,
4278        clippy::wildcard_imports,
4279        clippy::let_unit_value,
4280    )]
4281    use tonic::codegen::*;
4282    /// Generated trait containing gRPC methods that should be implemented for use with MovePackageServiceServer.
4283    #[async_trait]
4284    pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
4285        async fn get_package(
4286            &self,
4287            request: tonic::Request<super::GetPackageRequest>,
4288        ) -> std::result::Result<
4289            tonic::Response<super::GetPackageResponse>,
4290            tonic::Status,
4291        > {
4292            Err(tonic::Status::unimplemented("Not yet implemented"))
4293        }
4294        async fn get_datatype(
4295            &self,
4296            request: tonic::Request<super::GetDatatypeRequest>,
4297        ) -> std::result::Result<
4298            tonic::Response<super::GetDatatypeResponse>,
4299            tonic::Status,
4300        > {
4301            Err(tonic::Status::unimplemented("Not yet implemented"))
4302        }
4303        async fn get_function(
4304            &self,
4305            request: tonic::Request<super::GetFunctionRequest>,
4306        ) -> std::result::Result<
4307            tonic::Response<super::GetFunctionResponse>,
4308            tonic::Status,
4309        > {
4310            Err(tonic::Status::unimplemented("Not yet implemented"))
4311        }
4312        async fn list_package_versions(
4313            &self,
4314            request: tonic::Request<super::ListPackageVersionsRequest>,
4315        ) -> std::result::Result<
4316            tonic::Response<super::ListPackageVersionsResponse>,
4317            tonic::Status,
4318        > {
4319            Err(tonic::Status::unimplemented("Not yet implemented"))
4320        }
4321    }
4322    #[derive(Debug)]
4323    pub struct MovePackageServiceServer<T> {
4324        inner: Arc<T>,
4325        accept_compression_encodings: EnabledCompressionEncodings,
4326        send_compression_encodings: EnabledCompressionEncodings,
4327        max_decoding_message_size: Option<usize>,
4328        max_encoding_message_size: Option<usize>,
4329    }
4330    impl<T> MovePackageServiceServer<T> {
4331        pub fn new(inner: T) -> Self {
4332            Self::from_arc(Arc::new(inner))
4333        }
4334        pub fn from_arc(inner: Arc<T>) -> Self {
4335            Self {
4336                inner,
4337                accept_compression_encodings: Default::default(),
4338                send_compression_encodings: Default::default(),
4339                max_decoding_message_size: None,
4340                max_encoding_message_size: None,
4341            }
4342        }
4343        pub fn with_interceptor<F>(
4344            inner: T,
4345            interceptor: F,
4346        ) -> InterceptedService<Self, F>
4347        where
4348            F: tonic::service::Interceptor,
4349        {
4350            InterceptedService::new(Self::new(inner), interceptor)
4351        }
4352        /// Enable decompressing requests with the given encoding.
4353        #[must_use]
4354        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4355            self.accept_compression_encodings.enable(encoding);
4356            self
4357        }
4358        /// Compress responses with the given encoding, if the client supports it.
4359        #[must_use]
4360        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4361            self.send_compression_encodings.enable(encoding);
4362            self
4363        }
4364        /// Limits the maximum size of a decoded message.
4365        ///
4366        /// Default: `4MB`
4367        #[must_use]
4368        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4369            self.max_decoding_message_size = Some(limit);
4370            self
4371        }
4372        /// Limits the maximum size of an encoded message.
4373        ///
4374        /// Default: `usize::MAX`
4375        #[must_use]
4376        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4377            self.max_encoding_message_size = Some(limit);
4378            self
4379        }
4380    }
4381    impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
4382    where
4383        T: MovePackageService,
4384        B: Body + std::marker::Send + 'static,
4385        B::Error: Into<StdError> + std::marker::Send + 'static,
4386    {
4387        type Response = http::Response<tonic::body::Body>;
4388        type Error = std::convert::Infallible;
4389        type Future = BoxFuture<Self::Response, Self::Error>;
4390        fn poll_ready(
4391            &mut self,
4392            _cx: &mut Context<'_>,
4393        ) -> Poll<std::result::Result<(), Self::Error>> {
4394            Poll::Ready(Ok(()))
4395        }
4396        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4397            match req.uri().path() {
4398                "/sui.rpc.v2.MovePackageService/GetPackage" => {
4399                    #[allow(non_camel_case_types)]
4400                    struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
4401                    impl<
4402                        T: MovePackageService,
4403                    > tonic::server::UnaryService<super::GetPackageRequest>
4404                    for GetPackageSvc<T> {
4405                        type Response = super::GetPackageResponse;
4406                        type Future = BoxFuture<
4407                            tonic::Response<Self::Response>,
4408                            tonic::Status,
4409                        >;
4410                        fn call(
4411                            &mut self,
4412                            request: tonic::Request<super::GetPackageRequest>,
4413                        ) -> Self::Future {
4414                            let inner = Arc::clone(&self.0);
4415                            let fut = async move {
4416                                <T as MovePackageService>::get_package(&inner, request)
4417                                    .await
4418                            };
4419                            Box::pin(fut)
4420                        }
4421                    }
4422                    let accept_compression_encodings = self.accept_compression_encodings;
4423                    let send_compression_encodings = self.send_compression_encodings;
4424                    let max_decoding_message_size = self.max_decoding_message_size;
4425                    let max_encoding_message_size = self.max_encoding_message_size;
4426                    let inner = self.inner.clone();
4427                    let fut = async move {
4428                        let method = GetPackageSvc(inner);
4429                        let codec = tonic_prost::ProstCodec::default();
4430                        let mut grpc = tonic::server::Grpc::new(codec)
4431                            .apply_compression_config(
4432                                accept_compression_encodings,
4433                                send_compression_encodings,
4434                            )
4435                            .apply_max_message_size_config(
4436                                max_decoding_message_size,
4437                                max_encoding_message_size,
4438                            );
4439                        let res = grpc.unary(method, req).await;
4440                        Ok(res)
4441                    };
4442                    Box::pin(fut)
4443                }
4444                "/sui.rpc.v2.MovePackageService/GetDatatype" => {
4445                    #[allow(non_camel_case_types)]
4446                    struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
4447                    impl<
4448                        T: MovePackageService,
4449                    > tonic::server::UnaryService<super::GetDatatypeRequest>
4450                    for GetDatatypeSvc<T> {
4451                        type Response = super::GetDatatypeResponse;
4452                        type Future = BoxFuture<
4453                            tonic::Response<Self::Response>,
4454                            tonic::Status,
4455                        >;
4456                        fn call(
4457                            &mut self,
4458                            request: tonic::Request<super::GetDatatypeRequest>,
4459                        ) -> Self::Future {
4460                            let inner = Arc::clone(&self.0);
4461                            let fut = async move {
4462                                <T as MovePackageService>::get_datatype(&inner, request)
4463                                    .await
4464                            };
4465                            Box::pin(fut)
4466                        }
4467                    }
4468                    let accept_compression_encodings = self.accept_compression_encodings;
4469                    let send_compression_encodings = self.send_compression_encodings;
4470                    let max_decoding_message_size = self.max_decoding_message_size;
4471                    let max_encoding_message_size = self.max_encoding_message_size;
4472                    let inner = self.inner.clone();
4473                    let fut = async move {
4474                        let method = GetDatatypeSvc(inner);
4475                        let codec = tonic_prost::ProstCodec::default();
4476                        let mut grpc = tonic::server::Grpc::new(codec)
4477                            .apply_compression_config(
4478                                accept_compression_encodings,
4479                                send_compression_encodings,
4480                            )
4481                            .apply_max_message_size_config(
4482                                max_decoding_message_size,
4483                                max_encoding_message_size,
4484                            );
4485                        let res = grpc.unary(method, req).await;
4486                        Ok(res)
4487                    };
4488                    Box::pin(fut)
4489                }
4490                "/sui.rpc.v2.MovePackageService/GetFunction" => {
4491                    #[allow(non_camel_case_types)]
4492                    struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
4493                    impl<
4494                        T: MovePackageService,
4495                    > tonic::server::UnaryService<super::GetFunctionRequest>
4496                    for GetFunctionSvc<T> {
4497                        type Response = super::GetFunctionResponse;
4498                        type Future = BoxFuture<
4499                            tonic::Response<Self::Response>,
4500                            tonic::Status,
4501                        >;
4502                        fn call(
4503                            &mut self,
4504                            request: tonic::Request<super::GetFunctionRequest>,
4505                        ) -> Self::Future {
4506                            let inner = Arc::clone(&self.0);
4507                            let fut = async move {
4508                                <T as MovePackageService>::get_function(&inner, request)
4509                                    .await
4510                            };
4511                            Box::pin(fut)
4512                        }
4513                    }
4514                    let accept_compression_encodings = self.accept_compression_encodings;
4515                    let send_compression_encodings = self.send_compression_encodings;
4516                    let max_decoding_message_size = self.max_decoding_message_size;
4517                    let max_encoding_message_size = self.max_encoding_message_size;
4518                    let inner = self.inner.clone();
4519                    let fut = async move {
4520                        let method = GetFunctionSvc(inner);
4521                        let codec = tonic_prost::ProstCodec::default();
4522                        let mut grpc = tonic::server::Grpc::new(codec)
4523                            .apply_compression_config(
4524                                accept_compression_encodings,
4525                                send_compression_encodings,
4526                            )
4527                            .apply_max_message_size_config(
4528                                max_decoding_message_size,
4529                                max_encoding_message_size,
4530                            );
4531                        let res = grpc.unary(method, req).await;
4532                        Ok(res)
4533                    };
4534                    Box::pin(fut)
4535                }
4536                "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
4537                    #[allow(non_camel_case_types)]
4538                    struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
4539                    impl<
4540                        T: MovePackageService,
4541                    > tonic::server::UnaryService<super::ListPackageVersionsRequest>
4542                    for ListPackageVersionsSvc<T> {
4543                        type Response = super::ListPackageVersionsResponse;
4544                        type Future = BoxFuture<
4545                            tonic::Response<Self::Response>,
4546                            tonic::Status,
4547                        >;
4548                        fn call(
4549                            &mut self,
4550                            request: tonic::Request<super::ListPackageVersionsRequest>,
4551                        ) -> Self::Future {
4552                            let inner = Arc::clone(&self.0);
4553                            let fut = async move {
4554                                <T as MovePackageService>::list_package_versions(
4555                                        &inner,
4556                                        request,
4557                                    )
4558                                    .await
4559                            };
4560                            Box::pin(fut)
4561                        }
4562                    }
4563                    let accept_compression_encodings = self.accept_compression_encodings;
4564                    let send_compression_encodings = self.send_compression_encodings;
4565                    let max_decoding_message_size = self.max_decoding_message_size;
4566                    let max_encoding_message_size = self.max_encoding_message_size;
4567                    let inner = self.inner.clone();
4568                    let fut = async move {
4569                        let method = ListPackageVersionsSvc(inner);
4570                        let codec = tonic_prost::ProstCodec::default();
4571                        let mut grpc = tonic::server::Grpc::new(codec)
4572                            .apply_compression_config(
4573                                accept_compression_encodings,
4574                                send_compression_encodings,
4575                            )
4576                            .apply_max_message_size_config(
4577                                max_decoding_message_size,
4578                                max_encoding_message_size,
4579                            );
4580                        let res = grpc.unary(method, req).await;
4581                        Ok(res)
4582                    };
4583                    Box::pin(fut)
4584                }
4585                _ => {
4586                    Box::pin(async move {
4587                        let mut response = http::Response::new(
4588                            tonic::body::Body::default(),
4589                        );
4590                        let headers = response.headers_mut();
4591                        headers
4592                            .insert(
4593                                tonic::Status::GRPC_STATUS,
4594                                (tonic::Code::Unimplemented as i32).into(),
4595                            );
4596                        headers
4597                            .insert(
4598                                http::header::CONTENT_TYPE,
4599                                tonic::metadata::GRPC_CONTENT_TYPE,
4600                            );
4601                        Ok(response)
4602                    })
4603                }
4604            }
4605        }
4606    }
4607    impl<T> Clone for MovePackageServiceServer<T> {
4608        fn clone(&self) -> Self {
4609            let inner = self.inner.clone();
4610            Self {
4611                inner,
4612                accept_compression_encodings: self.accept_compression_encodings,
4613                send_compression_encodings: self.send_compression_encodings,
4614                max_decoding_message_size: self.max_decoding_message_size,
4615                max_encoding_message_size: self.max_encoding_message_size,
4616            }
4617        }
4618    }
4619    /// Generated gRPC service name
4620    pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
4621    impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
4622        const NAME: &'static str = SERVICE_NAME;
4623    }
4624}
4625#[non_exhaustive]
4626#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4627pub struct LookupNameRequest {
4628    /// Required. The SuiNS name to lookup.
4629    ///
4630    /// Supports both `@name` as well as `name.sui` formats.
4631    #[prost(string, optional, tag = "1")]
4632    pub name: ::core::option::Option<::prost::alloc::string::String>,
4633}
4634#[non_exhaustive]
4635#[derive(Clone, PartialEq, ::prost::Message)]
4636pub struct LookupNameResponse {
4637    /// The record for the requested name
4638    #[prost(message, optional, tag = "1")]
4639    pub record: ::core::option::Option<NameRecord>,
4640}
4641#[non_exhaustive]
4642#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4643pub struct ReverseLookupNameRequest {
4644    /// Required. The address to perform a reverse lookup for.
4645    #[prost(string, optional, tag = "1")]
4646    pub address: ::core::option::Option<::prost::alloc::string::String>,
4647}
4648#[non_exhaustive]
4649#[derive(Clone, PartialEq, ::prost::Message)]
4650pub struct ReverseLookupNameResponse {
4651    /// The record for the SuiNS name linked to the requested address
4652    #[prost(message, optional, tag = "1")]
4653    pub record: ::core::option::Option<NameRecord>,
4654}
4655#[non_exhaustive]
4656#[derive(Clone, PartialEq, ::prost::Message)]
4657pub struct NameRecord {
4658    /// Id of this record.
4659    ///
4660    /// Note that records are stored on chain as dynamic fields of the type
4661    /// `Field<Domain,NameRecord>`.
4662    #[prost(string, optional, tag = "1")]
4663    pub id: ::core::option::Option<::prost::alloc::string::String>,
4664    /// The SuiNS name of this record
4665    #[prost(string, optional, tag = "2")]
4666    pub name: ::core::option::Option<::prost::alloc::string::String>,
4667    /// The ID of the `RegistrationNFT` assigned to this record.
4668    ///
4669    /// The owner of the corresponding `RegistrationNFT` has the rights to
4670    /// be able to change and adjust the `target_address` of this domain.
4671    ///
4672    /// It is possible that the ID changes if the record expires and is
4673    /// purchased by someone else.
4674    #[prost(string, optional, tag = "3")]
4675    pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
4676    /// Timestamp when the record expires.
4677    ///
4678    /// This is either the expiration of the record itself or the expiration of
4679    /// this record's parent if this is a leaf record.
4680    #[prost(message, optional, tag = "4")]
4681    pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
4682    /// The target address that this name points to
4683    #[prost(string, optional, tag = "5")]
4684    pub target_address: ::core::option::Option<::prost::alloc::string::String>,
4685    /// Additional data which may be stored in a record
4686    #[prost(btree_map = "string, string", tag = "6")]
4687    pub data: ::prost::alloc::collections::BTreeMap<
4688        ::prost::alloc::string::String,
4689        ::prost::alloc::string::String,
4690    >,
4691}
4692/// Generated client implementations.
4693pub mod name_service_client {
4694    #![allow(
4695        unused_variables,
4696        dead_code,
4697        missing_docs,
4698        clippy::wildcard_imports,
4699        clippy::let_unit_value,
4700    )]
4701    use tonic::codegen::*;
4702    use tonic::codegen::http::Uri;
4703    #[derive(Debug, Clone)]
4704    pub struct NameServiceClient<T> {
4705        inner: tonic::client::Grpc<T>,
4706    }
4707    impl NameServiceClient<tonic::transport::Channel> {
4708        /// Attempt to create a new client by connecting to a given endpoint.
4709        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4710        where
4711            D: TryInto<tonic::transport::Endpoint>,
4712            D::Error: Into<StdError>,
4713        {
4714            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4715            Ok(Self::new(conn))
4716        }
4717    }
4718    impl<T> NameServiceClient<T>
4719    where
4720        T: tonic::client::GrpcService<tonic::body::Body>,
4721        T::Error: Into<StdError>,
4722        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4723        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4724    {
4725        pub fn new(inner: T) -> Self {
4726            let inner = tonic::client::Grpc::new(inner);
4727            Self { inner }
4728        }
4729        pub fn with_origin(inner: T, origin: Uri) -> Self {
4730            let inner = tonic::client::Grpc::with_origin(inner, origin);
4731            Self { inner }
4732        }
4733        pub fn with_interceptor<F>(
4734            inner: T,
4735            interceptor: F,
4736        ) -> NameServiceClient<InterceptedService<T, F>>
4737        where
4738            F: tonic::service::Interceptor,
4739            T::ResponseBody: Default,
4740            T: tonic::codegen::Service<
4741                http::Request<tonic::body::Body>,
4742                Response = http::Response<
4743                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4744                >,
4745            >,
4746            <T as tonic::codegen::Service<
4747                http::Request<tonic::body::Body>,
4748            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4749        {
4750            NameServiceClient::new(InterceptedService::new(inner, interceptor))
4751        }
4752        /// Compress requests with the given encoding.
4753        ///
4754        /// This requires the server to support it otherwise it might respond with an
4755        /// error.
4756        #[must_use]
4757        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4758            self.inner = self.inner.send_compressed(encoding);
4759            self
4760        }
4761        /// Enable decompressing responses.
4762        #[must_use]
4763        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4764            self.inner = self.inner.accept_compressed(encoding);
4765            self
4766        }
4767        /// Limits the maximum size of a decoded message.
4768        ///
4769        /// Default: `4MB`
4770        #[must_use]
4771        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4772            self.inner = self.inner.max_decoding_message_size(limit);
4773            self
4774        }
4775        /// Limits the maximum size of an encoded message.
4776        ///
4777        /// Default: `usize::MAX`
4778        #[must_use]
4779        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4780            self.inner = self.inner.max_encoding_message_size(limit);
4781            self
4782        }
4783        pub async fn lookup_name(
4784            &mut self,
4785            request: impl tonic::IntoRequest<super::LookupNameRequest>,
4786        ) -> std::result::Result<
4787            tonic::Response<super::LookupNameResponse>,
4788            tonic::Status,
4789        > {
4790            self.inner
4791                .ready()
4792                .await
4793                .map_err(|e| {
4794                    tonic::Status::unknown(
4795                        format!("Service was not ready: {}", e.into()),
4796                    )
4797                })?;
4798            let codec = tonic_prost::ProstCodec::default();
4799            let path = http::uri::PathAndQuery::from_static(
4800                "/sui.rpc.v2.NameService/LookupName",
4801            );
4802            let mut req = request.into_request();
4803            req.extensions_mut()
4804                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
4805            self.inner.unary(req, path, codec).await
4806        }
4807        pub async fn reverse_lookup_name(
4808            &mut self,
4809            request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
4810        ) -> std::result::Result<
4811            tonic::Response<super::ReverseLookupNameResponse>,
4812            tonic::Status,
4813        > {
4814            self.inner
4815                .ready()
4816                .await
4817                .map_err(|e| {
4818                    tonic::Status::unknown(
4819                        format!("Service was not ready: {}", e.into()),
4820                    )
4821                })?;
4822            let codec = tonic_prost::ProstCodec::default();
4823            let path = http::uri::PathAndQuery::from_static(
4824                "/sui.rpc.v2.NameService/ReverseLookupName",
4825            );
4826            let mut req = request.into_request();
4827            req.extensions_mut()
4828                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
4829            self.inner.unary(req, path, codec).await
4830        }
4831    }
4832}
4833/// Generated server implementations.
4834pub mod name_service_server {
4835    #![allow(
4836        unused_variables,
4837        dead_code,
4838        missing_docs,
4839        clippy::wildcard_imports,
4840        clippy::let_unit_value,
4841    )]
4842    use tonic::codegen::*;
4843    /// Generated trait containing gRPC methods that should be implemented for use with NameServiceServer.
4844    #[async_trait]
4845    pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
4846        async fn lookup_name(
4847            &self,
4848            request: tonic::Request<super::LookupNameRequest>,
4849        ) -> std::result::Result<
4850            tonic::Response<super::LookupNameResponse>,
4851            tonic::Status,
4852        > {
4853            Err(tonic::Status::unimplemented("Not yet implemented"))
4854        }
4855        async fn reverse_lookup_name(
4856            &self,
4857            request: tonic::Request<super::ReverseLookupNameRequest>,
4858        ) -> std::result::Result<
4859            tonic::Response<super::ReverseLookupNameResponse>,
4860            tonic::Status,
4861        > {
4862            Err(tonic::Status::unimplemented("Not yet implemented"))
4863        }
4864    }
4865    #[derive(Debug)]
4866    pub struct NameServiceServer<T> {
4867        inner: Arc<T>,
4868        accept_compression_encodings: EnabledCompressionEncodings,
4869        send_compression_encodings: EnabledCompressionEncodings,
4870        max_decoding_message_size: Option<usize>,
4871        max_encoding_message_size: Option<usize>,
4872    }
4873    impl<T> NameServiceServer<T> {
4874        pub fn new(inner: T) -> Self {
4875            Self::from_arc(Arc::new(inner))
4876        }
4877        pub fn from_arc(inner: Arc<T>) -> Self {
4878            Self {
4879                inner,
4880                accept_compression_encodings: Default::default(),
4881                send_compression_encodings: Default::default(),
4882                max_decoding_message_size: None,
4883                max_encoding_message_size: None,
4884            }
4885        }
4886        pub fn with_interceptor<F>(
4887            inner: T,
4888            interceptor: F,
4889        ) -> InterceptedService<Self, F>
4890        where
4891            F: tonic::service::Interceptor,
4892        {
4893            InterceptedService::new(Self::new(inner), interceptor)
4894        }
4895        /// Enable decompressing requests with the given encoding.
4896        #[must_use]
4897        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4898            self.accept_compression_encodings.enable(encoding);
4899            self
4900        }
4901        /// Compress responses with the given encoding, if the client supports it.
4902        #[must_use]
4903        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4904            self.send_compression_encodings.enable(encoding);
4905            self
4906        }
4907        /// Limits the maximum size of a decoded message.
4908        ///
4909        /// Default: `4MB`
4910        #[must_use]
4911        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4912            self.max_decoding_message_size = Some(limit);
4913            self
4914        }
4915        /// Limits the maximum size of an encoded message.
4916        ///
4917        /// Default: `usize::MAX`
4918        #[must_use]
4919        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4920            self.max_encoding_message_size = Some(limit);
4921            self
4922        }
4923    }
4924    impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
4925    where
4926        T: NameService,
4927        B: Body + std::marker::Send + 'static,
4928        B::Error: Into<StdError> + std::marker::Send + 'static,
4929    {
4930        type Response = http::Response<tonic::body::Body>;
4931        type Error = std::convert::Infallible;
4932        type Future = BoxFuture<Self::Response, Self::Error>;
4933        fn poll_ready(
4934            &mut self,
4935            _cx: &mut Context<'_>,
4936        ) -> Poll<std::result::Result<(), Self::Error>> {
4937            Poll::Ready(Ok(()))
4938        }
4939        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4940            match req.uri().path() {
4941                "/sui.rpc.v2.NameService/LookupName" => {
4942                    #[allow(non_camel_case_types)]
4943                    struct LookupNameSvc<T: NameService>(pub Arc<T>);
4944                    impl<
4945                        T: NameService,
4946                    > tonic::server::UnaryService<super::LookupNameRequest>
4947                    for LookupNameSvc<T> {
4948                        type Response = super::LookupNameResponse;
4949                        type Future = BoxFuture<
4950                            tonic::Response<Self::Response>,
4951                            tonic::Status,
4952                        >;
4953                        fn call(
4954                            &mut self,
4955                            request: tonic::Request<super::LookupNameRequest>,
4956                        ) -> Self::Future {
4957                            let inner = Arc::clone(&self.0);
4958                            let fut = async move {
4959                                <T as NameService>::lookup_name(&inner, request).await
4960                            };
4961                            Box::pin(fut)
4962                        }
4963                    }
4964                    let accept_compression_encodings = self.accept_compression_encodings;
4965                    let send_compression_encodings = self.send_compression_encodings;
4966                    let max_decoding_message_size = self.max_decoding_message_size;
4967                    let max_encoding_message_size = self.max_encoding_message_size;
4968                    let inner = self.inner.clone();
4969                    let fut = async move {
4970                        let method = LookupNameSvc(inner);
4971                        let codec = tonic_prost::ProstCodec::default();
4972                        let mut grpc = tonic::server::Grpc::new(codec)
4973                            .apply_compression_config(
4974                                accept_compression_encodings,
4975                                send_compression_encodings,
4976                            )
4977                            .apply_max_message_size_config(
4978                                max_decoding_message_size,
4979                                max_encoding_message_size,
4980                            );
4981                        let res = grpc.unary(method, req).await;
4982                        Ok(res)
4983                    };
4984                    Box::pin(fut)
4985                }
4986                "/sui.rpc.v2.NameService/ReverseLookupName" => {
4987                    #[allow(non_camel_case_types)]
4988                    struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
4989                    impl<
4990                        T: NameService,
4991                    > tonic::server::UnaryService<super::ReverseLookupNameRequest>
4992                    for ReverseLookupNameSvc<T> {
4993                        type Response = super::ReverseLookupNameResponse;
4994                        type Future = BoxFuture<
4995                            tonic::Response<Self::Response>,
4996                            tonic::Status,
4997                        >;
4998                        fn call(
4999                            &mut self,
5000                            request: tonic::Request<super::ReverseLookupNameRequest>,
5001                        ) -> Self::Future {
5002                            let inner = Arc::clone(&self.0);
5003                            let fut = async move {
5004                                <T as NameService>::reverse_lookup_name(&inner, request)
5005                                    .await
5006                            };
5007                            Box::pin(fut)
5008                        }
5009                    }
5010                    let accept_compression_encodings = self.accept_compression_encodings;
5011                    let send_compression_encodings = self.send_compression_encodings;
5012                    let max_decoding_message_size = self.max_decoding_message_size;
5013                    let max_encoding_message_size = self.max_encoding_message_size;
5014                    let inner = self.inner.clone();
5015                    let fut = async move {
5016                        let method = ReverseLookupNameSvc(inner);
5017                        let codec = tonic_prost::ProstCodec::default();
5018                        let mut grpc = tonic::server::Grpc::new(codec)
5019                            .apply_compression_config(
5020                                accept_compression_encodings,
5021                                send_compression_encodings,
5022                            )
5023                            .apply_max_message_size_config(
5024                                max_decoding_message_size,
5025                                max_encoding_message_size,
5026                            );
5027                        let res = grpc.unary(method, req).await;
5028                        Ok(res)
5029                    };
5030                    Box::pin(fut)
5031                }
5032                _ => {
5033                    Box::pin(async move {
5034                        let mut response = http::Response::new(
5035                            tonic::body::Body::default(),
5036                        );
5037                        let headers = response.headers_mut();
5038                        headers
5039                            .insert(
5040                                tonic::Status::GRPC_STATUS,
5041                                (tonic::Code::Unimplemented as i32).into(),
5042                            );
5043                        headers
5044                            .insert(
5045                                http::header::CONTENT_TYPE,
5046                                tonic::metadata::GRPC_CONTENT_TYPE,
5047                            );
5048                        Ok(response)
5049                    })
5050                }
5051            }
5052        }
5053    }
5054    impl<T> Clone for NameServiceServer<T> {
5055        fn clone(&self) -> Self {
5056            let inner = self.inner.clone();
5057            Self {
5058                inner,
5059                accept_compression_encodings: self.accept_compression_encodings,
5060                send_compression_encodings: self.send_compression_encodings,
5061                max_decoding_message_size: self.max_decoding_message_size,
5062                max_encoding_message_size: self.max_encoding_message_size,
5063            }
5064        }
5065    }
5066    /// Generated gRPC service name
5067    pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
5068    impl<T> tonic::server::NamedService for NameServiceServer<T> {
5069        const NAME: &'static str = SERVICE_NAME;
5070    }
5071}
5072/// An object on the Sui blockchain.
5073#[non_exhaustive]
5074#[derive(Clone, PartialEq, ::prost::Message)]
5075pub struct Object {
5076    /// This Object serialized as BCS.
5077    #[prost(message, optional, tag = "1")]
5078    pub bcs: ::core::option::Option<Bcs>,
5079    /// `ObjectId` for this object.
5080    #[prost(string, optional, tag = "2")]
5081    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5082    /// Version of the object.
5083    #[prost(uint64, optional, tag = "3")]
5084    pub version: ::core::option::Option<u64>,
5085    /// The digest of this Object.
5086    #[prost(string, optional, tag = "4")]
5087    pub digest: ::core::option::Option<::prost::alloc::string::String>,
5088    /// Owner of the object.
5089    #[prost(message, optional, tag = "5")]
5090    pub owner: ::core::option::Option<Owner>,
5091    /// The type of this object.
5092    ///
5093    /// This will be 'package' for packages and a StructTag for move structs.
5094    #[prost(string, optional, tag = "6")]
5095    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5096    /// DEPRECATED this field is no longer used to determine whether a tx can transfer this
5097    /// object. Instead, it is always calculated from the objects type when loaded in execution.
5098    ///
5099    /// Only set for Move structs
5100    #[prost(bool, optional, tag = "7")]
5101    pub has_public_transfer: ::core::option::Option<bool>,
5102    /// BCS bytes of a Move struct value.
5103    ///
5104    /// Only set for Move structs
5105    #[prost(message, optional, tag = "8")]
5106    pub contents: ::core::option::Option<Bcs>,
5107    /// Package information for Move Packages
5108    #[prost(message, optional, tag = "9")]
5109    pub package: ::core::option::Option<Package>,
5110    /// The digest of the transaction that created or last mutated this object
5111    #[prost(string, optional, tag = "10")]
5112    pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
5113    /// The amount of SUI to rebate if this object gets deleted.
5114    /// This number is re-calculated each time the object is mutated based on
5115    /// the present storage gas price.
5116    #[prost(uint64, optional, tag = "11")]
5117    pub storage_rebate: ::core::option::Option<u64>,
5118    /// JSON rendering of the object.
5119    #[prost(message, optional, boxed, tag = "100")]
5120    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
5121    /// Current balance if this object is a `0x2::coin::Coin<T>`
5122    #[prost(uint64, optional, tag = "101")]
5123    pub balance: ::core::option::Option<u64>,
5124    /// JSON rendering of the object based on an on-chain template.
5125    /// This will not be set if the value's type does not have an associated `Display` template.
5126    #[prost(message, optional, boxed, tag = "102")]
5127    pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
5128}
5129/// Set of Objects
5130#[non_exhaustive]
5131#[derive(Clone, PartialEq, ::prost::Message)]
5132pub struct ObjectSet {
5133    /// Objects are sorted by the key `(object_id, version)`.
5134    #[prost(message, repeated, tag = "1")]
5135    pub objects: ::prost::alloc::vec::Vec<Object>,
5136}
5137/// A rendered JSON blob based on an on-chain template.
5138#[non_exhaustive]
5139#[derive(Clone, PartialEq, ::prost::Message)]
5140pub struct Display {
5141    /// Output for all successfully substituted display fields. Unsuccessful
5142    /// fields will be `null`, and will be accompanied by a field in `errors`,
5143    /// explaining the error.
5144    #[prost(message, optional, tag = "1")]
5145    pub output: ::core::option::Option<::prost_types::Value>,
5146    /// If any fields failed to render, this will contain a mapping from failed
5147    /// field names to error messages. If all fields succeed, this will either be
5148    /// `null` or not set.
5149    #[prost(message, optional, tag = "2")]
5150    pub errors: ::core::option::Option<::prost_types::Value>,
5151}
5152/// Reference to an object.
5153#[non_exhaustive]
5154#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5155pub struct ObjectReference {
5156    /// The object id of this object.
5157    #[prost(string, optional, tag = "1")]
5158    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5159    /// The version of this object.
5160    #[prost(uint64, optional, tag = "2")]
5161    pub version: ::core::option::Option<u64>,
5162    /// The digest of this object.
5163    #[prost(string, optional, tag = "3")]
5164    pub digest: ::core::option::Option<::prost::alloc::string::String>,
5165}
5166/// Enum of different types of ownership for an object.
5167#[non_exhaustive]
5168#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5169pub struct Owner {
5170    #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
5171    pub kind: ::core::option::Option<i32>,
5172    /// Address or ObjectId of the owner
5173    #[prost(string, optional, tag = "2")]
5174    pub address: ::core::option::Option<::prost::alloc::string::String>,
5175    /// The `initial_shared_version` if kind is `SHARED` or `start_version` if kind `CONSENSUS_ADDRESS`.
5176    #[prost(uint64, optional, tag = "3")]
5177    pub version: ::core::option::Option<u64>,
5178}
5179/// Nested message and enum types in `Owner`.
5180pub mod owner {
5181    #[non_exhaustive]
5182    #[derive(
5183        Clone,
5184        Copy,
5185        Debug,
5186        PartialEq,
5187        Eq,
5188        Hash,
5189        PartialOrd,
5190        Ord,
5191        ::prost::Enumeration
5192    )]
5193    #[repr(i32)]
5194    pub enum OwnerKind {
5195        Unknown = 0,
5196        Address = 1,
5197        Object = 2,
5198        Shared = 3,
5199        Immutable = 4,
5200        ConsensusAddress = 5,
5201    }
5202    impl OwnerKind {
5203        /// String value of the enum field names used in the ProtoBuf definition.
5204        ///
5205        /// The values are not transformed in any way and thus are considered stable
5206        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5207        pub fn as_str_name(&self) -> &'static str {
5208            match self {
5209                Self::Unknown => "OWNER_KIND_UNKNOWN",
5210                Self::Address => "ADDRESS",
5211                Self::Object => "OBJECT",
5212                Self::Shared => "SHARED",
5213                Self::Immutable => "IMMUTABLE",
5214                Self::ConsensusAddress => "CONSENSUS_ADDRESS",
5215            }
5216        }
5217        /// Creates an enum from field names used in the ProtoBuf definition.
5218        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5219            match value {
5220                "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
5221                "ADDRESS" => Some(Self::Address),
5222                "OBJECT" => Some(Self::Object),
5223                "SHARED" => Some(Self::Shared),
5224                "IMMUTABLE" => Some(Self::Immutable),
5225                "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
5226                _ => None,
5227            }
5228        }
5229    }
5230}
5231#[non_exhaustive]
5232#[derive(Clone, PartialEq, ::prost::Message)]
5233pub struct ProtocolConfig {
5234    #[prost(uint64, optional, tag = "1")]
5235    pub protocol_version: ::core::option::Option<u64>,
5236    /// Deprecated in favor of the lossless `configs` field.
5237    #[prost(btree_map = "string, bool", tag = "2")]
5238    pub feature_flags: ::prost::alloc::collections::BTreeMap<
5239        ::prost::alloc::string::String,
5240        bool,
5241    >,
5242    /// Deprecated in favor of the lossless `configs` field.
5243    #[prost(btree_map = "string, string", tag = "3")]
5244    pub attributes: ::prost::alloc::collections::BTreeMap<
5245        ::prost::alloc::string::String,
5246        ::prost::alloc::string::String,
5247    >,
5248    #[prost(btree_map = "string, message", tag = "4")]
5249    pub configs: ::prost::alloc::collections::BTreeMap<
5250        ::prost::alloc::string::String,
5251        ::prost_types::Value,
5252    >,
5253}
5254/// Cursor-bounded query options.
5255///
5256/// `after` and `before` are canonical ledger-position bounds, not
5257/// ordering-relative cursors. `after` always excludes items at or below that
5258/// cursor, and `before` always excludes items at or above that cursor. Ordering
5259/// only controls the order of returned items within the resulting open interval.
5260///
5261/// When a request also specifies a checkpoint range, cursor bounds and
5262/// checkpoint bounds compose by intersection: results come only from ledger
5263/// positions inside both. Checkpoint bounds are likewise canonical and
5264/// ordering-independent.
5265///
5266/// For example, with `after = A`, `before = B`, `ordering = DESCENDING`, and
5267/// `limit = N`, the response contains up to N matching items in descending
5268/// order from the interval `(A, B)`. If the response ends with
5269/// `QUERY_END_REASON_ITEM_LIMIT`, resume by keeping `after = A` and setting
5270/// `before` to the last `Watermark.cursor` received. That cursor is the
5271/// lowest position reached in ledger order, so it becomes the next exclusive
5272/// upper bound.
5273#[non_exhaustive]
5274#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5275pub struct QueryOptions {
5276    /// The maximum number of items to return. Each method applies its own default
5277    /// and maximum. QueryEnd does not count against this limit.
5278    #[prost(uint32, optional, tag = "1")]
5279    pub limit: ::core::option::Option<u32>,
5280    /// Opaque exclusive lower bound. Results must be strictly after this cursor in
5281    /// canonical ledger order.
5282    #[prost(bytes = "bytes", optional, tag = "2")]
5283    pub after: ::core::option::Option<::prost::bytes::Bytes>,
5284    /// Opaque exclusive upper bound. Results must be strictly before this cursor
5285    /// in canonical ledger order.
5286    #[prost(bytes = "bytes", optional, tag = "3")]
5287    pub before: ::core::option::Option<::prost::bytes::Bytes>,
5288    /// Ordering for returned results. Defaults to ASCENDING.
5289    ///
5290    /// Ordering only controls the order of results within the bounded interval;
5291    /// cursor bounds keep the same meaning for ascending and descending reads.
5292    #[prost(enumeration = "Ordering", optional, tag = "4")]
5293    pub ordering: ::core::option::Option<i32>,
5294}
5295/// Progress marker for a query scan. Carried on every response frame, whether or
5296/// not the frame delivers a matching item. Watermarks never regress in the
5297/// requested ordering, but consecutive frames may carry the same watermark when
5298/// additional work does not advance the safe resume frontier.
5299#[non_exhaustive]
5300#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5301pub struct Watermark {
5302    /// Opaque cursor at this scan position. Set on every watermark. Use as
5303    /// `options.after` (ascending) or `options.before` (descending) on the next
5304    /// request to resume from here. The most recently received cursor is always
5305    /// the safe resume point.
5306    #[prost(bytes = "bytes", optional, tag = "1")]
5307    pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
5308    /// The inclusive boundary checkpoint that the scan has fully covered within
5309    /// the request's effective interval, in the request's ordering direction: an
5310    /// ascending scan has emitted every matching item in the interval at
5311    /// checkpoints `<= checkpoint` (strictly greater ones may still hold
5312    /// matches); a descending scan has emitted every matching item in the
5313    /// interval at checkpoints `>= checkpoint`. This boundary never regresses in
5314    /// the scan direction, but it may repeat while the cursor advances.
5315    ///
5316    /// Unset until the scan's first checkpoint is fully covered. For example, a
5317    /// scan resumed from a cursor that lands mid-checkpoint leaves this unset
5318    /// until the next checkpoint boundary in the scan direction is fully covered.
5319    /// A watermark still has a valid resume cursor while this field is unset.
5320    #[prost(uint64, optional, tag = "2")]
5321    pub checkpoint: ::core::option::Option<u64>,
5322}
5323/// Marker for the final frame of a successful query stream. Every successful
5324/// stream sets `QueryEnd` on exactly one frame, after which no further frames
5325/// are sent. That frame always carries the final watermark. For `ItemLimit`, it
5326/// also carries the final matching item; for every other reason it carries no
5327/// item. A ScanLimit terminal watermark may repeat the previous frame's cursor
5328/// when its authoritative scan frontier was already emitted; this does not
5329/// repeat an item.
5330///
5331/// A stream that fails or is cancelled terminates with a gRPC status and does
5332/// not send `QueryEnd`.
5333#[non_exhaustive]
5334#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5335pub struct QueryEnd {
5336    /// Reason this response stopped.
5337    #[prost(enumeration = "QueryEndReason", optional, tag = "1")]
5338    pub reason: ::core::option::Option<i32>,
5339}
5340/// Ordering for the returned result set.
5341#[non_exhaustive]
5342#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5343#[repr(i32)]
5344pub enum Ordering {
5345    /// Return results in increasing cursor order.
5346    Ascending = 0,
5347    /// Return results in decreasing cursor order.
5348    Descending = 1,
5349}
5350impl Ordering {
5351    /// String value of the enum field names used in the ProtoBuf definition.
5352    ///
5353    /// The values are not transformed in any way and thus are considered stable
5354    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5355    pub fn as_str_name(&self) -> &'static str {
5356        match self {
5357            Self::Ascending => "ORDERING_ASCENDING",
5358            Self::Descending => "ORDERING_DESCENDING",
5359        }
5360    }
5361    /// Creates an enum from field names used in the ProtoBuf definition.
5362    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5363        match value {
5364            "ORDERING_ASCENDING" => Some(Self::Ascending),
5365            "ORDERING_DESCENDING" => Some(Self::Descending),
5366            _ => None,
5367        }
5368    }
5369}
5370/// Reason the server stopped this query response.
5371#[non_exhaustive]
5372#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5373#[repr(i32)]
5374pub enum QueryEndReason {
5375    /// The stop reason was not specified.
5376    Unknown = 0,
5377    /// The response reached the requested item limit. The final matching item's
5378    /// frame carries `QueryEnd` and the final watermark. Resume from that frame's
5379    /// `Watermark.cursor` to continue reading the same effective interval.
5380    ItemLimit = 1,
5381    /// The response reached the server's per-request bucket-fetch budget for
5382    /// filtered scans before reaching the effective interval bound. The terminal
5383    /// frame carries no item. Its watermark cursor is the authoritative scan
5384    /// frontier from which to resume.
5385    ScanLimit = 2,
5386    /// The scan reached a requested checkpoint range bound. The terminal frame
5387    /// carries no item.
5388    CheckpointBound = 3,
5389    /// The scan reached an exclusive cursor bound. The terminal frame carries no
5390    /// item. Its watermark cursor represents that resolved bound without claiming
5391    /// that its containing checkpoint was fully covered.
5392    CursorBound = 4,
5393    /// The scan reached the currently indexed ledger tip. The terminal frame
5394    /// carries no item.
5395    LedgerTip = 5,
5396}
5397impl QueryEndReason {
5398    /// String value of the enum field names used in the ProtoBuf definition.
5399    ///
5400    /// The values are not transformed in any way and thus are considered stable
5401    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5402    pub fn as_str_name(&self) -> &'static str {
5403        match self {
5404            Self::Unknown => "QUERY_END_REASON_UNKNOWN",
5405            Self::ItemLimit => "QUERY_END_REASON_ITEM_LIMIT",
5406            Self::ScanLimit => "QUERY_END_REASON_SCAN_LIMIT",
5407            Self::CheckpointBound => "QUERY_END_REASON_CHECKPOINT_BOUND",
5408            Self::CursorBound => "QUERY_END_REASON_CURSOR_BOUND",
5409            Self::LedgerTip => "QUERY_END_REASON_LEDGER_TIP",
5410        }
5411    }
5412    /// Creates an enum from field names used in the ProtoBuf definition.
5413    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5414        match value {
5415            "QUERY_END_REASON_UNKNOWN" => Some(Self::Unknown),
5416            "QUERY_END_REASON_ITEM_LIMIT" => Some(Self::ItemLimit),
5417            "QUERY_END_REASON_SCAN_LIMIT" => Some(Self::ScanLimit),
5418            "QUERY_END_REASON_CHECKPOINT_BOUND" => Some(Self::CheckpointBound),
5419            "QUERY_END_REASON_CURSOR_BOUND" => Some(Self::CursorBound),
5420            "QUERY_END_REASON_LEDGER_TIP" => Some(Self::LedgerTip),
5421            _ => None,
5422        }
5423    }
5424}
5425/// A signature from a user.
5426#[non_exhaustive]
5427#[derive(Clone, PartialEq, ::prost::Message)]
5428pub struct UserSignature {
5429    /// This signature serialized as as BCS.
5430    ///
5431    /// When provided as input this will support both the form that is length
5432    /// prefixed as well as not length prefixed.
5433    #[prost(message, optional, tag = "1")]
5434    pub bcs: ::core::option::Option<Bcs>,
5435    /// The signature scheme of this signature.
5436    #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
5437    pub scheme: ::core::option::Option<i32>,
5438    #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
5439    pub signature: ::core::option::Option<user_signature::Signature>,
5440}
5441/// Nested message and enum types in `UserSignature`.
5442pub mod user_signature {
5443    #[non_exhaustive]
5444    #[derive(Clone, PartialEq, ::prost::Oneof)]
5445    pub enum Signature {
5446        /// Simple signature if scheme is ed25519 | secp256k1 | secp256r1.
5447        #[prost(message, tag = "3")]
5448        Simple(super::SimpleSignature),
5449        /// The multisig aggregated signature if scheme is `MULTISIG`.
5450        #[prost(message, tag = "4")]
5451        Multisig(super::MultisigAggregatedSignature),
5452        /// The zklogin authenticator if scheme is `ZKLOGIN`.
5453        #[prost(message, tag = "5")]
5454        Zklogin(super::ZkLoginAuthenticator),
5455        /// The passkey authenticator if scheme is `PASSKEY`.
5456        #[prost(message, tag = "6")]
5457        Passkey(super::PasskeyAuthenticator),
5458    }
5459}
5460/// Either an ed25519, secp256k1 or secp256r1 signature
5461#[non_exhaustive]
5462#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5463pub struct SimpleSignature {
5464    /// The signature scheme of this signature.
5465    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5466    pub scheme: ::core::option::Option<i32>,
5467    /// Signature bytes
5468    #[prost(bytes = "bytes", optional, tag = "2")]
5469    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5470    /// Public key bytes
5471    #[prost(bytes = "bytes", optional, tag = "3")]
5472    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5473}
5474/// Public key equivalent for zklogin authenticators.
5475#[non_exhaustive]
5476#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5477pub struct ZkLoginPublicIdentifier {
5478    #[prost(string, optional, tag = "1")]
5479    pub iss: ::core::option::Option<::prost::alloc::string::String>,
5480    /// base10 encoded Bn254FieldElement
5481    #[prost(string, optional, tag = "2")]
5482    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5483}
5484/// Set of valid public keys for multisig committee members.
5485#[non_exhaustive]
5486#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5487pub struct MultisigMemberPublicKey {
5488    /// The signature scheme of this public key.
5489    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5490    pub scheme: ::core::option::Option<i32>,
5491    /// Public key bytes if scheme is ed25519 | secp256k1 | secp256r1 | passkey.
5492    #[prost(bytes = "bytes", optional, tag = "2")]
5493    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5494    /// A zklogin public identifier if scheme is zklogin.
5495    #[prost(message, optional, tag = "3")]
5496    pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
5497}
5498/// A member in a multisig committee.
5499#[non_exhaustive]
5500#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5501pub struct MultisigMember {
5502    /// The public key of the committee member.
5503    #[prost(message, optional, tag = "1")]
5504    pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
5505    /// The weight of this member's signature.
5506    #[prost(uint32, optional, tag = "2")]
5507    pub weight: ::core::option::Option<u32>,
5508}
5509/// A multisig committee.
5510#[non_exhaustive]
5511#[derive(Clone, PartialEq, ::prost::Message)]
5512pub struct MultisigCommittee {
5513    /// A list of committee members and their corresponding weight.
5514    #[prost(message, repeated, tag = "1")]
5515    pub members: ::prost::alloc::vec::Vec<MultisigMember>,
5516    /// The threshold of signatures needed to validate a signature from
5517    /// this committee.
5518    #[prost(uint32, optional, tag = "2")]
5519    pub threshold: ::core::option::Option<u32>,
5520}
5521/// Aggregated signature from members of a multisig committee.
5522#[non_exhaustive]
5523#[derive(Clone, PartialEq, ::prost::Message)]
5524pub struct MultisigAggregatedSignature {
5525    /// The plain signatures encoded with signature scheme.
5526    ///
5527    /// The signatures must be in the same order as they are listed in the committee.
5528    #[prost(message, repeated, tag = "1")]
5529    pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
5530    /// Bitmap indicating which committee members contributed to the
5531    /// signature.
5532    #[prost(uint32, optional, tag = "2")]
5533    pub bitmap: ::core::option::Option<u32>,
5534    /// If present, means this signature's on-chain format uses the old
5535    /// legacy multisig format.
5536    #[prost(bytes = "bytes", optional, tag = "3")]
5537    pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5538    /// The committee to use to validate this signature.
5539    #[prost(message, optional, tag = "4")]
5540    pub committee: ::core::option::Option<MultisigCommittee>,
5541}
5542/// A signature from a member of a multisig committee.
5543#[non_exhaustive]
5544#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5545pub struct MultisigMemberSignature {
5546    /// The signature scheme of this signature.
5547    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5548    pub scheme: ::core::option::Option<i32>,
5549    /// Signature bytes if scheme is ed25519 | secp256k1 | secp256r1.
5550    #[prost(bytes = "bytes", optional, tag = "2")]
5551    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5552    /// The zklogin authenticator if scheme is `ZKLOGIN`.
5553    #[prost(message, optional, tag = "3")]
5554    pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
5555    /// The passkey authenticator if scheme is `PASSKEY`.
5556    #[prost(message, optional, tag = "4")]
5557    pub passkey: ::core::option::Option<PasskeyAuthenticator>,
5558}
5559/// A zklogin authenticator.
5560#[non_exhaustive]
5561#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5562pub struct ZkLoginAuthenticator {
5563    /// Zklogin proof and inputs required to perform proof verification.
5564    #[prost(message, optional, tag = "1")]
5565    pub inputs: ::core::option::Option<ZkLoginInputs>,
5566    /// Maximum epoch for which the proof is valid.
5567    #[prost(uint64, optional, tag = "2")]
5568    pub max_epoch: ::core::option::Option<u64>,
5569    /// User signature with the public key attested to by the provided proof.
5570    #[prost(message, optional, tag = "3")]
5571    pub signature: ::core::option::Option<SimpleSignature>,
5572    /// The public identifier (similar to a public key) for this zklogin authenticator
5573    #[prost(message, optional, tag = "4")]
5574    pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
5575    /// The id of the JWK used to authorize this zklogin authenticator
5576    #[prost(message, optional, tag = "5")]
5577    pub jwk_id: ::core::option::Option<JwkId>,
5578}
5579/// A zklogin groth16 proof and the required inputs to perform proof verification.
5580#[non_exhaustive]
5581#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5582pub struct ZkLoginInputs {
5583    #[prost(message, optional, tag = "1")]
5584    pub proof_points: ::core::option::Option<ZkLoginProof>,
5585    #[prost(message, optional, tag = "2")]
5586    pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
5587    #[prost(string, optional, tag = "3")]
5588    pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
5589    /// base10 encoded Bn254FieldElement
5590    #[prost(string, optional, tag = "4")]
5591    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5592}
5593/// A zklogin groth16 proof.
5594#[non_exhaustive]
5595#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5596pub struct ZkLoginProof {
5597    #[prost(message, optional, tag = "1")]
5598    pub a: ::core::option::Option<CircomG1>,
5599    #[prost(message, optional, tag = "2")]
5600    pub b: ::core::option::Option<CircomG2>,
5601    #[prost(message, optional, tag = "3")]
5602    pub c: ::core::option::Option<CircomG1>,
5603}
5604/// A claim of the iss in a zklogin proof.
5605#[non_exhaustive]
5606#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5607pub struct ZkLoginClaim {
5608    #[prost(string, optional, tag = "1")]
5609    pub value: ::core::option::Option<::prost::alloc::string::String>,
5610    #[prost(uint32, optional, tag = "2")]
5611    pub index_mod_4: ::core::option::Option<u32>,
5612}
5613/// A G1 point.
5614#[non_exhaustive]
5615#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5616pub struct CircomG1 {
5617    /// base10 encoded Bn254FieldElement
5618    #[prost(string, optional, tag = "1")]
5619    pub e0: ::core::option::Option<::prost::alloc::string::String>,
5620    /// base10 encoded Bn254FieldElement
5621    #[prost(string, optional, tag = "2")]
5622    pub e1: ::core::option::Option<::prost::alloc::string::String>,
5623    /// base10 encoded Bn254FieldElement
5624    #[prost(string, optional, tag = "3")]
5625    pub e2: ::core::option::Option<::prost::alloc::string::String>,
5626}
5627/// A G2 point.
5628#[non_exhaustive]
5629#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5630pub struct CircomG2 {
5631    /// base10 encoded Bn254FieldElement
5632    #[prost(string, optional, tag = "1")]
5633    pub e00: ::core::option::Option<::prost::alloc::string::String>,
5634    /// base10 encoded Bn254FieldElement
5635    #[prost(string, optional, tag = "2")]
5636    pub e01: ::core::option::Option<::prost::alloc::string::String>,
5637    /// base10 encoded Bn254FieldElement
5638    #[prost(string, optional, tag = "3")]
5639    pub e10: ::core::option::Option<::prost::alloc::string::String>,
5640    /// base10 encoded Bn254FieldElement
5641    #[prost(string, optional, tag = "4")]
5642    pub e11: ::core::option::Option<::prost::alloc::string::String>,
5643    /// base10 encoded Bn254FieldElement
5644    #[prost(string, optional, tag = "5")]
5645    pub e20: ::core::option::Option<::prost::alloc::string::String>,
5646    /// base10 encoded Bn254FieldElement
5647    #[prost(string, optional, tag = "6")]
5648    pub e21: ::core::option::Option<::prost::alloc::string::String>,
5649}
5650/// A passkey authenticator.
5651///
5652/// See
5653/// [struct.PasskeyAuthenticator](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/struct.PasskeyAuthenticator.html#bcs>)
5654/// for more information on the requirements on the shape of the
5655/// `client_data_json` field.
5656#[non_exhaustive]
5657#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5658pub struct PasskeyAuthenticator {
5659    /// Opaque authenticator data for this passkey signature.
5660    ///
5661    /// See [Authenticator Data](<https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data>) for
5662    /// more information on this field.
5663    #[prost(bytes = "bytes", optional, tag = "1")]
5664    pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
5665    /// Structured, unparsed, JSON for this passkey signature.
5666    ///
5667    /// See [CollectedClientData](<https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata>)
5668    /// for more information on this field.
5669    #[prost(string, optional, tag = "2")]
5670    pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
5671    /// A secp256r1 signature.
5672    #[prost(message, optional, tag = "3")]
5673    pub signature: ::core::option::Option<SimpleSignature>,
5674}
5675/// The validator set for a particular epoch.
5676#[non_exhaustive]
5677#[derive(Clone, PartialEq, ::prost::Message)]
5678pub struct ValidatorCommittee {
5679    /// The epoch where this committee governs.
5680    #[prost(uint64, optional, tag = "1")]
5681    pub epoch: ::core::option::Option<u64>,
5682    /// The committee members.
5683    #[prost(message, repeated, tag = "2")]
5684    pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
5685}
5686/// A member of a validator committee.
5687#[non_exhaustive]
5688#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5689pub struct ValidatorCommitteeMember {
5690    /// The 96-byte Bls12381 public key for this validator.
5691    #[prost(bytes = "bytes", optional, tag = "1")]
5692    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5693    /// voting weight this validator possesses.
5694    #[prost(uint64, optional, tag = "2")]
5695    pub weight: ::core::option::Option<u64>,
5696}
5697/// / An aggregated signature from multiple validators.
5698#[non_exhaustive]
5699#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5700pub struct ValidatorAggregatedSignature {
5701    /// The epoch when this signature was produced.
5702    ///
5703    /// This can be used to lookup the `ValidatorCommittee` from this epoch
5704    /// to verify this signature.
5705    #[prost(uint64, optional, tag = "1")]
5706    pub epoch: ::core::option::Option<u64>,
5707    /// The 48-byte Bls12381 aggregated signature.
5708    #[prost(bytes = "bytes", optional, tag = "2")]
5709    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5710    /// Bitmap indicating which members of the committee contributed to
5711    /// this signature.
5712    #[prost(bytes = "bytes", optional, tag = "3")]
5713    pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5714}
5715/// Flag use to disambiguate the signature schemes supported by Sui.
5716///
5717/// Note: the enum values defined by this proto message exactly match their
5718/// expected BCS serialized values when serialized as a u8. See
5719/// [enum.SignatureScheme](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/enum.SignatureScheme.html>)
5720/// for more information about signature schemes.
5721#[non_exhaustive]
5722#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5723#[repr(i32)]
5724pub enum SignatureScheme {
5725    Ed25519 = 0,
5726    Secp256k1 = 1,
5727    Secp256r1 = 2,
5728    Multisig = 3,
5729    Bls12381 = 4,
5730    Zklogin = 5,
5731    Passkey = 6,
5732}
5733impl SignatureScheme {
5734    /// String value of the enum field names used in the ProtoBuf definition.
5735    ///
5736    /// The values are not transformed in any way and thus are considered stable
5737    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5738    pub fn as_str_name(&self) -> &'static str {
5739        match self {
5740            Self::Ed25519 => "ED25519",
5741            Self::Secp256k1 => "SECP256K1",
5742            Self::Secp256r1 => "SECP256R1",
5743            Self::Multisig => "MULTISIG",
5744            Self::Bls12381 => "BLS12381",
5745            Self::Zklogin => "ZKLOGIN",
5746            Self::Passkey => "PASSKEY",
5747        }
5748    }
5749    /// Creates an enum from field names used in the ProtoBuf definition.
5750    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5751        match value {
5752            "ED25519" => Some(Self::Ed25519),
5753            "SECP256K1" => Some(Self::Secp256k1),
5754            "SECP256R1" => Some(Self::Secp256r1),
5755            "MULTISIG" => Some(Self::Multisig),
5756            "BLS12381" => Some(Self::Bls12381),
5757            "ZKLOGIN" => Some(Self::Zklogin),
5758            "PASSKEY" => Some(Self::Passkey),
5759            _ => None,
5760        }
5761    }
5762}
5763#[non_exhaustive]
5764#[derive(Clone, PartialEq, ::prost::Message)]
5765pub struct VerifySignatureRequest {
5766    /// The message to verify against.
5767    ///
5768    /// Today the only supported message types are `PersonalMessage` and
5769    /// `TransactionData` and the `Bcs.name` must be set to indicate which type of
5770    /// message is being verified.
5771    #[prost(message, optional, tag = "1")]
5772    pub message: ::core::option::Option<Bcs>,
5773    /// The signature to verify.
5774    #[prost(message, optional, tag = "2")]
5775    pub signature: ::core::option::Option<UserSignature>,
5776    /// Optional. Address to validate against the provided signature.
5777    ///
5778    /// If provided, this address will be compared against the the address derived
5779    /// from the provide signature and a successful response will only be returned
5780    /// if they match.
5781    #[prost(string, optional, tag = "3")]
5782    pub address: ::core::option::Option<::prost::alloc::string::String>,
5783    /// The set of JWKs to use when verifying Zklogin signatures.
5784    /// If this is empty the current set of valid JWKs stored onchain will be used
5785    #[prost(message, repeated, tag = "4")]
5786    pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
5787}
5788#[non_exhaustive]
5789#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5790pub struct VerifySignatureResponse {
5791    /// Indicates if the provided signature was valid given the requested parameters.
5792    #[prost(bool, optional, tag = "1")]
5793    pub is_valid: ::core::option::Option<bool>,
5794    /// If `is_valid` is `false`, this is the reason for why the signature verification failed.
5795    #[prost(string, optional, tag = "2")]
5796    pub reason: ::core::option::Option<::prost::alloc::string::String>,
5797}
5798/// Generated client implementations.
5799pub mod signature_verification_service_client {
5800    #![allow(
5801        unused_variables,
5802        dead_code,
5803        missing_docs,
5804        clippy::wildcard_imports,
5805        clippy::let_unit_value,
5806    )]
5807    use tonic::codegen::*;
5808    use tonic::codegen::http::Uri;
5809    #[derive(Debug, Clone)]
5810    pub struct SignatureVerificationServiceClient<T> {
5811        inner: tonic::client::Grpc<T>,
5812    }
5813    impl SignatureVerificationServiceClient<tonic::transport::Channel> {
5814        /// Attempt to create a new client by connecting to a given endpoint.
5815        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5816        where
5817            D: TryInto<tonic::transport::Endpoint>,
5818            D::Error: Into<StdError>,
5819        {
5820            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5821            Ok(Self::new(conn))
5822        }
5823    }
5824    impl<T> SignatureVerificationServiceClient<T>
5825    where
5826        T: tonic::client::GrpcService<tonic::body::Body>,
5827        T::Error: Into<StdError>,
5828        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5829        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5830    {
5831        pub fn new(inner: T) -> Self {
5832            let inner = tonic::client::Grpc::new(inner);
5833            Self { inner }
5834        }
5835        pub fn with_origin(inner: T, origin: Uri) -> Self {
5836            let inner = tonic::client::Grpc::with_origin(inner, origin);
5837            Self { inner }
5838        }
5839        pub fn with_interceptor<F>(
5840            inner: T,
5841            interceptor: F,
5842        ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
5843        where
5844            F: tonic::service::Interceptor,
5845            T::ResponseBody: Default,
5846            T: tonic::codegen::Service<
5847                http::Request<tonic::body::Body>,
5848                Response = http::Response<
5849                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5850                >,
5851            >,
5852            <T as tonic::codegen::Service<
5853                http::Request<tonic::body::Body>,
5854            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5855        {
5856            SignatureVerificationServiceClient::new(
5857                InterceptedService::new(inner, interceptor),
5858            )
5859        }
5860        /// Compress requests with the given encoding.
5861        ///
5862        /// This requires the server to support it otherwise it might respond with an
5863        /// error.
5864        #[must_use]
5865        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5866            self.inner = self.inner.send_compressed(encoding);
5867            self
5868        }
5869        /// Enable decompressing responses.
5870        #[must_use]
5871        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5872            self.inner = self.inner.accept_compressed(encoding);
5873            self
5874        }
5875        /// Limits the maximum size of a decoded message.
5876        ///
5877        /// Default: `4MB`
5878        #[must_use]
5879        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5880            self.inner = self.inner.max_decoding_message_size(limit);
5881            self
5882        }
5883        /// Limits the maximum size of an encoded message.
5884        ///
5885        /// Default: `usize::MAX`
5886        #[must_use]
5887        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5888            self.inner = self.inner.max_encoding_message_size(limit);
5889            self
5890        }
5891        /// Perform signature verification of a UserSignature against the provided message.
5892        pub async fn verify_signature(
5893            &mut self,
5894            request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
5895        ) -> std::result::Result<
5896            tonic::Response<super::VerifySignatureResponse>,
5897            tonic::Status,
5898        > {
5899            self.inner
5900                .ready()
5901                .await
5902                .map_err(|e| {
5903                    tonic::Status::unknown(
5904                        format!("Service was not ready: {}", e.into()),
5905                    )
5906                })?;
5907            let codec = tonic_prost::ProstCodec::default();
5908            let path = http::uri::PathAndQuery::from_static(
5909                "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
5910            );
5911            let mut req = request.into_request();
5912            req.extensions_mut()
5913                .insert(
5914                    GrpcMethod::new(
5915                        "sui.rpc.v2.SignatureVerificationService",
5916                        "VerifySignature",
5917                    ),
5918                );
5919            self.inner.unary(req, path, codec).await
5920        }
5921    }
5922}
5923/// Generated server implementations.
5924pub mod signature_verification_service_server {
5925    #![allow(
5926        unused_variables,
5927        dead_code,
5928        missing_docs,
5929        clippy::wildcard_imports,
5930        clippy::let_unit_value,
5931    )]
5932    use tonic::codegen::*;
5933    /// Generated trait containing gRPC methods that should be implemented for use with SignatureVerificationServiceServer.
5934    #[async_trait]
5935    pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
5936        /// Perform signature verification of a UserSignature against the provided message.
5937        async fn verify_signature(
5938            &self,
5939            request: tonic::Request<super::VerifySignatureRequest>,
5940        ) -> std::result::Result<
5941            tonic::Response<super::VerifySignatureResponse>,
5942            tonic::Status,
5943        > {
5944            Err(tonic::Status::unimplemented("Not yet implemented"))
5945        }
5946    }
5947    #[derive(Debug)]
5948    pub struct SignatureVerificationServiceServer<T> {
5949        inner: Arc<T>,
5950        accept_compression_encodings: EnabledCompressionEncodings,
5951        send_compression_encodings: EnabledCompressionEncodings,
5952        max_decoding_message_size: Option<usize>,
5953        max_encoding_message_size: Option<usize>,
5954    }
5955    impl<T> SignatureVerificationServiceServer<T> {
5956        pub fn new(inner: T) -> Self {
5957            Self::from_arc(Arc::new(inner))
5958        }
5959        pub fn from_arc(inner: Arc<T>) -> Self {
5960            Self {
5961                inner,
5962                accept_compression_encodings: Default::default(),
5963                send_compression_encodings: Default::default(),
5964                max_decoding_message_size: None,
5965                max_encoding_message_size: None,
5966            }
5967        }
5968        pub fn with_interceptor<F>(
5969            inner: T,
5970            interceptor: F,
5971        ) -> InterceptedService<Self, F>
5972        where
5973            F: tonic::service::Interceptor,
5974        {
5975            InterceptedService::new(Self::new(inner), interceptor)
5976        }
5977        /// Enable decompressing requests with the given encoding.
5978        #[must_use]
5979        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5980            self.accept_compression_encodings.enable(encoding);
5981            self
5982        }
5983        /// Compress responses with the given encoding, if the client supports it.
5984        #[must_use]
5985        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5986            self.send_compression_encodings.enable(encoding);
5987            self
5988        }
5989        /// Limits the maximum size of a decoded message.
5990        ///
5991        /// Default: `4MB`
5992        #[must_use]
5993        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5994            self.max_decoding_message_size = Some(limit);
5995            self
5996        }
5997        /// Limits the maximum size of an encoded message.
5998        ///
5999        /// Default: `usize::MAX`
6000        #[must_use]
6001        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6002            self.max_encoding_message_size = Some(limit);
6003            self
6004        }
6005    }
6006    impl<T, B> tonic::codegen::Service<http::Request<B>>
6007    for SignatureVerificationServiceServer<T>
6008    where
6009        T: SignatureVerificationService,
6010        B: Body + std::marker::Send + 'static,
6011        B::Error: Into<StdError> + std::marker::Send + 'static,
6012    {
6013        type Response = http::Response<tonic::body::Body>;
6014        type Error = std::convert::Infallible;
6015        type Future = BoxFuture<Self::Response, Self::Error>;
6016        fn poll_ready(
6017            &mut self,
6018            _cx: &mut Context<'_>,
6019        ) -> Poll<std::result::Result<(), Self::Error>> {
6020            Poll::Ready(Ok(()))
6021        }
6022        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6023            match req.uri().path() {
6024                "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
6025                    #[allow(non_camel_case_types)]
6026                    struct VerifySignatureSvc<T: SignatureVerificationService>(
6027                        pub Arc<T>,
6028                    );
6029                    impl<
6030                        T: SignatureVerificationService,
6031                    > tonic::server::UnaryService<super::VerifySignatureRequest>
6032                    for VerifySignatureSvc<T> {
6033                        type Response = super::VerifySignatureResponse;
6034                        type Future = BoxFuture<
6035                            tonic::Response<Self::Response>,
6036                            tonic::Status,
6037                        >;
6038                        fn call(
6039                            &mut self,
6040                            request: tonic::Request<super::VerifySignatureRequest>,
6041                        ) -> Self::Future {
6042                            let inner = Arc::clone(&self.0);
6043                            let fut = async move {
6044                                <T as SignatureVerificationService>::verify_signature(
6045                                        &inner,
6046                                        request,
6047                                    )
6048                                    .await
6049                            };
6050                            Box::pin(fut)
6051                        }
6052                    }
6053                    let accept_compression_encodings = self.accept_compression_encodings;
6054                    let send_compression_encodings = self.send_compression_encodings;
6055                    let max_decoding_message_size = self.max_decoding_message_size;
6056                    let max_encoding_message_size = self.max_encoding_message_size;
6057                    let inner = self.inner.clone();
6058                    let fut = async move {
6059                        let method = VerifySignatureSvc(inner);
6060                        let codec = tonic_prost::ProstCodec::default();
6061                        let mut grpc = tonic::server::Grpc::new(codec)
6062                            .apply_compression_config(
6063                                accept_compression_encodings,
6064                                send_compression_encodings,
6065                            )
6066                            .apply_max_message_size_config(
6067                                max_decoding_message_size,
6068                                max_encoding_message_size,
6069                            );
6070                        let res = grpc.unary(method, req).await;
6071                        Ok(res)
6072                    };
6073                    Box::pin(fut)
6074                }
6075                _ => {
6076                    Box::pin(async move {
6077                        let mut response = http::Response::new(
6078                            tonic::body::Body::default(),
6079                        );
6080                        let headers = response.headers_mut();
6081                        headers
6082                            .insert(
6083                                tonic::Status::GRPC_STATUS,
6084                                (tonic::Code::Unimplemented as i32).into(),
6085                            );
6086                        headers
6087                            .insert(
6088                                http::header::CONTENT_TYPE,
6089                                tonic::metadata::GRPC_CONTENT_TYPE,
6090                            );
6091                        Ok(response)
6092                    })
6093                }
6094            }
6095        }
6096    }
6097    impl<T> Clone for SignatureVerificationServiceServer<T> {
6098        fn clone(&self) -> Self {
6099            let inner = self.inner.clone();
6100            Self {
6101                inner,
6102                accept_compression_encodings: self.accept_compression_encodings,
6103                send_compression_encodings: self.send_compression_encodings,
6104                max_decoding_message_size: self.max_decoding_message_size,
6105                max_encoding_message_size: self.max_encoding_message_size,
6106            }
6107        }
6108    }
6109    /// Generated gRPC service name
6110    pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
6111    impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
6112        const NAME: &'static str = SERVICE_NAME;
6113    }
6114}
6115/// Request message for `NodeService.GetCoinInfo`.
6116#[non_exhaustive]
6117#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6118pub struct GetCoinInfoRequest {
6119    /// The coin type to request information about
6120    #[prost(string, optional, tag = "1")]
6121    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6122}
6123/// Response message for `NodeService.GetCoinInfo`.
6124#[non_exhaustive]
6125#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6126pub struct GetCoinInfoResponse {
6127    /// Required. The coin type.
6128    #[prost(string, optional, tag = "1")]
6129    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6130    /// This field will be populated with information about this coin
6131    /// type's `0x2::coin::CoinMetadata` if it exists and has not been wrapped.
6132    #[prost(message, optional, tag = "2")]
6133    pub metadata: ::core::option::Option<CoinMetadata>,
6134    /// This field will be populated with information about this coin
6135    /// type's `0x2::coin::TreasuryCap` if it exists and has not been wrapped.
6136    #[prost(message, optional, tag = "3")]
6137    pub treasury: ::core::option::Option<CoinTreasury>,
6138    /// If this coin type is a regulated coin, this field will be
6139    /// populated with information either from its Currency object
6140    /// in the CoinRegistry, or from its `0x2::coin::RegulatedCoinMetadata`
6141    /// object for coins that have not been migrated to the CoinRegistry
6142    ///
6143    /// If this coin is not known to be regulated, only the
6144    /// coin_regulated_state field will be populated.
6145    #[prost(message, optional, tag = "4")]
6146    pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
6147}
6148/// Metadata for a coin type
6149#[non_exhaustive]
6150#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6151pub struct CoinMetadata {
6152    /// ObjectId of the `0x2::coin::CoinMetadata` object or
6153    /// 0x2::sui::coin_registry::Currency object (when registered with CoinRegistry).
6154    #[prost(string, optional, tag = "1")]
6155    pub id: ::core::option::Option<::prost::alloc::string::String>,
6156    /// Number of decimal places to coin uses.
6157    #[prost(uint32, optional, tag = "2")]
6158    pub decimals: ::core::option::Option<u32>,
6159    /// Name for the token
6160    #[prost(string, optional, tag = "3")]
6161    pub name: ::core::option::Option<::prost::alloc::string::String>,
6162    /// Symbol for the token
6163    #[prost(string, optional, tag = "4")]
6164    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
6165    /// Description of the token
6166    #[prost(string, optional, tag = "5")]
6167    pub description: ::core::option::Option<::prost::alloc::string::String>,
6168    /// URL for the token logo
6169    #[prost(string, optional, tag = "6")]
6170    pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
6171    /// The MetadataCap ID if it has been claimed for this coin type.
6172    /// This capability allows updating the coin's metadata fields.
6173    /// Only populated when metadata is from CoinRegistry.
6174    #[prost(string, optional, tag = "7")]
6175    pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6176    /// State of the MetadataCap for this coin type.
6177    #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
6178    pub metadata_cap_state: ::core::option::Option<i32>,
6179}
6180/// Nested message and enum types in `CoinMetadata`.
6181pub mod coin_metadata {
6182    /// Information about the state of the coin's MetadataCap
6183    #[non_exhaustive]
6184    #[derive(
6185        Clone,
6186        Copy,
6187        Debug,
6188        PartialEq,
6189        Eq,
6190        Hash,
6191        PartialOrd,
6192        Ord,
6193        ::prost::Enumeration
6194    )]
6195    #[repr(i32)]
6196    pub enum MetadataCapState {
6197        /// Indicates the state of the MetadataCap is unknown.
6198        /// Set when the coin has not been migrated to the CoinRegistry.
6199        Unknown = 0,
6200        /// Indicates the MetadataCap has been claimed.
6201        Claimed = 1,
6202        /// Indicates the MetadataCap has not been claimed.
6203        Unclaimed = 2,
6204        /// Indicates the MetadataCap has been deleted.
6205        Deleted = 3,
6206    }
6207    impl MetadataCapState {
6208        /// String value of the enum field names used in the ProtoBuf definition.
6209        ///
6210        /// The values are not transformed in any way and thus are considered stable
6211        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6212        pub fn as_str_name(&self) -> &'static str {
6213            match self {
6214                Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
6215                Self::Claimed => "CLAIMED",
6216                Self::Unclaimed => "UNCLAIMED",
6217                Self::Deleted => "DELETED",
6218            }
6219        }
6220        /// Creates an enum from field names used in the ProtoBuf definition.
6221        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6222            match value {
6223                "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
6224                "CLAIMED" => Some(Self::Claimed),
6225                "UNCLAIMED" => Some(Self::Unclaimed),
6226                "DELETED" => Some(Self::Deleted),
6227                _ => None,
6228            }
6229        }
6230    }
6231}
6232/// Information about a coin type's `0x2::coin::TreasuryCap` and its total available supply
6233#[non_exhaustive]
6234#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6235pub struct CoinTreasury {
6236    /// ObjectId of the `0x2::coin::TreasuryCap` object.
6237    #[prost(string, optional, tag = "1")]
6238    pub id: ::core::option::Option<::prost::alloc::string::String>,
6239    /// Total available supply for this coin type.
6240    #[prost(uint64, optional, tag = "2")]
6241    pub total_supply: ::core::option::Option<u64>,
6242    /// Supply state indicating if the supply is fixed or can still be minted
6243    #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
6244    pub supply_state: ::core::option::Option<i32>,
6245}
6246/// Nested message and enum types in `CoinTreasury`.
6247pub mod coin_treasury {
6248    /// Supply state of a coin, matching the Move SupplyState enum
6249    #[non_exhaustive]
6250    #[derive(
6251        Clone,
6252        Copy,
6253        Debug,
6254        PartialEq,
6255        Eq,
6256        Hash,
6257        PartialOrd,
6258        Ord,
6259        ::prost::Enumeration
6260    )]
6261    #[repr(i32)]
6262    pub enum SupplyState {
6263        /// Supply is unknown or TreasuryCap still exists (minting still possible)
6264        Unknown = 0,
6265        /// Supply is fixed (TreasuryCap consumed, no more minting possible)
6266        Fixed = 1,
6267        /// Supply can only decrease (burning allowed, minting not allowed)
6268        BurnOnly = 2,
6269    }
6270    impl SupplyState {
6271        /// String value of the enum field names used in the ProtoBuf definition.
6272        ///
6273        /// The values are not transformed in any way and thus are considered stable
6274        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6275        pub fn as_str_name(&self) -> &'static str {
6276            match self {
6277                Self::Unknown => "SUPPLY_STATE_UNKNOWN",
6278                Self::Fixed => "FIXED",
6279                Self::BurnOnly => "BURN_ONLY",
6280            }
6281        }
6282        /// Creates an enum from field names used in the ProtoBuf definition.
6283        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6284            match value {
6285                "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
6286                "FIXED" => Some(Self::Fixed),
6287                "BURN_ONLY" => Some(Self::BurnOnly),
6288                _ => None,
6289            }
6290        }
6291    }
6292}
6293/// Information about a regulated coin, which indicates that it makes use of the transfer deny list.
6294#[non_exhaustive]
6295#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6296pub struct RegulatedCoinMetadata {
6297    /// ObjectId of the `0x2::coin::RegulatedCoinMetadata` object.
6298    /// Only present for coins that have not been migrated to CoinRegistry.
6299    #[prost(string, optional, tag = "1")]
6300    pub id: ::core::option::Option<::prost::alloc::string::String>,
6301    /// The ID of the coin's `CoinMetadata` or `CoinData` object.
6302    #[prost(string, optional, tag = "2")]
6303    pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
6304    /// The ID of the coin's `DenyCap` object.
6305    #[prost(string, optional, tag = "3")]
6306    pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
6307    /// Whether the coin can be globally paused
6308    #[prost(bool, optional, tag = "4")]
6309    pub allow_global_pause: ::core::option::Option<bool>,
6310    /// Variant of the regulated coin metadata
6311    #[prost(uint32, optional, tag = "5")]
6312    pub variant: ::core::option::Option<u32>,
6313    /// Indicates the coin's regulated state.
6314    #[prost(
6315        enumeration = "regulated_coin_metadata::CoinRegulatedState",
6316        optional,
6317        tag = "6"
6318    )]
6319    pub coin_regulated_state: ::core::option::Option<i32>,
6320}
6321/// Nested message and enum types in `RegulatedCoinMetadata`.
6322pub mod regulated_coin_metadata {
6323    /// Indicates the state of the regulation of the coin.
6324    #[non_exhaustive]
6325    #[derive(
6326        Clone,
6327        Copy,
6328        Debug,
6329        PartialEq,
6330        Eq,
6331        Hash,
6332        PartialOrd,
6333        Ord,
6334        ::prost::Enumeration
6335    )]
6336    #[repr(i32)]
6337    pub enum CoinRegulatedState {
6338        /// Indicates the regulation state of the coin is unknown.
6339        /// This is set when a coin has not been migrated to the
6340        /// coin registry and has no `0x2::coin::RegulatedCoinMetadata`
6341        /// object.
6342        Unknown = 0,
6343        /// Indicates a coin is regulated. RegulatedCoinMetadata will be populated.
6344        Regulated = 1,
6345        /// Indicates a coin is unregulated.
6346        Unregulated = 2,
6347    }
6348    impl CoinRegulatedState {
6349        /// String value of the enum field names used in the ProtoBuf definition.
6350        ///
6351        /// The values are not transformed in any way and thus are considered stable
6352        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6353        pub fn as_str_name(&self) -> &'static str {
6354            match self {
6355                Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
6356                Self::Regulated => "REGULATED",
6357                Self::Unregulated => "UNREGULATED",
6358            }
6359        }
6360        /// Creates an enum from field names used in the ProtoBuf definition.
6361        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6362            match value {
6363                "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
6364                "REGULATED" => Some(Self::Regulated),
6365                "UNREGULATED" => Some(Self::Unregulated),
6366                _ => None,
6367            }
6368        }
6369    }
6370}
6371/// Request message for `LiveDataService.GetBalance`.
6372#[non_exhaustive]
6373#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6374pub struct GetBalanceRequest {
6375    /// Required. The owner's Sui address.
6376    #[prost(string, optional, tag = "1")]
6377    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6378    /// Required. The type names for the coin (e.g., 0x2::sui::SUI).
6379    #[prost(string, optional, tag = "2")]
6380    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6381}
6382/// Response message for `LiveDataService.GetBalance`.
6383/// Return the total coin balance for one coin type, owned by the address owner.
6384#[non_exhaustive]
6385#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6386pub struct GetBalanceResponse {
6387    /// The balance information for the requested coin type.
6388    #[prost(message, optional, tag = "1")]
6389    pub balance: ::core::option::Option<Balance>,
6390}
6391/// Request message for `LiveDataService.ListBalances`.
6392#[non_exhaustive]
6393#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6394pub struct ListBalancesRequest {
6395    /// Required. The owner's Sui address.
6396    #[prost(string, optional, tag = "1")]
6397    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6398    /// The maximum number of balance entries to return. The service may return fewer than this value.
6399    /// If unspecified, at most `50` entries will be returned.
6400    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6401    #[prost(uint32, optional, tag = "2")]
6402    pub page_size: ::core::option::Option<u32>,
6403    /// A page token, received from a previous `ListBalances` call.
6404    /// Provide this to retrieve the subsequent page.
6405    ///
6406    /// When paginating, all other parameters provided to `ListBalances` must
6407    /// match the call that provided the page token.
6408    #[prost(bytes = "bytes", optional, tag = "3")]
6409    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6410}
6411/// Response message for `LiveDataService.ListBalances`.
6412/// Return the total coin balance for all coin types, owned by the address owner.
6413#[non_exhaustive]
6414#[derive(Clone, PartialEq, ::prost::Message)]
6415pub struct ListBalancesResponse {
6416    /// The list of coin types and their respective balances.
6417    #[prost(message, repeated, tag = "1")]
6418    pub balances: ::prost::alloc::vec::Vec<Balance>,
6419    /// A token, which can be sent as `page_token` to retrieve the next page.
6420    /// If this field is omitted, there are no subsequent pages.
6421    #[prost(bytes = "bytes", optional, tag = "2")]
6422    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6423}
6424/// Balance information for a specific coin type.
6425#[non_exhaustive]
6426#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6427pub struct Balance {
6428    /// The type of the coin (e.g., 0x2::sui::SUI).
6429    #[prost(string, optional, tag = "1")]
6430    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6431    /// The total balance of `coin_type` in its smallest unit.
6432    /// This is the sum of all spendable amounts of `coin_type` (`address_balance`
6433    /// and `coin_balance`).
6434    #[prost(uint64, optional, tag = "3")]
6435    pub balance: ::core::option::Option<u64>,
6436    /// The balance of `Balance<T>` in this address's Address Balance.
6437    #[prost(uint64, optional, tag = "4")]
6438    pub address_balance: ::core::option::Option<u64>,
6439    /// The balance of all `Coin<T>` objects owned by this address.
6440    #[prost(uint64, optional, tag = "5")]
6441    pub coin_balance: ::core::option::Option<u64>,
6442}
6443/// Request message for `NodeService.ListDynamicFields`
6444#[non_exhaustive]
6445#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6446pub struct ListDynamicFieldsRequest {
6447    /// Required. The `UID` of the parent, which owns the collections of dynamic fields.
6448    #[prost(string, optional, tag = "1")]
6449    pub parent: ::core::option::Option<::prost::alloc::string::String>,
6450    /// The maximum number of dynamic fields to return. The service may return fewer than this value.
6451    /// If unspecified, at most `50` entries will be returned.
6452    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6453    #[prost(uint32, optional, tag = "2")]
6454    pub page_size: ::core::option::Option<u32>,
6455    /// A page token, received from a previous `ListDynamicFields` call.
6456    /// Provide this to retrieve the subsequent page.
6457    ///
6458    /// When paginating, all other parameters provided to `ListDynamicFields` must
6459    /// match the call that provided the page token.
6460    #[prost(bytes = "bytes", optional, tag = "3")]
6461    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6462    /// Mask specifying which fields to read.
6463    /// If no mask is specified, defaults to `parent,field_id`.
6464    #[prost(message, optional, tag = "4")]
6465    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6466}
6467/// Response message for `NodeService.ListDynamicFields`
6468#[non_exhaustive]
6469#[derive(Clone, PartialEq, ::prost::Message)]
6470pub struct ListDynamicFieldsResponse {
6471    /// Page of dynamic fields owned by the specified parent.
6472    #[prost(message, repeated, tag = "1")]
6473    pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
6474    /// A token, which can be sent as `page_token` to retrieve the next page.
6475    /// If this field is omitted, there are no subsequent pages.
6476    #[prost(bytes = "bytes", optional, tag = "2")]
6477    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6478}
6479#[non_exhaustive]
6480#[derive(Clone, PartialEq, ::prost::Message)]
6481pub struct DynamicField {
6482    #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
6483    pub kind: ::core::option::Option<i32>,
6484    /// ObjectId of this dynamic field's parent.
6485    #[prost(string, optional, tag = "2")]
6486    pub parent: ::core::option::Option<::prost::alloc::string::String>,
6487    /// ObjectId of this dynamic field.
6488    #[prost(string, optional, tag = "3")]
6489    pub field_id: ::core::option::Option<::prost::alloc::string::String>,
6490    /// The field object itself
6491    #[prost(message, optional, tag = "4")]
6492    pub field_object: ::core::option::Option<Object>,
6493    /// The dynamic field's "name"
6494    #[prost(message, optional, tag = "5")]
6495    pub name: ::core::option::Option<Bcs>,
6496    /// The dynamic field's "value"
6497    #[prost(message, optional, tag = "6")]
6498    pub value: ::core::option::Option<Bcs>,
6499    /// The type of the dynamic field "value".
6500    ///
6501    /// If this is a dynamic object field then this is the type of the object
6502    /// itself (which is a child of this field), otherwise this is the type of the
6503    /// value of this field.
6504    #[prost(string, optional, tag = "7")]
6505    pub value_type: ::core::option::Option<::prost::alloc::string::String>,
6506    /// The ObjectId of the child object when a child is a dynamic
6507    /// object field.
6508    ///
6509    /// The presence or absence of this field can be used to determine if a child
6510    /// is a dynamic field or a dynamic child object
6511    #[prost(string, optional, tag = "8")]
6512    pub child_id: ::core::option::Option<::prost::alloc::string::String>,
6513    /// The object itself when a child is a dynamic object field.
6514    #[prost(message, optional, tag = "9")]
6515    pub child_object: ::core::option::Option<Object>,
6516}
6517/// Nested message and enum types in `DynamicField`.
6518pub mod dynamic_field {
6519    #[non_exhaustive]
6520    #[derive(
6521        Clone,
6522        Copy,
6523        Debug,
6524        PartialEq,
6525        Eq,
6526        Hash,
6527        PartialOrd,
6528        Ord,
6529        ::prost::Enumeration
6530    )]
6531    #[repr(i32)]
6532    pub enum DynamicFieldKind {
6533        Unknown = 0,
6534        Field = 1,
6535        Object = 2,
6536    }
6537    impl DynamicFieldKind {
6538        /// String value of the enum field names used in the ProtoBuf definition.
6539        ///
6540        /// The values are not transformed in any way and thus are considered stable
6541        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6542        pub fn as_str_name(&self) -> &'static str {
6543            match self {
6544                Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
6545                Self::Field => "FIELD",
6546                Self::Object => "OBJECT",
6547            }
6548        }
6549        /// Creates an enum from field names used in the ProtoBuf definition.
6550        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6551            match value {
6552                "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
6553                "FIELD" => Some(Self::Field),
6554                "OBJECT" => Some(Self::Object),
6555                _ => None,
6556            }
6557        }
6558    }
6559}
6560#[non_exhaustive]
6561#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6562pub struct ListOwnedObjectsRequest {
6563    /// Required. The address of the account that owns the objects.
6564    #[prost(string, optional, tag = "1")]
6565    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6566    /// The maximum number of entries return. The service may return fewer than this value.
6567    /// If unspecified, at most `50` entries will be returned.
6568    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6569    #[prost(uint32, optional, tag = "2")]
6570    pub page_size: ::core::option::Option<u32>,
6571    /// A page token, received from a previous `ListOwnedObjects` call.
6572    /// Provide this to retrieve the subsequent page.
6573    ///
6574    /// When paginating, all other parameters provided to `ListOwnedObjects` must
6575    /// match the call that provided the page token.
6576    #[prost(bytes = "bytes", optional, tag = "3")]
6577    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6578    /// Mask specifying which fields to read.
6579    /// If no mask is specified, defaults to `object_id,version,object_type`.
6580    #[prost(message, optional, tag = "4")]
6581    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6582    /// Optional type filter to limit the types of objects listed.
6583    ///
6584    /// Providing an object type with no type params will return objects of that
6585    /// type with any type parameter, e.g. `0x2::coin::Coin` will return all
6586    /// `Coin<T>` objects regardless of the type parameter `T`. Providing a type
6587    /// with a type param will restrict the returned objects to only those objects
6588    /// that match the provided type parameters, e.g.
6589    /// `0x2::coin::Coin<0x2::sui::SUI>` will only return `Coin<SUI>` objects.
6590    #[prost(string, optional, tag = "5")]
6591    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
6592}
6593#[non_exhaustive]
6594#[derive(Clone, PartialEq, ::prost::Message)]
6595pub struct ListOwnedObjectsResponse {
6596    /// Page of dynamic fields owned by the specified parent.
6597    #[prost(message, repeated, tag = "1")]
6598    pub objects: ::prost::alloc::vec::Vec<Object>,
6599    /// A token, which can be sent as `page_token` to retrieve the next page.
6600    /// If this field is omitted, there are no subsequent pages.
6601    #[prost(bytes = "bytes", optional, tag = "2")]
6602    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6603}
6604/// Generated client implementations.
6605pub mod state_service_client {
6606    #![allow(
6607        unused_variables,
6608        dead_code,
6609        missing_docs,
6610        clippy::wildcard_imports,
6611        clippy::let_unit_value,
6612    )]
6613    use tonic::codegen::*;
6614    use tonic::codegen::http::Uri;
6615    #[derive(Debug, Clone)]
6616    pub struct StateServiceClient<T> {
6617        inner: tonic::client::Grpc<T>,
6618    }
6619    impl StateServiceClient<tonic::transport::Channel> {
6620        /// Attempt to create a new client by connecting to a given endpoint.
6621        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6622        where
6623            D: TryInto<tonic::transport::Endpoint>,
6624            D::Error: Into<StdError>,
6625        {
6626            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6627            Ok(Self::new(conn))
6628        }
6629    }
6630    impl<T> StateServiceClient<T>
6631    where
6632        T: tonic::client::GrpcService<tonic::body::Body>,
6633        T::Error: Into<StdError>,
6634        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6635        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6636    {
6637        pub fn new(inner: T) -> Self {
6638            let inner = tonic::client::Grpc::new(inner);
6639            Self { inner }
6640        }
6641        pub fn with_origin(inner: T, origin: Uri) -> Self {
6642            let inner = tonic::client::Grpc::with_origin(inner, origin);
6643            Self { inner }
6644        }
6645        pub fn with_interceptor<F>(
6646            inner: T,
6647            interceptor: F,
6648        ) -> StateServiceClient<InterceptedService<T, F>>
6649        where
6650            F: tonic::service::Interceptor,
6651            T::ResponseBody: Default,
6652            T: tonic::codegen::Service<
6653                http::Request<tonic::body::Body>,
6654                Response = http::Response<
6655                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6656                >,
6657            >,
6658            <T as tonic::codegen::Service<
6659                http::Request<tonic::body::Body>,
6660            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6661        {
6662            StateServiceClient::new(InterceptedService::new(inner, interceptor))
6663        }
6664        /// Compress requests with the given encoding.
6665        ///
6666        /// This requires the server to support it otherwise it might respond with an
6667        /// error.
6668        #[must_use]
6669        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6670            self.inner = self.inner.send_compressed(encoding);
6671            self
6672        }
6673        /// Enable decompressing responses.
6674        #[must_use]
6675        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6676            self.inner = self.inner.accept_compressed(encoding);
6677            self
6678        }
6679        /// Limits the maximum size of a decoded message.
6680        ///
6681        /// Default: `4MB`
6682        #[must_use]
6683        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6684            self.inner = self.inner.max_decoding_message_size(limit);
6685            self
6686        }
6687        /// Limits the maximum size of an encoded message.
6688        ///
6689        /// Default: `usize::MAX`
6690        #[must_use]
6691        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6692            self.inner = self.inner.max_encoding_message_size(limit);
6693            self
6694        }
6695        pub async fn list_dynamic_fields(
6696            &mut self,
6697            request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
6698        ) -> std::result::Result<
6699            tonic::Response<super::ListDynamicFieldsResponse>,
6700            tonic::Status,
6701        > {
6702            self.inner
6703                .ready()
6704                .await
6705                .map_err(|e| {
6706                    tonic::Status::unknown(
6707                        format!("Service was not ready: {}", e.into()),
6708                    )
6709                })?;
6710            let codec = tonic_prost::ProstCodec::default();
6711            let path = http::uri::PathAndQuery::from_static(
6712                "/sui.rpc.v2.StateService/ListDynamicFields",
6713            );
6714            let mut req = request.into_request();
6715            req.extensions_mut()
6716                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
6717            self.inner.unary(req, path, codec).await
6718        }
6719        pub async fn list_owned_objects(
6720            &mut self,
6721            request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
6722        ) -> std::result::Result<
6723            tonic::Response<super::ListOwnedObjectsResponse>,
6724            tonic::Status,
6725        > {
6726            self.inner
6727                .ready()
6728                .await
6729                .map_err(|e| {
6730                    tonic::Status::unknown(
6731                        format!("Service was not ready: {}", e.into()),
6732                    )
6733                })?;
6734            let codec = tonic_prost::ProstCodec::default();
6735            let path = http::uri::PathAndQuery::from_static(
6736                "/sui.rpc.v2.StateService/ListOwnedObjects",
6737            );
6738            let mut req = request.into_request();
6739            req.extensions_mut()
6740                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
6741            self.inner.unary(req, path, codec).await
6742        }
6743        pub async fn get_coin_info(
6744            &mut self,
6745            request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
6746        ) -> std::result::Result<
6747            tonic::Response<super::GetCoinInfoResponse>,
6748            tonic::Status,
6749        > {
6750            self.inner
6751                .ready()
6752                .await
6753                .map_err(|e| {
6754                    tonic::Status::unknown(
6755                        format!("Service was not ready: {}", e.into()),
6756                    )
6757                })?;
6758            let codec = tonic_prost::ProstCodec::default();
6759            let path = http::uri::PathAndQuery::from_static(
6760                "/sui.rpc.v2.StateService/GetCoinInfo",
6761            );
6762            let mut req = request.into_request();
6763            req.extensions_mut()
6764                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
6765            self.inner.unary(req, path, codec).await
6766        }
6767        pub async fn get_balance(
6768            &mut self,
6769            request: impl tonic::IntoRequest<super::GetBalanceRequest>,
6770        ) -> std::result::Result<
6771            tonic::Response<super::GetBalanceResponse>,
6772            tonic::Status,
6773        > {
6774            self.inner
6775                .ready()
6776                .await
6777                .map_err(|e| {
6778                    tonic::Status::unknown(
6779                        format!("Service was not ready: {}", e.into()),
6780                    )
6781                })?;
6782            let codec = tonic_prost::ProstCodec::default();
6783            let path = http::uri::PathAndQuery::from_static(
6784                "/sui.rpc.v2.StateService/GetBalance",
6785            );
6786            let mut req = request.into_request();
6787            req.extensions_mut()
6788                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
6789            self.inner.unary(req, path, codec).await
6790        }
6791        pub async fn list_balances(
6792            &mut self,
6793            request: impl tonic::IntoRequest<super::ListBalancesRequest>,
6794        ) -> std::result::Result<
6795            tonic::Response<super::ListBalancesResponse>,
6796            tonic::Status,
6797        > {
6798            self.inner
6799                .ready()
6800                .await
6801                .map_err(|e| {
6802                    tonic::Status::unknown(
6803                        format!("Service was not ready: {}", e.into()),
6804                    )
6805                })?;
6806            let codec = tonic_prost::ProstCodec::default();
6807            let path = http::uri::PathAndQuery::from_static(
6808                "/sui.rpc.v2.StateService/ListBalances",
6809            );
6810            let mut req = request.into_request();
6811            req.extensions_mut()
6812                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
6813            self.inner.unary(req, path, codec).await
6814        }
6815    }
6816}
6817/// Generated server implementations.
6818pub mod state_service_server {
6819    #![allow(
6820        unused_variables,
6821        dead_code,
6822        missing_docs,
6823        clippy::wildcard_imports,
6824        clippy::let_unit_value,
6825    )]
6826    use tonic::codegen::*;
6827    /// Generated trait containing gRPC methods that should be implemented for use with StateServiceServer.
6828    #[async_trait]
6829    pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
6830        async fn list_dynamic_fields(
6831            &self,
6832            request: tonic::Request<super::ListDynamicFieldsRequest>,
6833        ) -> std::result::Result<
6834            tonic::Response<super::ListDynamicFieldsResponse>,
6835            tonic::Status,
6836        > {
6837            Err(tonic::Status::unimplemented("Not yet implemented"))
6838        }
6839        async fn list_owned_objects(
6840            &self,
6841            request: tonic::Request<super::ListOwnedObjectsRequest>,
6842        ) -> std::result::Result<
6843            tonic::Response<super::ListOwnedObjectsResponse>,
6844            tonic::Status,
6845        > {
6846            Err(tonic::Status::unimplemented("Not yet implemented"))
6847        }
6848        async fn get_coin_info(
6849            &self,
6850            request: tonic::Request<super::GetCoinInfoRequest>,
6851        ) -> std::result::Result<
6852            tonic::Response<super::GetCoinInfoResponse>,
6853            tonic::Status,
6854        > {
6855            Err(tonic::Status::unimplemented("Not yet implemented"))
6856        }
6857        async fn get_balance(
6858            &self,
6859            request: tonic::Request<super::GetBalanceRequest>,
6860        ) -> std::result::Result<
6861            tonic::Response<super::GetBalanceResponse>,
6862            tonic::Status,
6863        > {
6864            Err(tonic::Status::unimplemented("Not yet implemented"))
6865        }
6866        async fn list_balances(
6867            &self,
6868            request: tonic::Request<super::ListBalancesRequest>,
6869        ) -> std::result::Result<
6870            tonic::Response<super::ListBalancesResponse>,
6871            tonic::Status,
6872        > {
6873            Err(tonic::Status::unimplemented("Not yet implemented"))
6874        }
6875    }
6876    #[derive(Debug)]
6877    pub struct StateServiceServer<T> {
6878        inner: Arc<T>,
6879        accept_compression_encodings: EnabledCompressionEncodings,
6880        send_compression_encodings: EnabledCompressionEncodings,
6881        max_decoding_message_size: Option<usize>,
6882        max_encoding_message_size: Option<usize>,
6883    }
6884    impl<T> StateServiceServer<T> {
6885        pub fn new(inner: T) -> Self {
6886            Self::from_arc(Arc::new(inner))
6887        }
6888        pub fn from_arc(inner: Arc<T>) -> Self {
6889            Self {
6890                inner,
6891                accept_compression_encodings: Default::default(),
6892                send_compression_encodings: Default::default(),
6893                max_decoding_message_size: None,
6894                max_encoding_message_size: None,
6895            }
6896        }
6897        pub fn with_interceptor<F>(
6898            inner: T,
6899            interceptor: F,
6900        ) -> InterceptedService<Self, F>
6901        where
6902            F: tonic::service::Interceptor,
6903        {
6904            InterceptedService::new(Self::new(inner), interceptor)
6905        }
6906        /// Enable decompressing requests with the given encoding.
6907        #[must_use]
6908        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6909            self.accept_compression_encodings.enable(encoding);
6910            self
6911        }
6912        /// Compress responses with the given encoding, if the client supports it.
6913        #[must_use]
6914        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6915            self.send_compression_encodings.enable(encoding);
6916            self
6917        }
6918        /// Limits the maximum size of a decoded message.
6919        ///
6920        /// Default: `4MB`
6921        #[must_use]
6922        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6923            self.max_decoding_message_size = Some(limit);
6924            self
6925        }
6926        /// Limits the maximum size of an encoded message.
6927        ///
6928        /// Default: `usize::MAX`
6929        #[must_use]
6930        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6931            self.max_encoding_message_size = Some(limit);
6932            self
6933        }
6934    }
6935    impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
6936    where
6937        T: StateService,
6938        B: Body + std::marker::Send + 'static,
6939        B::Error: Into<StdError> + std::marker::Send + 'static,
6940    {
6941        type Response = http::Response<tonic::body::Body>;
6942        type Error = std::convert::Infallible;
6943        type Future = BoxFuture<Self::Response, Self::Error>;
6944        fn poll_ready(
6945            &mut self,
6946            _cx: &mut Context<'_>,
6947        ) -> Poll<std::result::Result<(), Self::Error>> {
6948            Poll::Ready(Ok(()))
6949        }
6950        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6951            match req.uri().path() {
6952                "/sui.rpc.v2.StateService/ListDynamicFields" => {
6953                    #[allow(non_camel_case_types)]
6954                    struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
6955                    impl<
6956                        T: StateService,
6957                    > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
6958                    for ListDynamicFieldsSvc<T> {
6959                        type Response = super::ListDynamicFieldsResponse;
6960                        type Future = BoxFuture<
6961                            tonic::Response<Self::Response>,
6962                            tonic::Status,
6963                        >;
6964                        fn call(
6965                            &mut self,
6966                            request: tonic::Request<super::ListDynamicFieldsRequest>,
6967                        ) -> Self::Future {
6968                            let inner = Arc::clone(&self.0);
6969                            let fut = async move {
6970                                <T as StateService>::list_dynamic_fields(&inner, request)
6971                                    .await
6972                            };
6973                            Box::pin(fut)
6974                        }
6975                    }
6976                    let accept_compression_encodings = self.accept_compression_encodings;
6977                    let send_compression_encodings = self.send_compression_encodings;
6978                    let max_decoding_message_size = self.max_decoding_message_size;
6979                    let max_encoding_message_size = self.max_encoding_message_size;
6980                    let inner = self.inner.clone();
6981                    let fut = async move {
6982                        let method = ListDynamicFieldsSvc(inner);
6983                        let codec = tonic_prost::ProstCodec::default();
6984                        let mut grpc = tonic::server::Grpc::new(codec)
6985                            .apply_compression_config(
6986                                accept_compression_encodings,
6987                                send_compression_encodings,
6988                            )
6989                            .apply_max_message_size_config(
6990                                max_decoding_message_size,
6991                                max_encoding_message_size,
6992                            );
6993                        let res = grpc.unary(method, req).await;
6994                        Ok(res)
6995                    };
6996                    Box::pin(fut)
6997                }
6998                "/sui.rpc.v2.StateService/ListOwnedObjects" => {
6999                    #[allow(non_camel_case_types)]
7000                    struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
7001                    impl<
7002                        T: StateService,
7003                    > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
7004                    for ListOwnedObjectsSvc<T> {
7005                        type Response = super::ListOwnedObjectsResponse;
7006                        type Future = BoxFuture<
7007                            tonic::Response<Self::Response>,
7008                            tonic::Status,
7009                        >;
7010                        fn call(
7011                            &mut self,
7012                            request: tonic::Request<super::ListOwnedObjectsRequest>,
7013                        ) -> Self::Future {
7014                            let inner = Arc::clone(&self.0);
7015                            let fut = async move {
7016                                <T as StateService>::list_owned_objects(&inner, request)
7017                                    .await
7018                            };
7019                            Box::pin(fut)
7020                        }
7021                    }
7022                    let accept_compression_encodings = self.accept_compression_encodings;
7023                    let send_compression_encodings = self.send_compression_encodings;
7024                    let max_decoding_message_size = self.max_decoding_message_size;
7025                    let max_encoding_message_size = self.max_encoding_message_size;
7026                    let inner = self.inner.clone();
7027                    let fut = async move {
7028                        let method = ListOwnedObjectsSvc(inner);
7029                        let codec = tonic_prost::ProstCodec::default();
7030                        let mut grpc = tonic::server::Grpc::new(codec)
7031                            .apply_compression_config(
7032                                accept_compression_encodings,
7033                                send_compression_encodings,
7034                            )
7035                            .apply_max_message_size_config(
7036                                max_decoding_message_size,
7037                                max_encoding_message_size,
7038                            );
7039                        let res = grpc.unary(method, req).await;
7040                        Ok(res)
7041                    };
7042                    Box::pin(fut)
7043                }
7044                "/sui.rpc.v2.StateService/GetCoinInfo" => {
7045                    #[allow(non_camel_case_types)]
7046                    struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
7047                    impl<
7048                        T: StateService,
7049                    > tonic::server::UnaryService<super::GetCoinInfoRequest>
7050                    for GetCoinInfoSvc<T> {
7051                        type Response = super::GetCoinInfoResponse;
7052                        type Future = BoxFuture<
7053                            tonic::Response<Self::Response>,
7054                            tonic::Status,
7055                        >;
7056                        fn call(
7057                            &mut self,
7058                            request: tonic::Request<super::GetCoinInfoRequest>,
7059                        ) -> Self::Future {
7060                            let inner = Arc::clone(&self.0);
7061                            let fut = async move {
7062                                <T as StateService>::get_coin_info(&inner, request).await
7063                            };
7064                            Box::pin(fut)
7065                        }
7066                    }
7067                    let accept_compression_encodings = self.accept_compression_encodings;
7068                    let send_compression_encodings = self.send_compression_encodings;
7069                    let max_decoding_message_size = self.max_decoding_message_size;
7070                    let max_encoding_message_size = self.max_encoding_message_size;
7071                    let inner = self.inner.clone();
7072                    let fut = async move {
7073                        let method = GetCoinInfoSvc(inner);
7074                        let codec = tonic_prost::ProstCodec::default();
7075                        let mut grpc = tonic::server::Grpc::new(codec)
7076                            .apply_compression_config(
7077                                accept_compression_encodings,
7078                                send_compression_encodings,
7079                            )
7080                            .apply_max_message_size_config(
7081                                max_decoding_message_size,
7082                                max_encoding_message_size,
7083                            );
7084                        let res = grpc.unary(method, req).await;
7085                        Ok(res)
7086                    };
7087                    Box::pin(fut)
7088                }
7089                "/sui.rpc.v2.StateService/GetBalance" => {
7090                    #[allow(non_camel_case_types)]
7091                    struct GetBalanceSvc<T: StateService>(pub Arc<T>);
7092                    impl<
7093                        T: StateService,
7094                    > tonic::server::UnaryService<super::GetBalanceRequest>
7095                    for GetBalanceSvc<T> {
7096                        type Response = super::GetBalanceResponse;
7097                        type Future = BoxFuture<
7098                            tonic::Response<Self::Response>,
7099                            tonic::Status,
7100                        >;
7101                        fn call(
7102                            &mut self,
7103                            request: tonic::Request<super::GetBalanceRequest>,
7104                        ) -> Self::Future {
7105                            let inner = Arc::clone(&self.0);
7106                            let fut = async move {
7107                                <T as StateService>::get_balance(&inner, request).await
7108                            };
7109                            Box::pin(fut)
7110                        }
7111                    }
7112                    let accept_compression_encodings = self.accept_compression_encodings;
7113                    let send_compression_encodings = self.send_compression_encodings;
7114                    let max_decoding_message_size = self.max_decoding_message_size;
7115                    let max_encoding_message_size = self.max_encoding_message_size;
7116                    let inner = self.inner.clone();
7117                    let fut = async move {
7118                        let method = GetBalanceSvc(inner);
7119                        let codec = tonic_prost::ProstCodec::default();
7120                        let mut grpc = tonic::server::Grpc::new(codec)
7121                            .apply_compression_config(
7122                                accept_compression_encodings,
7123                                send_compression_encodings,
7124                            )
7125                            .apply_max_message_size_config(
7126                                max_decoding_message_size,
7127                                max_encoding_message_size,
7128                            );
7129                        let res = grpc.unary(method, req).await;
7130                        Ok(res)
7131                    };
7132                    Box::pin(fut)
7133                }
7134                "/sui.rpc.v2.StateService/ListBalances" => {
7135                    #[allow(non_camel_case_types)]
7136                    struct ListBalancesSvc<T: StateService>(pub Arc<T>);
7137                    impl<
7138                        T: StateService,
7139                    > tonic::server::UnaryService<super::ListBalancesRequest>
7140                    for ListBalancesSvc<T> {
7141                        type Response = super::ListBalancesResponse;
7142                        type Future = BoxFuture<
7143                            tonic::Response<Self::Response>,
7144                            tonic::Status,
7145                        >;
7146                        fn call(
7147                            &mut self,
7148                            request: tonic::Request<super::ListBalancesRequest>,
7149                        ) -> Self::Future {
7150                            let inner = Arc::clone(&self.0);
7151                            let fut = async move {
7152                                <T as StateService>::list_balances(&inner, request).await
7153                            };
7154                            Box::pin(fut)
7155                        }
7156                    }
7157                    let accept_compression_encodings = self.accept_compression_encodings;
7158                    let send_compression_encodings = self.send_compression_encodings;
7159                    let max_decoding_message_size = self.max_decoding_message_size;
7160                    let max_encoding_message_size = self.max_encoding_message_size;
7161                    let inner = self.inner.clone();
7162                    let fut = async move {
7163                        let method = ListBalancesSvc(inner);
7164                        let codec = tonic_prost::ProstCodec::default();
7165                        let mut grpc = tonic::server::Grpc::new(codec)
7166                            .apply_compression_config(
7167                                accept_compression_encodings,
7168                                send_compression_encodings,
7169                            )
7170                            .apply_max_message_size_config(
7171                                max_decoding_message_size,
7172                                max_encoding_message_size,
7173                            );
7174                        let res = grpc.unary(method, req).await;
7175                        Ok(res)
7176                    };
7177                    Box::pin(fut)
7178                }
7179                _ => {
7180                    Box::pin(async move {
7181                        let mut response = http::Response::new(
7182                            tonic::body::Body::default(),
7183                        );
7184                        let headers = response.headers_mut();
7185                        headers
7186                            .insert(
7187                                tonic::Status::GRPC_STATUS,
7188                                (tonic::Code::Unimplemented as i32).into(),
7189                            );
7190                        headers
7191                            .insert(
7192                                http::header::CONTENT_TYPE,
7193                                tonic::metadata::GRPC_CONTENT_TYPE,
7194                            );
7195                        Ok(response)
7196                    })
7197                }
7198            }
7199        }
7200    }
7201    impl<T> Clone for StateServiceServer<T> {
7202        fn clone(&self) -> Self {
7203            let inner = self.inner.clone();
7204            Self {
7205                inner,
7206                accept_compression_encodings: self.accept_compression_encodings,
7207                send_compression_encodings: self.send_compression_encodings,
7208                max_decoding_message_size: self.max_decoding_message_size,
7209                max_encoding_message_size: self.max_encoding_message_size,
7210            }
7211        }
7212    }
7213    /// Generated gRPC service name
7214    pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
7215    impl<T> tonic::server::NamedService for StateServiceServer<T> {
7216        const NAME: &'static str = SERVICE_NAME;
7217    }
7218}
7219/// Request message for SubscriptionService.SubscribeCheckpoints.
7220#[derive(Eq, Hash)]
7221#[non_exhaustive]
7222#[derive(Clone, PartialEq, ::prost::Message)]
7223pub struct SubscribeCheckpointsRequest {
7224    /// Optional. Mask for specifying which parts of the Checkpoint should be
7225    /// returned (e.g. summary, contents, signatures). `cursor` is always
7226    /// populated and is not subject to the mask.
7227    #[prost(message, optional, tag = "1")]
7228    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7229    /// Optional. DNF filter over indexed transaction dimensions. A checkpoint
7230    /// matches if any transaction it contains satisfies the filter. If absent,
7231    /// every checkpoint is streamed.
7232    #[prost(message, optional, tag = "2")]
7233    pub filter: ::core::option::Option<TransactionFilter>,
7234}
7235/// Response message for SubscriptionService.SubscribeCheckpoints.
7236///
7237/// A checkpoint stream's position is checkpoint-granular, so the `cursor`
7238/// sequence number stands in for the `Watermark` message the other
7239/// subscription responses carry. Progress-only frames (with `checkpoint`
7240/// unset) occur only on filtered streams: on an unfiltered stream every frame
7241/// carries both fields, in order and without gaps.
7242#[non_exhaustive]
7243#[derive(Clone, PartialEq, ::prost::Message)]
7244pub struct SubscribeCheckpointsResponse {
7245    /// Required. The checkpoint sequence number the stream has fully covered,
7246    /// inclusive: every matching checkpoint from the stream's start position
7247    /// through `cursor` has been delivered. Present on every frame and
7248    /// advances monotonically.
7249    #[prost(uint64, optional, tag = "1")]
7250    pub cursor: ::core::option::Option<u64>,
7251    /// The matching checkpoint. Unset when this frame only advances the
7252    /// cursor past non-matching checkpoints.
7253    #[prost(message, optional, tag = "2")]
7254    pub checkpoint: ::core::option::Option<Checkpoint>,
7255}
7256/// Request message for SubscriptionService.SubscribeTransactions.
7257#[non_exhaustive]
7258#[derive(Clone, PartialEq, ::prost::Message)]
7259pub struct SubscribeTransactionsRequest {
7260    /// Optional. Mask for specifying which parts of the ExecutedTransaction
7261    /// should be returned.
7262    #[prost(message, optional, tag = "1")]
7263    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7264    /// Optional. DNF filter over indexed dimensions. If absent, every
7265    /// transaction is streamed.
7266    #[prost(message, optional, tag = "2")]
7267    pub filter: ::core::option::Option<TransactionFilter>,
7268}
7269/// Response message for SubscriptionService.SubscribeTransactions.
7270///
7271/// Mirrors ListTransactionsResponse, except there is no `end` field: a
7272/// subscription stream has no successful end.
7273#[non_exhaustive]
7274#[derive(Clone, PartialEq, ::prost::Message)]
7275pub struct SubscribeTransactionsResponse {
7276    /// One matching transaction. Its position within the containing checkpoint
7277    /// is reported by `ExecutedTransaction.transaction_index`.
7278    #[prost(message, optional, tag = "1")]
7279    pub transaction: ::core::option::Option<ExecutedTransaction>,
7280    /// Progress watermark as of this frame. Present on every frame.
7281    #[prost(message, optional, tag = "2")]
7282    pub watermark: ::core::option::Option<Watermark>,
7283}
7284/// Request message for SubscriptionService.SubscribeEvents.
7285#[non_exhaustive]
7286#[derive(Clone, PartialEq, ::prost::Message)]
7287pub struct SubscribeEventsRequest {
7288    /// Optional. Mask for specifying which parts of the Event should be
7289    /// returned.
7290    #[prost(message, optional, tag = "1")]
7291    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7292    /// Optional. DNF filter over indexed dimensions. If absent, every event is
7293    /// streamed.
7294    #[prost(message, optional, tag = "2")]
7295    pub filter: ::core::option::Option<EventFilter>,
7296}
7297/// Response message for SubscriptionService.SubscribeEvents.
7298///
7299/// Mirrors ListEventsResponse, except there is no `end` field: a subscription
7300/// stream has no successful end.
7301#[non_exhaustive]
7302#[derive(Clone, PartialEq, ::prost::Message)]
7303pub struct SubscribeEventsResponse {
7304    /// One matching event. Its ledger position -- containing checkpoint,
7305    /// emitting transaction digest and offset, and index within that
7306    /// transaction's event list -- is reported by the corresponding fields on
7307    /// `Event`.
7308    #[prost(message, optional, tag = "1")]
7309    pub event: ::core::option::Option<Event>,
7310    /// Progress watermark as of this frame. Present on every frame.
7311    #[prost(message, optional, tag = "2")]
7312    pub watermark: ::core::option::Option<Watermark>,
7313}
7314/// Generated client implementations.
7315pub mod subscription_service_client {
7316    #![allow(
7317        unused_variables,
7318        dead_code,
7319        missing_docs,
7320        clippy::wildcard_imports,
7321        clippy::let_unit_value,
7322    )]
7323    use tonic::codegen::*;
7324    use tonic::codegen::http::Uri;
7325    /// SubscriptionService provides filtered, real-time streams of checkpoints,
7326    /// transactions, and events.
7327    ///
7328    /// Each Subscribe API pairs with the LedgerService List API of the same name:
7329    /// requests take the same filter message, and responses carry the same item
7330    /// and watermark shapes with identical cursor semantics.
7331    ///
7332    /// Subscriptions do not support resumption. A new subscription always begins
7333    /// at the current tip of the chain as seen by the server (the latest executed
7334    /// checkpoint). To recover data missed between subscriptions, replay the gap
7335    /// with the paired List API: pass the last received `Watermark.cursor` as
7336    /// `options.after` on the List request (for checkpoints, pass the last
7337    /// received `cursor + 1` as `start_checkpoint`). The List scan reads from the
7338    /// indexed tip, which may trail the subscription's start position; repeat the
7339    /// List call as the index advances until the replay reaches the position
7340    /// established by the subscription's first frame.
7341    ///
7342    /// A subscription behaves like an unbounded ascending scan: every frame
7343    /// carries the subscriber's resume point, and progress advances as
7344    /// checkpoints are fully covered. Two delivery guarantees keep sparse
7345    /// filters live: the first frame on a filtered subscription is a
7346    /// progress-only frame establishing the stream's start position, and
7347    /// progress continues to advance with bounded staleness even when no item
7348    /// matches.
7349    ///
7350    /// Subscription streams have no successful end: they run until cancelled by
7351    /// the client or terminated by the server with a gRPC status.
7352    #[derive(Debug, Clone)]
7353    pub struct SubscriptionServiceClient<T> {
7354        inner: tonic::client::Grpc<T>,
7355    }
7356    impl SubscriptionServiceClient<tonic::transport::Channel> {
7357        /// Attempt to create a new client by connecting to a given endpoint.
7358        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7359        where
7360            D: TryInto<tonic::transport::Endpoint>,
7361            D::Error: Into<StdError>,
7362        {
7363            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7364            Ok(Self::new(conn))
7365        }
7366    }
7367    impl<T> SubscriptionServiceClient<T>
7368    where
7369        T: tonic::client::GrpcService<tonic::body::Body>,
7370        T::Error: Into<StdError>,
7371        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7372        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7373    {
7374        pub fn new(inner: T) -> Self {
7375            let inner = tonic::client::Grpc::new(inner);
7376            Self { inner }
7377        }
7378        pub fn with_origin(inner: T, origin: Uri) -> Self {
7379            let inner = tonic::client::Grpc::with_origin(inner, origin);
7380            Self { inner }
7381        }
7382        pub fn with_interceptor<F>(
7383            inner: T,
7384            interceptor: F,
7385        ) -> SubscriptionServiceClient<InterceptedService<T, F>>
7386        where
7387            F: tonic::service::Interceptor,
7388            T::ResponseBody: Default,
7389            T: tonic::codegen::Service<
7390                http::Request<tonic::body::Body>,
7391                Response = http::Response<
7392                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7393                >,
7394            >,
7395            <T as tonic::codegen::Service<
7396                http::Request<tonic::body::Body>,
7397            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7398        {
7399            SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
7400        }
7401        /// Compress requests with the given encoding.
7402        ///
7403        /// This requires the server to support it otherwise it might respond with an
7404        /// error.
7405        #[must_use]
7406        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7407            self.inner = self.inner.send_compressed(encoding);
7408            self
7409        }
7410        /// Enable decompressing responses.
7411        #[must_use]
7412        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7413            self.inner = self.inner.accept_compressed(encoding);
7414            self
7415        }
7416        /// Limits the maximum size of a decoded message.
7417        ///
7418        /// Default: `4MB`
7419        #[must_use]
7420        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7421            self.inner = self.inner.max_decoding_message_size(limit);
7422            self
7423        }
7424        /// Limits the maximum size of an encoded message.
7425        ///
7426        /// Default: `usize::MAX`
7427        #[must_use]
7428        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7429            self.inner = self.inner.max_encoding_message_size(limit);
7430            self
7431        }
7432        /// Subscribe to the stream of checkpoints.
7433        ///
7434        /// The stream begins at the latest executed checkpoint as seen by the
7435        /// server and yields checkpoints matching the filter as they are executed.
7436        /// A checkpoint matches if any transaction it contains satisfies the
7437        /// filter.
7438        pub async fn subscribe_checkpoints(
7439            &mut self,
7440            request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
7441        ) -> std::result::Result<
7442            tonic::Response<
7443                tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
7444            >,
7445            tonic::Status,
7446        > {
7447            self.inner
7448                .ready()
7449                .await
7450                .map_err(|e| {
7451                    tonic::Status::unknown(
7452                        format!("Service was not ready: {}", e.into()),
7453                    )
7454                })?;
7455            let codec = tonic_prost::ProstCodec::default();
7456            let path = http::uri::PathAndQuery::from_static(
7457                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
7458            );
7459            let mut req = request.into_request();
7460            req.extensions_mut()
7461                .insert(
7462                    GrpcMethod::new(
7463                        "sui.rpc.v2.SubscriptionService",
7464                        "SubscribeCheckpoints",
7465                    ),
7466                );
7467            self.inner.server_streaming(req, path, codec).await
7468        }
7469        /// Subscribe to the stream of transactions.
7470        ///
7471        /// The stream begins at the latest executed checkpoint as seen by the
7472        /// server and yields transactions matching the filter as they are executed.
7473        pub async fn subscribe_transactions(
7474            &mut self,
7475            request: impl tonic::IntoRequest<super::SubscribeTransactionsRequest>,
7476        ) -> std::result::Result<
7477            tonic::Response<
7478                tonic::codec::Streaming<super::SubscribeTransactionsResponse>,
7479            >,
7480            tonic::Status,
7481        > {
7482            self.inner
7483                .ready()
7484                .await
7485                .map_err(|e| {
7486                    tonic::Status::unknown(
7487                        format!("Service was not ready: {}", e.into()),
7488                    )
7489                })?;
7490            let codec = tonic_prost::ProstCodec::default();
7491            let path = http::uri::PathAndQuery::from_static(
7492                "/sui.rpc.v2.SubscriptionService/SubscribeTransactions",
7493            );
7494            let mut req = request.into_request();
7495            req.extensions_mut()
7496                .insert(
7497                    GrpcMethod::new(
7498                        "sui.rpc.v2.SubscriptionService",
7499                        "SubscribeTransactions",
7500                    ),
7501                );
7502            self.inner.server_streaming(req, path, codec).await
7503        }
7504        /// Subscribe to the stream of events.
7505        ///
7506        /// The stream begins at the latest executed checkpoint as seen by the
7507        /// server and yields events matching the filter as they are emitted.
7508        pub async fn subscribe_events(
7509            &mut self,
7510            request: impl tonic::IntoRequest<super::SubscribeEventsRequest>,
7511        ) -> std::result::Result<
7512            tonic::Response<tonic::codec::Streaming<super::SubscribeEventsResponse>>,
7513            tonic::Status,
7514        > {
7515            self.inner
7516                .ready()
7517                .await
7518                .map_err(|e| {
7519                    tonic::Status::unknown(
7520                        format!("Service was not ready: {}", e.into()),
7521                    )
7522                })?;
7523            let codec = tonic_prost::ProstCodec::default();
7524            let path = http::uri::PathAndQuery::from_static(
7525                "/sui.rpc.v2.SubscriptionService/SubscribeEvents",
7526            );
7527            let mut req = request.into_request();
7528            req.extensions_mut()
7529                .insert(
7530                    GrpcMethod::new("sui.rpc.v2.SubscriptionService", "SubscribeEvents"),
7531                );
7532            self.inner.server_streaming(req, path, codec).await
7533        }
7534    }
7535}
7536/// Generated server implementations.
7537pub mod subscription_service_server {
7538    #![allow(
7539        unused_variables,
7540        dead_code,
7541        missing_docs,
7542        clippy::wildcard_imports,
7543        clippy::let_unit_value,
7544    )]
7545    use tonic::codegen::*;
7546    /// Generated trait containing gRPC methods that should be implemented for use with SubscriptionServiceServer.
7547    #[async_trait]
7548    pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
7549        /// Subscribe to the stream of checkpoints.
7550        ///
7551        /// The stream begins at the latest executed checkpoint as seen by the
7552        /// server and yields checkpoints matching the filter as they are executed.
7553        /// A checkpoint matches if any transaction it contains satisfies the
7554        /// filter.
7555        async fn subscribe_checkpoints(
7556            &self,
7557            request: tonic::Request<super::SubscribeCheckpointsRequest>,
7558        ) -> std::result::Result<
7559            tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
7560            tonic::Status,
7561        > {
7562            Err(tonic::Status::unimplemented("Not yet implemented"))
7563        }
7564        /// Subscribe to the stream of transactions.
7565        ///
7566        /// The stream begins at the latest executed checkpoint as seen by the
7567        /// server and yields transactions matching the filter as they are executed.
7568        async fn subscribe_transactions(
7569            &self,
7570            request: tonic::Request<super::SubscribeTransactionsRequest>,
7571        ) -> std::result::Result<
7572            tonic::Response<BoxStream<super::SubscribeTransactionsResponse>>,
7573            tonic::Status,
7574        > {
7575            Err(tonic::Status::unimplemented("Not yet implemented"))
7576        }
7577        /// Subscribe to the stream of events.
7578        ///
7579        /// The stream begins at the latest executed checkpoint as seen by the
7580        /// server and yields events matching the filter as they are emitted.
7581        async fn subscribe_events(
7582            &self,
7583            request: tonic::Request<super::SubscribeEventsRequest>,
7584        ) -> std::result::Result<
7585            tonic::Response<BoxStream<super::SubscribeEventsResponse>>,
7586            tonic::Status,
7587        > {
7588            Err(tonic::Status::unimplemented("Not yet implemented"))
7589        }
7590    }
7591    /// SubscriptionService provides filtered, real-time streams of checkpoints,
7592    /// transactions, and events.
7593    ///
7594    /// Each Subscribe API pairs with the LedgerService List API of the same name:
7595    /// requests take the same filter message, and responses carry the same item
7596    /// and watermark shapes with identical cursor semantics.
7597    ///
7598    /// Subscriptions do not support resumption. A new subscription always begins
7599    /// at the current tip of the chain as seen by the server (the latest executed
7600    /// checkpoint). To recover data missed between subscriptions, replay the gap
7601    /// with the paired List API: pass the last received `Watermark.cursor` as
7602    /// `options.after` on the List request (for checkpoints, pass the last
7603    /// received `cursor + 1` as `start_checkpoint`). The List scan reads from the
7604    /// indexed tip, which may trail the subscription's start position; repeat the
7605    /// List call as the index advances until the replay reaches the position
7606    /// established by the subscription's first frame.
7607    ///
7608    /// A subscription behaves like an unbounded ascending scan: every frame
7609    /// carries the subscriber's resume point, and progress advances as
7610    /// checkpoints are fully covered. Two delivery guarantees keep sparse
7611    /// filters live: the first frame on a filtered subscription is a
7612    /// progress-only frame establishing the stream's start position, and
7613    /// progress continues to advance with bounded staleness even when no item
7614    /// matches.
7615    ///
7616    /// Subscription streams have no successful end: they run until cancelled by
7617    /// the client or terminated by the server with a gRPC status.
7618    #[derive(Debug)]
7619    pub struct SubscriptionServiceServer<T> {
7620        inner: Arc<T>,
7621        accept_compression_encodings: EnabledCompressionEncodings,
7622        send_compression_encodings: EnabledCompressionEncodings,
7623        max_decoding_message_size: Option<usize>,
7624        max_encoding_message_size: Option<usize>,
7625    }
7626    impl<T> SubscriptionServiceServer<T> {
7627        pub fn new(inner: T) -> Self {
7628            Self::from_arc(Arc::new(inner))
7629        }
7630        pub fn from_arc(inner: Arc<T>) -> Self {
7631            Self {
7632                inner,
7633                accept_compression_encodings: Default::default(),
7634                send_compression_encodings: Default::default(),
7635                max_decoding_message_size: None,
7636                max_encoding_message_size: None,
7637            }
7638        }
7639        pub fn with_interceptor<F>(
7640            inner: T,
7641            interceptor: F,
7642        ) -> InterceptedService<Self, F>
7643        where
7644            F: tonic::service::Interceptor,
7645        {
7646            InterceptedService::new(Self::new(inner), interceptor)
7647        }
7648        /// Enable decompressing requests with the given encoding.
7649        #[must_use]
7650        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7651            self.accept_compression_encodings.enable(encoding);
7652            self
7653        }
7654        /// Compress responses with the given encoding, if the client supports it.
7655        #[must_use]
7656        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7657            self.send_compression_encodings.enable(encoding);
7658            self
7659        }
7660        /// Limits the maximum size of a decoded message.
7661        ///
7662        /// Default: `4MB`
7663        #[must_use]
7664        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7665            self.max_decoding_message_size = Some(limit);
7666            self
7667        }
7668        /// Limits the maximum size of an encoded message.
7669        ///
7670        /// Default: `usize::MAX`
7671        #[must_use]
7672        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7673            self.max_encoding_message_size = Some(limit);
7674            self
7675        }
7676    }
7677    impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
7678    where
7679        T: SubscriptionService,
7680        B: Body + std::marker::Send + 'static,
7681        B::Error: Into<StdError> + std::marker::Send + 'static,
7682    {
7683        type Response = http::Response<tonic::body::Body>;
7684        type Error = std::convert::Infallible;
7685        type Future = BoxFuture<Self::Response, Self::Error>;
7686        fn poll_ready(
7687            &mut self,
7688            _cx: &mut Context<'_>,
7689        ) -> Poll<std::result::Result<(), Self::Error>> {
7690            Poll::Ready(Ok(()))
7691        }
7692        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7693            match req.uri().path() {
7694                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
7695                    #[allow(non_camel_case_types)]
7696                    struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
7697                    impl<
7698                        T: SubscriptionService,
7699                    > tonic::server::ServerStreamingService<
7700                        super::SubscribeCheckpointsRequest,
7701                    > for SubscribeCheckpointsSvc<T> {
7702                        type Response = super::SubscribeCheckpointsResponse;
7703                        type ResponseStream = BoxStream<
7704                            super::SubscribeCheckpointsResponse,
7705                        >;
7706                        type Future = BoxFuture<
7707                            tonic::Response<Self::ResponseStream>,
7708                            tonic::Status,
7709                        >;
7710                        fn call(
7711                            &mut self,
7712                            request: tonic::Request<super::SubscribeCheckpointsRequest>,
7713                        ) -> Self::Future {
7714                            let inner = Arc::clone(&self.0);
7715                            let fut = async move {
7716                                <T as SubscriptionService>::subscribe_checkpoints(
7717                                        &inner,
7718                                        request,
7719                                    )
7720                                    .await
7721                            };
7722                            Box::pin(fut)
7723                        }
7724                    }
7725                    let accept_compression_encodings = self.accept_compression_encodings;
7726                    let send_compression_encodings = self.send_compression_encodings;
7727                    let max_decoding_message_size = self.max_decoding_message_size;
7728                    let max_encoding_message_size = self.max_encoding_message_size;
7729                    let inner = self.inner.clone();
7730                    let fut = async move {
7731                        let method = SubscribeCheckpointsSvc(inner);
7732                        let codec = tonic_prost::ProstCodec::default();
7733                        let mut grpc = tonic::server::Grpc::new(codec)
7734                            .apply_compression_config(
7735                                accept_compression_encodings,
7736                                send_compression_encodings,
7737                            )
7738                            .apply_max_message_size_config(
7739                                max_decoding_message_size,
7740                                max_encoding_message_size,
7741                            );
7742                        let res = grpc.server_streaming(method, req).await;
7743                        Ok(res)
7744                    };
7745                    Box::pin(fut)
7746                }
7747                "/sui.rpc.v2.SubscriptionService/SubscribeTransactions" => {
7748                    #[allow(non_camel_case_types)]
7749                    struct SubscribeTransactionsSvc<T: SubscriptionService>(pub Arc<T>);
7750                    impl<
7751                        T: SubscriptionService,
7752                    > tonic::server::ServerStreamingService<
7753                        super::SubscribeTransactionsRequest,
7754                    > for SubscribeTransactionsSvc<T> {
7755                        type Response = super::SubscribeTransactionsResponse;
7756                        type ResponseStream = BoxStream<
7757                            super::SubscribeTransactionsResponse,
7758                        >;
7759                        type Future = BoxFuture<
7760                            tonic::Response<Self::ResponseStream>,
7761                            tonic::Status,
7762                        >;
7763                        fn call(
7764                            &mut self,
7765                            request: tonic::Request<super::SubscribeTransactionsRequest>,
7766                        ) -> Self::Future {
7767                            let inner = Arc::clone(&self.0);
7768                            let fut = async move {
7769                                <T as SubscriptionService>::subscribe_transactions(
7770                                        &inner,
7771                                        request,
7772                                    )
7773                                    .await
7774                            };
7775                            Box::pin(fut)
7776                        }
7777                    }
7778                    let accept_compression_encodings = self.accept_compression_encodings;
7779                    let send_compression_encodings = self.send_compression_encodings;
7780                    let max_decoding_message_size = self.max_decoding_message_size;
7781                    let max_encoding_message_size = self.max_encoding_message_size;
7782                    let inner = self.inner.clone();
7783                    let fut = async move {
7784                        let method = SubscribeTransactionsSvc(inner);
7785                        let codec = tonic_prost::ProstCodec::default();
7786                        let mut grpc = tonic::server::Grpc::new(codec)
7787                            .apply_compression_config(
7788                                accept_compression_encodings,
7789                                send_compression_encodings,
7790                            )
7791                            .apply_max_message_size_config(
7792                                max_decoding_message_size,
7793                                max_encoding_message_size,
7794                            );
7795                        let res = grpc.server_streaming(method, req).await;
7796                        Ok(res)
7797                    };
7798                    Box::pin(fut)
7799                }
7800                "/sui.rpc.v2.SubscriptionService/SubscribeEvents" => {
7801                    #[allow(non_camel_case_types)]
7802                    struct SubscribeEventsSvc<T: SubscriptionService>(pub Arc<T>);
7803                    impl<
7804                        T: SubscriptionService,
7805                    > tonic::server::ServerStreamingService<
7806                        super::SubscribeEventsRequest,
7807                    > for SubscribeEventsSvc<T> {
7808                        type Response = super::SubscribeEventsResponse;
7809                        type ResponseStream = BoxStream<super::SubscribeEventsResponse>;
7810                        type Future = BoxFuture<
7811                            tonic::Response<Self::ResponseStream>,
7812                            tonic::Status,
7813                        >;
7814                        fn call(
7815                            &mut self,
7816                            request: tonic::Request<super::SubscribeEventsRequest>,
7817                        ) -> Self::Future {
7818                            let inner = Arc::clone(&self.0);
7819                            let fut = async move {
7820                                <T as SubscriptionService>::subscribe_events(
7821                                        &inner,
7822                                        request,
7823                                    )
7824                                    .await
7825                            };
7826                            Box::pin(fut)
7827                        }
7828                    }
7829                    let accept_compression_encodings = self.accept_compression_encodings;
7830                    let send_compression_encodings = self.send_compression_encodings;
7831                    let max_decoding_message_size = self.max_decoding_message_size;
7832                    let max_encoding_message_size = self.max_encoding_message_size;
7833                    let inner = self.inner.clone();
7834                    let fut = async move {
7835                        let method = SubscribeEventsSvc(inner);
7836                        let codec = tonic_prost::ProstCodec::default();
7837                        let mut grpc = tonic::server::Grpc::new(codec)
7838                            .apply_compression_config(
7839                                accept_compression_encodings,
7840                                send_compression_encodings,
7841                            )
7842                            .apply_max_message_size_config(
7843                                max_decoding_message_size,
7844                                max_encoding_message_size,
7845                            );
7846                        let res = grpc.server_streaming(method, req).await;
7847                        Ok(res)
7848                    };
7849                    Box::pin(fut)
7850                }
7851                _ => {
7852                    Box::pin(async move {
7853                        let mut response = http::Response::new(
7854                            tonic::body::Body::default(),
7855                        );
7856                        let headers = response.headers_mut();
7857                        headers
7858                            .insert(
7859                                tonic::Status::GRPC_STATUS,
7860                                (tonic::Code::Unimplemented as i32).into(),
7861                            );
7862                        headers
7863                            .insert(
7864                                http::header::CONTENT_TYPE,
7865                                tonic::metadata::GRPC_CONTENT_TYPE,
7866                            );
7867                        Ok(response)
7868                    })
7869                }
7870            }
7871        }
7872    }
7873    impl<T> Clone for SubscriptionServiceServer<T> {
7874        fn clone(&self) -> Self {
7875            let inner = self.inner.clone();
7876            Self {
7877                inner,
7878                accept_compression_encodings: self.accept_compression_encodings,
7879                send_compression_encodings: self.send_compression_encodings,
7880                max_decoding_message_size: self.max_decoding_message_size,
7881                max_encoding_message_size: self.max_encoding_message_size,
7882            }
7883        }
7884    }
7885    /// Generated gRPC service name
7886    pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
7887    impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
7888        const NAME: &'static str = SERVICE_NAME;
7889    }
7890}
7891#[non_exhaustive]
7892#[derive(Clone, PartialEq, ::prost::Message)]
7893pub struct SystemState {
7894    /// The version of the system state data structure type.
7895    #[prost(uint64, optional, tag = "1")]
7896    pub version: ::core::option::Option<u64>,
7897    /// The epoch id
7898    #[prost(uint64, optional, tag = "2")]
7899    pub epoch: ::core::option::Option<u64>,
7900    /// The protocol version
7901    #[prost(uint64, optional, tag = "3")]
7902    pub protocol_version: ::core::option::Option<u64>,
7903    /// Information about the validators
7904    #[prost(message, optional, tag = "4")]
7905    pub validators: ::core::option::Option<ValidatorSet>,
7906    /// Storage Fund info
7907    #[prost(message, optional, tag = "5")]
7908    pub storage_fund: ::core::option::Option<StorageFund>,
7909    /// Set of system config parameters
7910    #[prost(message, optional, tag = "6")]
7911    pub parameters: ::core::option::Option<SystemParameters>,
7912    /// The reference gas price for this epoch
7913    #[prost(uint64, optional, tag = "7")]
7914    pub reference_gas_price: ::core::option::Option<u64>,
7915    /// A list of the records of validator reporting each other.
7916    ///
7917    /// There is an entry in this list for each validator that has been reported
7918    /// at least once. Each record contains all the validators that reported
7919    /// them. If a validator has never been reported they don't have a record in this list.
7920    /// This lists persists across epoch: a peer continues being in a reported state until the
7921    /// reporter doesn't explicitly remove their report.
7922    #[prost(message, repeated, tag = "8")]
7923    pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
7924    /// Schedule of stake subsidies given out each epoch.
7925    #[prost(message, optional, tag = "9")]
7926    pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
7927    /// Whether the system is running in a downgraded safe mode due to a non-recoverable bug.
7928    /// This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode.
7929    /// It can be reset once we are able to successfully execute advance_epoch.
7930    /// The rest of the fields starting with `safe_mode_` are accumulated during safe mode
7931    /// when advance_epoch_safe_mode is executed. They will eventually be processed once we
7932    /// are out of safe mode.
7933    #[prost(bool, optional, tag = "10")]
7934    pub safe_mode: ::core::option::Option<bool>,
7935    /// Storage rewards accumulated during safe_mode
7936    #[prost(uint64, optional, tag = "11")]
7937    pub safe_mode_storage_rewards: ::core::option::Option<u64>,
7938    /// Computation rewards accumulated during safe_mode
7939    #[prost(uint64, optional, tag = "12")]
7940    pub safe_mode_computation_rewards: ::core::option::Option<u64>,
7941    /// Storage rebates paid out during safe_mode
7942    #[prost(uint64, optional, tag = "13")]
7943    pub safe_mode_storage_rebates: ::core::option::Option<u64>,
7944    /// Nonrefundable storage fees accumulated during safe_mode
7945    #[prost(uint64, optional, tag = "14")]
7946    pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
7947    /// Unix timestamp of when this this epoch started
7948    #[prost(uint64, optional, tag = "15")]
7949    pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
7950    /// Any extra fields that's not defined statically.
7951    #[prost(message, optional, tag = "16")]
7952    pub extra_fields: ::core::option::Option<MoveTable>,
7953}
7954#[non_exhaustive]
7955#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7956pub struct ValidatorReportRecord {
7957    /// The address of the validator being reported
7958    #[prost(string, optional, tag = "1")]
7959    pub reported: ::core::option::Option<::prost::alloc::string::String>,
7960    /// The list of validator (addresses) that are reporting on the validator specified by `reported`
7961    #[prost(string, repeated, tag = "2")]
7962    pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7963}
7964#[non_exhaustive]
7965#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7966pub struct SystemParameters {
7967    /// The duration of an epoch, in milliseconds.
7968    #[prost(uint64, optional, tag = "1")]
7969    pub epoch_duration_ms: ::core::option::Option<u64>,
7970    /// The starting epoch in which stake subsidies start being paid out
7971    #[prost(uint64, optional, tag = "2")]
7972    pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
7973    /// Minimum number of active validators at any moment.
7974    #[prost(uint64, optional, tag = "3")]
7975    pub min_validator_count: ::core::option::Option<u64>,
7976    /// Maximum number of active validators at any moment.
7977    /// We do not allow the number of validators in any epoch to go above this.
7978    #[prost(uint64, optional, tag = "4")]
7979    pub max_validator_count: ::core::option::Option<u64>,
7980    /// Deprecated.
7981    /// Lower-bound on the amount of stake required to become a validator.
7982    #[prost(uint64, optional, tag = "5")]
7983    pub min_validator_joining_stake: ::core::option::Option<u64>,
7984    /// Deprecated.
7985    /// Validators with stake amount below `validator_low_stake_threshold` are considered to
7986    /// have low stake and will be escorted out of the validator set after being below this
7987    /// threshold for more than `validator_low_stake_grace_period` number of epochs.
7988    #[prost(uint64, optional, tag = "6")]
7989    pub validator_low_stake_threshold: ::core::option::Option<u64>,
7990    /// Deprecated.
7991    /// Validators with stake below `validator_very_low_stake_threshold` will be removed
7992    /// immediately at epoch change, no grace period.
7993    #[prost(uint64, optional, tag = "7")]
7994    pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
7995    /// A validator can have stake below `validator_low_stake_threshold`
7996    /// for this many epochs before being kicked out.
7997    #[prost(uint64, optional, tag = "8")]
7998    pub validator_low_stake_grace_period: ::core::option::Option<u64>,
7999    /// Any extra fields that are not defined statically.
8000    #[prost(message, optional, tag = "9")]
8001    pub extra_fields: ::core::option::Option<MoveTable>,
8002}
8003/// A message that represents a Move `0x2::table::Table` or `0x2::bag::Bag`
8004#[non_exhaustive]
8005#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8006pub struct MoveTable {
8007    /// The UID of the table or bag
8008    #[prost(string, optional, tag = "1")]
8009    pub id: ::core::option::Option<::prost::alloc::string::String>,
8010    /// The size or number of key-value pairs in the table or bag
8011    #[prost(uint64, optional, tag = "2")]
8012    pub size: ::core::option::Option<u64>,
8013}
8014#[non_exhaustive]
8015#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8016pub struct StakeSubsidy {
8017    /// Balance of SUI set aside for stake subsidies that will be drawn down over time.
8018    #[prost(uint64, optional, tag = "1")]
8019    pub balance: ::core::option::Option<u64>,
8020    /// Count of the number of times stake subsidies have been distributed.
8021    #[prost(uint64, optional, tag = "2")]
8022    pub distribution_counter: ::core::option::Option<u64>,
8023    /// The amount of stake subsidy to be drawn down per distribution.
8024    /// This amount decays and decreases over time.
8025    #[prost(uint64, optional, tag = "3")]
8026    pub current_distribution_amount: ::core::option::Option<u64>,
8027    /// Number of distributions to occur before the distribution amount decays.
8028    #[prost(uint64, optional, tag = "4")]
8029    pub stake_subsidy_period_length: ::core::option::Option<u64>,
8030    /// The rate at which the distribution amount decays at the end of each
8031    /// period. Expressed in basis points.
8032    #[prost(uint32, optional, tag = "5")]
8033    pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
8034    /// Any extra fields that's not defined statically.
8035    #[prost(message, optional, tag = "6")]
8036    pub extra_fields: ::core::option::Option<MoveTable>,
8037}
8038/// Struct representing the onchain storage fund.
8039#[non_exhaustive]
8040#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8041pub struct StorageFund {
8042    /// This is the sum of `storage_rebate` of
8043    /// all objects currently stored on-chain. To maintain this invariant, the only inflow of this
8044    /// balance is storage charges collected from transactions, and the only outflow is storage rebates
8045    /// of transactions, including both the portion refunded to the transaction senders as well as
8046    /// the non-refundable portion taken out and put into `non_refundable_balance`.
8047    #[prost(uint64, optional, tag = "1")]
8048    pub total_object_storage_rebates: ::core::option::Option<u64>,
8049    /// Represents any remaining inflow of the storage fund that should not
8050    /// be taken out of the fund.
8051    #[prost(uint64, optional, tag = "2")]
8052    pub non_refundable_balance: ::core::option::Option<u64>,
8053}
8054#[non_exhaustive]
8055#[derive(Clone, PartialEq, ::prost::Message)]
8056pub struct ValidatorSet {
8057    /// Total amount of stake from all active validators at the beginning of the epoch.
8058    /// Written only once per epoch, in `advance_epoch` function.
8059    #[prost(uint64, optional, tag = "1")]
8060    pub total_stake: ::core::option::Option<u64>,
8061    /// The current list of active validators.
8062    #[prost(message, repeated, tag = "2")]
8063    pub active_validators: ::prost::alloc::vec::Vec<Validator>,
8064    /// List of new validator candidates added during the current epoch.
8065    /// They will be processed at the end of the epoch.
8066    ///
8067    /// key: u64 (index), value: 0x3::validator::Validator
8068    #[prost(message, optional, tag = "3")]
8069    pub pending_active_validators: ::core::option::Option<MoveTable>,
8070    /// Removal requests from the validators. Each element is an index
8071    /// pointing to `active_validators`.
8072    #[prost(uint64, repeated, tag = "4")]
8073    pub pending_removals: ::prost::alloc::vec::Vec<u64>,
8074    /// Mappings from staking pool's ID to the sui address of a validator.
8075    ///
8076    /// key: address (staking pool Id), value: address (sui address of the validator)
8077    #[prost(message, optional, tag = "5")]
8078    pub staking_pool_mappings: ::core::option::Option<MoveTable>,
8079    /// Mapping from a staking pool ID to the inactive validator that has that pool as its staking pool.
8080    /// When a validator is deactivated the validator is removed from `active_validators` it
8081    /// is added to this table so that stakers can continue to withdraw their stake from it.
8082    ///
8083    /// key: address (staking pool Id), value: 0x3::validator_wrapper::ValidatorWrapper
8084    #[prost(message, optional, tag = "6")]
8085    pub inactive_validators: ::core::option::Option<MoveTable>,
8086    /// Table storing preactive/candidate validators, mapping their addresses to their `Validator ` structs.
8087    /// When an address calls `request_add_validator_candidate`, they get added to this table and become a preactive
8088    /// validator.
8089    /// When the candidate has met the min stake requirement, they can call `request_add_validator` to
8090    /// officially add them to the active validator set `active_validators` next epoch.
8091    ///
8092    /// key: address (sui address of the validator), value: 0x3::validator_wrapper::ValidatorWrapper
8093    #[prost(message, optional, tag = "7")]
8094    pub validator_candidates: ::core::option::Option<MoveTable>,
8095    /// Table storing the number of epochs during which a validator's stake has been below the low stake threshold.
8096    #[prost(btree_map = "string, uint64", tag = "8")]
8097    pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
8098        ::prost::alloc::string::String,
8099        u64,
8100    >,
8101    /// Any extra fields that's not defined statically.
8102    #[prost(message, optional, tag = "9")]
8103    pub extra_fields: ::core::option::Option<MoveTable>,
8104}
8105/// Definition of a Validator in the system contracts
8106///
8107/// Note: fields of ValidatorMetadata are flattened into this type
8108#[non_exhaustive]
8109#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8110pub struct Validator {
8111    /// A unique human-readable name of this validator.
8112    #[prost(string, optional, tag = "1")]
8113    pub name: ::core::option::Option<::prost::alloc::string::String>,
8114    /// The Sui Address of the validator. This is the sender that created the Validator object,
8115    /// and also the address to send validator/coins to during withdraws.
8116    #[prost(string, optional, tag = "2")]
8117    pub address: ::core::option::Option<::prost::alloc::string::String>,
8118    #[prost(string, optional, tag = "3")]
8119    pub description: ::core::option::Option<::prost::alloc::string::String>,
8120    #[prost(string, optional, tag = "4")]
8121    pub image_url: ::core::option::Option<::prost::alloc::string::String>,
8122    #[prost(string, optional, tag = "5")]
8123    pub project_url: ::core::option::Option<::prost::alloc::string::String>,
8124    /// The public key bytes corresponding to the private key that the validator
8125    /// holds to sign transactions. For now, this is the same as AuthorityName.
8126    #[prost(bytes = "bytes", optional, tag = "7")]
8127    pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8128    /// This is a proof that the validator has ownership of the protocol private key
8129    #[prost(bytes = "bytes", optional, tag = "8")]
8130    pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8131    /// The public key bytes corresponding to the private key that the validator
8132    /// uses to establish TLS connections
8133    #[prost(bytes = "bytes", optional, tag = "10")]
8134    pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8135    /// The public key bytes corresponding to the Narwhal Worker
8136    #[prost(bytes = "bytes", optional, tag = "12")]
8137    pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8138    /// The network address of the validator (could also contain extra info such as port, DNS and etc.).
8139    #[prost(string, optional, tag = "13")]
8140    pub network_address: ::core::option::Option<::prost::alloc::string::String>,
8141    /// The address of the validator used for p2p activities such as state sync (could also contain extra info such as port, DNS and etc.).
8142    #[prost(string, optional, tag = "14")]
8143    pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8144    /// The address of the narwhal primary
8145    #[prost(string, optional, tag = "15")]
8146    pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
8147    /// The address of the narwhal worker
8148    #[prost(string, optional, tag = "16")]
8149    pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
8150    #[prost(bytes = "bytes", optional, tag = "18")]
8151    pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8152    #[prost(bytes = "bytes", optional, tag = "19")]
8153    pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8154    #[prost(bytes = "bytes", optional, tag = "21")]
8155    pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8156    #[prost(bytes = "bytes", optional, tag = "23")]
8157    pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8158    #[prost(string, optional, tag = "24")]
8159    pub next_epoch_network_address: ::core::option::Option<
8160        ::prost::alloc::string::String,
8161    >,
8162    #[prost(string, optional, tag = "25")]
8163    pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8164    #[prost(string, optional, tag = "26")]
8165    pub next_epoch_primary_address: ::core::option::Option<
8166        ::prost::alloc::string::String,
8167    >,
8168    #[prost(string, optional, tag = "27")]
8169    pub next_epoch_worker_address: ::core::option::Option<
8170        ::prost::alloc::string::String,
8171    >,
8172    /// Any extra fields that's not defined statically in the `ValidatorMetadata` struct
8173    #[prost(message, optional, tag = "28")]
8174    pub metadata_extra_fields: ::core::option::Option<MoveTable>,
8175    /// The voting power of this validator, which might be different from its
8176    /// stake amount.
8177    #[prost(uint64, optional, tag = "29")]
8178    pub voting_power: ::core::option::Option<u64>,
8179    /// The ID of this validator's current valid `UnverifiedValidatorOperationCap`
8180    #[prost(string, optional, tag = "30")]
8181    pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
8182    /// Gas price quote, updated only at end of epoch.
8183    #[prost(uint64, optional, tag = "31")]
8184    pub gas_price: ::core::option::Option<u64>,
8185    /// Staking pool for this validator.
8186    #[prost(message, optional, tag = "32")]
8187    pub staking_pool: ::core::option::Option<StakingPool>,
8188    /// Commission rate of the validator, in basis point.
8189    #[prost(uint64, optional, tag = "33")]
8190    pub commission_rate: ::core::option::Option<u64>,
8191    /// Total amount of stake that would be active in the next epoch.
8192    #[prost(uint64, optional, tag = "34")]
8193    pub next_epoch_stake: ::core::option::Option<u64>,
8194    /// This validator's gas price quote for the next epoch.
8195    #[prost(uint64, optional, tag = "35")]
8196    pub next_epoch_gas_price: ::core::option::Option<u64>,
8197    /// The commission rate of the validator starting the next epoch, in basis point.
8198    #[prost(uint64, optional, tag = "36")]
8199    pub next_epoch_commission_rate: ::core::option::Option<u64>,
8200    /// Any extra fields that's not defined statically.
8201    #[prost(message, optional, tag = "37")]
8202    pub extra_fields: ::core::option::Option<MoveTable>,
8203}
8204/// A staking pool embedded in each validator struct in the system state object.
8205#[non_exhaustive]
8206#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8207pub struct StakingPool {
8208    /// UID of the StakingPool object
8209    #[prost(string, optional, tag = "1")]
8210    pub id: ::core::option::Option<::prost::alloc::string::String>,
8211    /// The epoch at which this pool became active.
8212    /// The value is `None` if the pool is pre-active and `Some(<epoch_number>)` if active or inactive.
8213    #[prost(uint64, optional, tag = "2")]
8214    pub activation_epoch: ::core::option::Option<u64>,
8215    /// The epoch at which this staking pool ceased to be active. `None` = {pre-active, active},
8216    /// `Some(<epoch_number>)` if in-active, and it was de-activated at epoch `<epoch_number>`.
8217    #[prost(uint64, optional, tag = "3")]
8218    pub deactivation_epoch: ::core::option::Option<u64>,
8219    /// The total number of SUI tokens in this pool, including the SUI in the rewards_pool, as well as in all the principal
8220    /// in the `StakedSui` object, updated at epoch boundaries.
8221    #[prost(uint64, optional, tag = "4")]
8222    pub sui_balance: ::core::option::Option<u64>,
8223    /// The epoch stake rewards will be added here at the end of each epoch.
8224    #[prost(uint64, optional, tag = "5")]
8225    pub rewards_pool: ::core::option::Option<u64>,
8226    /// Total number of pool tokens issued by the pool.
8227    #[prost(uint64, optional, tag = "6")]
8228    pub pool_token_balance: ::core::option::Option<u64>,
8229    /// Exchange rate history of previous epochs.
8230    ///
8231    /// The entries start from the `activation_epoch` of this pool and contains exchange rates at the beginning of each epoch,
8232    /// i.e., right after the rewards for the previous epoch have been deposited into the pool.
8233    ///
8234    /// key: u64 (epoch number), value: PoolTokenExchangeRate
8235    #[prost(message, optional, tag = "7")]
8236    pub exchange_rates: ::core::option::Option<MoveTable>,
8237    /// Pending stake amount for this epoch, emptied at epoch boundaries.
8238    #[prost(uint64, optional, tag = "8")]
8239    pub pending_stake: ::core::option::Option<u64>,
8240    /// Pending stake withdrawn during the current epoch, emptied at epoch boundaries.
8241    /// This includes both the principal and rewards SUI withdrawn.
8242    #[prost(uint64, optional, tag = "9")]
8243    pub pending_total_sui_withdraw: ::core::option::Option<u64>,
8244    /// Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.
8245    #[prost(uint64, optional, tag = "10")]
8246    pub pending_pool_token_withdraw: ::core::option::Option<u64>,
8247    /// Any extra fields that's not defined statically.
8248    #[prost(message, optional, tag = "11")]
8249    pub extra_fields: ::core::option::Option<MoveTable>,
8250}
8251/// A transaction.
8252#[non_exhaustive]
8253#[derive(Clone, PartialEq, ::prost::Message)]
8254pub struct Transaction {
8255    /// This Transaction serialized as BCS.
8256    #[prost(message, optional, tag = "1")]
8257    pub bcs: ::core::option::Option<Bcs>,
8258    /// The digest of this Transaction.
8259    #[prost(string, optional, tag = "2")]
8260    pub digest: ::core::option::Option<::prost::alloc::string::String>,
8261    /// Version of this Transaction.
8262    #[prost(int32, optional, tag = "3")]
8263    pub version: ::core::option::Option<i32>,
8264    #[prost(message, optional, tag = "4")]
8265    pub kind: ::core::option::Option<TransactionKind>,
8266    #[prost(string, optional, tag = "5")]
8267    pub sender: ::core::option::Option<::prost::alloc::string::String>,
8268    #[prost(message, optional, tag = "6")]
8269    pub gas_payment: ::core::option::Option<GasPayment>,
8270    #[prost(message, optional, tag = "7")]
8271    pub expiration: ::core::option::Option<TransactionExpiration>,
8272}
8273/// Payment information for executing a transaction.
8274#[non_exhaustive]
8275#[derive(Clone, PartialEq, ::prost::Message)]
8276pub struct GasPayment {
8277    /// Set of gas objects to use for payment.
8278    #[prost(message, repeated, tag = "1")]
8279    pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
8280    /// Owner of the gas objects, either the transaction sender or a sponsor.
8281    #[prost(string, optional, tag = "2")]
8282    pub owner: ::core::option::Option<::prost::alloc::string::String>,
8283    /// Gas unit price to use when charging for computation.
8284    ///
8285    /// Must be greater than or equal to the network's current RGP (reference gas price).
8286    #[prost(uint64, optional, tag = "3")]
8287    pub price: ::core::option::Option<u64>,
8288    /// Total budget willing to spend for the execution of a transaction.
8289    #[prost(uint64, optional, tag = "4")]
8290    pub budget: ::core::option::Option<u64>,
8291}
8292/// A TTL for a transaction.
8293#[non_exhaustive]
8294#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8295pub struct TransactionExpiration {
8296    #[prost(
8297        enumeration = "transaction_expiration::TransactionExpirationKind",
8298        optional,
8299        tag = "1"
8300    )]
8301    pub kind: ::core::option::Option<i32>,
8302    /// Maximum epoch in which a transaction can be executed. The provided maximal epoch
8303    /// must be greater than or equal to the current epoch for a transaction to execute.
8304    #[prost(uint64, optional, tag = "2")]
8305    pub epoch: ::core::option::Option<u64>,
8306    /// Minimal epoch in which a transaction can be executed. The provided minimal epoch
8307    /// must be less than or equal to the current epoch for a transaction to execute.
8308    #[prost(uint64, optional, tag = "3")]
8309    pub min_epoch: ::core::option::Option<u64>,
8310    /// Minimal UNIX timestamp in which a transaction can be executed. The
8311    /// provided minimal timestamp must be less than or equal to the current
8312    /// clock.
8313    #[prost(message, optional, tag = "4")]
8314    pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8315    /// Maximum UNIX timestamp in which a transaction can be executed. The
8316    /// provided maximal timestamp must be greater than or equal to the current
8317    /// clock.
8318    #[prost(message, optional, tag = "5")]
8319    pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8320    /// ChainId of the network this transaction is intended for in order to prevent cross-chain replay
8321    #[prost(string, optional, tag = "6")]
8322    pub chain: ::core::option::Option<::prost::alloc::string::String>,
8323    /// User-provided uniqueness identifier to differentiate otherwise identical transactions
8324    #[prost(uint32, optional, tag = "7")]
8325    pub nonce: ::core::option::Option<u32>,
8326    /// The validators allowed to propose this transaction in consensus. Only set when `kind`
8327    /// is `VALIDITY`. Leave unset to let any validator propose the transaction.
8328    #[prost(message, optional, tag = "8")]
8329    pub allowed_proposers: ::core::option::Option<AllowedProposers>,
8330}
8331/// Nested message and enum types in `TransactionExpiration`.
8332pub mod transaction_expiration {
8333    #[non_exhaustive]
8334    #[derive(
8335        Clone,
8336        Copy,
8337        Debug,
8338        PartialEq,
8339        Eq,
8340        Hash,
8341        PartialOrd,
8342        Ord,
8343        ::prost::Enumeration
8344    )]
8345    #[repr(i32)]
8346    pub enum TransactionExpirationKind {
8347        Unknown = 0,
8348        /// The transaction has no expiration.
8349        None = 1,
8350        /// Validators won't sign and execute transaction unless the expiration epoch
8351        /// is greater than or equal to the current epoch.
8352        Epoch = 2,
8353        /// This variant enables gas payments from address balances.
8354        ///
8355        /// When transactions use address balances for gas payment instead of explicit gas coins,
8356        /// we lose the natural transaction uniqueness and replay prevention that comes from
8357        /// mutation of gas coin objects.
8358        ///
8359        /// By bounding expiration and providing a nonce, validators must only retain
8360        /// executed digests for the maximum possible expiry range to differentiate
8361        /// retries from unique transactions with otherwise identical inputs.
8362        ValidDuring = 3,
8363        /// Everything in VALID_DURING, plus a restriction on which validators may
8364        /// propose the transaction in consensus.
8365        Validity = 4,
8366    }
8367    impl TransactionExpirationKind {
8368        /// String value of the enum field names used in the ProtoBuf definition.
8369        ///
8370        /// The values are not transformed in any way and thus are considered stable
8371        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8372        pub fn as_str_name(&self) -> &'static str {
8373            match self {
8374                Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
8375                Self::None => "NONE",
8376                Self::Epoch => "EPOCH",
8377                Self::ValidDuring => "VALID_DURING",
8378                Self::Validity => "VALIDITY",
8379            }
8380        }
8381        /// Creates an enum from field names used in the ProtoBuf definition.
8382        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8383            match value {
8384                "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
8385                "NONE" => Some(Self::None),
8386                "EPOCH" => Some(Self::Epoch),
8387                "VALID_DURING" => Some(Self::ValidDuring),
8388                "VALIDITY" => Some(Self::Validity),
8389                _ => None,
8390            }
8391        }
8392    }
8393}
8394/// The validators allowed to propose a transaction in consensus.
8395///
8396/// Proposal by any other validator is byzantine behavior and invalidates the whole block.
8397#[non_exhaustive]
8398#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8399pub struct AllowedProposers {
8400    /// The epoch whose committee `proposers` indexes into.
8401    ///
8402    /// Committee indices are only meaningful against one committee, so a set recorded for any
8403    /// other epoch is ignored and the transaction is treated as naming no proposers.
8404    #[prost(uint64, optional, tag = "1")]
8405    pub epoch: ::core::option::Option<u64>,
8406    /// Committee indices of the allowed proposers, strictly increasing and non-empty.
8407    ///
8408    /// An empty list names no validator and is rejected; omit `allowed_proposers` entirely to
8409    /// let any validator propose the transaction.
8410    #[prost(uint32, repeated, tag = "2")]
8411    pub proposers: ::prost::alloc::vec::Vec<u32>,
8412}
8413/// Transaction type.
8414#[non_exhaustive]
8415#[derive(Clone, PartialEq, ::prost::Message)]
8416pub struct TransactionKind {
8417    #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
8418    pub kind: ::core::option::Option<i32>,
8419    #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
8420    pub data: ::core::option::Option<transaction_kind::Data>,
8421}
8422/// Nested message and enum types in `TransactionKind`.
8423pub mod transaction_kind {
8424    #[non_exhaustive]
8425    #[derive(
8426        Clone,
8427        Copy,
8428        Debug,
8429        PartialEq,
8430        Eq,
8431        Hash,
8432        PartialOrd,
8433        Ord,
8434        ::prost::Enumeration
8435    )]
8436    #[repr(i32)]
8437    pub enum Kind {
8438        Unknown = 0,
8439        /// A user transaction comprised of a list of native commands and Move calls.
8440        ProgrammableTransaction = 1,
8441        /// System transaction used to end an epoch.
8442        ///
8443        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
8444        /// `EndOfEpochTransaction`).
8445        ChangeEpoch = 2,
8446        /// Transaction used to initialize the chain state.
8447        ///
8448        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
8449        /// executed on the chain.
8450        Genesis = 3,
8451        /// V1 consensus commit update.
8452        ConsensusCommitPrologueV1 = 4,
8453        /// Update set of valid JWKs used for zklogin.
8454        AuthenticatorStateUpdate = 5,
8455        /// Set of operations to run at the end of the epoch to close out the current epoch and start
8456        /// the next one.
8457        EndOfEpoch = 6,
8458        /// Randomness update.
8459        RandomnessStateUpdate = 7,
8460        /// V2 consensus commit update.
8461        ConsensusCommitPrologueV2 = 8,
8462        /// V3 consensus commit update.
8463        ConsensusCommitPrologueV3 = 9,
8464        /// V4 consensus commit update.
8465        ConsensusCommitPrologueV4 = 10,
8466        /// A system transaction comprised of a list of native commands and Move calls.
8467        ProgrammableSystemTransaction = 11,
8468    }
8469    impl Kind {
8470        /// String value of the enum field names used in the ProtoBuf definition.
8471        ///
8472        /// The values are not transformed in any way and thus are considered stable
8473        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8474        pub fn as_str_name(&self) -> &'static str {
8475            match self {
8476                Self::Unknown => "KIND_UNKNOWN",
8477                Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
8478                Self::ChangeEpoch => "CHANGE_EPOCH",
8479                Self::Genesis => "GENESIS",
8480                Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
8481                Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
8482                Self::EndOfEpoch => "END_OF_EPOCH",
8483                Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
8484                Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
8485                Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
8486                Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
8487                Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
8488            }
8489        }
8490        /// Creates an enum from field names used in the ProtoBuf definition.
8491        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8492            match value {
8493                "KIND_UNKNOWN" => Some(Self::Unknown),
8494                "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
8495                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8496                "GENESIS" => Some(Self::Genesis),
8497                "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
8498                "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
8499                "END_OF_EPOCH" => Some(Self::EndOfEpoch),
8500                "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
8501                "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
8502                "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
8503                "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
8504                "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
8505                    Some(Self::ProgrammableSystemTransaction)
8506                }
8507                _ => None,
8508            }
8509        }
8510    }
8511    #[non_exhaustive]
8512    #[derive(Clone, PartialEq, ::prost::Oneof)]
8513    pub enum Data {
8514        /// A transaction comprised of a list of native commands and Move calls.
8515        #[prost(message, tag = "2")]
8516        ProgrammableTransaction(super::ProgrammableTransaction),
8517        /// System transaction used to end an epoch.
8518        ///
8519        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
8520        /// `EndOfEpochTransaction`).
8521        #[prost(message, tag = "3")]
8522        ChangeEpoch(super::ChangeEpoch),
8523        /// Transaction used to initialize the chain state.
8524        ///
8525        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
8526        /// executed on the chain.
8527        #[prost(message, tag = "4")]
8528        Genesis(super::GenesisTransaction),
8529        /// consensus commit update info
8530        #[prost(message, tag = "5")]
8531        ConsensusCommitPrologue(super::ConsensusCommitPrologue),
8532        /// Update set of valid JWKs used for zklogin.
8533        #[prost(message, tag = "6")]
8534        AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
8535        /// Set of operations to run at the end of the epoch to close out the current epoch and start
8536        /// the next one.
8537        #[prost(message, tag = "7")]
8538        EndOfEpoch(super::EndOfEpochTransaction),
8539        /// Randomness update.
8540        #[prost(message, tag = "8")]
8541        RandomnessStateUpdate(super::RandomnessStateUpdate),
8542    }
8543}
8544/// A user transaction.
8545///
8546/// Contains a series of native commands and Move calls where the results of one command can be
8547/// used in future commands.
8548#[non_exhaustive]
8549#[derive(Clone, PartialEq, ::prost::Message)]
8550pub struct ProgrammableTransaction {
8551    /// Input objects or primitive values.
8552    #[prost(message, repeated, tag = "1")]
8553    pub inputs: ::prost::alloc::vec::Vec<Input>,
8554    /// The commands to be executed sequentially. A failure in any command
8555    /// results in the failure of the entire transaction.
8556    #[prost(message, repeated, tag = "2")]
8557    pub commands: ::prost::alloc::vec::Vec<Command>,
8558}
8559/// A single command in a programmable transaction.
8560#[non_exhaustive]
8561#[derive(Clone, PartialEq, ::prost::Message)]
8562pub struct Command {
8563    #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
8564    pub command: ::core::option::Option<command::Command>,
8565}
8566/// Nested message and enum types in `Command`.
8567pub mod command {
8568    #[non_exhaustive]
8569    #[derive(Clone, PartialEq, ::prost::Oneof)]
8570    pub enum Command {
8571        /// A call to either an entry or a public Move function.
8572        #[prost(message, tag = "1")]
8573        MoveCall(super::MoveCall),
8574        /// `(Vec<forall T:key+store. T>, address)`
8575        /// It sends n-objects to the specified address. These objects must have store
8576        /// (public transfer) and either the previous owner must be an address or the object must
8577        /// be newly created.
8578        #[prost(message, tag = "2")]
8579        TransferObjects(super::TransferObjects),
8580        /// `(&mut Coin<T>, Vec<u64>)` -> `Vec<Coin<T>>`
8581        /// It splits off some amounts into new coins with those amounts.
8582        #[prost(message, tag = "3")]
8583        SplitCoins(super::SplitCoins),
8584        /// `(&mut Coin<T>, Vec<Coin<T>>)`
8585        /// It merges n-coins into the first coin.
8586        #[prost(message, tag = "4")]
8587        MergeCoins(super::MergeCoins),
8588        /// Publishes a Move package. It takes the package bytes and a list of the package's transitive
8589        /// dependencies to link against on chain.
8590        #[prost(message, tag = "5")]
8591        Publish(super::Publish),
8592        /// `forall T: Vec<T> -> vector<T>`
8593        /// Given n-values of the same type, it constructs a vector. For non-objects or an empty vector,
8594        /// the type tag must be specified.
8595        #[prost(message, tag = "6")]
8596        MakeMoveVector(super::MakeMoveVector),
8597        /// Upgrades a Move package.
8598        /// Takes (in order):
8599        ///
8600        /// 1. A vector of serialized modules for the package.
8601        /// 1. A vector of object ids for the transitive dependencies of the new package.
8602        /// 1. The object ID of the package being upgraded.
8603        /// 1. An argument holding the `UpgradeTicket` that must have been produced from an earlier command in the same
8604        ///    programmable transaction.
8605        #[prost(message, tag = "7")]
8606        Upgrade(super::Upgrade),
8607    }
8608}
8609/// Command to call a Move function.
8610///
8611/// Functions that can be called by a `MoveCall` command are those that have a function signature
8612/// that is either `entry` or `public` (which don't have a reference return type).
8613#[non_exhaustive]
8614#[derive(Clone, PartialEq, ::prost::Message)]
8615pub struct MoveCall {
8616    /// The package containing the module and function.
8617    #[prost(string, optional, tag = "1")]
8618    pub package: ::core::option::Option<::prost::alloc::string::String>,
8619    /// The specific module in the package containing the function.
8620    #[prost(string, optional, tag = "2")]
8621    pub module: ::core::option::Option<::prost::alloc::string::String>,
8622    /// The function to be called.
8623    #[prost(string, optional, tag = "3")]
8624    pub function: ::core::option::Option<::prost::alloc::string::String>,
8625    /// The type arguments to the function.
8626    #[prost(string, repeated, tag = "4")]
8627    pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8628    /// The arguments to the function.
8629    #[prost(message, repeated, tag = "5")]
8630    pub arguments: ::prost::alloc::vec::Vec<Argument>,
8631}
8632/// Command to transfer ownership of a set of objects to an address.
8633#[non_exhaustive]
8634#[derive(Clone, PartialEq, ::prost::Message)]
8635pub struct TransferObjects {
8636    /// Set of objects to transfer.
8637    #[prost(message, repeated, tag = "1")]
8638    pub objects: ::prost::alloc::vec::Vec<Argument>,
8639    /// The address to transfer ownership to.
8640    #[prost(message, optional, tag = "2")]
8641    pub address: ::core::option::Option<Argument>,
8642}
8643/// Command to split a single coin object into multiple coins.
8644#[non_exhaustive]
8645#[derive(Clone, PartialEq, ::prost::Message)]
8646pub struct SplitCoins {
8647    /// The coin to split.
8648    #[prost(message, optional, tag = "1")]
8649    pub coin: ::core::option::Option<Argument>,
8650    /// The amounts to split off.
8651    #[prost(message, repeated, tag = "2")]
8652    pub amounts: ::prost::alloc::vec::Vec<Argument>,
8653}
8654/// Command to merge multiple coins of the same type into a single coin.
8655#[non_exhaustive]
8656#[derive(Clone, PartialEq, ::prost::Message)]
8657pub struct MergeCoins {
8658    /// Coin to merge coins into.
8659    #[prost(message, optional, tag = "1")]
8660    pub coin: ::core::option::Option<Argument>,
8661    /// Set of coins to merge into `coin`.
8662    ///
8663    /// All listed coins must be of the same type and be the same type as `coin`
8664    #[prost(message, repeated, tag = "2")]
8665    pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
8666}
8667/// Command to publish a new Move package.
8668#[non_exhaustive]
8669#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8670pub struct Publish {
8671    /// The serialized Move modules.
8672    #[prost(bytes = "bytes", repeated, tag = "1")]
8673    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8674    /// Set of packages that the to-be published package depends on.
8675    #[prost(string, repeated, tag = "2")]
8676    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8677}
8678/// Command to build a Move vector out of a set of individual elements.
8679#[non_exhaustive]
8680#[derive(Clone, PartialEq, ::prost::Message)]
8681pub struct MakeMoveVector {
8682    /// Type of the individual elements.
8683    ///
8684    /// This is required to be set when the type can't be inferred, for example when the set of
8685    /// provided arguments are all pure input values.
8686    #[prost(string, optional, tag = "1")]
8687    pub element_type: ::core::option::Option<::prost::alloc::string::String>,
8688    /// The set individual elements to build the vector with.
8689    #[prost(message, repeated, tag = "2")]
8690    pub elements: ::prost::alloc::vec::Vec<Argument>,
8691}
8692/// Command to upgrade an already published package.
8693#[non_exhaustive]
8694#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8695pub struct Upgrade {
8696    /// The serialized Move modules.
8697    #[prost(bytes = "bytes", repeated, tag = "1")]
8698    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8699    /// Set of packages that the to-be published package depends on.
8700    #[prost(string, repeated, tag = "2")]
8701    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8702    /// Package ID of the package to upgrade.
8703    #[prost(string, optional, tag = "3")]
8704    pub package: ::core::option::Option<::prost::alloc::string::String>,
8705    /// Ticket authorizing the upgrade.
8706    #[prost(message, optional, tag = "4")]
8707    pub ticket: ::core::option::Option<Argument>,
8708}
8709/// Randomness update.
8710#[non_exhaustive]
8711#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8712pub struct RandomnessStateUpdate {
8713    /// Epoch of the randomness state update transaction.
8714    #[prost(uint64, optional, tag = "1")]
8715    pub epoch: ::core::option::Option<u64>,
8716    /// Randomness round of the update.
8717    #[prost(uint64, optional, tag = "2")]
8718    pub randomness_round: ::core::option::Option<u64>,
8719    /// Updated random bytes.
8720    #[prost(bytes = "bytes", optional, tag = "3")]
8721    pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
8722    /// The initial version of the randomness object that it was shared at.
8723    #[prost(uint64, optional, tag = "4")]
8724    pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
8725}
8726/// System transaction used to change the epoch.
8727#[non_exhaustive]
8728#[derive(Clone, PartialEq, ::prost::Message)]
8729pub struct ChangeEpoch {
8730    /// The next (to become) epoch ID.
8731    #[prost(uint64, optional, tag = "1")]
8732    pub epoch: ::core::option::Option<u64>,
8733    /// The protocol version in effect in the new epoch.
8734    #[prost(uint64, optional, tag = "2")]
8735    pub protocol_version: ::core::option::Option<u64>,
8736    /// The total amount of gas charged for storage during the epoch.
8737    #[prost(uint64, optional, tag = "3")]
8738    pub storage_charge: ::core::option::Option<u64>,
8739    /// The total amount of gas charged for computation during the epoch.
8740    #[prost(uint64, optional, tag = "4")]
8741    pub computation_charge: ::core::option::Option<u64>,
8742    /// The amount of storage rebate refunded to the txn senders.
8743    #[prost(uint64, optional, tag = "5")]
8744    pub storage_rebate: ::core::option::Option<u64>,
8745    /// The non-refundable storage fee.
8746    #[prost(uint64, optional, tag = "6")]
8747    pub non_refundable_storage_fee: ::core::option::Option<u64>,
8748    /// Unix timestamp when epoch started.
8749    #[prost(message, optional, tag = "7")]
8750    pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8751    /// System packages (specifically framework and Move stdlib) that are written before the new
8752    /// epoch starts. This tracks framework upgrades on chain. When executing the `ChangeEpoch` txn,
8753    /// the validator must write out the following modules.  Modules are provided with the version they
8754    /// will be upgraded to, their modules in serialized form (which include their package ID), and
8755    /// a list of their transitive dependencies.
8756    #[prost(message, repeated, tag = "8")]
8757    pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
8758}
8759/// System package.
8760#[non_exhaustive]
8761#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8762pub struct SystemPackage {
8763    /// Version of the package.
8764    #[prost(uint64, optional, tag = "1")]
8765    pub version: ::core::option::Option<u64>,
8766    /// Move modules.
8767    #[prost(bytes = "bytes", repeated, tag = "2")]
8768    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8769    /// Package dependencies.
8770    #[prost(string, repeated, tag = "3")]
8771    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8772}
8773/// The genesis transaction.
8774#[non_exhaustive]
8775#[derive(Clone, PartialEq, ::prost::Message)]
8776pub struct GenesisTransaction {
8777    /// Set of genesis objects.
8778    #[prost(message, repeated, tag = "1")]
8779    pub objects: ::prost::alloc::vec::Vec<Object>,
8780}
8781/// Consensus commit prologue system transaction.
8782///
8783/// This message can represent V1, V2, and V3 prologue types.
8784#[non_exhaustive]
8785#[derive(Clone, PartialEq, ::prost::Message)]
8786pub struct ConsensusCommitPrologue {
8787    /// Epoch of the commit prologue transaction.
8788    ///
8789    /// Present in V1, V2, V3, V4.
8790    #[prost(uint64, optional, tag = "1")]
8791    pub epoch: ::core::option::Option<u64>,
8792    /// Consensus round of the commit.
8793    ///
8794    /// Present in V1, V2, V3, V4.
8795    #[prost(uint64, optional, tag = "2")]
8796    pub round: ::core::option::Option<u64>,
8797    /// Unix timestamp from consensus.
8798    ///
8799    /// Present in V1, V2, V3, V4.
8800    #[prost(message, optional, tag = "3")]
8801    pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8802    /// Digest of consensus output.
8803    ///
8804    /// Present in V2, V3, V4.
8805    #[prost(string, optional, tag = "4")]
8806    pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
8807    /// The sub DAG index of the consensus commit. This field is populated if there
8808    /// are multiple consensus commits per round.
8809    ///
8810    /// Present in V3, V4.
8811    #[prost(uint64, optional, tag = "5")]
8812    pub sub_dag_index: ::core::option::Option<u64>,
8813    /// Stores consensus handler determined consensus object version assignments.
8814    ///
8815    /// Present in V3, V4.
8816    #[prost(message, optional, tag = "6")]
8817    pub consensus_determined_version_assignments: ::core::option::Option<
8818        ConsensusDeterminedVersionAssignments,
8819    >,
8820    /// Digest of any additional state computed by the consensus handler.
8821    /// Used to detect forking bugs as early as possible.
8822    ///
8823    /// Present in V4.
8824    #[prost(string, optional, tag = "7")]
8825    pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
8826}
8827/// Object version assignment from consensus.
8828#[non_exhaustive]
8829#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8830pub struct VersionAssignment {
8831    /// `ObjectId` of the object.
8832    #[prost(string, optional, tag = "1")]
8833    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
8834    /// start version of the consensus stream for this object
8835    #[prost(uint64, optional, tag = "2")]
8836    pub start_version: ::core::option::Option<u64>,
8837    /// Assigned version.
8838    #[prost(uint64, optional, tag = "3")]
8839    pub version: ::core::option::Option<u64>,
8840}
8841/// A transaction that was canceled.
8842#[non_exhaustive]
8843#[derive(Clone, PartialEq, ::prost::Message)]
8844pub struct CanceledTransaction {
8845    /// Digest of the canceled transaction.
8846    #[prost(string, optional, tag = "1")]
8847    pub digest: ::core::option::Option<::prost::alloc::string::String>,
8848    /// List of object version assignments.
8849    #[prost(message, repeated, tag = "2")]
8850    pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
8851}
8852/// Version assignments performed by consensus.
8853#[non_exhaustive]
8854#[derive(Clone, PartialEq, ::prost::Message)]
8855pub struct ConsensusDeterminedVersionAssignments {
8856    /// Version of this message
8857    #[prost(int32, optional, tag = "1")]
8858    pub version: ::core::option::Option<i32>,
8859    /// Canceled transaction version assignment.
8860    #[prost(message, repeated, tag = "3")]
8861    pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
8862}
8863/// Update the set of valid JWKs.
8864#[non_exhaustive]
8865#[derive(Clone, PartialEq, ::prost::Message)]
8866pub struct AuthenticatorStateUpdate {
8867    /// Epoch of the authenticator state update transaction.
8868    #[prost(uint64, optional, tag = "1")]
8869    pub epoch: ::core::option::Option<u64>,
8870    /// Consensus round of the authenticator state update.
8871    #[prost(uint64, optional, tag = "2")]
8872    pub round: ::core::option::Option<u64>,
8873    /// Newly active JWKs.
8874    #[prost(message, repeated, tag = "3")]
8875    pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
8876    /// The initial version of the authenticator object that it was shared at.
8877    #[prost(uint64, optional, tag = "4")]
8878    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
8879}
8880/// A new JWK.
8881#[non_exhaustive]
8882#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8883pub struct ActiveJwk {
8884    /// Identifier used to uniquely identify a JWK.
8885    #[prost(message, optional, tag = "1")]
8886    pub id: ::core::option::Option<JwkId>,
8887    /// The JWK.
8888    #[prost(message, optional, tag = "2")]
8889    pub jwk: ::core::option::Option<Jwk>,
8890    /// Most recent epoch in which the JWK was validated.
8891    #[prost(uint64, optional, tag = "3")]
8892    pub epoch: ::core::option::Option<u64>,
8893}
8894/// Set of operations run at the end of the epoch to close out the current epoch
8895/// and start the next one.
8896#[non_exhaustive]
8897#[derive(Clone, PartialEq, ::prost::Message)]
8898pub struct EndOfEpochTransaction {
8899    #[prost(message, repeated, tag = "1")]
8900    pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
8901}
8902/// Operation run at the end of an epoch.
8903#[non_exhaustive]
8904#[derive(Clone, PartialEq, ::prost::Message)]
8905pub struct EndOfEpochTransactionKind {
8906    #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
8907    pub kind: ::core::option::Option<i32>,
8908    #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
8909    pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
8910}
8911/// Nested message and enum types in `EndOfEpochTransactionKind`.
8912pub mod end_of_epoch_transaction_kind {
8913    #[non_exhaustive]
8914    #[derive(
8915        Clone,
8916        Copy,
8917        Debug,
8918        PartialEq,
8919        Eq,
8920        Hash,
8921        PartialOrd,
8922        Ord,
8923        ::prost::Enumeration
8924    )]
8925    #[repr(i32)]
8926    pub enum Kind {
8927        Unknown = 0,
8928        /// End the epoch and start the next one.
8929        ChangeEpoch = 1,
8930        /// Create and initialize the authenticator object used for zklogin.
8931        AuthenticatorStateCreate = 2,
8932        /// Expire JWKs used for zklogin.
8933        AuthenticatorStateExpire = 3,
8934        /// Create and initialize the randomness object.
8935        RandomnessStateCreate = 4,
8936        /// Create and initialize the deny list object.
8937        DenyListStateCreate = 5,
8938        /// Create and initialize the bridge object.
8939        BridgeStateCreate = 6,
8940        /// Initialize the bridge committee.
8941        BridgeCommitteeInit = 7,
8942        /// Execution time observations from the committee to preserve cross epoch
8943        StoreExecutionTimeObservations = 8,
8944        /// Create the accumulator root object.
8945        AccumulatorRootCreate = 9,
8946        /// Create and initialize the Coin Registry object.
8947        CoinRegistryCreate = 10,
8948        /// Create and initialize the Display Registry object.
8949        DisplayRegistryCreate = 11,
8950        /// Create and initialize the Address Alias State object.
8951        AddressAliasStateCreate = 12,
8952        /// Write the end-of-epoch-computed storage cost for accumulator objects.
8953        WriteAccumulatorStorageCost = 13,
8954        /// Create and initialize the Forwarding Address Registry object.
8955        ForwardingAddressRegistryCreate = 14,
8956    }
8957    impl Kind {
8958        /// String value of the enum field names used in the ProtoBuf definition.
8959        ///
8960        /// The values are not transformed in any way and thus are considered stable
8961        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8962        pub fn as_str_name(&self) -> &'static str {
8963            match self {
8964                Self::Unknown => "KIND_UNKNOWN",
8965                Self::ChangeEpoch => "CHANGE_EPOCH",
8966                Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
8967                Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
8968                Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
8969                Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
8970                Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
8971                Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
8972                Self::StoreExecutionTimeObservations => {
8973                    "STORE_EXECUTION_TIME_OBSERVATIONS"
8974                }
8975                Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
8976                Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
8977                Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
8978                Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
8979                Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
8980                Self::ForwardingAddressRegistryCreate => {
8981                    "FORWARDING_ADDRESS_REGISTRY_CREATE"
8982                }
8983            }
8984        }
8985        /// Creates an enum from field names used in the ProtoBuf definition.
8986        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8987            match value {
8988                "KIND_UNKNOWN" => Some(Self::Unknown),
8989                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8990                "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
8991                "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
8992                "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
8993                "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
8994                "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
8995                "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
8996                "STORE_EXECUTION_TIME_OBSERVATIONS" => {
8997                    Some(Self::StoreExecutionTimeObservations)
8998                }
8999                "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
9000                "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
9001                "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
9002                "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
9003                "WRITE_ACCUMULATOR_STORAGE_COST" => {
9004                    Some(Self::WriteAccumulatorStorageCost)
9005                }
9006                "FORWARDING_ADDRESS_REGISTRY_CREATE" => {
9007                    Some(Self::ForwardingAddressRegistryCreate)
9008                }
9009                _ => None,
9010            }
9011        }
9012    }
9013    #[non_exhaustive]
9014    #[derive(Clone, PartialEq, ::prost::Oneof)]
9015    pub enum Data {
9016        /// End the epoch and start the next one.
9017        #[prost(message, tag = "2")]
9018        ChangeEpoch(super::ChangeEpoch),
9019        /// Expire JWKs used for zklogin.
9020        #[prost(message, tag = "3")]
9021        AuthenticatorStateExpire(super::AuthenticatorStateExpire),
9022        /// Execution time observations from the committee to preserve cross epoch
9023        #[prost(message, tag = "4")]
9024        ExecutionTimeObservations(super::ExecutionTimeObservations),
9025        /// ChainId used when initializing the bridge
9026        #[prost(string, tag = "5")]
9027        BridgeChainId(::prost::alloc::string::String),
9028        /// Start version of the Bridge object
9029        #[prost(uint64, tag = "6")]
9030        BridgeObjectVersion(u64),
9031        /// Contains the end-of-epoch-computed storage cost for accumulator objects.
9032        #[prost(uint64, tag = "7")]
9033        StorageCost(u64),
9034    }
9035}
9036/// Expire old JWKs.
9037#[non_exhaustive]
9038#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
9039pub struct AuthenticatorStateExpire {
9040    /// Expire JWKs that have a lower epoch than this.
9041    #[prost(uint64, optional, tag = "1")]
9042    pub min_epoch: ::core::option::Option<u64>,
9043    /// The initial version of the authenticator object that it was shared at.
9044    #[prost(uint64, optional, tag = "2")]
9045    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
9046}
9047#[non_exhaustive]
9048#[derive(Clone, PartialEq, ::prost::Message)]
9049pub struct ExecutionTimeObservations {
9050    /// Version of this ExecutionTimeObservations
9051    #[prost(int32, optional, tag = "1")]
9052    pub version: ::core::option::Option<i32>,
9053    #[prost(message, repeated, tag = "2")]
9054    pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
9055}
9056#[non_exhaustive]
9057#[derive(Clone, PartialEq, ::prost::Message)]
9058pub struct ExecutionTimeObservation {
9059    #[prost(
9060        enumeration = "execution_time_observation::ExecutionTimeObservationKind",
9061        optional,
9062        tag = "1"
9063    )]
9064    pub kind: ::core::option::Option<i32>,
9065    #[prost(message, optional, tag = "2")]
9066    pub move_entry_point: ::core::option::Option<MoveCall>,
9067    #[prost(message, repeated, tag = "3")]
9068    pub validator_observations: ::prost::alloc::vec::Vec<
9069        ValidatorExecutionTimeObservation,
9070    >,
9071}
9072/// Nested message and enum types in `ExecutionTimeObservation`.
9073pub mod execution_time_observation {
9074    #[non_exhaustive]
9075    #[derive(
9076        Clone,
9077        Copy,
9078        Debug,
9079        PartialEq,
9080        Eq,
9081        Hash,
9082        PartialOrd,
9083        Ord,
9084        ::prost::Enumeration
9085    )]
9086    #[repr(i32)]
9087    pub enum ExecutionTimeObservationKind {
9088        Unknown = 0,
9089        MoveEntryPoint = 1,
9090        TransferObjects = 2,
9091        SplitCoins = 3,
9092        MergeCoins = 4,
9093        Publish = 5,
9094        MakeMoveVector = 6,
9095        Upgrade = 7,
9096    }
9097    impl ExecutionTimeObservationKind {
9098        /// String value of the enum field names used in the ProtoBuf definition.
9099        ///
9100        /// The values are not transformed in any way and thus are considered stable
9101        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
9102        pub fn as_str_name(&self) -> &'static str {
9103            match self {
9104                Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
9105                Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
9106                Self::TransferObjects => "TRANSFER_OBJECTS",
9107                Self::SplitCoins => "SPLIT_COINS",
9108                Self::MergeCoins => "MERGE_COINS",
9109                Self::Publish => "PUBLISH",
9110                Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
9111                Self::Upgrade => "UPGRADE",
9112            }
9113        }
9114        /// Creates an enum from field names used in the ProtoBuf definition.
9115        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9116            match value {
9117                "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
9118                "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
9119                "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
9120                "SPLIT_COINS" => Some(Self::SplitCoins),
9121                "MERGE_COINS" => Some(Self::MergeCoins),
9122                "PUBLISH" => Some(Self::Publish),
9123                "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
9124                "UPGRADE" => Some(Self::Upgrade),
9125                _ => None,
9126            }
9127        }
9128    }
9129}
9130#[non_exhaustive]
9131#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9132pub struct ValidatorExecutionTimeObservation {
9133    /// Bls12381 public key of the validator
9134    #[prost(bytes = "bytes", optional, tag = "1")]
9135    pub validator: ::core::option::Option<::prost::bytes::Bytes>,
9136    /// Duration of an execution observation
9137    #[prost(message, optional, tag = "2")]
9138    pub duration: ::core::option::Option<::prost_types::Duration>,
9139}
9140#[non_exhaustive]
9141#[derive(Clone, PartialEq, ::prost::Message)]
9142pub struct ExecuteTransactionRequest {
9143    /// The transaction to execute.
9144    #[prost(message, optional, tag = "1")]
9145    pub transaction: ::core::option::Option<Transaction>,
9146    /// Set of `UserSignature`s authorizing the execution of the provided
9147    /// transaction.
9148    #[prost(message, repeated, tag = "2")]
9149    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
9150    /// Mask specifying which fields to read.
9151    /// If no mask is specified, defaults to `effects.status,checkpoint`.
9152    #[prost(message, optional, tag = "3")]
9153    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9154}
9155/// Response message for `NodeService.ExecuteTransaction`.
9156#[non_exhaustive]
9157#[derive(Clone, PartialEq, ::prost::Message)]
9158pub struct ExecuteTransactionResponse {
9159    #[prost(message, optional, tag = "1")]
9160    pub transaction: ::core::option::Option<ExecutedTransaction>,
9161}
9162#[non_exhaustive]
9163#[derive(Clone, PartialEq, ::prost::Message)]
9164pub struct SimulateTransactionRequest {
9165    #[prost(message, optional, tag = "1")]
9166    pub transaction: ::core::option::Option<Transaction>,
9167    /// Mask specifying which fields to read.
9168    #[prost(message, optional, tag = "2")]
9169    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9170    /// Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction
9171    #[prost(
9172        enumeration = "simulate_transaction_request::TransactionChecks",
9173        optional,
9174        tag = "3"
9175    )]
9176    pub checks: ::core::option::Option<i32>,
9177    /// Perform gas selection based on a budget estimation and include the
9178    /// selected gas payment and budget in the response.
9179    ///
9180    /// This option will be ignored if `checks` is `DISABLED`.
9181    #[prost(bool, optional, tag = "4")]
9182    pub do_gas_selection: ::core::option::Option<bool>,
9183}
9184/// Nested message and enum types in `SimulateTransactionRequest`.
9185pub mod simulate_transaction_request {
9186    /// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
9187    #[non_exhaustive]
9188    #[derive(
9189        Clone,
9190        Copy,
9191        Debug,
9192        PartialEq,
9193        Eq,
9194        Hash,
9195        PartialOrd,
9196        Ord,
9197        ::prost::Enumeration
9198    )]
9199    #[repr(i32)]
9200    pub enum TransactionChecks {
9201        Enabled = 0,
9202        Disabled = 1,
9203    }
9204    impl TransactionChecks {
9205        /// String value of the enum field names used in the ProtoBuf definition.
9206        ///
9207        /// The values are not transformed in any way and thus are considered stable
9208        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
9209        pub fn as_str_name(&self) -> &'static str {
9210            match self {
9211                Self::Enabled => "ENABLED",
9212                Self::Disabled => "DISABLED",
9213            }
9214        }
9215        /// Creates an enum from field names used in the ProtoBuf definition.
9216        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9217            match value {
9218                "ENABLED" => Some(Self::Enabled),
9219                "DISABLED" => Some(Self::Disabled),
9220                _ => None,
9221            }
9222        }
9223    }
9224}
9225#[non_exhaustive]
9226#[derive(Clone, PartialEq, ::prost::Message)]
9227pub struct SimulateTransactionResponse {
9228    #[prost(message, optional, tag = "1")]
9229    pub transaction: ::core::option::Option<ExecutedTransaction>,
9230    #[prost(message, repeated, tag = "2")]
9231    pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
9232    /// A suggested gas price to use, that is above RGP, in order to provide a
9233    /// better chance of the transaction being included in the presence of
9234    /// congested objects.
9235    #[prost(uint64, optional, tag = "3")]
9236    pub suggested_gas_price: ::core::option::Option<u64>,
9237}
9238/// An intermediate result/output from the execution of a single command
9239#[non_exhaustive]
9240#[derive(Clone, PartialEq, ::prost::Message)]
9241pub struct CommandResult {
9242    #[prost(message, repeated, tag = "1")]
9243    pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
9244    #[prost(message, repeated, tag = "2")]
9245    pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
9246}
9247#[non_exhaustive]
9248#[derive(Clone, PartialEq, ::prost::Message)]
9249pub struct CommandOutput {
9250    #[prost(message, optional, tag = "1")]
9251    pub argument: ::core::option::Option<Argument>,
9252    #[prost(message, optional, tag = "2")]
9253    pub value: ::core::option::Option<Bcs>,
9254    /// JSON rendering of the output.
9255    #[prost(message, optional, boxed, tag = "3")]
9256    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
9257}
9258/// Generated client implementations.
9259pub mod transaction_execution_service_client {
9260    #![allow(
9261        unused_variables,
9262        dead_code,
9263        missing_docs,
9264        clippy::wildcard_imports,
9265        clippy::let_unit_value,
9266    )]
9267    use tonic::codegen::*;
9268    use tonic::codegen::http::Uri;
9269    #[derive(Debug, Clone)]
9270    pub struct TransactionExecutionServiceClient<T> {
9271        inner: tonic::client::Grpc<T>,
9272    }
9273    impl TransactionExecutionServiceClient<tonic::transport::Channel> {
9274        /// Attempt to create a new client by connecting to a given endpoint.
9275        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9276        where
9277            D: TryInto<tonic::transport::Endpoint>,
9278            D::Error: Into<StdError>,
9279        {
9280            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9281            Ok(Self::new(conn))
9282        }
9283    }
9284    impl<T> TransactionExecutionServiceClient<T>
9285    where
9286        T: tonic::client::GrpcService<tonic::body::Body>,
9287        T::Error: Into<StdError>,
9288        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9289        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9290    {
9291        pub fn new(inner: T) -> Self {
9292            let inner = tonic::client::Grpc::new(inner);
9293            Self { inner }
9294        }
9295        pub fn with_origin(inner: T, origin: Uri) -> Self {
9296            let inner = tonic::client::Grpc::with_origin(inner, origin);
9297            Self { inner }
9298        }
9299        pub fn with_interceptor<F>(
9300            inner: T,
9301            interceptor: F,
9302        ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
9303        where
9304            F: tonic::service::Interceptor,
9305            T::ResponseBody: Default,
9306            T: tonic::codegen::Service<
9307                http::Request<tonic::body::Body>,
9308                Response = http::Response<
9309                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9310                >,
9311            >,
9312            <T as tonic::codegen::Service<
9313                http::Request<tonic::body::Body>,
9314            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9315        {
9316            TransactionExecutionServiceClient::new(
9317                InterceptedService::new(inner, interceptor),
9318            )
9319        }
9320        /// Compress requests with the given encoding.
9321        ///
9322        /// This requires the server to support it otherwise it might respond with an
9323        /// error.
9324        #[must_use]
9325        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9326            self.inner = self.inner.send_compressed(encoding);
9327            self
9328        }
9329        /// Enable decompressing responses.
9330        #[must_use]
9331        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9332            self.inner = self.inner.accept_compressed(encoding);
9333            self
9334        }
9335        /// Limits the maximum size of a decoded message.
9336        ///
9337        /// Default: `4MB`
9338        #[must_use]
9339        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9340            self.inner = self.inner.max_decoding_message_size(limit);
9341            self
9342        }
9343        /// Limits the maximum size of an encoded message.
9344        ///
9345        /// Default: `usize::MAX`
9346        #[must_use]
9347        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9348            self.inner = self.inner.max_encoding_message_size(limit);
9349            self
9350        }
9351        pub async fn execute_transaction(
9352            &mut self,
9353            request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
9354        ) -> std::result::Result<
9355            tonic::Response<super::ExecuteTransactionResponse>,
9356            tonic::Status,
9357        > {
9358            self.inner
9359                .ready()
9360                .await
9361                .map_err(|e| {
9362                    tonic::Status::unknown(
9363                        format!("Service was not ready: {}", e.into()),
9364                    )
9365                })?;
9366            let codec = tonic_prost::ProstCodec::default();
9367            let path = http::uri::PathAndQuery::from_static(
9368                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
9369            );
9370            let mut req = request.into_request();
9371            req.extensions_mut()
9372                .insert(
9373                    GrpcMethod::new(
9374                        "sui.rpc.v2.TransactionExecutionService",
9375                        "ExecuteTransaction",
9376                    ),
9377                );
9378            self.inner.unary(req, path, codec).await
9379        }
9380        pub async fn simulate_transaction(
9381            &mut self,
9382            request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
9383        ) -> std::result::Result<
9384            tonic::Response<super::SimulateTransactionResponse>,
9385            tonic::Status,
9386        > {
9387            self.inner
9388                .ready()
9389                .await
9390                .map_err(|e| {
9391                    tonic::Status::unknown(
9392                        format!("Service was not ready: {}", e.into()),
9393                    )
9394                })?;
9395            let codec = tonic_prost::ProstCodec::default();
9396            let path = http::uri::PathAndQuery::from_static(
9397                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
9398            );
9399            let mut req = request.into_request();
9400            req.extensions_mut()
9401                .insert(
9402                    GrpcMethod::new(
9403                        "sui.rpc.v2.TransactionExecutionService",
9404                        "SimulateTransaction",
9405                    ),
9406                );
9407            self.inner.unary(req, path, codec).await
9408        }
9409    }
9410}
9411/// Generated server implementations.
9412pub mod transaction_execution_service_server {
9413    #![allow(
9414        unused_variables,
9415        dead_code,
9416        missing_docs,
9417        clippy::wildcard_imports,
9418        clippy::let_unit_value,
9419    )]
9420    use tonic::codegen::*;
9421    /// Generated trait containing gRPC methods that should be implemented for use with TransactionExecutionServiceServer.
9422    #[async_trait]
9423    pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
9424        async fn execute_transaction(
9425            &self,
9426            request: tonic::Request<super::ExecuteTransactionRequest>,
9427        ) -> std::result::Result<
9428            tonic::Response<super::ExecuteTransactionResponse>,
9429            tonic::Status,
9430        > {
9431            Err(tonic::Status::unimplemented("Not yet implemented"))
9432        }
9433        async fn simulate_transaction(
9434            &self,
9435            request: tonic::Request<super::SimulateTransactionRequest>,
9436        ) -> std::result::Result<
9437            tonic::Response<super::SimulateTransactionResponse>,
9438            tonic::Status,
9439        > {
9440            Err(tonic::Status::unimplemented("Not yet implemented"))
9441        }
9442    }
9443    #[derive(Debug)]
9444    pub struct TransactionExecutionServiceServer<T> {
9445        inner: Arc<T>,
9446        accept_compression_encodings: EnabledCompressionEncodings,
9447        send_compression_encodings: EnabledCompressionEncodings,
9448        max_decoding_message_size: Option<usize>,
9449        max_encoding_message_size: Option<usize>,
9450    }
9451    impl<T> TransactionExecutionServiceServer<T> {
9452        pub fn new(inner: T) -> Self {
9453            Self::from_arc(Arc::new(inner))
9454        }
9455        pub fn from_arc(inner: Arc<T>) -> Self {
9456            Self {
9457                inner,
9458                accept_compression_encodings: Default::default(),
9459                send_compression_encodings: Default::default(),
9460                max_decoding_message_size: None,
9461                max_encoding_message_size: None,
9462            }
9463        }
9464        pub fn with_interceptor<F>(
9465            inner: T,
9466            interceptor: F,
9467        ) -> InterceptedService<Self, F>
9468        where
9469            F: tonic::service::Interceptor,
9470        {
9471            InterceptedService::new(Self::new(inner), interceptor)
9472        }
9473        /// Enable decompressing requests with the given encoding.
9474        #[must_use]
9475        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9476            self.accept_compression_encodings.enable(encoding);
9477            self
9478        }
9479        /// Compress responses with the given encoding, if the client supports it.
9480        #[must_use]
9481        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9482            self.send_compression_encodings.enable(encoding);
9483            self
9484        }
9485        /// Limits the maximum size of a decoded message.
9486        ///
9487        /// Default: `4MB`
9488        #[must_use]
9489        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9490            self.max_decoding_message_size = Some(limit);
9491            self
9492        }
9493        /// Limits the maximum size of an encoded message.
9494        ///
9495        /// Default: `usize::MAX`
9496        #[must_use]
9497        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9498            self.max_encoding_message_size = Some(limit);
9499            self
9500        }
9501    }
9502    impl<T, B> tonic::codegen::Service<http::Request<B>>
9503    for TransactionExecutionServiceServer<T>
9504    where
9505        T: TransactionExecutionService,
9506        B: Body + std::marker::Send + 'static,
9507        B::Error: Into<StdError> + std::marker::Send + 'static,
9508    {
9509        type Response = http::Response<tonic::body::Body>;
9510        type Error = std::convert::Infallible;
9511        type Future = BoxFuture<Self::Response, Self::Error>;
9512        fn poll_ready(
9513            &mut self,
9514            _cx: &mut Context<'_>,
9515        ) -> Poll<std::result::Result<(), Self::Error>> {
9516            Poll::Ready(Ok(()))
9517        }
9518        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9519            match req.uri().path() {
9520                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
9521                    #[allow(non_camel_case_types)]
9522                    struct ExecuteTransactionSvc<T: TransactionExecutionService>(
9523                        pub Arc<T>,
9524                    );
9525                    impl<
9526                        T: TransactionExecutionService,
9527                    > tonic::server::UnaryService<super::ExecuteTransactionRequest>
9528                    for ExecuteTransactionSvc<T> {
9529                        type Response = super::ExecuteTransactionResponse;
9530                        type Future = BoxFuture<
9531                            tonic::Response<Self::Response>,
9532                            tonic::Status,
9533                        >;
9534                        fn call(
9535                            &mut self,
9536                            request: tonic::Request<super::ExecuteTransactionRequest>,
9537                        ) -> Self::Future {
9538                            let inner = Arc::clone(&self.0);
9539                            let fut = async move {
9540                                <T as TransactionExecutionService>::execute_transaction(
9541                                        &inner,
9542                                        request,
9543                                    )
9544                                    .await
9545                            };
9546                            Box::pin(fut)
9547                        }
9548                    }
9549                    let accept_compression_encodings = self.accept_compression_encodings;
9550                    let send_compression_encodings = self.send_compression_encodings;
9551                    let max_decoding_message_size = self.max_decoding_message_size;
9552                    let max_encoding_message_size = self.max_encoding_message_size;
9553                    let inner = self.inner.clone();
9554                    let fut = async move {
9555                        let method = ExecuteTransactionSvc(inner);
9556                        let codec = tonic_prost::ProstCodec::default();
9557                        let mut grpc = tonic::server::Grpc::new(codec)
9558                            .apply_compression_config(
9559                                accept_compression_encodings,
9560                                send_compression_encodings,
9561                            )
9562                            .apply_max_message_size_config(
9563                                max_decoding_message_size,
9564                                max_encoding_message_size,
9565                            );
9566                        let res = grpc.unary(method, req).await;
9567                        Ok(res)
9568                    };
9569                    Box::pin(fut)
9570                }
9571                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
9572                    #[allow(non_camel_case_types)]
9573                    struct SimulateTransactionSvc<T: TransactionExecutionService>(
9574                        pub Arc<T>,
9575                    );
9576                    impl<
9577                        T: TransactionExecutionService,
9578                    > tonic::server::UnaryService<super::SimulateTransactionRequest>
9579                    for SimulateTransactionSvc<T> {
9580                        type Response = super::SimulateTransactionResponse;
9581                        type Future = BoxFuture<
9582                            tonic::Response<Self::Response>,
9583                            tonic::Status,
9584                        >;
9585                        fn call(
9586                            &mut self,
9587                            request: tonic::Request<super::SimulateTransactionRequest>,
9588                        ) -> Self::Future {
9589                            let inner = Arc::clone(&self.0);
9590                            let fut = async move {
9591                                <T as TransactionExecutionService>::simulate_transaction(
9592                                        &inner,
9593                                        request,
9594                                    )
9595                                    .await
9596                            };
9597                            Box::pin(fut)
9598                        }
9599                    }
9600                    let accept_compression_encodings = self.accept_compression_encodings;
9601                    let send_compression_encodings = self.send_compression_encodings;
9602                    let max_decoding_message_size = self.max_decoding_message_size;
9603                    let max_encoding_message_size = self.max_encoding_message_size;
9604                    let inner = self.inner.clone();
9605                    let fut = async move {
9606                        let method = SimulateTransactionSvc(inner);
9607                        let codec = tonic_prost::ProstCodec::default();
9608                        let mut grpc = tonic::server::Grpc::new(codec)
9609                            .apply_compression_config(
9610                                accept_compression_encodings,
9611                                send_compression_encodings,
9612                            )
9613                            .apply_max_message_size_config(
9614                                max_decoding_message_size,
9615                                max_encoding_message_size,
9616                            );
9617                        let res = grpc.unary(method, req).await;
9618                        Ok(res)
9619                    };
9620                    Box::pin(fut)
9621                }
9622                _ => {
9623                    Box::pin(async move {
9624                        let mut response = http::Response::new(
9625                            tonic::body::Body::default(),
9626                        );
9627                        let headers = response.headers_mut();
9628                        headers
9629                            .insert(
9630                                tonic::Status::GRPC_STATUS,
9631                                (tonic::Code::Unimplemented as i32).into(),
9632                            );
9633                        headers
9634                            .insert(
9635                                http::header::CONTENT_TYPE,
9636                                tonic::metadata::GRPC_CONTENT_TYPE,
9637                            );
9638                        Ok(response)
9639                    })
9640                }
9641            }
9642        }
9643    }
9644    impl<T> Clone for TransactionExecutionServiceServer<T> {
9645        fn clone(&self) -> Self {
9646            let inner = self.inner.clone();
9647            Self {
9648                inner,
9649                accept_compression_encodings: self.accept_compression_encodings,
9650                send_compression_encodings: self.send_compression_encodings,
9651                max_decoding_message_size: self.max_decoding_message_size,
9652                max_encoding_message_size: self.max_encoding_message_size,
9653            }
9654        }
9655    }
9656    /// Generated gRPC service name
9657    pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
9658    impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
9659        const NAME: &'static str = SERVICE_NAME;
9660    }
9661}