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 }
1196 impl CommandArgumentErrorKind {
1197 pub fn as_str_name(&self) -> &'static str {
1202 match self {
1203 Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1204 Self::TypeMismatch => "TYPE_MISMATCH",
1205 Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1206 Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1207 Self::InvalidArgumentToPrivateEntryFunction => {
1208 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1209 }
1210 Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1211 Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1212 Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1213 Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1214 Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1215 Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1216 Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1217 Self::ConsensusObjectOperationNotAllowed => {
1218 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1219 }
1220 Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1221 }
1222 }
1223 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1225 match value {
1226 "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1227 "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1228 "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1229 "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1230 Some(Self::InvalidUsageOfPureArgument)
1231 }
1232 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1233 Some(Self::InvalidArgumentToPrivateEntryFunction)
1234 }
1235 "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1236 "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1237 "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1238 "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1239 "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1240 "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1241 "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1242 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1243 Some(Self::ConsensusObjectOperationNotAllowed)
1244 }
1245 "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1246 _ => None,
1247 }
1248 }
1249 }
1250}
1251#[non_exhaustive]
1253#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1254pub struct PackageUpgradeError {
1255 #[prost(
1256 enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1257 optional,
1258 tag = "1"
1259 )]
1260 pub kind: ::core::option::Option<i32>,
1261 #[prost(string, optional, tag = "2")]
1263 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1264 #[prost(string, optional, tag = "3")]
1266 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1267 #[prost(uint32, optional, tag = "4")]
1269 pub policy: ::core::option::Option<u32>,
1270 #[prost(string, optional, tag = "5")]
1272 pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1273}
1274pub mod package_upgrade_error {
1276 #[non_exhaustive]
1277 #[derive(
1278 Clone,
1279 Copy,
1280 Debug,
1281 PartialEq,
1282 Eq,
1283 Hash,
1284 PartialOrd,
1285 Ord,
1286 ::prost::Enumeration
1287 )]
1288 #[repr(i32)]
1289 pub enum PackageUpgradeErrorKind {
1290 Unknown = 0,
1291 UnableToFetchPackage = 1,
1293 NotAPackage = 2,
1295 IncompatibleUpgrade = 3,
1297 DigestDoesNotMatch = 4,
1299 UnknownUpgradePolicy = 5,
1301 PackageIdDoesNotMatch = 6,
1303 }
1304 impl PackageUpgradeErrorKind {
1305 pub fn as_str_name(&self) -> &'static str {
1310 match self {
1311 Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1312 Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1313 Self::NotAPackage => "NOT_A_PACKAGE",
1314 Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1315 Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1316 Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1317 Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1318 }
1319 }
1320 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1322 match value {
1323 "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1324 "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1325 "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1326 "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1327 "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1328 "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1329 "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1330 _ => None,
1331 }
1332 }
1333 }
1334}
1335#[non_exhaustive]
1337#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1338pub struct TypeArgumentError {
1339 #[prost(uint32, optional, tag = "1")]
1341 pub type_argument: ::core::option::Option<u32>,
1342 #[prost(
1343 enumeration = "type_argument_error::TypeArgumentErrorKind",
1344 optional,
1345 tag = "2"
1346 )]
1347 pub kind: ::core::option::Option<i32>,
1348}
1349pub mod type_argument_error {
1351 #[non_exhaustive]
1352 #[derive(
1353 Clone,
1354 Copy,
1355 Debug,
1356 PartialEq,
1357 Eq,
1358 Hash,
1359 PartialOrd,
1360 Ord,
1361 ::prost::Enumeration
1362 )]
1363 #[repr(i32)]
1364 pub enum TypeArgumentErrorKind {
1365 Unknown = 0,
1366 TypeNotFound = 1,
1368 ConstraintNotSatisfied = 2,
1370 }
1371 impl TypeArgumentErrorKind {
1372 pub fn as_str_name(&self) -> &'static str {
1377 match self {
1378 Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1379 Self::TypeNotFound => "TYPE_NOT_FOUND",
1380 Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1381 }
1382 }
1383 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1385 match value {
1386 "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1387 "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1388 "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1389 _ => None,
1390 }
1391 }
1392 }
1393}
1394#[non_exhaustive]
1396#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1397pub struct GasCostSummary {
1398 #[prost(uint64, optional, tag = "1")]
1400 pub computation_cost: ::core::option::Option<u64>,
1401 #[prost(uint64, optional, tag = "2")]
1403 pub storage_cost: ::core::option::Option<u64>,
1404 #[prost(uint64, optional, tag = "3")]
1407 pub storage_rebate: ::core::option::Option<u64>,
1408 #[prost(uint64, optional, tag = "4")]
1410 pub non_refundable_storage_fee: ::core::option::Option<u64>,
1411}
1412#[non_exhaustive]
1414#[derive(Clone, PartialEq, ::prost::Message)]
1415pub struct Input {
1416 #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1417 pub kind: ::core::option::Option<i32>,
1418 #[prost(bytes = "bytes", optional, tag = "2")]
1423 pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1424 #[prost(string, optional, tag = "3")]
1426 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1427 #[prost(uint64, optional, tag = "4")]
1431 pub version: ::core::option::Option<u64>,
1432 #[prost(string, optional, tag = "5")]
1434 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1435 #[prost(bool, optional, tag = "6")]
1438 pub mutable: ::core::option::Option<bool>,
1439 #[prost(message, optional, boxed, tag = "1000")]
1443 pub literal: ::core::option::Option<
1444 ::prost::alloc::boxed::Box<::prost_types::Value>,
1445 >,
1446}
1447pub mod input {
1449 #[non_exhaustive]
1450 #[derive(
1451 Clone,
1452 Copy,
1453 Debug,
1454 PartialEq,
1455 Eq,
1456 Hash,
1457 PartialOrd,
1458 Ord,
1459 ::prost::Enumeration
1460 )]
1461 #[repr(i32)]
1462 pub enum InputKind {
1463 Unknown = 0,
1464 Pure = 1,
1466 ImmutableOrOwned = 2,
1468 Shared = 3,
1470 Receiving = 4,
1472 }
1473 impl InputKind {
1474 pub fn as_str_name(&self) -> &'static str {
1479 match self {
1480 Self::Unknown => "INPUT_KIND_UNKNOWN",
1481 Self::Pure => "PURE",
1482 Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
1483 Self::Shared => "SHARED",
1484 Self::Receiving => "RECEIVING",
1485 }
1486 }
1487 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1489 match value {
1490 "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
1491 "PURE" => Some(Self::Pure),
1492 "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
1493 "SHARED" => Some(Self::Shared),
1494 "RECEIVING" => Some(Self::Receiving),
1495 _ => None,
1496 }
1497 }
1498 }
1499}
1500#[non_exhaustive]
1502#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1503pub struct JwkId {
1504 #[prost(string, optional, tag = "1")]
1506 pub iss: ::core::option::Option<::prost::alloc::string::String>,
1507 #[prost(string, optional, tag = "2")]
1509 pub kid: ::core::option::Option<::prost::alloc::string::String>,
1510}
1511#[non_exhaustive]
1517#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1518pub struct Jwk {
1519 #[prost(string, optional, tag = "1")]
1521 pub kty: ::core::option::Option<::prost::alloc::string::String>,
1522 #[prost(string, optional, tag = "2")]
1524 pub e: ::core::option::Option<::prost::alloc::string::String>,
1525 #[prost(string, optional, tag = "3")]
1527 pub n: ::core::option::Option<::prost::alloc::string::String>,
1528 #[prost(string, optional, tag = "4")]
1530 pub alg: ::core::option::Option<::prost::alloc::string::String>,
1531}
1532#[non_exhaustive]
1533#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1534pub struct GetServiceInfoRequest {}
1535#[non_exhaustive]
1536#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1537pub struct GetServiceInfoResponse {
1538 #[prost(string, optional, tag = "1")]
1543 pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
1544 #[prost(string, optional, tag = "2")]
1548 pub chain: ::core::option::Option<::prost::alloc::string::String>,
1549 #[prost(uint64, optional, tag = "3")]
1551 pub epoch: ::core::option::Option<u64>,
1552 #[prost(uint64, optional, tag = "4")]
1554 pub checkpoint_height: ::core::option::Option<u64>,
1555 #[prost(message, optional, tag = "5")]
1557 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
1558 #[prost(uint64, optional, tag = "6")]
1560 pub lowest_available_checkpoint: ::core::option::Option<u64>,
1561 #[prost(uint64, optional, tag = "7")]
1563 pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
1564 #[prost(string, optional, tag = "8")]
1566 pub server: ::core::option::Option<::prost::alloc::string::String>,
1567}
1568#[non_exhaustive]
1569#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1570pub struct GetObjectRequest {
1571 #[prost(string, optional, tag = "1")]
1573 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1574 #[prost(uint64, optional, tag = "2")]
1578 pub version: ::core::option::Option<u64>,
1579 #[prost(message, optional, tag = "3")]
1582 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1583}
1584#[non_exhaustive]
1585#[derive(Clone, PartialEq, ::prost::Message)]
1586pub struct GetObjectResponse {
1587 #[prost(message, optional, tag = "1")]
1588 pub object: ::core::option::Option<Object>,
1589}
1590#[non_exhaustive]
1591#[derive(Clone, PartialEq, ::prost::Message)]
1592pub struct BatchGetObjectsRequest {
1593 #[prost(message, repeated, tag = "1")]
1594 pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
1595 #[prost(message, optional, tag = "2")]
1598 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1599}
1600#[non_exhaustive]
1601#[derive(Clone, PartialEq, ::prost::Message)]
1602pub struct BatchGetObjectsResponse {
1603 #[prost(message, repeated, tag = "1")]
1604 pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
1605}
1606#[non_exhaustive]
1607#[derive(Clone, PartialEq, ::prost::Message)]
1608pub struct GetObjectResult {
1609 #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
1610 pub result: ::core::option::Option<get_object_result::Result>,
1611}
1612pub mod get_object_result {
1614 #[non_exhaustive]
1615 #[derive(Clone, PartialEq, ::prost::Oneof)]
1616 pub enum Result {
1617 #[prost(message, tag = "1")]
1618 Object(super::Object),
1619 #[prost(message, tag = "2")]
1620 Error(super::super::super::super::google::rpc::Status),
1621 }
1622}
1623#[non_exhaustive]
1624#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1625pub struct GetTransactionRequest {
1626 #[prost(string, optional, tag = "1")]
1628 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1629 #[prost(message, optional, tag = "2")]
1632 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1633}
1634#[non_exhaustive]
1635#[derive(Clone, PartialEq, ::prost::Message)]
1636pub struct GetTransactionResponse {
1637 #[prost(message, optional, tag = "1")]
1638 pub transaction: ::core::option::Option<ExecutedTransaction>,
1639}
1640#[non_exhaustive]
1641#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1642pub struct BatchGetTransactionsRequest {
1643 #[prost(string, repeated, tag = "1")]
1645 pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1646 #[prost(message, optional, tag = "2")]
1649 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1650}
1651#[non_exhaustive]
1652#[derive(Clone, PartialEq, ::prost::Message)]
1653pub struct BatchGetTransactionsResponse {
1654 #[prost(message, repeated, tag = "1")]
1655 pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
1656}
1657#[non_exhaustive]
1658#[derive(Clone, PartialEq, ::prost::Message)]
1659pub struct GetTransactionResult {
1660 #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
1661 pub result: ::core::option::Option<get_transaction_result::Result>,
1662}
1663pub mod get_transaction_result {
1665 #[non_exhaustive]
1666 #[derive(Clone, PartialEq, ::prost::Oneof)]
1667 pub enum Result {
1668 #[prost(message, tag = "1")]
1669 Transaction(super::ExecutedTransaction),
1670 #[prost(message, tag = "2")]
1671 Error(super::super::super::super::google::rpc::Status),
1672 }
1673}
1674#[non_exhaustive]
1675#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1676pub struct GetCheckpointRequest {
1677 #[prost(message, optional, tag = "3")]
1680 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1681 #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
1683 pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
1684}
1685pub mod get_checkpoint_request {
1687 #[non_exhaustive]
1689 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1690 pub enum CheckpointId {
1691 #[prost(uint64, tag = "1")]
1693 SequenceNumber(u64),
1694 #[prost(string, tag = "2")]
1696 Digest(::prost::alloc::string::String),
1697 }
1698}
1699#[non_exhaustive]
1700#[derive(Clone, PartialEq, ::prost::Message)]
1701pub struct GetCheckpointResponse {
1702 #[prost(message, optional, tag = "1")]
1703 pub checkpoint: ::core::option::Option<Checkpoint>,
1704}
1705#[non_exhaustive]
1706#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1707pub struct GetEpochRequest {
1708 #[prost(uint64, optional, tag = "1")]
1711 pub epoch: ::core::option::Option<u64>,
1712 #[prost(message, optional, tag = "2")]
1715 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1716}
1717#[non_exhaustive]
1718#[derive(Clone, PartialEq, ::prost::Message)]
1719pub struct GetEpochResponse {
1720 #[prost(message, optional, tag = "1")]
1721 pub epoch: ::core::option::Option<Epoch>,
1722}
1723pub mod ledger_service_client {
1725 #![allow(
1726 unused_variables,
1727 dead_code,
1728 missing_docs,
1729 clippy::wildcard_imports,
1730 clippy::let_unit_value,
1731 )]
1732 use tonic::codegen::*;
1733 use tonic::codegen::http::Uri;
1734 #[derive(Debug, Clone)]
1735 pub struct LedgerServiceClient<T> {
1736 inner: tonic::client::Grpc<T>,
1737 }
1738 impl LedgerServiceClient<tonic::transport::Channel> {
1739 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1741 where
1742 D: TryInto<tonic::transport::Endpoint>,
1743 D::Error: Into<StdError>,
1744 {
1745 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1746 Ok(Self::new(conn))
1747 }
1748 }
1749 impl<T> LedgerServiceClient<T>
1750 where
1751 T: tonic::client::GrpcService<tonic::body::Body>,
1752 T::Error: Into<StdError>,
1753 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1754 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1755 {
1756 pub fn new(inner: T) -> Self {
1757 let inner = tonic::client::Grpc::new(inner);
1758 Self { inner }
1759 }
1760 pub fn with_origin(inner: T, origin: Uri) -> Self {
1761 let inner = tonic::client::Grpc::with_origin(inner, origin);
1762 Self { inner }
1763 }
1764 pub fn with_interceptor<F>(
1765 inner: T,
1766 interceptor: F,
1767 ) -> LedgerServiceClient<InterceptedService<T, F>>
1768 where
1769 F: tonic::service::Interceptor,
1770 T::ResponseBody: Default,
1771 T: tonic::codegen::Service<
1772 http::Request<tonic::body::Body>,
1773 Response = http::Response<
1774 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1775 >,
1776 >,
1777 <T as tonic::codegen::Service<
1778 http::Request<tonic::body::Body>,
1779 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1780 {
1781 LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
1782 }
1783 #[must_use]
1788 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1789 self.inner = self.inner.send_compressed(encoding);
1790 self
1791 }
1792 #[must_use]
1794 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1795 self.inner = self.inner.accept_compressed(encoding);
1796 self
1797 }
1798 #[must_use]
1802 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1803 self.inner = self.inner.max_decoding_message_size(limit);
1804 self
1805 }
1806 #[must_use]
1810 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1811 self.inner = self.inner.max_encoding_message_size(limit);
1812 self
1813 }
1814 pub async fn get_service_info(
1816 &mut self,
1817 request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
1818 ) -> std::result::Result<
1819 tonic::Response<super::GetServiceInfoResponse>,
1820 tonic::Status,
1821 > {
1822 self.inner
1823 .ready()
1824 .await
1825 .map_err(|e| {
1826 tonic::Status::unknown(
1827 format!("Service was not ready: {}", e.into()),
1828 )
1829 })?;
1830 let codec = tonic_prost::ProstCodec::default();
1831 let path = http::uri::PathAndQuery::from_static(
1832 "/sui.rpc.v2.LedgerService/GetServiceInfo",
1833 );
1834 let mut req = request.into_request();
1835 req.extensions_mut()
1836 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
1837 self.inner.unary(req, path, codec).await
1838 }
1839 pub async fn get_object(
1840 &mut self,
1841 request: impl tonic::IntoRequest<super::GetObjectRequest>,
1842 ) -> std::result::Result<
1843 tonic::Response<super::GetObjectResponse>,
1844 tonic::Status,
1845 > {
1846 self.inner
1847 .ready()
1848 .await
1849 .map_err(|e| {
1850 tonic::Status::unknown(
1851 format!("Service was not ready: {}", e.into()),
1852 )
1853 })?;
1854 let codec = tonic_prost::ProstCodec::default();
1855 let path = http::uri::PathAndQuery::from_static(
1856 "/sui.rpc.v2.LedgerService/GetObject",
1857 );
1858 let mut req = request.into_request();
1859 req.extensions_mut()
1860 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
1861 self.inner.unary(req, path, codec).await
1862 }
1863 pub async fn batch_get_objects(
1864 &mut self,
1865 request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
1866 ) -> std::result::Result<
1867 tonic::Response<super::BatchGetObjectsResponse>,
1868 tonic::Status,
1869 > {
1870 self.inner
1871 .ready()
1872 .await
1873 .map_err(|e| {
1874 tonic::Status::unknown(
1875 format!("Service was not ready: {}", e.into()),
1876 )
1877 })?;
1878 let codec = tonic_prost::ProstCodec::default();
1879 let path = http::uri::PathAndQuery::from_static(
1880 "/sui.rpc.v2.LedgerService/BatchGetObjects",
1881 );
1882 let mut req = request.into_request();
1883 req.extensions_mut()
1884 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
1885 self.inner.unary(req, path, codec).await
1886 }
1887 pub async fn get_transaction(
1888 &mut self,
1889 request: impl tonic::IntoRequest<super::GetTransactionRequest>,
1890 ) -> std::result::Result<
1891 tonic::Response<super::GetTransactionResponse>,
1892 tonic::Status,
1893 > {
1894 self.inner
1895 .ready()
1896 .await
1897 .map_err(|e| {
1898 tonic::Status::unknown(
1899 format!("Service was not ready: {}", e.into()),
1900 )
1901 })?;
1902 let codec = tonic_prost::ProstCodec::default();
1903 let path = http::uri::PathAndQuery::from_static(
1904 "/sui.rpc.v2.LedgerService/GetTransaction",
1905 );
1906 let mut req = request.into_request();
1907 req.extensions_mut()
1908 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
1909 self.inner.unary(req, path, codec).await
1910 }
1911 pub async fn batch_get_transactions(
1912 &mut self,
1913 request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
1914 ) -> std::result::Result<
1915 tonic::Response<super::BatchGetTransactionsResponse>,
1916 tonic::Status,
1917 > {
1918 self.inner
1919 .ready()
1920 .await
1921 .map_err(|e| {
1922 tonic::Status::unknown(
1923 format!("Service was not ready: {}", e.into()),
1924 )
1925 })?;
1926 let codec = tonic_prost::ProstCodec::default();
1927 let path = http::uri::PathAndQuery::from_static(
1928 "/sui.rpc.v2.LedgerService/BatchGetTransactions",
1929 );
1930 let mut req = request.into_request();
1931 req.extensions_mut()
1932 .insert(
1933 GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
1934 );
1935 self.inner.unary(req, path, codec).await
1936 }
1937 pub async fn get_checkpoint(
1938 &mut self,
1939 request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
1940 ) -> std::result::Result<
1941 tonic::Response<super::GetCheckpointResponse>,
1942 tonic::Status,
1943 > {
1944 self.inner
1945 .ready()
1946 .await
1947 .map_err(|e| {
1948 tonic::Status::unknown(
1949 format!("Service was not ready: {}", e.into()),
1950 )
1951 })?;
1952 let codec = tonic_prost::ProstCodec::default();
1953 let path = http::uri::PathAndQuery::from_static(
1954 "/sui.rpc.v2.LedgerService/GetCheckpoint",
1955 );
1956 let mut req = request.into_request();
1957 req.extensions_mut()
1958 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
1959 self.inner.unary(req, path, codec).await
1960 }
1961 pub async fn get_epoch(
1962 &mut self,
1963 request: impl tonic::IntoRequest<super::GetEpochRequest>,
1964 ) -> std::result::Result<
1965 tonic::Response<super::GetEpochResponse>,
1966 tonic::Status,
1967 > {
1968 self.inner
1969 .ready()
1970 .await
1971 .map_err(|e| {
1972 tonic::Status::unknown(
1973 format!("Service was not ready: {}", e.into()),
1974 )
1975 })?;
1976 let codec = tonic_prost::ProstCodec::default();
1977 let path = http::uri::PathAndQuery::from_static(
1978 "/sui.rpc.v2.LedgerService/GetEpoch",
1979 );
1980 let mut req = request.into_request();
1981 req.extensions_mut()
1982 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
1983 self.inner.unary(req, path, codec).await
1984 }
1985 }
1986}
1987pub mod ledger_service_server {
1989 #![allow(
1990 unused_variables,
1991 dead_code,
1992 missing_docs,
1993 clippy::wildcard_imports,
1994 clippy::let_unit_value,
1995 )]
1996 use tonic::codegen::*;
1997 #[async_trait]
1999 pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2000 async fn get_service_info(
2002 &self,
2003 request: tonic::Request<super::GetServiceInfoRequest>,
2004 ) -> std::result::Result<
2005 tonic::Response<super::GetServiceInfoResponse>,
2006 tonic::Status,
2007 >;
2008 async fn get_object(
2009 &self,
2010 request: tonic::Request<super::GetObjectRequest>,
2011 ) -> std::result::Result<
2012 tonic::Response<super::GetObjectResponse>,
2013 tonic::Status,
2014 >;
2015 async fn batch_get_objects(
2016 &self,
2017 request: tonic::Request<super::BatchGetObjectsRequest>,
2018 ) -> std::result::Result<
2019 tonic::Response<super::BatchGetObjectsResponse>,
2020 tonic::Status,
2021 >;
2022 async fn get_transaction(
2023 &self,
2024 request: tonic::Request<super::GetTransactionRequest>,
2025 ) -> std::result::Result<
2026 tonic::Response<super::GetTransactionResponse>,
2027 tonic::Status,
2028 >;
2029 async fn batch_get_transactions(
2030 &self,
2031 request: tonic::Request<super::BatchGetTransactionsRequest>,
2032 ) -> std::result::Result<
2033 tonic::Response<super::BatchGetTransactionsResponse>,
2034 tonic::Status,
2035 >;
2036 async fn get_checkpoint(
2037 &self,
2038 request: tonic::Request<super::GetCheckpointRequest>,
2039 ) -> std::result::Result<
2040 tonic::Response<super::GetCheckpointResponse>,
2041 tonic::Status,
2042 >;
2043 async fn get_epoch(
2044 &self,
2045 request: tonic::Request<super::GetEpochRequest>,
2046 ) -> std::result::Result<
2047 tonic::Response<super::GetEpochResponse>,
2048 tonic::Status,
2049 >;
2050 }
2051 #[derive(Debug)]
2052 pub struct LedgerServiceServer<T> {
2053 inner: Arc<T>,
2054 accept_compression_encodings: EnabledCompressionEncodings,
2055 send_compression_encodings: EnabledCompressionEncodings,
2056 max_decoding_message_size: Option<usize>,
2057 max_encoding_message_size: Option<usize>,
2058 }
2059 impl<T> LedgerServiceServer<T> {
2060 pub fn new(inner: T) -> Self {
2061 Self::from_arc(Arc::new(inner))
2062 }
2063 pub fn from_arc(inner: Arc<T>) -> Self {
2064 Self {
2065 inner,
2066 accept_compression_encodings: Default::default(),
2067 send_compression_encodings: Default::default(),
2068 max_decoding_message_size: None,
2069 max_encoding_message_size: None,
2070 }
2071 }
2072 pub fn with_interceptor<F>(
2073 inner: T,
2074 interceptor: F,
2075 ) -> InterceptedService<Self, F>
2076 where
2077 F: tonic::service::Interceptor,
2078 {
2079 InterceptedService::new(Self::new(inner), interceptor)
2080 }
2081 #[must_use]
2083 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2084 self.accept_compression_encodings.enable(encoding);
2085 self
2086 }
2087 #[must_use]
2089 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2090 self.send_compression_encodings.enable(encoding);
2091 self
2092 }
2093 #[must_use]
2097 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2098 self.max_decoding_message_size = Some(limit);
2099 self
2100 }
2101 #[must_use]
2105 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2106 self.max_encoding_message_size = Some(limit);
2107 self
2108 }
2109 }
2110 impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
2111 where
2112 T: LedgerService,
2113 B: Body + std::marker::Send + 'static,
2114 B::Error: Into<StdError> + std::marker::Send + 'static,
2115 {
2116 type Response = http::Response<tonic::body::Body>;
2117 type Error = std::convert::Infallible;
2118 type Future = BoxFuture<Self::Response, Self::Error>;
2119 fn poll_ready(
2120 &mut self,
2121 _cx: &mut Context<'_>,
2122 ) -> Poll<std::result::Result<(), Self::Error>> {
2123 Poll::Ready(Ok(()))
2124 }
2125 fn call(&mut self, req: http::Request<B>) -> Self::Future {
2126 match req.uri().path() {
2127 "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
2128 #[allow(non_camel_case_types)]
2129 struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
2130 impl<
2131 T: LedgerService,
2132 > tonic::server::UnaryService<super::GetServiceInfoRequest>
2133 for GetServiceInfoSvc<T> {
2134 type Response = super::GetServiceInfoResponse;
2135 type Future = BoxFuture<
2136 tonic::Response<Self::Response>,
2137 tonic::Status,
2138 >;
2139 fn call(
2140 &mut self,
2141 request: tonic::Request<super::GetServiceInfoRequest>,
2142 ) -> Self::Future {
2143 let inner = Arc::clone(&self.0);
2144 let fut = async move {
2145 <T as LedgerService>::get_service_info(&inner, request)
2146 .await
2147 };
2148 Box::pin(fut)
2149 }
2150 }
2151 let accept_compression_encodings = self.accept_compression_encodings;
2152 let send_compression_encodings = self.send_compression_encodings;
2153 let max_decoding_message_size = self.max_decoding_message_size;
2154 let max_encoding_message_size = self.max_encoding_message_size;
2155 let inner = self.inner.clone();
2156 let fut = async move {
2157 let method = GetServiceInfoSvc(inner);
2158 let codec = tonic_prost::ProstCodec::default();
2159 let mut grpc = tonic::server::Grpc::new(codec)
2160 .apply_compression_config(
2161 accept_compression_encodings,
2162 send_compression_encodings,
2163 )
2164 .apply_max_message_size_config(
2165 max_decoding_message_size,
2166 max_encoding_message_size,
2167 );
2168 let res = grpc.unary(method, req).await;
2169 Ok(res)
2170 };
2171 Box::pin(fut)
2172 }
2173 "/sui.rpc.v2.LedgerService/GetObject" => {
2174 #[allow(non_camel_case_types)]
2175 struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
2176 impl<
2177 T: LedgerService,
2178 > tonic::server::UnaryService<super::GetObjectRequest>
2179 for GetObjectSvc<T> {
2180 type Response = super::GetObjectResponse;
2181 type Future = BoxFuture<
2182 tonic::Response<Self::Response>,
2183 tonic::Status,
2184 >;
2185 fn call(
2186 &mut self,
2187 request: tonic::Request<super::GetObjectRequest>,
2188 ) -> Self::Future {
2189 let inner = Arc::clone(&self.0);
2190 let fut = async move {
2191 <T as LedgerService>::get_object(&inner, request).await
2192 };
2193 Box::pin(fut)
2194 }
2195 }
2196 let accept_compression_encodings = self.accept_compression_encodings;
2197 let send_compression_encodings = self.send_compression_encodings;
2198 let max_decoding_message_size = self.max_decoding_message_size;
2199 let max_encoding_message_size = self.max_encoding_message_size;
2200 let inner = self.inner.clone();
2201 let fut = async move {
2202 let method = GetObjectSvc(inner);
2203 let codec = tonic_prost::ProstCodec::default();
2204 let mut grpc = tonic::server::Grpc::new(codec)
2205 .apply_compression_config(
2206 accept_compression_encodings,
2207 send_compression_encodings,
2208 )
2209 .apply_max_message_size_config(
2210 max_decoding_message_size,
2211 max_encoding_message_size,
2212 );
2213 let res = grpc.unary(method, req).await;
2214 Ok(res)
2215 };
2216 Box::pin(fut)
2217 }
2218 "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
2219 #[allow(non_camel_case_types)]
2220 struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
2221 impl<
2222 T: LedgerService,
2223 > tonic::server::UnaryService<super::BatchGetObjectsRequest>
2224 for BatchGetObjectsSvc<T> {
2225 type Response = super::BatchGetObjectsResponse;
2226 type Future = BoxFuture<
2227 tonic::Response<Self::Response>,
2228 tonic::Status,
2229 >;
2230 fn call(
2231 &mut self,
2232 request: tonic::Request<super::BatchGetObjectsRequest>,
2233 ) -> Self::Future {
2234 let inner = Arc::clone(&self.0);
2235 let fut = async move {
2236 <T as LedgerService>::batch_get_objects(&inner, request)
2237 .await
2238 };
2239 Box::pin(fut)
2240 }
2241 }
2242 let accept_compression_encodings = self.accept_compression_encodings;
2243 let send_compression_encodings = self.send_compression_encodings;
2244 let max_decoding_message_size = self.max_decoding_message_size;
2245 let max_encoding_message_size = self.max_encoding_message_size;
2246 let inner = self.inner.clone();
2247 let fut = async move {
2248 let method = BatchGetObjectsSvc(inner);
2249 let codec = tonic_prost::ProstCodec::default();
2250 let mut grpc = tonic::server::Grpc::new(codec)
2251 .apply_compression_config(
2252 accept_compression_encodings,
2253 send_compression_encodings,
2254 )
2255 .apply_max_message_size_config(
2256 max_decoding_message_size,
2257 max_encoding_message_size,
2258 );
2259 let res = grpc.unary(method, req).await;
2260 Ok(res)
2261 };
2262 Box::pin(fut)
2263 }
2264 "/sui.rpc.v2.LedgerService/GetTransaction" => {
2265 #[allow(non_camel_case_types)]
2266 struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
2267 impl<
2268 T: LedgerService,
2269 > tonic::server::UnaryService<super::GetTransactionRequest>
2270 for GetTransactionSvc<T> {
2271 type Response = super::GetTransactionResponse;
2272 type Future = BoxFuture<
2273 tonic::Response<Self::Response>,
2274 tonic::Status,
2275 >;
2276 fn call(
2277 &mut self,
2278 request: tonic::Request<super::GetTransactionRequest>,
2279 ) -> Self::Future {
2280 let inner = Arc::clone(&self.0);
2281 let fut = async move {
2282 <T as LedgerService>::get_transaction(&inner, request).await
2283 };
2284 Box::pin(fut)
2285 }
2286 }
2287 let accept_compression_encodings = self.accept_compression_encodings;
2288 let send_compression_encodings = self.send_compression_encodings;
2289 let max_decoding_message_size = self.max_decoding_message_size;
2290 let max_encoding_message_size = self.max_encoding_message_size;
2291 let inner = self.inner.clone();
2292 let fut = async move {
2293 let method = GetTransactionSvc(inner);
2294 let codec = tonic_prost::ProstCodec::default();
2295 let mut grpc = tonic::server::Grpc::new(codec)
2296 .apply_compression_config(
2297 accept_compression_encodings,
2298 send_compression_encodings,
2299 )
2300 .apply_max_message_size_config(
2301 max_decoding_message_size,
2302 max_encoding_message_size,
2303 );
2304 let res = grpc.unary(method, req).await;
2305 Ok(res)
2306 };
2307 Box::pin(fut)
2308 }
2309 "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
2310 #[allow(non_camel_case_types)]
2311 struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
2312 impl<
2313 T: LedgerService,
2314 > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
2315 for BatchGetTransactionsSvc<T> {
2316 type Response = super::BatchGetTransactionsResponse;
2317 type Future = BoxFuture<
2318 tonic::Response<Self::Response>,
2319 tonic::Status,
2320 >;
2321 fn call(
2322 &mut self,
2323 request: tonic::Request<super::BatchGetTransactionsRequest>,
2324 ) -> Self::Future {
2325 let inner = Arc::clone(&self.0);
2326 let fut = async move {
2327 <T as LedgerService>::batch_get_transactions(
2328 &inner,
2329 request,
2330 )
2331 .await
2332 };
2333 Box::pin(fut)
2334 }
2335 }
2336 let accept_compression_encodings = self.accept_compression_encodings;
2337 let send_compression_encodings = self.send_compression_encodings;
2338 let max_decoding_message_size = self.max_decoding_message_size;
2339 let max_encoding_message_size = self.max_encoding_message_size;
2340 let inner = self.inner.clone();
2341 let fut = async move {
2342 let method = BatchGetTransactionsSvc(inner);
2343 let codec = tonic_prost::ProstCodec::default();
2344 let mut grpc = tonic::server::Grpc::new(codec)
2345 .apply_compression_config(
2346 accept_compression_encodings,
2347 send_compression_encodings,
2348 )
2349 .apply_max_message_size_config(
2350 max_decoding_message_size,
2351 max_encoding_message_size,
2352 );
2353 let res = grpc.unary(method, req).await;
2354 Ok(res)
2355 };
2356 Box::pin(fut)
2357 }
2358 "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
2359 #[allow(non_camel_case_types)]
2360 struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
2361 impl<
2362 T: LedgerService,
2363 > tonic::server::UnaryService<super::GetCheckpointRequest>
2364 for GetCheckpointSvc<T> {
2365 type Response = super::GetCheckpointResponse;
2366 type Future = BoxFuture<
2367 tonic::Response<Self::Response>,
2368 tonic::Status,
2369 >;
2370 fn call(
2371 &mut self,
2372 request: tonic::Request<super::GetCheckpointRequest>,
2373 ) -> Self::Future {
2374 let inner = Arc::clone(&self.0);
2375 let fut = async move {
2376 <T as LedgerService>::get_checkpoint(&inner, request).await
2377 };
2378 Box::pin(fut)
2379 }
2380 }
2381 let accept_compression_encodings = self.accept_compression_encodings;
2382 let send_compression_encodings = self.send_compression_encodings;
2383 let max_decoding_message_size = self.max_decoding_message_size;
2384 let max_encoding_message_size = self.max_encoding_message_size;
2385 let inner = self.inner.clone();
2386 let fut = async move {
2387 let method = GetCheckpointSvc(inner);
2388 let codec = tonic_prost::ProstCodec::default();
2389 let mut grpc = tonic::server::Grpc::new(codec)
2390 .apply_compression_config(
2391 accept_compression_encodings,
2392 send_compression_encodings,
2393 )
2394 .apply_max_message_size_config(
2395 max_decoding_message_size,
2396 max_encoding_message_size,
2397 );
2398 let res = grpc.unary(method, req).await;
2399 Ok(res)
2400 };
2401 Box::pin(fut)
2402 }
2403 "/sui.rpc.v2.LedgerService/GetEpoch" => {
2404 #[allow(non_camel_case_types)]
2405 struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
2406 impl<
2407 T: LedgerService,
2408 > tonic::server::UnaryService<super::GetEpochRequest>
2409 for GetEpochSvc<T> {
2410 type Response = super::GetEpochResponse;
2411 type Future = BoxFuture<
2412 tonic::Response<Self::Response>,
2413 tonic::Status,
2414 >;
2415 fn call(
2416 &mut self,
2417 request: tonic::Request<super::GetEpochRequest>,
2418 ) -> Self::Future {
2419 let inner = Arc::clone(&self.0);
2420 let fut = async move {
2421 <T as LedgerService>::get_epoch(&inner, request).await
2422 };
2423 Box::pin(fut)
2424 }
2425 }
2426 let accept_compression_encodings = self.accept_compression_encodings;
2427 let send_compression_encodings = self.send_compression_encodings;
2428 let max_decoding_message_size = self.max_decoding_message_size;
2429 let max_encoding_message_size = self.max_encoding_message_size;
2430 let inner = self.inner.clone();
2431 let fut = async move {
2432 let method = GetEpochSvc(inner);
2433 let codec = tonic_prost::ProstCodec::default();
2434 let mut grpc = tonic::server::Grpc::new(codec)
2435 .apply_compression_config(
2436 accept_compression_encodings,
2437 send_compression_encodings,
2438 )
2439 .apply_max_message_size_config(
2440 max_decoding_message_size,
2441 max_encoding_message_size,
2442 );
2443 let res = grpc.unary(method, req).await;
2444 Ok(res)
2445 };
2446 Box::pin(fut)
2447 }
2448 _ => {
2449 Box::pin(async move {
2450 let mut response = http::Response::new(
2451 tonic::body::Body::default(),
2452 );
2453 let headers = response.headers_mut();
2454 headers
2455 .insert(
2456 tonic::Status::GRPC_STATUS,
2457 (tonic::Code::Unimplemented as i32).into(),
2458 );
2459 headers
2460 .insert(
2461 http::header::CONTENT_TYPE,
2462 tonic::metadata::GRPC_CONTENT_TYPE,
2463 );
2464 Ok(response)
2465 })
2466 }
2467 }
2468 }
2469 }
2470 impl<T> Clone for LedgerServiceServer<T> {
2471 fn clone(&self) -> Self {
2472 let inner = self.inner.clone();
2473 Self {
2474 inner,
2475 accept_compression_encodings: self.accept_compression_encodings,
2476 send_compression_encodings: self.send_compression_encodings,
2477 max_decoding_message_size: self.max_decoding_message_size,
2478 max_encoding_message_size: self.max_encoding_message_size,
2479 }
2480 }
2481 }
2482 pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
2484 impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
2485 const NAME: &'static str = SERVICE_NAME;
2486 }
2487}
2488#[non_exhaustive]
2490#[derive(Clone, PartialEq, ::prost::Message)]
2491pub struct Package {
2492 #[prost(string, optional, tag = "1")]
2498 pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
2499 #[prost(string, optional, tag = "2")]
2506 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
2507 #[prost(uint64, optional, tag = "3")]
2509 pub version: ::core::option::Option<u64>,
2510 #[prost(message, repeated, tag = "4")]
2512 pub modules: ::prost::alloc::vec::Vec<Module>,
2513 #[prost(message, repeated, tag = "5")]
2516 pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
2517 #[prost(message, repeated, tag = "6")]
2521 pub linkage: ::prost::alloc::vec::Vec<Linkage>,
2522}
2523#[non_exhaustive]
2525#[derive(Clone, PartialEq, ::prost::Message)]
2526pub struct Module {
2527 #[prost(string, optional, tag = "1")]
2529 pub name: ::core::option::Option<::prost::alloc::string::String>,
2530 #[prost(bytes = "bytes", optional, tag = "2")]
2532 pub contents: ::core::option::Option<::prost::bytes::Bytes>,
2533 #[prost(message, repeated, tag = "3")]
2535 pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
2536 #[prost(message, repeated, tag = "4")]
2538 pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
2539}
2540#[non_exhaustive]
2542#[derive(Clone, PartialEq, ::prost::Message)]
2543pub struct DatatypeDescriptor {
2544 #[prost(string, optional, tag = "1")]
2548 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
2549 #[prost(string, optional, tag = "2")]
2553 pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
2554 #[prost(string, optional, tag = "3")]
2556 pub module: ::core::option::Option<::prost::alloc::string::String>,
2557 #[prost(string, optional, tag = "4")]
2559 pub name: ::core::option::Option<::prost::alloc::string::String>,
2560 #[prost(enumeration = "Ability", repeated, tag = "5")]
2562 pub abilities: ::prost::alloc::vec::Vec<i32>,
2563 #[prost(message, repeated, tag = "6")]
2565 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
2566 #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
2568 pub kind: ::core::option::Option<i32>,
2569 #[prost(message, repeated, tag = "8")]
2573 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
2574 #[prost(message, repeated, tag = "9")]
2578 pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
2579}
2580pub mod datatype_descriptor {
2582 #[non_exhaustive]
2583 #[derive(
2584 Clone,
2585 Copy,
2586 Debug,
2587 PartialEq,
2588 Eq,
2589 Hash,
2590 PartialOrd,
2591 Ord,
2592 ::prost::Enumeration
2593 )]
2594 #[repr(i32)]
2595 pub enum DatatypeKind {
2596 Unknown = 0,
2597 Struct = 1,
2598 Enum = 2,
2599 }
2600 impl DatatypeKind {
2601 pub fn as_str_name(&self) -> &'static str {
2606 match self {
2607 Self::Unknown => "DATATYPE_KIND_UNKNOWN",
2608 Self::Struct => "STRUCT",
2609 Self::Enum => "ENUM",
2610 }
2611 }
2612 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2614 match value {
2615 "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
2616 "STRUCT" => Some(Self::Struct),
2617 "ENUM" => Some(Self::Enum),
2618 _ => None,
2619 }
2620 }
2621 }
2622}
2623#[non_exhaustive]
2625#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2626pub struct TypeParameter {
2627 #[prost(enumeration = "Ability", repeated, tag = "1")]
2629 pub constraints: ::prost::alloc::vec::Vec<i32>,
2630 #[prost(bool, optional, tag = "2")]
2632 pub is_phantom: ::core::option::Option<bool>,
2633}
2634#[non_exhaustive]
2636#[derive(Clone, PartialEq, ::prost::Message)]
2637pub struct FieldDescriptor {
2638 #[prost(string, optional, tag = "1")]
2640 pub name: ::core::option::Option<::prost::alloc::string::String>,
2641 #[prost(uint32, optional, tag = "2")]
2643 pub position: ::core::option::Option<u32>,
2644 #[prost(message, optional, tag = "3")]
2646 pub r#type: ::core::option::Option<OpenSignatureBody>,
2647}
2648#[non_exhaustive]
2650#[derive(Clone, PartialEq, ::prost::Message)]
2651pub struct VariantDescriptor {
2652 #[prost(string, optional, tag = "1")]
2654 pub name: ::core::option::Option<::prost::alloc::string::String>,
2655 #[prost(uint32, optional, tag = "2")]
2657 pub position: ::core::option::Option<u32>,
2658 #[prost(message, repeated, tag = "3")]
2660 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
2661}
2662#[non_exhaustive]
2664#[derive(Clone, PartialEq, ::prost::Message)]
2665pub struct OpenSignatureBody {
2666 #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
2668 pub r#type: ::core::option::Option<i32>,
2669 #[prost(string, optional, tag = "2")]
2671 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
2672 #[prost(message, repeated, tag = "3")]
2674 pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
2675 #[prost(uint32, optional, tag = "4")]
2677 pub type_parameter: ::core::option::Option<u32>,
2678}
2679pub mod open_signature_body {
2681 #[non_exhaustive]
2682 #[derive(
2683 Clone,
2684 Copy,
2685 Debug,
2686 PartialEq,
2687 Eq,
2688 Hash,
2689 PartialOrd,
2690 Ord,
2691 ::prost::Enumeration
2692 )]
2693 #[repr(i32)]
2694 pub enum Type {
2695 Unknown = 0,
2696 Address = 1,
2697 Bool = 2,
2698 U8 = 3,
2699 U16 = 4,
2700 U32 = 5,
2701 U64 = 6,
2702 U128 = 7,
2703 U256 = 8,
2704 Vector = 9,
2705 Datatype = 10,
2706 Parameter = 11,
2707 }
2708 impl Type {
2709 pub fn as_str_name(&self) -> &'static str {
2714 match self {
2715 Self::Unknown => "TYPE_UNKNOWN",
2716 Self::Address => "ADDRESS",
2717 Self::Bool => "BOOL",
2718 Self::U8 => "U8",
2719 Self::U16 => "U16",
2720 Self::U32 => "U32",
2721 Self::U64 => "U64",
2722 Self::U128 => "U128",
2723 Self::U256 => "U256",
2724 Self::Vector => "VECTOR",
2725 Self::Datatype => "DATATYPE",
2726 Self::Parameter => "TYPE_PARAMETER",
2727 }
2728 }
2729 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2731 match value {
2732 "TYPE_UNKNOWN" => Some(Self::Unknown),
2733 "ADDRESS" => Some(Self::Address),
2734 "BOOL" => Some(Self::Bool),
2735 "U8" => Some(Self::U8),
2736 "U16" => Some(Self::U16),
2737 "U32" => Some(Self::U32),
2738 "U64" => Some(Self::U64),
2739 "U128" => Some(Self::U128),
2740 "U256" => Some(Self::U256),
2741 "VECTOR" => Some(Self::Vector),
2742 "DATATYPE" => Some(Self::Datatype),
2743 "TYPE_PARAMETER" => Some(Self::Parameter),
2744 _ => None,
2745 }
2746 }
2747 }
2748}
2749#[non_exhaustive]
2751#[derive(Clone, PartialEq, ::prost::Message)]
2752pub struct FunctionDescriptor {
2753 #[prost(string, optional, tag = "1")]
2755 pub name: ::core::option::Option<::prost::alloc::string::String>,
2756 #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
2758 pub visibility: ::core::option::Option<i32>,
2759 #[prost(bool, optional, tag = "6")]
2761 pub is_entry: ::core::option::Option<bool>,
2762 #[prost(message, repeated, tag = "7")]
2764 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
2765 #[prost(message, repeated, tag = "8")]
2767 pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
2768 #[prost(message, repeated, tag = "9")]
2770 pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
2771}
2772pub mod function_descriptor {
2774 #[non_exhaustive]
2775 #[derive(
2776 Clone,
2777 Copy,
2778 Debug,
2779 PartialEq,
2780 Eq,
2781 Hash,
2782 PartialOrd,
2783 Ord,
2784 ::prost::Enumeration
2785 )]
2786 #[repr(i32)]
2787 pub enum Visibility {
2788 Unknown = 0,
2789 Private = 1,
2790 Public = 2,
2791 Friend = 3,
2792 }
2793 impl Visibility {
2794 pub fn as_str_name(&self) -> &'static str {
2799 match self {
2800 Self::Unknown => "VISIBILITY_UNKNOWN",
2801 Self::Private => "PRIVATE",
2802 Self::Public => "PUBLIC",
2803 Self::Friend => "FRIEND",
2804 }
2805 }
2806 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2808 match value {
2809 "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
2810 "PRIVATE" => Some(Self::Private),
2811 "PUBLIC" => Some(Self::Public),
2812 "FRIEND" => Some(Self::Friend),
2813 _ => None,
2814 }
2815 }
2816 }
2817}
2818#[non_exhaustive]
2820#[derive(Clone, PartialEq, ::prost::Message)]
2821pub struct OpenSignature {
2822 #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
2823 pub reference: ::core::option::Option<i32>,
2824 #[prost(message, optional, tag = "2")]
2825 pub body: ::core::option::Option<OpenSignatureBody>,
2826}
2827pub mod open_signature {
2829 #[non_exhaustive]
2830 #[derive(
2831 Clone,
2832 Copy,
2833 Debug,
2834 PartialEq,
2835 Eq,
2836 Hash,
2837 PartialOrd,
2838 Ord,
2839 ::prost::Enumeration
2840 )]
2841 #[repr(i32)]
2842 pub enum Reference {
2843 Unknown = 0,
2844 Immutable = 1,
2845 Mutable = 2,
2846 }
2847 impl Reference {
2848 pub fn as_str_name(&self) -> &'static str {
2853 match self {
2854 Self::Unknown => "REFERENCE_UNKNOWN",
2855 Self::Immutable => "IMMUTABLE",
2856 Self::Mutable => "MUTABLE",
2857 }
2858 }
2859 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2861 match value {
2862 "REFERENCE_UNKNOWN" => Some(Self::Unknown),
2863 "IMMUTABLE" => Some(Self::Immutable),
2864 "MUTABLE" => Some(Self::Mutable),
2865 _ => None,
2866 }
2867 }
2868 }
2869}
2870#[non_exhaustive]
2872#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2873pub struct TypeOrigin {
2874 #[prost(string, optional, tag = "1")]
2875 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
2876 #[prost(string, optional, tag = "2")]
2877 pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
2878 #[prost(string, optional, tag = "3")]
2879 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
2880}
2881#[non_exhaustive]
2883#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2884pub struct Linkage {
2885 #[prost(string, optional, tag = "1")]
2887 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
2888 #[prost(string, optional, tag = "2")]
2890 pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
2891 #[prost(uint64, optional, tag = "3")]
2893 pub upgraded_version: ::core::option::Option<u64>,
2894}
2895#[non_exhaustive]
2897#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2898#[repr(i32)]
2899pub enum Ability {
2900 Unknown = 0,
2901 Copy = 1,
2903 Drop = 2,
2905 Store = 3,
2907 Key = 4,
2909}
2910impl Ability {
2911 pub fn as_str_name(&self) -> &'static str {
2916 match self {
2917 Self::Unknown => "ABILITY_UNKNOWN",
2918 Self::Copy => "COPY",
2919 Self::Drop => "DROP",
2920 Self::Store => "STORE",
2921 Self::Key => "KEY",
2922 }
2923 }
2924 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2926 match value {
2927 "ABILITY_UNKNOWN" => Some(Self::Unknown),
2928 "COPY" => Some(Self::Copy),
2929 "DROP" => Some(Self::Drop),
2930 "STORE" => Some(Self::Store),
2931 "KEY" => Some(Self::Key),
2932 _ => None,
2933 }
2934 }
2935}
2936#[non_exhaustive]
2937#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2938pub struct GetPackageRequest {
2939 #[prost(string, optional, tag = "1")]
2941 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
2942}
2943#[non_exhaustive]
2944#[derive(Clone, PartialEq, ::prost::Message)]
2945pub struct GetPackageResponse {
2946 #[prost(message, optional, tag = "1")]
2948 pub package: ::core::option::Option<Package>,
2949}
2950#[non_exhaustive]
2951#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2952pub struct GetDatatypeRequest {
2953 #[prost(string, optional, tag = "1")]
2955 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
2956 #[prost(string, optional, tag = "2")]
2958 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
2959 #[prost(string, optional, tag = "3")]
2961 pub name: ::core::option::Option<::prost::alloc::string::String>,
2962}
2963#[non_exhaustive]
2964#[derive(Clone, PartialEq, ::prost::Message)]
2965pub struct GetDatatypeResponse {
2966 #[prost(message, optional, tag = "1")]
2968 pub datatype: ::core::option::Option<DatatypeDescriptor>,
2969}
2970#[non_exhaustive]
2971#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2972pub struct GetFunctionRequest {
2973 #[prost(string, optional, tag = "1")]
2975 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
2976 #[prost(string, optional, tag = "2")]
2978 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
2979 #[prost(string, optional, tag = "3")]
2981 pub name: ::core::option::Option<::prost::alloc::string::String>,
2982}
2983#[non_exhaustive]
2984#[derive(Clone, PartialEq, ::prost::Message)]
2985pub struct GetFunctionResponse {
2986 #[prost(message, optional, tag = "1")]
2988 pub function: ::core::option::Option<FunctionDescriptor>,
2989}
2990#[non_exhaustive]
2991#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2992pub struct ListPackageVersionsRequest {
2993 #[prost(string, optional, tag = "1")]
2995 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
2996 #[prost(uint32, optional, tag = "2")]
3000 pub page_size: ::core::option::Option<u32>,
3001 #[prost(bytes = "bytes", optional, tag = "3")]
3007 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
3008}
3009#[non_exhaustive]
3010#[derive(Clone, PartialEq, ::prost::Message)]
3011pub struct ListPackageVersionsResponse {
3012 #[prost(message, repeated, tag = "1")]
3014 pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
3015 #[prost(bytes = "bytes", optional, tag = "2")]
3018 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
3019}
3020#[non_exhaustive]
3022#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3023pub struct PackageVersion {
3024 #[prost(string, optional, tag = "1")]
3026 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3027 #[prost(uint64, optional, tag = "2")]
3029 pub version: ::core::option::Option<u64>,
3030}
3031pub mod move_package_service_client {
3033 #![allow(
3034 unused_variables,
3035 dead_code,
3036 missing_docs,
3037 clippy::wildcard_imports,
3038 clippy::let_unit_value,
3039 )]
3040 use tonic::codegen::*;
3041 use tonic::codegen::http::Uri;
3042 #[derive(Debug, Clone)]
3043 pub struct MovePackageServiceClient<T> {
3044 inner: tonic::client::Grpc<T>,
3045 }
3046 impl MovePackageServiceClient<tonic::transport::Channel> {
3047 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3049 where
3050 D: TryInto<tonic::transport::Endpoint>,
3051 D::Error: Into<StdError>,
3052 {
3053 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3054 Ok(Self::new(conn))
3055 }
3056 }
3057 impl<T> MovePackageServiceClient<T>
3058 where
3059 T: tonic::client::GrpcService<tonic::body::Body>,
3060 T::Error: Into<StdError>,
3061 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3062 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3063 {
3064 pub fn new(inner: T) -> Self {
3065 let inner = tonic::client::Grpc::new(inner);
3066 Self { inner }
3067 }
3068 pub fn with_origin(inner: T, origin: Uri) -> Self {
3069 let inner = tonic::client::Grpc::with_origin(inner, origin);
3070 Self { inner }
3071 }
3072 pub fn with_interceptor<F>(
3073 inner: T,
3074 interceptor: F,
3075 ) -> MovePackageServiceClient<InterceptedService<T, F>>
3076 where
3077 F: tonic::service::Interceptor,
3078 T::ResponseBody: Default,
3079 T: tonic::codegen::Service<
3080 http::Request<tonic::body::Body>,
3081 Response = http::Response<
3082 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3083 >,
3084 >,
3085 <T as tonic::codegen::Service<
3086 http::Request<tonic::body::Body>,
3087 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3088 {
3089 MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
3090 }
3091 #[must_use]
3096 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3097 self.inner = self.inner.send_compressed(encoding);
3098 self
3099 }
3100 #[must_use]
3102 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3103 self.inner = self.inner.accept_compressed(encoding);
3104 self
3105 }
3106 #[must_use]
3110 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3111 self.inner = self.inner.max_decoding_message_size(limit);
3112 self
3113 }
3114 #[must_use]
3118 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3119 self.inner = self.inner.max_encoding_message_size(limit);
3120 self
3121 }
3122 pub async fn get_package(
3123 &mut self,
3124 request: impl tonic::IntoRequest<super::GetPackageRequest>,
3125 ) -> std::result::Result<
3126 tonic::Response<super::GetPackageResponse>,
3127 tonic::Status,
3128 > {
3129 self.inner
3130 .ready()
3131 .await
3132 .map_err(|e| {
3133 tonic::Status::unknown(
3134 format!("Service was not ready: {}", e.into()),
3135 )
3136 })?;
3137 let codec = tonic_prost::ProstCodec::default();
3138 let path = http::uri::PathAndQuery::from_static(
3139 "/sui.rpc.v2.MovePackageService/GetPackage",
3140 );
3141 let mut req = request.into_request();
3142 req.extensions_mut()
3143 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
3144 self.inner.unary(req, path, codec).await
3145 }
3146 pub async fn get_datatype(
3147 &mut self,
3148 request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
3149 ) -> std::result::Result<
3150 tonic::Response<super::GetDatatypeResponse>,
3151 tonic::Status,
3152 > {
3153 self.inner
3154 .ready()
3155 .await
3156 .map_err(|e| {
3157 tonic::Status::unknown(
3158 format!("Service was not ready: {}", e.into()),
3159 )
3160 })?;
3161 let codec = tonic_prost::ProstCodec::default();
3162 let path = http::uri::PathAndQuery::from_static(
3163 "/sui.rpc.v2.MovePackageService/GetDatatype",
3164 );
3165 let mut req = request.into_request();
3166 req.extensions_mut()
3167 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
3168 self.inner.unary(req, path, codec).await
3169 }
3170 pub async fn get_function(
3171 &mut self,
3172 request: impl tonic::IntoRequest<super::GetFunctionRequest>,
3173 ) -> std::result::Result<
3174 tonic::Response<super::GetFunctionResponse>,
3175 tonic::Status,
3176 > {
3177 self.inner
3178 .ready()
3179 .await
3180 .map_err(|e| {
3181 tonic::Status::unknown(
3182 format!("Service was not ready: {}", e.into()),
3183 )
3184 })?;
3185 let codec = tonic_prost::ProstCodec::default();
3186 let path = http::uri::PathAndQuery::from_static(
3187 "/sui.rpc.v2.MovePackageService/GetFunction",
3188 );
3189 let mut req = request.into_request();
3190 req.extensions_mut()
3191 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
3192 self.inner.unary(req, path, codec).await
3193 }
3194 pub async fn list_package_versions(
3195 &mut self,
3196 request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
3197 ) -> std::result::Result<
3198 tonic::Response<super::ListPackageVersionsResponse>,
3199 tonic::Status,
3200 > {
3201 self.inner
3202 .ready()
3203 .await
3204 .map_err(|e| {
3205 tonic::Status::unknown(
3206 format!("Service was not ready: {}", e.into()),
3207 )
3208 })?;
3209 let codec = tonic_prost::ProstCodec::default();
3210 let path = http::uri::PathAndQuery::from_static(
3211 "/sui.rpc.v2.MovePackageService/ListPackageVersions",
3212 );
3213 let mut req = request.into_request();
3214 req.extensions_mut()
3215 .insert(
3216 GrpcMethod::new(
3217 "sui.rpc.v2.MovePackageService",
3218 "ListPackageVersions",
3219 ),
3220 );
3221 self.inner.unary(req, path, codec).await
3222 }
3223 }
3224}
3225pub mod move_package_service_server {
3227 #![allow(
3228 unused_variables,
3229 dead_code,
3230 missing_docs,
3231 clippy::wildcard_imports,
3232 clippy::let_unit_value,
3233 )]
3234 use tonic::codegen::*;
3235 #[async_trait]
3237 pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
3238 async fn get_package(
3239 &self,
3240 request: tonic::Request<super::GetPackageRequest>,
3241 ) -> std::result::Result<
3242 tonic::Response<super::GetPackageResponse>,
3243 tonic::Status,
3244 >;
3245 async fn get_datatype(
3246 &self,
3247 request: tonic::Request<super::GetDatatypeRequest>,
3248 ) -> std::result::Result<
3249 tonic::Response<super::GetDatatypeResponse>,
3250 tonic::Status,
3251 >;
3252 async fn get_function(
3253 &self,
3254 request: tonic::Request<super::GetFunctionRequest>,
3255 ) -> std::result::Result<
3256 tonic::Response<super::GetFunctionResponse>,
3257 tonic::Status,
3258 >;
3259 async fn list_package_versions(
3260 &self,
3261 request: tonic::Request<super::ListPackageVersionsRequest>,
3262 ) -> std::result::Result<
3263 tonic::Response<super::ListPackageVersionsResponse>,
3264 tonic::Status,
3265 >;
3266 }
3267 #[derive(Debug)]
3268 pub struct MovePackageServiceServer<T> {
3269 inner: Arc<T>,
3270 accept_compression_encodings: EnabledCompressionEncodings,
3271 send_compression_encodings: EnabledCompressionEncodings,
3272 max_decoding_message_size: Option<usize>,
3273 max_encoding_message_size: Option<usize>,
3274 }
3275 impl<T> MovePackageServiceServer<T> {
3276 pub fn new(inner: T) -> Self {
3277 Self::from_arc(Arc::new(inner))
3278 }
3279 pub fn from_arc(inner: Arc<T>) -> Self {
3280 Self {
3281 inner,
3282 accept_compression_encodings: Default::default(),
3283 send_compression_encodings: Default::default(),
3284 max_decoding_message_size: None,
3285 max_encoding_message_size: None,
3286 }
3287 }
3288 pub fn with_interceptor<F>(
3289 inner: T,
3290 interceptor: F,
3291 ) -> InterceptedService<Self, F>
3292 where
3293 F: tonic::service::Interceptor,
3294 {
3295 InterceptedService::new(Self::new(inner), interceptor)
3296 }
3297 #[must_use]
3299 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3300 self.accept_compression_encodings.enable(encoding);
3301 self
3302 }
3303 #[must_use]
3305 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3306 self.send_compression_encodings.enable(encoding);
3307 self
3308 }
3309 #[must_use]
3313 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3314 self.max_decoding_message_size = Some(limit);
3315 self
3316 }
3317 #[must_use]
3321 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3322 self.max_encoding_message_size = Some(limit);
3323 self
3324 }
3325 }
3326 impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
3327 where
3328 T: MovePackageService,
3329 B: Body + std::marker::Send + 'static,
3330 B::Error: Into<StdError> + std::marker::Send + 'static,
3331 {
3332 type Response = http::Response<tonic::body::Body>;
3333 type Error = std::convert::Infallible;
3334 type Future = BoxFuture<Self::Response, Self::Error>;
3335 fn poll_ready(
3336 &mut self,
3337 _cx: &mut Context<'_>,
3338 ) -> Poll<std::result::Result<(), Self::Error>> {
3339 Poll::Ready(Ok(()))
3340 }
3341 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3342 match req.uri().path() {
3343 "/sui.rpc.v2.MovePackageService/GetPackage" => {
3344 #[allow(non_camel_case_types)]
3345 struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
3346 impl<
3347 T: MovePackageService,
3348 > tonic::server::UnaryService<super::GetPackageRequest>
3349 for GetPackageSvc<T> {
3350 type Response = super::GetPackageResponse;
3351 type Future = BoxFuture<
3352 tonic::Response<Self::Response>,
3353 tonic::Status,
3354 >;
3355 fn call(
3356 &mut self,
3357 request: tonic::Request<super::GetPackageRequest>,
3358 ) -> Self::Future {
3359 let inner = Arc::clone(&self.0);
3360 let fut = async move {
3361 <T as MovePackageService>::get_package(&inner, request)
3362 .await
3363 };
3364 Box::pin(fut)
3365 }
3366 }
3367 let accept_compression_encodings = self.accept_compression_encodings;
3368 let send_compression_encodings = self.send_compression_encodings;
3369 let max_decoding_message_size = self.max_decoding_message_size;
3370 let max_encoding_message_size = self.max_encoding_message_size;
3371 let inner = self.inner.clone();
3372 let fut = async move {
3373 let method = GetPackageSvc(inner);
3374 let codec = tonic_prost::ProstCodec::default();
3375 let mut grpc = tonic::server::Grpc::new(codec)
3376 .apply_compression_config(
3377 accept_compression_encodings,
3378 send_compression_encodings,
3379 )
3380 .apply_max_message_size_config(
3381 max_decoding_message_size,
3382 max_encoding_message_size,
3383 );
3384 let res = grpc.unary(method, req).await;
3385 Ok(res)
3386 };
3387 Box::pin(fut)
3388 }
3389 "/sui.rpc.v2.MovePackageService/GetDatatype" => {
3390 #[allow(non_camel_case_types)]
3391 struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
3392 impl<
3393 T: MovePackageService,
3394 > tonic::server::UnaryService<super::GetDatatypeRequest>
3395 for GetDatatypeSvc<T> {
3396 type Response = super::GetDatatypeResponse;
3397 type Future = BoxFuture<
3398 tonic::Response<Self::Response>,
3399 tonic::Status,
3400 >;
3401 fn call(
3402 &mut self,
3403 request: tonic::Request<super::GetDatatypeRequest>,
3404 ) -> Self::Future {
3405 let inner = Arc::clone(&self.0);
3406 let fut = async move {
3407 <T as MovePackageService>::get_datatype(&inner, request)
3408 .await
3409 };
3410 Box::pin(fut)
3411 }
3412 }
3413 let accept_compression_encodings = self.accept_compression_encodings;
3414 let send_compression_encodings = self.send_compression_encodings;
3415 let max_decoding_message_size = self.max_decoding_message_size;
3416 let max_encoding_message_size = self.max_encoding_message_size;
3417 let inner = self.inner.clone();
3418 let fut = async move {
3419 let method = GetDatatypeSvc(inner);
3420 let codec = tonic_prost::ProstCodec::default();
3421 let mut grpc = tonic::server::Grpc::new(codec)
3422 .apply_compression_config(
3423 accept_compression_encodings,
3424 send_compression_encodings,
3425 )
3426 .apply_max_message_size_config(
3427 max_decoding_message_size,
3428 max_encoding_message_size,
3429 );
3430 let res = grpc.unary(method, req).await;
3431 Ok(res)
3432 };
3433 Box::pin(fut)
3434 }
3435 "/sui.rpc.v2.MovePackageService/GetFunction" => {
3436 #[allow(non_camel_case_types)]
3437 struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
3438 impl<
3439 T: MovePackageService,
3440 > tonic::server::UnaryService<super::GetFunctionRequest>
3441 for GetFunctionSvc<T> {
3442 type Response = super::GetFunctionResponse;
3443 type Future = BoxFuture<
3444 tonic::Response<Self::Response>,
3445 tonic::Status,
3446 >;
3447 fn call(
3448 &mut self,
3449 request: tonic::Request<super::GetFunctionRequest>,
3450 ) -> Self::Future {
3451 let inner = Arc::clone(&self.0);
3452 let fut = async move {
3453 <T as MovePackageService>::get_function(&inner, request)
3454 .await
3455 };
3456 Box::pin(fut)
3457 }
3458 }
3459 let accept_compression_encodings = self.accept_compression_encodings;
3460 let send_compression_encodings = self.send_compression_encodings;
3461 let max_decoding_message_size = self.max_decoding_message_size;
3462 let max_encoding_message_size = self.max_encoding_message_size;
3463 let inner = self.inner.clone();
3464 let fut = async move {
3465 let method = GetFunctionSvc(inner);
3466 let codec = tonic_prost::ProstCodec::default();
3467 let mut grpc = tonic::server::Grpc::new(codec)
3468 .apply_compression_config(
3469 accept_compression_encodings,
3470 send_compression_encodings,
3471 )
3472 .apply_max_message_size_config(
3473 max_decoding_message_size,
3474 max_encoding_message_size,
3475 );
3476 let res = grpc.unary(method, req).await;
3477 Ok(res)
3478 };
3479 Box::pin(fut)
3480 }
3481 "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
3482 #[allow(non_camel_case_types)]
3483 struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
3484 impl<
3485 T: MovePackageService,
3486 > tonic::server::UnaryService<super::ListPackageVersionsRequest>
3487 for ListPackageVersionsSvc<T> {
3488 type Response = super::ListPackageVersionsResponse;
3489 type Future = BoxFuture<
3490 tonic::Response<Self::Response>,
3491 tonic::Status,
3492 >;
3493 fn call(
3494 &mut self,
3495 request: tonic::Request<super::ListPackageVersionsRequest>,
3496 ) -> Self::Future {
3497 let inner = Arc::clone(&self.0);
3498 let fut = async move {
3499 <T as MovePackageService>::list_package_versions(
3500 &inner,
3501 request,
3502 )
3503 .await
3504 };
3505 Box::pin(fut)
3506 }
3507 }
3508 let accept_compression_encodings = self.accept_compression_encodings;
3509 let send_compression_encodings = self.send_compression_encodings;
3510 let max_decoding_message_size = self.max_decoding_message_size;
3511 let max_encoding_message_size = self.max_encoding_message_size;
3512 let inner = self.inner.clone();
3513 let fut = async move {
3514 let method = ListPackageVersionsSvc(inner);
3515 let codec = tonic_prost::ProstCodec::default();
3516 let mut grpc = tonic::server::Grpc::new(codec)
3517 .apply_compression_config(
3518 accept_compression_encodings,
3519 send_compression_encodings,
3520 )
3521 .apply_max_message_size_config(
3522 max_decoding_message_size,
3523 max_encoding_message_size,
3524 );
3525 let res = grpc.unary(method, req).await;
3526 Ok(res)
3527 };
3528 Box::pin(fut)
3529 }
3530 _ => {
3531 Box::pin(async move {
3532 let mut response = http::Response::new(
3533 tonic::body::Body::default(),
3534 );
3535 let headers = response.headers_mut();
3536 headers
3537 .insert(
3538 tonic::Status::GRPC_STATUS,
3539 (tonic::Code::Unimplemented as i32).into(),
3540 );
3541 headers
3542 .insert(
3543 http::header::CONTENT_TYPE,
3544 tonic::metadata::GRPC_CONTENT_TYPE,
3545 );
3546 Ok(response)
3547 })
3548 }
3549 }
3550 }
3551 }
3552 impl<T> Clone for MovePackageServiceServer<T> {
3553 fn clone(&self) -> Self {
3554 let inner = self.inner.clone();
3555 Self {
3556 inner,
3557 accept_compression_encodings: self.accept_compression_encodings,
3558 send_compression_encodings: self.send_compression_encodings,
3559 max_decoding_message_size: self.max_decoding_message_size,
3560 max_encoding_message_size: self.max_encoding_message_size,
3561 }
3562 }
3563 }
3564 pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
3566 impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
3567 const NAME: &'static str = SERVICE_NAME;
3568 }
3569}
3570#[non_exhaustive]
3571#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3572pub struct LookupNameRequest {
3573 #[prost(string, optional, tag = "1")]
3577 pub name: ::core::option::Option<::prost::alloc::string::String>,
3578}
3579#[non_exhaustive]
3580#[derive(Clone, PartialEq, ::prost::Message)]
3581pub struct LookupNameResponse {
3582 #[prost(message, optional, tag = "1")]
3584 pub record: ::core::option::Option<NameRecord>,
3585}
3586#[non_exhaustive]
3587#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3588pub struct ReverseLookupNameRequest {
3589 #[prost(string, optional, tag = "1")]
3591 pub address: ::core::option::Option<::prost::alloc::string::String>,
3592}
3593#[non_exhaustive]
3594#[derive(Clone, PartialEq, ::prost::Message)]
3595pub struct ReverseLookupNameResponse {
3596 #[prost(message, optional, tag = "1")]
3598 pub record: ::core::option::Option<NameRecord>,
3599}
3600#[non_exhaustive]
3601#[derive(Clone, PartialEq, ::prost::Message)]
3602pub struct NameRecord {
3603 #[prost(string, optional, tag = "1")]
3608 pub id: ::core::option::Option<::prost::alloc::string::String>,
3609 #[prost(string, optional, tag = "2")]
3611 pub name: ::core::option::Option<::prost::alloc::string::String>,
3612 #[prost(string, optional, tag = "3")]
3620 pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
3621 #[prost(message, optional, tag = "4")]
3626 pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
3627 #[prost(string, optional, tag = "5")]
3629 pub target_address: ::core::option::Option<::prost::alloc::string::String>,
3630 #[prost(btree_map = "string, string", tag = "6")]
3632 pub data: ::prost::alloc::collections::BTreeMap<
3633 ::prost::alloc::string::String,
3634 ::prost::alloc::string::String,
3635 >,
3636}
3637pub mod name_service_client {
3639 #![allow(
3640 unused_variables,
3641 dead_code,
3642 missing_docs,
3643 clippy::wildcard_imports,
3644 clippy::let_unit_value,
3645 )]
3646 use tonic::codegen::*;
3647 use tonic::codegen::http::Uri;
3648 #[derive(Debug, Clone)]
3649 pub struct NameServiceClient<T> {
3650 inner: tonic::client::Grpc<T>,
3651 }
3652 impl NameServiceClient<tonic::transport::Channel> {
3653 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3655 where
3656 D: TryInto<tonic::transport::Endpoint>,
3657 D::Error: Into<StdError>,
3658 {
3659 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3660 Ok(Self::new(conn))
3661 }
3662 }
3663 impl<T> NameServiceClient<T>
3664 where
3665 T: tonic::client::GrpcService<tonic::body::Body>,
3666 T::Error: Into<StdError>,
3667 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3668 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3669 {
3670 pub fn new(inner: T) -> Self {
3671 let inner = tonic::client::Grpc::new(inner);
3672 Self { inner }
3673 }
3674 pub fn with_origin(inner: T, origin: Uri) -> Self {
3675 let inner = tonic::client::Grpc::with_origin(inner, origin);
3676 Self { inner }
3677 }
3678 pub fn with_interceptor<F>(
3679 inner: T,
3680 interceptor: F,
3681 ) -> NameServiceClient<InterceptedService<T, F>>
3682 where
3683 F: tonic::service::Interceptor,
3684 T::ResponseBody: Default,
3685 T: tonic::codegen::Service<
3686 http::Request<tonic::body::Body>,
3687 Response = http::Response<
3688 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3689 >,
3690 >,
3691 <T as tonic::codegen::Service<
3692 http::Request<tonic::body::Body>,
3693 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3694 {
3695 NameServiceClient::new(InterceptedService::new(inner, interceptor))
3696 }
3697 #[must_use]
3702 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3703 self.inner = self.inner.send_compressed(encoding);
3704 self
3705 }
3706 #[must_use]
3708 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3709 self.inner = self.inner.accept_compressed(encoding);
3710 self
3711 }
3712 #[must_use]
3716 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3717 self.inner = self.inner.max_decoding_message_size(limit);
3718 self
3719 }
3720 #[must_use]
3724 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3725 self.inner = self.inner.max_encoding_message_size(limit);
3726 self
3727 }
3728 pub async fn lookup_name(
3729 &mut self,
3730 request: impl tonic::IntoRequest<super::LookupNameRequest>,
3731 ) -> std::result::Result<
3732 tonic::Response<super::LookupNameResponse>,
3733 tonic::Status,
3734 > {
3735 self.inner
3736 .ready()
3737 .await
3738 .map_err(|e| {
3739 tonic::Status::unknown(
3740 format!("Service was not ready: {}", e.into()),
3741 )
3742 })?;
3743 let codec = tonic_prost::ProstCodec::default();
3744 let path = http::uri::PathAndQuery::from_static(
3745 "/sui.rpc.v2.NameService/LookupName",
3746 );
3747 let mut req = request.into_request();
3748 req.extensions_mut()
3749 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
3750 self.inner.unary(req, path, codec).await
3751 }
3752 pub async fn reverse_lookup_name(
3753 &mut self,
3754 request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
3755 ) -> std::result::Result<
3756 tonic::Response<super::ReverseLookupNameResponse>,
3757 tonic::Status,
3758 > {
3759 self.inner
3760 .ready()
3761 .await
3762 .map_err(|e| {
3763 tonic::Status::unknown(
3764 format!("Service was not ready: {}", e.into()),
3765 )
3766 })?;
3767 let codec = tonic_prost::ProstCodec::default();
3768 let path = http::uri::PathAndQuery::from_static(
3769 "/sui.rpc.v2.NameService/ReverseLookupName",
3770 );
3771 let mut req = request.into_request();
3772 req.extensions_mut()
3773 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
3774 self.inner.unary(req, path, codec).await
3775 }
3776 }
3777}
3778pub mod name_service_server {
3780 #![allow(
3781 unused_variables,
3782 dead_code,
3783 missing_docs,
3784 clippy::wildcard_imports,
3785 clippy::let_unit_value,
3786 )]
3787 use tonic::codegen::*;
3788 #[async_trait]
3790 pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
3791 async fn lookup_name(
3792 &self,
3793 request: tonic::Request<super::LookupNameRequest>,
3794 ) -> std::result::Result<
3795 tonic::Response<super::LookupNameResponse>,
3796 tonic::Status,
3797 >;
3798 async fn reverse_lookup_name(
3799 &self,
3800 request: tonic::Request<super::ReverseLookupNameRequest>,
3801 ) -> std::result::Result<
3802 tonic::Response<super::ReverseLookupNameResponse>,
3803 tonic::Status,
3804 >;
3805 }
3806 #[derive(Debug)]
3807 pub struct NameServiceServer<T> {
3808 inner: Arc<T>,
3809 accept_compression_encodings: EnabledCompressionEncodings,
3810 send_compression_encodings: EnabledCompressionEncodings,
3811 max_decoding_message_size: Option<usize>,
3812 max_encoding_message_size: Option<usize>,
3813 }
3814 impl<T> NameServiceServer<T> {
3815 pub fn new(inner: T) -> Self {
3816 Self::from_arc(Arc::new(inner))
3817 }
3818 pub fn from_arc(inner: Arc<T>) -> Self {
3819 Self {
3820 inner,
3821 accept_compression_encodings: Default::default(),
3822 send_compression_encodings: Default::default(),
3823 max_decoding_message_size: None,
3824 max_encoding_message_size: None,
3825 }
3826 }
3827 pub fn with_interceptor<F>(
3828 inner: T,
3829 interceptor: F,
3830 ) -> InterceptedService<Self, F>
3831 where
3832 F: tonic::service::Interceptor,
3833 {
3834 InterceptedService::new(Self::new(inner), interceptor)
3835 }
3836 #[must_use]
3838 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3839 self.accept_compression_encodings.enable(encoding);
3840 self
3841 }
3842 #[must_use]
3844 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3845 self.send_compression_encodings.enable(encoding);
3846 self
3847 }
3848 #[must_use]
3852 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3853 self.max_decoding_message_size = Some(limit);
3854 self
3855 }
3856 #[must_use]
3860 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3861 self.max_encoding_message_size = Some(limit);
3862 self
3863 }
3864 }
3865 impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
3866 where
3867 T: NameService,
3868 B: Body + std::marker::Send + 'static,
3869 B::Error: Into<StdError> + std::marker::Send + 'static,
3870 {
3871 type Response = http::Response<tonic::body::Body>;
3872 type Error = std::convert::Infallible;
3873 type Future = BoxFuture<Self::Response, Self::Error>;
3874 fn poll_ready(
3875 &mut self,
3876 _cx: &mut Context<'_>,
3877 ) -> Poll<std::result::Result<(), Self::Error>> {
3878 Poll::Ready(Ok(()))
3879 }
3880 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3881 match req.uri().path() {
3882 "/sui.rpc.v2.NameService/LookupName" => {
3883 #[allow(non_camel_case_types)]
3884 struct LookupNameSvc<T: NameService>(pub Arc<T>);
3885 impl<
3886 T: NameService,
3887 > tonic::server::UnaryService<super::LookupNameRequest>
3888 for LookupNameSvc<T> {
3889 type Response = super::LookupNameResponse;
3890 type Future = BoxFuture<
3891 tonic::Response<Self::Response>,
3892 tonic::Status,
3893 >;
3894 fn call(
3895 &mut self,
3896 request: tonic::Request<super::LookupNameRequest>,
3897 ) -> Self::Future {
3898 let inner = Arc::clone(&self.0);
3899 let fut = async move {
3900 <T as NameService>::lookup_name(&inner, request).await
3901 };
3902 Box::pin(fut)
3903 }
3904 }
3905 let accept_compression_encodings = self.accept_compression_encodings;
3906 let send_compression_encodings = self.send_compression_encodings;
3907 let max_decoding_message_size = self.max_decoding_message_size;
3908 let max_encoding_message_size = self.max_encoding_message_size;
3909 let inner = self.inner.clone();
3910 let fut = async move {
3911 let method = LookupNameSvc(inner);
3912 let codec = tonic_prost::ProstCodec::default();
3913 let mut grpc = tonic::server::Grpc::new(codec)
3914 .apply_compression_config(
3915 accept_compression_encodings,
3916 send_compression_encodings,
3917 )
3918 .apply_max_message_size_config(
3919 max_decoding_message_size,
3920 max_encoding_message_size,
3921 );
3922 let res = grpc.unary(method, req).await;
3923 Ok(res)
3924 };
3925 Box::pin(fut)
3926 }
3927 "/sui.rpc.v2.NameService/ReverseLookupName" => {
3928 #[allow(non_camel_case_types)]
3929 struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
3930 impl<
3931 T: NameService,
3932 > tonic::server::UnaryService<super::ReverseLookupNameRequest>
3933 for ReverseLookupNameSvc<T> {
3934 type Response = super::ReverseLookupNameResponse;
3935 type Future = BoxFuture<
3936 tonic::Response<Self::Response>,
3937 tonic::Status,
3938 >;
3939 fn call(
3940 &mut self,
3941 request: tonic::Request<super::ReverseLookupNameRequest>,
3942 ) -> Self::Future {
3943 let inner = Arc::clone(&self.0);
3944 let fut = async move {
3945 <T as NameService>::reverse_lookup_name(&inner, request)
3946 .await
3947 };
3948 Box::pin(fut)
3949 }
3950 }
3951 let accept_compression_encodings = self.accept_compression_encodings;
3952 let send_compression_encodings = self.send_compression_encodings;
3953 let max_decoding_message_size = self.max_decoding_message_size;
3954 let max_encoding_message_size = self.max_encoding_message_size;
3955 let inner = self.inner.clone();
3956 let fut = async move {
3957 let method = ReverseLookupNameSvc(inner);
3958 let codec = tonic_prost::ProstCodec::default();
3959 let mut grpc = tonic::server::Grpc::new(codec)
3960 .apply_compression_config(
3961 accept_compression_encodings,
3962 send_compression_encodings,
3963 )
3964 .apply_max_message_size_config(
3965 max_decoding_message_size,
3966 max_encoding_message_size,
3967 );
3968 let res = grpc.unary(method, req).await;
3969 Ok(res)
3970 };
3971 Box::pin(fut)
3972 }
3973 _ => {
3974 Box::pin(async move {
3975 let mut response = http::Response::new(
3976 tonic::body::Body::default(),
3977 );
3978 let headers = response.headers_mut();
3979 headers
3980 .insert(
3981 tonic::Status::GRPC_STATUS,
3982 (tonic::Code::Unimplemented as i32).into(),
3983 );
3984 headers
3985 .insert(
3986 http::header::CONTENT_TYPE,
3987 tonic::metadata::GRPC_CONTENT_TYPE,
3988 );
3989 Ok(response)
3990 })
3991 }
3992 }
3993 }
3994 }
3995 impl<T> Clone for NameServiceServer<T> {
3996 fn clone(&self) -> Self {
3997 let inner = self.inner.clone();
3998 Self {
3999 inner,
4000 accept_compression_encodings: self.accept_compression_encodings,
4001 send_compression_encodings: self.send_compression_encodings,
4002 max_decoding_message_size: self.max_decoding_message_size,
4003 max_encoding_message_size: self.max_encoding_message_size,
4004 }
4005 }
4006 }
4007 pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
4009 impl<T> tonic::server::NamedService for NameServiceServer<T> {
4010 const NAME: &'static str = SERVICE_NAME;
4011 }
4012}
4013#[non_exhaustive]
4015#[derive(Clone, PartialEq, ::prost::Message)]
4016pub struct Object {
4017 #[prost(message, optional, tag = "1")]
4019 pub bcs: ::core::option::Option<Bcs>,
4020 #[prost(string, optional, tag = "2")]
4022 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4023 #[prost(uint64, optional, tag = "3")]
4025 pub version: ::core::option::Option<u64>,
4026 #[prost(string, optional, tag = "4")]
4028 pub digest: ::core::option::Option<::prost::alloc::string::String>,
4029 #[prost(message, optional, tag = "5")]
4031 pub owner: ::core::option::Option<Owner>,
4032 #[prost(string, optional, tag = "6")]
4036 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
4037 #[prost(bool, optional, tag = "7")]
4042 pub has_public_transfer: ::core::option::Option<bool>,
4043 #[prost(message, optional, tag = "8")]
4047 pub contents: ::core::option::Option<Bcs>,
4048 #[prost(message, optional, tag = "9")]
4050 pub package: ::core::option::Option<Package>,
4051 #[prost(string, optional, tag = "10")]
4053 pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
4054 #[prost(uint64, optional, tag = "11")]
4058 pub storage_rebate: ::core::option::Option<u64>,
4059 #[prost(message, optional, boxed, tag = "100")]
4061 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
4062 #[prost(uint64, optional, tag = "101")]
4064 pub balance: ::core::option::Option<u64>,
4065}
4066#[non_exhaustive]
4068#[derive(Clone, PartialEq, ::prost::Message)]
4069pub struct ObjectSet {
4070 #[prost(message, repeated, tag = "1")]
4072 pub objects: ::prost::alloc::vec::Vec<Object>,
4073}
4074#[non_exhaustive]
4076#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4077pub struct ObjectReference {
4078 #[prost(string, optional, tag = "1")]
4080 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4081 #[prost(uint64, optional, tag = "2")]
4083 pub version: ::core::option::Option<u64>,
4084 #[prost(string, optional, tag = "3")]
4086 pub digest: ::core::option::Option<::prost::alloc::string::String>,
4087}
4088#[non_exhaustive]
4090#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4091pub struct Owner {
4092 #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
4093 pub kind: ::core::option::Option<i32>,
4094 #[prost(string, optional, tag = "2")]
4096 pub address: ::core::option::Option<::prost::alloc::string::String>,
4097 #[prost(uint64, optional, tag = "3")]
4099 pub version: ::core::option::Option<u64>,
4100}
4101pub mod owner {
4103 #[non_exhaustive]
4104 #[derive(
4105 Clone,
4106 Copy,
4107 Debug,
4108 PartialEq,
4109 Eq,
4110 Hash,
4111 PartialOrd,
4112 Ord,
4113 ::prost::Enumeration
4114 )]
4115 #[repr(i32)]
4116 pub enum OwnerKind {
4117 Unknown = 0,
4118 Address = 1,
4119 Object = 2,
4120 Shared = 3,
4121 Immutable = 4,
4122 ConsensusAddress = 5,
4123 }
4124 impl OwnerKind {
4125 pub fn as_str_name(&self) -> &'static str {
4130 match self {
4131 Self::Unknown => "OWNER_KIND_UNKNOWN",
4132 Self::Address => "ADDRESS",
4133 Self::Object => "OBJECT",
4134 Self::Shared => "SHARED",
4135 Self::Immutable => "IMMUTABLE",
4136 Self::ConsensusAddress => "CONSENSUS_ADDRESS",
4137 }
4138 }
4139 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4141 match value {
4142 "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
4143 "ADDRESS" => Some(Self::Address),
4144 "OBJECT" => Some(Self::Object),
4145 "SHARED" => Some(Self::Shared),
4146 "IMMUTABLE" => Some(Self::Immutable),
4147 "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
4148 _ => None,
4149 }
4150 }
4151 }
4152}
4153#[non_exhaustive]
4154#[derive(Clone, PartialEq, ::prost::Message)]
4155pub struct ProtocolConfig {
4156 #[prost(uint64, optional, tag = "1")]
4157 pub protocol_version: ::core::option::Option<u64>,
4158 #[prost(btree_map = "string, bool", tag = "2")]
4159 pub feature_flags: ::prost::alloc::collections::BTreeMap<
4160 ::prost::alloc::string::String,
4161 bool,
4162 >,
4163 #[prost(btree_map = "string, string", tag = "3")]
4164 pub attributes: ::prost::alloc::collections::BTreeMap<
4165 ::prost::alloc::string::String,
4166 ::prost::alloc::string::String,
4167 >,
4168}
4169#[non_exhaustive]
4171#[derive(Clone, PartialEq, ::prost::Message)]
4172pub struct UserSignature {
4173 #[prost(message, optional, tag = "1")]
4178 pub bcs: ::core::option::Option<Bcs>,
4179 #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
4181 pub scheme: ::core::option::Option<i32>,
4182 #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
4183 pub signature: ::core::option::Option<user_signature::Signature>,
4184}
4185pub mod user_signature {
4187 #[non_exhaustive]
4188 #[derive(Clone, PartialEq, ::prost::Oneof)]
4189 pub enum Signature {
4190 #[prost(message, tag = "3")]
4192 Simple(super::SimpleSignature),
4193 #[prost(message, tag = "4")]
4195 Multisig(super::MultisigAggregatedSignature),
4196 #[prost(message, tag = "5")]
4198 Zklogin(super::ZkLoginAuthenticator),
4199 #[prost(message, tag = "6")]
4201 Passkey(super::PasskeyAuthenticator),
4202 }
4203}
4204#[non_exhaustive]
4206#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4207pub struct SimpleSignature {
4208 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4210 pub scheme: ::core::option::Option<i32>,
4211 #[prost(bytes = "bytes", optional, tag = "2")]
4213 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4214 #[prost(bytes = "bytes", optional, tag = "3")]
4216 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4217}
4218#[non_exhaustive]
4220#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4221pub struct ZkLoginPublicIdentifier {
4222 #[prost(string, optional, tag = "1")]
4223 pub iss: ::core::option::Option<::prost::alloc::string::String>,
4224 #[prost(string, optional, tag = "2")]
4226 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4227}
4228#[non_exhaustive]
4230#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4231pub struct MultisigMemberPublicKey {
4232 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4234 pub scheme: ::core::option::Option<i32>,
4235 #[prost(bytes = "bytes", optional, tag = "2")]
4237 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4238 #[prost(message, optional, tag = "3")]
4240 pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
4241}
4242#[non_exhaustive]
4244#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4245pub struct MultisigMember {
4246 #[prost(message, optional, tag = "1")]
4248 pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
4249 #[prost(uint32, optional, tag = "2")]
4251 pub weight: ::core::option::Option<u32>,
4252}
4253#[non_exhaustive]
4255#[derive(Clone, PartialEq, ::prost::Message)]
4256pub struct MultisigCommittee {
4257 #[prost(message, repeated, tag = "1")]
4259 pub members: ::prost::alloc::vec::Vec<MultisigMember>,
4260 #[prost(uint32, optional, tag = "2")]
4263 pub threshold: ::core::option::Option<u32>,
4264}
4265#[non_exhaustive]
4267#[derive(Clone, PartialEq, ::prost::Message)]
4268pub struct MultisigAggregatedSignature {
4269 #[prost(message, repeated, tag = "1")]
4273 pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
4274 #[prost(uint32, optional, tag = "2")]
4277 pub bitmap: ::core::option::Option<u32>,
4278 #[prost(bytes = "bytes", optional, tag = "3")]
4281 pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4282 #[prost(message, optional, tag = "4")]
4284 pub committee: ::core::option::Option<MultisigCommittee>,
4285}
4286#[non_exhaustive]
4288#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4289pub struct MultisigMemberSignature {
4290 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4292 pub scheme: ::core::option::Option<i32>,
4293 #[prost(bytes = "bytes", optional, tag = "2")]
4295 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4296 #[prost(message, optional, tag = "3")]
4298 pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
4299 #[prost(message, optional, tag = "4")]
4301 pub passkey: ::core::option::Option<PasskeyAuthenticator>,
4302}
4303#[non_exhaustive]
4305#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4306pub struct ZkLoginAuthenticator {
4307 #[prost(message, optional, tag = "1")]
4309 pub inputs: ::core::option::Option<ZkLoginInputs>,
4310 #[prost(uint64, optional, tag = "2")]
4312 pub max_epoch: ::core::option::Option<u64>,
4313 #[prost(message, optional, tag = "3")]
4315 pub signature: ::core::option::Option<SimpleSignature>,
4316 #[prost(message, optional, tag = "4")]
4318 pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
4319 #[prost(message, optional, tag = "5")]
4321 pub jwk_id: ::core::option::Option<JwkId>,
4322}
4323#[non_exhaustive]
4325#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4326pub struct ZkLoginInputs {
4327 #[prost(message, optional, tag = "1")]
4328 pub proof_points: ::core::option::Option<ZkLoginProof>,
4329 #[prost(message, optional, tag = "2")]
4330 pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
4331 #[prost(string, optional, tag = "3")]
4332 pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
4333 #[prost(string, optional, tag = "4")]
4335 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4336}
4337#[non_exhaustive]
4339#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4340pub struct ZkLoginProof {
4341 #[prost(message, optional, tag = "1")]
4342 pub a: ::core::option::Option<CircomG1>,
4343 #[prost(message, optional, tag = "2")]
4344 pub b: ::core::option::Option<CircomG2>,
4345 #[prost(message, optional, tag = "3")]
4346 pub c: ::core::option::Option<CircomG1>,
4347}
4348#[non_exhaustive]
4350#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4351pub struct ZkLoginClaim {
4352 #[prost(string, optional, tag = "1")]
4353 pub value: ::core::option::Option<::prost::alloc::string::String>,
4354 #[prost(uint32, optional, tag = "2")]
4355 pub index_mod_4: ::core::option::Option<u32>,
4356}
4357#[non_exhaustive]
4359#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4360pub struct CircomG1 {
4361 #[prost(string, optional, tag = "1")]
4363 pub e0: ::core::option::Option<::prost::alloc::string::String>,
4364 #[prost(string, optional, tag = "2")]
4366 pub e1: ::core::option::Option<::prost::alloc::string::String>,
4367 #[prost(string, optional, tag = "3")]
4369 pub e2: ::core::option::Option<::prost::alloc::string::String>,
4370}
4371#[non_exhaustive]
4373#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4374pub struct CircomG2 {
4375 #[prost(string, optional, tag = "1")]
4377 pub e00: ::core::option::Option<::prost::alloc::string::String>,
4378 #[prost(string, optional, tag = "2")]
4380 pub e01: ::core::option::Option<::prost::alloc::string::String>,
4381 #[prost(string, optional, tag = "3")]
4383 pub e10: ::core::option::Option<::prost::alloc::string::String>,
4384 #[prost(string, optional, tag = "4")]
4386 pub e11: ::core::option::Option<::prost::alloc::string::String>,
4387 #[prost(string, optional, tag = "5")]
4389 pub e20: ::core::option::Option<::prost::alloc::string::String>,
4390 #[prost(string, optional, tag = "6")]
4392 pub e21: ::core::option::Option<::prost::alloc::string::String>,
4393}
4394#[non_exhaustive]
4401#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4402pub struct PasskeyAuthenticator {
4403 #[prost(bytes = "bytes", optional, tag = "1")]
4408 pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
4409 #[prost(string, optional, tag = "2")]
4414 pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
4415 #[prost(message, optional, tag = "3")]
4417 pub signature: ::core::option::Option<SimpleSignature>,
4418}
4419#[non_exhaustive]
4421#[derive(Clone, PartialEq, ::prost::Message)]
4422pub struct ValidatorCommittee {
4423 #[prost(uint64, optional, tag = "1")]
4425 pub epoch: ::core::option::Option<u64>,
4426 #[prost(message, repeated, tag = "2")]
4428 pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
4429}
4430#[non_exhaustive]
4432#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4433pub struct ValidatorCommitteeMember {
4434 #[prost(bytes = "bytes", optional, tag = "1")]
4436 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4437 #[prost(uint64, optional, tag = "2")]
4439 pub weight: ::core::option::Option<u64>,
4440}
4441#[non_exhaustive]
4443#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4444pub struct ValidatorAggregatedSignature {
4445 #[prost(uint64, optional, tag = "1")]
4450 pub epoch: ::core::option::Option<u64>,
4451 #[prost(bytes = "bytes", optional, tag = "2")]
4453 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4454 #[prost(bytes = "bytes", optional, tag = "3")]
4457 pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4458}
4459#[non_exhaustive]
4466#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4467#[repr(i32)]
4468pub enum SignatureScheme {
4469 Ed25519 = 0,
4470 Secp256k1 = 1,
4471 Secp256r1 = 2,
4472 Multisig = 3,
4473 Bls12381 = 4,
4474 Zklogin = 5,
4475 Passkey = 6,
4476}
4477impl SignatureScheme {
4478 pub fn as_str_name(&self) -> &'static str {
4483 match self {
4484 Self::Ed25519 => "ED25519",
4485 Self::Secp256k1 => "SECP256K1",
4486 Self::Secp256r1 => "SECP256R1",
4487 Self::Multisig => "MULTISIG",
4488 Self::Bls12381 => "BLS12381",
4489 Self::Zklogin => "ZKLOGIN",
4490 Self::Passkey => "PASSKEY",
4491 }
4492 }
4493 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4495 match value {
4496 "ED25519" => Some(Self::Ed25519),
4497 "SECP256K1" => Some(Self::Secp256k1),
4498 "SECP256R1" => Some(Self::Secp256r1),
4499 "MULTISIG" => Some(Self::Multisig),
4500 "BLS12381" => Some(Self::Bls12381),
4501 "ZKLOGIN" => Some(Self::Zklogin),
4502 "PASSKEY" => Some(Self::Passkey),
4503 _ => None,
4504 }
4505 }
4506}
4507#[non_exhaustive]
4508#[derive(Clone, PartialEq, ::prost::Message)]
4509pub struct VerifySignatureRequest {
4510 #[prost(message, optional, tag = "1")]
4516 pub message: ::core::option::Option<Bcs>,
4517 #[prost(message, optional, tag = "2")]
4519 pub signature: ::core::option::Option<UserSignature>,
4520 #[prost(string, optional, tag = "3")]
4526 pub address: ::core::option::Option<::prost::alloc::string::String>,
4527 #[prost(message, repeated, tag = "4")]
4530 pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
4531}
4532#[non_exhaustive]
4533#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4534pub struct VerifySignatureResponse {
4535 #[prost(bool, optional, tag = "1")]
4537 pub is_valid: ::core::option::Option<bool>,
4538 #[prost(string, optional, tag = "2")]
4540 pub reason: ::core::option::Option<::prost::alloc::string::String>,
4541}
4542pub mod signature_verification_service_client {
4544 #![allow(
4545 unused_variables,
4546 dead_code,
4547 missing_docs,
4548 clippy::wildcard_imports,
4549 clippy::let_unit_value,
4550 )]
4551 use tonic::codegen::*;
4552 use tonic::codegen::http::Uri;
4553 #[derive(Debug, Clone)]
4554 pub struct SignatureVerificationServiceClient<T> {
4555 inner: tonic::client::Grpc<T>,
4556 }
4557 impl SignatureVerificationServiceClient<tonic::transport::Channel> {
4558 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4560 where
4561 D: TryInto<tonic::transport::Endpoint>,
4562 D::Error: Into<StdError>,
4563 {
4564 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4565 Ok(Self::new(conn))
4566 }
4567 }
4568 impl<T> SignatureVerificationServiceClient<T>
4569 where
4570 T: tonic::client::GrpcService<tonic::body::Body>,
4571 T::Error: Into<StdError>,
4572 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4573 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4574 {
4575 pub fn new(inner: T) -> Self {
4576 let inner = tonic::client::Grpc::new(inner);
4577 Self { inner }
4578 }
4579 pub fn with_origin(inner: T, origin: Uri) -> Self {
4580 let inner = tonic::client::Grpc::with_origin(inner, origin);
4581 Self { inner }
4582 }
4583 pub fn with_interceptor<F>(
4584 inner: T,
4585 interceptor: F,
4586 ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
4587 where
4588 F: tonic::service::Interceptor,
4589 T::ResponseBody: Default,
4590 T: tonic::codegen::Service<
4591 http::Request<tonic::body::Body>,
4592 Response = http::Response<
4593 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4594 >,
4595 >,
4596 <T as tonic::codegen::Service<
4597 http::Request<tonic::body::Body>,
4598 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4599 {
4600 SignatureVerificationServiceClient::new(
4601 InterceptedService::new(inner, interceptor),
4602 )
4603 }
4604 #[must_use]
4609 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4610 self.inner = self.inner.send_compressed(encoding);
4611 self
4612 }
4613 #[must_use]
4615 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4616 self.inner = self.inner.accept_compressed(encoding);
4617 self
4618 }
4619 #[must_use]
4623 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4624 self.inner = self.inner.max_decoding_message_size(limit);
4625 self
4626 }
4627 #[must_use]
4631 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4632 self.inner = self.inner.max_encoding_message_size(limit);
4633 self
4634 }
4635 pub async fn verify_signature(
4637 &mut self,
4638 request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
4639 ) -> std::result::Result<
4640 tonic::Response<super::VerifySignatureResponse>,
4641 tonic::Status,
4642 > {
4643 self.inner
4644 .ready()
4645 .await
4646 .map_err(|e| {
4647 tonic::Status::unknown(
4648 format!("Service was not ready: {}", e.into()),
4649 )
4650 })?;
4651 let codec = tonic_prost::ProstCodec::default();
4652 let path = http::uri::PathAndQuery::from_static(
4653 "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
4654 );
4655 let mut req = request.into_request();
4656 req.extensions_mut()
4657 .insert(
4658 GrpcMethod::new(
4659 "sui.rpc.v2.SignatureVerificationService",
4660 "VerifySignature",
4661 ),
4662 );
4663 self.inner.unary(req, path, codec).await
4664 }
4665 }
4666}
4667pub mod signature_verification_service_server {
4669 #![allow(
4670 unused_variables,
4671 dead_code,
4672 missing_docs,
4673 clippy::wildcard_imports,
4674 clippy::let_unit_value,
4675 )]
4676 use tonic::codegen::*;
4677 #[async_trait]
4679 pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
4680 async fn verify_signature(
4682 &self,
4683 request: tonic::Request<super::VerifySignatureRequest>,
4684 ) -> std::result::Result<
4685 tonic::Response<super::VerifySignatureResponse>,
4686 tonic::Status,
4687 >;
4688 }
4689 #[derive(Debug)]
4690 pub struct SignatureVerificationServiceServer<T> {
4691 inner: Arc<T>,
4692 accept_compression_encodings: EnabledCompressionEncodings,
4693 send_compression_encodings: EnabledCompressionEncodings,
4694 max_decoding_message_size: Option<usize>,
4695 max_encoding_message_size: Option<usize>,
4696 }
4697 impl<T> SignatureVerificationServiceServer<T> {
4698 pub fn new(inner: T) -> Self {
4699 Self::from_arc(Arc::new(inner))
4700 }
4701 pub fn from_arc(inner: Arc<T>) -> Self {
4702 Self {
4703 inner,
4704 accept_compression_encodings: Default::default(),
4705 send_compression_encodings: Default::default(),
4706 max_decoding_message_size: None,
4707 max_encoding_message_size: None,
4708 }
4709 }
4710 pub fn with_interceptor<F>(
4711 inner: T,
4712 interceptor: F,
4713 ) -> InterceptedService<Self, F>
4714 where
4715 F: tonic::service::Interceptor,
4716 {
4717 InterceptedService::new(Self::new(inner), interceptor)
4718 }
4719 #[must_use]
4721 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4722 self.accept_compression_encodings.enable(encoding);
4723 self
4724 }
4725 #[must_use]
4727 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4728 self.send_compression_encodings.enable(encoding);
4729 self
4730 }
4731 #[must_use]
4735 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4736 self.max_decoding_message_size = Some(limit);
4737 self
4738 }
4739 #[must_use]
4743 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4744 self.max_encoding_message_size = Some(limit);
4745 self
4746 }
4747 }
4748 impl<T, B> tonic::codegen::Service<http::Request<B>>
4749 for SignatureVerificationServiceServer<T>
4750 where
4751 T: SignatureVerificationService,
4752 B: Body + std::marker::Send + 'static,
4753 B::Error: Into<StdError> + std::marker::Send + 'static,
4754 {
4755 type Response = http::Response<tonic::body::Body>;
4756 type Error = std::convert::Infallible;
4757 type Future = BoxFuture<Self::Response, Self::Error>;
4758 fn poll_ready(
4759 &mut self,
4760 _cx: &mut Context<'_>,
4761 ) -> Poll<std::result::Result<(), Self::Error>> {
4762 Poll::Ready(Ok(()))
4763 }
4764 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4765 match req.uri().path() {
4766 "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
4767 #[allow(non_camel_case_types)]
4768 struct VerifySignatureSvc<T: SignatureVerificationService>(
4769 pub Arc<T>,
4770 );
4771 impl<
4772 T: SignatureVerificationService,
4773 > tonic::server::UnaryService<super::VerifySignatureRequest>
4774 for VerifySignatureSvc<T> {
4775 type Response = super::VerifySignatureResponse;
4776 type Future = BoxFuture<
4777 tonic::Response<Self::Response>,
4778 tonic::Status,
4779 >;
4780 fn call(
4781 &mut self,
4782 request: tonic::Request<super::VerifySignatureRequest>,
4783 ) -> Self::Future {
4784 let inner = Arc::clone(&self.0);
4785 let fut = async move {
4786 <T as SignatureVerificationService>::verify_signature(
4787 &inner,
4788 request,
4789 )
4790 .await
4791 };
4792 Box::pin(fut)
4793 }
4794 }
4795 let accept_compression_encodings = self.accept_compression_encodings;
4796 let send_compression_encodings = self.send_compression_encodings;
4797 let max_decoding_message_size = self.max_decoding_message_size;
4798 let max_encoding_message_size = self.max_encoding_message_size;
4799 let inner = self.inner.clone();
4800 let fut = async move {
4801 let method = VerifySignatureSvc(inner);
4802 let codec = tonic_prost::ProstCodec::default();
4803 let mut grpc = tonic::server::Grpc::new(codec)
4804 .apply_compression_config(
4805 accept_compression_encodings,
4806 send_compression_encodings,
4807 )
4808 .apply_max_message_size_config(
4809 max_decoding_message_size,
4810 max_encoding_message_size,
4811 );
4812 let res = grpc.unary(method, req).await;
4813 Ok(res)
4814 };
4815 Box::pin(fut)
4816 }
4817 _ => {
4818 Box::pin(async move {
4819 let mut response = http::Response::new(
4820 tonic::body::Body::default(),
4821 );
4822 let headers = response.headers_mut();
4823 headers
4824 .insert(
4825 tonic::Status::GRPC_STATUS,
4826 (tonic::Code::Unimplemented as i32).into(),
4827 );
4828 headers
4829 .insert(
4830 http::header::CONTENT_TYPE,
4831 tonic::metadata::GRPC_CONTENT_TYPE,
4832 );
4833 Ok(response)
4834 })
4835 }
4836 }
4837 }
4838 }
4839 impl<T> Clone for SignatureVerificationServiceServer<T> {
4840 fn clone(&self) -> Self {
4841 let inner = self.inner.clone();
4842 Self {
4843 inner,
4844 accept_compression_encodings: self.accept_compression_encodings,
4845 send_compression_encodings: self.send_compression_encodings,
4846 max_decoding_message_size: self.max_decoding_message_size,
4847 max_encoding_message_size: self.max_encoding_message_size,
4848 }
4849 }
4850 }
4851 pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
4853 impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
4854 const NAME: &'static str = SERVICE_NAME;
4855 }
4856}
4857#[non_exhaustive]
4859#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4860pub struct GetCoinInfoRequest {
4861 #[prost(string, optional, tag = "1")]
4863 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
4864}
4865#[non_exhaustive]
4867#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4868pub struct GetCoinInfoResponse {
4869 #[prost(string, optional, tag = "1")]
4871 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
4872 #[prost(message, optional, tag = "2")]
4875 pub metadata: ::core::option::Option<CoinMetadata>,
4876 #[prost(message, optional, tag = "3")]
4879 pub treasury: ::core::option::Option<CoinTreasury>,
4880 #[prost(message, optional, tag = "4")]
4888 pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
4889}
4890#[non_exhaustive]
4892#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4893pub struct CoinMetadata {
4894 #[prost(string, optional, tag = "1")]
4897 pub id: ::core::option::Option<::prost::alloc::string::String>,
4898 #[prost(uint32, optional, tag = "2")]
4900 pub decimals: ::core::option::Option<u32>,
4901 #[prost(string, optional, tag = "3")]
4903 pub name: ::core::option::Option<::prost::alloc::string::String>,
4904 #[prost(string, optional, tag = "4")]
4906 pub symbol: ::core::option::Option<::prost::alloc::string::String>,
4907 #[prost(string, optional, tag = "5")]
4909 pub description: ::core::option::Option<::prost::alloc::string::String>,
4910 #[prost(string, optional, tag = "6")]
4912 pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
4913 #[prost(string, optional, tag = "7")]
4917 pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
4918 #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
4920 pub metadata_cap_state: ::core::option::Option<i32>,
4921}
4922pub mod coin_metadata {
4924 #[non_exhaustive]
4926 #[derive(
4927 Clone,
4928 Copy,
4929 Debug,
4930 PartialEq,
4931 Eq,
4932 Hash,
4933 PartialOrd,
4934 Ord,
4935 ::prost::Enumeration
4936 )]
4937 #[repr(i32)]
4938 pub enum MetadataCapState {
4939 Unknown = 0,
4942 Claimed = 1,
4944 Unclaimed = 2,
4946 Deleted = 3,
4948 }
4949 impl MetadataCapState {
4950 pub fn as_str_name(&self) -> &'static str {
4955 match self {
4956 Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
4957 Self::Claimed => "CLAIMED",
4958 Self::Unclaimed => "UNCLAIMED",
4959 Self::Deleted => "DELETED",
4960 }
4961 }
4962 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4964 match value {
4965 "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
4966 "CLAIMED" => Some(Self::Claimed),
4967 "UNCLAIMED" => Some(Self::Unclaimed),
4968 "DELETED" => Some(Self::Deleted),
4969 _ => None,
4970 }
4971 }
4972 }
4973}
4974#[non_exhaustive]
4976#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4977pub struct CoinTreasury {
4978 #[prost(string, optional, tag = "1")]
4980 pub id: ::core::option::Option<::prost::alloc::string::String>,
4981 #[prost(uint64, optional, tag = "2")]
4983 pub total_supply: ::core::option::Option<u64>,
4984 #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
4986 pub supply_state: ::core::option::Option<i32>,
4987}
4988pub mod coin_treasury {
4990 #[non_exhaustive]
4992 #[derive(
4993 Clone,
4994 Copy,
4995 Debug,
4996 PartialEq,
4997 Eq,
4998 Hash,
4999 PartialOrd,
5000 Ord,
5001 ::prost::Enumeration
5002 )]
5003 #[repr(i32)]
5004 pub enum SupplyState {
5005 Unknown = 0,
5007 Fixed = 1,
5009 BurnOnly = 2,
5011 }
5012 impl SupplyState {
5013 pub fn as_str_name(&self) -> &'static str {
5018 match self {
5019 Self::Unknown => "SUPPLY_STATE_UNKNOWN",
5020 Self::Fixed => "FIXED",
5021 Self::BurnOnly => "BURN_ONLY",
5022 }
5023 }
5024 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5026 match value {
5027 "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
5028 "FIXED" => Some(Self::Fixed),
5029 "BURN_ONLY" => Some(Self::BurnOnly),
5030 _ => None,
5031 }
5032 }
5033 }
5034}
5035#[non_exhaustive]
5037#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5038pub struct RegulatedCoinMetadata {
5039 #[prost(string, optional, tag = "1")]
5042 pub id: ::core::option::Option<::prost::alloc::string::String>,
5043 #[prost(string, optional, tag = "2")]
5045 pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
5046 #[prost(string, optional, tag = "3")]
5048 pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
5049 #[prost(bool, optional, tag = "4")]
5051 pub allow_global_pause: ::core::option::Option<bool>,
5052 #[prost(uint32, optional, tag = "5")]
5054 pub variant: ::core::option::Option<u32>,
5055 #[prost(
5057 enumeration = "regulated_coin_metadata::CoinRegulatedState",
5058 optional,
5059 tag = "6"
5060 )]
5061 pub coin_regulated_state: ::core::option::Option<i32>,
5062}
5063pub mod regulated_coin_metadata {
5065 #[non_exhaustive]
5067 #[derive(
5068 Clone,
5069 Copy,
5070 Debug,
5071 PartialEq,
5072 Eq,
5073 Hash,
5074 PartialOrd,
5075 Ord,
5076 ::prost::Enumeration
5077 )]
5078 #[repr(i32)]
5079 pub enum CoinRegulatedState {
5080 Unknown = 0,
5085 Regulated = 1,
5087 Unregulated = 2,
5089 }
5090 impl CoinRegulatedState {
5091 pub fn as_str_name(&self) -> &'static str {
5096 match self {
5097 Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
5098 Self::Regulated => "REGULATED",
5099 Self::Unregulated => "UNREGULATED",
5100 }
5101 }
5102 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5104 match value {
5105 "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
5106 "REGULATED" => Some(Self::Regulated),
5107 "UNREGULATED" => Some(Self::Unregulated),
5108 _ => None,
5109 }
5110 }
5111 }
5112}
5113#[non_exhaustive]
5115#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5116pub struct GetBalanceRequest {
5117 #[prost(string, optional, tag = "1")]
5119 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5120 #[prost(string, optional, tag = "2")]
5122 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5123}
5124#[non_exhaustive]
5127#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5128pub struct GetBalanceResponse {
5129 #[prost(message, optional, tag = "1")]
5131 pub balance: ::core::option::Option<Balance>,
5132}
5133#[non_exhaustive]
5135#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5136pub struct ListBalancesRequest {
5137 #[prost(string, optional, tag = "1")]
5139 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5140 #[prost(uint32, optional, tag = "2")]
5144 pub page_size: ::core::option::Option<u32>,
5145 #[prost(bytes = "bytes", optional, tag = "3")]
5151 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5152}
5153#[non_exhaustive]
5156#[derive(Clone, PartialEq, ::prost::Message)]
5157pub struct ListBalancesResponse {
5158 #[prost(message, repeated, tag = "1")]
5160 pub balances: ::prost::alloc::vec::Vec<Balance>,
5161 #[prost(bytes = "bytes", optional, tag = "2")]
5164 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5165}
5166#[non_exhaustive]
5168#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5169pub struct Balance {
5170 #[prost(string, optional, tag = "1")]
5172 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5173 #[prost(uint64, optional, tag = "3")]
5175 pub balance: ::core::option::Option<u64>,
5176}
5177#[non_exhaustive]
5179#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5180pub struct ListDynamicFieldsRequest {
5181 #[prost(string, optional, tag = "1")]
5183 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5184 #[prost(uint32, optional, tag = "2")]
5188 pub page_size: ::core::option::Option<u32>,
5189 #[prost(bytes = "bytes", optional, tag = "3")]
5195 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5196 #[prost(message, optional, tag = "4")]
5199 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5200}
5201#[non_exhaustive]
5203#[derive(Clone, PartialEq, ::prost::Message)]
5204pub struct ListDynamicFieldsResponse {
5205 #[prost(message, repeated, tag = "1")]
5207 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
5208 #[prost(bytes = "bytes", optional, tag = "2")]
5211 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5212}
5213#[non_exhaustive]
5214#[derive(Clone, PartialEq, ::prost::Message)]
5215pub struct DynamicField {
5216 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
5217 pub kind: ::core::option::Option<i32>,
5218 #[prost(string, optional, tag = "2")]
5220 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5221 #[prost(string, optional, tag = "3")]
5223 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
5224 #[prost(message, optional, tag = "4")]
5226 pub field_object: ::core::option::Option<Object>,
5227 #[prost(message, optional, tag = "5")]
5229 pub name: ::core::option::Option<Bcs>,
5230 #[prost(message, optional, tag = "6")]
5232 pub value: ::core::option::Option<Bcs>,
5233 #[prost(string, optional, tag = "7")]
5239 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
5240 #[prost(string, optional, tag = "8")]
5246 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
5247 #[prost(message, optional, tag = "9")]
5249 pub child_object: ::core::option::Option<Object>,
5250}
5251pub mod dynamic_field {
5253 #[non_exhaustive]
5254 #[derive(
5255 Clone,
5256 Copy,
5257 Debug,
5258 PartialEq,
5259 Eq,
5260 Hash,
5261 PartialOrd,
5262 Ord,
5263 ::prost::Enumeration
5264 )]
5265 #[repr(i32)]
5266 pub enum DynamicFieldKind {
5267 Unknown = 0,
5268 Field = 1,
5269 Object = 2,
5270 }
5271 impl DynamicFieldKind {
5272 pub fn as_str_name(&self) -> &'static str {
5277 match self {
5278 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
5279 Self::Field => "FIELD",
5280 Self::Object => "OBJECT",
5281 }
5282 }
5283 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5285 match value {
5286 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
5287 "FIELD" => Some(Self::Field),
5288 "OBJECT" => Some(Self::Object),
5289 _ => None,
5290 }
5291 }
5292 }
5293}
5294#[non_exhaustive]
5295#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5296pub struct ListOwnedObjectsRequest {
5297 #[prost(string, optional, tag = "1")]
5299 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5300 #[prost(uint32, optional, tag = "2")]
5304 pub page_size: ::core::option::Option<u32>,
5305 #[prost(bytes = "bytes", optional, tag = "3")]
5311 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5312 #[prost(message, optional, tag = "4")]
5315 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5316 #[prost(string, optional, tag = "5")]
5325 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5326}
5327#[non_exhaustive]
5328#[derive(Clone, PartialEq, ::prost::Message)]
5329pub struct ListOwnedObjectsResponse {
5330 #[prost(message, repeated, tag = "1")]
5332 pub objects: ::prost::alloc::vec::Vec<Object>,
5333 #[prost(bytes = "bytes", optional, tag = "2")]
5336 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5337}
5338pub mod state_service_client {
5340 #![allow(
5341 unused_variables,
5342 dead_code,
5343 missing_docs,
5344 clippy::wildcard_imports,
5345 clippy::let_unit_value,
5346 )]
5347 use tonic::codegen::*;
5348 use tonic::codegen::http::Uri;
5349 #[derive(Debug, Clone)]
5350 pub struct StateServiceClient<T> {
5351 inner: tonic::client::Grpc<T>,
5352 }
5353 impl StateServiceClient<tonic::transport::Channel> {
5354 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5356 where
5357 D: TryInto<tonic::transport::Endpoint>,
5358 D::Error: Into<StdError>,
5359 {
5360 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5361 Ok(Self::new(conn))
5362 }
5363 }
5364 impl<T> StateServiceClient<T>
5365 where
5366 T: tonic::client::GrpcService<tonic::body::Body>,
5367 T::Error: Into<StdError>,
5368 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5369 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5370 {
5371 pub fn new(inner: T) -> Self {
5372 let inner = tonic::client::Grpc::new(inner);
5373 Self { inner }
5374 }
5375 pub fn with_origin(inner: T, origin: Uri) -> Self {
5376 let inner = tonic::client::Grpc::with_origin(inner, origin);
5377 Self { inner }
5378 }
5379 pub fn with_interceptor<F>(
5380 inner: T,
5381 interceptor: F,
5382 ) -> StateServiceClient<InterceptedService<T, F>>
5383 where
5384 F: tonic::service::Interceptor,
5385 T::ResponseBody: Default,
5386 T: tonic::codegen::Service<
5387 http::Request<tonic::body::Body>,
5388 Response = http::Response<
5389 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5390 >,
5391 >,
5392 <T as tonic::codegen::Service<
5393 http::Request<tonic::body::Body>,
5394 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5395 {
5396 StateServiceClient::new(InterceptedService::new(inner, interceptor))
5397 }
5398 #[must_use]
5403 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5404 self.inner = self.inner.send_compressed(encoding);
5405 self
5406 }
5407 #[must_use]
5409 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5410 self.inner = self.inner.accept_compressed(encoding);
5411 self
5412 }
5413 #[must_use]
5417 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5418 self.inner = self.inner.max_decoding_message_size(limit);
5419 self
5420 }
5421 #[must_use]
5425 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5426 self.inner = self.inner.max_encoding_message_size(limit);
5427 self
5428 }
5429 pub async fn list_dynamic_fields(
5430 &mut self,
5431 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
5432 ) -> std::result::Result<
5433 tonic::Response<super::ListDynamicFieldsResponse>,
5434 tonic::Status,
5435 > {
5436 self.inner
5437 .ready()
5438 .await
5439 .map_err(|e| {
5440 tonic::Status::unknown(
5441 format!("Service was not ready: {}", e.into()),
5442 )
5443 })?;
5444 let codec = tonic_prost::ProstCodec::default();
5445 let path = http::uri::PathAndQuery::from_static(
5446 "/sui.rpc.v2.StateService/ListDynamicFields",
5447 );
5448 let mut req = request.into_request();
5449 req.extensions_mut()
5450 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
5451 self.inner.unary(req, path, codec).await
5452 }
5453 pub async fn list_owned_objects(
5454 &mut self,
5455 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
5456 ) -> std::result::Result<
5457 tonic::Response<super::ListOwnedObjectsResponse>,
5458 tonic::Status,
5459 > {
5460 self.inner
5461 .ready()
5462 .await
5463 .map_err(|e| {
5464 tonic::Status::unknown(
5465 format!("Service was not ready: {}", e.into()),
5466 )
5467 })?;
5468 let codec = tonic_prost::ProstCodec::default();
5469 let path = http::uri::PathAndQuery::from_static(
5470 "/sui.rpc.v2.StateService/ListOwnedObjects",
5471 );
5472 let mut req = request.into_request();
5473 req.extensions_mut()
5474 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
5475 self.inner.unary(req, path, codec).await
5476 }
5477 pub async fn get_coin_info(
5478 &mut self,
5479 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
5480 ) -> std::result::Result<
5481 tonic::Response<super::GetCoinInfoResponse>,
5482 tonic::Status,
5483 > {
5484 self.inner
5485 .ready()
5486 .await
5487 .map_err(|e| {
5488 tonic::Status::unknown(
5489 format!("Service was not ready: {}", e.into()),
5490 )
5491 })?;
5492 let codec = tonic_prost::ProstCodec::default();
5493 let path = http::uri::PathAndQuery::from_static(
5494 "/sui.rpc.v2.StateService/GetCoinInfo",
5495 );
5496 let mut req = request.into_request();
5497 req.extensions_mut()
5498 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
5499 self.inner.unary(req, path, codec).await
5500 }
5501 pub async fn get_balance(
5502 &mut self,
5503 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
5504 ) -> std::result::Result<
5505 tonic::Response<super::GetBalanceResponse>,
5506 tonic::Status,
5507 > {
5508 self.inner
5509 .ready()
5510 .await
5511 .map_err(|e| {
5512 tonic::Status::unknown(
5513 format!("Service was not ready: {}", e.into()),
5514 )
5515 })?;
5516 let codec = tonic_prost::ProstCodec::default();
5517 let path = http::uri::PathAndQuery::from_static(
5518 "/sui.rpc.v2.StateService/GetBalance",
5519 );
5520 let mut req = request.into_request();
5521 req.extensions_mut()
5522 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
5523 self.inner.unary(req, path, codec).await
5524 }
5525 pub async fn list_balances(
5526 &mut self,
5527 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
5528 ) -> std::result::Result<
5529 tonic::Response<super::ListBalancesResponse>,
5530 tonic::Status,
5531 > {
5532 self.inner
5533 .ready()
5534 .await
5535 .map_err(|e| {
5536 tonic::Status::unknown(
5537 format!("Service was not ready: {}", e.into()),
5538 )
5539 })?;
5540 let codec = tonic_prost::ProstCodec::default();
5541 let path = http::uri::PathAndQuery::from_static(
5542 "/sui.rpc.v2.StateService/ListBalances",
5543 );
5544 let mut req = request.into_request();
5545 req.extensions_mut()
5546 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
5547 self.inner.unary(req, path, codec).await
5548 }
5549 }
5550}
5551pub mod state_service_server {
5553 #![allow(
5554 unused_variables,
5555 dead_code,
5556 missing_docs,
5557 clippy::wildcard_imports,
5558 clippy::let_unit_value,
5559 )]
5560 use tonic::codegen::*;
5561 #[async_trait]
5563 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
5564 async fn list_dynamic_fields(
5565 &self,
5566 request: tonic::Request<super::ListDynamicFieldsRequest>,
5567 ) -> std::result::Result<
5568 tonic::Response<super::ListDynamicFieldsResponse>,
5569 tonic::Status,
5570 >;
5571 async fn list_owned_objects(
5572 &self,
5573 request: tonic::Request<super::ListOwnedObjectsRequest>,
5574 ) -> std::result::Result<
5575 tonic::Response<super::ListOwnedObjectsResponse>,
5576 tonic::Status,
5577 >;
5578 async fn get_coin_info(
5579 &self,
5580 request: tonic::Request<super::GetCoinInfoRequest>,
5581 ) -> std::result::Result<
5582 tonic::Response<super::GetCoinInfoResponse>,
5583 tonic::Status,
5584 >;
5585 async fn get_balance(
5586 &self,
5587 request: tonic::Request<super::GetBalanceRequest>,
5588 ) -> std::result::Result<
5589 tonic::Response<super::GetBalanceResponse>,
5590 tonic::Status,
5591 >;
5592 async fn list_balances(
5593 &self,
5594 request: tonic::Request<super::ListBalancesRequest>,
5595 ) -> std::result::Result<
5596 tonic::Response<super::ListBalancesResponse>,
5597 tonic::Status,
5598 >;
5599 }
5600 #[derive(Debug)]
5601 pub struct StateServiceServer<T> {
5602 inner: Arc<T>,
5603 accept_compression_encodings: EnabledCompressionEncodings,
5604 send_compression_encodings: EnabledCompressionEncodings,
5605 max_decoding_message_size: Option<usize>,
5606 max_encoding_message_size: Option<usize>,
5607 }
5608 impl<T> StateServiceServer<T> {
5609 pub fn new(inner: T) -> Self {
5610 Self::from_arc(Arc::new(inner))
5611 }
5612 pub fn from_arc(inner: Arc<T>) -> Self {
5613 Self {
5614 inner,
5615 accept_compression_encodings: Default::default(),
5616 send_compression_encodings: Default::default(),
5617 max_decoding_message_size: None,
5618 max_encoding_message_size: None,
5619 }
5620 }
5621 pub fn with_interceptor<F>(
5622 inner: T,
5623 interceptor: F,
5624 ) -> InterceptedService<Self, F>
5625 where
5626 F: tonic::service::Interceptor,
5627 {
5628 InterceptedService::new(Self::new(inner), interceptor)
5629 }
5630 #[must_use]
5632 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5633 self.accept_compression_encodings.enable(encoding);
5634 self
5635 }
5636 #[must_use]
5638 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5639 self.send_compression_encodings.enable(encoding);
5640 self
5641 }
5642 #[must_use]
5646 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5647 self.max_decoding_message_size = Some(limit);
5648 self
5649 }
5650 #[must_use]
5654 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5655 self.max_encoding_message_size = Some(limit);
5656 self
5657 }
5658 }
5659 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
5660 where
5661 T: StateService,
5662 B: Body + std::marker::Send + 'static,
5663 B::Error: Into<StdError> + std::marker::Send + 'static,
5664 {
5665 type Response = http::Response<tonic::body::Body>;
5666 type Error = std::convert::Infallible;
5667 type Future = BoxFuture<Self::Response, Self::Error>;
5668 fn poll_ready(
5669 &mut self,
5670 _cx: &mut Context<'_>,
5671 ) -> Poll<std::result::Result<(), Self::Error>> {
5672 Poll::Ready(Ok(()))
5673 }
5674 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5675 match req.uri().path() {
5676 "/sui.rpc.v2.StateService/ListDynamicFields" => {
5677 #[allow(non_camel_case_types)]
5678 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
5679 impl<
5680 T: StateService,
5681 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
5682 for ListDynamicFieldsSvc<T> {
5683 type Response = super::ListDynamicFieldsResponse;
5684 type Future = BoxFuture<
5685 tonic::Response<Self::Response>,
5686 tonic::Status,
5687 >;
5688 fn call(
5689 &mut self,
5690 request: tonic::Request<super::ListDynamicFieldsRequest>,
5691 ) -> Self::Future {
5692 let inner = Arc::clone(&self.0);
5693 let fut = async move {
5694 <T as StateService>::list_dynamic_fields(&inner, request)
5695 .await
5696 };
5697 Box::pin(fut)
5698 }
5699 }
5700 let accept_compression_encodings = self.accept_compression_encodings;
5701 let send_compression_encodings = self.send_compression_encodings;
5702 let max_decoding_message_size = self.max_decoding_message_size;
5703 let max_encoding_message_size = self.max_encoding_message_size;
5704 let inner = self.inner.clone();
5705 let fut = async move {
5706 let method = ListDynamicFieldsSvc(inner);
5707 let codec = tonic_prost::ProstCodec::default();
5708 let mut grpc = tonic::server::Grpc::new(codec)
5709 .apply_compression_config(
5710 accept_compression_encodings,
5711 send_compression_encodings,
5712 )
5713 .apply_max_message_size_config(
5714 max_decoding_message_size,
5715 max_encoding_message_size,
5716 );
5717 let res = grpc.unary(method, req).await;
5718 Ok(res)
5719 };
5720 Box::pin(fut)
5721 }
5722 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
5723 #[allow(non_camel_case_types)]
5724 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
5725 impl<
5726 T: StateService,
5727 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
5728 for ListOwnedObjectsSvc<T> {
5729 type Response = super::ListOwnedObjectsResponse;
5730 type Future = BoxFuture<
5731 tonic::Response<Self::Response>,
5732 tonic::Status,
5733 >;
5734 fn call(
5735 &mut self,
5736 request: tonic::Request<super::ListOwnedObjectsRequest>,
5737 ) -> Self::Future {
5738 let inner = Arc::clone(&self.0);
5739 let fut = async move {
5740 <T as StateService>::list_owned_objects(&inner, request)
5741 .await
5742 };
5743 Box::pin(fut)
5744 }
5745 }
5746 let accept_compression_encodings = self.accept_compression_encodings;
5747 let send_compression_encodings = self.send_compression_encodings;
5748 let max_decoding_message_size = self.max_decoding_message_size;
5749 let max_encoding_message_size = self.max_encoding_message_size;
5750 let inner = self.inner.clone();
5751 let fut = async move {
5752 let method = ListOwnedObjectsSvc(inner);
5753 let codec = tonic_prost::ProstCodec::default();
5754 let mut grpc = tonic::server::Grpc::new(codec)
5755 .apply_compression_config(
5756 accept_compression_encodings,
5757 send_compression_encodings,
5758 )
5759 .apply_max_message_size_config(
5760 max_decoding_message_size,
5761 max_encoding_message_size,
5762 );
5763 let res = grpc.unary(method, req).await;
5764 Ok(res)
5765 };
5766 Box::pin(fut)
5767 }
5768 "/sui.rpc.v2.StateService/GetCoinInfo" => {
5769 #[allow(non_camel_case_types)]
5770 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
5771 impl<
5772 T: StateService,
5773 > tonic::server::UnaryService<super::GetCoinInfoRequest>
5774 for GetCoinInfoSvc<T> {
5775 type Response = super::GetCoinInfoResponse;
5776 type Future = BoxFuture<
5777 tonic::Response<Self::Response>,
5778 tonic::Status,
5779 >;
5780 fn call(
5781 &mut self,
5782 request: tonic::Request<super::GetCoinInfoRequest>,
5783 ) -> Self::Future {
5784 let inner = Arc::clone(&self.0);
5785 let fut = async move {
5786 <T as StateService>::get_coin_info(&inner, request).await
5787 };
5788 Box::pin(fut)
5789 }
5790 }
5791 let accept_compression_encodings = self.accept_compression_encodings;
5792 let send_compression_encodings = self.send_compression_encodings;
5793 let max_decoding_message_size = self.max_decoding_message_size;
5794 let max_encoding_message_size = self.max_encoding_message_size;
5795 let inner = self.inner.clone();
5796 let fut = async move {
5797 let method = GetCoinInfoSvc(inner);
5798 let codec = tonic_prost::ProstCodec::default();
5799 let mut grpc = tonic::server::Grpc::new(codec)
5800 .apply_compression_config(
5801 accept_compression_encodings,
5802 send_compression_encodings,
5803 )
5804 .apply_max_message_size_config(
5805 max_decoding_message_size,
5806 max_encoding_message_size,
5807 );
5808 let res = grpc.unary(method, req).await;
5809 Ok(res)
5810 };
5811 Box::pin(fut)
5812 }
5813 "/sui.rpc.v2.StateService/GetBalance" => {
5814 #[allow(non_camel_case_types)]
5815 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
5816 impl<
5817 T: StateService,
5818 > tonic::server::UnaryService<super::GetBalanceRequest>
5819 for GetBalanceSvc<T> {
5820 type Response = super::GetBalanceResponse;
5821 type Future = BoxFuture<
5822 tonic::Response<Self::Response>,
5823 tonic::Status,
5824 >;
5825 fn call(
5826 &mut self,
5827 request: tonic::Request<super::GetBalanceRequest>,
5828 ) -> Self::Future {
5829 let inner = Arc::clone(&self.0);
5830 let fut = async move {
5831 <T as StateService>::get_balance(&inner, request).await
5832 };
5833 Box::pin(fut)
5834 }
5835 }
5836 let accept_compression_encodings = self.accept_compression_encodings;
5837 let send_compression_encodings = self.send_compression_encodings;
5838 let max_decoding_message_size = self.max_decoding_message_size;
5839 let max_encoding_message_size = self.max_encoding_message_size;
5840 let inner = self.inner.clone();
5841 let fut = async move {
5842 let method = GetBalanceSvc(inner);
5843 let codec = tonic_prost::ProstCodec::default();
5844 let mut grpc = tonic::server::Grpc::new(codec)
5845 .apply_compression_config(
5846 accept_compression_encodings,
5847 send_compression_encodings,
5848 )
5849 .apply_max_message_size_config(
5850 max_decoding_message_size,
5851 max_encoding_message_size,
5852 );
5853 let res = grpc.unary(method, req).await;
5854 Ok(res)
5855 };
5856 Box::pin(fut)
5857 }
5858 "/sui.rpc.v2.StateService/ListBalances" => {
5859 #[allow(non_camel_case_types)]
5860 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
5861 impl<
5862 T: StateService,
5863 > tonic::server::UnaryService<super::ListBalancesRequest>
5864 for ListBalancesSvc<T> {
5865 type Response = super::ListBalancesResponse;
5866 type Future = BoxFuture<
5867 tonic::Response<Self::Response>,
5868 tonic::Status,
5869 >;
5870 fn call(
5871 &mut self,
5872 request: tonic::Request<super::ListBalancesRequest>,
5873 ) -> Self::Future {
5874 let inner = Arc::clone(&self.0);
5875 let fut = async move {
5876 <T as StateService>::list_balances(&inner, request).await
5877 };
5878 Box::pin(fut)
5879 }
5880 }
5881 let accept_compression_encodings = self.accept_compression_encodings;
5882 let send_compression_encodings = self.send_compression_encodings;
5883 let max_decoding_message_size = self.max_decoding_message_size;
5884 let max_encoding_message_size = self.max_encoding_message_size;
5885 let inner = self.inner.clone();
5886 let fut = async move {
5887 let method = ListBalancesSvc(inner);
5888 let codec = tonic_prost::ProstCodec::default();
5889 let mut grpc = tonic::server::Grpc::new(codec)
5890 .apply_compression_config(
5891 accept_compression_encodings,
5892 send_compression_encodings,
5893 )
5894 .apply_max_message_size_config(
5895 max_decoding_message_size,
5896 max_encoding_message_size,
5897 );
5898 let res = grpc.unary(method, req).await;
5899 Ok(res)
5900 };
5901 Box::pin(fut)
5902 }
5903 _ => {
5904 Box::pin(async move {
5905 let mut response = http::Response::new(
5906 tonic::body::Body::default(),
5907 );
5908 let headers = response.headers_mut();
5909 headers
5910 .insert(
5911 tonic::Status::GRPC_STATUS,
5912 (tonic::Code::Unimplemented as i32).into(),
5913 );
5914 headers
5915 .insert(
5916 http::header::CONTENT_TYPE,
5917 tonic::metadata::GRPC_CONTENT_TYPE,
5918 );
5919 Ok(response)
5920 })
5921 }
5922 }
5923 }
5924 }
5925 impl<T> Clone for StateServiceServer<T> {
5926 fn clone(&self) -> Self {
5927 let inner = self.inner.clone();
5928 Self {
5929 inner,
5930 accept_compression_encodings: self.accept_compression_encodings,
5931 send_compression_encodings: self.send_compression_encodings,
5932 max_decoding_message_size: self.max_decoding_message_size,
5933 max_encoding_message_size: self.max_encoding_message_size,
5934 }
5935 }
5936 }
5937 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
5939 impl<T> tonic::server::NamedService for StateServiceServer<T> {
5940 const NAME: &'static str = SERVICE_NAME;
5941 }
5942}
5943#[non_exhaustive]
5945#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5946pub struct SubscribeCheckpointsRequest {
5947 #[prost(message, optional, tag = "1")]
5950 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5951}
5952#[non_exhaustive]
5954#[derive(Clone, PartialEq, ::prost::Message)]
5955pub struct SubscribeCheckpointsResponse {
5956 #[prost(uint64, optional, tag = "1")]
5959 pub cursor: ::core::option::Option<u64>,
5960 #[prost(message, optional, tag = "2")]
5962 pub checkpoint: ::core::option::Option<Checkpoint>,
5963}
5964pub mod subscription_service_client {
5966 #![allow(
5967 unused_variables,
5968 dead_code,
5969 missing_docs,
5970 clippy::wildcard_imports,
5971 clippy::let_unit_value,
5972 )]
5973 use tonic::codegen::*;
5974 use tonic::codegen::http::Uri;
5975 #[derive(Debug, Clone)]
5976 pub struct SubscriptionServiceClient<T> {
5977 inner: tonic::client::Grpc<T>,
5978 }
5979 impl SubscriptionServiceClient<tonic::transport::Channel> {
5980 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5982 where
5983 D: TryInto<tonic::transport::Endpoint>,
5984 D::Error: Into<StdError>,
5985 {
5986 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5987 Ok(Self::new(conn))
5988 }
5989 }
5990 impl<T> SubscriptionServiceClient<T>
5991 where
5992 T: tonic::client::GrpcService<tonic::body::Body>,
5993 T::Error: Into<StdError>,
5994 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5995 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5996 {
5997 pub fn new(inner: T) -> Self {
5998 let inner = tonic::client::Grpc::new(inner);
5999 Self { inner }
6000 }
6001 pub fn with_origin(inner: T, origin: Uri) -> Self {
6002 let inner = tonic::client::Grpc::with_origin(inner, origin);
6003 Self { inner }
6004 }
6005 pub fn with_interceptor<F>(
6006 inner: T,
6007 interceptor: F,
6008 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
6009 where
6010 F: tonic::service::Interceptor,
6011 T::ResponseBody: Default,
6012 T: tonic::codegen::Service<
6013 http::Request<tonic::body::Body>,
6014 Response = http::Response<
6015 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6016 >,
6017 >,
6018 <T as tonic::codegen::Service<
6019 http::Request<tonic::body::Body>,
6020 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6021 {
6022 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
6023 }
6024 #[must_use]
6029 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6030 self.inner = self.inner.send_compressed(encoding);
6031 self
6032 }
6033 #[must_use]
6035 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6036 self.inner = self.inner.accept_compressed(encoding);
6037 self
6038 }
6039 #[must_use]
6043 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6044 self.inner = self.inner.max_decoding_message_size(limit);
6045 self
6046 }
6047 #[must_use]
6051 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6052 self.inner = self.inner.max_encoding_message_size(limit);
6053 self
6054 }
6055 pub async fn subscribe_checkpoints(
6067 &mut self,
6068 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
6069 ) -> std::result::Result<
6070 tonic::Response<
6071 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
6072 >,
6073 tonic::Status,
6074 > {
6075 self.inner
6076 .ready()
6077 .await
6078 .map_err(|e| {
6079 tonic::Status::unknown(
6080 format!("Service was not ready: {}", e.into()),
6081 )
6082 })?;
6083 let codec = tonic_prost::ProstCodec::default();
6084 let path = http::uri::PathAndQuery::from_static(
6085 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
6086 );
6087 let mut req = request.into_request();
6088 req.extensions_mut()
6089 .insert(
6090 GrpcMethod::new(
6091 "sui.rpc.v2.SubscriptionService",
6092 "SubscribeCheckpoints",
6093 ),
6094 );
6095 self.inner.server_streaming(req, path, codec).await
6096 }
6097 }
6098}
6099pub mod subscription_service_server {
6101 #![allow(
6102 unused_variables,
6103 dead_code,
6104 missing_docs,
6105 clippy::wildcard_imports,
6106 clippy::let_unit_value,
6107 )]
6108 use tonic::codegen::*;
6109 #[async_trait]
6111 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
6112 type SubscribeCheckpointsStream: tonic::codegen::tokio_stream::Stream<
6114 Item = std::result::Result<
6115 super::SubscribeCheckpointsResponse,
6116 tonic::Status,
6117 >,
6118 >
6119 + std::marker::Send
6120 + 'static;
6121 async fn subscribe_checkpoints(
6133 &self,
6134 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6135 ) -> std::result::Result<
6136 tonic::Response<Self::SubscribeCheckpointsStream>,
6137 tonic::Status,
6138 >;
6139 }
6140 #[derive(Debug)]
6141 pub struct SubscriptionServiceServer<T> {
6142 inner: Arc<T>,
6143 accept_compression_encodings: EnabledCompressionEncodings,
6144 send_compression_encodings: EnabledCompressionEncodings,
6145 max_decoding_message_size: Option<usize>,
6146 max_encoding_message_size: Option<usize>,
6147 }
6148 impl<T> SubscriptionServiceServer<T> {
6149 pub fn new(inner: T) -> Self {
6150 Self::from_arc(Arc::new(inner))
6151 }
6152 pub fn from_arc(inner: Arc<T>) -> Self {
6153 Self {
6154 inner,
6155 accept_compression_encodings: Default::default(),
6156 send_compression_encodings: Default::default(),
6157 max_decoding_message_size: None,
6158 max_encoding_message_size: None,
6159 }
6160 }
6161 pub fn with_interceptor<F>(
6162 inner: T,
6163 interceptor: F,
6164 ) -> InterceptedService<Self, F>
6165 where
6166 F: tonic::service::Interceptor,
6167 {
6168 InterceptedService::new(Self::new(inner), interceptor)
6169 }
6170 #[must_use]
6172 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6173 self.accept_compression_encodings.enable(encoding);
6174 self
6175 }
6176 #[must_use]
6178 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6179 self.send_compression_encodings.enable(encoding);
6180 self
6181 }
6182 #[must_use]
6186 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6187 self.max_decoding_message_size = Some(limit);
6188 self
6189 }
6190 #[must_use]
6194 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6195 self.max_encoding_message_size = Some(limit);
6196 self
6197 }
6198 }
6199 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
6200 where
6201 T: SubscriptionService,
6202 B: Body + std::marker::Send + 'static,
6203 B::Error: Into<StdError> + std::marker::Send + 'static,
6204 {
6205 type Response = http::Response<tonic::body::Body>;
6206 type Error = std::convert::Infallible;
6207 type Future = BoxFuture<Self::Response, Self::Error>;
6208 fn poll_ready(
6209 &mut self,
6210 _cx: &mut Context<'_>,
6211 ) -> Poll<std::result::Result<(), Self::Error>> {
6212 Poll::Ready(Ok(()))
6213 }
6214 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6215 match req.uri().path() {
6216 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
6217 #[allow(non_camel_case_types)]
6218 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
6219 impl<
6220 T: SubscriptionService,
6221 > tonic::server::ServerStreamingService<
6222 super::SubscribeCheckpointsRequest,
6223 > for SubscribeCheckpointsSvc<T> {
6224 type Response = super::SubscribeCheckpointsResponse;
6225 type ResponseStream = T::SubscribeCheckpointsStream;
6226 type Future = BoxFuture<
6227 tonic::Response<Self::ResponseStream>,
6228 tonic::Status,
6229 >;
6230 fn call(
6231 &mut self,
6232 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6233 ) -> Self::Future {
6234 let inner = Arc::clone(&self.0);
6235 let fut = async move {
6236 <T as SubscriptionService>::subscribe_checkpoints(
6237 &inner,
6238 request,
6239 )
6240 .await
6241 };
6242 Box::pin(fut)
6243 }
6244 }
6245 let accept_compression_encodings = self.accept_compression_encodings;
6246 let send_compression_encodings = self.send_compression_encodings;
6247 let max_decoding_message_size = self.max_decoding_message_size;
6248 let max_encoding_message_size = self.max_encoding_message_size;
6249 let inner = self.inner.clone();
6250 let fut = async move {
6251 let method = SubscribeCheckpointsSvc(inner);
6252 let codec = tonic_prost::ProstCodec::default();
6253 let mut grpc = tonic::server::Grpc::new(codec)
6254 .apply_compression_config(
6255 accept_compression_encodings,
6256 send_compression_encodings,
6257 )
6258 .apply_max_message_size_config(
6259 max_decoding_message_size,
6260 max_encoding_message_size,
6261 );
6262 let res = grpc.server_streaming(method, req).await;
6263 Ok(res)
6264 };
6265 Box::pin(fut)
6266 }
6267 _ => {
6268 Box::pin(async move {
6269 let mut response = http::Response::new(
6270 tonic::body::Body::default(),
6271 );
6272 let headers = response.headers_mut();
6273 headers
6274 .insert(
6275 tonic::Status::GRPC_STATUS,
6276 (tonic::Code::Unimplemented as i32).into(),
6277 );
6278 headers
6279 .insert(
6280 http::header::CONTENT_TYPE,
6281 tonic::metadata::GRPC_CONTENT_TYPE,
6282 );
6283 Ok(response)
6284 })
6285 }
6286 }
6287 }
6288 }
6289 impl<T> Clone for SubscriptionServiceServer<T> {
6290 fn clone(&self) -> Self {
6291 let inner = self.inner.clone();
6292 Self {
6293 inner,
6294 accept_compression_encodings: self.accept_compression_encodings,
6295 send_compression_encodings: self.send_compression_encodings,
6296 max_decoding_message_size: self.max_decoding_message_size,
6297 max_encoding_message_size: self.max_encoding_message_size,
6298 }
6299 }
6300 }
6301 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
6303 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
6304 const NAME: &'static str = SERVICE_NAME;
6305 }
6306}
6307#[non_exhaustive]
6308#[derive(Clone, PartialEq, ::prost::Message)]
6309pub struct SystemState {
6310 #[prost(uint64, optional, tag = "1")]
6312 pub version: ::core::option::Option<u64>,
6313 #[prost(uint64, optional, tag = "2")]
6315 pub epoch: ::core::option::Option<u64>,
6316 #[prost(uint64, optional, tag = "3")]
6318 pub protocol_version: ::core::option::Option<u64>,
6319 #[prost(message, optional, tag = "4")]
6321 pub validators: ::core::option::Option<ValidatorSet>,
6322 #[prost(message, optional, tag = "5")]
6324 pub storage_fund: ::core::option::Option<StorageFund>,
6325 #[prost(message, optional, tag = "6")]
6327 pub parameters: ::core::option::Option<SystemParameters>,
6328 #[prost(uint64, optional, tag = "7")]
6330 pub reference_gas_price: ::core::option::Option<u64>,
6331 #[prost(message, repeated, tag = "8")]
6339 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
6340 #[prost(message, optional, tag = "9")]
6342 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
6343 #[prost(bool, optional, tag = "10")]
6350 pub safe_mode: ::core::option::Option<bool>,
6351 #[prost(uint64, optional, tag = "11")]
6353 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
6354 #[prost(uint64, optional, tag = "12")]
6356 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
6357 #[prost(uint64, optional, tag = "13")]
6359 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
6360 #[prost(uint64, optional, tag = "14")]
6362 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
6363 #[prost(uint64, optional, tag = "15")]
6365 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
6366 #[prost(message, optional, tag = "16")]
6368 pub extra_fields: ::core::option::Option<MoveTable>,
6369}
6370#[non_exhaustive]
6371#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6372pub struct ValidatorReportRecord {
6373 #[prost(string, optional, tag = "1")]
6375 pub reported: ::core::option::Option<::prost::alloc::string::String>,
6376 #[prost(string, repeated, tag = "2")]
6378 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6379}
6380#[non_exhaustive]
6381#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6382pub struct SystemParameters {
6383 #[prost(uint64, optional, tag = "1")]
6385 pub epoch_duration_ms: ::core::option::Option<u64>,
6386 #[prost(uint64, optional, tag = "2")]
6388 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
6389 #[prost(uint64, optional, tag = "3")]
6391 pub min_validator_count: ::core::option::Option<u64>,
6392 #[prost(uint64, optional, tag = "4")]
6395 pub max_validator_count: ::core::option::Option<u64>,
6396 #[prost(uint64, optional, tag = "5")]
6399 pub min_validator_joining_stake: ::core::option::Option<u64>,
6400 #[prost(uint64, optional, tag = "6")]
6405 pub validator_low_stake_threshold: ::core::option::Option<u64>,
6406 #[prost(uint64, optional, tag = "7")]
6410 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
6411 #[prost(uint64, optional, tag = "8")]
6414 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
6415 #[prost(message, optional, tag = "9")]
6417 pub extra_fields: ::core::option::Option<MoveTable>,
6418}
6419#[non_exhaustive]
6421#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6422pub struct MoveTable {
6423 #[prost(string, optional, tag = "1")]
6425 pub id: ::core::option::Option<::prost::alloc::string::String>,
6426 #[prost(uint64, optional, tag = "2")]
6428 pub size: ::core::option::Option<u64>,
6429}
6430#[non_exhaustive]
6431#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6432pub struct StakeSubsidy {
6433 #[prost(uint64, optional, tag = "1")]
6435 pub balance: ::core::option::Option<u64>,
6436 #[prost(uint64, optional, tag = "2")]
6438 pub distribution_counter: ::core::option::Option<u64>,
6439 #[prost(uint64, optional, tag = "3")]
6442 pub current_distribution_amount: ::core::option::Option<u64>,
6443 #[prost(uint64, optional, tag = "4")]
6445 pub stake_subsidy_period_length: ::core::option::Option<u64>,
6446 #[prost(uint32, optional, tag = "5")]
6449 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
6450 #[prost(message, optional, tag = "6")]
6452 pub extra_fields: ::core::option::Option<MoveTable>,
6453}
6454#[non_exhaustive]
6456#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6457pub struct StorageFund {
6458 #[prost(uint64, optional, tag = "1")]
6464 pub total_object_storage_rebates: ::core::option::Option<u64>,
6465 #[prost(uint64, optional, tag = "2")]
6468 pub non_refundable_balance: ::core::option::Option<u64>,
6469}
6470#[non_exhaustive]
6471#[derive(Clone, PartialEq, ::prost::Message)]
6472pub struct ValidatorSet {
6473 #[prost(uint64, optional, tag = "1")]
6476 pub total_stake: ::core::option::Option<u64>,
6477 #[prost(message, repeated, tag = "2")]
6479 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
6480 #[prost(message, optional, tag = "3")]
6485 pub pending_active_validators: ::core::option::Option<MoveTable>,
6486 #[prost(uint64, repeated, tag = "4")]
6489 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
6490 #[prost(message, optional, tag = "5")]
6494 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
6495 #[prost(message, optional, tag = "6")]
6501 pub inactive_validators: ::core::option::Option<MoveTable>,
6502 #[prost(message, optional, tag = "7")]
6510 pub validator_candidates: ::core::option::Option<MoveTable>,
6511 #[prost(btree_map = "string, uint64", tag = "8")]
6513 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
6514 ::prost::alloc::string::String,
6515 u64,
6516 >,
6517 #[prost(message, optional, tag = "9")]
6519 pub extra_fields: ::core::option::Option<MoveTable>,
6520}
6521#[non_exhaustive]
6525#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6526pub struct Validator {
6527 #[prost(string, optional, tag = "1")]
6529 pub name: ::core::option::Option<::prost::alloc::string::String>,
6530 #[prost(string, optional, tag = "2")]
6533 pub address: ::core::option::Option<::prost::alloc::string::String>,
6534 #[prost(string, optional, tag = "3")]
6535 pub description: ::core::option::Option<::prost::alloc::string::String>,
6536 #[prost(string, optional, tag = "4")]
6537 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
6538 #[prost(string, optional, tag = "5")]
6539 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
6540 #[prost(bytes = "bytes", optional, tag = "7")]
6543 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6544 #[prost(bytes = "bytes", optional, tag = "8")]
6546 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6547 #[prost(bytes = "bytes", optional, tag = "10")]
6550 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6551 #[prost(bytes = "bytes", optional, tag = "12")]
6553 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6554 #[prost(string, optional, tag = "13")]
6556 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
6557 #[prost(string, optional, tag = "14")]
6559 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6560 #[prost(string, optional, tag = "15")]
6562 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
6563 #[prost(string, optional, tag = "16")]
6565 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
6566 #[prost(bytes = "bytes", optional, tag = "18")]
6567 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6568 #[prost(bytes = "bytes", optional, tag = "19")]
6569 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6570 #[prost(bytes = "bytes", optional, tag = "21")]
6571 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6572 #[prost(bytes = "bytes", optional, tag = "23")]
6573 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6574 #[prost(string, optional, tag = "24")]
6575 pub next_epoch_network_address: ::core::option::Option<
6576 ::prost::alloc::string::String,
6577 >,
6578 #[prost(string, optional, tag = "25")]
6579 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6580 #[prost(string, optional, tag = "26")]
6581 pub next_epoch_primary_address: ::core::option::Option<
6582 ::prost::alloc::string::String,
6583 >,
6584 #[prost(string, optional, tag = "27")]
6585 pub next_epoch_worker_address: ::core::option::Option<
6586 ::prost::alloc::string::String,
6587 >,
6588 #[prost(message, optional, tag = "28")]
6590 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
6591 #[prost(uint64, optional, tag = "29")]
6594 pub voting_power: ::core::option::Option<u64>,
6595 #[prost(string, optional, tag = "30")]
6597 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6598 #[prost(uint64, optional, tag = "31")]
6600 pub gas_price: ::core::option::Option<u64>,
6601 #[prost(message, optional, tag = "32")]
6603 pub staking_pool: ::core::option::Option<StakingPool>,
6604 #[prost(uint64, optional, tag = "33")]
6606 pub commission_rate: ::core::option::Option<u64>,
6607 #[prost(uint64, optional, tag = "34")]
6609 pub next_epoch_stake: ::core::option::Option<u64>,
6610 #[prost(uint64, optional, tag = "35")]
6612 pub next_epoch_gas_price: ::core::option::Option<u64>,
6613 #[prost(uint64, optional, tag = "36")]
6615 pub next_epoch_commission_rate: ::core::option::Option<u64>,
6616 #[prost(message, optional, tag = "37")]
6618 pub extra_fields: ::core::option::Option<MoveTable>,
6619}
6620#[non_exhaustive]
6622#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6623pub struct StakingPool {
6624 #[prost(string, optional, tag = "1")]
6626 pub id: ::core::option::Option<::prost::alloc::string::String>,
6627 #[prost(uint64, optional, tag = "2")]
6630 pub activation_epoch: ::core::option::Option<u64>,
6631 #[prost(uint64, optional, tag = "3")]
6634 pub deactivation_epoch: ::core::option::Option<u64>,
6635 #[prost(uint64, optional, tag = "4")]
6638 pub sui_balance: ::core::option::Option<u64>,
6639 #[prost(uint64, optional, tag = "5")]
6641 pub rewards_pool: ::core::option::Option<u64>,
6642 #[prost(uint64, optional, tag = "6")]
6644 pub pool_token_balance: ::core::option::Option<u64>,
6645 #[prost(message, optional, tag = "7")]
6652 pub exchange_rates: ::core::option::Option<MoveTable>,
6653 #[prost(uint64, optional, tag = "8")]
6655 pub pending_stake: ::core::option::Option<u64>,
6656 #[prost(uint64, optional, tag = "9")]
6659 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
6660 #[prost(uint64, optional, tag = "10")]
6662 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
6663 #[prost(message, optional, tag = "11")]
6665 pub extra_fields: ::core::option::Option<MoveTable>,
6666}
6667#[non_exhaustive]
6669#[derive(Clone, PartialEq, ::prost::Message)]
6670pub struct Transaction {
6671 #[prost(message, optional, tag = "1")]
6673 pub bcs: ::core::option::Option<Bcs>,
6674 #[prost(string, optional, tag = "2")]
6676 pub digest: ::core::option::Option<::prost::alloc::string::String>,
6677 #[prost(int32, optional, tag = "3")]
6679 pub version: ::core::option::Option<i32>,
6680 #[prost(message, optional, tag = "4")]
6681 pub kind: ::core::option::Option<TransactionKind>,
6682 #[prost(string, optional, tag = "5")]
6683 pub sender: ::core::option::Option<::prost::alloc::string::String>,
6684 #[prost(message, optional, tag = "6")]
6685 pub gas_payment: ::core::option::Option<GasPayment>,
6686 #[prost(message, optional, tag = "7")]
6687 pub expiration: ::core::option::Option<TransactionExpiration>,
6688}
6689#[non_exhaustive]
6691#[derive(Clone, PartialEq, ::prost::Message)]
6692pub struct GasPayment {
6693 #[prost(message, repeated, tag = "1")]
6695 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
6696 #[prost(string, optional, tag = "2")]
6698 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6699 #[prost(uint64, optional, tag = "3")]
6703 pub price: ::core::option::Option<u64>,
6704 #[prost(uint64, optional, tag = "4")]
6706 pub budget: ::core::option::Option<u64>,
6707}
6708#[non_exhaustive]
6710#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6711pub struct TransactionExpiration {
6712 #[prost(
6713 enumeration = "transaction_expiration::TransactionExpirationKind",
6714 optional,
6715 tag = "1"
6716 )]
6717 pub kind: ::core::option::Option<i32>,
6718 #[prost(uint64, optional, tag = "2")]
6719 pub epoch: ::core::option::Option<u64>,
6720}
6721pub mod transaction_expiration {
6723 #[non_exhaustive]
6724 #[derive(
6725 Clone,
6726 Copy,
6727 Debug,
6728 PartialEq,
6729 Eq,
6730 Hash,
6731 PartialOrd,
6732 Ord,
6733 ::prost::Enumeration
6734 )]
6735 #[repr(i32)]
6736 pub enum TransactionExpirationKind {
6737 Unknown = 0,
6738 None = 1,
6740 Epoch = 2,
6743 }
6744 impl TransactionExpirationKind {
6745 pub fn as_str_name(&self) -> &'static str {
6750 match self {
6751 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
6752 Self::None => "NONE",
6753 Self::Epoch => "EPOCH",
6754 }
6755 }
6756 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6758 match value {
6759 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
6760 "NONE" => Some(Self::None),
6761 "EPOCH" => Some(Self::Epoch),
6762 _ => None,
6763 }
6764 }
6765 }
6766}
6767#[non_exhaustive]
6769#[derive(Clone, PartialEq, ::prost::Message)]
6770pub struct TransactionKind {
6771 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
6772 pub kind: ::core::option::Option<i32>,
6773 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
6774 pub data: ::core::option::Option<transaction_kind::Data>,
6775}
6776pub mod transaction_kind {
6778 #[non_exhaustive]
6779 #[derive(
6780 Clone,
6781 Copy,
6782 Debug,
6783 PartialEq,
6784 Eq,
6785 Hash,
6786 PartialOrd,
6787 Ord,
6788 ::prost::Enumeration
6789 )]
6790 #[repr(i32)]
6791 pub enum Kind {
6792 Unknown = 0,
6793 ProgrammableTransaction = 1,
6795 ChangeEpoch = 2,
6800 Genesis = 3,
6805 ConsensusCommitPrologueV1 = 4,
6807 AuthenticatorStateUpdate = 5,
6809 EndOfEpoch = 6,
6812 RandomnessStateUpdate = 7,
6814 ConsensusCommitPrologueV2 = 8,
6816 ConsensusCommitPrologueV3 = 9,
6818 ConsensusCommitPrologueV4 = 10,
6820 }
6821 impl Kind {
6822 pub fn as_str_name(&self) -> &'static str {
6827 match self {
6828 Self::Unknown => "KIND_UNKNOWN",
6829 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
6830 Self::ChangeEpoch => "CHANGE_EPOCH",
6831 Self::Genesis => "GENESIS",
6832 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
6833 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
6834 Self::EndOfEpoch => "END_OF_EPOCH",
6835 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
6836 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
6837 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
6838 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
6839 }
6840 }
6841 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6843 match value {
6844 "KIND_UNKNOWN" => Some(Self::Unknown),
6845 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
6846 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
6847 "GENESIS" => Some(Self::Genesis),
6848 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
6849 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
6850 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
6851 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
6852 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
6853 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
6854 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
6855 _ => None,
6856 }
6857 }
6858 }
6859 #[non_exhaustive]
6860 #[derive(Clone, PartialEq, ::prost::Oneof)]
6861 pub enum Data {
6862 #[prost(message, tag = "2")]
6864 ProgrammableTransaction(super::ProgrammableTransaction),
6865 #[prost(message, tag = "3")]
6870 ChangeEpoch(super::ChangeEpoch),
6871 #[prost(message, tag = "4")]
6876 Genesis(super::GenesisTransaction),
6877 #[prost(message, tag = "5")]
6879 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
6880 #[prost(message, tag = "6")]
6882 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
6883 #[prost(message, tag = "7")]
6886 EndOfEpoch(super::EndOfEpochTransaction),
6887 #[prost(message, tag = "8")]
6889 RandomnessStateUpdate(super::RandomnessStateUpdate),
6890 }
6891}
6892#[non_exhaustive]
6897#[derive(Clone, PartialEq, ::prost::Message)]
6898pub struct ProgrammableTransaction {
6899 #[prost(message, repeated, tag = "1")]
6901 pub inputs: ::prost::alloc::vec::Vec<Input>,
6902 #[prost(message, repeated, tag = "2")]
6905 pub commands: ::prost::alloc::vec::Vec<Command>,
6906}
6907#[non_exhaustive]
6909#[derive(Clone, PartialEq, ::prost::Message)]
6910pub struct Command {
6911 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
6912 pub command: ::core::option::Option<command::Command>,
6913}
6914pub mod command {
6916 #[non_exhaustive]
6917 #[derive(Clone, PartialEq, ::prost::Oneof)]
6918 pub enum Command {
6919 #[prost(message, tag = "1")]
6921 MoveCall(super::MoveCall),
6922 #[prost(message, tag = "2")]
6927 TransferObjects(super::TransferObjects),
6928 #[prost(message, tag = "3")]
6931 SplitCoins(super::SplitCoins),
6932 #[prost(message, tag = "4")]
6935 MergeCoins(super::MergeCoins),
6936 #[prost(message, tag = "5")]
6939 Publish(super::Publish),
6940 #[prost(message, tag = "6")]
6944 MakeMoveVector(super::MakeMoveVector),
6945 #[prost(message, tag = "7")]
6954 Upgrade(super::Upgrade),
6955 }
6956}
6957#[non_exhaustive]
6962#[derive(Clone, PartialEq, ::prost::Message)]
6963pub struct MoveCall {
6964 #[prost(string, optional, tag = "1")]
6966 pub package: ::core::option::Option<::prost::alloc::string::String>,
6967 #[prost(string, optional, tag = "2")]
6969 pub module: ::core::option::Option<::prost::alloc::string::String>,
6970 #[prost(string, optional, tag = "3")]
6972 pub function: ::core::option::Option<::prost::alloc::string::String>,
6973 #[prost(string, repeated, tag = "4")]
6975 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6976 #[prost(message, repeated, tag = "5")]
6978 pub arguments: ::prost::alloc::vec::Vec<Argument>,
6979}
6980#[non_exhaustive]
6982#[derive(Clone, PartialEq, ::prost::Message)]
6983pub struct TransferObjects {
6984 #[prost(message, repeated, tag = "1")]
6986 pub objects: ::prost::alloc::vec::Vec<Argument>,
6987 #[prost(message, optional, tag = "2")]
6989 pub address: ::core::option::Option<Argument>,
6990}
6991#[non_exhaustive]
6993#[derive(Clone, PartialEq, ::prost::Message)]
6994pub struct SplitCoins {
6995 #[prost(message, optional, tag = "1")]
6997 pub coin: ::core::option::Option<Argument>,
6998 #[prost(message, repeated, tag = "2")]
7000 pub amounts: ::prost::alloc::vec::Vec<Argument>,
7001}
7002#[non_exhaustive]
7004#[derive(Clone, PartialEq, ::prost::Message)]
7005pub struct MergeCoins {
7006 #[prost(message, optional, tag = "1")]
7008 pub coin: ::core::option::Option<Argument>,
7009 #[prost(message, repeated, tag = "2")]
7013 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
7014}
7015#[non_exhaustive]
7017#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7018pub struct Publish {
7019 #[prost(bytes = "bytes", repeated, tag = "1")]
7021 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7022 #[prost(string, repeated, tag = "2")]
7024 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7025}
7026#[non_exhaustive]
7028#[derive(Clone, PartialEq, ::prost::Message)]
7029pub struct MakeMoveVector {
7030 #[prost(string, optional, tag = "1")]
7035 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
7036 #[prost(message, repeated, tag = "2")]
7038 pub elements: ::prost::alloc::vec::Vec<Argument>,
7039}
7040#[non_exhaustive]
7042#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7043pub struct Upgrade {
7044 #[prost(bytes = "bytes", repeated, tag = "1")]
7046 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7047 #[prost(string, repeated, tag = "2")]
7049 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7050 #[prost(string, optional, tag = "3")]
7052 pub package: ::core::option::Option<::prost::alloc::string::String>,
7053 #[prost(message, optional, tag = "4")]
7055 pub ticket: ::core::option::Option<Argument>,
7056}
7057#[non_exhaustive]
7059#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7060pub struct RandomnessStateUpdate {
7061 #[prost(uint64, optional, tag = "1")]
7063 pub epoch: ::core::option::Option<u64>,
7064 #[prost(uint64, optional, tag = "2")]
7066 pub randomness_round: ::core::option::Option<u64>,
7067 #[prost(bytes = "bytes", optional, tag = "3")]
7069 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
7070 #[prost(uint64, optional, tag = "4")]
7072 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
7073}
7074#[non_exhaustive]
7076#[derive(Clone, PartialEq, ::prost::Message)]
7077pub struct ChangeEpoch {
7078 #[prost(uint64, optional, tag = "1")]
7080 pub epoch: ::core::option::Option<u64>,
7081 #[prost(uint64, optional, tag = "2")]
7083 pub protocol_version: ::core::option::Option<u64>,
7084 #[prost(uint64, optional, tag = "3")]
7086 pub storage_charge: ::core::option::Option<u64>,
7087 #[prost(uint64, optional, tag = "4")]
7089 pub computation_charge: ::core::option::Option<u64>,
7090 #[prost(uint64, optional, tag = "5")]
7092 pub storage_rebate: ::core::option::Option<u64>,
7093 #[prost(uint64, optional, tag = "6")]
7095 pub non_refundable_storage_fee: ::core::option::Option<u64>,
7096 #[prost(message, optional, tag = "7")]
7098 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7099 #[prost(message, repeated, tag = "8")]
7105 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
7106}
7107#[non_exhaustive]
7109#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7110pub struct SystemPackage {
7111 #[prost(uint64, optional, tag = "1")]
7113 pub version: ::core::option::Option<u64>,
7114 #[prost(bytes = "bytes", repeated, tag = "2")]
7116 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7117 #[prost(string, repeated, tag = "3")]
7119 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7120}
7121#[non_exhaustive]
7123#[derive(Clone, PartialEq, ::prost::Message)]
7124pub struct GenesisTransaction {
7125 #[prost(message, repeated, tag = "1")]
7127 pub objects: ::prost::alloc::vec::Vec<Object>,
7128}
7129#[non_exhaustive]
7133#[derive(Clone, PartialEq, ::prost::Message)]
7134pub struct ConsensusCommitPrologue {
7135 #[prost(uint64, optional, tag = "1")]
7139 pub epoch: ::core::option::Option<u64>,
7140 #[prost(uint64, optional, tag = "2")]
7144 pub round: ::core::option::Option<u64>,
7145 #[prost(message, optional, tag = "3")]
7149 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7150 #[prost(string, optional, tag = "4")]
7154 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
7155 #[prost(uint64, optional, tag = "5")]
7160 pub sub_dag_index: ::core::option::Option<u64>,
7161 #[prost(message, optional, tag = "6")]
7165 pub consensus_determined_version_assignments: ::core::option::Option<
7166 ConsensusDeterminedVersionAssignments,
7167 >,
7168 #[prost(string, optional, tag = "7")]
7173 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
7174}
7175#[non_exhaustive]
7177#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7178pub struct VersionAssignment {
7179 #[prost(string, optional, tag = "1")]
7181 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
7182 #[prost(uint64, optional, tag = "2")]
7184 pub start_version: ::core::option::Option<u64>,
7185 #[prost(uint64, optional, tag = "3")]
7187 pub version: ::core::option::Option<u64>,
7188}
7189#[non_exhaustive]
7191#[derive(Clone, PartialEq, ::prost::Message)]
7192pub struct CanceledTransaction {
7193 #[prost(string, optional, tag = "1")]
7195 pub digest: ::core::option::Option<::prost::alloc::string::String>,
7196 #[prost(message, repeated, tag = "2")]
7198 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
7199}
7200#[non_exhaustive]
7202#[derive(Clone, PartialEq, ::prost::Message)]
7203pub struct ConsensusDeterminedVersionAssignments {
7204 #[prost(int32, optional, tag = "1")]
7206 pub version: ::core::option::Option<i32>,
7207 #[prost(message, repeated, tag = "3")]
7209 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
7210}
7211#[non_exhaustive]
7213#[derive(Clone, PartialEq, ::prost::Message)]
7214pub struct AuthenticatorStateUpdate {
7215 #[prost(uint64, optional, tag = "1")]
7217 pub epoch: ::core::option::Option<u64>,
7218 #[prost(uint64, optional, tag = "2")]
7220 pub round: ::core::option::Option<u64>,
7221 #[prost(message, repeated, tag = "3")]
7223 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
7224 #[prost(uint64, optional, tag = "4")]
7226 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7227}
7228#[non_exhaustive]
7230#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7231pub struct ActiveJwk {
7232 #[prost(message, optional, tag = "1")]
7234 pub id: ::core::option::Option<JwkId>,
7235 #[prost(message, optional, tag = "2")]
7237 pub jwk: ::core::option::Option<Jwk>,
7238 #[prost(uint64, optional, tag = "3")]
7240 pub epoch: ::core::option::Option<u64>,
7241}
7242#[non_exhaustive]
7245#[derive(Clone, PartialEq, ::prost::Message)]
7246pub struct EndOfEpochTransaction {
7247 #[prost(message, repeated, tag = "1")]
7248 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
7249}
7250#[non_exhaustive]
7252#[derive(Clone, PartialEq, ::prost::Message)]
7253pub struct EndOfEpochTransactionKind {
7254 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
7255 pub kind: ::core::option::Option<i32>,
7256 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6")]
7257 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
7258}
7259pub mod end_of_epoch_transaction_kind {
7261 #[non_exhaustive]
7262 #[derive(
7263 Clone,
7264 Copy,
7265 Debug,
7266 PartialEq,
7267 Eq,
7268 Hash,
7269 PartialOrd,
7270 Ord,
7271 ::prost::Enumeration
7272 )]
7273 #[repr(i32)]
7274 pub enum Kind {
7275 Unknown = 0,
7276 ChangeEpoch = 1,
7278 AuthenticatorStateCreate = 2,
7280 AuthenticatorStateExpire = 3,
7282 RandomnessStateCreate = 4,
7284 DenyListStateCreate = 5,
7286 BridgeStateCreate = 6,
7288 BridgeCommitteeInit = 7,
7290 StoreExecutionTimeObservations = 8,
7292 AccumulatorRootCreate = 9,
7294 CoinRegistryCreate = 10,
7296 DisplayRegistryCreate = 11,
7298 }
7299 impl Kind {
7300 pub fn as_str_name(&self) -> &'static str {
7305 match self {
7306 Self::Unknown => "KIND_UNKNOWN",
7307 Self::ChangeEpoch => "CHANGE_EPOCH",
7308 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
7309 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
7310 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
7311 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
7312 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
7313 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
7314 Self::StoreExecutionTimeObservations => {
7315 "STORE_EXECUTION_TIME_OBSERVATIONS"
7316 }
7317 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
7318 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
7319 Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
7320 }
7321 }
7322 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7324 match value {
7325 "KIND_UNKNOWN" => Some(Self::Unknown),
7326 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7327 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
7328 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
7329 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
7330 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
7331 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
7332 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
7333 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
7334 Some(Self::StoreExecutionTimeObservations)
7335 }
7336 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
7337 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
7338 "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
7339 _ => None,
7340 }
7341 }
7342 }
7343 #[non_exhaustive]
7344 #[derive(Clone, PartialEq, ::prost::Oneof)]
7345 pub enum Data {
7346 #[prost(message, tag = "2")]
7348 ChangeEpoch(super::ChangeEpoch),
7349 #[prost(message, tag = "3")]
7351 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
7352 #[prost(message, tag = "4")]
7354 ExecutionTimeObservations(super::ExecutionTimeObservations),
7355 #[prost(string, tag = "5")]
7357 BridgeChainId(::prost::alloc::string::String),
7358 #[prost(uint64, tag = "6")]
7360 BridgeObjectVersion(u64),
7361 }
7362}
7363#[non_exhaustive]
7365#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7366pub struct AuthenticatorStateExpire {
7367 #[prost(uint64, optional, tag = "1")]
7369 pub min_epoch: ::core::option::Option<u64>,
7370 #[prost(uint64, optional, tag = "2")]
7372 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7373}
7374#[non_exhaustive]
7375#[derive(Clone, PartialEq, ::prost::Message)]
7376pub struct ExecutionTimeObservations {
7377 #[prost(int32, optional, tag = "1")]
7379 pub version: ::core::option::Option<i32>,
7380 #[prost(message, repeated, tag = "2")]
7381 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
7382}
7383#[non_exhaustive]
7384#[derive(Clone, PartialEq, ::prost::Message)]
7385pub struct ExecutionTimeObservation {
7386 #[prost(
7387 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
7388 optional,
7389 tag = "1"
7390 )]
7391 pub kind: ::core::option::Option<i32>,
7392 #[prost(message, optional, tag = "2")]
7393 pub move_entry_point: ::core::option::Option<MoveCall>,
7394 #[prost(message, repeated, tag = "3")]
7395 pub validator_observations: ::prost::alloc::vec::Vec<
7396 ValidatorExecutionTimeObservation,
7397 >,
7398}
7399pub mod execution_time_observation {
7401 #[non_exhaustive]
7402 #[derive(
7403 Clone,
7404 Copy,
7405 Debug,
7406 PartialEq,
7407 Eq,
7408 Hash,
7409 PartialOrd,
7410 Ord,
7411 ::prost::Enumeration
7412 )]
7413 #[repr(i32)]
7414 pub enum ExecutionTimeObservationKind {
7415 Unknown = 0,
7416 MoveEntryPoint = 1,
7417 TransferObjects = 2,
7418 SplitCoins = 3,
7419 MergeCoins = 4,
7420 Publish = 5,
7421 MakeMoveVector = 6,
7422 Upgrade = 7,
7423 }
7424 impl ExecutionTimeObservationKind {
7425 pub fn as_str_name(&self) -> &'static str {
7430 match self {
7431 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
7432 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
7433 Self::TransferObjects => "TRANSFER_OBJECTS",
7434 Self::SplitCoins => "SPLIT_COINS",
7435 Self::MergeCoins => "MERGE_COINS",
7436 Self::Publish => "PUBLISH",
7437 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
7438 Self::Upgrade => "UPGRADE",
7439 }
7440 }
7441 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7443 match value {
7444 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
7445 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
7446 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
7447 "SPLIT_COINS" => Some(Self::SplitCoins),
7448 "MERGE_COINS" => Some(Self::MergeCoins),
7449 "PUBLISH" => Some(Self::Publish),
7450 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
7451 "UPGRADE" => Some(Self::Upgrade),
7452 _ => None,
7453 }
7454 }
7455 }
7456}
7457#[non_exhaustive]
7458#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7459pub struct ValidatorExecutionTimeObservation {
7460 #[prost(bytes = "bytes", optional, tag = "1")]
7462 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
7463 #[prost(message, optional, tag = "2")]
7465 pub duration: ::core::option::Option<::prost_types::Duration>,
7466}
7467#[non_exhaustive]
7468#[derive(Clone, PartialEq, ::prost::Message)]
7469pub struct ExecuteTransactionRequest {
7470 #[prost(message, optional, tag = "1")]
7472 pub transaction: ::core::option::Option<Transaction>,
7473 #[prost(message, repeated, tag = "2")]
7476 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
7477 #[prost(message, optional, tag = "3")]
7480 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7481}
7482#[non_exhaustive]
7484#[derive(Clone, PartialEq, ::prost::Message)]
7485pub struct ExecuteTransactionResponse {
7486 #[prost(message, optional, tag = "1")]
7487 pub transaction: ::core::option::Option<ExecutedTransaction>,
7488}
7489#[non_exhaustive]
7490#[derive(Clone, PartialEq, ::prost::Message)]
7491pub struct SimulateTransactionRequest {
7492 #[prost(message, optional, tag = "1")]
7493 pub transaction: ::core::option::Option<Transaction>,
7494 #[prost(message, optional, tag = "2")]
7496 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7497 #[prost(
7499 enumeration = "simulate_transaction_request::TransactionChecks",
7500 optional,
7501 tag = "3"
7502 )]
7503 pub checks: ::core::option::Option<i32>,
7504 #[prost(bool, optional, tag = "4")]
7509 pub do_gas_selection: ::core::option::Option<bool>,
7510}
7511pub mod simulate_transaction_request {
7513 #[non_exhaustive]
7515 #[derive(
7516 Clone,
7517 Copy,
7518 Debug,
7519 PartialEq,
7520 Eq,
7521 Hash,
7522 PartialOrd,
7523 Ord,
7524 ::prost::Enumeration
7525 )]
7526 #[repr(i32)]
7527 pub enum TransactionChecks {
7528 Enabled = 0,
7529 Disabled = 1,
7530 }
7531 impl TransactionChecks {
7532 pub fn as_str_name(&self) -> &'static str {
7537 match self {
7538 Self::Enabled => "ENABLED",
7539 Self::Disabled => "DISABLED",
7540 }
7541 }
7542 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7544 match value {
7545 "ENABLED" => Some(Self::Enabled),
7546 "DISABLED" => Some(Self::Disabled),
7547 _ => None,
7548 }
7549 }
7550 }
7551}
7552#[non_exhaustive]
7553#[derive(Clone, PartialEq, ::prost::Message)]
7554pub struct SimulateTransactionResponse {
7555 #[prost(message, optional, tag = "1")]
7556 pub transaction: ::core::option::Option<ExecutedTransaction>,
7557 #[prost(message, repeated, tag = "2")]
7558 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
7559}
7560#[non_exhaustive]
7562#[derive(Clone, PartialEq, ::prost::Message)]
7563pub struct CommandResult {
7564 #[prost(message, repeated, tag = "1")]
7565 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
7566 #[prost(message, repeated, tag = "2")]
7567 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
7568}
7569#[non_exhaustive]
7570#[derive(Clone, PartialEq, ::prost::Message)]
7571pub struct CommandOutput {
7572 #[prost(message, optional, tag = "1")]
7573 pub argument: ::core::option::Option<Argument>,
7574 #[prost(message, optional, tag = "2")]
7575 pub value: ::core::option::Option<Bcs>,
7576 #[prost(message, optional, boxed, tag = "3")]
7578 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
7579}
7580pub mod transaction_execution_service_client {
7582 #![allow(
7583 unused_variables,
7584 dead_code,
7585 missing_docs,
7586 clippy::wildcard_imports,
7587 clippy::let_unit_value,
7588 )]
7589 use tonic::codegen::*;
7590 use tonic::codegen::http::Uri;
7591 #[derive(Debug, Clone)]
7592 pub struct TransactionExecutionServiceClient<T> {
7593 inner: tonic::client::Grpc<T>,
7594 }
7595 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
7596 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7598 where
7599 D: TryInto<tonic::transport::Endpoint>,
7600 D::Error: Into<StdError>,
7601 {
7602 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7603 Ok(Self::new(conn))
7604 }
7605 }
7606 impl<T> TransactionExecutionServiceClient<T>
7607 where
7608 T: tonic::client::GrpcService<tonic::body::Body>,
7609 T::Error: Into<StdError>,
7610 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7611 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7612 {
7613 pub fn new(inner: T) -> Self {
7614 let inner = tonic::client::Grpc::new(inner);
7615 Self { inner }
7616 }
7617 pub fn with_origin(inner: T, origin: Uri) -> Self {
7618 let inner = tonic::client::Grpc::with_origin(inner, origin);
7619 Self { inner }
7620 }
7621 pub fn with_interceptor<F>(
7622 inner: T,
7623 interceptor: F,
7624 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
7625 where
7626 F: tonic::service::Interceptor,
7627 T::ResponseBody: Default,
7628 T: tonic::codegen::Service<
7629 http::Request<tonic::body::Body>,
7630 Response = http::Response<
7631 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7632 >,
7633 >,
7634 <T as tonic::codegen::Service<
7635 http::Request<tonic::body::Body>,
7636 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7637 {
7638 TransactionExecutionServiceClient::new(
7639 InterceptedService::new(inner, interceptor),
7640 )
7641 }
7642 #[must_use]
7647 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7648 self.inner = self.inner.send_compressed(encoding);
7649 self
7650 }
7651 #[must_use]
7653 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7654 self.inner = self.inner.accept_compressed(encoding);
7655 self
7656 }
7657 #[must_use]
7661 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7662 self.inner = self.inner.max_decoding_message_size(limit);
7663 self
7664 }
7665 #[must_use]
7669 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7670 self.inner = self.inner.max_encoding_message_size(limit);
7671 self
7672 }
7673 pub async fn execute_transaction(
7674 &mut self,
7675 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
7676 ) -> std::result::Result<
7677 tonic::Response<super::ExecuteTransactionResponse>,
7678 tonic::Status,
7679 > {
7680 self.inner
7681 .ready()
7682 .await
7683 .map_err(|e| {
7684 tonic::Status::unknown(
7685 format!("Service was not ready: {}", e.into()),
7686 )
7687 })?;
7688 let codec = tonic_prost::ProstCodec::default();
7689 let path = http::uri::PathAndQuery::from_static(
7690 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
7691 );
7692 let mut req = request.into_request();
7693 req.extensions_mut()
7694 .insert(
7695 GrpcMethod::new(
7696 "sui.rpc.v2.TransactionExecutionService",
7697 "ExecuteTransaction",
7698 ),
7699 );
7700 self.inner.unary(req, path, codec).await
7701 }
7702 pub async fn simulate_transaction(
7703 &mut self,
7704 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
7705 ) -> std::result::Result<
7706 tonic::Response<super::SimulateTransactionResponse>,
7707 tonic::Status,
7708 > {
7709 self.inner
7710 .ready()
7711 .await
7712 .map_err(|e| {
7713 tonic::Status::unknown(
7714 format!("Service was not ready: {}", e.into()),
7715 )
7716 })?;
7717 let codec = tonic_prost::ProstCodec::default();
7718 let path = http::uri::PathAndQuery::from_static(
7719 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
7720 );
7721 let mut req = request.into_request();
7722 req.extensions_mut()
7723 .insert(
7724 GrpcMethod::new(
7725 "sui.rpc.v2.TransactionExecutionService",
7726 "SimulateTransaction",
7727 ),
7728 );
7729 self.inner.unary(req, path, codec).await
7730 }
7731 }
7732}
7733pub mod transaction_execution_service_server {
7735 #![allow(
7736 unused_variables,
7737 dead_code,
7738 missing_docs,
7739 clippy::wildcard_imports,
7740 clippy::let_unit_value,
7741 )]
7742 use tonic::codegen::*;
7743 #[async_trait]
7745 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
7746 async fn execute_transaction(
7747 &self,
7748 request: tonic::Request<super::ExecuteTransactionRequest>,
7749 ) -> std::result::Result<
7750 tonic::Response<super::ExecuteTransactionResponse>,
7751 tonic::Status,
7752 >;
7753 async fn simulate_transaction(
7754 &self,
7755 request: tonic::Request<super::SimulateTransactionRequest>,
7756 ) -> std::result::Result<
7757 tonic::Response<super::SimulateTransactionResponse>,
7758 tonic::Status,
7759 >;
7760 }
7761 #[derive(Debug)]
7762 pub struct TransactionExecutionServiceServer<T> {
7763 inner: Arc<T>,
7764 accept_compression_encodings: EnabledCompressionEncodings,
7765 send_compression_encodings: EnabledCompressionEncodings,
7766 max_decoding_message_size: Option<usize>,
7767 max_encoding_message_size: Option<usize>,
7768 }
7769 impl<T> TransactionExecutionServiceServer<T> {
7770 pub fn new(inner: T) -> Self {
7771 Self::from_arc(Arc::new(inner))
7772 }
7773 pub fn from_arc(inner: Arc<T>) -> Self {
7774 Self {
7775 inner,
7776 accept_compression_encodings: Default::default(),
7777 send_compression_encodings: Default::default(),
7778 max_decoding_message_size: None,
7779 max_encoding_message_size: None,
7780 }
7781 }
7782 pub fn with_interceptor<F>(
7783 inner: T,
7784 interceptor: F,
7785 ) -> InterceptedService<Self, F>
7786 where
7787 F: tonic::service::Interceptor,
7788 {
7789 InterceptedService::new(Self::new(inner), interceptor)
7790 }
7791 #[must_use]
7793 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7794 self.accept_compression_encodings.enable(encoding);
7795 self
7796 }
7797 #[must_use]
7799 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7800 self.send_compression_encodings.enable(encoding);
7801 self
7802 }
7803 #[must_use]
7807 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7808 self.max_decoding_message_size = Some(limit);
7809 self
7810 }
7811 #[must_use]
7815 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7816 self.max_encoding_message_size = Some(limit);
7817 self
7818 }
7819 }
7820 impl<T, B> tonic::codegen::Service<http::Request<B>>
7821 for TransactionExecutionServiceServer<T>
7822 where
7823 T: TransactionExecutionService,
7824 B: Body + std::marker::Send + 'static,
7825 B::Error: Into<StdError> + std::marker::Send + 'static,
7826 {
7827 type Response = http::Response<tonic::body::Body>;
7828 type Error = std::convert::Infallible;
7829 type Future = BoxFuture<Self::Response, Self::Error>;
7830 fn poll_ready(
7831 &mut self,
7832 _cx: &mut Context<'_>,
7833 ) -> Poll<std::result::Result<(), Self::Error>> {
7834 Poll::Ready(Ok(()))
7835 }
7836 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7837 match req.uri().path() {
7838 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
7839 #[allow(non_camel_case_types)]
7840 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
7841 pub Arc<T>,
7842 );
7843 impl<
7844 T: TransactionExecutionService,
7845 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
7846 for ExecuteTransactionSvc<T> {
7847 type Response = super::ExecuteTransactionResponse;
7848 type Future = BoxFuture<
7849 tonic::Response<Self::Response>,
7850 tonic::Status,
7851 >;
7852 fn call(
7853 &mut self,
7854 request: tonic::Request<super::ExecuteTransactionRequest>,
7855 ) -> Self::Future {
7856 let inner = Arc::clone(&self.0);
7857 let fut = async move {
7858 <T as TransactionExecutionService>::execute_transaction(
7859 &inner,
7860 request,
7861 )
7862 .await
7863 };
7864 Box::pin(fut)
7865 }
7866 }
7867 let accept_compression_encodings = self.accept_compression_encodings;
7868 let send_compression_encodings = self.send_compression_encodings;
7869 let max_decoding_message_size = self.max_decoding_message_size;
7870 let max_encoding_message_size = self.max_encoding_message_size;
7871 let inner = self.inner.clone();
7872 let fut = async move {
7873 let method = ExecuteTransactionSvc(inner);
7874 let codec = tonic_prost::ProstCodec::default();
7875 let mut grpc = tonic::server::Grpc::new(codec)
7876 .apply_compression_config(
7877 accept_compression_encodings,
7878 send_compression_encodings,
7879 )
7880 .apply_max_message_size_config(
7881 max_decoding_message_size,
7882 max_encoding_message_size,
7883 );
7884 let res = grpc.unary(method, req).await;
7885 Ok(res)
7886 };
7887 Box::pin(fut)
7888 }
7889 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
7890 #[allow(non_camel_case_types)]
7891 struct SimulateTransactionSvc<T: TransactionExecutionService>(
7892 pub Arc<T>,
7893 );
7894 impl<
7895 T: TransactionExecutionService,
7896 > tonic::server::UnaryService<super::SimulateTransactionRequest>
7897 for SimulateTransactionSvc<T> {
7898 type Response = super::SimulateTransactionResponse;
7899 type Future = BoxFuture<
7900 tonic::Response<Self::Response>,
7901 tonic::Status,
7902 >;
7903 fn call(
7904 &mut self,
7905 request: tonic::Request<super::SimulateTransactionRequest>,
7906 ) -> Self::Future {
7907 let inner = Arc::clone(&self.0);
7908 let fut = async move {
7909 <T as TransactionExecutionService>::simulate_transaction(
7910 &inner,
7911 request,
7912 )
7913 .await
7914 };
7915 Box::pin(fut)
7916 }
7917 }
7918 let accept_compression_encodings = self.accept_compression_encodings;
7919 let send_compression_encodings = self.send_compression_encodings;
7920 let max_decoding_message_size = self.max_decoding_message_size;
7921 let max_encoding_message_size = self.max_encoding_message_size;
7922 let inner = self.inner.clone();
7923 let fut = async move {
7924 let method = SimulateTransactionSvc(inner);
7925 let codec = tonic_prost::ProstCodec::default();
7926 let mut grpc = tonic::server::Grpc::new(codec)
7927 .apply_compression_config(
7928 accept_compression_encodings,
7929 send_compression_encodings,
7930 )
7931 .apply_max_message_size_config(
7932 max_decoding_message_size,
7933 max_encoding_message_size,
7934 );
7935 let res = grpc.unary(method, req).await;
7936 Ok(res)
7937 };
7938 Box::pin(fut)
7939 }
7940 _ => {
7941 Box::pin(async move {
7942 let mut response = http::Response::new(
7943 tonic::body::Body::default(),
7944 );
7945 let headers = response.headers_mut();
7946 headers
7947 .insert(
7948 tonic::Status::GRPC_STATUS,
7949 (tonic::Code::Unimplemented as i32).into(),
7950 );
7951 headers
7952 .insert(
7953 http::header::CONTENT_TYPE,
7954 tonic::metadata::GRPC_CONTENT_TYPE,
7955 );
7956 Ok(response)
7957 })
7958 }
7959 }
7960 }
7961 }
7962 impl<T> Clone for TransactionExecutionServiceServer<T> {
7963 fn clone(&self) -> Self {
7964 let inner = self.inner.clone();
7965 Self {
7966 inner,
7967 accept_compression_encodings: self.accept_compression_encodings,
7968 send_compression_encodings: self.send_compression_encodings,
7969 max_decoding_message_size: self.max_decoding_message_size,
7970 max_encoding_message_size: self.max_encoding_message_size,
7971 }
7972 }
7973 }
7974 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
7976 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
7977 const NAME: &'static str = SERVICE_NAME;
7978 }
7979}