1#[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 #[prost(uint32, optional, tag = "2")]
10 pub input: ::core::option::Option<u32>,
11 #[prost(uint32, optional, tag = "3")]
13 pub result: ::core::option::Option<u32>,
14 #[prost(uint32, optional, tag = "4")]
16 pub subresult: ::core::option::Option<u32>,
17}
18pub 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 Gas = 1,
37 Input = 2,
40 Result = 3,
42 }
43 impl ArgumentKind {
44 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 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#[non_exhaustive]
70#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
71pub struct BalanceChange {
72 #[prost(string, optional, tag = "1")]
74 pub address: ::core::option::Option<::prost::alloc::string::String>,
75 #[prost(string, optional, tag = "2")]
77 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
78 #[prost(string, optional, tag = "3")]
80 pub amount: ::core::option::Option<::prost::alloc::string::String>,
81}
82#[non_exhaustive]
86#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
87pub struct Bcs {
88 #[prost(string, optional, tag = "1")]
90 pub name: ::core::option::Option<::prost::alloc::string::String>,
91 #[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 #[prost(uint64, optional, tag = "1")]
100 pub sequence_number: ::core::option::Option<u64>,
101 #[prost(string, optional, tag = "2")]
103 pub digest: ::core::option::Option<::prost::alloc::string::String>,
104 #[prost(message, optional, tag = "3")]
106 pub summary: ::core::option::Option<CheckpointSummary>,
107 #[prost(message, optional, tag = "4")]
110 pub signature: ::core::option::Option<ValidatorAggregatedSignature>,
111 #[prost(message, optional, tag = "5")]
113 pub contents: ::core::option::Option<CheckpointContents>,
114 #[prost(message, repeated, tag = "6")]
116 pub transactions: ::prost::alloc::vec::Vec<ExecutedTransaction>,
117 #[prost(message, optional, tag = "7")]
125 pub objects: ::core::option::Option<ObjectSet>,
126}
127#[non_exhaustive]
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct CheckpointContents {
131 #[prost(message, optional, tag = "1")]
133 pub bcs: ::core::option::Option<Bcs>,
134 #[prost(string, optional, tag = "2")]
136 pub digest: ::core::option::Option<::prost::alloc::string::String>,
137 #[prost(int32, optional, tag = "3")]
139 pub version: ::core::option::Option<i32>,
140 #[prost(message, repeated, tag = "4")]
142 pub transactions: ::prost::alloc::vec::Vec<CheckpointedTransactionInfo>,
143}
144#[non_exhaustive]
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct CheckpointedTransactionInfo {
148 #[prost(string, optional, tag = "1")]
150 pub transaction: ::core::option::Option<::prost::alloc::string::String>,
151 #[prost(string, optional, tag = "2")]
153 pub effects: ::core::option::Option<::prost::alloc::string::String>,
154 #[prost(message, repeated, tag = "3")]
156 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
157}
158#[non_exhaustive]
179#[derive(Clone, PartialEq, ::prost::Message)]
180pub struct CheckpointSummary {
181 #[prost(message, optional, tag = "1")]
183 pub bcs: ::core::option::Option<Bcs>,
184 #[prost(string, optional, tag = "2")]
186 pub digest: ::core::option::Option<::prost::alloc::string::String>,
187 #[prost(uint64, optional, tag = "3")]
189 pub epoch: ::core::option::Option<u64>,
190 #[prost(uint64, optional, tag = "4")]
192 pub sequence_number: ::core::option::Option<u64>,
193 #[prost(uint64, optional, tag = "5")]
196 pub total_network_transactions: ::core::option::Option<u64>,
197 #[prost(string, optional, tag = "6")]
199 pub content_digest: ::core::option::Option<::prost::alloc::string::String>,
200 #[prost(string, optional, tag = "7")]
204 pub previous_digest: ::core::option::Option<::prost::alloc::string::String>,
205 #[prost(message, optional, tag = "8")]
208 pub epoch_rolling_gas_cost_summary: ::core::option::Option<GasCostSummary>,
209 #[prost(message, optional, tag = "9")]
213 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
214 #[prost(message, repeated, tag = "10")]
216 pub commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
217 #[prost(message, optional, tag = "11")]
219 pub end_of_epoch_data: ::core::option::Option<EndOfEpochData>,
220 #[prost(bytes = "bytes", optional, tag = "12")]
225 pub version_specific_data: ::core::option::Option<::prost::bytes::Bytes>,
226}
227#[non_exhaustive]
229#[derive(Clone, PartialEq, ::prost::Message)]
230pub struct EndOfEpochData {
231 #[prost(message, repeated, tag = "1")]
233 pub next_epoch_committee: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
234 #[prost(uint64, optional, tag = "2")]
236 pub next_epoch_protocol_version: ::core::option::Option<u64>,
237 #[prost(message, repeated, tag = "3")]
239 pub epoch_commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
240}
241#[non_exhaustive]
243#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
244pub struct CheckpointCommitment {
245 #[prost(
246 enumeration = "checkpoint_commitment::CheckpointCommitmentKind",
247 optional,
248 tag = "1"
249 )]
250 pub kind: ::core::option::Option<i32>,
251 #[prost(string, optional, tag = "2")]
252 pub digest: ::core::option::Option<::prost::alloc::string::String>,
253}
254pub mod checkpoint_commitment {
256 #[non_exhaustive]
257 #[derive(
258 Clone,
259 Copy,
260 Debug,
261 PartialEq,
262 Eq,
263 Hash,
264 PartialOrd,
265 Ord,
266 ::prost::Enumeration
267 )]
268 #[repr(i32)]
269 pub enum CheckpointCommitmentKind {
270 Unknown = 0,
271 EcmhLiveObjectSet = 1,
274 CheckpointArtifacts = 2,
276 }
277 impl CheckpointCommitmentKind {
278 pub fn as_str_name(&self) -> &'static str {
283 match self {
284 Self::Unknown => "CHECKPOINT_COMMITMENT_KIND_UNKNOWN",
285 Self::EcmhLiveObjectSet => "ECMH_LIVE_OBJECT_SET",
286 Self::CheckpointArtifacts => "CHECKPOINT_ARTIFACTS",
287 }
288 }
289 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
291 match value {
292 "CHECKPOINT_COMMITMENT_KIND_UNKNOWN" => Some(Self::Unknown),
293 "ECMH_LIVE_OBJECT_SET" => Some(Self::EcmhLiveObjectSet),
294 "CHECKPOINT_ARTIFACTS" => Some(Self::CheckpointArtifacts),
295 _ => None,
296 }
297 }
298 }
299}
300#[non_exhaustive]
302#[derive(Clone, PartialEq, ::prost::Message)]
303pub struct TransactionEffects {
304 #[prost(message, optional, tag = "1")]
306 pub bcs: ::core::option::Option<Bcs>,
307 #[prost(string, optional, tag = "2")]
309 pub digest: ::core::option::Option<::prost::alloc::string::String>,
310 #[prost(int32, optional, tag = "3")]
312 pub version: ::core::option::Option<i32>,
313 #[prost(message, optional, tag = "4")]
315 pub status: ::core::option::Option<ExecutionStatus>,
316 #[prost(uint64, optional, tag = "5")]
318 pub epoch: ::core::option::Option<u64>,
319 #[prost(message, optional, tag = "6")]
321 pub gas_used: ::core::option::Option<GasCostSummary>,
322 #[prost(string, optional, tag = "7")]
324 pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
325 #[prost(message, optional, tag = "8")]
329 pub gas_object: ::core::option::Option<ChangedObject>,
330 #[prost(string, optional, tag = "9")]
333 pub events_digest: ::core::option::Option<::prost::alloc::string::String>,
334 #[prost(string, repeated, tag = "10")]
336 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
337 #[prost(uint64, optional, tag = "11")]
339 pub lamport_version: ::core::option::Option<u64>,
340 #[prost(message, repeated, tag = "12")]
342 pub changed_objects: ::prost::alloc::vec::Vec<ChangedObject>,
343 #[prost(message, repeated, tag = "13")]
348 pub unchanged_consensus_objects: ::prost::alloc::vec::Vec<UnchangedConsensusObject>,
349 #[prost(string, optional, tag = "14")]
353 pub auxiliary_data_digest: ::core::option::Option<::prost::alloc::string::String>,
354 #[prost(message, repeated, tag = "15")]
355 pub unchanged_loaded_runtime_objects: ::prost::alloc::vec::Vec<ObjectReference>,
356}
357#[non_exhaustive]
359#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
360pub struct ChangedObject {
361 #[prost(string, optional, tag = "1")]
363 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
364 #[prost(enumeration = "changed_object::InputObjectState", optional, tag = "2")]
365 pub input_state: ::core::option::Option<i32>,
366 #[prost(uint64, optional, tag = "3")]
368 pub input_version: ::core::option::Option<u64>,
369 #[prost(string, optional, tag = "4")]
371 pub input_digest: ::core::option::Option<::prost::alloc::string::String>,
372 #[prost(message, optional, tag = "5")]
374 pub input_owner: ::core::option::Option<Owner>,
375 #[prost(enumeration = "changed_object::OutputObjectState", optional, tag = "6")]
376 pub output_state: ::core::option::Option<i32>,
377 #[prost(uint64, optional, tag = "7")]
379 pub output_version: ::core::option::Option<u64>,
380 #[prost(string, optional, tag = "8")]
382 pub output_digest: ::core::option::Option<::prost::alloc::string::String>,
383 #[prost(message, optional, tag = "9")]
385 pub output_owner: ::core::option::Option<Owner>,
386 #[prost(enumeration = "changed_object::IdOperation", optional, tag = "10")]
388 pub id_operation: ::core::option::Option<i32>,
389 #[prost(string, optional, tag = "11")]
392 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
393}
394pub mod changed_object {
396 #[non_exhaustive]
397 #[derive(
398 Clone,
399 Copy,
400 Debug,
401 PartialEq,
402 Eq,
403 Hash,
404 PartialOrd,
405 Ord,
406 ::prost::Enumeration
407 )]
408 #[repr(i32)]
409 pub enum InputObjectState {
410 Unknown = 0,
411 DoesNotExist = 1,
412 Exists = 2,
413 }
414 impl InputObjectState {
415 pub fn as_str_name(&self) -> &'static str {
420 match self {
421 Self::Unknown => "INPUT_OBJECT_STATE_UNKNOWN",
422 Self::DoesNotExist => "INPUT_OBJECT_STATE_DOES_NOT_EXIST",
423 Self::Exists => "INPUT_OBJECT_STATE_EXISTS",
424 }
425 }
426 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
428 match value {
429 "INPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
430 "INPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
431 "INPUT_OBJECT_STATE_EXISTS" => Some(Self::Exists),
432 _ => None,
433 }
434 }
435 }
436 #[non_exhaustive]
437 #[derive(
438 Clone,
439 Copy,
440 Debug,
441 PartialEq,
442 Eq,
443 Hash,
444 PartialOrd,
445 Ord,
446 ::prost::Enumeration
447 )]
448 #[repr(i32)]
449 pub enum OutputObjectState {
450 Unknown = 0,
451 DoesNotExist = 1,
452 ObjectWrite = 2,
453 PackageWrite = 3,
454 }
455 impl OutputObjectState {
456 pub fn as_str_name(&self) -> &'static str {
461 match self {
462 Self::Unknown => "OUTPUT_OBJECT_STATE_UNKNOWN",
463 Self::DoesNotExist => "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST",
464 Self::ObjectWrite => "OUTPUT_OBJECT_STATE_OBJECT_WRITE",
465 Self::PackageWrite => "OUTPUT_OBJECT_STATE_PACKAGE_WRITE",
466 }
467 }
468 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
470 match value {
471 "OUTPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
472 "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
473 "OUTPUT_OBJECT_STATE_OBJECT_WRITE" => Some(Self::ObjectWrite),
474 "OUTPUT_OBJECT_STATE_PACKAGE_WRITE" => Some(Self::PackageWrite),
475 _ => None,
476 }
477 }
478 }
479 #[non_exhaustive]
480 #[derive(
481 Clone,
482 Copy,
483 Debug,
484 PartialEq,
485 Eq,
486 Hash,
487 PartialOrd,
488 Ord,
489 ::prost::Enumeration
490 )]
491 #[repr(i32)]
492 pub enum IdOperation {
493 Unknown = 0,
494 None = 1,
495 Created = 2,
496 Deleted = 3,
497 }
498 impl IdOperation {
499 pub fn as_str_name(&self) -> &'static str {
504 match self {
505 Self::Unknown => "ID_OPERATION_UNKNOWN",
506 Self::None => "NONE",
507 Self::Created => "CREATED",
508 Self::Deleted => "DELETED",
509 }
510 }
511 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
513 match value {
514 "ID_OPERATION_UNKNOWN" => Some(Self::Unknown),
515 "NONE" => Some(Self::None),
516 "CREATED" => Some(Self::Created),
517 "DELETED" => Some(Self::Deleted),
518 _ => None,
519 }
520 }
521 }
522}
523#[non_exhaustive]
525#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
526pub struct UnchangedConsensusObject {
527 #[prost(
528 enumeration = "unchanged_consensus_object::UnchangedConsensusObjectKind",
529 optional,
530 tag = "1"
531 )]
532 pub kind: ::core::option::Option<i32>,
533 #[prost(string, optional, tag = "2")]
535 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
536 #[prost(uint64, optional, tag = "3")]
538 pub version: ::core::option::Option<u64>,
539 #[prost(string, optional, tag = "4")]
541 pub digest: ::core::option::Option<::prost::alloc::string::String>,
542 #[prost(string, optional, tag = "5")]
545 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
546}
547pub mod unchanged_consensus_object {
549 #[non_exhaustive]
550 #[derive(
551 Clone,
552 Copy,
553 Debug,
554 PartialEq,
555 Eq,
556 Hash,
557 PartialOrd,
558 Ord,
559 ::prost::Enumeration
560 )]
561 #[repr(i32)]
562 pub enum UnchangedConsensusObjectKind {
563 Unknown = 0,
564 ReadOnlyRoot = 1,
566 MutateConsensusStreamEnded = 2,
568 ReadConsensusStreamEnded = 3,
570 Canceled = 4,
573 PerEpochConfig = 5,
577 }
578 impl UnchangedConsensusObjectKind {
579 pub fn as_str_name(&self) -> &'static str {
584 match self {
585 Self::Unknown => "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN",
586 Self::ReadOnlyRoot => "READ_ONLY_ROOT",
587 Self::MutateConsensusStreamEnded => "MUTATE_CONSENSUS_STREAM_ENDED",
588 Self::ReadConsensusStreamEnded => "READ_CONSENSUS_STREAM_ENDED",
589 Self::Canceled => "CANCELED",
590 Self::PerEpochConfig => "PER_EPOCH_CONFIG",
591 }
592 }
593 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
595 match value {
596 "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN" => Some(Self::Unknown),
597 "READ_ONLY_ROOT" => Some(Self::ReadOnlyRoot),
598 "MUTATE_CONSENSUS_STREAM_ENDED" => Some(Self::MutateConsensusStreamEnded),
599 "READ_CONSENSUS_STREAM_ENDED" => Some(Self::ReadConsensusStreamEnded),
600 "CANCELED" => Some(Self::Canceled),
601 "PER_EPOCH_CONFIG" => Some(Self::PerEpochConfig),
602 _ => None,
603 }
604 }
605 }
606}
607#[non_exhaustive]
608#[derive(Clone, PartialEq, ::prost::Message)]
609pub struct Epoch {
610 #[prost(uint64, optional, tag = "1")]
611 pub epoch: ::core::option::Option<u64>,
612 #[prost(message, optional, tag = "2")]
614 pub committee: ::core::option::Option<ValidatorCommittee>,
615 #[prost(message, optional, boxed, tag = "3")]
619 pub system_state: ::core::option::Option<::prost::alloc::boxed::Box<SystemState>>,
620 #[prost(uint64, optional, tag = "4")]
621 pub first_checkpoint: ::core::option::Option<u64>,
622 #[prost(uint64, optional, tag = "5")]
623 pub last_checkpoint: ::core::option::Option<u64>,
624 #[prost(message, optional, tag = "6")]
625 pub start: ::core::option::Option<::prost_types::Timestamp>,
626 #[prost(message, optional, tag = "7")]
627 pub end: ::core::option::Option<::prost_types::Timestamp>,
628 #[prost(uint64, optional, tag = "8")]
630 pub reference_gas_price: ::core::option::Option<u64>,
631 #[prost(message, optional, tag = "9")]
632 pub protocol_config: ::core::option::Option<ProtocolConfig>,
633}
634#[non_exhaustive]
635#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
636#[repr(i32)]
637pub enum ErrorReason {
638 Unknown = 0,
639 FieldInvalid = 1,
640 FieldMissing = 2,
641}
642impl ErrorReason {
643 pub fn as_str_name(&self) -> &'static str {
648 match self {
649 Self::Unknown => "ERROR_REASON_UNKNOWN",
650 Self::FieldInvalid => "FIELD_INVALID",
651 Self::FieldMissing => "FIELD_MISSING",
652 }
653 }
654 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
656 match value {
657 "ERROR_REASON_UNKNOWN" => Some(Self::Unknown),
658 "FIELD_INVALID" => Some(Self::FieldInvalid),
659 "FIELD_MISSING" => Some(Self::FieldMissing),
660 _ => None,
661 }
662 }
663}
664#[non_exhaustive]
666#[derive(Clone, PartialEq, ::prost::Message)]
667pub struct TransactionEvents {
668 #[prost(message, optional, tag = "1")]
670 pub bcs: ::core::option::Option<Bcs>,
671 #[prost(string, optional, tag = "2")]
673 pub digest: ::core::option::Option<::prost::alloc::string::String>,
674 #[prost(message, repeated, tag = "3")]
676 pub events: ::prost::alloc::vec::Vec<Event>,
677}
678#[non_exhaustive]
680#[derive(Clone, PartialEq, ::prost::Message)]
681pub struct Event {
682 #[prost(string, optional, tag = "1")]
685 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
686 #[prost(string, optional, tag = "2")]
689 pub module: ::core::option::Option<::prost::alloc::string::String>,
690 #[prost(string, optional, tag = "3")]
692 pub sender: ::core::option::Option<::prost::alloc::string::String>,
693 #[prost(string, optional, tag = "4")]
695 pub event_type: ::core::option::Option<::prost::alloc::string::String>,
696 #[prost(message, optional, tag = "5")]
698 pub contents: ::core::option::Option<Bcs>,
699 #[prost(message, optional, boxed, tag = "6")]
701 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
702}
703#[non_exhaustive]
704#[derive(Clone, PartialEq, ::prost::Message)]
705pub struct ExecutedTransaction {
706 #[prost(string, optional, tag = "1")]
708 pub digest: ::core::option::Option<::prost::alloc::string::String>,
709 #[prost(message, optional, tag = "2")]
711 pub transaction: ::core::option::Option<Transaction>,
712 #[prost(message, repeated, tag = "3")]
715 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
716 #[prost(message, optional, tag = "4")]
718 pub effects: ::core::option::Option<TransactionEffects>,
719 #[prost(message, optional, tag = "5")]
726 pub events: ::core::option::Option<TransactionEvents>,
727 #[prost(uint64, optional, tag = "6")]
729 pub checkpoint: ::core::option::Option<u64>,
730 #[prost(message, optional, tag = "7")]
732 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
733 #[prost(message, repeated, tag = "8")]
734 pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
735 #[prost(message, optional, tag = "9")]
738 pub objects: ::core::option::Option<ObjectSet>,
739}
740#[non_exhaustive]
742#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
743pub struct ExecutionStatus {
744 #[prost(bool, optional, tag = "1")]
746 pub success: ::core::option::Option<bool>,
747 #[prost(message, optional, tag = "2")]
749 pub error: ::core::option::Option<ExecutionError>,
750}
751#[non_exhaustive]
753#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
754pub struct ExecutionError {
755 #[prost(string, optional, tag = "1")]
757 pub description: ::core::option::Option<::prost::alloc::string::String>,
758 #[prost(uint64, optional, tag = "2")]
760 pub command: ::core::option::Option<u64>,
761 #[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
762 pub kind: ::core::option::Option<i32>,
763 #[prost(
764 oneof = "execution_error::ErrorDetails",
765 tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
766 )]
767 pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
768}
769pub mod execution_error {
771 #[non_exhaustive]
772 #[derive(
773 Clone,
774 Copy,
775 Debug,
776 PartialEq,
777 Eq,
778 Hash,
779 PartialOrd,
780 Ord,
781 ::prost::Enumeration
782 )]
783 #[repr(i32)]
784 pub enum ExecutionErrorKind {
785 Unknown = 0,
786 InsufficientGas = 1,
788 InvalidGasObject = 2,
790 InvariantViolation = 3,
792 FeatureNotYetSupported = 4,
794 ObjectTooBig = 5,
796 PackageTooBig = 6,
798 CircularObjectOwnership = 7,
800 InsufficientCoinBalance = 8,
802 CoinBalanceOverflow = 9,
804 PublishErrorNonZeroAddress = 10,
807 SuiMoveVerificationError = 11,
809 MovePrimitiveRuntimeError = 12,
813 MoveAbort = 13,
815 VmVerificationOrDeserializationError = 14,
817 VmInvariantViolation = 15,
819 FunctionNotFound = 16,
821 ArityMismatch = 17,
824 TypeArityMismatch = 18,
827 NonEntryFunctionInvoked = 19,
829 CommandArgumentError = 20,
831 TypeArgumentError = 21,
833 UnusedValueWithoutDrop = 22,
835 InvalidPublicFunctionReturnType = 23,
838 InvalidTransferObject = 24,
840 EffectsTooLarge = 25,
842 PublishUpgradeMissingDependency = 26,
844 PublishUpgradeDependencyDowngrade = 27,
850 PackageUpgradeError = 28,
852 WrittenObjectsTooLarge = 29,
854 CertificateDenied = 30,
856 SuiMoveVerificationTimedout = 31,
858 ConsensusObjectOperationNotAllowed = 32,
860 InputObjectDeleted = 33,
862 ExecutionCanceledDueToConsensusObjectCongestion = 34,
864 AddressDeniedForCoin = 35,
866 CoinTypeGlobalPause = 36,
868 ExecutionCanceledDueToRandomnessUnavailable = 37,
870 MoveVectorElemTooBig = 38,
871 MoveRawValueTooBig = 39,
872 InvalidLinkage = 40,
873 }
874 impl ExecutionErrorKind {
875 pub fn as_str_name(&self) -> &'static str {
880 match self {
881 Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
882 Self::InsufficientGas => "INSUFFICIENT_GAS",
883 Self::InvalidGasObject => "INVALID_GAS_OBJECT",
884 Self::InvariantViolation => "INVARIANT_VIOLATION",
885 Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
886 Self::ObjectTooBig => "OBJECT_TOO_BIG",
887 Self::PackageTooBig => "PACKAGE_TOO_BIG",
888 Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
889 Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
890 Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
891 Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
892 Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
893 Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
894 Self::MoveAbort => "MOVE_ABORT",
895 Self::VmVerificationOrDeserializationError => {
896 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
897 }
898 Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
899 Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
900 Self::ArityMismatch => "ARITY_MISMATCH",
901 Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
902 Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
903 Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
904 Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
905 Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
906 Self::InvalidPublicFunctionReturnType => {
907 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
908 }
909 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
910 Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
911 Self::PublishUpgradeMissingDependency => {
912 "PUBLISH_UPGRADE_MISSING_DEPENDENCY"
913 }
914 Self::PublishUpgradeDependencyDowngrade => {
915 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
916 }
917 Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
918 Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
919 Self::CertificateDenied => "CERTIFICATE_DENIED",
920 Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
921 Self::ConsensusObjectOperationNotAllowed => {
922 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
923 }
924 Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
925 Self::ExecutionCanceledDueToConsensusObjectCongestion => {
926 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION"
927 }
928 Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
929 Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
930 Self::ExecutionCanceledDueToRandomnessUnavailable => {
931 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
932 }
933 Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
934 Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
935 Self::InvalidLinkage => "INVALID_LINKAGE",
936 }
937 }
938 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
940 match value {
941 "EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
942 "INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
943 "INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
944 "INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
945 "FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
946 "OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
947 "PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
948 "CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
949 "INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
950 "COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
951 "PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
952 Some(Self::PublishErrorNonZeroAddress)
953 }
954 "SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
955 "MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
956 "MOVE_ABORT" => Some(Self::MoveAbort),
957 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
958 Some(Self::VmVerificationOrDeserializationError)
959 }
960 "VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
961 "FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
962 "ARITY_MISMATCH" => Some(Self::ArityMismatch),
963 "TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
964 "NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
965 "COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
966 "TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
967 "UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
968 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
969 Some(Self::InvalidPublicFunctionReturnType)
970 }
971 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
972 "EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
973 "PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
974 Some(Self::PublishUpgradeMissingDependency)
975 }
976 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
977 Some(Self::PublishUpgradeDependencyDowngrade)
978 }
979 "PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
980 "WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
981 "CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
982 "SUI_MOVE_VERIFICATION_TIMEDOUT" => {
983 Some(Self::SuiMoveVerificationTimedout)
984 }
985 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
986 Some(Self::ConsensusObjectOperationNotAllowed)
987 }
988 "INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
989 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION" => {
990 Some(Self::ExecutionCanceledDueToConsensusObjectCongestion)
991 }
992 "ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
993 "COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
994 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
995 Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
996 }
997 "MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
998 "MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
999 "INVALID_LINKAGE" => Some(Self::InvalidLinkage),
1000 _ => None,
1001 }
1002 }
1003 }
1004 #[non_exhaustive]
1005 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1006 pub enum ErrorDetails {
1007 #[prost(message, tag = "4")]
1008 Abort(super::MoveAbort),
1009 #[prost(message, tag = "5")]
1010 SizeError(super::SizeError),
1011 #[prost(message, tag = "6")]
1012 CommandArgumentError(super::CommandArgumentError),
1013 #[prost(message, tag = "7")]
1014 TypeArgumentError(super::TypeArgumentError),
1015 #[prost(message, tag = "8")]
1016 PackageUpgradeError(super::PackageUpgradeError),
1017 #[prost(message, tag = "9")]
1018 IndexError(super::IndexError),
1019 #[prost(string, tag = "10")]
1020 ObjectId(::prost::alloc::string::String),
1021 #[prost(message, tag = "11")]
1022 CoinDenyListError(super::CoinDenyListError),
1023 #[prost(message, tag = "12")]
1025 CongestedObjects(super::CongestedObjects),
1026 }
1027}
1028#[non_exhaustive]
1029#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1030pub struct MoveAbort {
1031 #[prost(uint64, optional, tag = "1")]
1032 pub abort_code: ::core::option::Option<u64>,
1033 #[prost(message, optional, tag = "2")]
1035 pub location: ::core::option::Option<MoveLocation>,
1036 #[prost(message, optional, tag = "3")]
1038 pub clever_error: ::core::option::Option<CleverError>,
1039}
1040#[non_exhaustive]
1042#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1043pub struct MoveLocation {
1044 #[prost(string, optional, tag = "1")]
1046 pub package: ::core::option::Option<::prost::alloc::string::String>,
1047 #[prost(string, optional, tag = "2")]
1049 pub module: ::core::option::Option<::prost::alloc::string::String>,
1050 #[prost(uint32, optional, tag = "3")]
1052 pub function: ::core::option::Option<u32>,
1053 #[prost(uint32, optional, tag = "4")]
1055 pub instruction: ::core::option::Option<u32>,
1056 #[prost(string, optional, tag = "5")]
1058 pub function_name: ::core::option::Option<::prost::alloc::string::String>,
1059}
1060#[non_exhaustive]
1061#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1062pub struct CleverError {
1063 #[prost(uint64, optional, tag = "1")]
1064 pub error_code: ::core::option::Option<u64>,
1065 #[prost(uint64, optional, tag = "2")]
1066 pub line_number: ::core::option::Option<u64>,
1067 #[prost(string, optional, tag = "3")]
1068 pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
1069 #[prost(string, optional, tag = "4")]
1070 pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
1071 #[prost(oneof = "clever_error::Value", tags = "5, 6")]
1072 pub value: ::core::option::Option<clever_error::Value>,
1073}
1074pub mod clever_error {
1076 #[non_exhaustive]
1077 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1078 pub enum Value {
1079 #[prost(string, tag = "5")]
1080 Rendered(::prost::alloc::string::String),
1081 #[prost(bytes, tag = "6")]
1082 Raw(::prost::bytes::Bytes),
1083 }
1084}
1085#[non_exhaustive]
1087#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1088pub struct SizeError {
1089 #[prost(uint64, optional, tag = "1")]
1091 pub size: ::core::option::Option<u64>,
1092 #[prost(uint64, optional, tag = "2")]
1094 pub max_size: ::core::option::Option<u64>,
1095}
1096#[non_exhaustive]
1097#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1098pub struct IndexError {
1099 #[prost(uint32, optional, tag = "1")]
1101 pub index: ::core::option::Option<u32>,
1102 #[prost(uint32, optional, tag = "2")]
1104 pub subresult: ::core::option::Option<u32>,
1105}
1106#[non_exhaustive]
1107#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1108pub struct CoinDenyListError {
1109 #[prost(string, optional, tag = "1")]
1111 pub address: ::core::option::Option<::prost::alloc::string::String>,
1112 #[prost(string, optional, tag = "2")]
1114 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1115}
1116#[non_exhaustive]
1118#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1119pub struct CongestedObjects {
1120 #[prost(string, repeated, tag = "1")]
1121 pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1122}
1123#[non_exhaustive]
1125#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1126pub struct CommandArgumentError {
1127 #[prost(uint32, optional, tag = "1")]
1129 pub argument: ::core::option::Option<u32>,
1130 #[prost(
1131 enumeration = "command_argument_error::CommandArgumentErrorKind",
1132 optional,
1133 tag = "2"
1134 )]
1135 pub kind: ::core::option::Option<i32>,
1136 #[prost(message, optional, tag = "3")]
1137 pub index_error: ::core::option::Option<IndexError>,
1138}
1139pub mod command_argument_error {
1141 #[non_exhaustive]
1142 #[derive(
1143 Clone,
1144 Copy,
1145 Debug,
1146 PartialEq,
1147 Eq,
1148 Hash,
1149 PartialOrd,
1150 Ord,
1151 ::prost::Enumeration
1152 )]
1153 #[repr(i32)]
1154 pub enum CommandArgumentErrorKind {
1155 Unknown = 0,
1156 TypeMismatch = 1,
1158 InvalidBcsBytes = 2,
1160 InvalidUsageOfPureArgument = 3,
1162 InvalidArgumentToPrivateEntryFunction = 4,
1165 IndexOutOfBounds = 5,
1169 SecondaryIndexOutOfBounds = 6,
1173 InvalidResultArity = 7,
1177 InvalidGasCoinUsage = 8,
1180 InvalidValueUsage = 9,
1185 InvalidObjectByValue = 10,
1187 InvalidObjectByMutRef = 11,
1189 ConsensusObjectOperationNotAllowed = 12,
1192 InvalidArgumentArity = 13,
1195 InvalidTransferObject = 14,
1197 InvalidMakeMoveVecNonObjectArgument = 15,
1200 ArgumentWithoutValue = 16,
1202 CannotMoveBorrowedValue = 17,
1207 CannotWriteToExtendedReference = 18,
1211 InvalidReferenceArgument = 19,
1215 }
1216 impl CommandArgumentErrorKind {
1217 pub fn as_str_name(&self) -> &'static str {
1222 match self {
1223 Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1224 Self::TypeMismatch => "TYPE_MISMATCH",
1225 Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1226 Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1227 Self::InvalidArgumentToPrivateEntryFunction => {
1228 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1229 }
1230 Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1231 Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1232 Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1233 Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1234 Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1235 Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1236 Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1237 Self::ConsensusObjectOperationNotAllowed => {
1238 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1239 }
1240 Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1241 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1242 Self::InvalidMakeMoveVecNonObjectArgument => {
1243 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1244 }
1245 Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1246 Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1247 Self::CannotWriteToExtendedReference => {
1248 "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1249 }
1250 Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1251 }
1252 }
1253 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1255 match value {
1256 "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1257 "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1258 "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1259 "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1260 Some(Self::InvalidUsageOfPureArgument)
1261 }
1262 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1263 Some(Self::InvalidArgumentToPrivateEntryFunction)
1264 }
1265 "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1266 "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1267 "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1268 "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1269 "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1270 "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1271 "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1272 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1273 Some(Self::ConsensusObjectOperationNotAllowed)
1274 }
1275 "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1276 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1277 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1278 Some(Self::InvalidMakeMoveVecNonObjectArgument)
1279 }
1280 "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1281 "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1282 "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1283 Some(Self::CannotWriteToExtendedReference)
1284 }
1285 "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1286 _ => None,
1287 }
1288 }
1289 }
1290}
1291#[non_exhaustive]
1293#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1294pub struct PackageUpgradeError {
1295 #[prost(
1296 enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1297 optional,
1298 tag = "1"
1299 )]
1300 pub kind: ::core::option::Option<i32>,
1301 #[prost(string, optional, tag = "2")]
1303 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1304 #[prost(string, optional, tag = "3")]
1306 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1307 #[prost(uint32, optional, tag = "4")]
1309 pub policy: ::core::option::Option<u32>,
1310 #[prost(string, optional, tag = "5")]
1312 pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1313}
1314pub mod package_upgrade_error {
1316 #[non_exhaustive]
1317 #[derive(
1318 Clone,
1319 Copy,
1320 Debug,
1321 PartialEq,
1322 Eq,
1323 Hash,
1324 PartialOrd,
1325 Ord,
1326 ::prost::Enumeration
1327 )]
1328 #[repr(i32)]
1329 pub enum PackageUpgradeErrorKind {
1330 Unknown = 0,
1331 UnableToFetchPackage = 1,
1333 NotAPackage = 2,
1335 IncompatibleUpgrade = 3,
1337 DigestDoesNotMatch = 4,
1339 UnknownUpgradePolicy = 5,
1341 PackageIdDoesNotMatch = 6,
1343 }
1344 impl PackageUpgradeErrorKind {
1345 pub fn as_str_name(&self) -> &'static str {
1350 match self {
1351 Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1352 Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1353 Self::NotAPackage => "NOT_A_PACKAGE",
1354 Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1355 Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1356 Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1357 Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1358 }
1359 }
1360 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1362 match value {
1363 "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1364 "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1365 "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1366 "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1367 "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1368 "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1369 "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1370 _ => None,
1371 }
1372 }
1373 }
1374}
1375#[non_exhaustive]
1377#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1378pub struct TypeArgumentError {
1379 #[prost(uint32, optional, tag = "1")]
1381 pub type_argument: ::core::option::Option<u32>,
1382 #[prost(
1383 enumeration = "type_argument_error::TypeArgumentErrorKind",
1384 optional,
1385 tag = "2"
1386 )]
1387 pub kind: ::core::option::Option<i32>,
1388}
1389pub mod type_argument_error {
1391 #[non_exhaustive]
1392 #[derive(
1393 Clone,
1394 Copy,
1395 Debug,
1396 PartialEq,
1397 Eq,
1398 Hash,
1399 PartialOrd,
1400 Ord,
1401 ::prost::Enumeration
1402 )]
1403 #[repr(i32)]
1404 pub enum TypeArgumentErrorKind {
1405 Unknown = 0,
1406 TypeNotFound = 1,
1408 ConstraintNotSatisfied = 2,
1410 }
1411 impl TypeArgumentErrorKind {
1412 pub fn as_str_name(&self) -> &'static str {
1417 match self {
1418 Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1419 Self::TypeNotFound => "TYPE_NOT_FOUND",
1420 Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1421 }
1422 }
1423 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1425 match value {
1426 "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1427 "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1428 "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1429 _ => None,
1430 }
1431 }
1432 }
1433}
1434#[non_exhaustive]
1436#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1437pub struct GasCostSummary {
1438 #[prost(uint64, optional, tag = "1")]
1440 pub computation_cost: ::core::option::Option<u64>,
1441 #[prost(uint64, optional, tag = "2")]
1443 pub storage_cost: ::core::option::Option<u64>,
1444 #[prost(uint64, optional, tag = "3")]
1447 pub storage_rebate: ::core::option::Option<u64>,
1448 #[prost(uint64, optional, tag = "4")]
1450 pub non_refundable_storage_fee: ::core::option::Option<u64>,
1451}
1452#[non_exhaustive]
1454#[derive(Clone, PartialEq, ::prost::Message)]
1455pub struct Input {
1456 #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1457 pub kind: ::core::option::Option<i32>,
1458 #[prost(bytes = "bytes", optional, tag = "2")]
1463 pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1464 #[prost(string, optional, tag = "3")]
1466 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1467 #[prost(uint64, optional, tag = "4")]
1471 pub version: ::core::option::Option<u64>,
1472 #[prost(string, optional, tag = "5")]
1474 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1475 #[prost(bool, optional, tag = "6")]
1478 pub mutable: ::core::option::Option<bool>,
1479 #[prost(message, optional, boxed, tag = "1000")]
1483 pub literal: ::core::option::Option<
1484 ::prost::alloc::boxed::Box<::prost_types::Value>,
1485 >,
1486}
1487pub mod input {
1489 #[non_exhaustive]
1490 #[derive(
1491 Clone,
1492 Copy,
1493 Debug,
1494 PartialEq,
1495 Eq,
1496 Hash,
1497 PartialOrd,
1498 Ord,
1499 ::prost::Enumeration
1500 )]
1501 #[repr(i32)]
1502 pub enum InputKind {
1503 Unknown = 0,
1504 Pure = 1,
1506 ImmutableOrOwned = 2,
1508 Shared = 3,
1510 Receiving = 4,
1512 }
1513 impl InputKind {
1514 pub fn as_str_name(&self) -> &'static str {
1519 match self {
1520 Self::Unknown => "INPUT_KIND_UNKNOWN",
1521 Self::Pure => "PURE",
1522 Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
1523 Self::Shared => "SHARED",
1524 Self::Receiving => "RECEIVING",
1525 }
1526 }
1527 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1529 match value {
1530 "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
1531 "PURE" => Some(Self::Pure),
1532 "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
1533 "SHARED" => Some(Self::Shared),
1534 "RECEIVING" => Some(Self::Receiving),
1535 _ => None,
1536 }
1537 }
1538 }
1539}
1540#[non_exhaustive]
1542#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1543pub struct JwkId {
1544 #[prost(string, optional, tag = "1")]
1546 pub iss: ::core::option::Option<::prost::alloc::string::String>,
1547 #[prost(string, optional, tag = "2")]
1549 pub kid: ::core::option::Option<::prost::alloc::string::String>,
1550}
1551#[non_exhaustive]
1557#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1558pub struct Jwk {
1559 #[prost(string, optional, tag = "1")]
1561 pub kty: ::core::option::Option<::prost::alloc::string::String>,
1562 #[prost(string, optional, tag = "2")]
1564 pub e: ::core::option::Option<::prost::alloc::string::String>,
1565 #[prost(string, optional, tag = "3")]
1567 pub n: ::core::option::Option<::prost::alloc::string::String>,
1568 #[prost(string, optional, tag = "4")]
1570 pub alg: ::core::option::Option<::prost::alloc::string::String>,
1571}
1572#[non_exhaustive]
1573#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1574pub struct GetServiceInfoRequest {}
1575#[non_exhaustive]
1576#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1577pub struct GetServiceInfoResponse {
1578 #[prost(string, optional, tag = "1")]
1583 pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
1584 #[prost(string, optional, tag = "2")]
1588 pub chain: ::core::option::Option<::prost::alloc::string::String>,
1589 #[prost(uint64, optional, tag = "3")]
1591 pub epoch: ::core::option::Option<u64>,
1592 #[prost(uint64, optional, tag = "4")]
1594 pub checkpoint_height: ::core::option::Option<u64>,
1595 #[prost(message, optional, tag = "5")]
1597 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
1598 #[prost(uint64, optional, tag = "6")]
1600 pub lowest_available_checkpoint: ::core::option::Option<u64>,
1601 #[prost(uint64, optional, tag = "7")]
1603 pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
1604 #[prost(string, optional, tag = "8")]
1606 pub server: ::core::option::Option<::prost::alloc::string::String>,
1607}
1608#[non_exhaustive]
1609#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1610pub struct GetObjectRequest {
1611 #[prost(string, optional, tag = "1")]
1613 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1614 #[prost(uint64, optional, tag = "2")]
1618 pub version: ::core::option::Option<u64>,
1619 #[prost(message, optional, tag = "3")]
1622 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1623}
1624#[non_exhaustive]
1625#[derive(Clone, PartialEq, ::prost::Message)]
1626pub struct GetObjectResponse {
1627 #[prost(message, optional, tag = "1")]
1628 pub object: ::core::option::Option<Object>,
1629}
1630#[non_exhaustive]
1631#[derive(Clone, PartialEq, ::prost::Message)]
1632pub struct BatchGetObjectsRequest {
1633 #[prost(message, repeated, tag = "1")]
1634 pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
1635 #[prost(message, optional, tag = "2")]
1638 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1639}
1640#[non_exhaustive]
1641#[derive(Clone, PartialEq, ::prost::Message)]
1642pub struct BatchGetObjectsResponse {
1643 #[prost(message, repeated, tag = "1")]
1644 pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
1645}
1646#[non_exhaustive]
1647#[derive(Clone, PartialEq, ::prost::Message)]
1648pub struct GetObjectResult {
1649 #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
1650 pub result: ::core::option::Option<get_object_result::Result>,
1651}
1652pub mod get_object_result {
1654 #[non_exhaustive]
1655 #[derive(Clone, PartialEq, ::prost::Oneof)]
1656 pub enum Result {
1657 #[prost(message, tag = "1")]
1658 Object(super::Object),
1659 #[prost(message, tag = "2")]
1660 Error(super::super::super::super::google::rpc::Status),
1661 }
1662}
1663#[non_exhaustive]
1664#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1665pub struct GetTransactionRequest {
1666 #[prost(string, optional, tag = "1")]
1668 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1669 #[prost(message, optional, tag = "2")]
1672 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1673}
1674#[non_exhaustive]
1675#[derive(Clone, PartialEq, ::prost::Message)]
1676pub struct GetTransactionResponse {
1677 #[prost(message, optional, tag = "1")]
1678 pub transaction: ::core::option::Option<ExecutedTransaction>,
1679}
1680#[non_exhaustive]
1681#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1682pub struct BatchGetTransactionsRequest {
1683 #[prost(string, repeated, tag = "1")]
1685 pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1686 #[prost(message, optional, tag = "2")]
1689 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1690}
1691#[non_exhaustive]
1692#[derive(Clone, PartialEq, ::prost::Message)]
1693pub struct BatchGetTransactionsResponse {
1694 #[prost(message, repeated, tag = "1")]
1695 pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
1696}
1697#[non_exhaustive]
1698#[derive(Clone, PartialEq, ::prost::Message)]
1699pub struct GetTransactionResult {
1700 #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
1701 pub result: ::core::option::Option<get_transaction_result::Result>,
1702}
1703pub mod get_transaction_result {
1705 #[non_exhaustive]
1706 #[derive(Clone, PartialEq, ::prost::Oneof)]
1707 pub enum Result {
1708 #[prost(message, tag = "1")]
1709 Transaction(super::ExecutedTransaction),
1710 #[prost(message, tag = "2")]
1711 Error(super::super::super::super::google::rpc::Status),
1712 }
1713}
1714#[non_exhaustive]
1715#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1716pub struct GetCheckpointRequest {
1717 #[prost(message, optional, tag = "3")]
1720 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1721 #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
1723 pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
1724}
1725pub mod get_checkpoint_request {
1727 #[non_exhaustive]
1729 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1730 pub enum CheckpointId {
1731 #[prost(uint64, tag = "1")]
1733 SequenceNumber(u64),
1734 #[prost(string, tag = "2")]
1736 Digest(::prost::alloc::string::String),
1737 }
1738}
1739#[non_exhaustive]
1740#[derive(Clone, PartialEq, ::prost::Message)]
1741pub struct GetCheckpointResponse {
1742 #[prost(message, optional, tag = "1")]
1743 pub checkpoint: ::core::option::Option<Checkpoint>,
1744}
1745#[non_exhaustive]
1746#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1747pub struct GetEpochRequest {
1748 #[prost(uint64, optional, tag = "1")]
1751 pub epoch: ::core::option::Option<u64>,
1752 #[prost(message, optional, tag = "2")]
1755 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1756}
1757#[non_exhaustive]
1758#[derive(Clone, PartialEq, ::prost::Message)]
1759pub struct GetEpochResponse {
1760 #[prost(message, optional, tag = "1")]
1761 pub epoch: ::core::option::Option<Epoch>,
1762}
1763pub mod ledger_service_client {
1765 #![allow(
1766 unused_variables,
1767 dead_code,
1768 missing_docs,
1769 clippy::wildcard_imports,
1770 clippy::let_unit_value,
1771 )]
1772 use tonic::codegen::*;
1773 use tonic::codegen::http::Uri;
1774 #[derive(Debug, Clone)]
1775 pub struct LedgerServiceClient<T> {
1776 inner: tonic::client::Grpc<T>,
1777 }
1778 impl LedgerServiceClient<tonic::transport::Channel> {
1779 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1781 where
1782 D: TryInto<tonic::transport::Endpoint>,
1783 D::Error: Into<StdError>,
1784 {
1785 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1786 Ok(Self::new(conn))
1787 }
1788 }
1789 impl<T> LedgerServiceClient<T>
1790 where
1791 T: tonic::client::GrpcService<tonic::body::Body>,
1792 T::Error: Into<StdError>,
1793 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1794 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1795 {
1796 pub fn new(inner: T) -> Self {
1797 let inner = tonic::client::Grpc::new(inner);
1798 Self { inner }
1799 }
1800 pub fn with_origin(inner: T, origin: Uri) -> Self {
1801 let inner = tonic::client::Grpc::with_origin(inner, origin);
1802 Self { inner }
1803 }
1804 pub fn with_interceptor<F>(
1805 inner: T,
1806 interceptor: F,
1807 ) -> LedgerServiceClient<InterceptedService<T, F>>
1808 where
1809 F: tonic::service::Interceptor,
1810 T::ResponseBody: Default,
1811 T: tonic::codegen::Service<
1812 http::Request<tonic::body::Body>,
1813 Response = http::Response<
1814 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1815 >,
1816 >,
1817 <T as tonic::codegen::Service<
1818 http::Request<tonic::body::Body>,
1819 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1820 {
1821 LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
1822 }
1823 #[must_use]
1828 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1829 self.inner = self.inner.send_compressed(encoding);
1830 self
1831 }
1832 #[must_use]
1834 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1835 self.inner = self.inner.accept_compressed(encoding);
1836 self
1837 }
1838 #[must_use]
1842 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1843 self.inner = self.inner.max_decoding_message_size(limit);
1844 self
1845 }
1846 #[must_use]
1850 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1851 self.inner = self.inner.max_encoding_message_size(limit);
1852 self
1853 }
1854 pub async fn get_service_info(
1856 &mut self,
1857 request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
1858 ) -> std::result::Result<
1859 tonic::Response<super::GetServiceInfoResponse>,
1860 tonic::Status,
1861 > {
1862 self.inner
1863 .ready()
1864 .await
1865 .map_err(|e| {
1866 tonic::Status::unknown(
1867 format!("Service was not ready: {}", e.into()),
1868 )
1869 })?;
1870 let codec = tonic_prost::ProstCodec::default();
1871 let path = http::uri::PathAndQuery::from_static(
1872 "/sui.rpc.v2.LedgerService/GetServiceInfo",
1873 );
1874 let mut req = request.into_request();
1875 req.extensions_mut()
1876 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
1877 self.inner.unary(req, path, codec).await
1878 }
1879 pub async fn get_object(
1880 &mut self,
1881 request: impl tonic::IntoRequest<super::GetObjectRequest>,
1882 ) -> std::result::Result<
1883 tonic::Response<super::GetObjectResponse>,
1884 tonic::Status,
1885 > {
1886 self.inner
1887 .ready()
1888 .await
1889 .map_err(|e| {
1890 tonic::Status::unknown(
1891 format!("Service was not ready: {}", e.into()),
1892 )
1893 })?;
1894 let codec = tonic_prost::ProstCodec::default();
1895 let path = http::uri::PathAndQuery::from_static(
1896 "/sui.rpc.v2.LedgerService/GetObject",
1897 );
1898 let mut req = request.into_request();
1899 req.extensions_mut()
1900 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
1901 self.inner.unary(req, path, codec).await
1902 }
1903 pub async fn batch_get_objects(
1904 &mut self,
1905 request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
1906 ) -> std::result::Result<
1907 tonic::Response<super::BatchGetObjectsResponse>,
1908 tonic::Status,
1909 > {
1910 self.inner
1911 .ready()
1912 .await
1913 .map_err(|e| {
1914 tonic::Status::unknown(
1915 format!("Service was not ready: {}", e.into()),
1916 )
1917 })?;
1918 let codec = tonic_prost::ProstCodec::default();
1919 let path = http::uri::PathAndQuery::from_static(
1920 "/sui.rpc.v2.LedgerService/BatchGetObjects",
1921 );
1922 let mut req = request.into_request();
1923 req.extensions_mut()
1924 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
1925 self.inner.unary(req, path, codec).await
1926 }
1927 pub async fn get_transaction(
1928 &mut self,
1929 request: impl tonic::IntoRequest<super::GetTransactionRequest>,
1930 ) -> std::result::Result<
1931 tonic::Response<super::GetTransactionResponse>,
1932 tonic::Status,
1933 > {
1934 self.inner
1935 .ready()
1936 .await
1937 .map_err(|e| {
1938 tonic::Status::unknown(
1939 format!("Service was not ready: {}", e.into()),
1940 )
1941 })?;
1942 let codec = tonic_prost::ProstCodec::default();
1943 let path = http::uri::PathAndQuery::from_static(
1944 "/sui.rpc.v2.LedgerService/GetTransaction",
1945 );
1946 let mut req = request.into_request();
1947 req.extensions_mut()
1948 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
1949 self.inner.unary(req, path, codec).await
1950 }
1951 pub async fn batch_get_transactions(
1952 &mut self,
1953 request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
1954 ) -> std::result::Result<
1955 tonic::Response<super::BatchGetTransactionsResponse>,
1956 tonic::Status,
1957 > {
1958 self.inner
1959 .ready()
1960 .await
1961 .map_err(|e| {
1962 tonic::Status::unknown(
1963 format!("Service was not ready: {}", e.into()),
1964 )
1965 })?;
1966 let codec = tonic_prost::ProstCodec::default();
1967 let path = http::uri::PathAndQuery::from_static(
1968 "/sui.rpc.v2.LedgerService/BatchGetTransactions",
1969 );
1970 let mut req = request.into_request();
1971 req.extensions_mut()
1972 .insert(
1973 GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
1974 );
1975 self.inner.unary(req, path, codec).await
1976 }
1977 pub async fn get_checkpoint(
1978 &mut self,
1979 request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
1980 ) -> std::result::Result<
1981 tonic::Response<super::GetCheckpointResponse>,
1982 tonic::Status,
1983 > {
1984 self.inner
1985 .ready()
1986 .await
1987 .map_err(|e| {
1988 tonic::Status::unknown(
1989 format!("Service was not ready: {}", e.into()),
1990 )
1991 })?;
1992 let codec = tonic_prost::ProstCodec::default();
1993 let path = http::uri::PathAndQuery::from_static(
1994 "/sui.rpc.v2.LedgerService/GetCheckpoint",
1995 );
1996 let mut req = request.into_request();
1997 req.extensions_mut()
1998 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
1999 self.inner.unary(req, path, codec).await
2000 }
2001 pub async fn get_epoch(
2002 &mut self,
2003 request: impl tonic::IntoRequest<super::GetEpochRequest>,
2004 ) -> std::result::Result<
2005 tonic::Response<super::GetEpochResponse>,
2006 tonic::Status,
2007 > {
2008 self.inner
2009 .ready()
2010 .await
2011 .map_err(|e| {
2012 tonic::Status::unknown(
2013 format!("Service was not ready: {}", e.into()),
2014 )
2015 })?;
2016 let codec = tonic_prost::ProstCodec::default();
2017 let path = http::uri::PathAndQuery::from_static(
2018 "/sui.rpc.v2.LedgerService/GetEpoch",
2019 );
2020 let mut req = request.into_request();
2021 req.extensions_mut()
2022 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
2023 self.inner.unary(req, path, codec).await
2024 }
2025 }
2026}
2027pub mod ledger_service_server {
2029 #![allow(
2030 unused_variables,
2031 dead_code,
2032 missing_docs,
2033 clippy::wildcard_imports,
2034 clippy::let_unit_value,
2035 )]
2036 use tonic::codegen::*;
2037 #[async_trait]
2039 pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2040 async fn get_service_info(
2042 &self,
2043 request: tonic::Request<super::GetServiceInfoRequest>,
2044 ) -> std::result::Result<
2045 tonic::Response<super::GetServiceInfoResponse>,
2046 tonic::Status,
2047 >;
2048 async fn get_object(
2049 &self,
2050 request: tonic::Request<super::GetObjectRequest>,
2051 ) -> std::result::Result<
2052 tonic::Response<super::GetObjectResponse>,
2053 tonic::Status,
2054 >;
2055 async fn batch_get_objects(
2056 &self,
2057 request: tonic::Request<super::BatchGetObjectsRequest>,
2058 ) -> std::result::Result<
2059 tonic::Response<super::BatchGetObjectsResponse>,
2060 tonic::Status,
2061 >;
2062 async fn get_transaction(
2063 &self,
2064 request: tonic::Request<super::GetTransactionRequest>,
2065 ) -> std::result::Result<
2066 tonic::Response<super::GetTransactionResponse>,
2067 tonic::Status,
2068 >;
2069 async fn batch_get_transactions(
2070 &self,
2071 request: tonic::Request<super::BatchGetTransactionsRequest>,
2072 ) -> std::result::Result<
2073 tonic::Response<super::BatchGetTransactionsResponse>,
2074 tonic::Status,
2075 >;
2076 async fn get_checkpoint(
2077 &self,
2078 request: tonic::Request<super::GetCheckpointRequest>,
2079 ) -> std::result::Result<
2080 tonic::Response<super::GetCheckpointResponse>,
2081 tonic::Status,
2082 >;
2083 async fn get_epoch(
2084 &self,
2085 request: tonic::Request<super::GetEpochRequest>,
2086 ) -> std::result::Result<
2087 tonic::Response<super::GetEpochResponse>,
2088 tonic::Status,
2089 >;
2090 }
2091 #[derive(Debug)]
2092 pub struct LedgerServiceServer<T> {
2093 inner: Arc<T>,
2094 accept_compression_encodings: EnabledCompressionEncodings,
2095 send_compression_encodings: EnabledCompressionEncodings,
2096 max_decoding_message_size: Option<usize>,
2097 max_encoding_message_size: Option<usize>,
2098 }
2099 impl<T> LedgerServiceServer<T> {
2100 pub fn new(inner: T) -> Self {
2101 Self::from_arc(Arc::new(inner))
2102 }
2103 pub fn from_arc(inner: Arc<T>) -> Self {
2104 Self {
2105 inner,
2106 accept_compression_encodings: Default::default(),
2107 send_compression_encodings: Default::default(),
2108 max_decoding_message_size: None,
2109 max_encoding_message_size: None,
2110 }
2111 }
2112 pub fn with_interceptor<F>(
2113 inner: T,
2114 interceptor: F,
2115 ) -> InterceptedService<Self, F>
2116 where
2117 F: tonic::service::Interceptor,
2118 {
2119 InterceptedService::new(Self::new(inner), interceptor)
2120 }
2121 #[must_use]
2123 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2124 self.accept_compression_encodings.enable(encoding);
2125 self
2126 }
2127 #[must_use]
2129 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2130 self.send_compression_encodings.enable(encoding);
2131 self
2132 }
2133 #[must_use]
2137 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2138 self.max_decoding_message_size = Some(limit);
2139 self
2140 }
2141 #[must_use]
2145 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2146 self.max_encoding_message_size = Some(limit);
2147 self
2148 }
2149 }
2150 impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
2151 where
2152 T: LedgerService,
2153 B: Body + std::marker::Send + 'static,
2154 B::Error: Into<StdError> + std::marker::Send + 'static,
2155 {
2156 type Response = http::Response<tonic::body::Body>;
2157 type Error = std::convert::Infallible;
2158 type Future = BoxFuture<Self::Response, Self::Error>;
2159 fn poll_ready(
2160 &mut self,
2161 _cx: &mut Context<'_>,
2162 ) -> Poll<std::result::Result<(), Self::Error>> {
2163 Poll::Ready(Ok(()))
2164 }
2165 fn call(&mut self, req: http::Request<B>) -> Self::Future {
2166 match req.uri().path() {
2167 "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
2168 #[allow(non_camel_case_types)]
2169 struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
2170 impl<
2171 T: LedgerService,
2172 > tonic::server::UnaryService<super::GetServiceInfoRequest>
2173 for GetServiceInfoSvc<T> {
2174 type Response = super::GetServiceInfoResponse;
2175 type Future = BoxFuture<
2176 tonic::Response<Self::Response>,
2177 tonic::Status,
2178 >;
2179 fn call(
2180 &mut self,
2181 request: tonic::Request<super::GetServiceInfoRequest>,
2182 ) -> Self::Future {
2183 let inner = Arc::clone(&self.0);
2184 let fut = async move {
2185 <T as LedgerService>::get_service_info(&inner, request)
2186 .await
2187 };
2188 Box::pin(fut)
2189 }
2190 }
2191 let accept_compression_encodings = self.accept_compression_encodings;
2192 let send_compression_encodings = self.send_compression_encodings;
2193 let max_decoding_message_size = self.max_decoding_message_size;
2194 let max_encoding_message_size = self.max_encoding_message_size;
2195 let inner = self.inner.clone();
2196 let fut = async move {
2197 let method = GetServiceInfoSvc(inner);
2198 let codec = tonic_prost::ProstCodec::default();
2199 let mut grpc = tonic::server::Grpc::new(codec)
2200 .apply_compression_config(
2201 accept_compression_encodings,
2202 send_compression_encodings,
2203 )
2204 .apply_max_message_size_config(
2205 max_decoding_message_size,
2206 max_encoding_message_size,
2207 );
2208 let res = grpc.unary(method, req).await;
2209 Ok(res)
2210 };
2211 Box::pin(fut)
2212 }
2213 "/sui.rpc.v2.LedgerService/GetObject" => {
2214 #[allow(non_camel_case_types)]
2215 struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
2216 impl<
2217 T: LedgerService,
2218 > tonic::server::UnaryService<super::GetObjectRequest>
2219 for GetObjectSvc<T> {
2220 type Response = super::GetObjectResponse;
2221 type Future = BoxFuture<
2222 tonic::Response<Self::Response>,
2223 tonic::Status,
2224 >;
2225 fn call(
2226 &mut self,
2227 request: tonic::Request<super::GetObjectRequest>,
2228 ) -> Self::Future {
2229 let inner = Arc::clone(&self.0);
2230 let fut = async move {
2231 <T as LedgerService>::get_object(&inner, request).await
2232 };
2233 Box::pin(fut)
2234 }
2235 }
2236 let accept_compression_encodings = self.accept_compression_encodings;
2237 let send_compression_encodings = self.send_compression_encodings;
2238 let max_decoding_message_size = self.max_decoding_message_size;
2239 let max_encoding_message_size = self.max_encoding_message_size;
2240 let inner = self.inner.clone();
2241 let fut = async move {
2242 let method = GetObjectSvc(inner);
2243 let codec = tonic_prost::ProstCodec::default();
2244 let mut grpc = tonic::server::Grpc::new(codec)
2245 .apply_compression_config(
2246 accept_compression_encodings,
2247 send_compression_encodings,
2248 )
2249 .apply_max_message_size_config(
2250 max_decoding_message_size,
2251 max_encoding_message_size,
2252 );
2253 let res = grpc.unary(method, req).await;
2254 Ok(res)
2255 };
2256 Box::pin(fut)
2257 }
2258 "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
2259 #[allow(non_camel_case_types)]
2260 struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
2261 impl<
2262 T: LedgerService,
2263 > tonic::server::UnaryService<super::BatchGetObjectsRequest>
2264 for BatchGetObjectsSvc<T> {
2265 type Response = super::BatchGetObjectsResponse;
2266 type Future = BoxFuture<
2267 tonic::Response<Self::Response>,
2268 tonic::Status,
2269 >;
2270 fn call(
2271 &mut self,
2272 request: tonic::Request<super::BatchGetObjectsRequest>,
2273 ) -> Self::Future {
2274 let inner = Arc::clone(&self.0);
2275 let fut = async move {
2276 <T as LedgerService>::batch_get_objects(&inner, request)
2277 .await
2278 };
2279 Box::pin(fut)
2280 }
2281 }
2282 let accept_compression_encodings = self.accept_compression_encodings;
2283 let send_compression_encodings = self.send_compression_encodings;
2284 let max_decoding_message_size = self.max_decoding_message_size;
2285 let max_encoding_message_size = self.max_encoding_message_size;
2286 let inner = self.inner.clone();
2287 let fut = async move {
2288 let method = BatchGetObjectsSvc(inner);
2289 let codec = tonic_prost::ProstCodec::default();
2290 let mut grpc = tonic::server::Grpc::new(codec)
2291 .apply_compression_config(
2292 accept_compression_encodings,
2293 send_compression_encodings,
2294 )
2295 .apply_max_message_size_config(
2296 max_decoding_message_size,
2297 max_encoding_message_size,
2298 );
2299 let res = grpc.unary(method, req).await;
2300 Ok(res)
2301 };
2302 Box::pin(fut)
2303 }
2304 "/sui.rpc.v2.LedgerService/GetTransaction" => {
2305 #[allow(non_camel_case_types)]
2306 struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
2307 impl<
2308 T: LedgerService,
2309 > tonic::server::UnaryService<super::GetTransactionRequest>
2310 for GetTransactionSvc<T> {
2311 type Response = super::GetTransactionResponse;
2312 type Future = BoxFuture<
2313 tonic::Response<Self::Response>,
2314 tonic::Status,
2315 >;
2316 fn call(
2317 &mut self,
2318 request: tonic::Request<super::GetTransactionRequest>,
2319 ) -> Self::Future {
2320 let inner = Arc::clone(&self.0);
2321 let fut = async move {
2322 <T as LedgerService>::get_transaction(&inner, request).await
2323 };
2324 Box::pin(fut)
2325 }
2326 }
2327 let accept_compression_encodings = self.accept_compression_encodings;
2328 let send_compression_encodings = self.send_compression_encodings;
2329 let max_decoding_message_size = self.max_decoding_message_size;
2330 let max_encoding_message_size = self.max_encoding_message_size;
2331 let inner = self.inner.clone();
2332 let fut = async move {
2333 let method = GetTransactionSvc(inner);
2334 let codec = tonic_prost::ProstCodec::default();
2335 let mut grpc = tonic::server::Grpc::new(codec)
2336 .apply_compression_config(
2337 accept_compression_encodings,
2338 send_compression_encodings,
2339 )
2340 .apply_max_message_size_config(
2341 max_decoding_message_size,
2342 max_encoding_message_size,
2343 );
2344 let res = grpc.unary(method, req).await;
2345 Ok(res)
2346 };
2347 Box::pin(fut)
2348 }
2349 "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
2350 #[allow(non_camel_case_types)]
2351 struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
2352 impl<
2353 T: LedgerService,
2354 > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
2355 for BatchGetTransactionsSvc<T> {
2356 type Response = super::BatchGetTransactionsResponse;
2357 type Future = BoxFuture<
2358 tonic::Response<Self::Response>,
2359 tonic::Status,
2360 >;
2361 fn call(
2362 &mut self,
2363 request: tonic::Request<super::BatchGetTransactionsRequest>,
2364 ) -> Self::Future {
2365 let inner = Arc::clone(&self.0);
2366 let fut = async move {
2367 <T as LedgerService>::batch_get_transactions(
2368 &inner,
2369 request,
2370 )
2371 .await
2372 };
2373 Box::pin(fut)
2374 }
2375 }
2376 let accept_compression_encodings = self.accept_compression_encodings;
2377 let send_compression_encodings = self.send_compression_encodings;
2378 let max_decoding_message_size = self.max_decoding_message_size;
2379 let max_encoding_message_size = self.max_encoding_message_size;
2380 let inner = self.inner.clone();
2381 let fut = async move {
2382 let method = BatchGetTransactionsSvc(inner);
2383 let codec = tonic_prost::ProstCodec::default();
2384 let mut grpc = tonic::server::Grpc::new(codec)
2385 .apply_compression_config(
2386 accept_compression_encodings,
2387 send_compression_encodings,
2388 )
2389 .apply_max_message_size_config(
2390 max_decoding_message_size,
2391 max_encoding_message_size,
2392 );
2393 let res = grpc.unary(method, req).await;
2394 Ok(res)
2395 };
2396 Box::pin(fut)
2397 }
2398 "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
2399 #[allow(non_camel_case_types)]
2400 struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
2401 impl<
2402 T: LedgerService,
2403 > tonic::server::UnaryService<super::GetCheckpointRequest>
2404 for GetCheckpointSvc<T> {
2405 type Response = super::GetCheckpointResponse;
2406 type Future = BoxFuture<
2407 tonic::Response<Self::Response>,
2408 tonic::Status,
2409 >;
2410 fn call(
2411 &mut self,
2412 request: tonic::Request<super::GetCheckpointRequest>,
2413 ) -> Self::Future {
2414 let inner = Arc::clone(&self.0);
2415 let fut = async move {
2416 <T as LedgerService>::get_checkpoint(&inner, request).await
2417 };
2418 Box::pin(fut)
2419 }
2420 }
2421 let accept_compression_encodings = self.accept_compression_encodings;
2422 let send_compression_encodings = self.send_compression_encodings;
2423 let max_decoding_message_size = self.max_decoding_message_size;
2424 let max_encoding_message_size = self.max_encoding_message_size;
2425 let inner = self.inner.clone();
2426 let fut = async move {
2427 let method = GetCheckpointSvc(inner);
2428 let codec = tonic_prost::ProstCodec::default();
2429 let mut grpc = tonic::server::Grpc::new(codec)
2430 .apply_compression_config(
2431 accept_compression_encodings,
2432 send_compression_encodings,
2433 )
2434 .apply_max_message_size_config(
2435 max_decoding_message_size,
2436 max_encoding_message_size,
2437 );
2438 let res = grpc.unary(method, req).await;
2439 Ok(res)
2440 };
2441 Box::pin(fut)
2442 }
2443 "/sui.rpc.v2.LedgerService/GetEpoch" => {
2444 #[allow(non_camel_case_types)]
2445 struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
2446 impl<
2447 T: LedgerService,
2448 > tonic::server::UnaryService<super::GetEpochRequest>
2449 for GetEpochSvc<T> {
2450 type Response = super::GetEpochResponse;
2451 type Future = BoxFuture<
2452 tonic::Response<Self::Response>,
2453 tonic::Status,
2454 >;
2455 fn call(
2456 &mut self,
2457 request: tonic::Request<super::GetEpochRequest>,
2458 ) -> Self::Future {
2459 let inner = Arc::clone(&self.0);
2460 let fut = async move {
2461 <T as LedgerService>::get_epoch(&inner, request).await
2462 };
2463 Box::pin(fut)
2464 }
2465 }
2466 let accept_compression_encodings = self.accept_compression_encodings;
2467 let send_compression_encodings = self.send_compression_encodings;
2468 let max_decoding_message_size = self.max_decoding_message_size;
2469 let max_encoding_message_size = self.max_encoding_message_size;
2470 let inner = self.inner.clone();
2471 let fut = async move {
2472 let method = GetEpochSvc(inner);
2473 let codec = tonic_prost::ProstCodec::default();
2474 let mut grpc = tonic::server::Grpc::new(codec)
2475 .apply_compression_config(
2476 accept_compression_encodings,
2477 send_compression_encodings,
2478 )
2479 .apply_max_message_size_config(
2480 max_decoding_message_size,
2481 max_encoding_message_size,
2482 );
2483 let res = grpc.unary(method, req).await;
2484 Ok(res)
2485 };
2486 Box::pin(fut)
2487 }
2488 _ => {
2489 Box::pin(async move {
2490 let mut response = http::Response::new(
2491 tonic::body::Body::default(),
2492 );
2493 let headers = response.headers_mut();
2494 headers
2495 .insert(
2496 tonic::Status::GRPC_STATUS,
2497 (tonic::Code::Unimplemented as i32).into(),
2498 );
2499 headers
2500 .insert(
2501 http::header::CONTENT_TYPE,
2502 tonic::metadata::GRPC_CONTENT_TYPE,
2503 );
2504 Ok(response)
2505 })
2506 }
2507 }
2508 }
2509 }
2510 impl<T> Clone for LedgerServiceServer<T> {
2511 fn clone(&self) -> Self {
2512 let inner = self.inner.clone();
2513 Self {
2514 inner,
2515 accept_compression_encodings: self.accept_compression_encodings,
2516 send_compression_encodings: self.send_compression_encodings,
2517 max_decoding_message_size: self.max_decoding_message_size,
2518 max_encoding_message_size: self.max_encoding_message_size,
2519 }
2520 }
2521 }
2522 pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
2524 impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
2525 const NAME: &'static str = SERVICE_NAME;
2526 }
2527}
2528#[non_exhaustive]
2530#[derive(Clone, PartialEq, ::prost::Message)]
2531pub struct Package {
2532 #[prost(string, optional, tag = "1")]
2538 pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
2539 #[prost(string, optional, tag = "2")]
2546 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
2547 #[prost(uint64, optional, tag = "3")]
2549 pub version: ::core::option::Option<u64>,
2550 #[prost(message, repeated, tag = "4")]
2552 pub modules: ::prost::alloc::vec::Vec<Module>,
2553 #[prost(message, repeated, tag = "5")]
2556 pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
2557 #[prost(message, repeated, tag = "6")]
2561 pub linkage: ::prost::alloc::vec::Vec<Linkage>,
2562}
2563#[non_exhaustive]
2565#[derive(Clone, PartialEq, ::prost::Message)]
2566pub struct Module {
2567 #[prost(string, optional, tag = "1")]
2569 pub name: ::core::option::Option<::prost::alloc::string::String>,
2570 #[prost(bytes = "bytes", optional, tag = "2")]
2572 pub contents: ::core::option::Option<::prost::bytes::Bytes>,
2573 #[prost(message, repeated, tag = "3")]
2575 pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
2576 #[prost(message, repeated, tag = "4")]
2578 pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
2579}
2580#[non_exhaustive]
2582#[derive(Clone, PartialEq, ::prost::Message)]
2583pub struct DatatypeDescriptor {
2584 #[prost(string, optional, tag = "1")]
2588 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
2589 #[prost(string, optional, tag = "2")]
2593 pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
2594 #[prost(string, optional, tag = "3")]
2596 pub module: ::core::option::Option<::prost::alloc::string::String>,
2597 #[prost(string, optional, tag = "4")]
2599 pub name: ::core::option::Option<::prost::alloc::string::String>,
2600 #[prost(enumeration = "Ability", repeated, tag = "5")]
2602 pub abilities: ::prost::alloc::vec::Vec<i32>,
2603 #[prost(message, repeated, tag = "6")]
2605 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
2606 #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
2608 pub kind: ::core::option::Option<i32>,
2609 #[prost(message, repeated, tag = "8")]
2613 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
2614 #[prost(message, repeated, tag = "9")]
2618 pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
2619}
2620pub mod datatype_descriptor {
2622 #[non_exhaustive]
2623 #[derive(
2624 Clone,
2625 Copy,
2626 Debug,
2627 PartialEq,
2628 Eq,
2629 Hash,
2630 PartialOrd,
2631 Ord,
2632 ::prost::Enumeration
2633 )]
2634 #[repr(i32)]
2635 pub enum DatatypeKind {
2636 Unknown = 0,
2637 Struct = 1,
2638 Enum = 2,
2639 }
2640 impl DatatypeKind {
2641 pub fn as_str_name(&self) -> &'static str {
2646 match self {
2647 Self::Unknown => "DATATYPE_KIND_UNKNOWN",
2648 Self::Struct => "STRUCT",
2649 Self::Enum => "ENUM",
2650 }
2651 }
2652 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2654 match value {
2655 "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
2656 "STRUCT" => Some(Self::Struct),
2657 "ENUM" => Some(Self::Enum),
2658 _ => None,
2659 }
2660 }
2661 }
2662}
2663#[non_exhaustive]
2665#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2666pub struct TypeParameter {
2667 #[prost(enumeration = "Ability", repeated, tag = "1")]
2669 pub constraints: ::prost::alloc::vec::Vec<i32>,
2670 #[prost(bool, optional, tag = "2")]
2672 pub is_phantom: ::core::option::Option<bool>,
2673}
2674#[non_exhaustive]
2676#[derive(Clone, PartialEq, ::prost::Message)]
2677pub struct FieldDescriptor {
2678 #[prost(string, optional, tag = "1")]
2680 pub name: ::core::option::Option<::prost::alloc::string::String>,
2681 #[prost(uint32, optional, tag = "2")]
2683 pub position: ::core::option::Option<u32>,
2684 #[prost(message, optional, tag = "3")]
2686 pub r#type: ::core::option::Option<OpenSignatureBody>,
2687}
2688#[non_exhaustive]
2690#[derive(Clone, PartialEq, ::prost::Message)]
2691pub struct VariantDescriptor {
2692 #[prost(string, optional, tag = "1")]
2694 pub name: ::core::option::Option<::prost::alloc::string::String>,
2695 #[prost(uint32, optional, tag = "2")]
2697 pub position: ::core::option::Option<u32>,
2698 #[prost(message, repeated, tag = "3")]
2700 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
2701}
2702#[non_exhaustive]
2704#[derive(Clone, PartialEq, ::prost::Message)]
2705pub struct OpenSignatureBody {
2706 #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
2708 pub r#type: ::core::option::Option<i32>,
2709 #[prost(string, optional, tag = "2")]
2711 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
2712 #[prost(message, repeated, tag = "3")]
2714 pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
2715 #[prost(uint32, optional, tag = "4")]
2717 pub type_parameter: ::core::option::Option<u32>,
2718}
2719pub mod open_signature_body {
2721 #[non_exhaustive]
2722 #[derive(
2723 Clone,
2724 Copy,
2725 Debug,
2726 PartialEq,
2727 Eq,
2728 Hash,
2729 PartialOrd,
2730 Ord,
2731 ::prost::Enumeration
2732 )]
2733 #[repr(i32)]
2734 pub enum Type {
2735 Unknown = 0,
2736 Address = 1,
2737 Bool = 2,
2738 U8 = 3,
2739 U16 = 4,
2740 U32 = 5,
2741 U64 = 6,
2742 U128 = 7,
2743 U256 = 8,
2744 Vector = 9,
2745 Datatype = 10,
2746 Parameter = 11,
2747 }
2748 impl Type {
2749 pub fn as_str_name(&self) -> &'static str {
2754 match self {
2755 Self::Unknown => "TYPE_UNKNOWN",
2756 Self::Address => "ADDRESS",
2757 Self::Bool => "BOOL",
2758 Self::U8 => "U8",
2759 Self::U16 => "U16",
2760 Self::U32 => "U32",
2761 Self::U64 => "U64",
2762 Self::U128 => "U128",
2763 Self::U256 => "U256",
2764 Self::Vector => "VECTOR",
2765 Self::Datatype => "DATATYPE",
2766 Self::Parameter => "TYPE_PARAMETER",
2767 }
2768 }
2769 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2771 match value {
2772 "TYPE_UNKNOWN" => Some(Self::Unknown),
2773 "ADDRESS" => Some(Self::Address),
2774 "BOOL" => Some(Self::Bool),
2775 "U8" => Some(Self::U8),
2776 "U16" => Some(Self::U16),
2777 "U32" => Some(Self::U32),
2778 "U64" => Some(Self::U64),
2779 "U128" => Some(Self::U128),
2780 "U256" => Some(Self::U256),
2781 "VECTOR" => Some(Self::Vector),
2782 "DATATYPE" => Some(Self::Datatype),
2783 "TYPE_PARAMETER" => Some(Self::Parameter),
2784 _ => None,
2785 }
2786 }
2787 }
2788}
2789#[non_exhaustive]
2791#[derive(Clone, PartialEq, ::prost::Message)]
2792pub struct FunctionDescriptor {
2793 #[prost(string, optional, tag = "1")]
2795 pub name: ::core::option::Option<::prost::alloc::string::String>,
2796 #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
2798 pub visibility: ::core::option::Option<i32>,
2799 #[prost(bool, optional, tag = "6")]
2801 pub is_entry: ::core::option::Option<bool>,
2802 #[prost(message, repeated, tag = "7")]
2804 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
2805 #[prost(message, repeated, tag = "8")]
2807 pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
2808 #[prost(message, repeated, tag = "9")]
2810 pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
2811}
2812pub mod function_descriptor {
2814 #[non_exhaustive]
2815 #[derive(
2816 Clone,
2817 Copy,
2818 Debug,
2819 PartialEq,
2820 Eq,
2821 Hash,
2822 PartialOrd,
2823 Ord,
2824 ::prost::Enumeration
2825 )]
2826 #[repr(i32)]
2827 pub enum Visibility {
2828 Unknown = 0,
2829 Private = 1,
2830 Public = 2,
2831 Friend = 3,
2832 }
2833 impl Visibility {
2834 pub fn as_str_name(&self) -> &'static str {
2839 match self {
2840 Self::Unknown => "VISIBILITY_UNKNOWN",
2841 Self::Private => "PRIVATE",
2842 Self::Public => "PUBLIC",
2843 Self::Friend => "FRIEND",
2844 }
2845 }
2846 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2848 match value {
2849 "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
2850 "PRIVATE" => Some(Self::Private),
2851 "PUBLIC" => Some(Self::Public),
2852 "FRIEND" => Some(Self::Friend),
2853 _ => None,
2854 }
2855 }
2856 }
2857}
2858#[non_exhaustive]
2860#[derive(Clone, PartialEq, ::prost::Message)]
2861pub struct OpenSignature {
2862 #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
2863 pub reference: ::core::option::Option<i32>,
2864 #[prost(message, optional, tag = "2")]
2865 pub body: ::core::option::Option<OpenSignatureBody>,
2866}
2867pub mod open_signature {
2869 #[non_exhaustive]
2870 #[derive(
2871 Clone,
2872 Copy,
2873 Debug,
2874 PartialEq,
2875 Eq,
2876 Hash,
2877 PartialOrd,
2878 Ord,
2879 ::prost::Enumeration
2880 )]
2881 #[repr(i32)]
2882 pub enum Reference {
2883 Unknown = 0,
2884 Immutable = 1,
2885 Mutable = 2,
2886 }
2887 impl Reference {
2888 pub fn as_str_name(&self) -> &'static str {
2893 match self {
2894 Self::Unknown => "REFERENCE_UNKNOWN",
2895 Self::Immutable => "IMMUTABLE",
2896 Self::Mutable => "MUTABLE",
2897 }
2898 }
2899 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2901 match value {
2902 "REFERENCE_UNKNOWN" => Some(Self::Unknown),
2903 "IMMUTABLE" => Some(Self::Immutable),
2904 "MUTABLE" => Some(Self::Mutable),
2905 _ => None,
2906 }
2907 }
2908 }
2909}
2910#[non_exhaustive]
2912#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2913pub struct TypeOrigin {
2914 #[prost(string, optional, tag = "1")]
2915 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
2916 #[prost(string, optional, tag = "2")]
2917 pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
2918 #[prost(string, optional, tag = "3")]
2919 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
2920}
2921#[non_exhaustive]
2923#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2924pub struct Linkage {
2925 #[prost(string, optional, tag = "1")]
2927 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
2928 #[prost(string, optional, tag = "2")]
2930 pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
2931 #[prost(uint64, optional, tag = "3")]
2933 pub upgraded_version: ::core::option::Option<u64>,
2934}
2935#[non_exhaustive]
2937#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2938#[repr(i32)]
2939pub enum Ability {
2940 Unknown = 0,
2941 Copy = 1,
2943 Drop = 2,
2945 Store = 3,
2947 Key = 4,
2949}
2950impl Ability {
2951 pub fn as_str_name(&self) -> &'static str {
2956 match self {
2957 Self::Unknown => "ABILITY_UNKNOWN",
2958 Self::Copy => "COPY",
2959 Self::Drop => "DROP",
2960 Self::Store => "STORE",
2961 Self::Key => "KEY",
2962 }
2963 }
2964 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2966 match value {
2967 "ABILITY_UNKNOWN" => Some(Self::Unknown),
2968 "COPY" => Some(Self::Copy),
2969 "DROP" => Some(Self::Drop),
2970 "STORE" => Some(Self::Store),
2971 "KEY" => Some(Self::Key),
2972 _ => None,
2973 }
2974 }
2975}
2976#[non_exhaustive]
2977#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2978pub struct GetPackageRequest {
2979 #[prost(string, optional, tag = "1")]
2981 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
2982}
2983#[non_exhaustive]
2984#[derive(Clone, PartialEq, ::prost::Message)]
2985pub struct GetPackageResponse {
2986 #[prost(message, optional, tag = "1")]
2988 pub package: ::core::option::Option<Package>,
2989}
2990#[non_exhaustive]
2991#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2992pub struct GetDatatypeRequest {
2993 #[prost(string, optional, tag = "1")]
2995 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
2996 #[prost(string, optional, tag = "2")]
2998 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
2999 #[prost(string, optional, tag = "3")]
3001 pub name: ::core::option::Option<::prost::alloc::string::String>,
3002}
3003#[non_exhaustive]
3004#[derive(Clone, PartialEq, ::prost::Message)]
3005pub struct GetDatatypeResponse {
3006 #[prost(message, optional, tag = "1")]
3008 pub datatype: ::core::option::Option<DatatypeDescriptor>,
3009}
3010#[non_exhaustive]
3011#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3012pub struct GetFunctionRequest {
3013 #[prost(string, optional, tag = "1")]
3015 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3016 #[prost(string, optional, tag = "2")]
3018 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3019 #[prost(string, optional, tag = "3")]
3021 pub name: ::core::option::Option<::prost::alloc::string::String>,
3022}
3023#[non_exhaustive]
3024#[derive(Clone, PartialEq, ::prost::Message)]
3025pub struct GetFunctionResponse {
3026 #[prost(message, optional, tag = "1")]
3028 pub function: ::core::option::Option<FunctionDescriptor>,
3029}
3030#[non_exhaustive]
3031#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3032pub struct ListPackageVersionsRequest {
3033 #[prost(string, optional, tag = "1")]
3035 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3036 #[prost(uint32, optional, tag = "2")]
3040 pub page_size: ::core::option::Option<u32>,
3041 #[prost(bytes = "bytes", optional, tag = "3")]
3047 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
3048}
3049#[non_exhaustive]
3050#[derive(Clone, PartialEq, ::prost::Message)]
3051pub struct ListPackageVersionsResponse {
3052 #[prost(message, repeated, tag = "1")]
3054 pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
3055 #[prost(bytes = "bytes", optional, tag = "2")]
3058 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
3059}
3060#[non_exhaustive]
3062#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3063pub struct PackageVersion {
3064 #[prost(string, optional, tag = "1")]
3066 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3067 #[prost(uint64, optional, tag = "2")]
3069 pub version: ::core::option::Option<u64>,
3070}
3071pub mod move_package_service_client {
3073 #![allow(
3074 unused_variables,
3075 dead_code,
3076 missing_docs,
3077 clippy::wildcard_imports,
3078 clippy::let_unit_value,
3079 )]
3080 use tonic::codegen::*;
3081 use tonic::codegen::http::Uri;
3082 #[derive(Debug, Clone)]
3083 pub struct MovePackageServiceClient<T> {
3084 inner: tonic::client::Grpc<T>,
3085 }
3086 impl MovePackageServiceClient<tonic::transport::Channel> {
3087 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3089 where
3090 D: TryInto<tonic::transport::Endpoint>,
3091 D::Error: Into<StdError>,
3092 {
3093 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3094 Ok(Self::new(conn))
3095 }
3096 }
3097 impl<T> MovePackageServiceClient<T>
3098 where
3099 T: tonic::client::GrpcService<tonic::body::Body>,
3100 T::Error: Into<StdError>,
3101 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3102 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3103 {
3104 pub fn new(inner: T) -> Self {
3105 let inner = tonic::client::Grpc::new(inner);
3106 Self { inner }
3107 }
3108 pub fn with_origin(inner: T, origin: Uri) -> Self {
3109 let inner = tonic::client::Grpc::with_origin(inner, origin);
3110 Self { inner }
3111 }
3112 pub fn with_interceptor<F>(
3113 inner: T,
3114 interceptor: F,
3115 ) -> MovePackageServiceClient<InterceptedService<T, F>>
3116 where
3117 F: tonic::service::Interceptor,
3118 T::ResponseBody: Default,
3119 T: tonic::codegen::Service<
3120 http::Request<tonic::body::Body>,
3121 Response = http::Response<
3122 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3123 >,
3124 >,
3125 <T as tonic::codegen::Service<
3126 http::Request<tonic::body::Body>,
3127 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3128 {
3129 MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
3130 }
3131 #[must_use]
3136 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3137 self.inner = self.inner.send_compressed(encoding);
3138 self
3139 }
3140 #[must_use]
3142 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3143 self.inner = self.inner.accept_compressed(encoding);
3144 self
3145 }
3146 #[must_use]
3150 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3151 self.inner = self.inner.max_decoding_message_size(limit);
3152 self
3153 }
3154 #[must_use]
3158 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3159 self.inner = self.inner.max_encoding_message_size(limit);
3160 self
3161 }
3162 pub async fn get_package(
3163 &mut self,
3164 request: impl tonic::IntoRequest<super::GetPackageRequest>,
3165 ) -> std::result::Result<
3166 tonic::Response<super::GetPackageResponse>,
3167 tonic::Status,
3168 > {
3169 self.inner
3170 .ready()
3171 .await
3172 .map_err(|e| {
3173 tonic::Status::unknown(
3174 format!("Service was not ready: {}", e.into()),
3175 )
3176 })?;
3177 let codec = tonic_prost::ProstCodec::default();
3178 let path = http::uri::PathAndQuery::from_static(
3179 "/sui.rpc.v2.MovePackageService/GetPackage",
3180 );
3181 let mut req = request.into_request();
3182 req.extensions_mut()
3183 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
3184 self.inner.unary(req, path, codec).await
3185 }
3186 pub async fn get_datatype(
3187 &mut self,
3188 request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
3189 ) -> std::result::Result<
3190 tonic::Response<super::GetDatatypeResponse>,
3191 tonic::Status,
3192 > {
3193 self.inner
3194 .ready()
3195 .await
3196 .map_err(|e| {
3197 tonic::Status::unknown(
3198 format!("Service was not ready: {}", e.into()),
3199 )
3200 })?;
3201 let codec = tonic_prost::ProstCodec::default();
3202 let path = http::uri::PathAndQuery::from_static(
3203 "/sui.rpc.v2.MovePackageService/GetDatatype",
3204 );
3205 let mut req = request.into_request();
3206 req.extensions_mut()
3207 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
3208 self.inner.unary(req, path, codec).await
3209 }
3210 pub async fn get_function(
3211 &mut self,
3212 request: impl tonic::IntoRequest<super::GetFunctionRequest>,
3213 ) -> std::result::Result<
3214 tonic::Response<super::GetFunctionResponse>,
3215 tonic::Status,
3216 > {
3217 self.inner
3218 .ready()
3219 .await
3220 .map_err(|e| {
3221 tonic::Status::unknown(
3222 format!("Service was not ready: {}", e.into()),
3223 )
3224 })?;
3225 let codec = tonic_prost::ProstCodec::default();
3226 let path = http::uri::PathAndQuery::from_static(
3227 "/sui.rpc.v2.MovePackageService/GetFunction",
3228 );
3229 let mut req = request.into_request();
3230 req.extensions_mut()
3231 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
3232 self.inner.unary(req, path, codec).await
3233 }
3234 pub async fn list_package_versions(
3235 &mut self,
3236 request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
3237 ) -> std::result::Result<
3238 tonic::Response<super::ListPackageVersionsResponse>,
3239 tonic::Status,
3240 > {
3241 self.inner
3242 .ready()
3243 .await
3244 .map_err(|e| {
3245 tonic::Status::unknown(
3246 format!("Service was not ready: {}", e.into()),
3247 )
3248 })?;
3249 let codec = tonic_prost::ProstCodec::default();
3250 let path = http::uri::PathAndQuery::from_static(
3251 "/sui.rpc.v2.MovePackageService/ListPackageVersions",
3252 );
3253 let mut req = request.into_request();
3254 req.extensions_mut()
3255 .insert(
3256 GrpcMethod::new(
3257 "sui.rpc.v2.MovePackageService",
3258 "ListPackageVersions",
3259 ),
3260 );
3261 self.inner.unary(req, path, codec).await
3262 }
3263 }
3264}
3265pub mod move_package_service_server {
3267 #![allow(
3268 unused_variables,
3269 dead_code,
3270 missing_docs,
3271 clippy::wildcard_imports,
3272 clippy::let_unit_value,
3273 )]
3274 use tonic::codegen::*;
3275 #[async_trait]
3277 pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
3278 async fn get_package(
3279 &self,
3280 request: tonic::Request<super::GetPackageRequest>,
3281 ) -> std::result::Result<
3282 tonic::Response<super::GetPackageResponse>,
3283 tonic::Status,
3284 >;
3285 async fn get_datatype(
3286 &self,
3287 request: tonic::Request<super::GetDatatypeRequest>,
3288 ) -> std::result::Result<
3289 tonic::Response<super::GetDatatypeResponse>,
3290 tonic::Status,
3291 >;
3292 async fn get_function(
3293 &self,
3294 request: tonic::Request<super::GetFunctionRequest>,
3295 ) -> std::result::Result<
3296 tonic::Response<super::GetFunctionResponse>,
3297 tonic::Status,
3298 >;
3299 async fn list_package_versions(
3300 &self,
3301 request: tonic::Request<super::ListPackageVersionsRequest>,
3302 ) -> std::result::Result<
3303 tonic::Response<super::ListPackageVersionsResponse>,
3304 tonic::Status,
3305 >;
3306 }
3307 #[derive(Debug)]
3308 pub struct MovePackageServiceServer<T> {
3309 inner: Arc<T>,
3310 accept_compression_encodings: EnabledCompressionEncodings,
3311 send_compression_encodings: EnabledCompressionEncodings,
3312 max_decoding_message_size: Option<usize>,
3313 max_encoding_message_size: Option<usize>,
3314 }
3315 impl<T> MovePackageServiceServer<T> {
3316 pub fn new(inner: T) -> Self {
3317 Self::from_arc(Arc::new(inner))
3318 }
3319 pub fn from_arc(inner: Arc<T>) -> Self {
3320 Self {
3321 inner,
3322 accept_compression_encodings: Default::default(),
3323 send_compression_encodings: Default::default(),
3324 max_decoding_message_size: None,
3325 max_encoding_message_size: None,
3326 }
3327 }
3328 pub fn with_interceptor<F>(
3329 inner: T,
3330 interceptor: F,
3331 ) -> InterceptedService<Self, F>
3332 where
3333 F: tonic::service::Interceptor,
3334 {
3335 InterceptedService::new(Self::new(inner), interceptor)
3336 }
3337 #[must_use]
3339 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3340 self.accept_compression_encodings.enable(encoding);
3341 self
3342 }
3343 #[must_use]
3345 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3346 self.send_compression_encodings.enable(encoding);
3347 self
3348 }
3349 #[must_use]
3353 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3354 self.max_decoding_message_size = Some(limit);
3355 self
3356 }
3357 #[must_use]
3361 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3362 self.max_encoding_message_size = Some(limit);
3363 self
3364 }
3365 }
3366 impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
3367 where
3368 T: MovePackageService,
3369 B: Body + std::marker::Send + 'static,
3370 B::Error: Into<StdError> + std::marker::Send + 'static,
3371 {
3372 type Response = http::Response<tonic::body::Body>;
3373 type Error = std::convert::Infallible;
3374 type Future = BoxFuture<Self::Response, Self::Error>;
3375 fn poll_ready(
3376 &mut self,
3377 _cx: &mut Context<'_>,
3378 ) -> Poll<std::result::Result<(), Self::Error>> {
3379 Poll::Ready(Ok(()))
3380 }
3381 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3382 match req.uri().path() {
3383 "/sui.rpc.v2.MovePackageService/GetPackage" => {
3384 #[allow(non_camel_case_types)]
3385 struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
3386 impl<
3387 T: MovePackageService,
3388 > tonic::server::UnaryService<super::GetPackageRequest>
3389 for GetPackageSvc<T> {
3390 type Response = super::GetPackageResponse;
3391 type Future = BoxFuture<
3392 tonic::Response<Self::Response>,
3393 tonic::Status,
3394 >;
3395 fn call(
3396 &mut self,
3397 request: tonic::Request<super::GetPackageRequest>,
3398 ) -> Self::Future {
3399 let inner = Arc::clone(&self.0);
3400 let fut = async move {
3401 <T as MovePackageService>::get_package(&inner, request)
3402 .await
3403 };
3404 Box::pin(fut)
3405 }
3406 }
3407 let accept_compression_encodings = self.accept_compression_encodings;
3408 let send_compression_encodings = self.send_compression_encodings;
3409 let max_decoding_message_size = self.max_decoding_message_size;
3410 let max_encoding_message_size = self.max_encoding_message_size;
3411 let inner = self.inner.clone();
3412 let fut = async move {
3413 let method = GetPackageSvc(inner);
3414 let codec = tonic_prost::ProstCodec::default();
3415 let mut grpc = tonic::server::Grpc::new(codec)
3416 .apply_compression_config(
3417 accept_compression_encodings,
3418 send_compression_encodings,
3419 )
3420 .apply_max_message_size_config(
3421 max_decoding_message_size,
3422 max_encoding_message_size,
3423 );
3424 let res = grpc.unary(method, req).await;
3425 Ok(res)
3426 };
3427 Box::pin(fut)
3428 }
3429 "/sui.rpc.v2.MovePackageService/GetDatatype" => {
3430 #[allow(non_camel_case_types)]
3431 struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
3432 impl<
3433 T: MovePackageService,
3434 > tonic::server::UnaryService<super::GetDatatypeRequest>
3435 for GetDatatypeSvc<T> {
3436 type Response = super::GetDatatypeResponse;
3437 type Future = BoxFuture<
3438 tonic::Response<Self::Response>,
3439 tonic::Status,
3440 >;
3441 fn call(
3442 &mut self,
3443 request: tonic::Request<super::GetDatatypeRequest>,
3444 ) -> Self::Future {
3445 let inner = Arc::clone(&self.0);
3446 let fut = async move {
3447 <T as MovePackageService>::get_datatype(&inner, request)
3448 .await
3449 };
3450 Box::pin(fut)
3451 }
3452 }
3453 let accept_compression_encodings = self.accept_compression_encodings;
3454 let send_compression_encodings = self.send_compression_encodings;
3455 let max_decoding_message_size = self.max_decoding_message_size;
3456 let max_encoding_message_size = self.max_encoding_message_size;
3457 let inner = self.inner.clone();
3458 let fut = async move {
3459 let method = GetDatatypeSvc(inner);
3460 let codec = tonic_prost::ProstCodec::default();
3461 let mut grpc = tonic::server::Grpc::new(codec)
3462 .apply_compression_config(
3463 accept_compression_encodings,
3464 send_compression_encodings,
3465 )
3466 .apply_max_message_size_config(
3467 max_decoding_message_size,
3468 max_encoding_message_size,
3469 );
3470 let res = grpc.unary(method, req).await;
3471 Ok(res)
3472 };
3473 Box::pin(fut)
3474 }
3475 "/sui.rpc.v2.MovePackageService/GetFunction" => {
3476 #[allow(non_camel_case_types)]
3477 struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
3478 impl<
3479 T: MovePackageService,
3480 > tonic::server::UnaryService<super::GetFunctionRequest>
3481 for GetFunctionSvc<T> {
3482 type Response = super::GetFunctionResponse;
3483 type Future = BoxFuture<
3484 tonic::Response<Self::Response>,
3485 tonic::Status,
3486 >;
3487 fn call(
3488 &mut self,
3489 request: tonic::Request<super::GetFunctionRequest>,
3490 ) -> Self::Future {
3491 let inner = Arc::clone(&self.0);
3492 let fut = async move {
3493 <T as MovePackageService>::get_function(&inner, request)
3494 .await
3495 };
3496 Box::pin(fut)
3497 }
3498 }
3499 let accept_compression_encodings = self.accept_compression_encodings;
3500 let send_compression_encodings = self.send_compression_encodings;
3501 let max_decoding_message_size = self.max_decoding_message_size;
3502 let max_encoding_message_size = self.max_encoding_message_size;
3503 let inner = self.inner.clone();
3504 let fut = async move {
3505 let method = GetFunctionSvc(inner);
3506 let codec = tonic_prost::ProstCodec::default();
3507 let mut grpc = tonic::server::Grpc::new(codec)
3508 .apply_compression_config(
3509 accept_compression_encodings,
3510 send_compression_encodings,
3511 )
3512 .apply_max_message_size_config(
3513 max_decoding_message_size,
3514 max_encoding_message_size,
3515 );
3516 let res = grpc.unary(method, req).await;
3517 Ok(res)
3518 };
3519 Box::pin(fut)
3520 }
3521 "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
3522 #[allow(non_camel_case_types)]
3523 struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
3524 impl<
3525 T: MovePackageService,
3526 > tonic::server::UnaryService<super::ListPackageVersionsRequest>
3527 for ListPackageVersionsSvc<T> {
3528 type Response = super::ListPackageVersionsResponse;
3529 type Future = BoxFuture<
3530 tonic::Response<Self::Response>,
3531 tonic::Status,
3532 >;
3533 fn call(
3534 &mut self,
3535 request: tonic::Request<super::ListPackageVersionsRequest>,
3536 ) -> Self::Future {
3537 let inner = Arc::clone(&self.0);
3538 let fut = async move {
3539 <T as MovePackageService>::list_package_versions(
3540 &inner,
3541 request,
3542 )
3543 .await
3544 };
3545 Box::pin(fut)
3546 }
3547 }
3548 let accept_compression_encodings = self.accept_compression_encodings;
3549 let send_compression_encodings = self.send_compression_encodings;
3550 let max_decoding_message_size = self.max_decoding_message_size;
3551 let max_encoding_message_size = self.max_encoding_message_size;
3552 let inner = self.inner.clone();
3553 let fut = async move {
3554 let method = ListPackageVersionsSvc(inner);
3555 let codec = tonic_prost::ProstCodec::default();
3556 let mut grpc = tonic::server::Grpc::new(codec)
3557 .apply_compression_config(
3558 accept_compression_encodings,
3559 send_compression_encodings,
3560 )
3561 .apply_max_message_size_config(
3562 max_decoding_message_size,
3563 max_encoding_message_size,
3564 );
3565 let res = grpc.unary(method, req).await;
3566 Ok(res)
3567 };
3568 Box::pin(fut)
3569 }
3570 _ => {
3571 Box::pin(async move {
3572 let mut response = http::Response::new(
3573 tonic::body::Body::default(),
3574 );
3575 let headers = response.headers_mut();
3576 headers
3577 .insert(
3578 tonic::Status::GRPC_STATUS,
3579 (tonic::Code::Unimplemented as i32).into(),
3580 );
3581 headers
3582 .insert(
3583 http::header::CONTENT_TYPE,
3584 tonic::metadata::GRPC_CONTENT_TYPE,
3585 );
3586 Ok(response)
3587 })
3588 }
3589 }
3590 }
3591 }
3592 impl<T> Clone for MovePackageServiceServer<T> {
3593 fn clone(&self) -> Self {
3594 let inner = self.inner.clone();
3595 Self {
3596 inner,
3597 accept_compression_encodings: self.accept_compression_encodings,
3598 send_compression_encodings: self.send_compression_encodings,
3599 max_decoding_message_size: self.max_decoding_message_size,
3600 max_encoding_message_size: self.max_encoding_message_size,
3601 }
3602 }
3603 }
3604 pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
3606 impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
3607 const NAME: &'static str = SERVICE_NAME;
3608 }
3609}
3610#[non_exhaustive]
3611#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3612pub struct LookupNameRequest {
3613 #[prost(string, optional, tag = "1")]
3617 pub name: ::core::option::Option<::prost::alloc::string::String>,
3618}
3619#[non_exhaustive]
3620#[derive(Clone, PartialEq, ::prost::Message)]
3621pub struct LookupNameResponse {
3622 #[prost(message, optional, tag = "1")]
3624 pub record: ::core::option::Option<NameRecord>,
3625}
3626#[non_exhaustive]
3627#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3628pub struct ReverseLookupNameRequest {
3629 #[prost(string, optional, tag = "1")]
3631 pub address: ::core::option::Option<::prost::alloc::string::String>,
3632}
3633#[non_exhaustive]
3634#[derive(Clone, PartialEq, ::prost::Message)]
3635pub struct ReverseLookupNameResponse {
3636 #[prost(message, optional, tag = "1")]
3638 pub record: ::core::option::Option<NameRecord>,
3639}
3640#[non_exhaustive]
3641#[derive(Clone, PartialEq, ::prost::Message)]
3642pub struct NameRecord {
3643 #[prost(string, optional, tag = "1")]
3648 pub id: ::core::option::Option<::prost::alloc::string::String>,
3649 #[prost(string, optional, tag = "2")]
3651 pub name: ::core::option::Option<::prost::alloc::string::String>,
3652 #[prost(string, optional, tag = "3")]
3660 pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
3661 #[prost(message, optional, tag = "4")]
3666 pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
3667 #[prost(string, optional, tag = "5")]
3669 pub target_address: ::core::option::Option<::prost::alloc::string::String>,
3670 #[prost(btree_map = "string, string", tag = "6")]
3672 pub data: ::prost::alloc::collections::BTreeMap<
3673 ::prost::alloc::string::String,
3674 ::prost::alloc::string::String,
3675 >,
3676}
3677pub mod name_service_client {
3679 #![allow(
3680 unused_variables,
3681 dead_code,
3682 missing_docs,
3683 clippy::wildcard_imports,
3684 clippy::let_unit_value,
3685 )]
3686 use tonic::codegen::*;
3687 use tonic::codegen::http::Uri;
3688 #[derive(Debug, Clone)]
3689 pub struct NameServiceClient<T> {
3690 inner: tonic::client::Grpc<T>,
3691 }
3692 impl NameServiceClient<tonic::transport::Channel> {
3693 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3695 where
3696 D: TryInto<tonic::transport::Endpoint>,
3697 D::Error: Into<StdError>,
3698 {
3699 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3700 Ok(Self::new(conn))
3701 }
3702 }
3703 impl<T> NameServiceClient<T>
3704 where
3705 T: tonic::client::GrpcService<tonic::body::Body>,
3706 T::Error: Into<StdError>,
3707 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3708 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3709 {
3710 pub fn new(inner: T) -> Self {
3711 let inner = tonic::client::Grpc::new(inner);
3712 Self { inner }
3713 }
3714 pub fn with_origin(inner: T, origin: Uri) -> Self {
3715 let inner = tonic::client::Grpc::with_origin(inner, origin);
3716 Self { inner }
3717 }
3718 pub fn with_interceptor<F>(
3719 inner: T,
3720 interceptor: F,
3721 ) -> NameServiceClient<InterceptedService<T, F>>
3722 where
3723 F: tonic::service::Interceptor,
3724 T::ResponseBody: Default,
3725 T: tonic::codegen::Service<
3726 http::Request<tonic::body::Body>,
3727 Response = http::Response<
3728 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3729 >,
3730 >,
3731 <T as tonic::codegen::Service<
3732 http::Request<tonic::body::Body>,
3733 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3734 {
3735 NameServiceClient::new(InterceptedService::new(inner, interceptor))
3736 }
3737 #[must_use]
3742 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3743 self.inner = self.inner.send_compressed(encoding);
3744 self
3745 }
3746 #[must_use]
3748 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3749 self.inner = self.inner.accept_compressed(encoding);
3750 self
3751 }
3752 #[must_use]
3756 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3757 self.inner = self.inner.max_decoding_message_size(limit);
3758 self
3759 }
3760 #[must_use]
3764 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3765 self.inner = self.inner.max_encoding_message_size(limit);
3766 self
3767 }
3768 pub async fn lookup_name(
3769 &mut self,
3770 request: impl tonic::IntoRequest<super::LookupNameRequest>,
3771 ) -> std::result::Result<
3772 tonic::Response<super::LookupNameResponse>,
3773 tonic::Status,
3774 > {
3775 self.inner
3776 .ready()
3777 .await
3778 .map_err(|e| {
3779 tonic::Status::unknown(
3780 format!("Service was not ready: {}", e.into()),
3781 )
3782 })?;
3783 let codec = tonic_prost::ProstCodec::default();
3784 let path = http::uri::PathAndQuery::from_static(
3785 "/sui.rpc.v2.NameService/LookupName",
3786 );
3787 let mut req = request.into_request();
3788 req.extensions_mut()
3789 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
3790 self.inner.unary(req, path, codec).await
3791 }
3792 pub async fn reverse_lookup_name(
3793 &mut self,
3794 request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
3795 ) -> std::result::Result<
3796 tonic::Response<super::ReverseLookupNameResponse>,
3797 tonic::Status,
3798 > {
3799 self.inner
3800 .ready()
3801 .await
3802 .map_err(|e| {
3803 tonic::Status::unknown(
3804 format!("Service was not ready: {}", e.into()),
3805 )
3806 })?;
3807 let codec = tonic_prost::ProstCodec::default();
3808 let path = http::uri::PathAndQuery::from_static(
3809 "/sui.rpc.v2.NameService/ReverseLookupName",
3810 );
3811 let mut req = request.into_request();
3812 req.extensions_mut()
3813 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
3814 self.inner.unary(req, path, codec).await
3815 }
3816 }
3817}
3818pub mod name_service_server {
3820 #![allow(
3821 unused_variables,
3822 dead_code,
3823 missing_docs,
3824 clippy::wildcard_imports,
3825 clippy::let_unit_value,
3826 )]
3827 use tonic::codegen::*;
3828 #[async_trait]
3830 pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
3831 async fn lookup_name(
3832 &self,
3833 request: tonic::Request<super::LookupNameRequest>,
3834 ) -> std::result::Result<
3835 tonic::Response<super::LookupNameResponse>,
3836 tonic::Status,
3837 >;
3838 async fn reverse_lookup_name(
3839 &self,
3840 request: tonic::Request<super::ReverseLookupNameRequest>,
3841 ) -> std::result::Result<
3842 tonic::Response<super::ReverseLookupNameResponse>,
3843 tonic::Status,
3844 >;
3845 }
3846 #[derive(Debug)]
3847 pub struct NameServiceServer<T> {
3848 inner: Arc<T>,
3849 accept_compression_encodings: EnabledCompressionEncodings,
3850 send_compression_encodings: EnabledCompressionEncodings,
3851 max_decoding_message_size: Option<usize>,
3852 max_encoding_message_size: Option<usize>,
3853 }
3854 impl<T> NameServiceServer<T> {
3855 pub fn new(inner: T) -> Self {
3856 Self::from_arc(Arc::new(inner))
3857 }
3858 pub fn from_arc(inner: Arc<T>) -> Self {
3859 Self {
3860 inner,
3861 accept_compression_encodings: Default::default(),
3862 send_compression_encodings: Default::default(),
3863 max_decoding_message_size: None,
3864 max_encoding_message_size: None,
3865 }
3866 }
3867 pub fn with_interceptor<F>(
3868 inner: T,
3869 interceptor: F,
3870 ) -> InterceptedService<Self, F>
3871 where
3872 F: tonic::service::Interceptor,
3873 {
3874 InterceptedService::new(Self::new(inner), interceptor)
3875 }
3876 #[must_use]
3878 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3879 self.accept_compression_encodings.enable(encoding);
3880 self
3881 }
3882 #[must_use]
3884 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3885 self.send_compression_encodings.enable(encoding);
3886 self
3887 }
3888 #[must_use]
3892 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3893 self.max_decoding_message_size = Some(limit);
3894 self
3895 }
3896 #[must_use]
3900 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3901 self.max_encoding_message_size = Some(limit);
3902 self
3903 }
3904 }
3905 impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
3906 where
3907 T: NameService,
3908 B: Body + std::marker::Send + 'static,
3909 B::Error: Into<StdError> + std::marker::Send + 'static,
3910 {
3911 type Response = http::Response<tonic::body::Body>;
3912 type Error = std::convert::Infallible;
3913 type Future = BoxFuture<Self::Response, Self::Error>;
3914 fn poll_ready(
3915 &mut self,
3916 _cx: &mut Context<'_>,
3917 ) -> Poll<std::result::Result<(), Self::Error>> {
3918 Poll::Ready(Ok(()))
3919 }
3920 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3921 match req.uri().path() {
3922 "/sui.rpc.v2.NameService/LookupName" => {
3923 #[allow(non_camel_case_types)]
3924 struct LookupNameSvc<T: NameService>(pub Arc<T>);
3925 impl<
3926 T: NameService,
3927 > tonic::server::UnaryService<super::LookupNameRequest>
3928 for LookupNameSvc<T> {
3929 type Response = super::LookupNameResponse;
3930 type Future = BoxFuture<
3931 tonic::Response<Self::Response>,
3932 tonic::Status,
3933 >;
3934 fn call(
3935 &mut self,
3936 request: tonic::Request<super::LookupNameRequest>,
3937 ) -> Self::Future {
3938 let inner = Arc::clone(&self.0);
3939 let fut = async move {
3940 <T as NameService>::lookup_name(&inner, request).await
3941 };
3942 Box::pin(fut)
3943 }
3944 }
3945 let accept_compression_encodings = self.accept_compression_encodings;
3946 let send_compression_encodings = self.send_compression_encodings;
3947 let max_decoding_message_size = self.max_decoding_message_size;
3948 let max_encoding_message_size = self.max_encoding_message_size;
3949 let inner = self.inner.clone();
3950 let fut = async move {
3951 let method = LookupNameSvc(inner);
3952 let codec = tonic_prost::ProstCodec::default();
3953 let mut grpc = tonic::server::Grpc::new(codec)
3954 .apply_compression_config(
3955 accept_compression_encodings,
3956 send_compression_encodings,
3957 )
3958 .apply_max_message_size_config(
3959 max_decoding_message_size,
3960 max_encoding_message_size,
3961 );
3962 let res = grpc.unary(method, req).await;
3963 Ok(res)
3964 };
3965 Box::pin(fut)
3966 }
3967 "/sui.rpc.v2.NameService/ReverseLookupName" => {
3968 #[allow(non_camel_case_types)]
3969 struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
3970 impl<
3971 T: NameService,
3972 > tonic::server::UnaryService<super::ReverseLookupNameRequest>
3973 for ReverseLookupNameSvc<T> {
3974 type Response = super::ReverseLookupNameResponse;
3975 type Future = BoxFuture<
3976 tonic::Response<Self::Response>,
3977 tonic::Status,
3978 >;
3979 fn call(
3980 &mut self,
3981 request: tonic::Request<super::ReverseLookupNameRequest>,
3982 ) -> Self::Future {
3983 let inner = Arc::clone(&self.0);
3984 let fut = async move {
3985 <T as NameService>::reverse_lookup_name(&inner, request)
3986 .await
3987 };
3988 Box::pin(fut)
3989 }
3990 }
3991 let accept_compression_encodings = self.accept_compression_encodings;
3992 let send_compression_encodings = self.send_compression_encodings;
3993 let max_decoding_message_size = self.max_decoding_message_size;
3994 let max_encoding_message_size = self.max_encoding_message_size;
3995 let inner = self.inner.clone();
3996 let fut = async move {
3997 let method = ReverseLookupNameSvc(inner);
3998 let codec = tonic_prost::ProstCodec::default();
3999 let mut grpc = tonic::server::Grpc::new(codec)
4000 .apply_compression_config(
4001 accept_compression_encodings,
4002 send_compression_encodings,
4003 )
4004 .apply_max_message_size_config(
4005 max_decoding_message_size,
4006 max_encoding_message_size,
4007 );
4008 let res = grpc.unary(method, req).await;
4009 Ok(res)
4010 };
4011 Box::pin(fut)
4012 }
4013 _ => {
4014 Box::pin(async move {
4015 let mut response = http::Response::new(
4016 tonic::body::Body::default(),
4017 );
4018 let headers = response.headers_mut();
4019 headers
4020 .insert(
4021 tonic::Status::GRPC_STATUS,
4022 (tonic::Code::Unimplemented as i32).into(),
4023 );
4024 headers
4025 .insert(
4026 http::header::CONTENT_TYPE,
4027 tonic::metadata::GRPC_CONTENT_TYPE,
4028 );
4029 Ok(response)
4030 })
4031 }
4032 }
4033 }
4034 }
4035 impl<T> Clone for NameServiceServer<T> {
4036 fn clone(&self) -> Self {
4037 let inner = self.inner.clone();
4038 Self {
4039 inner,
4040 accept_compression_encodings: self.accept_compression_encodings,
4041 send_compression_encodings: self.send_compression_encodings,
4042 max_decoding_message_size: self.max_decoding_message_size,
4043 max_encoding_message_size: self.max_encoding_message_size,
4044 }
4045 }
4046 }
4047 pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
4049 impl<T> tonic::server::NamedService for NameServiceServer<T> {
4050 const NAME: &'static str = SERVICE_NAME;
4051 }
4052}
4053#[non_exhaustive]
4055#[derive(Clone, PartialEq, ::prost::Message)]
4056pub struct Object {
4057 #[prost(message, optional, tag = "1")]
4059 pub bcs: ::core::option::Option<Bcs>,
4060 #[prost(string, optional, tag = "2")]
4062 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4063 #[prost(uint64, optional, tag = "3")]
4065 pub version: ::core::option::Option<u64>,
4066 #[prost(string, optional, tag = "4")]
4068 pub digest: ::core::option::Option<::prost::alloc::string::String>,
4069 #[prost(message, optional, tag = "5")]
4071 pub owner: ::core::option::Option<Owner>,
4072 #[prost(string, optional, tag = "6")]
4076 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
4077 #[prost(bool, optional, tag = "7")]
4082 pub has_public_transfer: ::core::option::Option<bool>,
4083 #[prost(message, optional, tag = "8")]
4087 pub contents: ::core::option::Option<Bcs>,
4088 #[prost(message, optional, tag = "9")]
4090 pub package: ::core::option::Option<Package>,
4091 #[prost(string, optional, tag = "10")]
4093 pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
4094 #[prost(uint64, optional, tag = "11")]
4098 pub storage_rebate: ::core::option::Option<u64>,
4099 #[prost(message, optional, boxed, tag = "100")]
4101 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
4102 #[prost(uint64, optional, tag = "101")]
4104 pub balance: ::core::option::Option<u64>,
4105}
4106#[non_exhaustive]
4108#[derive(Clone, PartialEq, ::prost::Message)]
4109pub struct ObjectSet {
4110 #[prost(message, repeated, tag = "1")]
4112 pub objects: ::prost::alloc::vec::Vec<Object>,
4113}
4114#[non_exhaustive]
4116#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4117pub struct ObjectReference {
4118 #[prost(string, optional, tag = "1")]
4120 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4121 #[prost(uint64, optional, tag = "2")]
4123 pub version: ::core::option::Option<u64>,
4124 #[prost(string, optional, tag = "3")]
4126 pub digest: ::core::option::Option<::prost::alloc::string::String>,
4127}
4128#[non_exhaustive]
4130#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4131pub struct Owner {
4132 #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
4133 pub kind: ::core::option::Option<i32>,
4134 #[prost(string, optional, tag = "2")]
4136 pub address: ::core::option::Option<::prost::alloc::string::String>,
4137 #[prost(uint64, optional, tag = "3")]
4139 pub version: ::core::option::Option<u64>,
4140}
4141pub mod owner {
4143 #[non_exhaustive]
4144 #[derive(
4145 Clone,
4146 Copy,
4147 Debug,
4148 PartialEq,
4149 Eq,
4150 Hash,
4151 PartialOrd,
4152 Ord,
4153 ::prost::Enumeration
4154 )]
4155 #[repr(i32)]
4156 pub enum OwnerKind {
4157 Unknown = 0,
4158 Address = 1,
4159 Object = 2,
4160 Shared = 3,
4161 Immutable = 4,
4162 ConsensusAddress = 5,
4163 }
4164 impl OwnerKind {
4165 pub fn as_str_name(&self) -> &'static str {
4170 match self {
4171 Self::Unknown => "OWNER_KIND_UNKNOWN",
4172 Self::Address => "ADDRESS",
4173 Self::Object => "OBJECT",
4174 Self::Shared => "SHARED",
4175 Self::Immutable => "IMMUTABLE",
4176 Self::ConsensusAddress => "CONSENSUS_ADDRESS",
4177 }
4178 }
4179 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4181 match value {
4182 "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
4183 "ADDRESS" => Some(Self::Address),
4184 "OBJECT" => Some(Self::Object),
4185 "SHARED" => Some(Self::Shared),
4186 "IMMUTABLE" => Some(Self::Immutable),
4187 "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
4188 _ => None,
4189 }
4190 }
4191 }
4192}
4193#[non_exhaustive]
4194#[derive(Clone, PartialEq, ::prost::Message)]
4195pub struct ProtocolConfig {
4196 #[prost(uint64, optional, tag = "1")]
4197 pub protocol_version: ::core::option::Option<u64>,
4198 #[prost(btree_map = "string, bool", tag = "2")]
4199 pub feature_flags: ::prost::alloc::collections::BTreeMap<
4200 ::prost::alloc::string::String,
4201 bool,
4202 >,
4203 #[prost(btree_map = "string, string", tag = "3")]
4204 pub attributes: ::prost::alloc::collections::BTreeMap<
4205 ::prost::alloc::string::String,
4206 ::prost::alloc::string::String,
4207 >,
4208}
4209#[non_exhaustive]
4211#[derive(Clone, PartialEq, ::prost::Message)]
4212pub struct UserSignature {
4213 #[prost(message, optional, tag = "1")]
4218 pub bcs: ::core::option::Option<Bcs>,
4219 #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
4221 pub scheme: ::core::option::Option<i32>,
4222 #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
4223 pub signature: ::core::option::Option<user_signature::Signature>,
4224}
4225pub mod user_signature {
4227 #[non_exhaustive]
4228 #[derive(Clone, PartialEq, ::prost::Oneof)]
4229 pub enum Signature {
4230 #[prost(message, tag = "3")]
4232 Simple(super::SimpleSignature),
4233 #[prost(message, tag = "4")]
4235 Multisig(super::MultisigAggregatedSignature),
4236 #[prost(message, tag = "5")]
4238 Zklogin(super::ZkLoginAuthenticator),
4239 #[prost(message, tag = "6")]
4241 Passkey(super::PasskeyAuthenticator),
4242 }
4243}
4244#[non_exhaustive]
4246#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4247pub struct SimpleSignature {
4248 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4250 pub scheme: ::core::option::Option<i32>,
4251 #[prost(bytes = "bytes", optional, tag = "2")]
4253 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4254 #[prost(bytes = "bytes", optional, tag = "3")]
4256 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4257}
4258#[non_exhaustive]
4260#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4261pub struct ZkLoginPublicIdentifier {
4262 #[prost(string, optional, tag = "1")]
4263 pub iss: ::core::option::Option<::prost::alloc::string::String>,
4264 #[prost(string, optional, tag = "2")]
4266 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4267}
4268#[non_exhaustive]
4270#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4271pub struct MultisigMemberPublicKey {
4272 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4274 pub scheme: ::core::option::Option<i32>,
4275 #[prost(bytes = "bytes", optional, tag = "2")]
4277 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4278 #[prost(message, optional, tag = "3")]
4280 pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
4281}
4282#[non_exhaustive]
4284#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4285pub struct MultisigMember {
4286 #[prost(message, optional, tag = "1")]
4288 pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
4289 #[prost(uint32, optional, tag = "2")]
4291 pub weight: ::core::option::Option<u32>,
4292}
4293#[non_exhaustive]
4295#[derive(Clone, PartialEq, ::prost::Message)]
4296pub struct MultisigCommittee {
4297 #[prost(message, repeated, tag = "1")]
4299 pub members: ::prost::alloc::vec::Vec<MultisigMember>,
4300 #[prost(uint32, optional, tag = "2")]
4303 pub threshold: ::core::option::Option<u32>,
4304}
4305#[non_exhaustive]
4307#[derive(Clone, PartialEq, ::prost::Message)]
4308pub struct MultisigAggregatedSignature {
4309 #[prost(message, repeated, tag = "1")]
4313 pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
4314 #[prost(uint32, optional, tag = "2")]
4317 pub bitmap: ::core::option::Option<u32>,
4318 #[prost(bytes = "bytes", optional, tag = "3")]
4321 pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4322 #[prost(message, optional, tag = "4")]
4324 pub committee: ::core::option::Option<MultisigCommittee>,
4325}
4326#[non_exhaustive]
4328#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4329pub struct MultisigMemberSignature {
4330 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4332 pub scheme: ::core::option::Option<i32>,
4333 #[prost(bytes = "bytes", optional, tag = "2")]
4335 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4336 #[prost(message, optional, tag = "3")]
4338 pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
4339 #[prost(message, optional, tag = "4")]
4341 pub passkey: ::core::option::Option<PasskeyAuthenticator>,
4342}
4343#[non_exhaustive]
4345#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4346pub struct ZkLoginAuthenticator {
4347 #[prost(message, optional, tag = "1")]
4349 pub inputs: ::core::option::Option<ZkLoginInputs>,
4350 #[prost(uint64, optional, tag = "2")]
4352 pub max_epoch: ::core::option::Option<u64>,
4353 #[prost(message, optional, tag = "3")]
4355 pub signature: ::core::option::Option<SimpleSignature>,
4356 #[prost(message, optional, tag = "4")]
4358 pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
4359 #[prost(message, optional, tag = "5")]
4361 pub jwk_id: ::core::option::Option<JwkId>,
4362}
4363#[non_exhaustive]
4365#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4366pub struct ZkLoginInputs {
4367 #[prost(message, optional, tag = "1")]
4368 pub proof_points: ::core::option::Option<ZkLoginProof>,
4369 #[prost(message, optional, tag = "2")]
4370 pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
4371 #[prost(string, optional, tag = "3")]
4372 pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
4373 #[prost(string, optional, tag = "4")]
4375 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4376}
4377#[non_exhaustive]
4379#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4380pub struct ZkLoginProof {
4381 #[prost(message, optional, tag = "1")]
4382 pub a: ::core::option::Option<CircomG1>,
4383 #[prost(message, optional, tag = "2")]
4384 pub b: ::core::option::Option<CircomG2>,
4385 #[prost(message, optional, tag = "3")]
4386 pub c: ::core::option::Option<CircomG1>,
4387}
4388#[non_exhaustive]
4390#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4391pub struct ZkLoginClaim {
4392 #[prost(string, optional, tag = "1")]
4393 pub value: ::core::option::Option<::prost::alloc::string::String>,
4394 #[prost(uint32, optional, tag = "2")]
4395 pub index_mod_4: ::core::option::Option<u32>,
4396}
4397#[non_exhaustive]
4399#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4400pub struct CircomG1 {
4401 #[prost(string, optional, tag = "1")]
4403 pub e0: ::core::option::Option<::prost::alloc::string::String>,
4404 #[prost(string, optional, tag = "2")]
4406 pub e1: ::core::option::Option<::prost::alloc::string::String>,
4407 #[prost(string, optional, tag = "3")]
4409 pub e2: ::core::option::Option<::prost::alloc::string::String>,
4410}
4411#[non_exhaustive]
4413#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4414pub struct CircomG2 {
4415 #[prost(string, optional, tag = "1")]
4417 pub e00: ::core::option::Option<::prost::alloc::string::String>,
4418 #[prost(string, optional, tag = "2")]
4420 pub e01: ::core::option::Option<::prost::alloc::string::String>,
4421 #[prost(string, optional, tag = "3")]
4423 pub e10: ::core::option::Option<::prost::alloc::string::String>,
4424 #[prost(string, optional, tag = "4")]
4426 pub e11: ::core::option::Option<::prost::alloc::string::String>,
4427 #[prost(string, optional, tag = "5")]
4429 pub e20: ::core::option::Option<::prost::alloc::string::String>,
4430 #[prost(string, optional, tag = "6")]
4432 pub e21: ::core::option::Option<::prost::alloc::string::String>,
4433}
4434#[non_exhaustive]
4441#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4442pub struct PasskeyAuthenticator {
4443 #[prost(bytes = "bytes", optional, tag = "1")]
4448 pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
4449 #[prost(string, optional, tag = "2")]
4454 pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
4455 #[prost(message, optional, tag = "3")]
4457 pub signature: ::core::option::Option<SimpleSignature>,
4458}
4459#[non_exhaustive]
4461#[derive(Clone, PartialEq, ::prost::Message)]
4462pub struct ValidatorCommittee {
4463 #[prost(uint64, optional, tag = "1")]
4465 pub epoch: ::core::option::Option<u64>,
4466 #[prost(message, repeated, tag = "2")]
4468 pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
4469}
4470#[non_exhaustive]
4472#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4473pub struct ValidatorCommitteeMember {
4474 #[prost(bytes = "bytes", optional, tag = "1")]
4476 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4477 #[prost(uint64, optional, tag = "2")]
4479 pub weight: ::core::option::Option<u64>,
4480}
4481#[non_exhaustive]
4483#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4484pub struct ValidatorAggregatedSignature {
4485 #[prost(uint64, optional, tag = "1")]
4490 pub epoch: ::core::option::Option<u64>,
4491 #[prost(bytes = "bytes", optional, tag = "2")]
4493 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4494 #[prost(bytes = "bytes", optional, tag = "3")]
4497 pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4498}
4499#[non_exhaustive]
4506#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4507#[repr(i32)]
4508pub enum SignatureScheme {
4509 Ed25519 = 0,
4510 Secp256k1 = 1,
4511 Secp256r1 = 2,
4512 Multisig = 3,
4513 Bls12381 = 4,
4514 Zklogin = 5,
4515 Passkey = 6,
4516}
4517impl SignatureScheme {
4518 pub fn as_str_name(&self) -> &'static str {
4523 match self {
4524 Self::Ed25519 => "ED25519",
4525 Self::Secp256k1 => "SECP256K1",
4526 Self::Secp256r1 => "SECP256R1",
4527 Self::Multisig => "MULTISIG",
4528 Self::Bls12381 => "BLS12381",
4529 Self::Zklogin => "ZKLOGIN",
4530 Self::Passkey => "PASSKEY",
4531 }
4532 }
4533 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4535 match value {
4536 "ED25519" => Some(Self::Ed25519),
4537 "SECP256K1" => Some(Self::Secp256k1),
4538 "SECP256R1" => Some(Self::Secp256r1),
4539 "MULTISIG" => Some(Self::Multisig),
4540 "BLS12381" => Some(Self::Bls12381),
4541 "ZKLOGIN" => Some(Self::Zklogin),
4542 "PASSKEY" => Some(Self::Passkey),
4543 _ => None,
4544 }
4545 }
4546}
4547#[non_exhaustive]
4548#[derive(Clone, PartialEq, ::prost::Message)]
4549pub struct VerifySignatureRequest {
4550 #[prost(message, optional, tag = "1")]
4556 pub message: ::core::option::Option<Bcs>,
4557 #[prost(message, optional, tag = "2")]
4559 pub signature: ::core::option::Option<UserSignature>,
4560 #[prost(string, optional, tag = "3")]
4566 pub address: ::core::option::Option<::prost::alloc::string::String>,
4567 #[prost(message, repeated, tag = "4")]
4570 pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
4571}
4572#[non_exhaustive]
4573#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4574pub struct VerifySignatureResponse {
4575 #[prost(bool, optional, tag = "1")]
4577 pub is_valid: ::core::option::Option<bool>,
4578 #[prost(string, optional, tag = "2")]
4580 pub reason: ::core::option::Option<::prost::alloc::string::String>,
4581}
4582pub mod signature_verification_service_client {
4584 #![allow(
4585 unused_variables,
4586 dead_code,
4587 missing_docs,
4588 clippy::wildcard_imports,
4589 clippy::let_unit_value,
4590 )]
4591 use tonic::codegen::*;
4592 use tonic::codegen::http::Uri;
4593 #[derive(Debug, Clone)]
4594 pub struct SignatureVerificationServiceClient<T> {
4595 inner: tonic::client::Grpc<T>,
4596 }
4597 impl SignatureVerificationServiceClient<tonic::transport::Channel> {
4598 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4600 where
4601 D: TryInto<tonic::transport::Endpoint>,
4602 D::Error: Into<StdError>,
4603 {
4604 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4605 Ok(Self::new(conn))
4606 }
4607 }
4608 impl<T> SignatureVerificationServiceClient<T>
4609 where
4610 T: tonic::client::GrpcService<tonic::body::Body>,
4611 T::Error: Into<StdError>,
4612 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4613 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4614 {
4615 pub fn new(inner: T) -> Self {
4616 let inner = tonic::client::Grpc::new(inner);
4617 Self { inner }
4618 }
4619 pub fn with_origin(inner: T, origin: Uri) -> Self {
4620 let inner = tonic::client::Grpc::with_origin(inner, origin);
4621 Self { inner }
4622 }
4623 pub fn with_interceptor<F>(
4624 inner: T,
4625 interceptor: F,
4626 ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
4627 where
4628 F: tonic::service::Interceptor,
4629 T::ResponseBody: Default,
4630 T: tonic::codegen::Service<
4631 http::Request<tonic::body::Body>,
4632 Response = http::Response<
4633 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4634 >,
4635 >,
4636 <T as tonic::codegen::Service<
4637 http::Request<tonic::body::Body>,
4638 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4639 {
4640 SignatureVerificationServiceClient::new(
4641 InterceptedService::new(inner, interceptor),
4642 )
4643 }
4644 #[must_use]
4649 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4650 self.inner = self.inner.send_compressed(encoding);
4651 self
4652 }
4653 #[must_use]
4655 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4656 self.inner = self.inner.accept_compressed(encoding);
4657 self
4658 }
4659 #[must_use]
4663 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4664 self.inner = self.inner.max_decoding_message_size(limit);
4665 self
4666 }
4667 #[must_use]
4671 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4672 self.inner = self.inner.max_encoding_message_size(limit);
4673 self
4674 }
4675 pub async fn verify_signature(
4677 &mut self,
4678 request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
4679 ) -> std::result::Result<
4680 tonic::Response<super::VerifySignatureResponse>,
4681 tonic::Status,
4682 > {
4683 self.inner
4684 .ready()
4685 .await
4686 .map_err(|e| {
4687 tonic::Status::unknown(
4688 format!("Service was not ready: {}", e.into()),
4689 )
4690 })?;
4691 let codec = tonic_prost::ProstCodec::default();
4692 let path = http::uri::PathAndQuery::from_static(
4693 "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
4694 );
4695 let mut req = request.into_request();
4696 req.extensions_mut()
4697 .insert(
4698 GrpcMethod::new(
4699 "sui.rpc.v2.SignatureVerificationService",
4700 "VerifySignature",
4701 ),
4702 );
4703 self.inner.unary(req, path, codec).await
4704 }
4705 }
4706}
4707pub mod signature_verification_service_server {
4709 #![allow(
4710 unused_variables,
4711 dead_code,
4712 missing_docs,
4713 clippy::wildcard_imports,
4714 clippy::let_unit_value,
4715 )]
4716 use tonic::codegen::*;
4717 #[async_trait]
4719 pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
4720 async fn verify_signature(
4722 &self,
4723 request: tonic::Request<super::VerifySignatureRequest>,
4724 ) -> std::result::Result<
4725 tonic::Response<super::VerifySignatureResponse>,
4726 tonic::Status,
4727 >;
4728 }
4729 #[derive(Debug)]
4730 pub struct SignatureVerificationServiceServer<T> {
4731 inner: Arc<T>,
4732 accept_compression_encodings: EnabledCompressionEncodings,
4733 send_compression_encodings: EnabledCompressionEncodings,
4734 max_decoding_message_size: Option<usize>,
4735 max_encoding_message_size: Option<usize>,
4736 }
4737 impl<T> SignatureVerificationServiceServer<T> {
4738 pub fn new(inner: T) -> Self {
4739 Self::from_arc(Arc::new(inner))
4740 }
4741 pub fn from_arc(inner: Arc<T>) -> Self {
4742 Self {
4743 inner,
4744 accept_compression_encodings: Default::default(),
4745 send_compression_encodings: Default::default(),
4746 max_decoding_message_size: None,
4747 max_encoding_message_size: None,
4748 }
4749 }
4750 pub fn with_interceptor<F>(
4751 inner: T,
4752 interceptor: F,
4753 ) -> InterceptedService<Self, F>
4754 where
4755 F: tonic::service::Interceptor,
4756 {
4757 InterceptedService::new(Self::new(inner), interceptor)
4758 }
4759 #[must_use]
4761 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4762 self.accept_compression_encodings.enable(encoding);
4763 self
4764 }
4765 #[must_use]
4767 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4768 self.send_compression_encodings.enable(encoding);
4769 self
4770 }
4771 #[must_use]
4775 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4776 self.max_decoding_message_size = Some(limit);
4777 self
4778 }
4779 #[must_use]
4783 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4784 self.max_encoding_message_size = Some(limit);
4785 self
4786 }
4787 }
4788 impl<T, B> tonic::codegen::Service<http::Request<B>>
4789 for SignatureVerificationServiceServer<T>
4790 where
4791 T: SignatureVerificationService,
4792 B: Body + std::marker::Send + 'static,
4793 B::Error: Into<StdError> + std::marker::Send + 'static,
4794 {
4795 type Response = http::Response<tonic::body::Body>;
4796 type Error = std::convert::Infallible;
4797 type Future = BoxFuture<Self::Response, Self::Error>;
4798 fn poll_ready(
4799 &mut self,
4800 _cx: &mut Context<'_>,
4801 ) -> Poll<std::result::Result<(), Self::Error>> {
4802 Poll::Ready(Ok(()))
4803 }
4804 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4805 match req.uri().path() {
4806 "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
4807 #[allow(non_camel_case_types)]
4808 struct VerifySignatureSvc<T: SignatureVerificationService>(
4809 pub Arc<T>,
4810 );
4811 impl<
4812 T: SignatureVerificationService,
4813 > tonic::server::UnaryService<super::VerifySignatureRequest>
4814 for VerifySignatureSvc<T> {
4815 type Response = super::VerifySignatureResponse;
4816 type Future = BoxFuture<
4817 tonic::Response<Self::Response>,
4818 tonic::Status,
4819 >;
4820 fn call(
4821 &mut self,
4822 request: tonic::Request<super::VerifySignatureRequest>,
4823 ) -> Self::Future {
4824 let inner = Arc::clone(&self.0);
4825 let fut = async move {
4826 <T as SignatureVerificationService>::verify_signature(
4827 &inner,
4828 request,
4829 )
4830 .await
4831 };
4832 Box::pin(fut)
4833 }
4834 }
4835 let accept_compression_encodings = self.accept_compression_encodings;
4836 let send_compression_encodings = self.send_compression_encodings;
4837 let max_decoding_message_size = self.max_decoding_message_size;
4838 let max_encoding_message_size = self.max_encoding_message_size;
4839 let inner = self.inner.clone();
4840 let fut = async move {
4841 let method = VerifySignatureSvc(inner);
4842 let codec = tonic_prost::ProstCodec::default();
4843 let mut grpc = tonic::server::Grpc::new(codec)
4844 .apply_compression_config(
4845 accept_compression_encodings,
4846 send_compression_encodings,
4847 )
4848 .apply_max_message_size_config(
4849 max_decoding_message_size,
4850 max_encoding_message_size,
4851 );
4852 let res = grpc.unary(method, req).await;
4853 Ok(res)
4854 };
4855 Box::pin(fut)
4856 }
4857 _ => {
4858 Box::pin(async move {
4859 let mut response = http::Response::new(
4860 tonic::body::Body::default(),
4861 );
4862 let headers = response.headers_mut();
4863 headers
4864 .insert(
4865 tonic::Status::GRPC_STATUS,
4866 (tonic::Code::Unimplemented as i32).into(),
4867 );
4868 headers
4869 .insert(
4870 http::header::CONTENT_TYPE,
4871 tonic::metadata::GRPC_CONTENT_TYPE,
4872 );
4873 Ok(response)
4874 })
4875 }
4876 }
4877 }
4878 }
4879 impl<T> Clone for SignatureVerificationServiceServer<T> {
4880 fn clone(&self) -> Self {
4881 let inner = self.inner.clone();
4882 Self {
4883 inner,
4884 accept_compression_encodings: self.accept_compression_encodings,
4885 send_compression_encodings: self.send_compression_encodings,
4886 max_decoding_message_size: self.max_decoding_message_size,
4887 max_encoding_message_size: self.max_encoding_message_size,
4888 }
4889 }
4890 }
4891 pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
4893 impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
4894 const NAME: &'static str = SERVICE_NAME;
4895 }
4896}
4897#[non_exhaustive]
4899#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4900pub struct GetCoinInfoRequest {
4901 #[prost(string, optional, tag = "1")]
4903 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
4904}
4905#[non_exhaustive]
4907#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4908pub struct GetCoinInfoResponse {
4909 #[prost(string, optional, tag = "1")]
4911 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
4912 #[prost(message, optional, tag = "2")]
4915 pub metadata: ::core::option::Option<CoinMetadata>,
4916 #[prost(message, optional, tag = "3")]
4919 pub treasury: ::core::option::Option<CoinTreasury>,
4920 #[prost(message, optional, tag = "4")]
4928 pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
4929}
4930#[non_exhaustive]
4932#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4933pub struct CoinMetadata {
4934 #[prost(string, optional, tag = "1")]
4937 pub id: ::core::option::Option<::prost::alloc::string::String>,
4938 #[prost(uint32, optional, tag = "2")]
4940 pub decimals: ::core::option::Option<u32>,
4941 #[prost(string, optional, tag = "3")]
4943 pub name: ::core::option::Option<::prost::alloc::string::String>,
4944 #[prost(string, optional, tag = "4")]
4946 pub symbol: ::core::option::Option<::prost::alloc::string::String>,
4947 #[prost(string, optional, tag = "5")]
4949 pub description: ::core::option::Option<::prost::alloc::string::String>,
4950 #[prost(string, optional, tag = "6")]
4952 pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
4953 #[prost(string, optional, tag = "7")]
4957 pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
4958 #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
4960 pub metadata_cap_state: ::core::option::Option<i32>,
4961}
4962pub mod coin_metadata {
4964 #[non_exhaustive]
4966 #[derive(
4967 Clone,
4968 Copy,
4969 Debug,
4970 PartialEq,
4971 Eq,
4972 Hash,
4973 PartialOrd,
4974 Ord,
4975 ::prost::Enumeration
4976 )]
4977 #[repr(i32)]
4978 pub enum MetadataCapState {
4979 Unknown = 0,
4982 Claimed = 1,
4984 Unclaimed = 2,
4986 Deleted = 3,
4988 }
4989 impl MetadataCapState {
4990 pub fn as_str_name(&self) -> &'static str {
4995 match self {
4996 Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
4997 Self::Claimed => "CLAIMED",
4998 Self::Unclaimed => "UNCLAIMED",
4999 Self::Deleted => "DELETED",
5000 }
5001 }
5002 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5004 match value {
5005 "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
5006 "CLAIMED" => Some(Self::Claimed),
5007 "UNCLAIMED" => Some(Self::Unclaimed),
5008 "DELETED" => Some(Self::Deleted),
5009 _ => None,
5010 }
5011 }
5012 }
5013}
5014#[non_exhaustive]
5016#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5017pub struct CoinTreasury {
5018 #[prost(string, optional, tag = "1")]
5020 pub id: ::core::option::Option<::prost::alloc::string::String>,
5021 #[prost(uint64, optional, tag = "2")]
5023 pub total_supply: ::core::option::Option<u64>,
5024 #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
5026 pub supply_state: ::core::option::Option<i32>,
5027}
5028pub mod coin_treasury {
5030 #[non_exhaustive]
5032 #[derive(
5033 Clone,
5034 Copy,
5035 Debug,
5036 PartialEq,
5037 Eq,
5038 Hash,
5039 PartialOrd,
5040 Ord,
5041 ::prost::Enumeration
5042 )]
5043 #[repr(i32)]
5044 pub enum SupplyState {
5045 Unknown = 0,
5047 Fixed = 1,
5049 BurnOnly = 2,
5051 }
5052 impl SupplyState {
5053 pub fn as_str_name(&self) -> &'static str {
5058 match self {
5059 Self::Unknown => "SUPPLY_STATE_UNKNOWN",
5060 Self::Fixed => "FIXED",
5061 Self::BurnOnly => "BURN_ONLY",
5062 }
5063 }
5064 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5066 match value {
5067 "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
5068 "FIXED" => Some(Self::Fixed),
5069 "BURN_ONLY" => Some(Self::BurnOnly),
5070 _ => None,
5071 }
5072 }
5073 }
5074}
5075#[non_exhaustive]
5077#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5078pub struct RegulatedCoinMetadata {
5079 #[prost(string, optional, tag = "1")]
5082 pub id: ::core::option::Option<::prost::alloc::string::String>,
5083 #[prost(string, optional, tag = "2")]
5085 pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
5086 #[prost(string, optional, tag = "3")]
5088 pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
5089 #[prost(bool, optional, tag = "4")]
5091 pub allow_global_pause: ::core::option::Option<bool>,
5092 #[prost(uint32, optional, tag = "5")]
5094 pub variant: ::core::option::Option<u32>,
5095 #[prost(
5097 enumeration = "regulated_coin_metadata::CoinRegulatedState",
5098 optional,
5099 tag = "6"
5100 )]
5101 pub coin_regulated_state: ::core::option::Option<i32>,
5102}
5103pub mod regulated_coin_metadata {
5105 #[non_exhaustive]
5107 #[derive(
5108 Clone,
5109 Copy,
5110 Debug,
5111 PartialEq,
5112 Eq,
5113 Hash,
5114 PartialOrd,
5115 Ord,
5116 ::prost::Enumeration
5117 )]
5118 #[repr(i32)]
5119 pub enum CoinRegulatedState {
5120 Unknown = 0,
5125 Regulated = 1,
5127 Unregulated = 2,
5129 }
5130 impl CoinRegulatedState {
5131 pub fn as_str_name(&self) -> &'static str {
5136 match self {
5137 Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
5138 Self::Regulated => "REGULATED",
5139 Self::Unregulated => "UNREGULATED",
5140 }
5141 }
5142 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5144 match value {
5145 "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
5146 "REGULATED" => Some(Self::Regulated),
5147 "UNREGULATED" => Some(Self::Unregulated),
5148 _ => None,
5149 }
5150 }
5151 }
5152}
5153#[non_exhaustive]
5155#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5156pub struct GetBalanceRequest {
5157 #[prost(string, optional, tag = "1")]
5159 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5160 #[prost(string, optional, tag = "2")]
5162 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5163}
5164#[non_exhaustive]
5167#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5168pub struct GetBalanceResponse {
5169 #[prost(message, optional, tag = "1")]
5171 pub balance: ::core::option::Option<Balance>,
5172}
5173#[non_exhaustive]
5175#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5176pub struct ListBalancesRequest {
5177 #[prost(string, optional, tag = "1")]
5179 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5180 #[prost(uint32, optional, tag = "2")]
5184 pub page_size: ::core::option::Option<u32>,
5185 #[prost(bytes = "bytes", optional, tag = "3")]
5191 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5192}
5193#[non_exhaustive]
5196#[derive(Clone, PartialEq, ::prost::Message)]
5197pub struct ListBalancesResponse {
5198 #[prost(message, repeated, tag = "1")]
5200 pub balances: ::prost::alloc::vec::Vec<Balance>,
5201 #[prost(bytes = "bytes", optional, tag = "2")]
5204 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5205}
5206#[non_exhaustive]
5208#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5209pub struct Balance {
5210 #[prost(string, optional, tag = "1")]
5212 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5213 #[prost(uint64, optional, tag = "3")]
5215 pub balance: ::core::option::Option<u64>,
5216}
5217#[non_exhaustive]
5219#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5220pub struct ListDynamicFieldsRequest {
5221 #[prost(string, optional, tag = "1")]
5223 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5224 #[prost(uint32, optional, tag = "2")]
5228 pub page_size: ::core::option::Option<u32>,
5229 #[prost(bytes = "bytes", optional, tag = "3")]
5235 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5236 #[prost(message, optional, tag = "4")]
5239 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5240}
5241#[non_exhaustive]
5243#[derive(Clone, PartialEq, ::prost::Message)]
5244pub struct ListDynamicFieldsResponse {
5245 #[prost(message, repeated, tag = "1")]
5247 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
5248 #[prost(bytes = "bytes", optional, tag = "2")]
5251 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5252}
5253#[non_exhaustive]
5254#[derive(Clone, PartialEq, ::prost::Message)]
5255pub struct DynamicField {
5256 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
5257 pub kind: ::core::option::Option<i32>,
5258 #[prost(string, optional, tag = "2")]
5260 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5261 #[prost(string, optional, tag = "3")]
5263 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
5264 #[prost(message, optional, tag = "4")]
5266 pub field_object: ::core::option::Option<Object>,
5267 #[prost(message, optional, tag = "5")]
5269 pub name: ::core::option::Option<Bcs>,
5270 #[prost(message, optional, tag = "6")]
5272 pub value: ::core::option::Option<Bcs>,
5273 #[prost(string, optional, tag = "7")]
5279 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
5280 #[prost(string, optional, tag = "8")]
5286 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
5287 #[prost(message, optional, tag = "9")]
5289 pub child_object: ::core::option::Option<Object>,
5290}
5291pub mod dynamic_field {
5293 #[non_exhaustive]
5294 #[derive(
5295 Clone,
5296 Copy,
5297 Debug,
5298 PartialEq,
5299 Eq,
5300 Hash,
5301 PartialOrd,
5302 Ord,
5303 ::prost::Enumeration
5304 )]
5305 #[repr(i32)]
5306 pub enum DynamicFieldKind {
5307 Unknown = 0,
5308 Field = 1,
5309 Object = 2,
5310 }
5311 impl DynamicFieldKind {
5312 pub fn as_str_name(&self) -> &'static str {
5317 match self {
5318 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
5319 Self::Field => "FIELD",
5320 Self::Object => "OBJECT",
5321 }
5322 }
5323 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5325 match value {
5326 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
5327 "FIELD" => Some(Self::Field),
5328 "OBJECT" => Some(Self::Object),
5329 _ => None,
5330 }
5331 }
5332 }
5333}
5334#[non_exhaustive]
5335#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5336pub struct ListOwnedObjectsRequest {
5337 #[prost(string, optional, tag = "1")]
5339 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5340 #[prost(uint32, optional, tag = "2")]
5344 pub page_size: ::core::option::Option<u32>,
5345 #[prost(bytes = "bytes", optional, tag = "3")]
5351 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5352 #[prost(message, optional, tag = "4")]
5355 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5356 #[prost(string, optional, tag = "5")]
5365 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5366}
5367#[non_exhaustive]
5368#[derive(Clone, PartialEq, ::prost::Message)]
5369pub struct ListOwnedObjectsResponse {
5370 #[prost(message, repeated, tag = "1")]
5372 pub objects: ::prost::alloc::vec::Vec<Object>,
5373 #[prost(bytes = "bytes", optional, tag = "2")]
5376 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5377}
5378pub mod state_service_client {
5380 #![allow(
5381 unused_variables,
5382 dead_code,
5383 missing_docs,
5384 clippy::wildcard_imports,
5385 clippy::let_unit_value,
5386 )]
5387 use tonic::codegen::*;
5388 use tonic::codegen::http::Uri;
5389 #[derive(Debug, Clone)]
5390 pub struct StateServiceClient<T> {
5391 inner: tonic::client::Grpc<T>,
5392 }
5393 impl StateServiceClient<tonic::transport::Channel> {
5394 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5396 where
5397 D: TryInto<tonic::transport::Endpoint>,
5398 D::Error: Into<StdError>,
5399 {
5400 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5401 Ok(Self::new(conn))
5402 }
5403 }
5404 impl<T> StateServiceClient<T>
5405 where
5406 T: tonic::client::GrpcService<tonic::body::Body>,
5407 T::Error: Into<StdError>,
5408 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5409 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5410 {
5411 pub fn new(inner: T) -> Self {
5412 let inner = tonic::client::Grpc::new(inner);
5413 Self { inner }
5414 }
5415 pub fn with_origin(inner: T, origin: Uri) -> Self {
5416 let inner = tonic::client::Grpc::with_origin(inner, origin);
5417 Self { inner }
5418 }
5419 pub fn with_interceptor<F>(
5420 inner: T,
5421 interceptor: F,
5422 ) -> StateServiceClient<InterceptedService<T, F>>
5423 where
5424 F: tonic::service::Interceptor,
5425 T::ResponseBody: Default,
5426 T: tonic::codegen::Service<
5427 http::Request<tonic::body::Body>,
5428 Response = http::Response<
5429 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5430 >,
5431 >,
5432 <T as tonic::codegen::Service<
5433 http::Request<tonic::body::Body>,
5434 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5435 {
5436 StateServiceClient::new(InterceptedService::new(inner, interceptor))
5437 }
5438 #[must_use]
5443 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5444 self.inner = self.inner.send_compressed(encoding);
5445 self
5446 }
5447 #[must_use]
5449 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5450 self.inner = self.inner.accept_compressed(encoding);
5451 self
5452 }
5453 #[must_use]
5457 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5458 self.inner = self.inner.max_decoding_message_size(limit);
5459 self
5460 }
5461 #[must_use]
5465 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5466 self.inner = self.inner.max_encoding_message_size(limit);
5467 self
5468 }
5469 pub async fn list_dynamic_fields(
5470 &mut self,
5471 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
5472 ) -> std::result::Result<
5473 tonic::Response<super::ListDynamicFieldsResponse>,
5474 tonic::Status,
5475 > {
5476 self.inner
5477 .ready()
5478 .await
5479 .map_err(|e| {
5480 tonic::Status::unknown(
5481 format!("Service was not ready: {}", e.into()),
5482 )
5483 })?;
5484 let codec = tonic_prost::ProstCodec::default();
5485 let path = http::uri::PathAndQuery::from_static(
5486 "/sui.rpc.v2.StateService/ListDynamicFields",
5487 );
5488 let mut req = request.into_request();
5489 req.extensions_mut()
5490 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
5491 self.inner.unary(req, path, codec).await
5492 }
5493 pub async fn list_owned_objects(
5494 &mut self,
5495 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
5496 ) -> std::result::Result<
5497 tonic::Response<super::ListOwnedObjectsResponse>,
5498 tonic::Status,
5499 > {
5500 self.inner
5501 .ready()
5502 .await
5503 .map_err(|e| {
5504 tonic::Status::unknown(
5505 format!("Service was not ready: {}", e.into()),
5506 )
5507 })?;
5508 let codec = tonic_prost::ProstCodec::default();
5509 let path = http::uri::PathAndQuery::from_static(
5510 "/sui.rpc.v2.StateService/ListOwnedObjects",
5511 );
5512 let mut req = request.into_request();
5513 req.extensions_mut()
5514 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
5515 self.inner.unary(req, path, codec).await
5516 }
5517 pub async fn get_coin_info(
5518 &mut self,
5519 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
5520 ) -> std::result::Result<
5521 tonic::Response<super::GetCoinInfoResponse>,
5522 tonic::Status,
5523 > {
5524 self.inner
5525 .ready()
5526 .await
5527 .map_err(|e| {
5528 tonic::Status::unknown(
5529 format!("Service was not ready: {}", e.into()),
5530 )
5531 })?;
5532 let codec = tonic_prost::ProstCodec::default();
5533 let path = http::uri::PathAndQuery::from_static(
5534 "/sui.rpc.v2.StateService/GetCoinInfo",
5535 );
5536 let mut req = request.into_request();
5537 req.extensions_mut()
5538 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
5539 self.inner.unary(req, path, codec).await
5540 }
5541 pub async fn get_balance(
5542 &mut self,
5543 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
5544 ) -> std::result::Result<
5545 tonic::Response<super::GetBalanceResponse>,
5546 tonic::Status,
5547 > {
5548 self.inner
5549 .ready()
5550 .await
5551 .map_err(|e| {
5552 tonic::Status::unknown(
5553 format!("Service was not ready: {}", e.into()),
5554 )
5555 })?;
5556 let codec = tonic_prost::ProstCodec::default();
5557 let path = http::uri::PathAndQuery::from_static(
5558 "/sui.rpc.v2.StateService/GetBalance",
5559 );
5560 let mut req = request.into_request();
5561 req.extensions_mut()
5562 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
5563 self.inner.unary(req, path, codec).await
5564 }
5565 pub async fn list_balances(
5566 &mut self,
5567 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
5568 ) -> std::result::Result<
5569 tonic::Response<super::ListBalancesResponse>,
5570 tonic::Status,
5571 > {
5572 self.inner
5573 .ready()
5574 .await
5575 .map_err(|e| {
5576 tonic::Status::unknown(
5577 format!("Service was not ready: {}", e.into()),
5578 )
5579 })?;
5580 let codec = tonic_prost::ProstCodec::default();
5581 let path = http::uri::PathAndQuery::from_static(
5582 "/sui.rpc.v2.StateService/ListBalances",
5583 );
5584 let mut req = request.into_request();
5585 req.extensions_mut()
5586 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
5587 self.inner.unary(req, path, codec).await
5588 }
5589 }
5590}
5591pub mod state_service_server {
5593 #![allow(
5594 unused_variables,
5595 dead_code,
5596 missing_docs,
5597 clippy::wildcard_imports,
5598 clippy::let_unit_value,
5599 )]
5600 use tonic::codegen::*;
5601 #[async_trait]
5603 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
5604 async fn list_dynamic_fields(
5605 &self,
5606 request: tonic::Request<super::ListDynamicFieldsRequest>,
5607 ) -> std::result::Result<
5608 tonic::Response<super::ListDynamicFieldsResponse>,
5609 tonic::Status,
5610 >;
5611 async fn list_owned_objects(
5612 &self,
5613 request: tonic::Request<super::ListOwnedObjectsRequest>,
5614 ) -> std::result::Result<
5615 tonic::Response<super::ListOwnedObjectsResponse>,
5616 tonic::Status,
5617 >;
5618 async fn get_coin_info(
5619 &self,
5620 request: tonic::Request<super::GetCoinInfoRequest>,
5621 ) -> std::result::Result<
5622 tonic::Response<super::GetCoinInfoResponse>,
5623 tonic::Status,
5624 >;
5625 async fn get_balance(
5626 &self,
5627 request: tonic::Request<super::GetBalanceRequest>,
5628 ) -> std::result::Result<
5629 tonic::Response<super::GetBalanceResponse>,
5630 tonic::Status,
5631 >;
5632 async fn list_balances(
5633 &self,
5634 request: tonic::Request<super::ListBalancesRequest>,
5635 ) -> std::result::Result<
5636 tonic::Response<super::ListBalancesResponse>,
5637 tonic::Status,
5638 >;
5639 }
5640 #[derive(Debug)]
5641 pub struct StateServiceServer<T> {
5642 inner: Arc<T>,
5643 accept_compression_encodings: EnabledCompressionEncodings,
5644 send_compression_encodings: EnabledCompressionEncodings,
5645 max_decoding_message_size: Option<usize>,
5646 max_encoding_message_size: Option<usize>,
5647 }
5648 impl<T> StateServiceServer<T> {
5649 pub fn new(inner: T) -> Self {
5650 Self::from_arc(Arc::new(inner))
5651 }
5652 pub fn from_arc(inner: Arc<T>) -> Self {
5653 Self {
5654 inner,
5655 accept_compression_encodings: Default::default(),
5656 send_compression_encodings: Default::default(),
5657 max_decoding_message_size: None,
5658 max_encoding_message_size: None,
5659 }
5660 }
5661 pub fn with_interceptor<F>(
5662 inner: T,
5663 interceptor: F,
5664 ) -> InterceptedService<Self, F>
5665 where
5666 F: tonic::service::Interceptor,
5667 {
5668 InterceptedService::new(Self::new(inner), interceptor)
5669 }
5670 #[must_use]
5672 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5673 self.accept_compression_encodings.enable(encoding);
5674 self
5675 }
5676 #[must_use]
5678 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5679 self.send_compression_encodings.enable(encoding);
5680 self
5681 }
5682 #[must_use]
5686 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5687 self.max_decoding_message_size = Some(limit);
5688 self
5689 }
5690 #[must_use]
5694 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5695 self.max_encoding_message_size = Some(limit);
5696 self
5697 }
5698 }
5699 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
5700 where
5701 T: StateService,
5702 B: Body + std::marker::Send + 'static,
5703 B::Error: Into<StdError> + std::marker::Send + 'static,
5704 {
5705 type Response = http::Response<tonic::body::Body>;
5706 type Error = std::convert::Infallible;
5707 type Future = BoxFuture<Self::Response, Self::Error>;
5708 fn poll_ready(
5709 &mut self,
5710 _cx: &mut Context<'_>,
5711 ) -> Poll<std::result::Result<(), Self::Error>> {
5712 Poll::Ready(Ok(()))
5713 }
5714 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5715 match req.uri().path() {
5716 "/sui.rpc.v2.StateService/ListDynamicFields" => {
5717 #[allow(non_camel_case_types)]
5718 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
5719 impl<
5720 T: StateService,
5721 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
5722 for ListDynamicFieldsSvc<T> {
5723 type Response = super::ListDynamicFieldsResponse;
5724 type Future = BoxFuture<
5725 tonic::Response<Self::Response>,
5726 tonic::Status,
5727 >;
5728 fn call(
5729 &mut self,
5730 request: tonic::Request<super::ListDynamicFieldsRequest>,
5731 ) -> Self::Future {
5732 let inner = Arc::clone(&self.0);
5733 let fut = async move {
5734 <T as StateService>::list_dynamic_fields(&inner, request)
5735 .await
5736 };
5737 Box::pin(fut)
5738 }
5739 }
5740 let accept_compression_encodings = self.accept_compression_encodings;
5741 let send_compression_encodings = self.send_compression_encodings;
5742 let max_decoding_message_size = self.max_decoding_message_size;
5743 let max_encoding_message_size = self.max_encoding_message_size;
5744 let inner = self.inner.clone();
5745 let fut = async move {
5746 let method = ListDynamicFieldsSvc(inner);
5747 let codec = tonic_prost::ProstCodec::default();
5748 let mut grpc = tonic::server::Grpc::new(codec)
5749 .apply_compression_config(
5750 accept_compression_encodings,
5751 send_compression_encodings,
5752 )
5753 .apply_max_message_size_config(
5754 max_decoding_message_size,
5755 max_encoding_message_size,
5756 );
5757 let res = grpc.unary(method, req).await;
5758 Ok(res)
5759 };
5760 Box::pin(fut)
5761 }
5762 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
5763 #[allow(non_camel_case_types)]
5764 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
5765 impl<
5766 T: StateService,
5767 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
5768 for ListOwnedObjectsSvc<T> {
5769 type Response = super::ListOwnedObjectsResponse;
5770 type Future = BoxFuture<
5771 tonic::Response<Self::Response>,
5772 tonic::Status,
5773 >;
5774 fn call(
5775 &mut self,
5776 request: tonic::Request<super::ListOwnedObjectsRequest>,
5777 ) -> Self::Future {
5778 let inner = Arc::clone(&self.0);
5779 let fut = async move {
5780 <T as StateService>::list_owned_objects(&inner, request)
5781 .await
5782 };
5783 Box::pin(fut)
5784 }
5785 }
5786 let accept_compression_encodings = self.accept_compression_encodings;
5787 let send_compression_encodings = self.send_compression_encodings;
5788 let max_decoding_message_size = self.max_decoding_message_size;
5789 let max_encoding_message_size = self.max_encoding_message_size;
5790 let inner = self.inner.clone();
5791 let fut = async move {
5792 let method = ListOwnedObjectsSvc(inner);
5793 let codec = tonic_prost::ProstCodec::default();
5794 let mut grpc = tonic::server::Grpc::new(codec)
5795 .apply_compression_config(
5796 accept_compression_encodings,
5797 send_compression_encodings,
5798 )
5799 .apply_max_message_size_config(
5800 max_decoding_message_size,
5801 max_encoding_message_size,
5802 );
5803 let res = grpc.unary(method, req).await;
5804 Ok(res)
5805 };
5806 Box::pin(fut)
5807 }
5808 "/sui.rpc.v2.StateService/GetCoinInfo" => {
5809 #[allow(non_camel_case_types)]
5810 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
5811 impl<
5812 T: StateService,
5813 > tonic::server::UnaryService<super::GetCoinInfoRequest>
5814 for GetCoinInfoSvc<T> {
5815 type Response = super::GetCoinInfoResponse;
5816 type Future = BoxFuture<
5817 tonic::Response<Self::Response>,
5818 tonic::Status,
5819 >;
5820 fn call(
5821 &mut self,
5822 request: tonic::Request<super::GetCoinInfoRequest>,
5823 ) -> Self::Future {
5824 let inner = Arc::clone(&self.0);
5825 let fut = async move {
5826 <T as StateService>::get_coin_info(&inner, request).await
5827 };
5828 Box::pin(fut)
5829 }
5830 }
5831 let accept_compression_encodings = self.accept_compression_encodings;
5832 let send_compression_encodings = self.send_compression_encodings;
5833 let max_decoding_message_size = self.max_decoding_message_size;
5834 let max_encoding_message_size = self.max_encoding_message_size;
5835 let inner = self.inner.clone();
5836 let fut = async move {
5837 let method = GetCoinInfoSvc(inner);
5838 let codec = tonic_prost::ProstCodec::default();
5839 let mut grpc = tonic::server::Grpc::new(codec)
5840 .apply_compression_config(
5841 accept_compression_encodings,
5842 send_compression_encodings,
5843 )
5844 .apply_max_message_size_config(
5845 max_decoding_message_size,
5846 max_encoding_message_size,
5847 );
5848 let res = grpc.unary(method, req).await;
5849 Ok(res)
5850 };
5851 Box::pin(fut)
5852 }
5853 "/sui.rpc.v2.StateService/GetBalance" => {
5854 #[allow(non_camel_case_types)]
5855 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
5856 impl<
5857 T: StateService,
5858 > tonic::server::UnaryService<super::GetBalanceRequest>
5859 for GetBalanceSvc<T> {
5860 type Response = super::GetBalanceResponse;
5861 type Future = BoxFuture<
5862 tonic::Response<Self::Response>,
5863 tonic::Status,
5864 >;
5865 fn call(
5866 &mut self,
5867 request: tonic::Request<super::GetBalanceRequest>,
5868 ) -> Self::Future {
5869 let inner = Arc::clone(&self.0);
5870 let fut = async move {
5871 <T as StateService>::get_balance(&inner, request).await
5872 };
5873 Box::pin(fut)
5874 }
5875 }
5876 let accept_compression_encodings = self.accept_compression_encodings;
5877 let send_compression_encodings = self.send_compression_encodings;
5878 let max_decoding_message_size = self.max_decoding_message_size;
5879 let max_encoding_message_size = self.max_encoding_message_size;
5880 let inner = self.inner.clone();
5881 let fut = async move {
5882 let method = GetBalanceSvc(inner);
5883 let codec = tonic_prost::ProstCodec::default();
5884 let mut grpc = tonic::server::Grpc::new(codec)
5885 .apply_compression_config(
5886 accept_compression_encodings,
5887 send_compression_encodings,
5888 )
5889 .apply_max_message_size_config(
5890 max_decoding_message_size,
5891 max_encoding_message_size,
5892 );
5893 let res = grpc.unary(method, req).await;
5894 Ok(res)
5895 };
5896 Box::pin(fut)
5897 }
5898 "/sui.rpc.v2.StateService/ListBalances" => {
5899 #[allow(non_camel_case_types)]
5900 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
5901 impl<
5902 T: StateService,
5903 > tonic::server::UnaryService<super::ListBalancesRequest>
5904 for ListBalancesSvc<T> {
5905 type Response = super::ListBalancesResponse;
5906 type Future = BoxFuture<
5907 tonic::Response<Self::Response>,
5908 tonic::Status,
5909 >;
5910 fn call(
5911 &mut self,
5912 request: tonic::Request<super::ListBalancesRequest>,
5913 ) -> Self::Future {
5914 let inner = Arc::clone(&self.0);
5915 let fut = async move {
5916 <T as StateService>::list_balances(&inner, request).await
5917 };
5918 Box::pin(fut)
5919 }
5920 }
5921 let accept_compression_encodings = self.accept_compression_encodings;
5922 let send_compression_encodings = self.send_compression_encodings;
5923 let max_decoding_message_size = self.max_decoding_message_size;
5924 let max_encoding_message_size = self.max_encoding_message_size;
5925 let inner = self.inner.clone();
5926 let fut = async move {
5927 let method = ListBalancesSvc(inner);
5928 let codec = tonic_prost::ProstCodec::default();
5929 let mut grpc = tonic::server::Grpc::new(codec)
5930 .apply_compression_config(
5931 accept_compression_encodings,
5932 send_compression_encodings,
5933 )
5934 .apply_max_message_size_config(
5935 max_decoding_message_size,
5936 max_encoding_message_size,
5937 );
5938 let res = grpc.unary(method, req).await;
5939 Ok(res)
5940 };
5941 Box::pin(fut)
5942 }
5943 _ => {
5944 Box::pin(async move {
5945 let mut response = http::Response::new(
5946 tonic::body::Body::default(),
5947 );
5948 let headers = response.headers_mut();
5949 headers
5950 .insert(
5951 tonic::Status::GRPC_STATUS,
5952 (tonic::Code::Unimplemented as i32).into(),
5953 );
5954 headers
5955 .insert(
5956 http::header::CONTENT_TYPE,
5957 tonic::metadata::GRPC_CONTENT_TYPE,
5958 );
5959 Ok(response)
5960 })
5961 }
5962 }
5963 }
5964 }
5965 impl<T> Clone for StateServiceServer<T> {
5966 fn clone(&self) -> Self {
5967 let inner = self.inner.clone();
5968 Self {
5969 inner,
5970 accept_compression_encodings: self.accept_compression_encodings,
5971 send_compression_encodings: self.send_compression_encodings,
5972 max_decoding_message_size: self.max_decoding_message_size,
5973 max_encoding_message_size: self.max_encoding_message_size,
5974 }
5975 }
5976 }
5977 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
5979 impl<T> tonic::server::NamedService for StateServiceServer<T> {
5980 const NAME: &'static str = SERVICE_NAME;
5981 }
5982}
5983#[non_exhaustive]
5985#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5986pub struct SubscribeCheckpointsRequest {
5987 #[prost(message, optional, tag = "1")]
5990 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5991}
5992#[non_exhaustive]
5994#[derive(Clone, PartialEq, ::prost::Message)]
5995pub struct SubscribeCheckpointsResponse {
5996 #[prost(uint64, optional, tag = "1")]
5999 pub cursor: ::core::option::Option<u64>,
6000 #[prost(message, optional, tag = "2")]
6002 pub checkpoint: ::core::option::Option<Checkpoint>,
6003}
6004pub mod subscription_service_client {
6006 #![allow(
6007 unused_variables,
6008 dead_code,
6009 missing_docs,
6010 clippy::wildcard_imports,
6011 clippy::let_unit_value,
6012 )]
6013 use tonic::codegen::*;
6014 use tonic::codegen::http::Uri;
6015 #[derive(Debug, Clone)]
6016 pub struct SubscriptionServiceClient<T> {
6017 inner: tonic::client::Grpc<T>,
6018 }
6019 impl SubscriptionServiceClient<tonic::transport::Channel> {
6020 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6022 where
6023 D: TryInto<tonic::transport::Endpoint>,
6024 D::Error: Into<StdError>,
6025 {
6026 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6027 Ok(Self::new(conn))
6028 }
6029 }
6030 impl<T> SubscriptionServiceClient<T>
6031 where
6032 T: tonic::client::GrpcService<tonic::body::Body>,
6033 T::Error: Into<StdError>,
6034 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6035 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6036 {
6037 pub fn new(inner: T) -> Self {
6038 let inner = tonic::client::Grpc::new(inner);
6039 Self { inner }
6040 }
6041 pub fn with_origin(inner: T, origin: Uri) -> Self {
6042 let inner = tonic::client::Grpc::with_origin(inner, origin);
6043 Self { inner }
6044 }
6045 pub fn with_interceptor<F>(
6046 inner: T,
6047 interceptor: F,
6048 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
6049 where
6050 F: tonic::service::Interceptor,
6051 T::ResponseBody: Default,
6052 T: tonic::codegen::Service<
6053 http::Request<tonic::body::Body>,
6054 Response = http::Response<
6055 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6056 >,
6057 >,
6058 <T as tonic::codegen::Service<
6059 http::Request<tonic::body::Body>,
6060 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6061 {
6062 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
6063 }
6064 #[must_use]
6069 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6070 self.inner = self.inner.send_compressed(encoding);
6071 self
6072 }
6073 #[must_use]
6075 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6076 self.inner = self.inner.accept_compressed(encoding);
6077 self
6078 }
6079 #[must_use]
6083 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6084 self.inner = self.inner.max_decoding_message_size(limit);
6085 self
6086 }
6087 #[must_use]
6091 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6092 self.inner = self.inner.max_encoding_message_size(limit);
6093 self
6094 }
6095 pub async fn subscribe_checkpoints(
6107 &mut self,
6108 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
6109 ) -> std::result::Result<
6110 tonic::Response<
6111 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
6112 >,
6113 tonic::Status,
6114 > {
6115 self.inner
6116 .ready()
6117 .await
6118 .map_err(|e| {
6119 tonic::Status::unknown(
6120 format!("Service was not ready: {}", e.into()),
6121 )
6122 })?;
6123 let codec = tonic_prost::ProstCodec::default();
6124 let path = http::uri::PathAndQuery::from_static(
6125 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
6126 );
6127 let mut req = request.into_request();
6128 req.extensions_mut()
6129 .insert(
6130 GrpcMethod::new(
6131 "sui.rpc.v2.SubscriptionService",
6132 "SubscribeCheckpoints",
6133 ),
6134 );
6135 self.inner.server_streaming(req, path, codec).await
6136 }
6137 }
6138}
6139pub mod subscription_service_server {
6141 #![allow(
6142 unused_variables,
6143 dead_code,
6144 missing_docs,
6145 clippy::wildcard_imports,
6146 clippy::let_unit_value,
6147 )]
6148 use tonic::codegen::*;
6149 #[async_trait]
6151 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
6152 type SubscribeCheckpointsStream: tonic::codegen::tokio_stream::Stream<
6154 Item = std::result::Result<
6155 super::SubscribeCheckpointsResponse,
6156 tonic::Status,
6157 >,
6158 >
6159 + std::marker::Send
6160 + 'static;
6161 async fn subscribe_checkpoints(
6173 &self,
6174 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6175 ) -> std::result::Result<
6176 tonic::Response<Self::SubscribeCheckpointsStream>,
6177 tonic::Status,
6178 >;
6179 }
6180 #[derive(Debug)]
6181 pub struct SubscriptionServiceServer<T> {
6182 inner: Arc<T>,
6183 accept_compression_encodings: EnabledCompressionEncodings,
6184 send_compression_encodings: EnabledCompressionEncodings,
6185 max_decoding_message_size: Option<usize>,
6186 max_encoding_message_size: Option<usize>,
6187 }
6188 impl<T> SubscriptionServiceServer<T> {
6189 pub fn new(inner: T) -> Self {
6190 Self::from_arc(Arc::new(inner))
6191 }
6192 pub fn from_arc(inner: Arc<T>) -> Self {
6193 Self {
6194 inner,
6195 accept_compression_encodings: Default::default(),
6196 send_compression_encodings: Default::default(),
6197 max_decoding_message_size: None,
6198 max_encoding_message_size: None,
6199 }
6200 }
6201 pub fn with_interceptor<F>(
6202 inner: T,
6203 interceptor: F,
6204 ) -> InterceptedService<Self, F>
6205 where
6206 F: tonic::service::Interceptor,
6207 {
6208 InterceptedService::new(Self::new(inner), interceptor)
6209 }
6210 #[must_use]
6212 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6213 self.accept_compression_encodings.enable(encoding);
6214 self
6215 }
6216 #[must_use]
6218 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6219 self.send_compression_encodings.enable(encoding);
6220 self
6221 }
6222 #[must_use]
6226 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6227 self.max_decoding_message_size = Some(limit);
6228 self
6229 }
6230 #[must_use]
6234 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6235 self.max_encoding_message_size = Some(limit);
6236 self
6237 }
6238 }
6239 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
6240 where
6241 T: SubscriptionService,
6242 B: Body + std::marker::Send + 'static,
6243 B::Error: Into<StdError> + std::marker::Send + 'static,
6244 {
6245 type Response = http::Response<tonic::body::Body>;
6246 type Error = std::convert::Infallible;
6247 type Future = BoxFuture<Self::Response, Self::Error>;
6248 fn poll_ready(
6249 &mut self,
6250 _cx: &mut Context<'_>,
6251 ) -> Poll<std::result::Result<(), Self::Error>> {
6252 Poll::Ready(Ok(()))
6253 }
6254 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6255 match req.uri().path() {
6256 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
6257 #[allow(non_camel_case_types)]
6258 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
6259 impl<
6260 T: SubscriptionService,
6261 > tonic::server::ServerStreamingService<
6262 super::SubscribeCheckpointsRequest,
6263 > for SubscribeCheckpointsSvc<T> {
6264 type Response = super::SubscribeCheckpointsResponse;
6265 type ResponseStream = T::SubscribeCheckpointsStream;
6266 type Future = BoxFuture<
6267 tonic::Response<Self::ResponseStream>,
6268 tonic::Status,
6269 >;
6270 fn call(
6271 &mut self,
6272 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6273 ) -> Self::Future {
6274 let inner = Arc::clone(&self.0);
6275 let fut = async move {
6276 <T as SubscriptionService>::subscribe_checkpoints(
6277 &inner,
6278 request,
6279 )
6280 .await
6281 };
6282 Box::pin(fut)
6283 }
6284 }
6285 let accept_compression_encodings = self.accept_compression_encodings;
6286 let send_compression_encodings = self.send_compression_encodings;
6287 let max_decoding_message_size = self.max_decoding_message_size;
6288 let max_encoding_message_size = self.max_encoding_message_size;
6289 let inner = self.inner.clone();
6290 let fut = async move {
6291 let method = SubscribeCheckpointsSvc(inner);
6292 let codec = tonic_prost::ProstCodec::default();
6293 let mut grpc = tonic::server::Grpc::new(codec)
6294 .apply_compression_config(
6295 accept_compression_encodings,
6296 send_compression_encodings,
6297 )
6298 .apply_max_message_size_config(
6299 max_decoding_message_size,
6300 max_encoding_message_size,
6301 );
6302 let res = grpc.server_streaming(method, req).await;
6303 Ok(res)
6304 };
6305 Box::pin(fut)
6306 }
6307 _ => {
6308 Box::pin(async move {
6309 let mut response = http::Response::new(
6310 tonic::body::Body::default(),
6311 );
6312 let headers = response.headers_mut();
6313 headers
6314 .insert(
6315 tonic::Status::GRPC_STATUS,
6316 (tonic::Code::Unimplemented as i32).into(),
6317 );
6318 headers
6319 .insert(
6320 http::header::CONTENT_TYPE,
6321 tonic::metadata::GRPC_CONTENT_TYPE,
6322 );
6323 Ok(response)
6324 })
6325 }
6326 }
6327 }
6328 }
6329 impl<T> Clone for SubscriptionServiceServer<T> {
6330 fn clone(&self) -> Self {
6331 let inner = self.inner.clone();
6332 Self {
6333 inner,
6334 accept_compression_encodings: self.accept_compression_encodings,
6335 send_compression_encodings: self.send_compression_encodings,
6336 max_decoding_message_size: self.max_decoding_message_size,
6337 max_encoding_message_size: self.max_encoding_message_size,
6338 }
6339 }
6340 }
6341 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
6343 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
6344 const NAME: &'static str = SERVICE_NAME;
6345 }
6346}
6347#[non_exhaustive]
6348#[derive(Clone, PartialEq, ::prost::Message)]
6349pub struct SystemState {
6350 #[prost(uint64, optional, tag = "1")]
6352 pub version: ::core::option::Option<u64>,
6353 #[prost(uint64, optional, tag = "2")]
6355 pub epoch: ::core::option::Option<u64>,
6356 #[prost(uint64, optional, tag = "3")]
6358 pub protocol_version: ::core::option::Option<u64>,
6359 #[prost(message, optional, tag = "4")]
6361 pub validators: ::core::option::Option<ValidatorSet>,
6362 #[prost(message, optional, tag = "5")]
6364 pub storage_fund: ::core::option::Option<StorageFund>,
6365 #[prost(message, optional, tag = "6")]
6367 pub parameters: ::core::option::Option<SystemParameters>,
6368 #[prost(uint64, optional, tag = "7")]
6370 pub reference_gas_price: ::core::option::Option<u64>,
6371 #[prost(message, repeated, tag = "8")]
6379 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
6380 #[prost(message, optional, tag = "9")]
6382 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
6383 #[prost(bool, optional, tag = "10")]
6390 pub safe_mode: ::core::option::Option<bool>,
6391 #[prost(uint64, optional, tag = "11")]
6393 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
6394 #[prost(uint64, optional, tag = "12")]
6396 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
6397 #[prost(uint64, optional, tag = "13")]
6399 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
6400 #[prost(uint64, optional, tag = "14")]
6402 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
6403 #[prost(uint64, optional, tag = "15")]
6405 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
6406 #[prost(message, optional, tag = "16")]
6408 pub extra_fields: ::core::option::Option<MoveTable>,
6409}
6410#[non_exhaustive]
6411#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6412pub struct ValidatorReportRecord {
6413 #[prost(string, optional, tag = "1")]
6415 pub reported: ::core::option::Option<::prost::alloc::string::String>,
6416 #[prost(string, repeated, tag = "2")]
6418 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6419}
6420#[non_exhaustive]
6421#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6422pub struct SystemParameters {
6423 #[prost(uint64, optional, tag = "1")]
6425 pub epoch_duration_ms: ::core::option::Option<u64>,
6426 #[prost(uint64, optional, tag = "2")]
6428 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
6429 #[prost(uint64, optional, tag = "3")]
6431 pub min_validator_count: ::core::option::Option<u64>,
6432 #[prost(uint64, optional, tag = "4")]
6435 pub max_validator_count: ::core::option::Option<u64>,
6436 #[prost(uint64, optional, tag = "5")]
6439 pub min_validator_joining_stake: ::core::option::Option<u64>,
6440 #[prost(uint64, optional, tag = "6")]
6445 pub validator_low_stake_threshold: ::core::option::Option<u64>,
6446 #[prost(uint64, optional, tag = "7")]
6450 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
6451 #[prost(uint64, optional, tag = "8")]
6454 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
6455 #[prost(message, optional, tag = "9")]
6457 pub extra_fields: ::core::option::Option<MoveTable>,
6458}
6459#[non_exhaustive]
6461#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6462pub struct MoveTable {
6463 #[prost(string, optional, tag = "1")]
6465 pub id: ::core::option::Option<::prost::alloc::string::String>,
6466 #[prost(uint64, optional, tag = "2")]
6468 pub size: ::core::option::Option<u64>,
6469}
6470#[non_exhaustive]
6471#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6472pub struct StakeSubsidy {
6473 #[prost(uint64, optional, tag = "1")]
6475 pub balance: ::core::option::Option<u64>,
6476 #[prost(uint64, optional, tag = "2")]
6478 pub distribution_counter: ::core::option::Option<u64>,
6479 #[prost(uint64, optional, tag = "3")]
6482 pub current_distribution_amount: ::core::option::Option<u64>,
6483 #[prost(uint64, optional, tag = "4")]
6485 pub stake_subsidy_period_length: ::core::option::Option<u64>,
6486 #[prost(uint32, optional, tag = "5")]
6489 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
6490 #[prost(message, optional, tag = "6")]
6492 pub extra_fields: ::core::option::Option<MoveTable>,
6493}
6494#[non_exhaustive]
6496#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6497pub struct StorageFund {
6498 #[prost(uint64, optional, tag = "1")]
6504 pub total_object_storage_rebates: ::core::option::Option<u64>,
6505 #[prost(uint64, optional, tag = "2")]
6508 pub non_refundable_balance: ::core::option::Option<u64>,
6509}
6510#[non_exhaustive]
6511#[derive(Clone, PartialEq, ::prost::Message)]
6512pub struct ValidatorSet {
6513 #[prost(uint64, optional, tag = "1")]
6516 pub total_stake: ::core::option::Option<u64>,
6517 #[prost(message, repeated, tag = "2")]
6519 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
6520 #[prost(message, optional, tag = "3")]
6525 pub pending_active_validators: ::core::option::Option<MoveTable>,
6526 #[prost(uint64, repeated, tag = "4")]
6529 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
6530 #[prost(message, optional, tag = "5")]
6534 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
6535 #[prost(message, optional, tag = "6")]
6541 pub inactive_validators: ::core::option::Option<MoveTable>,
6542 #[prost(message, optional, tag = "7")]
6550 pub validator_candidates: ::core::option::Option<MoveTable>,
6551 #[prost(btree_map = "string, uint64", tag = "8")]
6553 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
6554 ::prost::alloc::string::String,
6555 u64,
6556 >,
6557 #[prost(message, optional, tag = "9")]
6559 pub extra_fields: ::core::option::Option<MoveTable>,
6560}
6561#[non_exhaustive]
6565#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6566pub struct Validator {
6567 #[prost(string, optional, tag = "1")]
6569 pub name: ::core::option::Option<::prost::alloc::string::String>,
6570 #[prost(string, optional, tag = "2")]
6573 pub address: ::core::option::Option<::prost::alloc::string::String>,
6574 #[prost(string, optional, tag = "3")]
6575 pub description: ::core::option::Option<::prost::alloc::string::String>,
6576 #[prost(string, optional, tag = "4")]
6577 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
6578 #[prost(string, optional, tag = "5")]
6579 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
6580 #[prost(bytes = "bytes", optional, tag = "7")]
6583 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6584 #[prost(bytes = "bytes", optional, tag = "8")]
6586 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6587 #[prost(bytes = "bytes", optional, tag = "10")]
6590 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6591 #[prost(bytes = "bytes", optional, tag = "12")]
6593 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6594 #[prost(string, optional, tag = "13")]
6596 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
6597 #[prost(string, optional, tag = "14")]
6599 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6600 #[prost(string, optional, tag = "15")]
6602 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
6603 #[prost(string, optional, tag = "16")]
6605 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
6606 #[prost(bytes = "bytes", optional, tag = "18")]
6607 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6608 #[prost(bytes = "bytes", optional, tag = "19")]
6609 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6610 #[prost(bytes = "bytes", optional, tag = "21")]
6611 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6612 #[prost(bytes = "bytes", optional, tag = "23")]
6613 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6614 #[prost(string, optional, tag = "24")]
6615 pub next_epoch_network_address: ::core::option::Option<
6616 ::prost::alloc::string::String,
6617 >,
6618 #[prost(string, optional, tag = "25")]
6619 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6620 #[prost(string, optional, tag = "26")]
6621 pub next_epoch_primary_address: ::core::option::Option<
6622 ::prost::alloc::string::String,
6623 >,
6624 #[prost(string, optional, tag = "27")]
6625 pub next_epoch_worker_address: ::core::option::Option<
6626 ::prost::alloc::string::String,
6627 >,
6628 #[prost(message, optional, tag = "28")]
6630 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
6631 #[prost(uint64, optional, tag = "29")]
6634 pub voting_power: ::core::option::Option<u64>,
6635 #[prost(string, optional, tag = "30")]
6637 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6638 #[prost(uint64, optional, tag = "31")]
6640 pub gas_price: ::core::option::Option<u64>,
6641 #[prost(message, optional, tag = "32")]
6643 pub staking_pool: ::core::option::Option<StakingPool>,
6644 #[prost(uint64, optional, tag = "33")]
6646 pub commission_rate: ::core::option::Option<u64>,
6647 #[prost(uint64, optional, tag = "34")]
6649 pub next_epoch_stake: ::core::option::Option<u64>,
6650 #[prost(uint64, optional, tag = "35")]
6652 pub next_epoch_gas_price: ::core::option::Option<u64>,
6653 #[prost(uint64, optional, tag = "36")]
6655 pub next_epoch_commission_rate: ::core::option::Option<u64>,
6656 #[prost(message, optional, tag = "37")]
6658 pub extra_fields: ::core::option::Option<MoveTable>,
6659}
6660#[non_exhaustive]
6662#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6663pub struct StakingPool {
6664 #[prost(string, optional, tag = "1")]
6666 pub id: ::core::option::Option<::prost::alloc::string::String>,
6667 #[prost(uint64, optional, tag = "2")]
6670 pub activation_epoch: ::core::option::Option<u64>,
6671 #[prost(uint64, optional, tag = "3")]
6674 pub deactivation_epoch: ::core::option::Option<u64>,
6675 #[prost(uint64, optional, tag = "4")]
6678 pub sui_balance: ::core::option::Option<u64>,
6679 #[prost(uint64, optional, tag = "5")]
6681 pub rewards_pool: ::core::option::Option<u64>,
6682 #[prost(uint64, optional, tag = "6")]
6684 pub pool_token_balance: ::core::option::Option<u64>,
6685 #[prost(message, optional, tag = "7")]
6692 pub exchange_rates: ::core::option::Option<MoveTable>,
6693 #[prost(uint64, optional, tag = "8")]
6695 pub pending_stake: ::core::option::Option<u64>,
6696 #[prost(uint64, optional, tag = "9")]
6699 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
6700 #[prost(uint64, optional, tag = "10")]
6702 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
6703 #[prost(message, optional, tag = "11")]
6705 pub extra_fields: ::core::option::Option<MoveTable>,
6706}
6707#[non_exhaustive]
6709#[derive(Clone, PartialEq, ::prost::Message)]
6710pub struct Transaction {
6711 #[prost(message, optional, tag = "1")]
6713 pub bcs: ::core::option::Option<Bcs>,
6714 #[prost(string, optional, tag = "2")]
6716 pub digest: ::core::option::Option<::prost::alloc::string::String>,
6717 #[prost(int32, optional, tag = "3")]
6719 pub version: ::core::option::Option<i32>,
6720 #[prost(message, optional, tag = "4")]
6721 pub kind: ::core::option::Option<TransactionKind>,
6722 #[prost(string, optional, tag = "5")]
6723 pub sender: ::core::option::Option<::prost::alloc::string::String>,
6724 #[prost(message, optional, tag = "6")]
6725 pub gas_payment: ::core::option::Option<GasPayment>,
6726 #[prost(message, optional, tag = "7")]
6727 pub expiration: ::core::option::Option<TransactionExpiration>,
6728}
6729#[non_exhaustive]
6731#[derive(Clone, PartialEq, ::prost::Message)]
6732pub struct GasPayment {
6733 #[prost(message, repeated, tag = "1")]
6735 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
6736 #[prost(string, optional, tag = "2")]
6738 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6739 #[prost(uint64, optional, tag = "3")]
6743 pub price: ::core::option::Option<u64>,
6744 #[prost(uint64, optional, tag = "4")]
6746 pub budget: ::core::option::Option<u64>,
6747}
6748#[non_exhaustive]
6750#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6751pub struct TransactionExpiration {
6752 #[prost(
6753 enumeration = "transaction_expiration::TransactionExpirationKind",
6754 optional,
6755 tag = "1"
6756 )]
6757 pub kind: ::core::option::Option<i32>,
6758 #[prost(uint64, optional, tag = "2")]
6759 pub epoch: ::core::option::Option<u64>,
6760}
6761pub mod transaction_expiration {
6763 #[non_exhaustive]
6764 #[derive(
6765 Clone,
6766 Copy,
6767 Debug,
6768 PartialEq,
6769 Eq,
6770 Hash,
6771 PartialOrd,
6772 Ord,
6773 ::prost::Enumeration
6774 )]
6775 #[repr(i32)]
6776 pub enum TransactionExpirationKind {
6777 Unknown = 0,
6778 None = 1,
6780 Epoch = 2,
6783 }
6784 impl TransactionExpirationKind {
6785 pub fn as_str_name(&self) -> &'static str {
6790 match self {
6791 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
6792 Self::None => "NONE",
6793 Self::Epoch => "EPOCH",
6794 }
6795 }
6796 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6798 match value {
6799 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
6800 "NONE" => Some(Self::None),
6801 "EPOCH" => Some(Self::Epoch),
6802 _ => None,
6803 }
6804 }
6805 }
6806}
6807#[non_exhaustive]
6809#[derive(Clone, PartialEq, ::prost::Message)]
6810pub struct TransactionKind {
6811 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
6812 pub kind: ::core::option::Option<i32>,
6813 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
6814 pub data: ::core::option::Option<transaction_kind::Data>,
6815}
6816pub mod transaction_kind {
6818 #[non_exhaustive]
6819 #[derive(
6820 Clone,
6821 Copy,
6822 Debug,
6823 PartialEq,
6824 Eq,
6825 Hash,
6826 PartialOrd,
6827 Ord,
6828 ::prost::Enumeration
6829 )]
6830 #[repr(i32)]
6831 pub enum Kind {
6832 Unknown = 0,
6833 ProgrammableTransaction = 1,
6835 ChangeEpoch = 2,
6840 Genesis = 3,
6845 ConsensusCommitPrologueV1 = 4,
6847 AuthenticatorStateUpdate = 5,
6849 EndOfEpoch = 6,
6852 RandomnessStateUpdate = 7,
6854 ConsensusCommitPrologueV2 = 8,
6856 ConsensusCommitPrologueV3 = 9,
6858 ConsensusCommitPrologueV4 = 10,
6860 }
6861 impl Kind {
6862 pub fn as_str_name(&self) -> &'static str {
6867 match self {
6868 Self::Unknown => "KIND_UNKNOWN",
6869 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
6870 Self::ChangeEpoch => "CHANGE_EPOCH",
6871 Self::Genesis => "GENESIS",
6872 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
6873 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
6874 Self::EndOfEpoch => "END_OF_EPOCH",
6875 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
6876 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
6877 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
6878 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
6879 }
6880 }
6881 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6883 match value {
6884 "KIND_UNKNOWN" => Some(Self::Unknown),
6885 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
6886 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
6887 "GENESIS" => Some(Self::Genesis),
6888 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
6889 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
6890 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
6891 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
6892 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
6893 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
6894 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
6895 _ => None,
6896 }
6897 }
6898 }
6899 #[non_exhaustive]
6900 #[derive(Clone, PartialEq, ::prost::Oneof)]
6901 pub enum Data {
6902 #[prost(message, tag = "2")]
6904 ProgrammableTransaction(super::ProgrammableTransaction),
6905 #[prost(message, tag = "3")]
6910 ChangeEpoch(super::ChangeEpoch),
6911 #[prost(message, tag = "4")]
6916 Genesis(super::GenesisTransaction),
6917 #[prost(message, tag = "5")]
6919 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
6920 #[prost(message, tag = "6")]
6922 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
6923 #[prost(message, tag = "7")]
6926 EndOfEpoch(super::EndOfEpochTransaction),
6927 #[prost(message, tag = "8")]
6929 RandomnessStateUpdate(super::RandomnessStateUpdate),
6930 }
6931}
6932#[non_exhaustive]
6937#[derive(Clone, PartialEq, ::prost::Message)]
6938pub struct ProgrammableTransaction {
6939 #[prost(message, repeated, tag = "1")]
6941 pub inputs: ::prost::alloc::vec::Vec<Input>,
6942 #[prost(message, repeated, tag = "2")]
6945 pub commands: ::prost::alloc::vec::Vec<Command>,
6946}
6947#[non_exhaustive]
6949#[derive(Clone, PartialEq, ::prost::Message)]
6950pub struct Command {
6951 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
6952 pub command: ::core::option::Option<command::Command>,
6953}
6954pub mod command {
6956 #[non_exhaustive]
6957 #[derive(Clone, PartialEq, ::prost::Oneof)]
6958 pub enum Command {
6959 #[prost(message, tag = "1")]
6961 MoveCall(super::MoveCall),
6962 #[prost(message, tag = "2")]
6967 TransferObjects(super::TransferObjects),
6968 #[prost(message, tag = "3")]
6971 SplitCoins(super::SplitCoins),
6972 #[prost(message, tag = "4")]
6975 MergeCoins(super::MergeCoins),
6976 #[prost(message, tag = "5")]
6979 Publish(super::Publish),
6980 #[prost(message, tag = "6")]
6984 MakeMoveVector(super::MakeMoveVector),
6985 #[prost(message, tag = "7")]
6994 Upgrade(super::Upgrade),
6995 }
6996}
6997#[non_exhaustive]
7002#[derive(Clone, PartialEq, ::prost::Message)]
7003pub struct MoveCall {
7004 #[prost(string, optional, tag = "1")]
7006 pub package: ::core::option::Option<::prost::alloc::string::String>,
7007 #[prost(string, optional, tag = "2")]
7009 pub module: ::core::option::Option<::prost::alloc::string::String>,
7010 #[prost(string, optional, tag = "3")]
7012 pub function: ::core::option::Option<::prost::alloc::string::String>,
7013 #[prost(string, repeated, tag = "4")]
7015 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7016 #[prost(message, repeated, tag = "5")]
7018 pub arguments: ::prost::alloc::vec::Vec<Argument>,
7019}
7020#[non_exhaustive]
7022#[derive(Clone, PartialEq, ::prost::Message)]
7023pub struct TransferObjects {
7024 #[prost(message, repeated, tag = "1")]
7026 pub objects: ::prost::alloc::vec::Vec<Argument>,
7027 #[prost(message, optional, tag = "2")]
7029 pub address: ::core::option::Option<Argument>,
7030}
7031#[non_exhaustive]
7033#[derive(Clone, PartialEq, ::prost::Message)]
7034pub struct SplitCoins {
7035 #[prost(message, optional, tag = "1")]
7037 pub coin: ::core::option::Option<Argument>,
7038 #[prost(message, repeated, tag = "2")]
7040 pub amounts: ::prost::alloc::vec::Vec<Argument>,
7041}
7042#[non_exhaustive]
7044#[derive(Clone, PartialEq, ::prost::Message)]
7045pub struct MergeCoins {
7046 #[prost(message, optional, tag = "1")]
7048 pub coin: ::core::option::Option<Argument>,
7049 #[prost(message, repeated, tag = "2")]
7053 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
7054}
7055#[non_exhaustive]
7057#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7058pub struct Publish {
7059 #[prost(bytes = "bytes", repeated, tag = "1")]
7061 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7062 #[prost(string, repeated, tag = "2")]
7064 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7065}
7066#[non_exhaustive]
7068#[derive(Clone, PartialEq, ::prost::Message)]
7069pub struct MakeMoveVector {
7070 #[prost(string, optional, tag = "1")]
7075 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
7076 #[prost(message, repeated, tag = "2")]
7078 pub elements: ::prost::alloc::vec::Vec<Argument>,
7079}
7080#[non_exhaustive]
7082#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7083pub struct Upgrade {
7084 #[prost(bytes = "bytes", repeated, tag = "1")]
7086 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7087 #[prost(string, repeated, tag = "2")]
7089 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7090 #[prost(string, optional, tag = "3")]
7092 pub package: ::core::option::Option<::prost::alloc::string::String>,
7093 #[prost(message, optional, tag = "4")]
7095 pub ticket: ::core::option::Option<Argument>,
7096}
7097#[non_exhaustive]
7099#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7100pub struct RandomnessStateUpdate {
7101 #[prost(uint64, optional, tag = "1")]
7103 pub epoch: ::core::option::Option<u64>,
7104 #[prost(uint64, optional, tag = "2")]
7106 pub randomness_round: ::core::option::Option<u64>,
7107 #[prost(bytes = "bytes", optional, tag = "3")]
7109 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
7110 #[prost(uint64, optional, tag = "4")]
7112 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
7113}
7114#[non_exhaustive]
7116#[derive(Clone, PartialEq, ::prost::Message)]
7117pub struct ChangeEpoch {
7118 #[prost(uint64, optional, tag = "1")]
7120 pub epoch: ::core::option::Option<u64>,
7121 #[prost(uint64, optional, tag = "2")]
7123 pub protocol_version: ::core::option::Option<u64>,
7124 #[prost(uint64, optional, tag = "3")]
7126 pub storage_charge: ::core::option::Option<u64>,
7127 #[prost(uint64, optional, tag = "4")]
7129 pub computation_charge: ::core::option::Option<u64>,
7130 #[prost(uint64, optional, tag = "5")]
7132 pub storage_rebate: ::core::option::Option<u64>,
7133 #[prost(uint64, optional, tag = "6")]
7135 pub non_refundable_storage_fee: ::core::option::Option<u64>,
7136 #[prost(message, optional, tag = "7")]
7138 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7139 #[prost(message, repeated, tag = "8")]
7145 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
7146}
7147#[non_exhaustive]
7149#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7150pub struct SystemPackage {
7151 #[prost(uint64, optional, tag = "1")]
7153 pub version: ::core::option::Option<u64>,
7154 #[prost(bytes = "bytes", repeated, tag = "2")]
7156 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7157 #[prost(string, repeated, tag = "3")]
7159 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7160}
7161#[non_exhaustive]
7163#[derive(Clone, PartialEq, ::prost::Message)]
7164pub struct GenesisTransaction {
7165 #[prost(message, repeated, tag = "1")]
7167 pub objects: ::prost::alloc::vec::Vec<Object>,
7168}
7169#[non_exhaustive]
7173#[derive(Clone, PartialEq, ::prost::Message)]
7174pub struct ConsensusCommitPrologue {
7175 #[prost(uint64, optional, tag = "1")]
7179 pub epoch: ::core::option::Option<u64>,
7180 #[prost(uint64, optional, tag = "2")]
7184 pub round: ::core::option::Option<u64>,
7185 #[prost(message, optional, tag = "3")]
7189 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7190 #[prost(string, optional, tag = "4")]
7194 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
7195 #[prost(uint64, optional, tag = "5")]
7200 pub sub_dag_index: ::core::option::Option<u64>,
7201 #[prost(message, optional, tag = "6")]
7205 pub consensus_determined_version_assignments: ::core::option::Option<
7206 ConsensusDeterminedVersionAssignments,
7207 >,
7208 #[prost(string, optional, tag = "7")]
7213 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
7214}
7215#[non_exhaustive]
7217#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7218pub struct VersionAssignment {
7219 #[prost(string, optional, tag = "1")]
7221 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
7222 #[prost(uint64, optional, tag = "2")]
7224 pub start_version: ::core::option::Option<u64>,
7225 #[prost(uint64, optional, tag = "3")]
7227 pub version: ::core::option::Option<u64>,
7228}
7229#[non_exhaustive]
7231#[derive(Clone, PartialEq, ::prost::Message)]
7232pub struct CanceledTransaction {
7233 #[prost(string, optional, tag = "1")]
7235 pub digest: ::core::option::Option<::prost::alloc::string::String>,
7236 #[prost(message, repeated, tag = "2")]
7238 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
7239}
7240#[non_exhaustive]
7242#[derive(Clone, PartialEq, ::prost::Message)]
7243pub struct ConsensusDeterminedVersionAssignments {
7244 #[prost(int32, optional, tag = "1")]
7246 pub version: ::core::option::Option<i32>,
7247 #[prost(message, repeated, tag = "3")]
7249 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
7250}
7251#[non_exhaustive]
7253#[derive(Clone, PartialEq, ::prost::Message)]
7254pub struct AuthenticatorStateUpdate {
7255 #[prost(uint64, optional, tag = "1")]
7257 pub epoch: ::core::option::Option<u64>,
7258 #[prost(uint64, optional, tag = "2")]
7260 pub round: ::core::option::Option<u64>,
7261 #[prost(message, repeated, tag = "3")]
7263 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
7264 #[prost(uint64, optional, tag = "4")]
7266 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7267}
7268#[non_exhaustive]
7270#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7271pub struct ActiveJwk {
7272 #[prost(message, optional, tag = "1")]
7274 pub id: ::core::option::Option<JwkId>,
7275 #[prost(message, optional, tag = "2")]
7277 pub jwk: ::core::option::Option<Jwk>,
7278 #[prost(uint64, optional, tag = "3")]
7280 pub epoch: ::core::option::Option<u64>,
7281}
7282#[non_exhaustive]
7285#[derive(Clone, PartialEq, ::prost::Message)]
7286pub struct EndOfEpochTransaction {
7287 #[prost(message, repeated, tag = "1")]
7288 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
7289}
7290#[non_exhaustive]
7292#[derive(Clone, PartialEq, ::prost::Message)]
7293pub struct EndOfEpochTransactionKind {
7294 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
7295 pub kind: ::core::option::Option<i32>,
7296 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6")]
7297 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
7298}
7299pub mod end_of_epoch_transaction_kind {
7301 #[non_exhaustive]
7302 #[derive(
7303 Clone,
7304 Copy,
7305 Debug,
7306 PartialEq,
7307 Eq,
7308 Hash,
7309 PartialOrd,
7310 Ord,
7311 ::prost::Enumeration
7312 )]
7313 #[repr(i32)]
7314 pub enum Kind {
7315 Unknown = 0,
7316 ChangeEpoch = 1,
7318 AuthenticatorStateCreate = 2,
7320 AuthenticatorStateExpire = 3,
7322 RandomnessStateCreate = 4,
7324 DenyListStateCreate = 5,
7326 BridgeStateCreate = 6,
7328 BridgeCommitteeInit = 7,
7330 StoreExecutionTimeObservations = 8,
7332 AccumulatorRootCreate = 9,
7334 CoinRegistryCreate = 10,
7336 DisplayRegistryCreate = 11,
7338 }
7339 impl Kind {
7340 pub fn as_str_name(&self) -> &'static str {
7345 match self {
7346 Self::Unknown => "KIND_UNKNOWN",
7347 Self::ChangeEpoch => "CHANGE_EPOCH",
7348 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
7349 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
7350 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
7351 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
7352 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
7353 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
7354 Self::StoreExecutionTimeObservations => {
7355 "STORE_EXECUTION_TIME_OBSERVATIONS"
7356 }
7357 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
7358 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
7359 Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
7360 }
7361 }
7362 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7364 match value {
7365 "KIND_UNKNOWN" => Some(Self::Unknown),
7366 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7367 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
7368 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
7369 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
7370 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
7371 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
7372 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
7373 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
7374 Some(Self::StoreExecutionTimeObservations)
7375 }
7376 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
7377 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
7378 "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
7379 _ => None,
7380 }
7381 }
7382 }
7383 #[non_exhaustive]
7384 #[derive(Clone, PartialEq, ::prost::Oneof)]
7385 pub enum Data {
7386 #[prost(message, tag = "2")]
7388 ChangeEpoch(super::ChangeEpoch),
7389 #[prost(message, tag = "3")]
7391 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
7392 #[prost(message, tag = "4")]
7394 ExecutionTimeObservations(super::ExecutionTimeObservations),
7395 #[prost(string, tag = "5")]
7397 BridgeChainId(::prost::alloc::string::String),
7398 #[prost(uint64, tag = "6")]
7400 BridgeObjectVersion(u64),
7401 }
7402}
7403#[non_exhaustive]
7405#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7406pub struct AuthenticatorStateExpire {
7407 #[prost(uint64, optional, tag = "1")]
7409 pub min_epoch: ::core::option::Option<u64>,
7410 #[prost(uint64, optional, tag = "2")]
7412 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7413}
7414#[non_exhaustive]
7415#[derive(Clone, PartialEq, ::prost::Message)]
7416pub struct ExecutionTimeObservations {
7417 #[prost(int32, optional, tag = "1")]
7419 pub version: ::core::option::Option<i32>,
7420 #[prost(message, repeated, tag = "2")]
7421 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
7422}
7423#[non_exhaustive]
7424#[derive(Clone, PartialEq, ::prost::Message)]
7425pub struct ExecutionTimeObservation {
7426 #[prost(
7427 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
7428 optional,
7429 tag = "1"
7430 )]
7431 pub kind: ::core::option::Option<i32>,
7432 #[prost(message, optional, tag = "2")]
7433 pub move_entry_point: ::core::option::Option<MoveCall>,
7434 #[prost(message, repeated, tag = "3")]
7435 pub validator_observations: ::prost::alloc::vec::Vec<
7436 ValidatorExecutionTimeObservation,
7437 >,
7438}
7439pub mod execution_time_observation {
7441 #[non_exhaustive]
7442 #[derive(
7443 Clone,
7444 Copy,
7445 Debug,
7446 PartialEq,
7447 Eq,
7448 Hash,
7449 PartialOrd,
7450 Ord,
7451 ::prost::Enumeration
7452 )]
7453 #[repr(i32)]
7454 pub enum ExecutionTimeObservationKind {
7455 Unknown = 0,
7456 MoveEntryPoint = 1,
7457 TransferObjects = 2,
7458 SplitCoins = 3,
7459 MergeCoins = 4,
7460 Publish = 5,
7461 MakeMoveVector = 6,
7462 Upgrade = 7,
7463 }
7464 impl ExecutionTimeObservationKind {
7465 pub fn as_str_name(&self) -> &'static str {
7470 match self {
7471 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
7472 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
7473 Self::TransferObjects => "TRANSFER_OBJECTS",
7474 Self::SplitCoins => "SPLIT_COINS",
7475 Self::MergeCoins => "MERGE_COINS",
7476 Self::Publish => "PUBLISH",
7477 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
7478 Self::Upgrade => "UPGRADE",
7479 }
7480 }
7481 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7483 match value {
7484 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
7485 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
7486 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
7487 "SPLIT_COINS" => Some(Self::SplitCoins),
7488 "MERGE_COINS" => Some(Self::MergeCoins),
7489 "PUBLISH" => Some(Self::Publish),
7490 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
7491 "UPGRADE" => Some(Self::Upgrade),
7492 _ => None,
7493 }
7494 }
7495 }
7496}
7497#[non_exhaustive]
7498#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7499pub struct ValidatorExecutionTimeObservation {
7500 #[prost(bytes = "bytes", optional, tag = "1")]
7502 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
7503 #[prost(message, optional, tag = "2")]
7505 pub duration: ::core::option::Option<::prost_types::Duration>,
7506}
7507#[non_exhaustive]
7508#[derive(Clone, PartialEq, ::prost::Message)]
7509pub struct ExecuteTransactionRequest {
7510 #[prost(message, optional, tag = "1")]
7512 pub transaction: ::core::option::Option<Transaction>,
7513 #[prost(message, repeated, tag = "2")]
7516 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
7517 #[prost(message, optional, tag = "3")]
7520 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7521}
7522#[non_exhaustive]
7524#[derive(Clone, PartialEq, ::prost::Message)]
7525pub struct ExecuteTransactionResponse {
7526 #[prost(message, optional, tag = "1")]
7527 pub transaction: ::core::option::Option<ExecutedTransaction>,
7528}
7529#[non_exhaustive]
7530#[derive(Clone, PartialEq, ::prost::Message)]
7531pub struct SimulateTransactionRequest {
7532 #[prost(message, optional, tag = "1")]
7533 pub transaction: ::core::option::Option<Transaction>,
7534 #[prost(message, optional, tag = "2")]
7536 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7537 #[prost(
7539 enumeration = "simulate_transaction_request::TransactionChecks",
7540 optional,
7541 tag = "3"
7542 )]
7543 pub checks: ::core::option::Option<i32>,
7544 #[prost(bool, optional, tag = "4")]
7549 pub do_gas_selection: ::core::option::Option<bool>,
7550}
7551pub mod simulate_transaction_request {
7553 #[non_exhaustive]
7555 #[derive(
7556 Clone,
7557 Copy,
7558 Debug,
7559 PartialEq,
7560 Eq,
7561 Hash,
7562 PartialOrd,
7563 Ord,
7564 ::prost::Enumeration
7565 )]
7566 #[repr(i32)]
7567 pub enum TransactionChecks {
7568 Enabled = 0,
7569 Disabled = 1,
7570 }
7571 impl TransactionChecks {
7572 pub fn as_str_name(&self) -> &'static str {
7577 match self {
7578 Self::Enabled => "ENABLED",
7579 Self::Disabled => "DISABLED",
7580 }
7581 }
7582 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7584 match value {
7585 "ENABLED" => Some(Self::Enabled),
7586 "DISABLED" => Some(Self::Disabled),
7587 _ => None,
7588 }
7589 }
7590 }
7591}
7592#[non_exhaustive]
7593#[derive(Clone, PartialEq, ::prost::Message)]
7594pub struct SimulateTransactionResponse {
7595 #[prost(message, optional, tag = "1")]
7596 pub transaction: ::core::option::Option<ExecutedTransaction>,
7597 #[prost(message, repeated, tag = "2")]
7598 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
7599}
7600#[non_exhaustive]
7602#[derive(Clone, PartialEq, ::prost::Message)]
7603pub struct CommandResult {
7604 #[prost(message, repeated, tag = "1")]
7605 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
7606 #[prost(message, repeated, tag = "2")]
7607 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
7608}
7609#[non_exhaustive]
7610#[derive(Clone, PartialEq, ::prost::Message)]
7611pub struct CommandOutput {
7612 #[prost(message, optional, tag = "1")]
7613 pub argument: ::core::option::Option<Argument>,
7614 #[prost(message, optional, tag = "2")]
7615 pub value: ::core::option::Option<Bcs>,
7616 #[prost(message, optional, boxed, tag = "3")]
7618 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
7619}
7620pub mod transaction_execution_service_client {
7622 #![allow(
7623 unused_variables,
7624 dead_code,
7625 missing_docs,
7626 clippy::wildcard_imports,
7627 clippy::let_unit_value,
7628 )]
7629 use tonic::codegen::*;
7630 use tonic::codegen::http::Uri;
7631 #[derive(Debug, Clone)]
7632 pub struct TransactionExecutionServiceClient<T> {
7633 inner: tonic::client::Grpc<T>,
7634 }
7635 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
7636 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7638 where
7639 D: TryInto<tonic::transport::Endpoint>,
7640 D::Error: Into<StdError>,
7641 {
7642 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7643 Ok(Self::new(conn))
7644 }
7645 }
7646 impl<T> TransactionExecutionServiceClient<T>
7647 where
7648 T: tonic::client::GrpcService<tonic::body::Body>,
7649 T::Error: Into<StdError>,
7650 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7651 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7652 {
7653 pub fn new(inner: T) -> Self {
7654 let inner = tonic::client::Grpc::new(inner);
7655 Self { inner }
7656 }
7657 pub fn with_origin(inner: T, origin: Uri) -> Self {
7658 let inner = tonic::client::Grpc::with_origin(inner, origin);
7659 Self { inner }
7660 }
7661 pub fn with_interceptor<F>(
7662 inner: T,
7663 interceptor: F,
7664 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
7665 where
7666 F: tonic::service::Interceptor,
7667 T::ResponseBody: Default,
7668 T: tonic::codegen::Service<
7669 http::Request<tonic::body::Body>,
7670 Response = http::Response<
7671 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7672 >,
7673 >,
7674 <T as tonic::codegen::Service<
7675 http::Request<tonic::body::Body>,
7676 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7677 {
7678 TransactionExecutionServiceClient::new(
7679 InterceptedService::new(inner, interceptor),
7680 )
7681 }
7682 #[must_use]
7687 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7688 self.inner = self.inner.send_compressed(encoding);
7689 self
7690 }
7691 #[must_use]
7693 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7694 self.inner = self.inner.accept_compressed(encoding);
7695 self
7696 }
7697 #[must_use]
7701 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7702 self.inner = self.inner.max_decoding_message_size(limit);
7703 self
7704 }
7705 #[must_use]
7709 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7710 self.inner = self.inner.max_encoding_message_size(limit);
7711 self
7712 }
7713 pub async fn execute_transaction(
7714 &mut self,
7715 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
7716 ) -> std::result::Result<
7717 tonic::Response<super::ExecuteTransactionResponse>,
7718 tonic::Status,
7719 > {
7720 self.inner
7721 .ready()
7722 .await
7723 .map_err(|e| {
7724 tonic::Status::unknown(
7725 format!("Service was not ready: {}", e.into()),
7726 )
7727 })?;
7728 let codec = tonic_prost::ProstCodec::default();
7729 let path = http::uri::PathAndQuery::from_static(
7730 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
7731 );
7732 let mut req = request.into_request();
7733 req.extensions_mut()
7734 .insert(
7735 GrpcMethod::new(
7736 "sui.rpc.v2.TransactionExecutionService",
7737 "ExecuteTransaction",
7738 ),
7739 );
7740 self.inner.unary(req, path, codec).await
7741 }
7742 pub async fn simulate_transaction(
7743 &mut self,
7744 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
7745 ) -> std::result::Result<
7746 tonic::Response<super::SimulateTransactionResponse>,
7747 tonic::Status,
7748 > {
7749 self.inner
7750 .ready()
7751 .await
7752 .map_err(|e| {
7753 tonic::Status::unknown(
7754 format!("Service was not ready: {}", e.into()),
7755 )
7756 })?;
7757 let codec = tonic_prost::ProstCodec::default();
7758 let path = http::uri::PathAndQuery::from_static(
7759 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
7760 );
7761 let mut req = request.into_request();
7762 req.extensions_mut()
7763 .insert(
7764 GrpcMethod::new(
7765 "sui.rpc.v2.TransactionExecutionService",
7766 "SimulateTransaction",
7767 ),
7768 );
7769 self.inner.unary(req, path, codec).await
7770 }
7771 }
7772}
7773pub mod transaction_execution_service_server {
7775 #![allow(
7776 unused_variables,
7777 dead_code,
7778 missing_docs,
7779 clippy::wildcard_imports,
7780 clippy::let_unit_value,
7781 )]
7782 use tonic::codegen::*;
7783 #[async_trait]
7785 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
7786 async fn execute_transaction(
7787 &self,
7788 request: tonic::Request<super::ExecuteTransactionRequest>,
7789 ) -> std::result::Result<
7790 tonic::Response<super::ExecuteTransactionResponse>,
7791 tonic::Status,
7792 >;
7793 async fn simulate_transaction(
7794 &self,
7795 request: tonic::Request<super::SimulateTransactionRequest>,
7796 ) -> std::result::Result<
7797 tonic::Response<super::SimulateTransactionResponse>,
7798 tonic::Status,
7799 >;
7800 }
7801 #[derive(Debug)]
7802 pub struct TransactionExecutionServiceServer<T> {
7803 inner: Arc<T>,
7804 accept_compression_encodings: EnabledCompressionEncodings,
7805 send_compression_encodings: EnabledCompressionEncodings,
7806 max_decoding_message_size: Option<usize>,
7807 max_encoding_message_size: Option<usize>,
7808 }
7809 impl<T> TransactionExecutionServiceServer<T> {
7810 pub fn new(inner: T) -> Self {
7811 Self::from_arc(Arc::new(inner))
7812 }
7813 pub fn from_arc(inner: Arc<T>) -> Self {
7814 Self {
7815 inner,
7816 accept_compression_encodings: Default::default(),
7817 send_compression_encodings: Default::default(),
7818 max_decoding_message_size: None,
7819 max_encoding_message_size: None,
7820 }
7821 }
7822 pub fn with_interceptor<F>(
7823 inner: T,
7824 interceptor: F,
7825 ) -> InterceptedService<Self, F>
7826 where
7827 F: tonic::service::Interceptor,
7828 {
7829 InterceptedService::new(Self::new(inner), interceptor)
7830 }
7831 #[must_use]
7833 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7834 self.accept_compression_encodings.enable(encoding);
7835 self
7836 }
7837 #[must_use]
7839 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7840 self.send_compression_encodings.enable(encoding);
7841 self
7842 }
7843 #[must_use]
7847 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7848 self.max_decoding_message_size = Some(limit);
7849 self
7850 }
7851 #[must_use]
7855 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7856 self.max_encoding_message_size = Some(limit);
7857 self
7858 }
7859 }
7860 impl<T, B> tonic::codegen::Service<http::Request<B>>
7861 for TransactionExecutionServiceServer<T>
7862 where
7863 T: TransactionExecutionService,
7864 B: Body + std::marker::Send + 'static,
7865 B::Error: Into<StdError> + std::marker::Send + 'static,
7866 {
7867 type Response = http::Response<tonic::body::Body>;
7868 type Error = std::convert::Infallible;
7869 type Future = BoxFuture<Self::Response, Self::Error>;
7870 fn poll_ready(
7871 &mut self,
7872 _cx: &mut Context<'_>,
7873 ) -> Poll<std::result::Result<(), Self::Error>> {
7874 Poll::Ready(Ok(()))
7875 }
7876 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7877 match req.uri().path() {
7878 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
7879 #[allow(non_camel_case_types)]
7880 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
7881 pub Arc<T>,
7882 );
7883 impl<
7884 T: TransactionExecutionService,
7885 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
7886 for ExecuteTransactionSvc<T> {
7887 type Response = super::ExecuteTransactionResponse;
7888 type Future = BoxFuture<
7889 tonic::Response<Self::Response>,
7890 tonic::Status,
7891 >;
7892 fn call(
7893 &mut self,
7894 request: tonic::Request<super::ExecuteTransactionRequest>,
7895 ) -> Self::Future {
7896 let inner = Arc::clone(&self.0);
7897 let fut = async move {
7898 <T as TransactionExecutionService>::execute_transaction(
7899 &inner,
7900 request,
7901 )
7902 .await
7903 };
7904 Box::pin(fut)
7905 }
7906 }
7907 let accept_compression_encodings = self.accept_compression_encodings;
7908 let send_compression_encodings = self.send_compression_encodings;
7909 let max_decoding_message_size = self.max_decoding_message_size;
7910 let max_encoding_message_size = self.max_encoding_message_size;
7911 let inner = self.inner.clone();
7912 let fut = async move {
7913 let method = ExecuteTransactionSvc(inner);
7914 let codec = tonic_prost::ProstCodec::default();
7915 let mut grpc = tonic::server::Grpc::new(codec)
7916 .apply_compression_config(
7917 accept_compression_encodings,
7918 send_compression_encodings,
7919 )
7920 .apply_max_message_size_config(
7921 max_decoding_message_size,
7922 max_encoding_message_size,
7923 );
7924 let res = grpc.unary(method, req).await;
7925 Ok(res)
7926 };
7927 Box::pin(fut)
7928 }
7929 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
7930 #[allow(non_camel_case_types)]
7931 struct SimulateTransactionSvc<T: TransactionExecutionService>(
7932 pub Arc<T>,
7933 );
7934 impl<
7935 T: TransactionExecutionService,
7936 > tonic::server::UnaryService<super::SimulateTransactionRequest>
7937 for SimulateTransactionSvc<T> {
7938 type Response = super::SimulateTransactionResponse;
7939 type Future = BoxFuture<
7940 tonic::Response<Self::Response>,
7941 tonic::Status,
7942 >;
7943 fn call(
7944 &mut self,
7945 request: tonic::Request<super::SimulateTransactionRequest>,
7946 ) -> Self::Future {
7947 let inner = Arc::clone(&self.0);
7948 let fut = async move {
7949 <T as TransactionExecutionService>::simulate_transaction(
7950 &inner,
7951 request,
7952 )
7953 .await
7954 };
7955 Box::pin(fut)
7956 }
7957 }
7958 let accept_compression_encodings = self.accept_compression_encodings;
7959 let send_compression_encodings = self.send_compression_encodings;
7960 let max_decoding_message_size = self.max_decoding_message_size;
7961 let max_encoding_message_size = self.max_encoding_message_size;
7962 let inner = self.inner.clone();
7963 let fut = async move {
7964 let method = SimulateTransactionSvc(inner);
7965 let codec = tonic_prost::ProstCodec::default();
7966 let mut grpc = tonic::server::Grpc::new(codec)
7967 .apply_compression_config(
7968 accept_compression_encodings,
7969 send_compression_encodings,
7970 )
7971 .apply_max_message_size_config(
7972 max_decoding_message_size,
7973 max_encoding_message_size,
7974 );
7975 let res = grpc.unary(method, req).await;
7976 Ok(res)
7977 };
7978 Box::pin(fut)
7979 }
7980 _ => {
7981 Box::pin(async move {
7982 let mut response = http::Response::new(
7983 tonic::body::Body::default(),
7984 );
7985 let headers = response.headers_mut();
7986 headers
7987 .insert(
7988 tonic::Status::GRPC_STATUS,
7989 (tonic::Code::Unimplemented as i32).into(),
7990 );
7991 headers
7992 .insert(
7993 http::header::CONTENT_TYPE,
7994 tonic::metadata::GRPC_CONTENT_TYPE,
7995 );
7996 Ok(response)
7997 })
7998 }
7999 }
8000 }
8001 }
8002 impl<T> Clone for TransactionExecutionServiceServer<T> {
8003 fn clone(&self) -> Self {
8004 let inner = self.inner.clone();
8005 Self {
8006 inner,
8007 accept_compression_encodings: self.accept_compression_encodings,
8008 send_compression_encodings: self.send_compression_encodings,
8009 max_decoding_message_size: self.max_decoding_message_size,
8010 max_encoding_message_size: self.max_encoding_message_size,
8011 }
8012 }
8013 }
8014 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
8016 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
8017 const NAME: &'static str = SERVICE_NAME;
8018 }
8019}