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 #[prost(message, repeated, tag = "4")]
162 pub address_aliases_versions: ::prost::alloc::vec::Vec<AddressAliasesVersion>,
163}
164#[non_exhaustive]
165#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
166pub struct AddressAliasesVersion {
167 #[prost(uint64, optional, tag = "1")]
168 pub version: ::core::option::Option<u64>,
169}
170#[non_exhaustive]
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct CheckpointSummary {
193 #[prost(message, optional, tag = "1")]
195 pub bcs: ::core::option::Option<Bcs>,
196 #[prost(string, optional, tag = "2")]
198 pub digest: ::core::option::Option<::prost::alloc::string::String>,
199 #[prost(uint64, optional, tag = "3")]
201 pub epoch: ::core::option::Option<u64>,
202 #[prost(uint64, optional, tag = "4")]
204 pub sequence_number: ::core::option::Option<u64>,
205 #[prost(uint64, optional, tag = "5")]
208 pub total_network_transactions: ::core::option::Option<u64>,
209 #[prost(string, optional, tag = "6")]
211 pub content_digest: ::core::option::Option<::prost::alloc::string::String>,
212 #[prost(string, optional, tag = "7")]
216 pub previous_digest: ::core::option::Option<::prost::alloc::string::String>,
217 #[prost(message, optional, tag = "8")]
220 pub epoch_rolling_gas_cost_summary: ::core::option::Option<GasCostSummary>,
221 #[prost(message, optional, tag = "9")]
225 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
226 #[prost(message, repeated, tag = "10")]
228 pub commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
229 #[prost(message, optional, tag = "11")]
231 pub end_of_epoch_data: ::core::option::Option<EndOfEpochData>,
232 #[prost(bytes = "bytes", optional, tag = "12")]
237 pub version_specific_data: ::core::option::Option<::prost::bytes::Bytes>,
238}
239#[non_exhaustive]
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct EndOfEpochData {
243 #[prost(message, repeated, tag = "1")]
245 pub next_epoch_committee: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
246 #[prost(uint64, optional, tag = "2")]
248 pub next_epoch_protocol_version: ::core::option::Option<u64>,
249 #[prost(message, repeated, tag = "3")]
251 pub epoch_commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
252}
253#[non_exhaustive]
255#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
256pub struct CheckpointCommitment {
257 #[prost(
258 enumeration = "checkpoint_commitment::CheckpointCommitmentKind",
259 optional,
260 tag = "1"
261 )]
262 pub kind: ::core::option::Option<i32>,
263 #[prost(string, optional, tag = "2")]
264 pub digest: ::core::option::Option<::prost::alloc::string::String>,
265}
266pub mod checkpoint_commitment {
268 #[non_exhaustive]
269 #[derive(
270 Clone,
271 Copy,
272 Debug,
273 PartialEq,
274 Eq,
275 Hash,
276 PartialOrd,
277 Ord,
278 ::prost::Enumeration
279 )]
280 #[repr(i32)]
281 pub enum CheckpointCommitmentKind {
282 Unknown = 0,
283 EcmhLiveObjectSet = 1,
286 CheckpointArtifacts = 2,
288 }
289 impl CheckpointCommitmentKind {
290 pub fn as_str_name(&self) -> &'static str {
295 match self {
296 Self::Unknown => "CHECKPOINT_COMMITMENT_KIND_UNKNOWN",
297 Self::EcmhLiveObjectSet => "ECMH_LIVE_OBJECT_SET",
298 Self::CheckpointArtifacts => "CHECKPOINT_ARTIFACTS",
299 }
300 }
301 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
303 match value {
304 "CHECKPOINT_COMMITMENT_KIND_UNKNOWN" => Some(Self::Unknown),
305 "ECMH_LIVE_OBJECT_SET" => Some(Self::EcmhLiveObjectSet),
306 "CHECKPOINT_ARTIFACTS" => Some(Self::CheckpointArtifacts),
307 _ => None,
308 }
309 }
310 }
311}
312#[non_exhaustive]
314#[derive(Clone, PartialEq, ::prost::Message)]
315pub struct TransactionEffects {
316 #[prost(message, optional, tag = "1")]
318 pub bcs: ::core::option::Option<Bcs>,
319 #[prost(string, optional, tag = "2")]
321 pub digest: ::core::option::Option<::prost::alloc::string::String>,
322 #[prost(int32, optional, tag = "3")]
324 pub version: ::core::option::Option<i32>,
325 #[prost(message, optional, tag = "4")]
327 pub status: ::core::option::Option<ExecutionStatus>,
328 #[prost(uint64, optional, tag = "5")]
330 pub epoch: ::core::option::Option<u64>,
331 #[prost(message, optional, tag = "6")]
333 pub gas_used: ::core::option::Option<GasCostSummary>,
334 #[prost(string, optional, tag = "7")]
336 pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
337 #[prost(message, optional, tag = "8")]
341 pub gas_object: ::core::option::Option<ChangedObject>,
342 #[prost(string, optional, tag = "9")]
345 pub events_digest: ::core::option::Option<::prost::alloc::string::String>,
346 #[prost(string, repeated, tag = "10")]
348 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
349 #[prost(uint64, optional, tag = "11")]
351 pub lamport_version: ::core::option::Option<u64>,
352 #[prost(message, repeated, tag = "12")]
354 pub changed_objects: ::prost::alloc::vec::Vec<ChangedObject>,
355 #[prost(message, repeated, tag = "13")]
360 pub unchanged_consensus_objects: ::prost::alloc::vec::Vec<UnchangedConsensusObject>,
361 #[prost(string, optional, tag = "14")]
365 pub auxiliary_data_digest: ::core::option::Option<::prost::alloc::string::String>,
366 #[prost(message, repeated, tag = "15")]
367 pub unchanged_loaded_runtime_objects: ::prost::alloc::vec::Vec<ObjectReference>,
368}
369#[non_exhaustive]
371#[derive(Clone, PartialEq, ::prost::Message)]
372pub struct ChangedObject {
373 #[prost(string, optional, tag = "1")]
375 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
376 #[prost(enumeration = "changed_object::InputObjectState", optional, tag = "2")]
377 pub input_state: ::core::option::Option<i32>,
378 #[prost(uint64, optional, tag = "3")]
380 pub input_version: ::core::option::Option<u64>,
381 #[prost(string, optional, tag = "4")]
383 pub input_digest: ::core::option::Option<::prost::alloc::string::String>,
384 #[prost(message, optional, tag = "5")]
386 pub input_owner: ::core::option::Option<Owner>,
387 #[prost(enumeration = "changed_object::OutputObjectState", optional, tag = "6")]
388 pub output_state: ::core::option::Option<i32>,
389 #[prost(uint64, optional, tag = "7")]
391 pub output_version: ::core::option::Option<u64>,
392 #[prost(string, optional, tag = "8")]
394 pub output_digest: ::core::option::Option<::prost::alloc::string::String>,
395 #[prost(message, optional, tag = "9")]
397 pub output_owner: ::core::option::Option<Owner>,
398 #[prost(message, optional, tag = "12")]
400 pub accumulator_write: ::core::option::Option<AccumulatorWrite>,
401 #[prost(enumeration = "changed_object::IdOperation", optional, tag = "10")]
403 pub id_operation: ::core::option::Option<i32>,
404 #[prost(string, optional, tag = "11")]
407 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
408}
409pub mod changed_object {
411 #[non_exhaustive]
412 #[derive(
413 Clone,
414 Copy,
415 Debug,
416 PartialEq,
417 Eq,
418 Hash,
419 PartialOrd,
420 Ord,
421 ::prost::Enumeration
422 )]
423 #[repr(i32)]
424 pub enum InputObjectState {
425 Unknown = 0,
426 DoesNotExist = 1,
427 Exists = 2,
428 }
429 impl InputObjectState {
430 pub fn as_str_name(&self) -> &'static str {
435 match self {
436 Self::Unknown => "INPUT_OBJECT_STATE_UNKNOWN",
437 Self::DoesNotExist => "INPUT_OBJECT_STATE_DOES_NOT_EXIST",
438 Self::Exists => "INPUT_OBJECT_STATE_EXISTS",
439 }
440 }
441 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
443 match value {
444 "INPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
445 "INPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
446 "INPUT_OBJECT_STATE_EXISTS" => Some(Self::Exists),
447 _ => None,
448 }
449 }
450 }
451 #[non_exhaustive]
452 #[derive(
453 Clone,
454 Copy,
455 Debug,
456 PartialEq,
457 Eq,
458 Hash,
459 PartialOrd,
460 Ord,
461 ::prost::Enumeration
462 )]
463 #[repr(i32)]
464 pub enum OutputObjectState {
465 Unknown = 0,
466 DoesNotExist = 1,
467 ObjectWrite = 2,
468 PackageWrite = 3,
469 AccumulatorWrite = 4,
470 }
471 impl OutputObjectState {
472 pub fn as_str_name(&self) -> &'static str {
477 match self {
478 Self::Unknown => "OUTPUT_OBJECT_STATE_UNKNOWN",
479 Self::DoesNotExist => "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST",
480 Self::ObjectWrite => "OUTPUT_OBJECT_STATE_OBJECT_WRITE",
481 Self::PackageWrite => "OUTPUT_OBJECT_STATE_PACKAGE_WRITE",
482 Self::AccumulatorWrite => "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE",
483 }
484 }
485 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
487 match value {
488 "OUTPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
489 "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
490 "OUTPUT_OBJECT_STATE_OBJECT_WRITE" => Some(Self::ObjectWrite),
491 "OUTPUT_OBJECT_STATE_PACKAGE_WRITE" => Some(Self::PackageWrite),
492 "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE" => Some(Self::AccumulatorWrite),
493 _ => None,
494 }
495 }
496 }
497 #[non_exhaustive]
498 #[derive(
499 Clone,
500 Copy,
501 Debug,
502 PartialEq,
503 Eq,
504 Hash,
505 PartialOrd,
506 Ord,
507 ::prost::Enumeration
508 )]
509 #[repr(i32)]
510 pub enum IdOperation {
511 Unknown = 0,
512 None = 1,
513 Created = 2,
514 Deleted = 3,
515 }
516 impl IdOperation {
517 pub fn as_str_name(&self) -> &'static str {
522 match self {
523 Self::Unknown => "ID_OPERATION_UNKNOWN",
524 Self::None => "NONE",
525 Self::Created => "CREATED",
526 Self::Deleted => "DELETED",
527 }
528 }
529 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
531 match value {
532 "ID_OPERATION_UNKNOWN" => Some(Self::Unknown),
533 "NONE" => Some(Self::None),
534 "CREATED" => Some(Self::Created),
535 "DELETED" => Some(Self::Deleted),
536 _ => None,
537 }
538 }
539 }
540}
541#[non_exhaustive]
543#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
544pub struct EventDigestEntry {
545 #[prost(uint64, optional, tag = "1")]
547 pub event_index: ::core::option::Option<u64>,
548 #[prost(string, optional, tag = "2")]
550 pub digest: ::core::option::Option<::prost::alloc::string::String>,
551}
552#[non_exhaustive]
553#[derive(Clone, PartialEq, ::prost::Message)]
554pub struct AccumulatorWrite {
555 #[prost(string, optional, tag = "1")]
556 pub address: ::core::option::Option<::prost::alloc::string::String>,
557 #[prost(string, optional, tag = "2")]
558 pub accumulator_type: ::core::option::Option<::prost::alloc::string::String>,
559 #[prost(
560 enumeration = "accumulator_write::AccumulatorOperation",
561 optional,
562 tag = "3"
563 )]
564 pub operation: ::core::option::Option<i32>,
565 #[prost(enumeration = "accumulator_write::AccumulatorValue", optional, tag = "4")]
566 pub value_kind: ::core::option::Option<i32>,
567 #[prost(uint64, optional, tag = "5")]
569 pub integer_value: ::core::option::Option<u64>,
570 #[prost(uint64, repeated, tag = "6")]
573 pub integer_tuple: ::prost::alloc::vec::Vec<u64>,
574 #[prost(message, repeated, tag = "7")]
578 pub event_digest_value: ::prost::alloc::vec::Vec<EventDigestEntry>,
579}
580pub mod accumulator_write {
582 #[non_exhaustive]
583 #[derive(
584 Clone,
585 Copy,
586 Debug,
587 PartialEq,
588 Eq,
589 Hash,
590 PartialOrd,
591 Ord,
592 ::prost::Enumeration
593 )]
594 #[repr(i32)]
595 pub enum AccumulatorOperation {
596 Unknown = 0,
597 Merge = 1,
598 Split = 2,
599 }
600 impl AccumulatorOperation {
601 pub fn as_str_name(&self) -> &'static str {
606 match self {
607 Self::Unknown => "ACCUMULATOR_OPERATION_UNKNOWN",
608 Self::Merge => "MERGE",
609 Self::Split => "SPLIT",
610 }
611 }
612 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
614 match value {
615 "ACCUMULATOR_OPERATION_UNKNOWN" => Some(Self::Unknown),
616 "MERGE" => Some(Self::Merge),
617 "SPLIT" => Some(Self::Split),
618 _ => None,
619 }
620 }
621 }
622 #[non_exhaustive]
623 #[derive(
624 Clone,
625 Copy,
626 Debug,
627 PartialEq,
628 Eq,
629 Hash,
630 PartialOrd,
631 Ord,
632 ::prost::Enumeration
633 )]
634 #[repr(i32)]
635 pub enum AccumulatorValue {
636 Unknown = 0,
637 Integer = 1,
638 IntegerTuple = 2,
639 EventDigest = 3,
640 }
641 impl AccumulatorValue {
642 pub fn as_str_name(&self) -> &'static str {
647 match self {
648 Self::Unknown => "ACCUMULATOR_VALUE_UNKNOWN",
649 Self::Integer => "INTEGER",
650 Self::IntegerTuple => "INTEGER_TUPLE",
651 Self::EventDigest => "EVENT_DIGEST",
652 }
653 }
654 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
656 match value {
657 "ACCUMULATOR_VALUE_UNKNOWN" => Some(Self::Unknown),
658 "INTEGER" => Some(Self::Integer),
659 "INTEGER_TUPLE" => Some(Self::IntegerTuple),
660 "EVENT_DIGEST" => Some(Self::EventDigest),
661 _ => None,
662 }
663 }
664 }
665}
666#[non_exhaustive]
668#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
669pub struct UnchangedConsensusObject {
670 #[prost(
671 enumeration = "unchanged_consensus_object::UnchangedConsensusObjectKind",
672 optional,
673 tag = "1"
674 )]
675 pub kind: ::core::option::Option<i32>,
676 #[prost(string, optional, tag = "2")]
678 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
679 #[prost(uint64, optional, tag = "3")]
681 pub version: ::core::option::Option<u64>,
682 #[prost(string, optional, tag = "4")]
684 pub digest: ::core::option::Option<::prost::alloc::string::String>,
685 #[prost(string, optional, tag = "5")]
688 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
689}
690pub mod unchanged_consensus_object {
692 #[non_exhaustive]
693 #[derive(
694 Clone,
695 Copy,
696 Debug,
697 PartialEq,
698 Eq,
699 Hash,
700 PartialOrd,
701 Ord,
702 ::prost::Enumeration
703 )]
704 #[repr(i32)]
705 pub enum UnchangedConsensusObjectKind {
706 Unknown = 0,
707 ReadOnlyRoot = 1,
709 MutateConsensusStreamEnded = 2,
711 ReadConsensusStreamEnded = 3,
713 Canceled = 4,
716 PerEpochConfig = 5,
720 }
721 impl UnchangedConsensusObjectKind {
722 pub fn as_str_name(&self) -> &'static str {
727 match self {
728 Self::Unknown => "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN",
729 Self::ReadOnlyRoot => "READ_ONLY_ROOT",
730 Self::MutateConsensusStreamEnded => "MUTATE_CONSENSUS_STREAM_ENDED",
731 Self::ReadConsensusStreamEnded => "READ_CONSENSUS_STREAM_ENDED",
732 Self::Canceled => "CANCELED",
733 Self::PerEpochConfig => "PER_EPOCH_CONFIG",
734 }
735 }
736 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
738 match value {
739 "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN" => Some(Self::Unknown),
740 "READ_ONLY_ROOT" => Some(Self::ReadOnlyRoot),
741 "MUTATE_CONSENSUS_STREAM_ENDED" => Some(Self::MutateConsensusStreamEnded),
742 "READ_CONSENSUS_STREAM_ENDED" => Some(Self::ReadConsensusStreamEnded),
743 "CANCELED" => Some(Self::Canceled),
744 "PER_EPOCH_CONFIG" => Some(Self::PerEpochConfig),
745 _ => None,
746 }
747 }
748 }
749}
750#[non_exhaustive]
751#[derive(Clone, PartialEq, ::prost::Message)]
752pub struct Epoch {
753 #[prost(uint64, optional, tag = "1")]
754 pub epoch: ::core::option::Option<u64>,
755 #[prost(message, optional, tag = "2")]
757 pub committee: ::core::option::Option<ValidatorCommittee>,
758 #[prost(message, optional, boxed, tag = "3")]
762 pub system_state: ::core::option::Option<::prost::alloc::boxed::Box<SystemState>>,
763 #[prost(uint64, optional, tag = "4")]
764 pub first_checkpoint: ::core::option::Option<u64>,
765 #[prost(uint64, optional, tag = "5")]
766 pub last_checkpoint: ::core::option::Option<u64>,
767 #[prost(message, optional, tag = "6")]
768 pub start: ::core::option::Option<::prost_types::Timestamp>,
769 #[prost(message, optional, tag = "7")]
770 pub end: ::core::option::Option<::prost_types::Timestamp>,
771 #[prost(uint64, optional, tag = "8")]
773 pub reference_gas_price: ::core::option::Option<u64>,
774 #[prost(message, optional, tag = "9")]
775 pub protocol_config: ::core::option::Option<ProtocolConfig>,
776}
777#[non_exhaustive]
778#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
779#[repr(i32)]
780pub enum ErrorReason {
781 Unknown = 0,
782 FieldInvalid = 1,
783 FieldMissing = 2,
784}
785impl ErrorReason {
786 pub fn as_str_name(&self) -> &'static str {
791 match self {
792 Self::Unknown => "ERROR_REASON_UNKNOWN",
793 Self::FieldInvalid => "FIELD_INVALID",
794 Self::FieldMissing => "FIELD_MISSING",
795 }
796 }
797 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
799 match value {
800 "ERROR_REASON_UNKNOWN" => Some(Self::Unknown),
801 "FIELD_INVALID" => Some(Self::FieldInvalid),
802 "FIELD_MISSING" => Some(Self::FieldMissing),
803 _ => None,
804 }
805 }
806}
807#[non_exhaustive]
809#[derive(Clone, PartialEq, ::prost::Message)]
810pub struct TransactionEvents {
811 #[prost(message, optional, tag = "1")]
813 pub bcs: ::core::option::Option<Bcs>,
814 #[prost(string, optional, tag = "2")]
816 pub digest: ::core::option::Option<::prost::alloc::string::String>,
817 #[prost(message, repeated, tag = "3")]
819 pub events: ::prost::alloc::vec::Vec<Event>,
820}
821#[non_exhaustive]
823#[derive(Clone, PartialEq, ::prost::Message)]
824pub struct Event {
825 #[prost(string, optional, tag = "1")]
828 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
829 #[prost(string, optional, tag = "2")]
832 pub module: ::core::option::Option<::prost::alloc::string::String>,
833 #[prost(string, optional, tag = "3")]
835 pub sender: ::core::option::Option<::prost::alloc::string::String>,
836 #[prost(string, optional, tag = "4")]
838 pub event_type: ::core::option::Option<::prost::alloc::string::String>,
839 #[prost(message, optional, tag = "5")]
841 pub contents: ::core::option::Option<Bcs>,
842 #[prost(message, optional, boxed, tag = "6")]
844 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
845 #[prost(uint64, optional, tag = "7")]
851 pub checkpoint: ::core::option::Option<u64>,
852 #[prost(string, optional, tag = "8")]
854 pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
855 #[prost(uint64, optional, tag = "9")]
860 pub transaction_index: ::core::option::Option<u64>,
861 #[prost(uint32, optional, tag = "10")]
863 pub event_index: ::core::option::Option<u32>,
864}
865#[non_exhaustive]
866#[derive(Clone, PartialEq, ::prost::Message)]
867pub struct ExecutedTransaction {
868 #[prost(string, optional, tag = "1")]
870 pub digest: ::core::option::Option<::prost::alloc::string::String>,
871 #[prost(message, optional, tag = "2")]
873 pub transaction: ::core::option::Option<Transaction>,
874 #[prost(message, repeated, tag = "3")]
877 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
878 #[prost(message, optional, tag = "4")]
880 pub effects: ::core::option::Option<TransactionEffects>,
881 #[prost(message, optional, tag = "5")]
888 pub events: ::core::option::Option<TransactionEvents>,
889 #[prost(uint64, optional, tag = "6")]
891 pub checkpoint: ::core::option::Option<u64>,
892 #[prost(message, optional, tag = "7")]
894 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
895 #[prost(message, repeated, tag = "8")]
896 pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
897 #[prost(message, optional, tag = "9")]
900 pub objects: ::core::option::Option<ObjectSet>,
901 #[prost(uint64, optional, tag = "10")]
904 pub transaction_index: ::core::option::Option<u64>,
905}
906#[non_exhaustive]
908#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
909pub struct ExecutionStatus {
910 #[prost(bool, optional, tag = "1")]
912 pub success: ::core::option::Option<bool>,
913 #[prost(message, optional, tag = "2")]
915 pub error: ::core::option::Option<ExecutionError>,
916}
917#[non_exhaustive]
919#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
920pub struct ExecutionError {
921 #[prost(string, optional, tag = "1")]
923 pub description: ::core::option::Option<::prost::alloc::string::String>,
924 #[prost(uint64, optional, tag = "2")]
926 pub command: ::core::option::Option<u64>,
927 #[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
928 pub kind: ::core::option::Option<i32>,
929 #[prost(
930 oneof = "execution_error::ErrorDetails",
931 tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
932 )]
933 pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
934}
935pub mod execution_error {
937 #[non_exhaustive]
938 #[derive(
939 Clone,
940 Copy,
941 Debug,
942 PartialEq,
943 Eq,
944 Hash,
945 PartialOrd,
946 Ord,
947 ::prost::Enumeration
948 )]
949 #[repr(i32)]
950 pub enum ExecutionErrorKind {
951 Unknown = 0,
952 InsufficientGas = 1,
954 InvalidGasObject = 2,
956 InvariantViolation = 3,
958 FeatureNotYetSupported = 4,
960 ObjectTooBig = 5,
962 PackageTooBig = 6,
964 CircularObjectOwnership = 7,
966 InsufficientCoinBalance = 8,
968 CoinBalanceOverflow = 9,
970 PublishErrorNonZeroAddress = 10,
973 SuiMoveVerificationError = 11,
975 MovePrimitiveRuntimeError = 12,
979 MoveAbort = 13,
981 VmVerificationOrDeserializationError = 14,
983 VmInvariantViolation = 15,
985 FunctionNotFound = 16,
987 ArityMismatch = 17,
990 TypeArityMismatch = 18,
993 NonEntryFunctionInvoked = 19,
995 CommandArgumentError = 20,
997 TypeArgumentError = 21,
999 UnusedValueWithoutDrop = 22,
1001 InvalidPublicFunctionReturnType = 23,
1004 InvalidTransferObject = 24,
1006 EffectsTooLarge = 25,
1008 PublishUpgradeMissingDependency = 26,
1010 PublishUpgradeDependencyDowngrade = 27,
1016 PackageUpgradeError = 28,
1018 WrittenObjectsTooLarge = 29,
1020 CertificateDenied = 30,
1022 SuiMoveVerificationTimedout = 31,
1024 ConsensusObjectOperationNotAllowed = 32,
1026 InputObjectDeleted = 33,
1028 ExecutionCanceledDueToConsensusObjectCongestion = 34,
1030 AddressDeniedForCoin = 35,
1032 CoinTypeGlobalPause = 36,
1034 ExecutionCanceledDueToRandomnessUnavailable = 37,
1036 MoveVectorElemTooBig = 38,
1040 MoveRawValueTooBig = 39,
1044 InvalidLinkage = 40,
1046 InsufficientFundsForWithdraw = 41,
1048 NonExclusiveWriteInputObjectModified = 42,
1050 }
1051 impl ExecutionErrorKind {
1052 pub fn as_str_name(&self) -> &'static str {
1057 match self {
1058 Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
1059 Self::InsufficientGas => "INSUFFICIENT_GAS",
1060 Self::InvalidGasObject => "INVALID_GAS_OBJECT",
1061 Self::InvariantViolation => "INVARIANT_VIOLATION",
1062 Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
1063 Self::ObjectTooBig => "OBJECT_TOO_BIG",
1064 Self::PackageTooBig => "PACKAGE_TOO_BIG",
1065 Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
1066 Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
1067 Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
1068 Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
1069 Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
1070 Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
1071 Self::MoveAbort => "MOVE_ABORT",
1072 Self::VmVerificationOrDeserializationError => {
1073 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
1074 }
1075 Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
1076 Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
1077 Self::ArityMismatch => "ARITY_MISMATCH",
1078 Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
1079 Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
1080 Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
1081 Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
1082 Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
1083 Self::InvalidPublicFunctionReturnType => {
1084 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
1085 }
1086 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1087 Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
1088 Self::PublishUpgradeMissingDependency => {
1089 "PUBLISH_UPGRADE_MISSING_DEPENDENCY"
1090 }
1091 Self::PublishUpgradeDependencyDowngrade => {
1092 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
1093 }
1094 Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
1095 Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
1096 Self::CertificateDenied => "CERTIFICATE_DENIED",
1097 Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
1098 Self::ConsensusObjectOperationNotAllowed => {
1099 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1100 }
1101 Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
1102 Self::ExecutionCanceledDueToConsensusObjectCongestion => {
1103 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION"
1104 }
1105 Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
1106 Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
1107 Self::ExecutionCanceledDueToRandomnessUnavailable => {
1108 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
1109 }
1110 Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
1111 Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
1112 Self::InvalidLinkage => "INVALID_LINKAGE",
1113 Self::InsufficientFundsForWithdraw => "INSUFFICIENT_FUNDS_FOR_WITHDRAW",
1114 Self::NonExclusiveWriteInputObjectModified => {
1115 "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED"
1116 }
1117 }
1118 }
1119 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1121 match value {
1122 "EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1123 "INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
1124 "INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
1125 "INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
1126 "FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
1127 "OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
1128 "PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
1129 "CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
1130 "INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
1131 "COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
1132 "PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
1133 Some(Self::PublishErrorNonZeroAddress)
1134 }
1135 "SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
1136 "MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
1137 "MOVE_ABORT" => Some(Self::MoveAbort),
1138 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
1139 Some(Self::VmVerificationOrDeserializationError)
1140 }
1141 "VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
1142 "FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
1143 "ARITY_MISMATCH" => Some(Self::ArityMismatch),
1144 "TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
1145 "NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
1146 "COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
1147 "TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
1148 "UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
1149 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
1150 Some(Self::InvalidPublicFunctionReturnType)
1151 }
1152 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1153 "EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
1154 "PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
1155 Some(Self::PublishUpgradeMissingDependency)
1156 }
1157 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
1158 Some(Self::PublishUpgradeDependencyDowngrade)
1159 }
1160 "PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
1161 "WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
1162 "CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
1163 "SUI_MOVE_VERIFICATION_TIMEDOUT" => {
1164 Some(Self::SuiMoveVerificationTimedout)
1165 }
1166 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1167 Some(Self::ConsensusObjectOperationNotAllowed)
1168 }
1169 "INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
1170 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION" => {
1171 Some(Self::ExecutionCanceledDueToConsensusObjectCongestion)
1172 }
1173 "ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
1174 "COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
1175 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
1176 Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
1177 }
1178 "MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
1179 "MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
1180 "INVALID_LINKAGE" => Some(Self::InvalidLinkage),
1181 "INSUFFICIENT_FUNDS_FOR_WITHDRAW" => {
1182 Some(Self::InsufficientFundsForWithdraw)
1183 }
1184 "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED" => {
1185 Some(Self::NonExclusiveWriteInputObjectModified)
1186 }
1187 _ => None,
1188 }
1189 }
1190 }
1191 #[non_exhaustive]
1192 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1193 pub enum ErrorDetails {
1194 #[prost(message, tag = "4")]
1195 Abort(super::MoveAbort),
1196 #[prost(message, tag = "5")]
1197 SizeError(super::SizeError),
1198 #[prost(message, tag = "6")]
1199 CommandArgumentError(super::CommandArgumentError),
1200 #[prost(message, tag = "7")]
1201 TypeArgumentError(super::TypeArgumentError),
1202 #[prost(message, tag = "8")]
1203 PackageUpgradeError(super::PackageUpgradeError),
1204 #[prost(message, tag = "9")]
1205 IndexError(super::IndexError),
1206 #[prost(string, tag = "10")]
1207 ObjectId(::prost::alloc::string::String),
1208 #[prost(message, tag = "11")]
1209 CoinDenyListError(super::CoinDenyListError),
1210 #[prost(message, tag = "12")]
1212 CongestedObjects(super::CongestedObjects),
1213 }
1214}
1215#[non_exhaustive]
1216#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1217pub struct MoveAbort {
1218 #[prost(uint64, optional, tag = "1")]
1219 pub abort_code: ::core::option::Option<u64>,
1220 #[prost(message, optional, tag = "2")]
1222 pub location: ::core::option::Option<MoveLocation>,
1223 #[prost(message, optional, tag = "3")]
1225 pub clever_error: ::core::option::Option<CleverError>,
1226}
1227#[non_exhaustive]
1229#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1230pub struct MoveLocation {
1231 #[prost(string, optional, tag = "1")]
1233 pub package: ::core::option::Option<::prost::alloc::string::String>,
1234 #[prost(string, optional, tag = "2")]
1236 pub module: ::core::option::Option<::prost::alloc::string::String>,
1237 #[prost(uint32, optional, tag = "3")]
1239 pub function: ::core::option::Option<u32>,
1240 #[prost(uint32, optional, tag = "4")]
1242 pub instruction: ::core::option::Option<u32>,
1243 #[prost(string, optional, tag = "5")]
1245 pub function_name: ::core::option::Option<::prost::alloc::string::String>,
1246}
1247#[non_exhaustive]
1248#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1249pub struct CleverError {
1250 #[prost(uint64, optional, tag = "1")]
1251 pub error_code: ::core::option::Option<u64>,
1252 #[prost(uint64, optional, tag = "2")]
1253 pub line_number: ::core::option::Option<u64>,
1254 #[prost(string, optional, tag = "3")]
1255 pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
1256 #[prost(string, optional, tag = "4")]
1257 pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
1258 #[prost(oneof = "clever_error::Value", tags = "5, 6")]
1259 pub value: ::core::option::Option<clever_error::Value>,
1260}
1261pub mod clever_error {
1263 #[non_exhaustive]
1264 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1265 pub enum Value {
1266 #[prost(string, tag = "5")]
1267 Rendered(::prost::alloc::string::String),
1268 #[prost(bytes, tag = "6")]
1269 Raw(::prost::bytes::Bytes),
1270 }
1271}
1272#[non_exhaustive]
1274#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1275pub struct SizeError {
1276 #[prost(uint64, optional, tag = "1")]
1278 pub size: ::core::option::Option<u64>,
1279 #[prost(uint64, optional, tag = "2")]
1281 pub max_size: ::core::option::Option<u64>,
1282}
1283#[non_exhaustive]
1284#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1285pub struct IndexError {
1286 #[prost(uint32, optional, tag = "1")]
1288 pub index: ::core::option::Option<u32>,
1289 #[prost(uint32, optional, tag = "2")]
1291 pub subresult: ::core::option::Option<u32>,
1292}
1293#[non_exhaustive]
1294#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1295pub struct CoinDenyListError {
1296 #[prost(string, optional, tag = "1")]
1298 pub address: ::core::option::Option<::prost::alloc::string::String>,
1299 #[prost(string, optional, tag = "2")]
1301 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1302}
1303#[non_exhaustive]
1305#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1306pub struct CongestedObjects {
1307 #[prost(string, repeated, tag = "1")]
1308 pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1309}
1310#[non_exhaustive]
1312#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1313pub struct CommandArgumentError {
1314 #[prost(uint32, optional, tag = "1")]
1316 pub argument: ::core::option::Option<u32>,
1317 #[prost(
1318 enumeration = "command_argument_error::CommandArgumentErrorKind",
1319 optional,
1320 tag = "2"
1321 )]
1322 pub kind: ::core::option::Option<i32>,
1323 #[prost(message, optional, tag = "3")]
1324 pub index_error: ::core::option::Option<IndexError>,
1325}
1326pub mod command_argument_error {
1328 #[non_exhaustive]
1329 #[derive(
1330 Clone,
1331 Copy,
1332 Debug,
1333 PartialEq,
1334 Eq,
1335 Hash,
1336 PartialOrd,
1337 Ord,
1338 ::prost::Enumeration
1339 )]
1340 #[repr(i32)]
1341 pub enum CommandArgumentErrorKind {
1342 Unknown = 0,
1343 TypeMismatch = 1,
1345 InvalidBcsBytes = 2,
1347 InvalidUsageOfPureArgument = 3,
1349 InvalidArgumentToPrivateEntryFunction = 4,
1352 IndexOutOfBounds = 5,
1356 SecondaryIndexOutOfBounds = 6,
1360 InvalidResultArity = 7,
1364 InvalidGasCoinUsage = 8,
1367 InvalidValueUsage = 9,
1372 InvalidObjectByValue = 10,
1374 InvalidObjectByMutRef = 11,
1376 ConsensusObjectOperationNotAllowed = 12,
1379 InvalidArgumentArity = 13,
1382 InvalidTransferObject = 14,
1384 InvalidMakeMoveVecNonObjectArgument = 15,
1387 ArgumentWithoutValue = 16,
1389 CannotMoveBorrowedValue = 17,
1394 CannotWriteToExtendedReference = 18,
1398 InvalidReferenceArgument = 19,
1402 InvalidTxContext = 20,
1406 }
1407 impl CommandArgumentErrorKind {
1408 pub fn as_str_name(&self) -> &'static str {
1413 match self {
1414 Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1415 Self::TypeMismatch => "TYPE_MISMATCH",
1416 Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1417 Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1418 Self::InvalidArgumentToPrivateEntryFunction => {
1419 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1420 }
1421 Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1422 Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1423 Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1424 Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1425 Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1426 Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1427 Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1428 Self::ConsensusObjectOperationNotAllowed => {
1429 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1430 }
1431 Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1432 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1433 Self::InvalidMakeMoveVecNonObjectArgument => {
1434 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1435 }
1436 Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1437 Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1438 Self::CannotWriteToExtendedReference => {
1439 "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1440 }
1441 Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1442 Self::InvalidTxContext => "INVALID_TX_CONTEXT",
1443 }
1444 }
1445 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1447 match value {
1448 "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1449 "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1450 "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1451 "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1452 Some(Self::InvalidUsageOfPureArgument)
1453 }
1454 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1455 Some(Self::InvalidArgumentToPrivateEntryFunction)
1456 }
1457 "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1458 "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1459 "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1460 "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1461 "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1462 "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1463 "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1464 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1465 Some(Self::ConsensusObjectOperationNotAllowed)
1466 }
1467 "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1468 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1469 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1470 Some(Self::InvalidMakeMoveVecNonObjectArgument)
1471 }
1472 "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1473 "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1474 "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1475 Some(Self::CannotWriteToExtendedReference)
1476 }
1477 "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1478 "INVALID_TX_CONTEXT" => Some(Self::InvalidTxContext),
1479 _ => None,
1480 }
1481 }
1482 }
1483}
1484#[non_exhaustive]
1486#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1487pub struct PackageUpgradeError {
1488 #[prost(
1489 enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1490 optional,
1491 tag = "1"
1492 )]
1493 pub kind: ::core::option::Option<i32>,
1494 #[prost(string, optional, tag = "2")]
1496 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1497 #[prost(string, optional, tag = "3")]
1499 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1500 #[prost(uint32, optional, tag = "4")]
1502 pub policy: ::core::option::Option<u32>,
1503 #[prost(string, optional, tag = "5")]
1505 pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1506}
1507pub mod package_upgrade_error {
1509 #[non_exhaustive]
1510 #[derive(
1511 Clone,
1512 Copy,
1513 Debug,
1514 PartialEq,
1515 Eq,
1516 Hash,
1517 PartialOrd,
1518 Ord,
1519 ::prost::Enumeration
1520 )]
1521 #[repr(i32)]
1522 pub enum PackageUpgradeErrorKind {
1523 Unknown = 0,
1524 UnableToFetchPackage = 1,
1526 NotAPackage = 2,
1528 IncompatibleUpgrade = 3,
1530 DigestDoesNotMatch = 4,
1532 UnknownUpgradePolicy = 5,
1534 PackageIdDoesNotMatch = 6,
1536 }
1537 impl PackageUpgradeErrorKind {
1538 pub fn as_str_name(&self) -> &'static str {
1543 match self {
1544 Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1545 Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1546 Self::NotAPackage => "NOT_A_PACKAGE",
1547 Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1548 Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1549 Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1550 Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1551 }
1552 }
1553 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1555 match value {
1556 "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1557 "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1558 "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1559 "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1560 "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1561 "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1562 "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1563 _ => None,
1564 }
1565 }
1566 }
1567}
1568#[non_exhaustive]
1570#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1571pub struct TypeArgumentError {
1572 #[prost(uint32, optional, tag = "1")]
1574 pub type_argument: ::core::option::Option<u32>,
1575 #[prost(
1576 enumeration = "type_argument_error::TypeArgumentErrorKind",
1577 optional,
1578 tag = "2"
1579 )]
1580 pub kind: ::core::option::Option<i32>,
1581}
1582pub mod type_argument_error {
1584 #[non_exhaustive]
1585 #[derive(
1586 Clone,
1587 Copy,
1588 Debug,
1589 PartialEq,
1590 Eq,
1591 Hash,
1592 PartialOrd,
1593 Ord,
1594 ::prost::Enumeration
1595 )]
1596 #[repr(i32)]
1597 pub enum TypeArgumentErrorKind {
1598 Unknown = 0,
1599 TypeNotFound = 1,
1601 ConstraintNotSatisfied = 2,
1603 }
1604 impl TypeArgumentErrorKind {
1605 pub fn as_str_name(&self) -> &'static str {
1610 match self {
1611 Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1612 Self::TypeNotFound => "TYPE_NOT_FOUND",
1613 Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1614 }
1615 }
1616 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1618 match value {
1619 "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1620 "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1621 "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1622 _ => None,
1623 }
1624 }
1625 }
1626}
1627#[derive(Eq, Hash)]
1632#[non_exhaustive]
1633#[derive(Clone, PartialEq, ::prost::Message)]
1634pub struct TransactionFilter {
1635 #[prost(message, repeated, tag = "1")]
1637 pub terms: ::prost::alloc::vec::Vec<TransactionTerm>,
1638}
1639#[derive(Eq, Hash)]
1641#[non_exhaustive]
1642#[derive(Clone, PartialEq, ::prost::Message)]
1643pub struct TransactionTerm {
1644 #[prost(message, repeated, tag = "1")]
1646 pub literals: ::prost::alloc::vec::Vec<TransactionLiteral>,
1647}
1648#[non_exhaustive]
1650#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1651pub struct TransactionLiteral {
1652 #[prost(bool, tag = "1")]
1655 pub negated: bool,
1656 #[prost(oneof = "transaction_literal::Predicate", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
1658 pub predicate: ::core::option::Option<transaction_literal::Predicate>,
1659}
1660pub mod transaction_literal {
1662 #[non_exhaustive]
1664 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1665 pub enum Predicate {
1666 #[prost(message, tag = "2")]
1668 Sender(super::SenderFilter),
1669 #[prost(message, tag = "3")]
1674 AffectedAddress(super::AffectedAddressFilter),
1675 #[prost(message, tag = "4")]
1678 AffectedObject(super::AffectedObjectFilter),
1679 #[prost(message, tag = "5")]
1681 MoveCall(super::MoveCallFilter),
1682 #[prost(message, tag = "6")]
1685 EmitModule(super::EmitModuleFilter),
1686 #[prost(message, tag = "7")]
1689 EventType(super::EventTypeFilter),
1690 #[prost(message, tag = "8")]
1693 EventStreamHead(super::EventStreamHeadFilter),
1694 #[prost(message, tag = "9")]
1697 PackageWrite(super::PackageWriteFilter),
1698 }
1699}
1700#[non_exhaustive]
1706#[derive(Clone, PartialEq, ::prost::Message)]
1707pub struct EventFilter {
1708 #[prost(message, repeated, tag = "1")]
1710 pub terms: ::prost::alloc::vec::Vec<EventTerm>,
1711}
1712#[non_exhaustive]
1714#[derive(Clone, PartialEq, ::prost::Message)]
1715pub struct EventTerm {
1716 #[prost(message, repeated, tag = "1")]
1718 pub literals: ::prost::alloc::vec::Vec<EventLiteral>,
1719}
1720#[non_exhaustive]
1722#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1723pub struct EventLiteral {
1724 #[prost(bool, tag = "1")]
1726 pub negated: bool,
1727 #[prost(oneof = "event_literal::Predicate", tags = "2, 3, 4, 5")]
1729 pub predicate: ::core::option::Option<event_literal::Predicate>,
1730}
1731pub mod event_literal {
1733 #[non_exhaustive]
1735 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1736 pub enum Predicate {
1737 #[prost(message, tag = "2")]
1739 Sender(super::SenderFilter),
1740 #[prost(message, tag = "3")]
1742 EmitModule(super::EmitModuleFilter),
1743 #[prost(message, tag = "4")]
1745 EventType(super::EventTypeFilter),
1746 #[prost(message, tag = "5")]
1748 EventStreamHead(super::EventStreamHeadFilter),
1749 }
1750}
1751#[non_exhaustive]
1753#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1754pub struct SenderFilter {
1755 #[prost(string, optional, tag = "1")]
1757 pub address: ::core::option::Option<::prost::alloc::string::String>,
1758}
1759#[non_exhaustive]
1764#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1765pub struct AffectedAddressFilter {
1766 #[prost(string, optional, tag = "1")]
1768 pub address: ::core::option::Option<::prost::alloc::string::String>,
1769}
1770#[non_exhaustive]
1772#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1773pub struct AffectedObjectFilter {
1774 #[prost(string, optional, tag = "1")]
1776 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1777}
1778#[non_exhaustive]
1785#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1786pub struct MoveCallFilter {
1787 #[prost(string, optional, tag = "1")]
1789 pub function: ::core::option::Option<::prost::alloc::string::String>,
1790}
1791#[non_exhaustive]
1798#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1799pub struct EmitModuleFilter {
1800 #[prost(string, optional, tag = "1")]
1802 pub module: ::core::option::Option<::prost::alloc::string::String>,
1803}
1804#[non_exhaustive]
1812#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1813pub struct EventTypeFilter {
1814 #[prost(string, optional, tag = "1")]
1817 pub event_type: ::core::option::Option<::prost::alloc::string::String>,
1818}
1819#[non_exhaustive]
1821#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1822pub struct EventStreamHeadFilter {
1823 #[prost(string, optional, tag = "1")]
1825 pub stream_id: ::core::option::Option<::prost::alloc::string::String>,
1826}
1827#[non_exhaustive]
1829#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1830pub struct PackageWriteFilter {}
1831#[non_exhaustive]
1833#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1834pub struct GasCostSummary {
1835 #[prost(uint64, optional, tag = "1")]
1837 pub computation_cost: ::core::option::Option<u64>,
1838 #[prost(uint64, optional, tag = "2")]
1840 pub storage_cost: ::core::option::Option<u64>,
1841 #[prost(uint64, optional, tag = "3")]
1844 pub storage_rebate: ::core::option::Option<u64>,
1845 #[prost(uint64, optional, tag = "4")]
1847 pub non_refundable_storage_fee: ::core::option::Option<u64>,
1848}
1849#[non_exhaustive]
1851#[derive(Clone, PartialEq, ::prost::Message)]
1852pub struct Input {
1853 #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1854 pub kind: ::core::option::Option<i32>,
1855 #[prost(bytes = "bytes", optional, tag = "2")]
1860 pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1861 #[prost(string, optional, tag = "3")]
1863 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1864 #[prost(uint64, optional, tag = "4")]
1868 pub version: ::core::option::Option<u64>,
1869 #[prost(string, optional, tag = "5")]
1871 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1872 #[prost(bool, optional, tag = "6")]
1875 pub mutable: ::core::option::Option<bool>,
1876 #[prost(enumeration = "input::Mutability", optional, tag = "7")]
1881 pub mutability: ::core::option::Option<i32>,
1882 #[prost(message, optional, tag = "8")]
1884 pub funds_withdrawal: ::core::option::Option<FundsWithdrawal>,
1885 #[prost(message, optional, boxed, tag = "1000")]
1889 pub literal: ::core::option::Option<
1890 ::prost::alloc::boxed::Box<::prost_types::Value>,
1891 >,
1892}
1893pub mod input {
1895 #[non_exhaustive]
1896 #[derive(
1897 Clone,
1898 Copy,
1899 Debug,
1900 PartialEq,
1901 Eq,
1902 Hash,
1903 PartialOrd,
1904 Ord,
1905 ::prost::Enumeration
1906 )]
1907 #[repr(i32)]
1908 pub enum InputKind {
1909 Unknown = 0,
1910 Pure = 1,
1912 ImmutableOrOwned = 2,
1914 Shared = 3,
1916 Receiving = 4,
1918 FundsWithdrawal = 5,
1920 }
1921 impl InputKind {
1922 pub fn as_str_name(&self) -> &'static str {
1927 match self {
1928 Self::Unknown => "INPUT_KIND_UNKNOWN",
1929 Self::Pure => "PURE",
1930 Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
1931 Self::Shared => "SHARED",
1932 Self::Receiving => "RECEIVING",
1933 Self::FundsWithdrawal => "FUNDS_WITHDRAWAL",
1934 }
1935 }
1936 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1938 match value {
1939 "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
1940 "PURE" => Some(Self::Pure),
1941 "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
1942 "SHARED" => Some(Self::Shared),
1943 "RECEIVING" => Some(Self::Receiving),
1944 "FUNDS_WITHDRAWAL" => Some(Self::FundsWithdrawal),
1945 _ => None,
1946 }
1947 }
1948 }
1949 #[non_exhaustive]
1950 #[derive(
1951 Clone,
1952 Copy,
1953 Debug,
1954 PartialEq,
1955 Eq,
1956 Hash,
1957 PartialOrd,
1958 Ord,
1959 ::prost::Enumeration
1960 )]
1961 #[repr(i32)]
1962 pub enum Mutability {
1963 Unknown = 0,
1964 Immutable = 1,
1965 Mutable = 2,
1966 NonExclusiveWrite = 3,
1970 }
1971 impl Mutability {
1972 pub fn as_str_name(&self) -> &'static str {
1977 match self {
1978 Self::Unknown => "MUTABILITY_UNKNOWN",
1979 Self::Immutable => "IMMUTABLE",
1980 Self::Mutable => "MUTABLE",
1981 Self::NonExclusiveWrite => "NON_EXCLUSIVE_WRITE",
1982 }
1983 }
1984 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1986 match value {
1987 "MUTABILITY_UNKNOWN" => Some(Self::Unknown),
1988 "IMMUTABLE" => Some(Self::Immutable),
1989 "MUTABLE" => Some(Self::Mutable),
1990 "NON_EXCLUSIVE_WRITE" => Some(Self::NonExclusiveWrite),
1991 _ => None,
1992 }
1993 }
1994 }
1995}
1996#[non_exhaustive]
1997#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1998pub struct FundsWithdrawal {
1999 #[prost(uint64, optional, tag = "1")]
2000 pub amount: ::core::option::Option<u64>,
2001 #[prost(string, optional, tag = "2")]
2002 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
2003 #[prost(enumeration = "funds_withdrawal::Source", optional, tag = "3")]
2004 pub source: ::core::option::Option<i32>,
2005 #[prost(string, optional, tag = "4")]
2007 pub funder: ::core::option::Option<::prost::alloc::string::String>,
2008 #[prost(string, optional, tag = "5")]
2011 pub allowance: ::core::option::Option<::prost::alloc::string::String>,
2012}
2013pub mod funds_withdrawal {
2015 #[non_exhaustive]
2016 #[derive(
2017 Clone,
2018 Copy,
2019 Debug,
2020 PartialEq,
2021 Eq,
2022 Hash,
2023 PartialOrd,
2024 Ord,
2025 ::prost::Enumeration
2026 )]
2027 #[repr(i32)]
2028 pub enum Source {
2029 Unknown = 0,
2030 Sender = 1,
2031 Sponsor = 2,
2032 SenderAllowance = 3,
2035 }
2036 impl Source {
2037 pub fn as_str_name(&self) -> &'static str {
2042 match self {
2043 Self::Unknown => "SOURCE_UNKNOWN",
2044 Self::Sender => "SENDER",
2045 Self::Sponsor => "SPONSOR",
2046 Self::SenderAllowance => "SENDER_ALLOWANCE",
2047 }
2048 }
2049 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2051 match value {
2052 "SOURCE_UNKNOWN" => Some(Self::Unknown),
2053 "SENDER" => Some(Self::Sender),
2054 "SPONSOR" => Some(Self::Sponsor),
2055 "SENDER_ALLOWANCE" => Some(Self::SenderAllowance),
2056 _ => None,
2057 }
2058 }
2059 }
2060}
2061#[non_exhaustive]
2063#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2064pub struct JwkId {
2065 #[prost(string, optional, tag = "1")]
2067 pub iss: ::core::option::Option<::prost::alloc::string::String>,
2068 #[prost(string, optional, tag = "2")]
2070 pub kid: ::core::option::Option<::prost::alloc::string::String>,
2071}
2072#[non_exhaustive]
2078#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2079pub struct Jwk {
2080 #[prost(string, optional, tag = "1")]
2082 pub kty: ::core::option::Option<::prost::alloc::string::String>,
2083 #[prost(string, optional, tag = "2")]
2085 pub e: ::core::option::Option<::prost::alloc::string::String>,
2086 #[prost(string, optional, tag = "3")]
2088 pub n: ::core::option::Option<::prost::alloc::string::String>,
2089 #[prost(string, optional, tag = "4")]
2091 pub alg: ::core::option::Option<::prost::alloc::string::String>,
2092}
2093#[non_exhaustive]
2094#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2095pub struct GetServiceInfoRequest {}
2096#[non_exhaustive]
2097#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2098pub struct GetServiceInfoResponse {
2099 #[prost(string, optional, tag = "1")]
2104 pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
2105 #[prost(string, optional, tag = "2")]
2109 pub chain: ::core::option::Option<::prost::alloc::string::String>,
2110 #[prost(uint64, optional, tag = "3")]
2112 pub epoch: ::core::option::Option<u64>,
2113 #[prost(uint64, optional, tag = "4")]
2115 pub checkpoint_height: ::core::option::Option<u64>,
2116 #[prost(message, optional, tag = "5")]
2118 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
2119 #[prost(uint64, optional, tag = "6")]
2121 pub lowest_available_checkpoint: ::core::option::Option<u64>,
2122 #[prost(uint64, optional, tag = "7")]
2124 pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
2125 #[prost(string, optional, tag = "8")]
2127 pub server: ::core::option::Option<::prost::alloc::string::String>,
2128}
2129#[non_exhaustive]
2130#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2131pub struct GetObjectRequest {
2132 #[prost(string, optional, tag = "1")]
2134 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2135 #[prost(uint64, optional, tag = "2")]
2139 pub version: ::core::option::Option<u64>,
2140 #[prost(message, optional, tag = "3")]
2143 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2144}
2145#[non_exhaustive]
2146#[derive(Clone, PartialEq, ::prost::Message)]
2147pub struct GetObjectResponse {
2148 #[prost(message, optional, tag = "1")]
2149 pub object: ::core::option::Option<Object>,
2150}
2151#[non_exhaustive]
2152#[derive(Clone, PartialEq, ::prost::Message)]
2153pub struct BatchGetObjectsRequest {
2154 #[prost(message, repeated, tag = "1")]
2155 pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
2156 #[prost(message, optional, tag = "2")]
2159 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2160}
2161#[non_exhaustive]
2162#[derive(Clone, PartialEq, ::prost::Message)]
2163pub struct BatchGetObjectsResponse {
2164 #[prost(message, repeated, tag = "1")]
2165 pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
2166}
2167#[non_exhaustive]
2168#[derive(Clone, PartialEq, ::prost::Message)]
2169pub struct GetObjectResult {
2170 #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
2171 pub result: ::core::option::Option<get_object_result::Result>,
2172}
2173pub mod get_object_result {
2175 #[non_exhaustive]
2176 #[derive(Clone, PartialEq, ::prost::Oneof)]
2177 pub enum Result {
2178 #[prost(message, tag = "1")]
2179 Object(super::Object),
2180 #[prost(message, tag = "2")]
2181 Error(super::super::super::super::google::rpc::Status),
2182 }
2183}
2184#[non_exhaustive]
2185#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2186pub struct GetTransactionRequest {
2187 #[prost(string, optional, tag = "1")]
2189 pub digest: ::core::option::Option<::prost::alloc::string::String>,
2190 #[prost(message, optional, tag = "2")]
2193 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2194}
2195#[non_exhaustive]
2196#[derive(Clone, PartialEq, ::prost::Message)]
2197pub struct GetTransactionResponse {
2198 #[prost(message, optional, tag = "1")]
2199 pub transaction: ::core::option::Option<ExecutedTransaction>,
2200}
2201#[non_exhaustive]
2202#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2203pub struct BatchGetTransactionsRequest {
2204 #[prost(string, repeated, tag = "1")]
2206 pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2207 #[prost(message, optional, tag = "2")]
2210 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2211}
2212#[non_exhaustive]
2213#[derive(Clone, PartialEq, ::prost::Message)]
2214pub struct BatchGetTransactionsResponse {
2215 #[prost(message, repeated, tag = "1")]
2216 pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
2217}
2218#[non_exhaustive]
2219#[derive(Clone, PartialEq, ::prost::Message)]
2220pub struct GetTransactionResult {
2221 #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
2222 pub result: ::core::option::Option<get_transaction_result::Result>,
2223}
2224pub mod get_transaction_result {
2226 #[non_exhaustive]
2227 #[derive(Clone, PartialEq, ::prost::Oneof)]
2228 pub enum Result {
2229 #[prost(message, tag = "1")]
2230 Transaction(super::ExecutedTransaction),
2231 #[prost(message, tag = "2")]
2232 Error(super::super::super::super::google::rpc::Status),
2233 }
2234}
2235#[non_exhaustive]
2236#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2237pub struct GetCheckpointRequest {
2238 #[prost(message, optional, tag = "3")]
2241 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2242 #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
2244 pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
2245}
2246pub mod get_checkpoint_request {
2248 #[non_exhaustive]
2250 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2251 pub enum CheckpointId {
2252 #[prost(uint64, tag = "1")]
2254 SequenceNumber(u64),
2255 #[prost(string, tag = "2")]
2257 Digest(::prost::alloc::string::String),
2258 }
2259}
2260#[non_exhaustive]
2261#[derive(Clone, PartialEq, ::prost::Message)]
2262pub struct GetCheckpointResponse {
2263 #[prost(message, optional, tag = "1")]
2264 pub checkpoint: ::core::option::Option<Checkpoint>,
2265}
2266#[non_exhaustive]
2267#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2268pub struct GetEpochRequest {
2269 #[prost(uint64, optional, tag = "1")]
2272 pub epoch: ::core::option::Option<u64>,
2273 #[prost(message, optional, tag = "2")]
2276 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2277}
2278#[non_exhaustive]
2279#[derive(Clone, PartialEq, ::prost::Message)]
2280pub struct GetEpochResponse {
2281 #[prost(message, optional, tag = "1")]
2282 pub epoch: ::core::option::Option<Epoch>,
2283}
2284#[non_exhaustive]
2286#[derive(Clone, PartialEq, ::prost::Message)]
2287pub struct ListCheckpointsRequest {
2288 #[prost(message, optional, tag = "1")]
2291 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2292 #[prost(uint64, optional, tag = "2")]
2295 pub start_checkpoint: ::core::option::Option<u64>,
2296 #[prost(uint64, optional, tag = "3")]
2299 pub end_checkpoint: ::core::option::Option<u64>,
2300 #[prost(message, optional, tag = "4")]
2304 pub filter: ::core::option::Option<TransactionFilter>,
2305 #[prost(message, optional, tag = "5")]
2311 pub options: ::core::option::Option<QueryOptions>,
2312}
2313#[non_exhaustive]
2324#[derive(Clone, PartialEq, ::prost::Message)]
2325pub struct ListCheckpointsResponse {
2326 #[prost(message, optional, tag = "1")]
2328 pub checkpoint: ::core::option::Option<Checkpoint>,
2329 #[prost(message, optional, tag = "2")]
2333 pub watermark: ::core::option::Option<Watermark>,
2334 #[prost(message, optional, tag = "3")]
2336 pub end: ::core::option::Option<QueryEnd>,
2337}
2338#[non_exhaustive]
2340#[derive(Clone, PartialEq, ::prost::Message)]
2341pub struct ListTransactionsRequest {
2342 #[prost(message, optional, tag = "1")]
2345 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2346 #[prost(uint64, optional, tag = "2")]
2349 pub start_checkpoint: ::core::option::Option<u64>,
2350 #[prost(uint64, optional, tag = "3")]
2353 pub end_checkpoint: ::core::option::Option<u64>,
2354 #[prost(message, optional, tag = "4")]
2357 pub filter: ::core::option::Option<TransactionFilter>,
2358 #[prost(message, optional, tag = "5")]
2364 pub options: ::core::option::Option<QueryOptions>,
2365}
2366#[non_exhaustive]
2377#[derive(Clone, PartialEq, ::prost::Message)]
2378pub struct ListTransactionsResponse {
2379 #[prost(message, optional, tag = "1")]
2382 pub transaction: ::core::option::Option<ExecutedTransaction>,
2383 #[prost(message, optional, tag = "2")]
2387 pub watermark: ::core::option::Option<Watermark>,
2388 #[prost(message, optional, tag = "3")]
2390 pub end: ::core::option::Option<QueryEnd>,
2391}
2392#[non_exhaustive]
2394#[derive(Clone, PartialEq, ::prost::Message)]
2395pub struct ListEventsRequest {
2396 #[prost(message, optional, tag = "1")]
2398 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2399 #[prost(uint64, optional, tag = "2")]
2402 pub start_checkpoint: ::core::option::Option<u64>,
2403 #[prost(uint64, optional, tag = "3")]
2406 pub end_checkpoint: ::core::option::Option<u64>,
2407 #[prost(message, optional, tag = "4")]
2410 pub filter: ::core::option::Option<EventFilter>,
2411 #[prost(message, optional, tag = "5")]
2417 pub options: ::core::option::Option<QueryOptions>,
2418}
2419#[non_exhaustive]
2430#[derive(Clone, PartialEq, ::prost::Message)]
2431pub struct ListEventsResponse {
2432 #[prost(message, optional, tag = "1")]
2437 pub event: ::core::option::Option<Event>,
2438 #[prost(message, optional, tag = "2")]
2442 pub watermark: ::core::option::Option<Watermark>,
2443 #[prost(message, optional, tag = "3")]
2445 pub end: ::core::option::Option<QueryEnd>,
2446}
2447pub mod ledger_service_client {
2449 #![allow(
2450 unused_variables,
2451 dead_code,
2452 missing_docs,
2453 clippy::wildcard_imports,
2454 clippy::let_unit_value,
2455 )]
2456 use tonic::codegen::*;
2457 use tonic::codegen::http::Uri;
2458 #[derive(Debug, Clone)]
2459 pub struct LedgerServiceClient<T> {
2460 inner: tonic::client::Grpc<T>,
2461 }
2462 impl LedgerServiceClient<tonic::transport::Channel> {
2463 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2465 where
2466 D: TryInto<tonic::transport::Endpoint>,
2467 D::Error: Into<StdError>,
2468 {
2469 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2470 Ok(Self::new(conn))
2471 }
2472 }
2473 impl<T> LedgerServiceClient<T>
2474 where
2475 T: tonic::client::GrpcService<tonic::body::Body>,
2476 T::Error: Into<StdError>,
2477 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2478 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2479 {
2480 pub fn new(inner: T) -> Self {
2481 let inner = tonic::client::Grpc::new(inner);
2482 Self { inner }
2483 }
2484 pub fn with_origin(inner: T, origin: Uri) -> Self {
2485 let inner = tonic::client::Grpc::with_origin(inner, origin);
2486 Self { inner }
2487 }
2488 pub fn with_interceptor<F>(
2489 inner: T,
2490 interceptor: F,
2491 ) -> LedgerServiceClient<InterceptedService<T, F>>
2492 where
2493 F: tonic::service::Interceptor,
2494 T::ResponseBody: Default,
2495 T: tonic::codegen::Service<
2496 http::Request<tonic::body::Body>,
2497 Response = http::Response<
2498 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2499 >,
2500 >,
2501 <T as tonic::codegen::Service<
2502 http::Request<tonic::body::Body>,
2503 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2504 {
2505 LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
2506 }
2507 #[must_use]
2512 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2513 self.inner = self.inner.send_compressed(encoding);
2514 self
2515 }
2516 #[must_use]
2518 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2519 self.inner = self.inner.accept_compressed(encoding);
2520 self
2521 }
2522 #[must_use]
2526 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2527 self.inner = self.inner.max_decoding_message_size(limit);
2528 self
2529 }
2530 #[must_use]
2534 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2535 self.inner = self.inner.max_encoding_message_size(limit);
2536 self
2537 }
2538 pub async fn get_service_info(
2540 &mut self,
2541 request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
2542 ) -> std::result::Result<
2543 tonic::Response<super::GetServiceInfoResponse>,
2544 tonic::Status,
2545 > {
2546 self.inner
2547 .ready()
2548 .await
2549 .map_err(|e| {
2550 tonic::Status::unknown(
2551 format!("Service was not ready: {}", e.into()),
2552 )
2553 })?;
2554 let codec = tonic_prost::ProstCodec::default();
2555 let path = http::uri::PathAndQuery::from_static(
2556 "/sui.rpc.v2.LedgerService/GetServiceInfo",
2557 );
2558 let mut req = request.into_request();
2559 req.extensions_mut()
2560 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
2561 self.inner.unary(req, path, codec).await
2562 }
2563 pub async fn get_object(
2564 &mut self,
2565 request: impl tonic::IntoRequest<super::GetObjectRequest>,
2566 ) -> std::result::Result<
2567 tonic::Response<super::GetObjectResponse>,
2568 tonic::Status,
2569 > {
2570 self.inner
2571 .ready()
2572 .await
2573 .map_err(|e| {
2574 tonic::Status::unknown(
2575 format!("Service was not ready: {}", e.into()),
2576 )
2577 })?;
2578 let codec = tonic_prost::ProstCodec::default();
2579 let path = http::uri::PathAndQuery::from_static(
2580 "/sui.rpc.v2.LedgerService/GetObject",
2581 );
2582 let mut req = request.into_request();
2583 req.extensions_mut()
2584 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
2585 self.inner.unary(req, path, codec).await
2586 }
2587 pub async fn batch_get_objects(
2588 &mut self,
2589 request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
2590 ) -> std::result::Result<
2591 tonic::Response<super::BatchGetObjectsResponse>,
2592 tonic::Status,
2593 > {
2594 self.inner
2595 .ready()
2596 .await
2597 .map_err(|e| {
2598 tonic::Status::unknown(
2599 format!("Service was not ready: {}", e.into()),
2600 )
2601 })?;
2602 let codec = tonic_prost::ProstCodec::default();
2603 let path = http::uri::PathAndQuery::from_static(
2604 "/sui.rpc.v2.LedgerService/BatchGetObjects",
2605 );
2606 let mut req = request.into_request();
2607 req.extensions_mut()
2608 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
2609 self.inner.unary(req, path, codec).await
2610 }
2611 pub async fn get_transaction(
2612 &mut self,
2613 request: impl tonic::IntoRequest<super::GetTransactionRequest>,
2614 ) -> std::result::Result<
2615 tonic::Response<super::GetTransactionResponse>,
2616 tonic::Status,
2617 > {
2618 self.inner
2619 .ready()
2620 .await
2621 .map_err(|e| {
2622 tonic::Status::unknown(
2623 format!("Service was not ready: {}", e.into()),
2624 )
2625 })?;
2626 let codec = tonic_prost::ProstCodec::default();
2627 let path = http::uri::PathAndQuery::from_static(
2628 "/sui.rpc.v2.LedgerService/GetTransaction",
2629 );
2630 let mut req = request.into_request();
2631 req.extensions_mut()
2632 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
2633 self.inner.unary(req, path, codec).await
2634 }
2635 pub async fn batch_get_transactions(
2636 &mut self,
2637 request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
2638 ) -> std::result::Result<
2639 tonic::Response<super::BatchGetTransactionsResponse>,
2640 tonic::Status,
2641 > {
2642 self.inner
2643 .ready()
2644 .await
2645 .map_err(|e| {
2646 tonic::Status::unknown(
2647 format!("Service was not ready: {}", e.into()),
2648 )
2649 })?;
2650 let codec = tonic_prost::ProstCodec::default();
2651 let path = http::uri::PathAndQuery::from_static(
2652 "/sui.rpc.v2.LedgerService/BatchGetTransactions",
2653 );
2654 let mut req = request.into_request();
2655 req.extensions_mut()
2656 .insert(
2657 GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
2658 );
2659 self.inner.unary(req, path, codec).await
2660 }
2661 pub async fn get_checkpoint(
2662 &mut self,
2663 request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
2664 ) -> std::result::Result<
2665 tonic::Response<super::GetCheckpointResponse>,
2666 tonic::Status,
2667 > {
2668 self.inner
2669 .ready()
2670 .await
2671 .map_err(|e| {
2672 tonic::Status::unknown(
2673 format!("Service was not ready: {}", e.into()),
2674 )
2675 })?;
2676 let codec = tonic_prost::ProstCodec::default();
2677 let path = http::uri::PathAndQuery::from_static(
2678 "/sui.rpc.v2.LedgerService/GetCheckpoint",
2679 );
2680 let mut req = request.into_request();
2681 req.extensions_mut()
2682 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
2683 self.inner.unary(req, path, codec).await
2684 }
2685 pub async fn get_epoch(
2686 &mut self,
2687 request: impl tonic::IntoRequest<super::GetEpochRequest>,
2688 ) -> std::result::Result<
2689 tonic::Response<super::GetEpochResponse>,
2690 tonic::Status,
2691 > {
2692 self.inner
2693 .ready()
2694 .await
2695 .map_err(|e| {
2696 tonic::Status::unknown(
2697 format!("Service was not ready: {}", e.into()),
2698 )
2699 })?;
2700 let codec = tonic_prost::ProstCodec::default();
2701 let path = http::uri::PathAndQuery::from_static(
2702 "/sui.rpc.v2.LedgerService/GetEpoch",
2703 );
2704 let mut req = request.into_request();
2705 req.extensions_mut()
2706 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
2707 self.inner.unary(req, path, codec).await
2708 }
2709 pub async fn list_checkpoints(
2715 &mut self,
2716 request: impl tonic::IntoRequest<super::ListCheckpointsRequest>,
2717 ) -> std::result::Result<
2718 tonic::Response<tonic::codec::Streaming<super::ListCheckpointsResponse>>,
2719 tonic::Status,
2720 > {
2721 self.inner
2722 .ready()
2723 .await
2724 .map_err(|e| {
2725 tonic::Status::unknown(
2726 format!("Service was not ready: {}", e.into()),
2727 )
2728 })?;
2729 let codec = tonic_prost::ProstCodec::default();
2730 let path = http::uri::PathAndQuery::from_static(
2731 "/sui.rpc.v2.LedgerService/ListCheckpoints",
2732 );
2733 let mut req = request.into_request();
2734 req.extensions_mut()
2735 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListCheckpoints"));
2736 self.inner.server_streaming(req, path, codec).await
2737 }
2738 pub async fn list_transactions(
2743 &mut self,
2744 request: impl tonic::IntoRequest<super::ListTransactionsRequest>,
2745 ) -> std::result::Result<
2746 tonic::Response<tonic::codec::Streaming<super::ListTransactionsResponse>>,
2747 tonic::Status,
2748 > {
2749 self.inner
2750 .ready()
2751 .await
2752 .map_err(|e| {
2753 tonic::Status::unknown(
2754 format!("Service was not ready: {}", e.into()),
2755 )
2756 })?;
2757 let codec = tonic_prost::ProstCodec::default();
2758 let path = http::uri::PathAndQuery::from_static(
2759 "/sui.rpc.v2.LedgerService/ListTransactions",
2760 );
2761 let mut req = request.into_request();
2762 req.extensions_mut()
2763 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListTransactions"));
2764 self.inner.server_streaming(req, path, codec).await
2765 }
2766 pub async fn list_events(
2771 &mut self,
2772 request: impl tonic::IntoRequest<super::ListEventsRequest>,
2773 ) -> std::result::Result<
2774 tonic::Response<tonic::codec::Streaming<super::ListEventsResponse>>,
2775 tonic::Status,
2776 > {
2777 self.inner
2778 .ready()
2779 .await
2780 .map_err(|e| {
2781 tonic::Status::unknown(
2782 format!("Service was not ready: {}", e.into()),
2783 )
2784 })?;
2785 let codec = tonic_prost::ProstCodec::default();
2786 let path = http::uri::PathAndQuery::from_static(
2787 "/sui.rpc.v2.LedgerService/ListEvents",
2788 );
2789 let mut req = request.into_request();
2790 req.extensions_mut()
2791 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListEvents"));
2792 self.inner.server_streaming(req, path, codec).await
2793 }
2794 }
2795}
2796pub mod ledger_service_server {
2798 #![allow(
2799 unused_variables,
2800 dead_code,
2801 missing_docs,
2802 clippy::wildcard_imports,
2803 clippy::let_unit_value,
2804 )]
2805 use tonic::codegen::*;
2806 #[async_trait]
2808 pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2809 async fn get_service_info(
2811 &self,
2812 request: tonic::Request<super::GetServiceInfoRequest>,
2813 ) -> std::result::Result<
2814 tonic::Response<super::GetServiceInfoResponse>,
2815 tonic::Status,
2816 > {
2817 Err(tonic::Status::unimplemented("Not yet implemented"))
2818 }
2819 async fn get_object(
2820 &self,
2821 request: tonic::Request<super::GetObjectRequest>,
2822 ) -> std::result::Result<
2823 tonic::Response<super::GetObjectResponse>,
2824 tonic::Status,
2825 > {
2826 Err(tonic::Status::unimplemented("Not yet implemented"))
2827 }
2828 async fn batch_get_objects(
2829 &self,
2830 request: tonic::Request<super::BatchGetObjectsRequest>,
2831 ) -> std::result::Result<
2832 tonic::Response<super::BatchGetObjectsResponse>,
2833 tonic::Status,
2834 > {
2835 Err(tonic::Status::unimplemented("Not yet implemented"))
2836 }
2837 async fn get_transaction(
2838 &self,
2839 request: tonic::Request<super::GetTransactionRequest>,
2840 ) -> std::result::Result<
2841 tonic::Response<super::GetTransactionResponse>,
2842 tonic::Status,
2843 > {
2844 Err(tonic::Status::unimplemented("Not yet implemented"))
2845 }
2846 async fn batch_get_transactions(
2847 &self,
2848 request: tonic::Request<super::BatchGetTransactionsRequest>,
2849 ) -> std::result::Result<
2850 tonic::Response<super::BatchGetTransactionsResponse>,
2851 tonic::Status,
2852 > {
2853 Err(tonic::Status::unimplemented("Not yet implemented"))
2854 }
2855 async fn get_checkpoint(
2856 &self,
2857 request: tonic::Request<super::GetCheckpointRequest>,
2858 ) -> std::result::Result<
2859 tonic::Response<super::GetCheckpointResponse>,
2860 tonic::Status,
2861 > {
2862 Err(tonic::Status::unimplemented("Not yet implemented"))
2863 }
2864 async fn get_epoch(
2865 &self,
2866 request: tonic::Request<super::GetEpochRequest>,
2867 ) -> std::result::Result<
2868 tonic::Response<super::GetEpochResponse>,
2869 tonic::Status,
2870 > {
2871 Err(tonic::Status::unimplemented("Not yet implemented"))
2872 }
2873 async fn list_checkpoints(
2879 &self,
2880 request: tonic::Request<super::ListCheckpointsRequest>,
2881 ) -> std::result::Result<
2882 tonic::Response<BoxStream<super::ListCheckpointsResponse>>,
2883 tonic::Status,
2884 > {
2885 Err(tonic::Status::unimplemented("Not yet implemented"))
2886 }
2887 async fn list_transactions(
2892 &self,
2893 request: tonic::Request<super::ListTransactionsRequest>,
2894 ) -> std::result::Result<
2895 tonic::Response<BoxStream<super::ListTransactionsResponse>>,
2896 tonic::Status,
2897 > {
2898 Err(tonic::Status::unimplemented("Not yet implemented"))
2899 }
2900 async fn list_events(
2905 &self,
2906 request: tonic::Request<super::ListEventsRequest>,
2907 ) -> std::result::Result<
2908 tonic::Response<BoxStream<super::ListEventsResponse>>,
2909 tonic::Status,
2910 > {
2911 Err(tonic::Status::unimplemented("Not yet implemented"))
2912 }
2913 }
2914 #[derive(Debug)]
2915 pub struct LedgerServiceServer<T> {
2916 inner: Arc<T>,
2917 accept_compression_encodings: EnabledCompressionEncodings,
2918 send_compression_encodings: EnabledCompressionEncodings,
2919 max_decoding_message_size: Option<usize>,
2920 max_encoding_message_size: Option<usize>,
2921 }
2922 impl<T> LedgerServiceServer<T> {
2923 pub fn new(inner: T) -> Self {
2924 Self::from_arc(Arc::new(inner))
2925 }
2926 pub fn from_arc(inner: Arc<T>) -> Self {
2927 Self {
2928 inner,
2929 accept_compression_encodings: Default::default(),
2930 send_compression_encodings: Default::default(),
2931 max_decoding_message_size: None,
2932 max_encoding_message_size: None,
2933 }
2934 }
2935 pub fn with_interceptor<F>(
2936 inner: T,
2937 interceptor: F,
2938 ) -> InterceptedService<Self, F>
2939 where
2940 F: tonic::service::Interceptor,
2941 {
2942 InterceptedService::new(Self::new(inner), interceptor)
2943 }
2944 #[must_use]
2946 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2947 self.accept_compression_encodings.enable(encoding);
2948 self
2949 }
2950 #[must_use]
2952 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2953 self.send_compression_encodings.enable(encoding);
2954 self
2955 }
2956 #[must_use]
2960 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2961 self.max_decoding_message_size = Some(limit);
2962 self
2963 }
2964 #[must_use]
2968 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2969 self.max_encoding_message_size = Some(limit);
2970 self
2971 }
2972 }
2973 impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
2974 where
2975 T: LedgerService,
2976 B: Body + std::marker::Send + 'static,
2977 B::Error: Into<StdError> + std::marker::Send + 'static,
2978 {
2979 type Response = http::Response<tonic::body::Body>;
2980 type Error = std::convert::Infallible;
2981 type Future = BoxFuture<Self::Response, Self::Error>;
2982 fn poll_ready(
2983 &mut self,
2984 _cx: &mut Context<'_>,
2985 ) -> Poll<std::result::Result<(), Self::Error>> {
2986 Poll::Ready(Ok(()))
2987 }
2988 fn call(&mut self, req: http::Request<B>) -> Self::Future {
2989 match req.uri().path() {
2990 "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
2991 #[allow(non_camel_case_types)]
2992 struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
2993 impl<
2994 T: LedgerService,
2995 > tonic::server::UnaryService<super::GetServiceInfoRequest>
2996 for GetServiceInfoSvc<T> {
2997 type Response = super::GetServiceInfoResponse;
2998 type Future = BoxFuture<
2999 tonic::Response<Self::Response>,
3000 tonic::Status,
3001 >;
3002 fn call(
3003 &mut self,
3004 request: tonic::Request<super::GetServiceInfoRequest>,
3005 ) -> Self::Future {
3006 let inner = Arc::clone(&self.0);
3007 let fut = async move {
3008 <T as LedgerService>::get_service_info(&inner, request)
3009 .await
3010 };
3011 Box::pin(fut)
3012 }
3013 }
3014 let accept_compression_encodings = self.accept_compression_encodings;
3015 let send_compression_encodings = self.send_compression_encodings;
3016 let max_decoding_message_size = self.max_decoding_message_size;
3017 let max_encoding_message_size = self.max_encoding_message_size;
3018 let inner = self.inner.clone();
3019 let fut = async move {
3020 let method = GetServiceInfoSvc(inner);
3021 let codec = tonic_prost::ProstCodec::default();
3022 let mut grpc = tonic::server::Grpc::new(codec)
3023 .apply_compression_config(
3024 accept_compression_encodings,
3025 send_compression_encodings,
3026 )
3027 .apply_max_message_size_config(
3028 max_decoding_message_size,
3029 max_encoding_message_size,
3030 );
3031 let res = grpc.unary(method, req).await;
3032 Ok(res)
3033 };
3034 Box::pin(fut)
3035 }
3036 "/sui.rpc.v2.LedgerService/GetObject" => {
3037 #[allow(non_camel_case_types)]
3038 struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
3039 impl<
3040 T: LedgerService,
3041 > tonic::server::UnaryService<super::GetObjectRequest>
3042 for GetObjectSvc<T> {
3043 type Response = super::GetObjectResponse;
3044 type Future = BoxFuture<
3045 tonic::Response<Self::Response>,
3046 tonic::Status,
3047 >;
3048 fn call(
3049 &mut self,
3050 request: tonic::Request<super::GetObjectRequest>,
3051 ) -> Self::Future {
3052 let inner = Arc::clone(&self.0);
3053 let fut = async move {
3054 <T as LedgerService>::get_object(&inner, request).await
3055 };
3056 Box::pin(fut)
3057 }
3058 }
3059 let accept_compression_encodings = self.accept_compression_encodings;
3060 let send_compression_encodings = self.send_compression_encodings;
3061 let max_decoding_message_size = self.max_decoding_message_size;
3062 let max_encoding_message_size = self.max_encoding_message_size;
3063 let inner = self.inner.clone();
3064 let fut = async move {
3065 let method = GetObjectSvc(inner);
3066 let codec = tonic_prost::ProstCodec::default();
3067 let mut grpc = tonic::server::Grpc::new(codec)
3068 .apply_compression_config(
3069 accept_compression_encodings,
3070 send_compression_encodings,
3071 )
3072 .apply_max_message_size_config(
3073 max_decoding_message_size,
3074 max_encoding_message_size,
3075 );
3076 let res = grpc.unary(method, req).await;
3077 Ok(res)
3078 };
3079 Box::pin(fut)
3080 }
3081 "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
3082 #[allow(non_camel_case_types)]
3083 struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
3084 impl<
3085 T: LedgerService,
3086 > tonic::server::UnaryService<super::BatchGetObjectsRequest>
3087 for BatchGetObjectsSvc<T> {
3088 type Response = super::BatchGetObjectsResponse;
3089 type Future = BoxFuture<
3090 tonic::Response<Self::Response>,
3091 tonic::Status,
3092 >;
3093 fn call(
3094 &mut self,
3095 request: tonic::Request<super::BatchGetObjectsRequest>,
3096 ) -> Self::Future {
3097 let inner = Arc::clone(&self.0);
3098 let fut = async move {
3099 <T as LedgerService>::batch_get_objects(&inner, request)
3100 .await
3101 };
3102 Box::pin(fut)
3103 }
3104 }
3105 let accept_compression_encodings = self.accept_compression_encodings;
3106 let send_compression_encodings = self.send_compression_encodings;
3107 let max_decoding_message_size = self.max_decoding_message_size;
3108 let max_encoding_message_size = self.max_encoding_message_size;
3109 let inner = self.inner.clone();
3110 let fut = async move {
3111 let method = BatchGetObjectsSvc(inner);
3112 let codec = tonic_prost::ProstCodec::default();
3113 let mut grpc = tonic::server::Grpc::new(codec)
3114 .apply_compression_config(
3115 accept_compression_encodings,
3116 send_compression_encodings,
3117 )
3118 .apply_max_message_size_config(
3119 max_decoding_message_size,
3120 max_encoding_message_size,
3121 );
3122 let res = grpc.unary(method, req).await;
3123 Ok(res)
3124 };
3125 Box::pin(fut)
3126 }
3127 "/sui.rpc.v2.LedgerService/GetTransaction" => {
3128 #[allow(non_camel_case_types)]
3129 struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
3130 impl<
3131 T: LedgerService,
3132 > tonic::server::UnaryService<super::GetTransactionRequest>
3133 for GetTransactionSvc<T> {
3134 type Response = super::GetTransactionResponse;
3135 type Future = BoxFuture<
3136 tonic::Response<Self::Response>,
3137 tonic::Status,
3138 >;
3139 fn call(
3140 &mut self,
3141 request: tonic::Request<super::GetTransactionRequest>,
3142 ) -> Self::Future {
3143 let inner = Arc::clone(&self.0);
3144 let fut = async move {
3145 <T as LedgerService>::get_transaction(&inner, request).await
3146 };
3147 Box::pin(fut)
3148 }
3149 }
3150 let accept_compression_encodings = self.accept_compression_encodings;
3151 let send_compression_encodings = self.send_compression_encodings;
3152 let max_decoding_message_size = self.max_decoding_message_size;
3153 let max_encoding_message_size = self.max_encoding_message_size;
3154 let inner = self.inner.clone();
3155 let fut = async move {
3156 let method = GetTransactionSvc(inner);
3157 let codec = tonic_prost::ProstCodec::default();
3158 let mut grpc = tonic::server::Grpc::new(codec)
3159 .apply_compression_config(
3160 accept_compression_encodings,
3161 send_compression_encodings,
3162 )
3163 .apply_max_message_size_config(
3164 max_decoding_message_size,
3165 max_encoding_message_size,
3166 );
3167 let res = grpc.unary(method, req).await;
3168 Ok(res)
3169 };
3170 Box::pin(fut)
3171 }
3172 "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
3173 #[allow(non_camel_case_types)]
3174 struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
3175 impl<
3176 T: LedgerService,
3177 > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
3178 for BatchGetTransactionsSvc<T> {
3179 type Response = super::BatchGetTransactionsResponse;
3180 type Future = BoxFuture<
3181 tonic::Response<Self::Response>,
3182 tonic::Status,
3183 >;
3184 fn call(
3185 &mut self,
3186 request: tonic::Request<super::BatchGetTransactionsRequest>,
3187 ) -> Self::Future {
3188 let inner = Arc::clone(&self.0);
3189 let fut = async move {
3190 <T as LedgerService>::batch_get_transactions(
3191 &inner,
3192 request,
3193 )
3194 .await
3195 };
3196 Box::pin(fut)
3197 }
3198 }
3199 let accept_compression_encodings = self.accept_compression_encodings;
3200 let send_compression_encodings = self.send_compression_encodings;
3201 let max_decoding_message_size = self.max_decoding_message_size;
3202 let max_encoding_message_size = self.max_encoding_message_size;
3203 let inner = self.inner.clone();
3204 let fut = async move {
3205 let method = BatchGetTransactionsSvc(inner);
3206 let codec = tonic_prost::ProstCodec::default();
3207 let mut grpc = tonic::server::Grpc::new(codec)
3208 .apply_compression_config(
3209 accept_compression_encodings,
3210 send_compression_encodings,
3211 )
3212 .apply_max_message_size_config(
3213 max_decoding_message_size,
3214 max_encoding_message_size,
3215 );
3216 let res = grpc.unary(method, req).await;
3217 Ok(res)
3218 };
3219 Box::pin(fut)
3220 }
3221 "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
3222 #[allow(non_camel_case_types)]
3223 struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
3224 impl<
3225 T: LedgerService,
3226 > tonic::server::UnaryService<super::GetCheckpointRequest>
3227 for GetCheckpointSvc<T> {
3228 type Response = super::GetCheckpointResponse;
3229 type Future = BoxFuture<
3230 tonic::Response<Self::Response>,
3231 tonic::Status,
3232 >;
3233 fn call(
3234 &mut self,
3235 request: tonic::Request<super::GetCheckpointRequest>,
3236 ) -> Self::Future {
3237 let inner = Arc::clone(&self.0);
3238 let fut = async move {
3239 <T as LedgerService>::get_checkpoint(&inner, request).await
3240 };
3241 Box::pin(fut)
3242 }
3243 }
3244 let accept_compression_encodings = self.accept_compression_encodings;
3245 let send_compression_encodings = self.send_compression_encodings;
3246 let max_decoding_message_size = self.max_decoding_message_size;
3247 let max_encoding_message_size = self.max_encoding_message_size;
3248 let inner = self.inner.clone();
3249 let fut = async move {
3250 let method = GetCheckpointSvc(inner);
3251 let codec = tonic_prost::ProstCodec::default();
3252 let mut grpc = tonic::server::Grpc::new(codec)
3253 .apply_compression_config(
3254 accept_compression_encodings,
3255 send_compression_encodings,
3256 )
3257 .apply_max_message_size_config(
3258 max_decoding_message_size,
3259 max_encoding_message_size,
3260 );
3261 let res = grpc.unary(method, req).await;
3262 Ok(res)
3263 };
3264 Box::pin(fut)
3265 }
3266 "/sui.rpc.v2.LedgerService/GetEpoch" => {
3267 #[allow(non_camel_case_types)]
3268 struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
3269 impl<
3270 T: LedgerService,
3271 > tonic::server::UnaryService<super::GetEpochRequest>
3272 for GetEpochSvc<T> {
3273 type Response = super::GetEpochResponse;
3274 type Future = BoxFuture<
3275 tonic::Response<Self::Response>,
3276 tonic::Status,
3277 >;
3278 fn call(
3279 &mut self,
3280 request: tonic::Request<super::GetEpochRequest>,
3281 ) -> Self::Future {
3282 let inner = Arc::clone(&self.0);
3283 let fut = async move {
3284 <T as LedgerService>::get_epoch(&inner, request).await
3285 };
3286 Box::pin(fut)
3287 }
3288 }
3289 let accept_compression_encodings = self.accept_compression_encodings;
3290 let send_compression_encodings = self.send_compression_encodings;
3291 let max_decoding_message_size = self.max_decoding_message_size;
3292 let max_encoding_message_size = self.max_encoding_message_size;
3293 let inner = self.inner.clone();
3294 let fut = async move {
3295 let method = GetEpochSvc(inner);
3296 let codec = tonic_prost::ProstCodec::default();
3297 let mut grpc = tonic::server::Grpc::new(codec)
3298 .apply_compression_config(
3299 accept_compression_encodings,
3300 send_compression_encodings,
3301 )
3302 .apply_max_message_size_config(
3303 max_decoding_message_size,
3304 max_encoding_message_size,
3305 );
3306 let res = grpc.unary(method, req).await;
3307 Ok(res)
3308 };
3309 Box::pin(fut)
3310 }
3311 "/sui.rpc.v2.LedgerService/ListCheckpoints" => {
3312 #[allow(non_camel_case_types)]
3313 struct ListCheckpointsSvc<T: LedgerService>(pub Arc<T>);
3314 impl<
3315 T: LedgerService,
3316 > tonic::server::ServerStreamingService<
3317 super::ListCheckpointsRequest,
3318 > for ListCheckpointsSvc<T> {
3319 type Response = super::ListCheckpointsResponse;
3320 type ResponseStream = BoxStream<super::ListCheckpointsResponse>;
3321 type Future = BoxFuture<
3322 tonic::Response<Self::ResponseStream>,
3323 tonic::Status,
3324 >;
3325 fn call(
3326 &mut self,
3327 request: tonic::Request<super::ListCheckpointsRequest>,
3328 ) -> Self::Future {
3329 let inner = Arc::clone(&self.0);
3330 let fut = async move {
3331 <T as LedgerService>::list_checkpoints(&inner, request)
3332 .await
3333 };
3334 Box::pin(fut)
3335 }
3336 }
3337 let accept_compression_encodings = self.accept_compression_encodings;
3338 let send_compression_encodings = self.send_compression_encodings;
3339 let max_decoding_message_size = self.max_decoding_message_size;
3340 let max_encoding_message_size = self.max_encoding_message_size;
3341 let inner = self.inner.clone();
3342 let fut = async move {
3343 let method = ListCheckpointsSvc(inner);
3344 let codec = tonic_prost::ProstCodec::default();
3345 let mut grpc = tonic::server::Grpc::new(codec)
3346 .apply_compression_config(
3347 accept_compression_encodings,
3348 send_compression_encodings,
3349 )
3350 .apply_max_message_size_config(
3351 max_decoding_message_size,
3352 max_encoding_message_size,
3353 );
3354 let res = grpc.server_streaming(method, req).await;
3355 Ok(res)
3356 };
3357 Box::pin(fut)
3358 }
3359 "/sui.rpc.v2.LedgerService/ListTransactions" => {
3360 #[allow(non_camel_case_types)]
3361 struct ListTransactionsSvc<T: LedgerService>(pub Arc<T>);
3362 impl<
3363 T: LedgerService,
3364 > tonic::server::ServerStreamingService<
3365 super::ListTransactionsRequest,
3366 > for ListTransactionsSvc<T> {
3367 type Response = super::ListTransactionsResponse;
3368 type ResponseStream = BoxStream<super::ListTransactionsResponse>;
3369 type Future = BoxFuture<
3370 tonic::Response<Self::ResponseStream>,
3371 tonic::Status,
3372 >;
3373 fn call(
3374 &mut self,
3375 request: tonic::Request<super::ListTransactionsRequest>,
3376 ) -> Self::Future {
3377 let inner = Arc::clone(&self.0);
3378 let fut = async move {
3379 <T as LedgerService>::list_transactions(&inner, request)
3380 .await
3381 };
3382 Box::pin(fut)
3383 }
3384 }
3385 let accept_compression_encodings = self.accept_compression_encodings;
3386 let send_compression_encodings = self.send_compression_encodings;
3387 let max_decoding_message_size = self.max_decoding_message_size;
3388 let max_encoding_message_size = self.max_encoding_message_size;
3389 let inner = self.inner.clone();
3390 let fut = async move {
3391 let method = ListTransactionsSvc(inner);
3392 let codec = tonic_prost::ProstCodec::default();
3393 let mut grpc = tonic::server::Grpc::new(codec)
3394 .apply_compression_config(
3395 accept_compression_encodings,
3396 send_compression_encodings,
3397 )
3398 .apply_max_message_size_config(
3399 max_decoding_message_size,
3400 max_encoding_message_size,
3401 );
3402 let res = grpc.server_streaming(method, req).await;
3403 Ok(res)
3404 };
3405 Box::pin(fut)
3406 }
3407 "/sui.rpc.v2.LedgerService/ListEvents" => {
3408 #[allow(non_camel_case_types)]
3409 struct ListEventsSvc<T: LedgerService>(pub Arc<T>);
3410 impl<
3411 T: LedgerService,
3412 > tonic::server::ServerStreamingService<super::ListEventsRequest>
3413 for ListEventsSvc<T> {
3414 type Response = super::ListEventsResponse;
3415 type ResponseStream = BoxStream<super::ListEventsResponse>;
3416 type Future = BoxFuture<
3417 tonic::Response<Self::ResponseStream>,
3418 tonic::Status,
3419 >;
3420 fn call(
3421 &mut self,
3422 request: tonic::Request<super::ListEventsRequest>,
3423 ) -> Self::Future {
3424 let inner = Arc::clone(&self.0);
3425 let fut = async move {
3426 <T as LedgerService>::list_events(&inner, request).await
3427 };
3428 Box::pin(fut)
3429 }
3430 }
3431 let accept_compression_encodings = self.accept_compression_encodings;
3432 let send_compression_encodings = self.send_compression_encodings;
3433 let max_decoding_message_size = self.max_decoding_message_size;
3434 let max_encoding_message_size = self.max_encoding_message_size;
3435 let inner = self.inner.clone();
3436 let fut = async move {
3437 let method = ListEventsSvc(inner);
3438 let codec = tonic_prost::ProstCodec::default();
3439 let mut grpc = tonic::server::Grpc::new(codec)
3440 .apply_compression_config(
3441 accept_compression_encodings,
3442 send_compression_encodings,
3443 )
3444 .apply_max_message_size_config(
3445 max_decoding_message_size,
3446 max_encoding_message_size,
3447 );
3448 let res = grpc.server_streaming(method, req).await;
3449 Ok(res)
3450 };
3451 Box::pin(fut)
3452 }
3453 _ => {
3454 Box::pin(async move {
3455 let mut response = http::Response::new(
3456 tonic::body::Body::default(),
3457 );
3458 let headers = response.headers_mut();
3459 headers
3460 .insert(
3461 tonic::Status::GRPC_STATUS,
3462 (tonic::Code::Unimplemented as i32).into(),
3463 );
3464 headers
3465 .insert(
3466 http::header::CONTENT_TYPE,
3467 tonic::metadata::GRPC_CONTENT_TYPE,
3468 );
3469 Ok(response)
3470 })
3471 }
3472 }
3473 }
3474 }
3475 impl<T> Clone for LedgerServiceServer<T> {
3476 fn clone(&self) -> Self {
3477 let inner = self.inner.clone();
3478 Self {
3479 inner,
3480 accept_compression_encodings: self.accept_compression_encodings,
3481 send_compression_encodings: self.send_compression_encodings,
3482 max_decoding_message_size: self.max_decoding_message_size,
3483 max_encoding_message_size: self.max_encoding_message_size,
3484 }
3485 }
3486 }
3487 pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
3489 impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
3490 const NAME: &'static str = SERVICE_NAME;
3491 }
3492}
3493#[non_exhaustive]
3495#[derive(Clone, PartialEq, ::prost::Message)]
3496pub struct Package {
3497 #[prost(string, optional, tag = "1")]
3503 pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
3504 #[prost(string, optional, tag = "2")]
3511 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3512 #[prost(uint64, optional, tag = "3")]
3514 pub version: ::core::option::Option<u64>,
3515 #[prost(message, repeated, tag = "4")]
3517 pub modules: ::prost::alloc::vec::Vec<Module>,
3518 #[prost(message, repeated, tag = "5")]
3521 pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
3522 #[prost(message, repeated, tag = "6")]
3526 pub linkage: ::prost::alloc::vec::Vec<Linkage>,
3527}
3528#[non_exhaustive]
3530#[derive(Clone, PartialEq, ::prost::Message)]
3531pub struct Module {
3532 #[prost(string, optional, tag = "1")]
3534 pub name: ::core::option::Option<::prost::alloc::string::String>,
3535 #[prost(bytes = "bytes", optional, tag = "2")]
3537 pub contents: ::core::option::Option<::prost::bytes::Bytes>,
3538 #[prost(message, repeated, tag = "3")]
3540 pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
3541 #[prost(message, repeated, tag = "4")]
3543 pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
3544}
3545#[non_exhaustive]
3547#[derive(Clone, PartialEq, ::prost::Message)]
3548pub struct DatatypeDescriptor {
3549 #[prost(string, optional, tag = "1")]
3553 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3554 #[prost(string, optional, tag = "2")]
3558 pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
3559 #[prost(string, optional, tag = "3")]
3561 pub module: ::core::option::Option<::prost::alloc::string::String>,
3562 #[prost(string, optional, tag = "4")]
3564 pub name: ::core::option::Option<::prost::alloc::string::String>,
3565 #[prost(enumeration = "Ability", repeated, tag = "5")]
3567 pub abilities: ::prost::alloc::vec::Vec<i32>,
3568 #[prost(message, repeated, tag = "6")]
3570 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3571 #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
3573 pub kind: ::core::option::Option<i32>,
3574 #[prost(message, repeated, tag = "8")]
3578 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3579 #[prost(message, repeated, tag = "9")]
3583 pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
3584}
3585pub mod datatype_descriptor {
3587 #[non_exhaustive]
3588 #[derive(
3589 Clone,
3590 Copy,
3591 Debug,
3592 PartialEq,
3593 Eq,
3594 Hash,
3595 PartialOrd,
3596 Ord,
3597 ::prost::Enumeration
3598 )]
3599 #[repr(i32)]
3600 pub enum DatatypeKind {
3601 Unknown = 0,
3602 Struct = 1,
3603 Enum = 2,
3604 }
3605 impl DatatypeKind {
3606 pub fn as_str_name(&self) -> &'static str {
3611 match self {
3612 Self::Unknown => "DATATYPE_KIND_UNKNOWN",
3613 Self::Struct => "STRUCT",
3614 Self::Enum => "ENUM",
3615 }
3616 }
3617 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3619 match value {
3620 "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
3621 "STRUCT" => Some(Self::Struct),
3622 "ENUM" => Some(Self::Enum),
3623 _ => None,
3624 }
3625 }
3626 }
3627}
3628#[non_exhaustive]
3630#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3631pub struct TypeParameter {
3632 #[prost(enumeration = "Ability", repeated, tag = "1")]
3634 pub constraints: ::prost::alloc::vec::Vec<i32>,
3635 #[prost(bool, optional, tag = "2")]
3637 pub is_phantom: ::core::option::Option<bool>,
3638}
3639#[non_exhaustive]
3641#[derive(Clone, PartialEq, ::prost::Message)]
3642pub struct FieldDescriptor {
3643 #[prost(string, optional, tag = "1")]
3645 pub name: ::core::option::Option<::prost::alloc::string::String>,
3646 #[prost(uint32, optional, tag = "2")]
3648 pub position: ::core::option::Option<u32>,
3649 #[prost(message, optional, tag = "3")]
3651 pub r#type: ::core::option::Option<OpenSignatureBody>,
3652}
3653#[non_exhaustive]
3655#[derive(Clone, PartialEq, ::prost::Message)]
3656pub struct VariantDescriptor {
3657 #[prost(string, optional, tag = "1")]
3659 pub name: ::core::option::Option<::prost::alloc::string::String>,
3660 #[prost(uint32, optional, tag = "2")]
3662 pub position: ::core::option::Option<u32>,
3663 #[prost(message, repeated, tag = "3")]
3665 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3666}
3667#[non_exhaustive]
3669#[derive(Clone, PartialEq, ::prost::Message)]
3670pub struct OpenSignatureBody {
3671 #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
3673 pub r#type: ::core::option::Option<i32>,
3674 #[prost(string, optional, tag = "2")]
3676 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3677 #[prost(message, repeated, tag = "3")]
3679 pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
3680 #[prost(uint32, optional, tag = "4")]
3682 pub type_parameter: ::core::option::Option<u32>,
3683}
3684pub mod open_signature_body {
3686 #[non_exhaustive]
3687 #[derive(
3688 Clone,
3689 Copy,
3690 Debug,
3691 PartialEq,
3692 Eq,
3693 Hash,
3694 PartialOrd,
3695 Ord,
3696 ::prost::Enumeration
3697 )]
3698 #[repr(i32)]
3699 pub enum Type {
3700 Unknown = 0,
3701 Address = 1,
3702 Bool = 2,
3703 U8 = 3,
3704 U16 = 4,
3705 U32 = 5,
3706 U64 = 6,
3707 U128 = 7,
3708 U256 = 8,
3709 Vector = 9,
3710 Datatype = 10,
3711 Parameter = 11,
3712 }
3713 impl Type {
3714 pub fn as_str_name(&self) -> &'static str {
3719 match self {
3720 Self::Unknown => "TYPE_UNKNOWN",
3721 Self::Address => "ADDRESS",
3722 Self::Bool => "BOOL",
3723 Self::U8 => "U8",
3724 Self::U16 => "U16",
3725 Self::U32 => "U32",
3726 Self::U64 => "U64",
3727 Self::U128 => "U128",
3728 Self::U256 => "U256",
3729 Self::Vector => "VECTOR",
3730 Self::Datatype => "DATATYPE",
3731 Self::Parameter => "TYPE_PARAMETER",
3732 }
3733 }
3734 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3736 match value {
3737 "TYPE_UNKNOWN" => Some(Self::Unknown),
3738 "ADDRESS" => Some(Self::Address),
3739 "BOOL" => Some(Self::Bool),
3740 "U8" => Some(Self::U8),
3741 "U16" => Some(Self::U16),
3742 "U32" => Some(Self::U32),
3743 "U64" => Some(Self::U64),
3744 "U128" => Some(Self::U128),
3745 "U256" => Some(Self::U256),
3746 "VECTOR" => Some(Self::Vector),
3747 "DATATYPE" => Some(Self::Datatype),
3748 "TYPE_PARAMETER" => Some(Self::Parameter),
3749 _ => None,
3750 }
3751 }
3752 }
3753}
3754#[non_exhaustive]
3756#[derive(Clone, PartialEq, ::prost::Message)]
3757pub struct FunctionDescriptor {
3758 #[prost(string, optional, tag = "1")]
3760 pub name: ::core::option::Option<::prost::alloc::string::String>,
3761 #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
3763 pub visibility: ::core::option::Option<i32>,
3764 #[prost(bool, optional, tag = "6")]
3766 pub is_entry: ::core::option::Option<bool>,
3767 #[prost(message, repeated, tag = "7")]
3769 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3770 #[prost(message, repeated, tag = "8")]
3772 pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
3773 #[prost(message, repeated, tag = "9")]
3775 pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
3776}
3777pub mod function_descriptor {
3779 #[non_exhaustive]
3780 #[derive(
3781 Clone,
3782 Copy,
3783 Debug,
3784 PartialEq,
3785 Eq,
3786 Hash,
3787 PartialOrd,
3788 Ord,
3789 ::prost::Enumeration
3790 )]
3791 #[repr(i32)]
3792 pub enum Visibility {
3793 Unknown = 0,
3794 Private = 1,
3795 Public = 2,
3796 Friend = 3,
3797 }
3798 impl Visibility {
3799 pub fn as_str_name(&self) -> &'static str {
3804 match self {
3805 Self::Unknown => "VISIBILITY_UNKNOWN",
3806 Self::Private => "PRIVATE",
3807 Self::Public => "PUBLIC",
3808 Self::Friend => "FRIEND",
3809 }
3810 }
3811 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3813 match value {
3814 "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
3815 "PRIVATE" => Some(Self::Private),
3816 "PUBLIC" => Some(Self::Public),
3817 "FRIEND" => Some(Self::Friend),
3818 _ => None,
3819 }
3820 }
3821 }
3822}
3823#[non_exhaustive]
3825#[derive(Clone, PartialEq, ::prost::Message)]
3826pub struct OpenSignature {
3827 #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
3828 pub reference: ::core::option::Option<i32>,
3829 #[prost(message, optional, tag = "2")]
3830 pub body: ::core::option::Option<OpenSignatureBody>,
3831}
3832pub mod open_signature {
3834 #[non_exhaustive]
3835 #[derive(
3836 Clone,
3837 Copy,
3838 Debug,
3839 PartialEq,
3840 Eq,
3841 Hash,
3842 PartialOrd,
3843 Ord,
3844 ::prost::Enumeration
3845 )]
3846 #[repr(i32)]
3847 pub enum Reference {
3848 Unknown = 0,
3849 Immutable = 1,
3850 Mutable = 2,
3851 }
3852 impl Reference {
3853 pub fn as_str_name(&self) -> &'static str {
3858 match self {
3859 Self::Unknown => "REFERENCE_UNKNOWN",
3860 Self::Immutable => "IMMUTABLE",
3861 Self::Mutable => "MUTABLE",
3862 }
3863 }
3864 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3866 match value {
3867 "REFERENCE_UNKNOWN" => Some(Self::Unknown),
3868 "IMMUTABLE" => Some(Self::Immutable),
3869 "MUTABLE" => Some(Self::Mutable),
3870 _ => None,
3871 }
3872 }
3873 }
3874}
3875#[non_exhaustive]
3877#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3878pub struct TypeOrigin {
3879 #[prost(string, optional, tag = "1")]
3880 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3881 #[prost(string, optional, tag = "2")]
3882 pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
3883 #[prost(string, optional, tag = "3")]
3884 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3885}
3886#[non_exhaustive]
3888#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3889pub struct Linkage {
3890 #[prost(string, optional, tag = "1")]
3892 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3893 #[prost(string, optional, tag = "2")]
3895 pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
3896 #[prost(uint64, optional, tag = "3")]
3898 pub upgraded_version: ::core::option::Option<u64>,
3899}
3900#[non_exhaustive]
3902#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3903#[repr(i32)]
3904pub enum Ability {
3905 Unknown = 0,
3906 Copy = 1,
3908 Drop = 2,
3910 Store = 3,
3912 Key = 4,
3914}
3915impl Ability {
3916 pub fn as_str_name(&self) -> &'static str {
3921 match self {
3922 Self::Unknown => "ABILITY_UNKNOWN",
3923 Self::Copy => "COPY",
3924 Self::Drop => "DROP",
3925 Self::Store => "STORE",
3926 Self::Key => "KEY",
3927 }
3928 }
3929 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3931 match value {
3932 "ABILITY_UNKNOWN" => Some(Self::Unknown),
3933 "COPY" => Some(Self::Copy),
3934 "DROP" => Some(Self::Drop),
3935 "STORE" => Some(Self::Store),
3936 "KEY" => Some(Self::Key),
3937 _ => None,
3938 }
3939 }
3940}
3941#[non_exhaustive]
3942#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3943pub struct GetPackageRequest {
3944 #[prost(string, optional, tag = "1")]
3951 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3952 #[prost(oneof = "get_package_request::Selector", tags = "2, 3")]
3965 pub selector: ::core::option::Option<get_package_request::Selector>,
3966}
3967pub mod get_package_request {
3969 #[non_exhaustive]
3982 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
3983 pub enum Selector {
3984 #[prost(uint64, tag = "2")]
3985 Version(u64),
3986 #[prost(uint64, tag = "3")]
3987 AtCheckpoint(u64),
3988 }
3989}
3990#[non_exhaustive]
3991#[derive(Clone, PartialEq, ::prost::Message)]
3992pub struct GetPackageResponse {
3993 #[prost(message, optional, tag = "1")]
3995 pub package: ::core::option::Option<Package>,
3996}
3997#[non_exhaustive]
3998#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3999pub struct GetDatatypeRequest {
4000 #[prost(string, optional, tag = "1")]
4002 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4003 #[prost(string, optional, tag = "2")]
4005 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4006 #[prost(string, optional, tag = "3")]
4008 pub name: ::core::option::Option<::prost::alloc::string::String>,
4009}
4010#[non_exhaustive]
4011#[derive(Clone, PartialEq, ::prost::Message)]
4012pub struct GetDatatypeResponse {
4013 #[prost(message, optional, tag = "1")]
4015 pub datatype: ::core::option::Option<DatatypeDescriptor>,
4016}
4017#[non_exhaustive]
4018#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4019pub struct GetFunctionRequest {
4020 #[prost(string, optional, tag = "1")]
4022 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4023 #[prost(string, optional, tag = "2")]
4025 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4026 #[prost(string, optional, tag = "3")]
4028 pub name: ::core::option::Option<::prost::alloc::string::String>,
4029}
4030#[non_exhaustive]
4031#[derive(Clone, PartialEq, ::prost::Message)]
4032pub struct GetFunctionResponse {
4033 #[prost(message, optional, tag = "1")]
4035 pub function: ::core::option::Option<FunctionDescriptor>,
4036}
4037#[non_exhaustive]
4038#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4039pub struct ListPackageVersionsRequest {
4040 #[prost(string, optional, tag = "1")]
4042 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4043 #[prost(uint32, optional, tag = "2")]
4047 pub page_size: ::core::option::Option<u32>,
4048 #[prost(bytes = "bytes", optional, tag = "3")]
4054 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
4055}
4056#[non_exhaustive]
4057#[derive(Clone, PartialEq, ::prost::Message)]
4058pub struct ListPackageVersionsResponse {
4059 #[prost(message, repeated, tag = "1")]
4061 pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
4062 #[prost(bytes = "bytes", optional, tag = "2")]
4065 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
4066}
4067#[non_exhaustive]
4069#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4070pub struct PackageVersion {
4071 #[prost(string, optional, tag = "1")]
4073 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4074 #[prost(uint64, optional, tag = "2")]
4076 pub version: ::core::option::Option<u64>,
4077}
4078pub mod move_package_service_client {
4080 #![allow(
4081 unused_variables,
4082 dead_code,
4083 missing_docs,
4084 clippy::wildcard_imports,
4085 clippy::let_unit_value,
4086 )]
4087 use tonic::codegen::*;
4088 use tonic::codegen::http::Uri;
4089 #[derive(Debug, Clone)]
4090 pub struct MovePackageServiceClient<T> {
4091 inner: tonic::client::Grpc<T>,
4092 }
4093 impl MovePackageServiceClient<tonic::transport::Channel> {
4094 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4096 where
4097 D: TryInto<tonic::transport::Endpoint>,
4098 D::Error: Into<StdError>,
4099 {
4100 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4101 Ok(Self::new(conn))
4102 }
4103 }
4104 impl<T> MovePackageServiceClient<T>
4105 where
4106 T: tonic::client::GrpcService<tonic::body::Body>,
4107 T::Error: Into<StdError>,
4108 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4109 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4110 {
4111 pub fn new(inner: T) -> Self {
4112 let inner = tonic::client::Grpc::new(inner);
4113 Self { inner }
4114 }
4115 pub fn with_origin(inner: T, origin: Uri) -> Self {
4116 let inner = tonic::client::Grpc::with_origin(inner, origin);
4117 Self { inner }
4118 }
4119 pub fn with_interceptor<F>(
4120 inner: T,
4121 interceptor: F,
4122 ) -> MovePackageServiceClient<InterceptedService<T, F>>
4123 where
4124 F: tonic::service::Interceptor,
4125 T::ResponseBody: Default,
4126 T: tonic::codegen::Service<
4127 http::Request<tonic::body::Body>,
4128 Response = http::Response<
4129 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4130 >,
4131 >,
4132 <T as tonic::codegen::Service<
4133 http::Request<tonic::body::Body>,
4134 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4135 {
4136 MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
4137 }
4138 #[must_use]
4143 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4144 self.inner = self.inner.send_compressed(encoding);
4145 self
4146 }
4147 #[must_use]
4149 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4150 self.inner = self.inner.accept_compressed(encoding);
4151 self
4152 }
4153 #[must_use]
4157 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4158 self.inner = self.inner.max_decoding_message_size(limit);
4159 self
4160 }
4161 #[must_use]
4165 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4166 self.inner = self.inner.max_encoding_message_size(limit);
4167 self
4168 }
4169 pub async fn get_package(
4170 &mut self,
4171 request: impl tonic::IntoRequest<super::GetPackageRequest>,
4172 ) -> std::result::Result<
4173 tonic::Response<super::GetPackageResponse>,
4174 tonic::Status,
4175 > {
4176 self.inner
4177 .ready()
4178 .await
4179 .map_err(|e| {
4180 tonic::Status::unknown(
4181 format!("Service was not ready: {}", e.into()),
4182 )
4183 })?;
4184 let codec = tonic_prost::ProstCodec::default();
4185 let path = http::uri::PathAndQuery::from_static(
4186 "/sui.rpc.v2.MovePackageService/GetPackage",
4187 );
4188 let mut req = request.into_request();
4189 req.extensions_mut()
4190 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
4191 self.inner.unary(req, path, codec).await
4192 }
4193 pub async fn get_datatype(
4194 &mut self,
4195 request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
4196 ) -> std::result::Result<
4197 tonic::Response<super::GetDatatypeResponse>,
4198 tonic::Status,
4199 > {
4200 self.inner
4201 .ready()
4202 .await
4203 .map_err(|e| {
4204 tonic::Status::unknown(
4205 format!("Service was not ready: {}", e.into()),
4206 )
4207 })?;
4208 let codec = tonic_prost::ProstCodec::default();
4209 let path = http::uri::PathAndQuery::from_static(
4210 "/sui.rpc.v2.MovePackageService/GetDatatype",
4211 );
4212 let mut req = request.into_request();
4213 req.extensions_mut()
4214 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
4215 self.inner.unary(req, path, codec).await
4216 }
4217 pub async fn get_function(
4218 &mut self,
4219 request: impl tonic::IntoRequest<super::GetFunctionRequest>,
4220 ) -> std::result::Result<
4221 tonic::Response<super::GetFunctionResponse>,
4222 tonic::Status,
4223 > {
4224 self.inner
4225 .ready()
4226 .await
4227 .map_err(|e| {
4228 tonic::Status::unknown(
4229 format!("Service was not ready: {}", e.into()),
4230 )
4231 })?;
4232 let codec = tonic_prost::ProstCodec::default();
4233 let path = http::uri::PathAndQuery::from_static(
4234 "/sui.rpc.v2.MovePackageService/GetFunction",
4235 );
4236 let mut req = request.into_request();
4237 req.extensions_mut()
4238 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
4239 self.inner.unary(req, path, codec).await
4240 }
4241 pub async fn list_package_versions(
4242 &mut self,
4243 request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
4244 ) -> std::result::Result<
4245 tonic::Response<super::ListPackageVersionsResponse>,
4246 tonic::Status,
4247 > {
4248 self.inner
4249 .ready()
4250 .await
4251 .map_err(|e| {
4252 tonic::Status::unknown(
4253 format!("Service was not ready: {}", e.into()),
4254 )
4255 })?;
4256 let codec = tonic_prost::ProstCodec::default();
4257 let path = http::uri::PathAndQuery::from_static(
4258 "/sui.rpc.v2.MovePackageService/ListPackageVersions",
4259 );
4260 let mut req = request.into_request();
4261 req.extensions_mut()
4262 .insert(
4263 GrpcMethod::new(
4264 "sui.rpc.v2.MovePackageService",
4265 "ListPackageVersions",
4266 ),
4267 );
4268 self.inner.unary(req, path, codec).await
4269 }
4270 }
4271}
4272pub mod move_package_service_server {
4274 #![allow(
4275 unused_variables,
4276 dead_code,
4277 missing_docs,
4278 clippy::wildcard_imports,
4279 clippy::let_unit_value,
4280 )]
4281 use tonic::codegen::*;
4282 #[async_trait]
4284 pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
4285 async fn get_package(
4286 &self,
4287 request: tonic::Request<super::GetPackageRequest>,
4288 ) -> std::result::Result<
4289 tonic::Response<super::GetPackageResponse>,
4290 tonic::Status,
4291 > {
4292 Err(tonic::Status::unimplemented("Not yet implemented"))
4293 }
4294 async fn get_datatype(
4295 &self,
4296 request: tonic::Request<super::GetDatatypeRequest>,
4297 ) -> std::result::Result<
4298 tonic::Response<super::GetDatatypeResponse>,
4299 tonic::Status,
4300 > {
4301 Err(tonic::Status::unimplemented("Not yet implemented"))
4302 }
4303 async fn get_function(
4304 &self,
4305 request: tonic::Request<super::GetFunctionRequest>,
4306 ) -> std::result::Result<
4307 tonic::Response<super::GetFunctionResponse>,
4308 tonic::Status,
4309 > {
4310 Err(tonic::Status::unimplemented("Not yet implemented"))
4311 }
4312 async fn list_package_versions(
4313 &self,
4314 request: tonic::Request<super::ListPackageVersionsRequest>,
4315 ) -> std::result::Result<
4316 tonic::Response<super::ListPackageVersionsResponse>,
4317 tonic::Status,
4318 > {
4319 Err(tonic::Status::unimplemented("Not yet implemented"))
4320 }
4321 }
4322 #[derive(Debug)]
4323 pub struct MovePackageServiceServer<T> {
4324 inner: Arc<T>,
4325 accept_compression_encodings: EnabledCompressionEncodings,
4326 send_compression_encodings: EnabledCompressionEncodings,
4327 max_decoding_message_size: Option<usize>,
4328 max_encoding_message_size: Option<usize>,
4329 }
4330 impl<T> MovePackageServiceServer<T> {
4331 pub fn new(inner: T) -> Self {
4332 Self::from_arc(Arc::new(inner))
4333 }
4334 pub fn from_arc(inner: Arc<T>) -> Self {
4335 Self {
4336 inner,
4337 accept_compression_encodings: Default::default(),
4338 send_compression_encodings: Default::default(),
4339 max_decoding_message_size: None,
4340 max_encoding_message_size: None,
4341 }
4342 }
4343 pub fn with_interceptor<F>(
4344 inner: T,
4345 interceptor: F,
4346 ) -> InterceptedService<Self, F>
4347 where
4348 F: tonic::service::Interceptor,
4349 {
4350 InterceptedService::new(Self::new(inner), interceptor)
4351 }
4352 #[must_use]
4354 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4355 self.accept_compression_encodings.enable(encoding);
4356 self
4357 }
4358 #[must_use]
4360 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4361 self.send_compression_encodings.enable(encoding);
4362 self
4363 }
4364 #[must_use]
4368 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4369 self.max_decoding_message_size = Some(limit);
4370 self
4371 }
4372 #[must_use]
4376 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4377 self.max_encoding_message_size = Some(limit);
4378 self
4379 }
4380 }
4381 impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
4382 where
4383 T: MovePackageService,
4384 B: Body + std::marker::Send + 'static,
4385 B::Error: Into<StdError> + std::marker::Send + 'static,
4386 {
4387 type Response = http::Response<tonic::body::Body>;
4388 type Error = std::convert::Infallible;
4389 type Future = BoxFuture<Self::Response, Self::Error>;
4390 fn poll_ready(
4391 &mut self,
4392 _cx: &mut Context<'_>,
4393 ) -> Poll<std::result::Result<(), Self::Error>> {
4394 Poll::Ready(Ok(()))
4395 }
4396 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4397 match req.uri().path() {
4398 "/sui.rpc.v2.MovePackageService/GetPackage" => {
4399 #[allow(non_camel_case_types)]
4400 struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
4401 impl<
4402 T: MovePackageService,
4403 > tonic::server::UnaryService<super::GetPackageRequest>
4404 for GetPackageSvc<T> {
4405 type Response = super::GetPackageResponse;
4406 type Future = BoxFuture<
4407 tonic::Response<Self::Response>,
4408 tonic::Status,
4409 >;
4410 fn call(
4411 &mut self,
4412 request: tonic::Request<super::GetPackageRequest>,
4413 ) -> Self::Future {
4414 let inner = Arc::clone(&self.0);
4415 let fut = async move {
4416 <T as MovePackageService>::get_package(&inner, request)
4417 .await
4418 };
4419 Box::pin(fut)
4420 }
4421 }
4422 let accept_compression_encodings = self.accept_compression_encodings;
4423 let send_compression_encodings = self.send_compression_encodings;
4424 let max_decoding_message_size = self.max_decoding_message_size;
4425 let max_encoding_message_size = self.max_encoding_message_size;
4426 let inner = self.inner.clone();
4427 let fut = async move {
4428 let method = GetPackageSvc(inner);
4429 let codec = tonic_prost::ProstCodec::default();
4430 let mut grpc = tonic::server::Grpc::new(codec)
4431 .apply_compression_config(
4432 accept_compression_encodings,
4433 send_compression_encodings,
4434 )
4435 .apply_max_message_size_config(
4436 max_decoding_message_size,
4437 max_encoding_message_size,
4438 );
4439 let res = grpc.unary(method, req).await;
4440 Ok(res)
4441 };
4442 Box::pin(fut)
4443 }
4444 "/sui.rpc.v2.MovePackageService/GetDatatype" => {
4445 #[allow(non_camel_case_types)]
4446 struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
4447 impl<
4448 T: MovePackageService,
4449 > tonic::server::UnaryService<super::GetDatatypeRequest>
4450 for GetDatatypeSvc<T> {
4451 type Response = super::GetDatatypeResponse;
4452 type Future = BoxFuture<
4453 tonic::Response<Self::Response>,
4454 tonic::Status,
4455 >;
4456 fn call(
4457 &mut self,
4458 request: tonic::Request<super::GetDatatypeRequest>,
4459 ) -> Self::Future {
4460 let inner = Arc::clone(&self.0);
4461 let fut = async move {
4462 <T as MovePackageService>::get_datatype(&inner, request)
4463 .await
4464 };
4465 Box::pin(fut)
4466 }
4467 }
4468 let accept_compression_encodings = self.accept_compression_encodings;
4469 let send_compression_encodings = self.send_compression_encodings;
4470 let max_decoding_message_size = self.max_decoding_message_size;
4471 let max_encoding_message_size = self.max_encoding_message_size;
4472 let inner = self.inner.clone();
4473 let fut = async move {
4474 let method = GetDatatypeSvc(inner);
4475 let codec = tonic_prost::ProstCodec::default();
4476 let mut grpc = tonic::server::Grpc::new(codec)
4477 .apply_compression_config(
4478 accept_compression_encodings,
4479 send_compression_encodings,
4480 )
4481 .apply_max_message_size_config(
4482 max_decoding_message_size,
4483 max_encoding_message_size,
4484 );
4485 let res = grpc.unary(method, req).await;
4486 Ok(res)
4487 };
4488 Box::pin(fut)
4489 }
4490 "/sui.rpc.v2.MovePackageService/GetFunction" => {
4491 #[allow(non_camel_case_types)]
4492 struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
4493 impl<
4494 T: MovePackageService,
4495 > tonic::server::UnaryService<super::GetFunctionRequest>
4496 for GetFunctionSvc<T> {
4497 type Response = super::GetFunctionResponse;
4498 type Future = BoxFuture<
4499 tonic::Response<Self::Response>,
4500 tonic::Status,
4501 >;
4502 fn call(
4503 &mut self,
4504 request: tonic::Request<super::GetFunctionRequest>,
4505 ) -> Self::Future {
4506 let inner = Arc::clone(&self.0);
4507 let fut = async move {
4508 <T as MovePackageService>::get_function(&inner, request)
4509 .await
4510 };
4511 Box::pin(fut)
4512 }
4513 }
4514 let accept_compression_encodings = self.accept_compression_encodings;
4515 let send_compression_encodings = self.send_compression_encodings;
4516 let max_decoding_message_size = self.max_decoding_message_size;
4517 let max_encoding_message_size = self.max_encoding_message_size;
4518 let inner = self.inner.clone();
4519 let fut = async move {
4520 let method = GetFunctionSvc(inner);
4521 let codec = tonic_prost::ProstCodec::default();
4522 let mut grpc = tonic::server::Grpc::new(codec)
4523 .apply_compression_config(
4524 accept_compression_encodings,
4525 send_compression_encodings,
4526 )
4527 .apply_max_message_size_config(
4528 max_decoding_message_size,
4529 max_encoding_message_size,
4530 );
4531 let res = grpc.unary(method, req).await;
4532 Ok(res)
4533 };
4534 Box::pin(fut)
4535 }
4536 "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
4537 #[allow(non_camel_case_types)]
4538 struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
4539 impl<
4540 T: MovePackageService,
4541 > tonic::server::UnaryService<super::ListPackageVersionsRequest>
4542 for ListPackageVersionsSvc<T> {
4543 type Response = super::ListPackageVersionsResponse;
4544 type Future = BoxFuture<
4545 tonic::Response<Self::Response>,
4546 tonic::Status,
4547 >;
4548 fn call(
4549 &mut self,
4550 request: tonic::Request<super::ListPackageVersionsRequest>,
4551 ) -> Self::Future {
4552 let inner = Arc::clone(&self.0);
4553 let fut = async move {
4554 <T as MovePackageService>::list_package_versions(
4555 &inner,
4556 request,
4557 )
4558 .await
4559 };
4560 Box::pin(fut)
4561 }
4562 }
4563 let accept_compression_encodings = self.accept_compression_encodings;
4564 let send_compression_encodings = self.send_compression_encodings;
4565 let max_decoding_message_size = self.max_decoding_message_size;
4566 let max_encoding_message_size = self.max_encoding_message_size;
4567 let inner = self.inner.clone();
4568 let fut = async move {
4569 let method = ListPackageVersionsSvc(inner);
4570 let codec = tonic_prost::ProstCodec::default();
4571 let mut grpc = tonic::server::Grpc::new(codec)
4572 .apply_compression_config(
4573 accept_compression_encodings,
4574 send_compression_encodings,
4575 )
4576 .apply_max_message_size_config(
4577 max_decoding_message_size,
4578 max_encoding_message_size,
4579 );
4580 let res = grpc.unary(method, req).await;
4581 Ok(res)
4582 };
4583 Box::pin(fut)
4584 }
4585 _ => {
4586 Box::pin(async move {
4587 let mut response = http::Response::new(
4588 tonic::body::Body::default(),
4589 );
4590 let headers = response.headers_mut();
4591 headers
4592 .insert(
4593 tonic::Status::GRPC_STATUS,
4594 (tonic::Code::Unimplemented as i32).into(),
4595 );
4596 headers
4597 .insert(
4598 http::header::CONTENT_TYPE,
4599 tonic::metadata::GRPC_CONTENT_TYPE,
4600 );
4601 Ok(response)
4602 })
4603 }
4604 }
4605 }
4606 }
4607 impl<T> Clone for MovePackageServiceServer<T> {
4608 fn clone(&self) -> Self {
4609 let inner = self.inner.clone();
4610 Self {
4611 inner,
4612 accept_compression_encodings: self.accept_compression_encodings,
4613 send_compression_encodings: self.send_compression_encodings,
4614 max_decoding_message_size: self.max_decoding_message_size,
4615 max_encoding_message_size: self.max_encoding_message_size,
4616 }
4617 }
4618 }
4619 pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
4621 impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
4622 const NAME: &'static str = SERVICE_NAME;
4623 }
4624}
4625#[non_exhaustive]
4626#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4627pub struct LookupNameRequest {
4628 #[prost(string, optional, tag = "1")]
4632 pub name: ::core::option::Option<::prost::alloc::string::String>,
4633}
4634#[non_exhaustive]
4635#[derive(Clone, PartialEq, ::prost::Message)]
4636pub struct LookupNameResponse {
4637 #[prost(message, optional, tag = "1")]
4639 pub record: ::core::option::Option<NameRecord>,
4640}
4641#[non_exhaustive]
4642#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4643pub struct ReverseLookupNameRequest {
4644 #[prost(string, optional, tag = "1")]
4646 pub address: ::core::option::Option<::prost::alloc::string::String>,
4647}
4648#[non_exhaustive]
4649#[derive(Clone, PartialEq, ::prost::Message)]
4650pub struct ReverseLookupNameResponse {
4651 #[prost(message, optional, tag = "1")]
4653 pub record: ::core::option::Option<NameRecord>,
4654}
4655#[non_exhaustive]
4656#[derive(Clone, PartialEq, ::prost::Message)]
4657pub struct NameRecord {
4658 #[prost(string, optional, tag = "1")]
4663 pub id: ::core::option::Option<::prost::alloc::string::String>,
4664 #[prost(string, optional, tag = "2")]
4666 pub name: ::core::option::Option<::prost::alloc::string::String>,
4667 #[prost(string, optional, tag = "3")]
4675 pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
4676 #[prost(message, optional, tag = "4")]
4681 pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
4682 #[prost(string, optional, tag = "5")]
4684 pub target_address: ::core::option::Option<::prost::alloc::string::String>,
4685 #[prost(btree_map = "string, string", tag = "6")]
4687 pub data: ::prost::alloc::collections::BTreeMap<
4688 ::prost::alloc::string::String,
4689 ::prost::alloc::string::String,
4690 >,
4691}
4692pub mod name_service_client {
4694 #![allow(
4695 unused_variables,
4696 dead_code,
4697 missing_docs,
4698 clippy::wildcard_imports,
4699 clippy::let_unit_value,
4700 )]
4701 use tonic::codegen::*;
4702 use tonic::codegen::http::Uri;
4703 #[derive(Debug, Clone)]
4704 pub struct NameServiceClient<T> {
4705 inner: tonic::client::Grpc<T>,
4706 }
4707 impl NameServiceClient<tonic::transport::Channel> {
4708 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4710 where
4711 D: TryInto<tonic::transport::Endpoint>,
4712 D::Error: Into<StdError>,
4713 {
4714 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4715 Ok(Self::new(conn))
4716 }
4717 }
4718 impl<T> NameServiceClient<T>
4719 where
4720 T: tonic::client::GrpcService<tonic::body::Body>,
4721 T::Error: Into<StdError>,
4722 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4723 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4724 {
4725 pub fn new(inner: T) -> Self {
4726 let inner = tonic::client::Grpc::new(inner);
4727 Self { inner }
4728 }
4729 pub fn with_origin(inner: T, origin: Uri) -> Self {
4730 let inner = tonic::client::Grpc::with_origin(inner, origin);
4731 Self { inner }
4732 }
4733 pub fn with_interceptor<F>(
4734 inner: T,
4735 interceptor: F,
4736 ) -> NameServiceClient<InterceptedService<T, F>>
4737 where
4738 F: tonic::service::Interceptor,
4739 T::ResponseBody: Default,
4740 T: tonic::codegen::Service<
4741 http::Request<tonic::body::Body>,
4742 Response = http::Response<
4743 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4744 >,
4745 >,
4746 <T as tonic::codegen::Service<
4747 http::Request<tonic::body::Body>,
4748 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4749 {
4750 NameServiceClient::new(InterceptedService::new(inner, interceptor))
4751 }
4752 #[must_use]
4757 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4758 self.inner = self.inner.send_compressed(encoding);
4759 self
4760 }
4761 #[must_use]
4763 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4764 self.inner = self.inner.accept_compressed(encoding);
4765 self
4766 }
4767 #[must_use]
4771 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4772 self.inner = self.inner.max_decoding_message_size(limit);
4773 self
4774 }
4775 #[must_use]
4779 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4780 self.inner = self.inner.max_encoding_message_size(limit);
4781 self
4782 }
4783 pub async fn lookup_name(
4784 &mut self,
4785 request: impl tonic::IntoRequest<super::LookupNameRequest>,
4786 ) -> std::result::Result<
4787 tonic::Response<super::LookupNameResponse>,
4788 tonic::Status,
4789 > {
4790 self.inner
4791 .ready()
4792 .await
4793 .map_err(|e| {
4794 tonic::Status::unknown(
4795 format!("Service was not ready: {}", e.into()),
4796 )
4797 })?;
4798 let codec = tonic_prost::ProstCodec::default();
4799 let path = http::uri::PathAndQuery::from_static(
4800 "/sui.rpc.v2.NameService/LookupName",
4801 );
4802 let mut req = request.into_request();
4803 req.extensions_mut()
4804 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
4805 self.inner.unary(req, path, codec).await
4806 }
4807 pub async fn reverse_lookup_name(
4808 &mut self,
4809 request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
4810 ) -> std::result::Result<
4811 tonic::Response<super::ReverseLookupNameResponse>,
4812 tonic::Status,
4813 > {
4814 self.inner
4815 .ready()
4816 .await
4817 .map_err(|e| {
4818 tonic::Status::unknown(
4819 format!("Service was not ready: {}", e.into()),
4820 )
4821 })?;
4822 let codec = tonic_prost::ProstCodec::default();
4823 let path = http::uri::PathAndQuery::from_static(
4824 "/sui.rpc.v2.NameService/ReverseLookupName",
4825 );
4826 let mut req = request.into_request();
4827 req.extensions_mut()
4828 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
4829 self.inner.unary(req, path, codec).await
4830 }
4831 }
4832}
4833pub mod name_service_server {
4835 #![allow(
4836 unused_variables,
4837 dead_code,
4838 missing_docs,
4839 clippy::wildcard_imports,
4840 clippy::let_unit_value,
4841 )]
4842 use tonic::codegen::*;
4843 #[async_trait]
4845 pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
4846 async fn lookup_name(
4847 &self,
4848 request: tonic::Request<super::LookupNameRequest>,
4849 ) -> std::result::Result<
4850 tonic::Response<super::LookupNameResponse>,
4851 tonic::Status,
4852 > {
4853 Err(tonic::Status::unimplemented("Not yet implemented"))
4854 }
4855 async fn reverse_lookup_name(
4856 &self,
4857 request: tonic::Request<super::ReverseLookupNameRequest>,
4858 ) -> std::result::Result<
4859 tonic::Response<super::ReverseLookupNameResponse>,
4860 tonic::Status,
4861 > {
4862 Err(tonic::Status::unimplemented("Not yet implemented"))
4863 }
4864 }
4865 #[derive(Debug)]
4866 pub struct NameServiceServer<T> {
4867 inner: Arc<T>,
4868 accept_compression_encodings: EnabledCompressionEncodings,
4869 send_compression_encodings: EnabledCompressionEncodings,
4870 max_decoding_message_size: Option<usize>,
4871 max_encoding_message_size: Option<usize>,
4872 }
4873 impl<T> NameServiceServer<T> {
4874 pub fn new(inner: T) -> Self {
4875 Self::from_arc(Arc::new(inner))
4876 }
4877 pub fn from_arc(inner: Arc<T>) -> Self {
4878 Self {
4879 inner,
4880 accept_compression_encodings: Default::default(),
4881 send_compression_encodings: Default::default(),
4882 max_decoding_message_size: None,
4883 max_encoding_message_size: None,
4884 }
4885 }
4886 pub fn with_interceptor<F>(
4887 inner: T,
4888 interceptor: F,
4889 ) -> InterceptedService<Self, F>
4890 where
4891 F: tonic::service::Interceptor,
4892 {
4893 InterceptedService::new(Self::new(inner), interceptor)
4894 }
4895 #[must_use]
4897 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4898 self.accept_compression_encodings.enable(encoding);
4899 self
4900 }
4901 #[must_use]
4903 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4904 self.send_compression_encodings.enable(encoding);
4905 self
4906 }
4907 #[must_use]
4911 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4912 self.max_decoding_message_size = Some(limit);
4913 self
4914 }
4915 #[must_use]
4919 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4920 self.max_encoding_message_size = Some(limit);
4921 self
4922 }
4923 }
4924 impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
4925 where
4926 T: NameService,
4927 B: Body + std::marker::Send + 'static,
4928 B::Error: Into<StdError> + std::marker::Send + 'static,
4929 {
4930 type Response = http::Response<tonic::body::Body>;
4931 type Error = std::convert::Infallible;
4932 type Future = BoxFuture<Self::Response, Self::Error>;
4933 fn poll_ready(
4934 &mut self,
4935 _cx: &mut Context<'_>,
4936 ) -> Poll<std::result::Result<(), Self::Error>> {
4937 Poll::Ready(Ok(()))
4938 }
4939 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4940 match req.uri().path() {
4941 "/sui.rpc.v2.NameService/LookupName" => {
4942 #[allow(non_camel_case_types)]
4943 struct LookupNameSvc<T: NameService>(pub Arc<T>);
4944 impl<
4945 T: NameService,
4946 > tonic::server::UnaryService<super::LookupNameRequest>
4947 for LookupNameSvc<T> {
4948 type Response = super::LookupNameResponse;
4949 type Future = BoxFuture<
4950 tonic::Response<Self::Response>,
4951 tonic::Status,
4952 >;
4953 fn call(
4954 &mut self,
4955 request: tonic::Request<super::LookupNameRequest>,
4956 ) -> Self::Future {
4957 let inner = Arc::clone(&self.0);
4958 let fut = async move {
4959 <T as NameService>::lookup_name(&inner, request).await
4960 };
4961 Box::pin(fut)
4962 }
4963 }
4964 let accept_compression_encodings = self.accept_compression_encodings;
4965 let send_compression_encodings = self.send_compression_encodings;
4966 let max_decoding_message_size = self.max_decoding_message_size;
4967 let max_encoding_message_size = self.max_encoding_message_size;
4968 let inner = self.inner.clone();
4969 let fut = async move {
4970 let method = LookupNameSvc(inner);
4971 let codec = tonic_prost::ProstCodec::default();
4972 let mut grpc = tonic::server::Grpc::new(codec)
4973 .apply_compression_config(
4974 accept_compression_encodings,
4975 send_compression_encodings,
4976 )
4977 .apply_max_message_size_config(
4978 max_decoding_message_size,
4979 max_encoding_message_size,
4980 );
4981 let res = grpc.unary(method, req).await;
4982 Ok(res)
4983 };
4984 Box::pin(fut)
4985 }
4986 "/sui.rpc.v2.NameService/ReverseLookupName" => {
4987 #[allow(non_camel_case_types)]
4988 struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
4989 impl<
4990 T: NameService,
4991 > tonic::server::UnaryService<super::ReverseLookupNameRequest>
4992 for ReverseLookupNameSvc<T> {
4993 type Response = super::ReverseLookupNameResponse;
4994 type Future = BoxFuture<
4995 tonic::Response<Self::Response>,
4996 tonic::Status,
4997 >;
4998 fn call(
4999 &mut self,
5000 request: tonic::Request<super::ReverseLookupNameRequest>,
5001 ) -> Self::Future {
5002 let inner = Arc::clone(&self.0);
5003 let fut = async move {
5004 <T as NameService>::reverse_lookup_name(&inner, request)
5005 .await
5006 };
5007 Box::pin(fut)
5008 }
5009 }
5010 let accept_compression_encodings = self.accept_compression_encodings;
5011 let send_compression_encodings = self.send_compression_encodings;
5012 let max_decoding_message_size = self.max_decoding_message_size;
5013 let max_encoding_message_size = self.max_encoding_message_size;
5014 let inner = self.inner.clone();
5015 let fut = async move {
5016 let method = ReverseLookupNameSvc(inner);
5017 let codec = tonic_prost::ProstCodec::default();
5018 let mut grpc = tonic::server::Grpc::new(codec)
5019 .apply_compression_config(
5020 accept_compression_encodings,
5021 send_compression_encodings,
5022 )
5023 .apply_max_message_size_config(
5024 max_decoding_message_size,
5025 max_encoding_message_size,
5026 );
5027 let res = grpc.unary(method, req).await;
5028 Ok(res)
5029 };
5030 Box::pin(fut)
5031 }
5032 _ => {
5033 Box::pin(async move {
5034 let mut response = http::Response::new(
5035 tonic::body::Body::default(),
5036 );
5037 let headers = response.headers_mut();
5038 headers
5039 .insert(
5040 tonic::Status::GRPC_STATUS,
5041 (tonic::Code::Unimplemented as i32).into(),
5042 );
5043 headers
5044 .insert(
5045 http::header::CONTENT_TYPE,
5046 tonic::metadata::GRPC_CONTENT_TYPE,
5047 );
5048 Ok(response)
5049 })
5050 }
5051 }
5052 }
5053 }
5054 impl<T> Clone for NameServiceServer<T> {
5055 fn clone(&self) -> Self {
5056 let inner = self.inner.clone();
5057 Self {
5058 inner,
5059 accept_compression_encodings: self.accept_compression_encodings,
5060 send_compression_encodings: self.send_compression_encodings,
5061 max_decoding_message_size: self.max_decoding_message_size,
5062 max_encoding_message_size: self.max_encoding_message_size,
5063 }
5064 }
5065 }
5066 pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
5068 impl<T> tonic::server::NamedService for NameServiceServer<T> {
5069 const NAME: &'static str = SERVICE_NAME;
5070 }
5071}
5072#[non_exhaustive]
5074#[derive(Clone, PartialEq, ::prost::Message)]
5075pub struct Object {
5076 #[prost(message, optional, tag = "1")]
5078 pub bcs: ::core::option::Option<Bcs>,
5079 #[prost(string, optional, tag = "2")]
5081 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5082 #[prost(uint64, optional, tag = "3")]
5084 pub version: ::core::option::Option<u64>,
5085 #[prost(string, optional, tag = "4")]
5087 pub digest: ::core::option::Option<::prost::alloc::string::String>,
5088 #[prost(message, optional, tag = "5")]
5090 pub owner: ::core::option::Option<Owner>,
5091 #[prost(string, optional, tag = "6")]
5095 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5096 #[prost(bool, optional, tag = "7")]
5101 pub has_public_transfer: ::core::option::Option<bool>,
5102 #[prost(message, optional, tag = "8")]
5106 pub contents: ::core::option::Option<Bcs>,
5107 #[prost(message, optional, tag = "9")]
5109 pub package: ::core::option::Option<Package>,
5110 #[prost(string, optional, tag = "10")]
5112 pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
5113 #[prost(uint64, optional, tag = "11")]
5117 pub storage_rebate: ::core::option::Option<u64>,
5118 #[prost(message, optional, boxed, tag = "100")]
5120 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
5121 #[prost(uint64, optional, tag = "101")]
5123 pub balance: ::core::option::Option<u64>,
5124 #[prost(message, optional, boxed, tag = "102")]
5127 pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
5128}
5129#[non_exhaustive]
5131#[derive(Clone, PartialEq, ::prost::Message)]
5132pub struct ObjectSet {
5133 #[prost(message, repeated, tag = "1")]
5135 pub objects: ::prost::alloc::vec::Vec<Object>,
5136}
5137#[non_exhaustive]
5139#[derive(Clone, PartialEq, ::prost::Message)]
5140pub struct Display {
5141 #[prost(message, optional, tag = "1")]
5145 pub output: ::core::option::Option<::prost_types::Value>,
5146 #[prost(message, optional, tag = "2")]
5150 pub errors: ::core::option::Option<::prost_types::Value>,
5151}
5152#[non_exhaustive]
5154#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5155pub struct ObjectReference {
5156 #[prost(string, optional, tag = "1")]
5158 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5159 #[prost(uint64, optional, tag = "2")]
5161 pub version: ::core::option::Option<u64>,
5162 #[prost(string, optional, tag = "3")]
5164 pub digest: ::core::option::Option<::prost::alloc::string::String>,
5165}
5166#[non_exhaustive]
5168#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5169pub struct Owner {
5170 #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
5171 pub kind: ::core::option::Option<i32>,
5172 #[prost(string, optional, tag = "2")]
5174 pub address: ::core::option::Option<::prost::alloc::string::String>,
5175 #[prost(uint64, optional, tag = "3")]
5177 pub version: ::core::option::Option<u64>,
5178}
5179pub mod owner {
5181 #[non_exhaustive]
5182 #[derive(
5183 Clone,
5184 Copy,
5185 Debug,
5186 PartialEq,
5187 Eq,
5188 Hash,
5189 PartialOrd,
5190 Ord,
5191 ::prost::Enumeration
5192 )]
5193 #[repr(i32)]
5194 pub enum OwnerKind {
5195 Unknown = 0,
5196 Address = 1,
5197 Object = 2,
5198 Shared = 3,
5199 Immutable = 4,
5200 ConsensusAddress = 5,
5201 }
5202 impl OwnerKind {
5203 pub fn as_str_name(&self) -> &'static str {
5208 match self {
5209 Self::Unknown => "OWNER_KIND_UNKNOWN",
5210 Self::Address => "ADDRESS",
5211 Self::Object => "OBJECT",
5212 Self::Shared => "SHARED",
5213 Self::Immutable => "IMMUTABLE",
5214 Self::ConsensusAddress => "CONSENSUS_ADDRESS",
5215 }
5216 }
5217 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5219 match value {
5220 "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
5221 "ADDRESS" => Some(Self::Address),
5222 "OBJECT" => Some(Self::Object),
5223 "SHARED" => Some(Self::Shared),
5224 "IMMUTABLE" => Some(Self::Immutable),
5225 "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
5226 _ => None,
5227 }
5228 }
5229 }
5230}
5231#[non_exhaustive]
5232#[derive(Clone, PartialEq, ::prost::Message)]
5233pub struct ProtocolConfig {
5234 #[prost(uint64, optional, tag = "1")]
5235 pub protocol_version: ::core::option::Option<u64>,
5236 #[prost(btree_map = "string, bool", tag = "2")]
5238 pub feature_flags: ::prost::alloc::collections::BTreeMap<
5239 ::prost::alloc::string::String,
5240 bool,
5241 >,
5242 #[prost(btree_map = "string, string", tag = "3")]
5244 pub attributes: ::prost::alloc::collections::BTreeMap<
5245 ::prost::alloc::string::String,
5246 ::prost::alloc::string::String,
5247 >,
5248 #[prost(btree_map = "string, message", tag = "4")]
5249 pub configs: ::prost::alloc::collections::BTreeMap<
5250 ::prost::alloc::string::String,
5251 ::prost_types::Value,
5252 >,
5253}
5254#[non_exhaustive]
5274#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5275pub struct QueryOptions {
5276 #[prost(uint32, optional, tag = "1")]
5279 pub limit: ::core::option::Option<u32>,
5280 #[prost(bytes = "bytes", optional, tag = "2")]
5283 pub after: ::core::option::Option<::prost::bytes::Bytes>,
5284 #[prost(bytes = "bytes", optional, tag = "3")]
5287 pub before: ::core::option::Option<::prost::bytes::Bytes>,
5288 #[prost(enumeration = "Ordering", optional, tag = "4")]
5293 pub ordering: ::core::option::Option<i32>,
5294}
5295#[non_exhaustive]
5300#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5301pub struct Watermark {
5302 #[prost(bytes = "bytes", optional, tag = "1")]
5307 pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
5308 #[prost(uint64, optional, tag = "2")]
5321 pub checkpoint: ::core::option::Option<u64>,
5322}
5323#[non_exhaustive]
5334#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5335pub struct QueryEnd {
5336 #[prost(enumeration = "QueryEndReason", optional, tag = "1")]
5338 pub reason: ::core::option::Option<i32>,
5339}
5340#[non_exhaustive]
5342#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5343#[repr(i32)]
5344pub enum Ordering {
5345 Ascending = 0,
5347 Descending = 1,
5349}
5350impl Ordering {
5351 pub fn as_str_name(&self) -> &'static str {
5356 match self {
5357 Self::Ascending => "ORDERING_ASCENDING",
5358 Self::Descending => "ORDERING_DESCENDING",
5359 }
5360 }
5361 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5363 match value {
5364 "ORDERING_ASCENDING" => Some(Self::Ascending),
5365 "ORDERING_DESCENDING" => Some(Self::Descending),
5366 _ => None,
5367 }
5368 }
5369}
5370#[non_exhaustive]
5372#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5373#[repr(i32)]
5374pub enum QueryEndReason {
5375 Unknown = 0,
5377 ItemLimit = 1,
5381 ScanLimit = 2,
5386 CheckpointBound = 3,
5389 CursorBound = 4,
5393 LedgerTip = 5,
5396}
5397impl QueryEndReason {
5398 pub fn as_str_name(&self) -> &'static str {
5403 match self {
5404 Self::Unknown => "QUERY_END_REASON_UNKNOWN",
5405 Self::ItemLimit => "QUERY_END_REASON_ITEM_LIMIT",
5406 Self::ScanLimit => "QUERY_END_REASON_SCAN_LIMIT",
5407 Self::CheckpointBound => "QUERY_END_REASON_CHECKPOINT_BOUND",
5408 Self::CursorBound => "QUERY_END_REASON_CURSOR_BOUND",
5409 Self::LedgerTip => "QUERY_END_REASON_LEDGER_TIP",
5410 }
5411 }
5412 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5414 match value {
5415 "QUERY_END_REASON_UNKNOWN" => Some(Self::Unknown),
5416 "QUERY_END_REASON_ITEM_LIMIT" => Some(Self::ItemLimit),
5417 "QUERY_END_REASON_SCAN_LIMIT" => Some(Self::ScanLimit),
5418 "QUERY_END_REASON_CHECKPOINT_BOUND" => Some(Self::CheckpointBound),
5419 "QUERY_END_REASON_CURSOR_BOUND" => Some(Self::CursorBound),
5420 "QUERY_END_REASON_LEDGER_TIP" => Some(Self::LedgerTip),
5421 _ => None,
5422 }
5423 }
5424}
5425#[non_exhaustive]
5427#[derive(Clone, PartialEq, ::prost::Message)]
5428pub struct UserSignature {
5429 #[prost(message, optional, tag = "1")]
5434 pub bcs: ::core::option::Option<Bcs>,
5435 #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
5437 pub scheme: ::core::option::Option<i32>,
5438 #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
5439 pub signature: ::core::option::Option<user_signature::Signature>,
5440}
5441pub mod user_signature {
5443 #[non_exhaustive]
5444 #[derive(Clone, PartialEq, ::prost::Oneof)]
5445 pub enum Signature {
5446 #[prost(message, tag = "3")]
5448 Simple(super::SimpleSignature),
5449 #[prost(message, tag = "4")]
5451 Multisig(super::MultisigAggregatedSignature),
5452 #[prost(message, tag = "5")]
5454 Zklogin(super::ZkLoginAuthenticator),
5455 #[prost(message, tag = "6")]
5457 Passkey(super::PasskeyAuthenticator),
5458 }
5459}
5460#[non_exhaustive]
5462#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5463pub struct SimpleSignature {
5464 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5466 pub scheme: ::core::option::Option<i32>,
5467 #[prost(bytes = "bytes", optional, tag = "2")]
5469 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5470 #[prost(bytes = "bytes", optional, tag = "3")]
5472 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5473}
5474#[non_exhaustive]
5476#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5477pub struct ZkLoginPublicIdentifier {
5478 #[prost(string, optional, tag = "1")]
5479 pub iss: ::core::option::Option<::prost::alloc::string::String>,
5480 #[prost(string, optional, tag = "2")]
5482 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5483}
5484#[non_exhaustive]
5486#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5487pub struct MultisigMemberPublicKey {
5488 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5490 pub scheme: ::core::option::Option<i32>,
5491 #[prost(bytes = "bytes", optional, tag = "2")]
5493 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5494 #[prost(message, optional, tag = "3")]
5496 pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
5497}
5498#[non_exhaustive]
5500#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5501pub struct MultisigMember {
5502 #[prost(message, optional, tag = "1")]
5504 pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
5505 #[prost(uint32, optional, tag = "2")]
5507 pub weight: ::core::option::Option<u32>,
5508}
5509#[non_exhaustive]
5511#[derive(Clone, PartialEq, ::prost::Message)]
5512pub struct MultisigCommittee {
5513 #[prost(message, repeated, tag = "1")]
5515 pub members: ::prost::alloc::vec::Vec<MultisigMember>,
5516 #[prost(uint32, optional, tag = "2")]
5519 pub threshold: ::core::option::Option<u32>,
5520}
5521#[non_exhaustive]
5523#[derive(Clone, PartialEq, ::prost::Message)]
5524pub struct MultisigAggregatedSignature {
5525 #[prost(message, repeated, tag = "1")]
5529 pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
5530 #[prost(uint32, optional, tag = "2")]
5533 pub bitmap: ::core::option::Option<u32>,
5534 #[prost(bytes = "bytes", optional, tag = "3")]
5537 pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5538 #[prost(message, optional, tag = "4")]
5540 pub committee: ::core::option::Option<MultisigCommittee>,
5541}
5542#[non_exhaustive]
5544#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5545pub struct MultisigMemberSignature {
5546 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5548 pub scheme: ::core::option::Option<i32>,
5549 #[prost(bytes = "bytes", optional, tag = "2")]
5551 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5552 #[prost(message, optional, tag = "3")]
5554 pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
5555 #[prost(message, optional, tag = "4")]
5557 pub passkey: ::core::option::Option<PasskeyAuthenticator>,
5558}
5559#[non_exhaustive]
5561#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5562pub struct ZkLoginAuthenticator {
5563 #[prost(message, optional, tag = "1")]
5565 pub inputs: ::core::option::Option<ZkLoginInputs>,
5566 #[prost(uint64, optional, tag = "2")]
5568 pub max_epoch: ::core::option::Option<u64>,
5569 #[prost(message, optional, tag = "3")]
5571 pub signature: ::core::option::Option<SimpleSignature>,
5572 #[prost(message, optional, tag = "4")]
5574 pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
5575 #[prost(message, optional, tag = "5")]
5577 pub jwk_id: ::core::option::Option<JwkId>,
5578}
5579#[non_exhaustive]
5581#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5582pub struct ZkLoginInputs {
5583 #[prost(message, optional, tag = "1")]
5584 pub proof_points: ::core::option::Option<ZkLoginProof>,
5585 #[prost(message, optional, tag = "2")]
5586 pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
5587 #[prost(string, optional, tag = "3")]
5588 pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
5589 #[prost(string, optional, tag = "4")]
5591 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5592}
5593#[non_exhaustive]
5595#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5596pub struct ZkLoginProof {
5597 #[prost(message, optional, tag = "1")]
5598 pub a: ::core::option::Option<CircomG1>,
5599 #[prost(message, optional, tag = "2")]
5600 pub b: ::core::option::Option<CircomG2>,
5601 #[prost(message, optional, tag = "3")]
5602 pub c: ::core::option::Option<CircomG1>,
5603}
5604#[non_exhaustive]
5606#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5607pub struct ZkLoginClaim {
5608 #[prost(string, optional, tag = "1")]
5609 pub value: ::core::option::Option<::prost::alloc::string::String>,
5610 #[prost(uint32, optional, tag = "2")]
5611 pub index_mod_4: ::core::option::Option<u32>,
5612}
5613#[non_exhaustive]
5615#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5616pub struct CircomG1 {
5617 #[prost(string, optional, tag = "1")]
5619 pub e0: ::core::option::Option<::prost::alloc::string::String>,
5620 #[prost(string, optional, tag = "2")]
5622 pub e1: ::core::option::Option<::prost::alloc::string::String>,
5623 #[prost(string, optional, tag = "3")]
5625 pub e2: ::core::option::Option<::prost::alloc::string::String>,
5626}
5627#[non_exhaustive]
5629#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5630pub struct CircomG2 {
5631 #[prost(string, optional, tag = "1")]
5633 pub e00: ::core::option::Option<::prost::alloc::string::String>,
5634 #[prost(string, optional, tag = "2")]
5636 pub e01: ::core::option::Option<::prost::alloc::string::String>,
5637 #[prost(string, optional, tag = "3")]
5639 pub e10: ::core::option::Option<::prost::alloc::string::String>,
5640 #[prost(string, optional, tag = "4")]
5642 pub e11: ::core::option::Option<::prost::alloc::string::String>,
5643 #[prost(string, optional, tag = "5")]
5645 pub e20: ::core::option::Option<::prost::alloc::string::String>,
5646 #[prost(string, optional, tag = "6")]
5648 pub e21: ::core::option::Option<::prost::alloc::string::String>,
5649}
5650#[non_exhaustive]
5657#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5658pub struct PasskeyAuthenticator {
5659 #[prost(bytes = "bytes", optional, tag = "1")]
5664 pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
5665 #[prost(string, optional, tag = "2")]
5670 pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
5671 #[prost(message, optional, tag = "3")]
5673 pub signature: ::core::option::Option<SimpleSignature>,
5674}
5675#[non_exhaustive]
5677#[derive(Clone, PartialEq, ::prost::Message)]
5678pub struct ValidatorCommittee {
5679 #[prost(uint64, optional, tag = "1")]
5681 pub epoch: ::core::option::Option<u64>,
5682 #[prost(message, repeated, tag = "2")]
5684 pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
5685}
5686#[non_exhaustive]
5688#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5689pub struct ValidatorCommitteeMember {
5690 #[prost(bytes = "bytes", optional, tag = "1")]
5692 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5693 #[prost(uint64, optional, tag = "2")]
5695 pub weight: ::core::option::Option<u64>,
5696}
5697#[non_exhaustive]
5699#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5700pub struct ValidatorAggregatedSignature {
5701 #[prost(uint64, optional, tag = "1")]
5706 pub epoch: ::core::option::Option<u64>,
5707 #[prost(bytes = "bytes", optional, tag = "2")]
5709 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5710 #[prost(bytes = "bytes", optional, tag = "3")]
5713 pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5714}
5715#[non_exhaustive]
5722#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5723#[repr(i32)]
5724pub enum SignatureScheme {
5725 Ed25519 = 0,
5726 Secp256k1 = 1,
5727 Secp256r1 = 2,
5728 Multisig = 3,
5729 Bls12381 = 4,
5730 Zklogin = 5,
5731 Passkey = 6,
5732}
5733impl SignatureScheme {
5734 pub fn as_str_name(&self) -> &'static str {
5739 match self {
5740 Self::Ed25519 => "ED25519",
5741 Self::Secp256k1 => "SECP256K1",
5742 Self::Secp256r1 => "SECP256R1",
5743 Self::Multisig => "MULTISIG",
5744 Self::Bls12381 => "BLS12381",
5745 Self::Zklogin => "ZKLOGIN",
5746 Self::Passkey => "PASSKEY",
5747 }
5748 }
5749 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5751 match value {
5752 "ED25519" => Some(Self::Ed25519),
5753 "SECP256K1" => Some(Self::Secp256k1),
5754 "SECP256R1" => Some(Self::Secp256r1),
5755 "MULTISIG" => Some(Self::Multisig),
5756 "BLS12381" => Some(Self::Bls12381),
5757 "ZKLOGIN" => Some(Self::Zklogin),
5758 "PASSKEY" => Some(Self::Passkey),
5759 _ => None,
5760 }
5761 }
5762}
5763#[non_exhaustive]
5764#[derive(Clone, PartialEq, ::prost::Message)]
5765pub struct VerifySignatureRequest {
5766 #[prost(message, optional, tag = "1")]
5772 pub message: ::core::option::Option<Bcs>,
5773 #[prost(message, optional, tag = "2")]
5775 pub signature: ::core::option::Option<UserSignature>,
5776 #[prost(string, optional, tag = "3")]
5782 pub address: ::core::option::Option<::prost::alloc::string::String>,
5783 #[prost(message, repeated, tag = "4")]
5786 pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
5787}
5788#[non_exhaustive]
5789#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5790pub struct VerifySignatureResponse {
5791 #[prost(bool, optional, tag = "1")]
5793 pub is_valid: ::core::option::Option<bool>,
5794 #[prost(string, optional, tag = "2")]
5796 pub reason: ::core::option::Option<::prost::alloc::string::String>,
5797}
5798pub mod signature_verification_service_client {
5800 #![allow(
5801 unused_variables,
5802 dead_code,
5803 missing_docs,
5804 clippy::wildcard_imports,
5805 clippy::let_unit_value,
5806 )]
5807 use tonic::codegen::*;
5808 use tonic::codegen::http::Uri;
5809 #[derive(Debug, Clone)]
5810 pub struct SignatureVerificationServiceClient<T> {
5811 inner: tonic::client::Grpc<T>,
5812 }
5813 impl SignatureVerificationServiceClient<tonic::transport::Channel> {
5814 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5816 where
5817 D: TryInto<tonic::transport::Endpoint>,
5818 D::Error: Into<StdError>,
5819 {
5820 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5821 Ok(Self::new(conn))
5822 }
5823 }
5824 impl<T> SignatureVerificationServiceClient<T>
5825 where
5826 T: tonic::client::GrpcService<tonic::body::Body>,
5827 T::Error: Into<StdError>,
5828 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5829 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5830 {
5831 pub fn new(inner: T) -> Self {
5832 let inner = tonic::client::Grpc::new(inner);
5833 Self { inner }
5834 }
5835 pub fn with_origin(inner: T, origin: Uri) -> Self {
5836 let inner = tonic::client::Grpc::with_origin(inner, origin);
5837 Self { inner }
5838 }
5839 pub fn with_interceptor<F>(
5840 inner: T,
5841 interceptor: F,
5842 ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
5843 where
5844 F: tonic::service::Interceptor,
5845 T::ResponseBody: Default,
5846 T: tonic::codegen::Service<
5847 http::Request<tonic::body::Body>,
5848 Response = http::Response<
5849 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5850 >,
5851 >,
5852 <T as tonic::codegen::Service<
5853 http::Request<tonic::body::Body>,
5854 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5855 {
5856 SignatureVerificationServiceClient::new(
5857 InterceptedService::new(inner, interceptor),
5858 )
5859 }
5860 #[must_use]
5865 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5866 self.inner = self.inner.send_compressed(encoding);
5867 self
5868 }
5869 #[must_use]
5871 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5872 self.inner = self.inner.accept_compressed(encoding);
5873 self
5874 }
5875 #[must_use]
5879 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5880 self.inner = self.inner.max_decoding_message_size(limit);
5881 self
5882 }
5883 #[must_use]
5887 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5888 self.inner = self.inner.max_encoding_message_size(limit);
5889 self
5890 }
5891 pub async fn verify_signature(
5893 &mut self,
5894 request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
5895 ) -> std::result::Result<
5896 tonic::Response<super::VerifySignatureResponse>,
5897 tonic::Status,
5898 > {
5899 self.inner
5900 .ready()
5901 .await
5902 .map_err(|e| {
5903 tonic::Status::unknown(
5904 format!("Service was not ready: {}", e.into()),
5905 )
5906 })?;
5907 let codec = tonic_prost::ProstCodec::default();
5908 let path = http::uri::PathAndQuery::from_static(
5909 "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
5910 );
5911 let mut req = request.into_request();
5912 req.extensions_mut()
5913 .insert(
5914 GrpcMethod::new(
5915 "sui.rpc.v2.SignatureVerificationService",
5916 "VerifySignature",
5917 ),
5918 );
5919 self.inner.unary(req, path, codec).await
5920 }
5921 }
5922}
5923pub mod signature_verification_service_server {
5925 #![allow(
5926 unused_variables,
5927 dead_code,
5928 missing_docs,
5929 clippy::wildcard_imports,
5930 clippy::let_unit_value,
5931 )]
5932 use tonic::codegen::*;
5933 #[async_trait]
5935 pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
5936 async fn verify_signature(
5938 &self,
5939 request: tonic::Request<super::VerifySignatureRequest>,
5940 ) -> std::result::Result<
5941 tonic::Response<super::VerifySignatureResponse>,
5942 tonic::Status,
5943 > {
5944 Err(tonic::Status::unimplemented("Not yet implemented"))
5945 }
5946 }
5947 #[derive(Debug)]
5948 pub struct SignatureVerificationServiceServer<T> {
5949 inner: Arc<T>,
5950 accept_compression_encodings: EnabledCompressionEncodings,
5951 send_compression_encodings: EnabledCompressionEncodings,
5952 max_decoding_message_size: Option<usize>,
5953 max_encoding_message_size: Option<usize>,
5954 }
5955 impl<T> SignatureVerificationServiceServer<T> {
5956 pub fn new(inner: T) -> Self {
5957 Self::from_arc(Arc::new(inner))
5958 }
5959 pub fn from_arc(inner: Arc<T>) -> Self {
5960 Self {
5961 inner,
5962 accept_compression_encodings: Default::default(),
5963 send_compression_encodings: Default::default(),
5964 max_decoding_message_size: None,
5965 max_encoding_message_size: None,
5966 }
5967 }
5968 pub fn with_interceptor<F>(
5969 inner: T,
5970 interceptor: F,
5971 ) -> InterceptedService<Self, F>
5972 where
5973 F: tonic::service::Interceptor,
5974 {
5975 InterceptedService::new(Self::new(inner), interceptor)
5976 }
5977 #[must_use]
5979 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5980 self.accept_compression_encodings.enable(encoding);
5981 self
5982 }
5983 #[must_use]
5985 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5986 self.send_compression_encodings.enable(encoding);
5987 self
5988 }
5989 #[must_use]
5993 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5994 self.max_decoding_message_size = Some(limit);
5995 self
5996 }
5997 #[must_use]
6001 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6002 self.max_encoding_message_size = Some(limit);
6003 self
6004 }
6005 }
6006 impl<T, B> tonic::codegen::Service<http::Request<B>>
6007 for SignatureVerificationServiceServer<T>
6008 where
6009 T: SignatureVerificationService,
6010 B: Body + std::marker::Send + 'static,
6011 B::Error: Into<StdError> + std::marker::Send + 'static,
6012 {
6013 type Response = http::Response<tonic::body::Body>;
6014 type Error = std::convert::Infallible;
6015 type Future = BoxFuture<Self::Response, Self::Error>;
6016 fn poll_ready(
6017 &mut self,
6018 _cx: &mut Context<'_>,
6019 ) -> Poll<std::result::Result<(), Self::Error>> {
6020 Poll::Ready(Ok(()))
6021 }
6022 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6023 match req.uri().path() {
6024 "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
6025 #[allow(non_camel_case_types)]
6026 struct VerifySignatureSvc<T: SignatureVerificationService>(
6027 pub Arc<T>,
6028 );
6029 impl<
6030 T: SignatureVerificationService,
6031 > tonic::server::UnaryService<super::VerifySignatureRequest>
6032 for VerifySignatureSvc<T> {
6033 type Response = super::VerifySignatureResponse;
6034 type Future = BoxFuture<
6035 tonic::Response<Self::Response>,
6036 tonic::Status,
6037 >;
6038 fn call(
6039 &mut self,
6040 request: tonic::Request<super::VerifySignatureRequest>,
6041 ) -> Self::Future {
6042 let inner = Arc::clone(&self.0);
6043 let fut = async move {
6044 <T as SignatureVerificationService>::verify_signature(
6045 &inner,
6046 request,
6047 )
6048 .await
6049 };
6050 Box::pin(fut)
6051 }
6052 }
6053 let accept_compression_encodings = self.accept_compression_encodings;
6054 let send_compression_encodings = self.send_compression_encodings;
6055 let max_decoding_message_size = self.max_decoding_message_size;
6056 let max_encoding_message_size = self.max_encoding_message_size;
6057 let inner = self.inner.clone();
6058 let fut = async move {
6059 let method = VerifySignatureSvc(inner);
6060 let codec = tonic_prost::ProstCodec::default();
6061 let mut grpc = tonic::server::Grpc::new(codec)
6062 .apply_compression_config(
6063 accept_compression_encodings,
6064 send_compression_encodings,
6065 )
6066 .apply_max_message_size_config(
6067 max_decoding_message_size,
6068 max_encoding_message_size,
6069 );
6070 let res = grpc.unary(method, req).await;
6071 Ok(res)
6072 };
6073 Box::pin(fut)
6074 }
6075 _ => {
6076 Box::pin(async move {
6077 let mut response = http::Response::new(
6078 tonic::body::Body::default(),
6079 );
6080 let headers = response.headers_mut();
6081 headers
6082 .insert(
6083 tonic::Status::GRPC_STATUS,
6084 (tonic::Code::Unimplemented as i32).into(),
6085 );
6086 headers
6087 .insert(
6088 http::header::CONTENT_TYPE,
6089 tonic::metadata::GRPC_CONTENT_TYPE,
6090 );
6091 Ok(response)
6092 })
6093 }
6094 }
6095 }
6096 }
6097 impl<T> Clone for SignatureVerificationServiceServer<T> {
6098 fn clone(&self) -> Self {
6099 let inner = self.inner.clone();
6100 Self {
6101 inner,
6102 accept_compression_encodings: self.accept_compression_encodings,
6103 send_compression_encodings: self.send_compression_encodings,
6104 max_decoding_message_size: self.max_decoding_message_size,
6105 max_encoding_message_size: self.max_encoding_message_size,
6106 }
6107 }
6108 }
6109 pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
6111 impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
6112 const NAME: &'static str = SERVICE_NAME;
6113 }
6114}
6115#[non_exhaustive]
6117#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6118pub struct GetCoinInfoRequest {
6119 #[prost(string, optional, tag = "1")]
6121 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6122}
6123#[non_exhaustive]
6125#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6126pub struct GetCoinInfoResponse {
6127 #[prost(string, optional, tag = "1")]
6129 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6130 #[prost(message, optional, tag = "2")]
6133 pub metadata: ::core::option::Option<CoinMetadata>,
6134 #[prost(message, optional, tag = "3")]
6137 pub treasury: ::core::option::Option<CoinTreasury>,
6138 #[prost(message, optional, tag = "4")]
6146 pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
6147}
6148#[non_exhaustive]
6150#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6151pub struct CoinMetadata {
6152 #[prost(string, optional, tag = "1")]
6155 pub id: ::core::option::Option<::prost::alloc::string::String>,
6156 #[prost(uint32, optional, tag = "2")]
6158 pub decimals: ::core::option::Option<u32>,
6159 #[prost(string, optional, tag = "3")]
6161 pub name: ::core::option::Option<::prost::alloc::string::String>,
6162 #[prost(string, optional, tag = "4")]
6164 pub symbol: ::core::option::Option<::prost::alloc::string::String>,
6165 #[prost(string, optional, tag = "5")]
6167 pub description: ::core::option::Option<::prost::alloc::string::String>,
6168 #[prost(string, optional, tag = "6")]
6170 pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
6171 #[prost(string, optional, tag = "7")]
6175 pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6176 #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
6178 pub metadata_cap_state: ::core::option::Option<i32>,
6179}
6180pub mod coin_metadata {
6182 #[non_exhaustive]
6184 #[derive(
6185 Clone,
6186 Copy,
6187 Debug,
6188 PartialEq,
6189 Eq,
6190 Hash,
6191 PartialOrd,
6192 Ord,
6193 ::prost::Enumeration
6194 )]
6195 #[repr(i32)]
6196 pub enum MetadataCapState {
6197 Unknown = 0,
6200 Claimed = 1,
6202 Unclaimed = 2,
6204 Deleted = 3,
6206 }
6207 impl MetadataCapState {
6208 pub fn as_str_name(&self) -> &'static str {
6213 match self {
6214 Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
6215 Self::Claimed => "CLAIMED",
6216 Self::Unclaimed => "UNCLAIMED",
6217 Self::Deleted => "DELETED",
6218 }
6219 }
6220 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6222 match value {
6223 "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
6224 "CLAIMED" => Some(Self::Claimed),
6225 "UNCLAIMED" => Some(Self::Unclaimed),
6226 "DELETED" => Some(Self::Deleted),
6227 _ => None,
6228 }
6229 }
6230 }
6231}
6232#[non_exhaustive]
6234#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6235pub struct CoinTreasury {
6236 #[prost(string, optional, tag = "1")]
6238 pub id: ::core::option::Option<::prost::alloc::string::String>,
6239 #[prost(uint64, optional, tag = "2")]
6241 pub total_supply: ::core::option::Option<u64>,
6242 #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
6244 pub supply_state: ::core::option::Option<i32>,
6245}
6246pub mod coin_treasury {
6248 #[non_exhaustive]
6250 #[derive(
6251 Clone,
6252 Copy,
6253 Debug,
6254 PartialEq,
6255 Eq,
6256 Hash,
6257 PartialOrd,
6258 Ord,
6259 ::prost::Enumeration
6260 )]
6261 #[repr(i32)]
6262 pub enum SupplyState {
6263 Unknown = 0,
6265 Fixed = 1,
6267 BurnOnly = 2,
6269 }
6270 impl SupplyState {
6271 pub fn as_str_name(&self) -> &'static str {
6276 match self {
6277 Self::Unknown => "SUPPLY_STATE_UNKNOWN",
6278 Self::Fixed => "FIXED",
6279 Self::BurnOnly => "BURN_ONLY",
6280 }
6281 }
6282 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6284 match value {
6285 "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
6286 "FIXED" => Some(Self::Fixed),
6287 "BURN_ONLY" => Some(Self::BurnOnly),
6288 _ => None,
6289 }
6290 }
6291 }
6292}
6293#[non_exhaustive]
6295#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6296pub struct RegulatedCoinMetadata {
6297 #[prost(string, optional, tag = "1")]
6300 pub id: ::core::option::Option<::prost::alloc::string::String>,
6301 #[prost(string, optional, tag = "2")]
6303 pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
6304 #[prost(string, optional, tag = "3")]
6306 pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
6307 #[prost(bool, optional, tag = "4")]
6309 pub allow_global_pause: ::core::option::Option<bool>,
6310 #[prost(uint32, optional, tag = "5")]
6312 pub variant: ::core::option::Option<u32>,
6313 #[prost(
6315 enumeration = "regulated_coin_metadata::CoinRegulatedState",
6316 optional,
6317 tag = "6"
6318 )]
6319 pub coin_regulated_state: ::core::option::Option<i32>,
6320}
6321pub mod regulated_coin_metadata {
6323 #[non_exhaustive]
6325 #[derive(
6326 Clone,
6327 Copy,
6328 Debug,
6329 PartialEq,
6330 Eq,
6331 Hash,
6332 PartialOrd,
6333 Ord,
6334 ::prost::Enumeration
6335 )]
6336 #[repr(i32)]
6337 pub enum CoinRegulatedState {
6338 Unknown = 0,
6343 Regulated = 1,
6345 Unregulated = 2,
6347 }
6348 impl CoinRegulatedState {
6349 pub fn as_str_name(&self) -> &'static str {
6354 match self {
6355 Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
6356 Self::Regulated => "REGULATED",
6357 Self::Unregulated => "UNREGULATED",
6358 }
6359 }
6360 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6362 match value {
6363 "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
6364 "REGULATED" => Some(Self::Regulated),
6365 "UNREGULATED" => Some(Self::Unregulated),
6366 _ => None,
6367 }
6368 }
6369 }
6370}
6371#[non_exhaustive]
6373#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6374pub struct GetBalanceRequest {
6375 #[prost(string, optional, tag = "1")]
6377 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6378 #[prost(string, optional, tag = "2")]
6380 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6381}
6382#[non_exhaustive]
6385#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6386pub struct GetBalanceResponse {
6387 #[prost(message, optional, tag = "1")]
6389 pub balance: ::core::option::Option<Balance>,
6390}
6391#[non_exhaustive]
6393#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6394pub struct ListBalancesRequest {
6395 #[prost(string, optional, tag = "1")]
6397 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6398 #[prost(uint32, optional, tag = "2")]
6402 pub page_size: ::core::option::Option<u32>,
6403 #[prost(bytes = "bytes", optional, tag = "3")]
6409 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6410}
6411#[non_exhaustive]
6414#[derive(Clone, PartialEq, ::prost::Message)]
6415pub struct ListBalancesResponse {
6416 #[prost(message, repeated, tag = "1")]
6418 pub balances: ::prost::alloc::vec::Vec<Balance>,
6419 #[prost(bytes = "bytes", optional, tag = "2")]
6422 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6423}
6424#[non_exhaustive]
6426#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6427pub struct Balance {
6428 #[prost(string, optional, tag = "1")]
6430 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6431 #[prost(uint64, optional, tag = "3")]
6435 pub balance: ::core::option::Option<u64>,
6436 #[prost(uint64, optional, tag = "4")]
6438 pub address_balance: ::core::option::Option<u64>,
6439 #[prost(uint64, optional, tag = "5")]
6441 pub coin_balance: ::core::option::Option<u64>,
6442}
6443#[non_exhaustive]
6445#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6446pub struct ListDynamicFieldsRequest {
6447 #[prost(string, optional, tag = "1")]
6449 pub parent: ::core::option::Option<::prost::alloc::string::String>,
6450 #[prost(uint32, optional, tag = "2")]
6454 pub page_size: ::core::option::Option<u32>,
6455 #[prost(bytes = "bytes", optional, tag = "3")]
6461 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6462 #[prost(message, optional, tag = "4")]
6465 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6466}
6467#[non_exhaustive]
6469#[derive(Clone, PartialEq, ::prost::Message)]
6470pub struct ListDynamicFieldsResponse {
6471 #[prost(message, repeated, tag = "1")]
6473 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
6474 #[prost(bytes = "bytes", optional, tag = "2")]
6477 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6478}
6479#[non_exhaustive]
6480#[derive(Clone, PartialEq, ::prost::Message)]
6481pub struct DynamicField {
6482 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
6483 pub kind: ::core::option::Option<i32>,
6484 #[prost(string, optional, tag = "2")]
6486 pub parent: ::core::option::Option<::prost::alloc::string::String>,
6487 #[prost(string, optional, tag = "3")]
6489 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
6490 #[prost(message, optional, tag = "4")]
6492 pub field_object: ::core::option::Option<Object>,
6493 #[prost(message, optional, tag = "5")]
6495 pub name: ::core::option::Option<Bcs>,
6496 #[prost(message, optional, tag = "6")]
6498 pub value: ::core::option::Option<Bcs>,
6499 #[prost(string, optional, tag = "7")]
6505 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
6506 #[prost(string, optional, tag = "8")]
6512 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
6513 #[prost(message, optional, tag = "9")]
6515 pub child_object: ::core::option::Option<Object>,
6516}
6517pub mod dynamic_field {
6519 #[non_exhaustive]
6520 #[derive(
6521 Clone,
6522 Copy,
6523 Debug,
6524 PartialEq,
6525 Eq,
6526 Hash,
6527 PartialOrd,
6528 Ord,
6529 ::prost::Enumeration
6530 )]
6531 #[repr(i32)]
6532 pub enum DynamicFieldKind {
6533 Unknown = 0,
6534 Field = 1,
6535 Object = 2,
6536 }
6537 impl DynamicFieldKind {
6538 pub fn as_str_name(&self) -> &'static str {
6543 match self {
6544 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
6545 Self::Field => "FIELD",
6546 Self::Object => "OBJECT",
6547 }
6548 }
6549 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6551 match value {
6552 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
6553 "FIELD" => Some(Self::Field),
6554 "OBJECT" => Some(Self::Object),
6555 _ => None,
6556 }
6557 }
6558 }
6559}
6560#[non_exhaustive]
6561#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6562pub struct ListOwnedObjectsRequest {
6563 #[prost(string, optional, tag = "1")]
6565 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6566 #[prost(uint32, optional, tag = "2")]
6570 pub page_size: ::core::option::Option<u32>,
6571 #[prost(bytes = "bytes", optional, tag = "3")]
6577 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6578 #[prost(message, optional, tag = "4")]
6581 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6582 #[prost(string, optional, tag = "5")]
6591 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
6592}
6593#[non_exhaustive]
6594#[derive(Clone, PartialEq, ::prost::Message)]
6595pub struct ListOwnedObjectsResponse {
6596 #[prost(message, repeated, tag = "1")]
6598 pub objects: ::prost::alloc::vec::Vec<Object>,
6599 #[prost(bytes = "bytes", optional, tag = "2")]
6602 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6603}
6604pub mod state_service_client {
6606 #![allow(
6607 unused_variables,
6608 dead_code,
6609 missing_docs,
6610 clippy::wildcard_imports,
6611 clippy::let_unit_value,
6612 )]
6613 use tonic::codegen::*;
6614 use tonic::codegen::http::Uri;
6615 #[derive(Debug, Clone)]
6616 pub struct StateServiceClient<T> {
6617 inner: tonic::client::Grpc<T>,
6618 }
6619 impl StateServiceClient<tonic::transport::Channel> {
6620 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6622 where
6623 D: TryInto<tonic::transport::Endpoint>,
6624 D::Error: Into<StdError>,
6625 {
6626 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6627 Ok(Self::new(conn))
6628 }
6629 }
6630 impl<T> StateServiceClient<T>
6631 where
6632 T: tonic::client::GrpcService<tonic::body::Body>,
6633 T::Error: Into<StdError>,
6634 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6635 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6636 {
6637 pub fn new(inner: T) -> Self {
6638 let inner = tonic::client::Grpc::new(inner);
6639 Self { inner }
6640 }
6641 pub fn with_origin(inner: T, origin: Uri) -> Self {
6642 let inner = tonic::client::Grpc::with_origin(inner, origin);
6643 Self { inner }
6644 }
6645 pub fn with_interceptor<F>(
6646 inner: T,
6647 interceptor: F,
6648 ) -> StateServiceClient<InterceptedService<T, F>>
6649 where
6650 F: tonic::service::Interceptor,
6651 T::ResponseBody: Default,
6652 T: tonic::codegen::Service<
6653 http::Request<tonic::body::Body>,
6654 Response = http::Response<
6655 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6656 >,
6657 >,
6658 <T as tonic::codegen::Service<
6659 http::Request<tonic::body::Body>,
6660 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6661 {
6662 StateServiceClient::new(InterceptedService::new(inner, interceptor))
6663 }
6664 #[must_use]
6669 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6670 self.inner = self.inner.send_compressed(encoding);
6671 self
6672 }
6673 #[must_use]
6675 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6676 self.inner = self.inner.accept_compressed(encoding);
6677 self
6678 }
6679 #[must_use]
6683 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6684 self.inner = self.inner.max_decoding_message_size(limit);
6685 self
6686 }
6687 #[must_use]
6691 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6692 self.inner = self.inner.max_encoding_message_size(limit);
6693 self
6694 }
6695 pub async fn list_dynamic_fields(
6696 &mut self,
6697 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
6698 ) -> std::result::Result<
6699 tonic::Response<super::ListDynamicFieldsResponse>,
6700 tonic::Status,
6701 > {
6702 self.inner
6703 .ready()
6704 .await
6705 .map_err(|e| {
6706 tonic::Status::unknown(
6707 format!("Service was not ready: {}", e.into()),
6708 )
6709 })?;
6710 let codec = tonic_prost::ProstCodec::default();
6711 let path = http::uri::PathAndQuery::from_static(
6712 "/sui.rpc.v2.StateService/ListDynamicFields",
6713 );
6714 let mut req = request.into_request();
6715 req.extensions_mut()
6716 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
6717 self.inner.unary(req, path, codec).await
6718 }
6719 pub async fn list_owned_objects(
6720 &mut self,
6721 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
6722 ) -> std::result::Result<
6723 tonic::Response<super::ListOwnedObjectsResponse>,
6724 tonic::Status,
6725 > {
6726 self.inner
6727 .ready()
6728 .await
6729 .map_err(|e| {
6730 tonic::Status::unknown(
6731 format!("Service was not ready: {}", e.into()),
6732 )
6733 })?;
6734 let codec = tonic_prost::ProstCodec::default();
6735 let path = http::uri::PathAndQuery::from_static(
6736 "/sui.rpc.v2.StateService/ListOwnedObjects",
6737 );
6738 let mut req = request.into_request();
6739 req.extensions_mut()
6740 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
6741 self.inner.unary(req, path, codec).await
6742 }
6743 pub async fn get_coin_info(
6744 &mut self,
6745 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
6746 ) -> std::result::Result<
6747 tonic::Response<super::GetCoinInfoResponse>,
6748 tonic::Status,
6749 > {
6750 self.inner
6751 .ready()
6752 .await
6753 .map_err(|e| {
6754 tonic::Status::unknown(
6755 format!("Service was not ready: {}", e.into()),
6756 )
6757 })?;
6758 let codec = tonic_prost::ProstCodec::default();
6759 let path = http::uri::PathAndQuery::from_static(
6760 "/sui.rpc.v2.StateService/GetCoinInfo",
6761 );
6762 let mut req = request.into_request();
6763 req.extensions_mut()
6764 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
6765 self.inner.unary(req, path, codec).await
6766 }
6767 pub async fn get_balance(
6768 &mut self,
6769 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
6770 ) -> std::result::Result<
6771 tonic::Response<super::GetBalanceResponse>,
6772 tonic::Status,
6773 > {
6774 self.inner
6775 .ready()
6776 .await
6777 .map_err(|e| {
6778 tonic::Status::unknown(
6779 format!("Service was not ready: {}", e.into()),
6780 )
6781 })?;
6782 let codec = tonic_prost::ProstCodec::default();
6783 let path = http::uri::PathAndQuery::from_static(
6784 "/sui.rpc.v2.StateService/GetBalance",
6785 );
6786 let mut req = request.into_request();
6787 req.extensions_mut()
6788 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
6789 self.inner.unary(req, path, codec).await
6790 }
6791 pub async fn list_balances(
6792 &mut self,
6793 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
6794 ) -> std::result::Result<
6795 tonic::Response<super::ListBalancesResponse>,
6796 tonic::Status,
6797 > {
6798 self.inner
6799 .ready()
6800 .await
6801 .map_err(|e| {
6802 tonic::Status::unknown(
6803 format!("Service was not ready: {}", e.into()),
6804 )
6805 })?;
6806 let codec = tonic_prost::ProstCodec::default();
6807 let path = http::uri::PathAndQuery::from_static(
6808 "/sui.rpc.v2.StateService/ListBalances",
6809 );
6810 let mut req = request.into_request();
6811 req.extensions_mut()
6812 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
6813 self.inner.unary(req, path, codec).await
6814 }
6815 }
6816}
6817pub mod state_service_server {
6819 #![allow(
6820 unused_variables,
6821 dead_code,
6822 missing_docs,
6823 clippy::wildcard_imports,
6824 clippy::let_unit_value,
6825 )]
6826 use tonic::codegen::*;
6827 #[async_trait]
6829 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
6830 async fn list_dynamic_fields(
6831 &self,
6832 request: tonic::Request<super::ListDynamicFieldsRequest>,
6833 ) -> std::result::Result<
6834 tonic::Response<super::ListDynamicFieldsResponse>,
6835 tonic::Status,
6836 > {
6837 Err(tonic::Status::unimplemented("Not yet implemented"))
6838 }
6839 async fn list_owned_objects(
6840 &self,
6841 request: tonic::Request<super::ListOwnedObjectsRequest>,
6842 ) -> std::result::Result<
6843 tonic::Response<super::ListOwnedObjectsResponse>,
6844 tonic::Status,
6845 > {
6846 Err(tonic::Status::unimplemented("Not yet implemented"))
6847 }
6848 async fn get_coin_info(
6849 &self,
6850 request: tonic::Request<super::GetCoinInfoRequest>,
6851 ) -> std::result::Result<
6852 tonic::Response<super::GetCoinInfoResponse>,
6853 tonic::Status,
6854 > {
6855 Err(tonic::Status::unimplemented("Not yet implemented"))
6856 }
6857 async fn get_balance(
6858 &self,
6859 request: tonic::Request<super::GetBalanceRequest>,
6860 ) -> std::result::Result<
6861 tonic::Response<super::GetBalanceResponse>,
6862 tonic::Status,
6863 > {
6864 Err(tonic::Status::unimplemented("Not yet implemented"))
6865 }
6866 async fn list_balances(
6867 &self,
6868 request: tonic::Request<super::ListBalancesRequest>,
6869 ) -> std::result::Result<
6870 tonic::Response<super::ListBalancesResponse>,
6871 tonic::Status,
6872 > {
6873 Err(tonic::Status::unimplemented("Not yet implemented"))
6874 }
6875 }
6876 #[derive(Debug)]
6877 pub struct StateServiceServer<T> {
6878 inner: Arc<T>,
6879 accept_compression_encodings: EnabledCompressionEncodings,
6880 send_compression_encodings: EnabledCompressionEncodings,
6881 max_decoding_message_size: Option<usize>,
6882 max_encoding_message_size: Option<usize>,
6883 }
6884 impl<T> StateServiceServer<T> {
6885 pub fn new(inner: T) -> Self {
6886 Self::from_arc(Arc::new(inner))
6887 }
6888 pub fn from_arc(inner: Arc<T>) -> Self {
6889 Self {
6890 inner,
6891 accept_compression_encodings: Default::default(),
6892 send_compression_encodings: Default::default(),
6893 max_decoding_message_size: None,
6894 max_encoding_message_size: None,
6895 }
6896 }
6897 pub fn with_interceptor<F>(
6898 inner: T,
6899 interceptor: F,
6900 ) -> InterceptedService<Self, F>
6901 where
6902 F: tonic::service::Interceptor,
6903 {
6904 InterceptedService::new(Self::new(inner), interceptor)
6905 }
6906 #[must_use]
6908 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6909 self.accept_compression_encodings.enable(encoding);
6910 self
6911 }
6912 #[must_use]
6914 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6915 self.send_compression_encodings.enable(encoding);
6916 self
6917 }
6918 #[must_use]
6922 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6923 self.max_decoding_message_size = Some(limit);
6924 self
6925 }
6926 #[must_use]
6930 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6931 self.max_encoding_message_size = Some(limit);
6932 self
6933 }
6934 }
6935 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
6936 where
6937 T: StateService,
6938 B: Body + std::marker::Send + 'static,
6939 B::Error: Into<StdError> + std::marker::Send + 'static,
6940 {
6941 type Response = http::Response<tonic::body::Body>;
6942 type Error = std::convert::Infallible;
6943 type Future = BoxFuture<Self::Response, Self::Error>;
6944 fn poll_ready(
6945 &mut self,
6946 _cx: &mut Context<'_>,
6947 ) -> Poll<std::result::Result<(), Self::Error>> {
6948 Poll::Ready(Ok(()))
6949 }
6950 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6951 match req.uri().path() {
6952 "/sui.rpc.v2.StateService/ListDynamicFields" => {
6953 #[allow(non_camel_case_types)]
6954 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
6955 impl<
6956 T: StateService,
6957 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
6958 for ListDynamicFieldsSvc<T> {
6959 type Response = super::ListDynamicFieldsResponse;
6960 type Future = BoxFuture<
6961 tonic::Response<Self::Response>,
6962 tonic::Status,
6963 >;
6964 fn call(
6965 &mut self,
6966 request: tonic::Request<super::ListDynamicFieldsRequest>,
6967 ) -> Self::Future {
6968 let inner = Arc::clone(&self.0);
6969 let fut = async move {
6970 <T as StateService>::list_dynamic_fields(&inner, request)
6971 .await
6972 };
6973 Box::pin(fut)
6974 }
6975 }
6976 let accept_compression_encodings = self.accept_compression_encodings;
6977 let send_compression_encodings = self.send_compression_encodings;
6978 let max_decoding_message_size = self.max_decoding_message_size;
6979 let max_encoding_message_size = self.max_encoding_message_size;
6980 let inner = self.inner.clone();
6981 let fut = async move {
6982 let method = ListDynamicFieldsSvc(inner);
6983 let codec = tonic_prost::ProstCodec::default();
6984 let mut grpc = tonic::server::Grpc::new(codec)
6985 .apply_compression_config(
6986 accept_compression_encodings,
6987 send_compression_encodings,
6988 )
6989 .apply_max_message_size_config(
6990 max_decoding_message_size,
6991 max_encoding_message_size,
6992 );
6993 let res = grpc.unary(method, req).await;
6994 Ok(res)
6995 };
6996 Box::pin(fut)
6997 }
6998 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
6999 #[allow(non_camel_case_types)]
7000 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
7001 impl<
7002 T: StateService,
7003 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
7004 for ListOwnedObjectsSvc<T> {
7005 type Response = super::ListOwnedObjectsResponse;
7006 type Future = BoxFuture<
7007 tonic::Response<Self::Response>,
7008 tonic::Status,
7009 >;
7010 fn call(
7011 &mut self,
7012 request: tonic::Request<super::ListOwnedObjectsRequest>,
7013 ) -> Self::Future {
7014 let inner = Arc::clone(&self.0);
7015 let fut = async move {
7016 <T as StateService>::list_owned_objects(&inner, request)
7017 .await
7018 };
7019 Box::pin(fut)
7020 }
7021 }
7022 let accept_compression_encodings = self.accept_compression_encodings;
7023 let send_compression_encodings = self.send_compression_encodings;
7024 let max_decoding_message_size = self.max_decoding_message_size;
7025 let max_encoding_message_size = self.max_encoding_message_size;
7026 let inner = self.inner.clone();
7027 let fut = async move {
7028 let method = ListOwnedObjectsSvc(inner);
7029 let codec = tonic_prost::ProstCodec::default();
7030 let mut grpc = tonic::server::Grpc::new(codec)
7031 .apply_compression_config(
7032 accept_compression_encodings,
7033 send_compression_encodings,
7034 )
7035 .apply_max_message_size_config(
7036 max_decoding_message_size,
7037 max_encoding_message_size,
7038 );
7039 let res = grpc.unary(method, req).await;
7040 Ok(res)
7041 };
7042 Box::pin(fut)
7043 }
7044 "/sui.rpc.v2.StateService/GetCoinInfo" => {
7045 #[allow(non_camel_case_types)]
7046 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
7047 impl<
7048 T: StateService,
7049 > tonic::server::UnaryService<super::GetCoinInfoRequest>
7050 for GetCoinInfoSvc<T> {
7051 type Response = super::GetCoinInfoResponse;
7052 type Future = BoxFuture<
7053 tonic::Response<Self::Response>,
7054 tonic::Status,
7055 >;
7056 fn call(
7057 &mut self,
7058 request: tonic::Request<super::GetCoinInfoRequest>,
7059 ) -> Self::Future {
7060 let inner = Arc::clone(&self.0);
7061 let fut = async move {
7062 <T as StateService>::get_coin_info(&inner, request).await
7063 };
7064 Box::pin(fut)
7065 }
7066 }
7067 let accept_compression_encodings = self.accept_compression_encodings;
7068 let send_compression_encodings = self.send_compression_encodings;
7069 let max_decoding_message_size = self.max_decoding_message_size;
7070 let max_encoding_message_size = self.max_encoding_message_size;
7071 let inner = self.inner.clone();
7072 let fut = async move {
7073 let method = GetCoinInfoSvc(inner);
7074 let codec = tonic_prost::ProstCodec::default();
7075 let mut grpc = tonic::server::Grpc::new(codec)
7076 .apply_compression_config(
7077 accept_compression_encodings,
7078 send_compression_encodings,
7079 )
7080 .apply_max_message_size_config(
7081 max_decoding_message_size,
7082 max_encoding_message_size,
7083 );
7084 let res = grpc.unary(method, req).await;
7085 Ok(res)
7086 };
7087 Box::pin(fut)
7088 }
7089 "/sui.rpc.v2.StateService/GetBalance" => {
7090 #[allow(non_camel_case_types)]
7091 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
7092 impl<
7093 T: StateService,
7094 > tonic::server::UnaryService<super::GetBalanceRequest>
7095 for GetBalanceSvc<T> {
7096 type Response = super::GetBalanceResponse;
7097 type Future = BoxFuture<
7098 tonic::Response<Self::Response>,
7099 tonic::Status,
7100 >;
7101 fn call(
7102 &mut self,
7103 request: tonic::Request<super::GetBalanceRequest>,
7104 ) -> Self::Future {
7105 let inner = Arc::clone(&self.0);
7106 let fut = async move {
7107 <T as StateService>::get_balance(&inner, request).await
7108 };
7109 Box::pin(fut)
7110 }
7111 }
7112 let accept_compression_encodings = self.accept_compression_encodings;
7113 let send_compression_encodings = self.send_compression_encodings;
7114 let max_decoding_message_size = self.max_decoding_message_size;
7115 let max_encoding_message_size = self.max_encoding_message_size;
7116 let inner = self.inner.clone();
7117 let fut = async move {
7118 let method = GetBalanceSvc(inner);
7119 let codec = tonic_prost::ProstCodec::default();
7120 let mut grpc = tonic::server::Grpc::new(codec)
7121 .apply_compression_config(
7122 accept_compression_encodings,
7123 send_compression_encodings,
7124 )
7125 .apply_max_message_size_config(
7126 max_decoding_message_size,
7127 max_encoding_message_size,
7128 );
7129 let res = grpc.unary(method, req).await;
7130 Ok(res)
7131 };
7132 Box::pin(fut)
7133 }
7134 "/sui.rpc.v2.StateService/ListBalances" => {
7135 #[allow(non_camel_case_types)]
7136 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
7137 impl<
7138 T: StateService,
7139 > tonic::server::UnaryService<super::ListBalancesRequest>
7140 for ListBalancesSvc<T> {
7141 type Response = super::ListBalancesResponse;
7142 type Future = BoxFuture<
7143 tonic::Response<Self::Response>,
7144 tonic::Status,
7145 >;
7146 fn call(
7147 &mut self,
7148 request: tonic::Request<super::ListBalancesRequest>,
7149 ) -> Self::Future {
7150 let inner = Arc::clone(&self.0);
7151 let fut = async move {
7152 <T as StateService>::list_balances(&inner, request).await
7153 };
7154 Box::pin(fut)
7155 }
7156 }
7157 let accept_compression_encodings = self.accept_compression_encodings;
7158 let send_compression_encodings = self.send_compression_encodings;
7159 let max_decoding_message_size = self.max_decoding_message_size;
7160 let max_encoding_message_size = self.max_encoding_message_size;
7161 let inner = self.inner.clone();
7162 let fut = async move {
7163 let method = ListBalancesSvc(inner);
7164 let codec = tonic_prost::ProstCodec::default();
7165 let mut grpc = tonic::server::Grpc::new(codec)
7166 .apply_compression_config(
7167 accept_compression_encodings,
7168 send_compression_encodings,
7169 )
7170 .apply_max_message_size_config(
7171 max_decoding_message_size,
7172 max_encoding_message_size,
7173 );
7174 let res = grpc.unary(method, req).await;
7175 Ok(res)
7176 };
7177 Box::pin(fut)
7178 }
7179 _ => {
7180 Box::pin(async move {
7181 let mut response = http::Response::new(
7182 tonic::body::Body::default(),
7183 );
7184 let headers = response.headers_mut();
7185 headers
7186 .insert(
7187 tonic::Status::GRPC_STATUS,
7188 (tonic::Code::Unimplemented as i32).into(),
7189 );
7190 headers
7191 .insert(
7192 http::header::CONTENT_TYPE,
7193 tonic::metadata::GRPC_CONTENT_TYPE,
7194 );
7195 Ok(response)
7196 })
7197 }
7198 }
7199 }
7200 }
7201 impl<T> Clone for StateServiceServer<T> {
7202 fn clone(&self) -> Self {
7203 let inner = self.inner.clone();
7204 Self {
7205 inner,
7206 accept_compression_encodings: self.accept_compression_encodings,
7207 send_compression_encodings: self.send_compression_encodings,
7208 max_decoding_message_size: self.max_decoding_message_size,
7209 max_encoding_message_size: self.max_encoding_message_size,
7210 }
7211 }
7212 }
7213 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
7215 impl<T> tonic::server::NamedService for StateServiceServer<T> {
7216 const NAME: &'static str = SERVICE_NAME;
7217 }
7218}
7219#[derive(Eq, Hash)]
7221#[non_exhaustive]
7222#[derive(Clone, PartialEq, ::prost::Message)]
7223pub struct SubscribeCheckpointsRequest {
7224 #[prost(message, optional, tag = "1")]
7228 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7229 #[prost(message, optional, tag = "2")]
7233 pub filter: ::core::option::Option<TransactionFilter>,
7234}
7235#[non_exhaustive]
7243#[derive(Clone, PartialEq, ::prost::Message)]
7244pub struct SubscribeCheckpointsResponse {
7245 #[prost(uint64, optional, tag = "1")]
7250 pub cursor: ::core::option::Option<u64>,
7251 #[prost(message, optional, tag = "2")]
7254 pub checkpoint: ::core::option::Option<Checkpoint>,
7255}
7256#[non_exhaustive]
7258#[derive(Clone, PartialEq, ::prost::Message)]
7259pub struct SubscribeTransactionsRequest {
7260 #[prost(message, optional, tag = "1")]
7263 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7264 #[prost(message, optional, tag = "2")]
7267 pub filter: ::core::option::Option<TransactionFilter>,
7268}
7269#[non_exhaustive]
7274#[derive(Clone, PartialEq, ::prost::Message)]
7275pub struct SubscribeTransactionsResponse {
7276 #[prost(message, optional, tag = "1")]
7279 pub transaction: ::core::option::Option<ExecutedTransaction>,
7280 #[prost(message, optional, tag = "2")]
7282 pub watermark: ::core::option::Option<Watermark>,
7283}
7284#[non_exhaustive]
7286#[derive(Clone, PartialEq, ::prost::Message)]
7287pub struct SubscribeEventsRequest {
7288 #[prost(message, optional, tag = "1")]
7291 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7292 #[prost(message, optional, tag = "2")]
7295 pub filter: ::core::option::Option<EventFilter>,
7296}
7297#[non_exhaustive]
7302#[derive(Clone, PartialEq, ::prost::Message)]
7303pub struct SubscribeEventsResponse {
7304 #[prost(message, optional, tag = "1")]
7309 pub event: ::core::option::Option<Event>,
7310 #[prost(message, optional, tag = "2")]
7312 pub watermark: ::core::option::Option<Watermark>,
7313}
7314pub mod subscription_service_client {
7316 #![allow(
7317 unused_variables,
7318 dead_code,
7319 missing_docs,
7320 clippy::wildcard_imports,
7321 clippy::let_unit_value,
7322 )]
7323 use tonic::codegen::*;
7324 use tonic::codegen::http::Uri;
7325 #[derive(Debug, Clone)]
7353 pub struct SubscriptionServiceClient<T> {
7354 inner: tonic::client::Grpc<T>,
7355 }
7356 impl SubscriptionServiceClient<tonic::transport::Channel> {
7357 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7359 where
7360 D: TryInto<tonic::transport::Endpoint>,
7361 D::Error: Into<StdError>,
7362 {
7363 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7364 Ok(Self::new(conn))
7365 }
7366 }
7367 impl<T> SubscriptionServiceClient<T>
7368 where
7369 T: tonic::client::GrpcService<tonic::body::Body>,
7370 T::Error: Into<StdError>,
7371 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7372 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7373 {
7374 pub fn new(inner: T) -> Self {
7375 let inner = tonic::client::Grpc::new(inner);
7376 Self { inner }
7377 }
7378 pub fn with_origin(inner: T, origin: Uri) -> Self {
7379 let inner = tonic::client::Grpc::with_origin(inner, origin);
7380 Self { inner }
7381 }
7382 pub fn with_interceptor<F>(
7383 inner: T,
7384 interceptor: F,
7385 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
7386 where
7387 F: tonic::service::Interceptor,
7388 T::ResponseBody: Default,
7389 T: tonic::codegen::Service<
7390 http::Request<tonic::body::Body>,
7391 Response = http::Response<
7392 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7393 >,
7394 >,
7395 <T as tonic::codegen::Service<
7396 http::Request<tonic::body::Body>,
7397 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7398 {
7399 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
7400 }
7401 #[must_use]
7406 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7407 self.inner = self.inner.send_compressed(encoding);
7408 self
7409 }
7410 #[must_use]
7412 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7413 self.inner = self.inner.accept_compressed(encoding);
7414 self
7415 }
7416 #[must_use]
7420 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7421 self.inner = self.inner.max_decoding_message_size(limit);
7422 self
7423 }
7424 #[must_use]
7428 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7429 self.inner = self.inner.max_encoding_message_size(limit);
7430 self
7431 }
7432 pub async fn subscribe_checkpoints(
7439 &mut self,
7440 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
7441 ) -> std::result::Result<
7442 tonic::Response<
7443 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
7444 >,
7445 tonic::Status,
7446 > {
7447 self.inner
7448 .ready()
7449 .await
7450 .map_err(|e| {
7451 tonic::Status::unknown(
7452 format!("Service was not ready: {}", e.into()),
7453 )
7454 })?;
7455 let codec = tonic_prost::ProstCodec::default();
7456 let path = http::uri::PathAndQuery::from_static(
7457 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
7458 );
7459 let mut req = request.into_request();
7460 req.extensions_mut()
7461 .insert(
7462 GrpcMethod::new(
7463 "sui.rpc.v2.SubscriptionService",
7464 "SubscribeCheckpoints",
7465 ),
7466 );
7467 self.inner.server_streaming(req, path, codec).await
7468 }
7469 pub async fn subscribe_transactions(
7474 &mut self,
7475 request: impl tonic::IntoRequest<super::SubscribeTransactionsRequest>,
7476 ) -> std::result::Result<
7477 tonic::Response<
7478 tonic::codec::Streaming<super::SubscribeTransactionsResponse>,
7479 >,
7480 tonic::Status,
7481 > {
7482 self.inner
7483 .ready()
7484 .await
7485 .map_err(|e| {
7486 tonic::Status::unknown(
7487 format!("Service was not ready: {}", e.into()),
7488 )
7489 })?;
7490 let codec = tonic_prost::ProstCodec::default();
7491 let path = http::uri::PathAndQuery::from_static(
7492 "/sui.rpc.v2.SubscriptionService/SubscribeTransactions",
7493 );
7494 let mut req = request.into_request();
7495 req.extensions_mut()
7496 .insert(
7497 GrpcMethod::new(
7498 "sui.rpc.v2.SubscriptionService",
7499 "SubscribeTransactions",
7500 ),
7501 );
7502 self.inner.server_streaming(req, path, codec).await
7503 }
7504 pub async fn subscribe_events(
7509 &mut self,
7510 request: impl tonic::IntoRequest<super::SubscribeEventsRequest>,
7511 ) -> std::result::Result<
7512 tonic::Response<tonic::codec::Streaming<super::SubscribeEventsResponse>>,
7513 tonic::Status,
7514 > {
7515 self.inner
7516 .ready()
7517 .await
7518 .map_err(|e| {
7519 tonic::Status::unknown(
7520 format!("Service was not ready: {}", e.into()),
7521 )
7522 })?;
7523 let codec = tonic_prost::ProstCodec::default();
7524 let path = http::uri::PathAndQuery::from_static(
7525 "/sui.rpc.v2.SubscriptionService/SubscribeEvents",
7526 );
7527 let mut req = request.into_request();
7528 req.extensions_mut()
7529 .insert(
7530 GrpcMethod::new("sui.rpc.v2.SubscriptionService", "SubscribeEvents"),
7531 );
7532 self.inner.server_streaming(req, path, codec).await
7533 }
7534 }
7535}
7536pub mod subscription_service_server {
7538 #![allow(
7539 unused_variables,
7540 dead_code,
7541 missing_docs,
7542 clippy::wildcard_imports,
7543 clippy::let_unit_value,
7544 )]
7545 use tonic::codegen::*;
7546 #[async_trait]
7548 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
7549 async fn subscribe_checkpoints(
7556 &self,
7557 request: tonic::Request<super::SubscribeCheckpointsRequest>,
7558 ) -> std::result::Result<
7559 tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
7560 tonic::Status,
7561 > {
7562 Err(tonic::Status::unimplemented("Not yet implemented"))
7563 }
7564 async fn subscribe_transactions(
7569 &self,
7570 request: tonic::Request<super::SubscribeTransactionsRequest>,
7571 ) -> std::result::Result<
7572 tonic::Response<BoxStream<super::SubscribeTransactionsResponse>>,
7573 tonic::Status,
7574 > {
7575 Err(tonic::Status::unimplemented("Not yet implemented"))
7576 }
7577 async fn subscribe_events(
7582 &self,
7583 request: tonic::Request<super::SubscribeEventsRequest>,
7584 ) -> std::result::Result<
7585 tonic::Response<BoxStream<super::SubscribeEventsResponse>>,
7586 tonic::Status,
7587 > {
7588 Err(tonic::Status::unimplemented("Not yet implemented"))
7589 }
7590 }
7591 #[derive(Debug)]
7619 pub struct SubscriptionServiceServer<T> {
7620 inner: Arc<T>,
7621 accept_compression_encodings: EnabledCompressionEncodings,
7622 send_compression_encodings: EnabledCompressionEncodings,
7623 max_decoding_message_size: Option<usize>,
7624 max_encoding_message_size: Option<usize>,
7625 }
7626 impl<T> SubscriptionServiceServer<T> {
7627 pub fn new(inner: T) -> Self {
7628 Self::from_arc(Arc::new(inner))
7629 }
7630 pub fn from_arc(inner: Arc<T>) -> Self {
7631 Self {
7632 inner,
7633 accept_compression_encodings: Default::default(),
7634 send_compression_encodings: Default::default(),
7635 max_decoding_message_size: None,
7636 max_encoding_message_size: None,
7637 }
7638 }
7639 pub fn with_interceptor<F>(
7640 inner: T,
7641 interceptor: F,
7642 ) -> InterceptedService<Self, F>
7643 where
7644 F: tonic::service::Interceptor,
7645 {
7646 InterceptedService::new(Self::new(inner), interceptor)
7647 }
7648 #[must_use]
7650 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7651 self.accept_compression_encodings.enable(encoding);
7652 self
7653 }
7654 #[must_use]
7656 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7657 self.send_compression_encodings.enable(encoding);
7658 self
7659 }
7660 #[must_use]
7664 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7665 self.max_decoding_message_size = Some(limit);
7666 self
7667 }
7668 #[must_use]
7672 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7673 self.max_encoding_message_size = Some(limit);
7674 self
7675 }
7676 }
7677 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
7678 where
7679 T: SubscriptionService,
7680 B: Body + std::marker::Send + 'static,
7681 B::Error: Into<StdError> + std::marker::Send + 'static,
7682 {
7683 type Response = http::Response<tonic::body::Body>;
7684 type Error = std::convert::Infallible;
7685 type Future = BoxFuture<Self::Response, Self::Error>;
7686 fn poll_ready(
7687 &mut self,
7688 _cx: &mut Context<'_>,
7689 ) -> Poll<std::result::Result<(), Self::Error>> {
7690 Poll::Ready(Ok(()))
7691 }
7692 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7693 match req.uri().path() {
7694 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
7695 #[allow(non_camel_case_types)]
7696 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
7697 impl<
7698 T: SubscriptionService,
7699 > tonic::server::ServerStreamingService<
7700 super::SubscribeCheckpointsRequest,
7701 > for SubscribeCheckpointsSvc<T> {
7702 type Response = super::SubscribeCheckpointsResponse;
7703 type ResponseStream = BoxStream<
7704 super::SubscribeCheckpointsResponse,
7705 >;
7706 type Future = BoxFuture<
7707 tonic::Response<Self::ResponseStream>,
7708 tonic::Status,
7709 >;
7710 fn call(
7711 &mut self,
7712 request: tonic::Request<super::SubscribeCheckpointsRequest>,
7713 ) -> Self::Future {
7714 let inner = Arc::clone(&self.0);
7715 let fut = async move {
7716 <T as SubscriptionService>::subscribe_checkpoints(
7717 &inner,
7718 request,
7719 )
7720 .await
7721 };
7722 Box::pin(fut)
7723 }
7724 }
7725 let accept_compression_encodings = self.accept_compression_encodings;
7726 let send_compression_encodings = self.send_compression_encodings;
7727 let max_decoding_message_size = self.max_decoding_message_size;
7728 let max_encoding_message_size = self.max_encoding_message_size;
7729 let inner = self.inner.clone();
7730 let fut = async move {
7731 let method = SubscribeCheckpointsSvc(inner);
7732 let codec = tonic_prost::ProstCodec::default();
7733 let mut grpc = tonic::server::Grpc::new(codec)
7734 .apply_compression_config(
7735 accept_compression_encodings,
7736 send_compression_encodings,
7737 )
7738 .apply_max_message_size_config(
7739 max_decoding_message_size,
7740 max_encoding_message_size,
7741 );
7742 let res = grpc.server_streaming(method, req).await;
7743 Ok(res)
7744 };
7745 Box::pin(fut)
7746 }
7747 "/sui.rpc.v2.SubscriptionService/SubscribeTransactions" => {
7748 #[allow(non_camel_case_types)]
7749 struct SubscribeTransactionsSvc<T: SubscriptionService>(pub Arc<T>);
7750 impl<
7751 T: SubscriptionService,
7752 > tonic::server::ServerStreamingService<
7753 super::SubscribeTransactionsRequest,
7754 > for SubscribeTransactionsSvc<T> {
7755 type Response = super::SubscribeTransactionsResponse;
7756 type ResponseStream = BoxStream<
7757 super::SubscribeTransactionsResponse,
7758 >;
7759 type Future = BoxFuture<
7760 tonic::Response<Self::ResponseStream>,
7761 tonic::Status,
7762 >;
7763 fn call(
7764 &mut self,
7765 request: tonic::Request<super::SubscribeTransactionsRequest>,
7766 ) -> Self::Future {
7767 let inner = Arc::clone(&self.0);
7768 let fut = async move {
7769 <T as SubscriptionService>::subscribe_transactions(
7770 &inner,
7771 request,
7772 )
7773 .await
7774 };
7775 Box::pin(fut)
7776 }
7777 }
7778 let accept_compression_encodings = self.accept_compression_encodings;
7779 let send_compression_encodings = self.send_compression_encodings;
7780 let max_decoding_message_size = self.max_decoding_message_size;
7781 let max_encoding_message_size = self.max_encoding_message_size;
7782 let inner = self.inner.clone();
7783 let fut = async move {
7784 let method = SubscribeTransactionsSvc(inner);
7785 let codec = tonic_prost::ProstCodec::default();
7786 let mut grpc = tonic::server::Grpc::new(codec)
7787 .apply_compression_config(
7788 accept_compression_encodings,
7789 send_compression_encodings,
7790 )
7791 .apply_max_message_size_config(
7792 max_decoding_message_size,
7793 max_encoding_message_size,
7794 );
7795 let res = grpc.server_streaming(method, req).await;
7796 Ok(res)
7797 };
7798 Box::pin(fut)
7799 }
7800 "/sui.rpc.v2.SubscriptionService/SubscribeEvents" => {
7801 #[allow(non_camel_case_types)]
7802 struct SubscribeEventsSvc<T: SubscriptionService>(pub Arc<T>);
7803 impl<
7804 T: SubscriptionService,
7805 > tonic::server::ServerStreamingService<
7806 super::SubscribeEventsRequest,
7807 > for SubscribeEventsSvc<T> {
7808 type Response = super::SubscribeEventsResponse;
7809 type ResponseStream = BoxStream<super::SubscribeEventsResponse>;
7810 type Future = BoxFuture<
7811 tonic::Response<Self::ResponseStream>,
7812 tonic::Status,
7813 >;
7814 fn call(
7815 &mut self,
7816 request: tonic::Request<super::SubscribeEventsRequest>,
7817 ) -> Self::Future {
7818 let inner = Arc::clone(&self.0);
7819 let fut = async move {
7820 <T as SubscriptionService>::subscribe_events(
7821 &inner,
7822 request,
7823 )
7824 .await
7825 };
7826 Box::pin(fut)
7827 }
7828 }
7829 let accept_compression_encodings = self.accept_compression_encodings;
7830 let send_compression_encodings = self.send_compression_encodings;
7831 let max_decoding_message_size = self.max_decoding_message_size;
7832 let max_encoding_message_size = self.max_encoding_message_size;
7833 let inner = self.inner.clone();
7834 let fut = async move {
7835 let method = SubscribeEventsSvc(inner);
7836 let codec = tonic_prost::ProstCodec::default();
7837 let mut grpc = tonic::server::Grpc::new(codec)
7838 .apply_compression_config(
7839 accept_compression_encodings,
7840 send_compression_encodings,
7841 )
7842 .apply_max_message_size_config(
7843 max_decoding_message_size,
7844 max_encoding_message_size,
7845 );
7846 let res = grpc.server_streaming(method, req).await;
7847 Ok(res)
7848 };
7849 Box::pin(fut)
7850 }
7851 _ => {
7852 Box::pin(async move {
7853 let mut response = http::Response::new(
7854 tonic::body::Body::default(),
7855 );
7856 let headers = response.headers_mut();
7857 headers
7858 .insert(
7859 tonic::Status::GRPC_STATUS,
7860 (tonic::Code::Unimplemented as i32).into(),
7861 );
7862 headers
7863 .insert(
7864 http::header::CONTENT_TYPE,
7865 tonic::metadata::GRPC_CONTENT_TYPE,
7866 );
7867 Ok(response)
7868 })
7869 }
7870 }
7871 }
7872 }
7873 impl<T> Clone for SubscriptionServiceServer<T> {
7874 fn clone(&self) -> Self {
7875 let inner = self.inner.clone();
7876 Self {
7877 inner,
7878 accept_compression_encodings: self.accept_compression_encodings,
7879 send_compression_encodings: self.send_compression_encodings,
7880 max_decoding_message_size: self.max_decoding_message_size,
7881 max_encoding_message_size: self.max_encoding_message_size,
7882 }
7883 }
7884 }
7885 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
7887 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
7888 const NAME: &'static str = SERVICE_NAME;
7889 }
7890}
7891#[non_exhaustive]
7892#[derive(Clone, PartialEq, ::prost::Message)]
7893pub struct SystemState {
7894 #[prost(uint64, optional, tag = "1")]
7896 pub version: ::core::option::Option<u64>,
7897 #[prost(uint64, optional, tag = "2")]
7899 pub epoch: ::core::option::Option<u64>,
7900 #[prost(uint64, optional, tag = "3")]
7902 pub protocol_version: ::core::option::Option<u64>,
7903 #[prost(message, optional, tag = "4")]
7905 pub validators: ::core::option::Option<ValidatorSet>,
7906 #[prost(message, optional, tag = "5")]
7908 pub storage_fund: ::core::option::Option<StorageFund>,
7909 #[prost(message, optional, tag = "6")]
7911 pub parameters: ::core::option::Option<SystemParameters>,
7912 #[prost(uint64, optional, tag = "7")]
7914 pub reference_gas_price: ::core::option::Option<u64>,
7915 #[prost(message, repeated, tag = "8")]
7923 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
7924 #[prost(message, optional, tag = "9")]
7926 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
7927 #[prost(bool, optional, tag = "10")]
7934 pub safe_mode: ::core::option::Option<bool>,
7935 #[prost(uint64, optional, tag = "11")]
7937 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
7938 #[prost(uint64, optional, tag = "12")]
7940 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
7941 #[prost(uint64, optional, tag = "13")]
7943 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
7944 #[prost(uint64, optional, tag = "14")]
7946 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
7947 #[prost(uint64, optional, tag = "15")]
7949 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
7950 #[prost(message, optional, tag = "16")]
7952 pub extra_fields: ::core::option::Option<MoveTable>,
7953}
7954#[non_exhaustive]
7955#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7956pub struct ValidatorReportRecord {
7957 #[prost(string, optional, tag = "1")]
7959 pub reported: ::core::option::Option<::prost::alloc::string::String>,
7960 #[prost(string, repeated, tag = "2")]
7962 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7963}
7964#[non_exhaustive]
7965#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7966pub struct SystemParameters {
7967 #[prost(uint64, optional, tag = "1")]
7969 pub epoch_duration_ms: ::core::option::Option<u64>,
7970 #[prost(uint64, optional, tag = "2")]
7972 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
7973 #[prost(uint64, optional, tag = "3")]
7975 pub min_validator_count: ::core::option::Option<u64>,
7976 #[prost(uint64, optional, tag = "4")]
7979 pub max_validator_count: ::core::option::Option<u64>,
7980 #[prost(uint64, optional, tag = "5")]
7983 pub min_validator_joining_stake: ::core::option::Option<u64>,
7984 #[prost(uint64, optional, tag = "6")]
7989 pub validator_low_stake_threshold: ::core::option::Option<u64>,
7990 #[prost(uint64, optional, tag = "7")]
7994 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
7995 #[prost(uint64, optional, tag = "8")]
7998 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
7999 #[prost(message, optional, tag = "9")]
8001 pub extra_fields: ::core::option::Option<MoveTable>,
8002}
8003#[non_exhaustive]
8005#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8006pub struct MoveTable {
8007 #[prost(string, optional, tag = "1")]
8009 pub id: ::core::option::Option<::prost::alloc::string::String>,
8010 #[prost(uint64, optional, tag = "2")]
8012 pub size: ::core::option::Option<u64>,
8013}
8014#[non_exhaustive]
8015#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8016pub struct StakeSubsidy {
8017 #[prost(uint64, optional, tag = "1")]
8019 pub balance: ::core::option::Option<u64>,
8020 #[prost(uint64, optional, tag = "2")]
8022 pub distribution_counter: ::core::option::Option<u64>,
8023 #[prost(uint64, optional, tag = "3")]
8026 pub current_distribution_amount: ::core::option::Option<u64>,
8027 #[prost(uint64, optional, tag = "4")]
8029 pub stake_subsidy_period_length: ::core::option::Option<u64>,
8030 #[prost(uint32, optional, tag = "5")]
8033 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
8034 #[prost(message, optional, tag = "6")]
8036 pub extra_fields: ::core::option::Option<MoveTable>,
8037}
8038#[non_exhaustive]
8040#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8041pub struct StorageFund {
8042 #[prost(uint64, optional, tag = "1")]
8048 pub total_object_storage_rebates: ::core::option::Option<u64>,
8049 #[prost(uint64, optional, tag = "2")]
8052 pub non_refundable_balance: ::core::option::Option<u64>,
8053}
8054#[non_exhaustive]
8055#[derive(Clone, PartialEq, ::prost::Message)]
8056pub struct ValidatorSet {
8057 #[prost(uint64, optional, tag = "1")]
8060 pub total_stake: ::core::option::Option<u64>,
8061 #[prost(message, repeated, tag = "2")]
8063 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
8064 #[prost(message, optional, tag = "3")]
8069 pub pending_active_validators: ::core::option::Option<MoveTable>,
8070 #[prost(uint64, repeated, tag = "4")]
8073 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
8074 #[prost(message, optional, tag = "5")]
8078 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
8079 #[prost(message, optional, tag = "6")]
8085 pub inactive_validators: ::core::option::Option<MoveTable>,
8086 #[prost(message, optional, tag = "7")]
8094 pub validator_candidates: ::core::option::Option<MoveTable>,
8095 #[prost(btree_map = "string, uint64", tag = "8")]
8097 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
8098 ::prost::alloc::string::String,
8099 u64,
8100 >,
8101 #[prost(message, optional, tag = "9")]
8103 pub extra_fields: ::core::option::Option<MoveTable>,
8104}
8105#[non_exhaustive]
8109#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8110pub struct Validator {
8111 #[prost(string, optional, tag = "1")]
8113 pub name: ::core::option::Option<::prost::alloc::string::String>,
8114 #[prost(string, optional, tag = "2")]
8117 pub address: ::core::option::Option<::prost::alloc::string::String>,
8118 #[prost(string, optional, tag = "3")]
8119 pub description: ::core::option::Option<::prost::alloc::string::String>,
8120 #[prost(string, optional, tag = "4")]
8121 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
8122 #[prost(string, optional, tag = "5")]
8123 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
8124 #[prost(bytes = "bytes", optional, tag = "7")]
8127 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8128 #[prost(bytes = "bytes", optional, tag = "8")]
8130 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8131 #[prost(bytes = "bytes", optional, tag = "10")]
8134 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8135 #[prost(bytes = "bytes", optional, tag = "12")]
8137 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8138 #[prost(string, optional, tag = "13")]
8140 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
8141 #[prost(string, optional, tag = "14")]
8143 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8144 #[prost(string, optional, tag = "15")]
8146 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
8147 #[prost(string, optional, tag = "16")]
8149 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
8150 #[prost(bytes = "bytes", optional, tag = "18")]
8151 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8152 #[prost(bytes = "bytes", optional, tag = "19")]
8153 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8154 #[prost(bytes = "bytes", optional, tag = "21")]
8155 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8156 #[prost(bytes = "bytes", optional, tag = "23")]
8157 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8158 #[prost(string, optional, tag = "24")]
8159 pub next_epoch_network_address: ::core::option::Option<
8160 ::prost::alloc::string::String,
8161 >,
8162 #[prost(string, optional, tag = "25")]
8163 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8164 #[prost(string, optional, tag = "26")]
8165 pub next_epoch_primary_address: ::core::option::Option<
8166 ::prost::alloc::string::String,
8167 >,
8168 #[prost(string, optional, tag = "27")]
8169 pub next_epoch_worker_address: ::core::option::Option<
8170 ::prost::alloc::string::String,
8171 >,
8172 #[prost(message, optional, tag = "28")]
8174 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
8175 #[prost(uint64, optional, tag = "29")]
8178 pub voting_power: ::core::option::Option<u64>,
8179 #[prost(string, optional, tag = "30")]
8181 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
8182 #[prost(uint64, optional, tag = "31")]
8184 pub gas_price: ::core::option::Option<u64>,
8185 #[prost(message, optional, tag = "32")]
8187 pub staking_pool: ::core::option::Option<StakingPool>,
8188 #[prost(uint64, optional, tag = "33")]
8190 pub commission_rate: ::core::option::Option<u64>,
8191 #[prost(uint64, optional, tag = "34")]
8193 pub next_epoch_stake: ::core::option::Option<u64>,
8194 #[prost(uint64, optional, tag = "35")]
8196 pub next_epoch_gas_price: ::core::option::Option<u64>,
8197 #[prost(uint64, optional, tag = "36")]
8199 pub next_epoch_commission_rate: ::core::option::Option<u64>,
8200 #[prost(message, optional, tag = "37")]
8202 pub extra_fields: ::core::option::Option<MoveTable>,
8203}
8204#[non_exhaustive]
8206#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8207pub struct StakingPool {
8208 #[prost(string, optional, tag = "1")]
8210 pub id: ::core::option::Option<::prost::alloc::string::String>,
8211 #[prost(uint64, optional, tag = "2")]
8214 pub activation_epoch: ::core::option::Option<u64>,
8215 #[prost(uint64, optional, tag = "3")]
8218 pub deactivation_epoch: ::core::option::Option<u64>,
8219 #[prost(uint64, optional, tag = "4")]
8222 pub sui_balance: ::core::option::Option<u64>,
8223 #[prost(uint64, optional, tag = "5")]
8225 pub rewards_pool: ::core::option::Option<u64>,
8226 #[prost(uint64, optional, tag = "6")]
8228 pub pool_token_balance: ::core::option::Option<u64>,
8229 #[prost(message, optional, tag = "7")]
8236 pub exchange_rates: ::core::option::Option<MoveTable>,
8237 #[prost(uint64, optional, tag = "8")]
8239 pub pending_stake: ::core::option::Option<u64>,
8240 #[prost(uint64, optional, tag = "9")]
8243 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
8244 #[prost(uint64, optional, tag = "10")]
8246 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
8247 #[prost(message, optional, tag = "11")]
8249 pub extra_fields: ::core::option::Option<MoveTable>,
8250}
8251#[non_exhaustive]
8253#[derive(Clone, PartialEq, ::prost::Message)]
8254pub struct Transaction {
8255 #[prost(message, optional, tag = "1")]
8257 pub bcs: ::core::option::Option<Bcs>,
8258 #[prost(string, optional, tag = "2")]
8260 pub digest: ::core::option::Option<::prost::alloc::string::String>,
8261 #[prost(int32, optional, tag = "3")]
8263 pub version: ::core::option::Option<i32>,
8264 #[prost(message, optional, tag = "4")]
8265 pub kind: ::core::option::Option<TransactionKind>,
8266 #[prost(string, optional, tag = "5")]
8267 pub sender: ::core::option::Option<::prost::alloc::string::String>,
8268 #[prost(message, optional, tag = "6")]
8269 pub gas_payment: ::core::option::Option<GasPayment>,
8270 #[prost(message, optional, tag = "7")]
8271 pub expiration: ::core::option::Option<TransactionExpiration>,
8272}
8273#[non_exhaustive]
8275#[derive(Clone, PartialEq, ::prost::Message)]
8276pub struct GasPayment {
8277 #[prost(message, repeated, tag = "1")]
8279 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
8280 #[prost(string, optional, tag = "2")]
8282 pub owner: ::core::option::Option<::prost::alloc::string::String>,
8283 #[prost(uint64, optional, tag = "3")]
8287 pub price: ::core::option::Option<u64>,
8288 #[prost(uint64, optional, tag = "4")]
8290 pub budget: ::core::option::Option<u64>,
8291}
8292#[non_exhaustive]
8294#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8295pub struct TransactionExpiration {
8296 #[prost(
8297 enumeration = "transaction_expiration::TransactionExpirationKind",
8298 optional,
8299 tag = "1"
8300 )]
8301 pub kind: ::core::option::Option<i32>,
8302 #[prost(uint64, optional, tag = "2")]
8305 pub epoch: ::core::option::Option<u64>,
8306 #[prost(uint64, optional, tag = "3")]
8309 pub min_epoch: ::core::option::Option<u64>,
8310 #[prost(message, optional, tag = "4")]
8314 pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8315 #[prost(message, optional, tag = "5")]
8319 pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8320 #[prost(string, optional, tag = "6")]
8322 pub chain: ::core::option::Option<::prost::alloc::string::String>,
8323 #[prost(uint32, optional, tag = "7")]
8325 pub nonce: ::core::option::Option<u32>,
8326 #[prost(message, optional, tag = "8")]
8329 pub allowed_proposers: ::core::option::Option<AllowedProposers>,
8330}
8331pub mod transaction_expiration {
8333 #[non_exhaustive]
8334 #[derive(
8335 Clone,
8336 Copy,
8337 Debug,
8338 PartialEq,
8339 Eq,
8340 Hash,
8341 PartialOrd,
8342 Ord,
8343 ::prost::Enumeration
8344 )]
8345 #[repr(i32)]
8346 pub enum TransactionExpirationKind {
8347 Unknown = 0,
8348 None = 1,
8350 Epoch = 2,
8353 ValidDuring = 3,
8363 Validity = 4,
8366 }
8367 impl TransactionExpirationKind {
8368 pub fn as_str_name(&self) -> &'static str {
8373 match self {
8374 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
8375 Self::None => "NONE",
8376 Self::Epoch => "EPOCH",
8377 Self::ValidDuring => "VALID_DURING",
8378 Self::Validity => "VALIDITY",
8379 }
8380 }
8381 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8383 match value {
8384 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
8385 "NONE" => Some(Self::None),
8386 "EPOCH" => Some(Self::Epoch),
8387 "VALID_DURING" => Some(Self::ValidDuring),
8388 "VALIDITY" => Some(Self::Validity),
8389 _ => None,
8390 }
8391 }
8392 }
8393}
8394#[non_exhaustive]
8398#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8399pub struct AllowedProposers {
8400 #[prost(uint64, optional, tag = "1")]
8405 pub epoch: ::core::option::Option<u64>,
8406 #[prost(uint32, repeated, tag = "2")]
8411 pub proposers: ::prost::alloc::vec::Vec<u32>,
8412}
8413#[non_exhaustive]
8415#[derive(Clone, PartialEq, ::prost::Message)]
8416pub struct TransactionKind {
8417 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
8418 pub kind: ::core::option::Option<i32>,
8419 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
8420 pub data: ::core::option::Option<transaction_kind::Data>,
8421}
8422pub mod transaction_kind {
8424 #[non_exhaustive]
8425 #[derive(
8426 Clone,
8427 Copy,
8428 Debug,
8429 PartialEq,
8430 Eq,
8431 Hash,
8432 PartialOrd,
8433 Ord,
8434 ::prost::Enumeration
8435 )]
8436 #[repr(i32)]
8437 pub enum Kind {
8438 Unknown = 0,
8439 ProgrammableTransaction = 1,
8441 ChangeEpoch = 2,
8446 Genesis = 3,
8451 ConsensusCommitPrologueV1 = 4,
8453 AuthenticatorStateUpdate = 5,
8455 EndOfEpoch = 6,
8458 RandomnessStateUpdate = 7,
8460 ConsensusCommitPrologueV2 = 8,
8462 ConsensusCommitPrologueV3 = 9,
8464 ConsensusCommitPrologueV4 = 10,
8466 ProgrammableSystemTransaction = 11,
8468 }
8469 impl Kind {
8470 pub fn as_str_name(&self) -> &'static str {
8475 match self {
8476 Self::Unknown => "KIND_UNKNOWN",
8477 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
8478 Self::ChangeEpoch => "CHANGE_EPOCH",
8479 Self::Genesis => "GENESIS",
8480 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
8481 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
8482 Self::EndOfEpoch => "END_OF_EPOCH",
8483 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
8484 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
8485 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
8486 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
8487 Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
8488 }
8489 }
8490 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8492 match value {
8493 "KIND_UNKNOWN" => Some(Self::Unknown),
8494 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
8495 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8496 "GENESIS" => Some(Self::Genesis),
8497 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
8498 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
8499 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
8500 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
8501 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
8502 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
8503 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
8504 "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
8505 Some(Self::ProgrammableSystemTransaction)
8506 }
8507 _ => None,
8508 }
8509 }
8510 }
8511 #[non_exhaustive]
8512 #[derive(Clone, PartialEq, ::prost::Oneof)]
8513 pub enum Data {
8514 #[prost(message, tag = "2")]
8516 ProgrammableTransaction(super::ProgrammableTransaction),
8517 #[prost(message, tag = "3")]
8522 ChangeEpoch(super::ChangeEpoch),
8523 #[prost(message, tag = "4")]
8528 Genesis(super::GenesisTransaction),
8529 #[prost(message, tag = "5")]
8531 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
8532 #[prost(message, tag = "6")]
8534 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
8535 #[prost(message, tag = "7")]
8538 EndOfEpoch(super::EndOfEpochTransaction),
8539 #[prost(message, tag = "8")]
8541 RandomnessStateUpdate(super::RandomnessStateUpdate),
8542 }
8543}
8544#[non_exhaustive]
8549#[derive(Clone, PartialEq, ::prost::Message)]
8550pub struct ProgrammableTransaction {
8551 #[prost(message, repeated, tag = "1")]
8553 pub inputs: ::prost::alloc::vec::Vec<Input>,
8554 #[prost(message, repeated, tag = "2")]
8557 pub commands: ::prost::alloc::vec::Vec<Command>,
8558}
8559#[non_exhaustive]
8561#[derive(Clone, PartialEq, ::prost::Message)]
8562pub struct Command {
8563 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
8564 pub command: ::core::option::Option<command::Command>,
8565}
8566pub mod command {
8568 #[non_exhaustive]
8569 #[derive(Clone, PartialEq, ::prost::Oneof)]
8570 pub enum Command {
8571 #[prost(message, tag = "1")]
8573 MoveCall(super::MoveCall),
8574 #[prost(message, tag = "2")]
8579 TransferObjects(super::TransferObjects),
8580 #[prost(message, tag = "3")]
8583 SplitCoins(super::SplitCoins),
8584 #[prost(message, tag = "4")]
8587 MergeCoins(super::MergeCoins),
8588 #[prost(message, tag = "5")]
8591 Publish(super::Publish),
8592 #[prost(message, tag = "6")]
8596 MakeMoveVector(super::MakeMoveVector),
8597 #[prost(message, tag = "7")]
8606 Upgrade(super::Upgrade),
8607 }
8608}
8609#[non_exhaustive]
8614#[derive(Clone, PartialEq, ::prost::Message)]
8615pub struct MoveCall {
8616 #[prost(string, optional, tag = "1")]
8618 pub package: ::core::option::Option<::prost::alloc::string::String>,
8619 #[prost(string, optional, tag = "2")]
8621 pub module: ::core::option::Option<::prost::alloc::string::String>,
8622 #[prost(string, optional, tag = "3")]
8624 pub function: ::core::option::Option<::prost::alloc::string::String>,
8625 #[prost(string, repeated, tag = "4")]
8627 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8628 #[prost(message, repeated, tag = "5")]
8630 pub arguments: ::prost::alloc::vec::Vec<Argument>,
8631}
8632#[non_exhaustive]
8634#[derive(Clone, PartialEq, ::prost::Message)]
8635pub struct TransferObjects {
8636 #[prost(message, repeated, tag = "1")]
8638 pub objects: ::prost::alloc::vec::Vec<Argument>,
8639 #[prost(message, optional, tag = "2")]
8641 pub address: ::core::option::Option<Argument>,
8642}
8643#[non_exhaustive]
8645#[derive(Clone, PartialEq, ::prost::Message)]
8646pub struct SplitCoins {
8647 #[prost(message, optional, tag = "1")]
8649 pub coin: ::core::option::Option<Argument>,
8650 #[prost(message, repeated, tag = "2")]
8652 pub amounts: ::prost::alloc::vec::Vec<Argument>,
8653}
8654#[non_exhaustive]
8656#[derive(Clone, PartialEq, ::prost::Message)]
8657pub struct MergeCoins {
8658 #[prost(message, optional, tag = "1")]
8660 pub coin: ::core::option::Option<Argument>,
8661 #[prost(message, repeated, tag = "2")]
8665 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
8666}
8667#[non_exhaustive]
8669#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8670pub struct Publish {
8671 #[prost(bytes = "bytes", repeated, tag = "1")]
8673 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8674 #[prost(string, repeated, tag = "2")]
8676 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8677}
8678#[non_exhaustive]
8680#[derive(Clone, PartialEq, ::prost::Message)]
8681pub struct MakeMoveVector {
8682 #[prost(string, optional, tag = "1")]
8687 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
8688 #[prost(message, repeated, tag = "2")]
8690 pub elements: ::prost::alloc::vec::Vec<Argument>,
8691}
8692#[non_exhaustive]
8694#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8695pub struct Upgrade {
8696 #[prost(bytes = "bytes", repeated, tag = "1")]
8698 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8699 #[prost(string, repeated, tag = "2")]
8701 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8702 #[prost(string, optional, tag = "3")]
8704 pub package: ::core::option::Option<::prost::alloc::string::String>,
8705 #[prost(message, optional, tag = "4")]
8707 pub ticket: ::core::option::Option<Argument>,
8708}
8709#[non_exhaustive]
8711#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8712pub struct RandomnessStateUpdate {
8713 #[prost(uint64, optional, tag = "1")]
8715 pub epoch: ::core::option::Option<u64>,
8716 #[prost(uint64, optional, tag = "2")]
8718 pub randomness_round: ::core::option::Option<u64>,
8719 #[prost(bytes = "bytes", optional, tag = "3")]
8721 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
8722 #[prost(uint64, optional, tag = "4")]
8724 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
8725}
8726#[non_exhaustive]
8728#[derive(Clone, PartialEq, ::prost::Message)]
8729pub struct ChangeEpoch {
8730 #[prost(uint64, optional, tag = "1")]
8732 pub epoch: ::core::option::Option<u64>,
8733 #[prost(uint64, optional, tag = "2")]
8735 pub protocol_version: ::core::option::Option<u64>,
8736 #[prost(uint64, optional, tag = "3")]
8738 pub storage_charge: ::core::option::Option<u64>,
8739 #[prost(uint64, optional, tag = "4")]
8741 pub computation_charge: ::core::option::Option<u64>,
8742 #[prost(uint64, optional, tag = "5")]
8744 pub storage_rebate: ::core::option::Option<u64>,
8745 #[prost(uint64, optional, tag = "6")]
8747 pub non_refundable_storage_fee: ::core::option::Option<u64>,
8748 #[prost(message, optional, tag = "7")]
8750 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8751 #[prost(message, repeated, tag = "8")]
8757 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
8758}
8759#[non_exhaustive]
8761#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8762pub struct SystemPackage {
8763 #[prost(uint64, optional, tag = "1")]
8765 pub version: ::core::option::Option<u64>,
8766 #[prost(bytes = "bytes", repeated, tag = "2")]
8768 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8769 #[prost(string, repeated, tag = "3")]
8771 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8772}
8773#[non_exhaustive]
8775#[derive(Clone, PartialEq, ::prost::Message)]
8776pub struct GenesisTransaction {
8777 #[prost(message, repeated, tag = "1")]
8779 pub objects: ::prost::alloc::vec::Vec<Object>,
8780}
8781#[non_exhaustive]
8785#[derive(Clone, PartialEq, ::prost::Message)]
8786pub struct ConsensusCommitPrologue {
8787 #[prost(uint64, optional, tag = "1")]
8791 pub epoch: ::core::option::Option<u64>,
8792 #[prost(uint64, optional, tag = "2")]
8796 pub round: ::core::option::Option<u64>,
8797 #[prost(message, optional, tag = "3")]
8801 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8802 #[prost(string, optional, tag = "4")]
8806 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
8807 #[prost(uint64, optional, tag = "5")]
8812 pub sub_dag_index: ::core::option::Option<u64>,
8813 #[prost(message, optional, tag = "6")]
8817 pub consensus_determined_version_assignments: ::core::option::Option<
8818 ConsensusDeterminedVersionAssignments,
8819 >,
8820 #[prost(string, optional, tag = "7")]
8825 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
8826}
8827#[non_exhaustive]
8829#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8830pub struct VersionAssignment {
8831 #[prost(string, optional, tag = "1")]
8833 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
8834 #[prost(uint64, optional, tag = "2")]
8836 pub start_version: ::core::option::Option<u64>,
8837 #[prost(uint64, optional, tag = "3")]
8839 pub version: ::core::option::Option<u64>,
8840}
8841#[non_exhaustive]
8843#[derive(Clone, PartialEq, ::prost::Message)]
8844pub struct CanceledTransaction {
8845 #[prost(string, optional, tag = "1")]
8847 pub digest: ::core::option::Option<::prost::alloc::string::String>,
8848 #[prost(message, repeated, tag = "2")]
8850 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
8851}
8852#[non_exhaustive]
8854#[derive(Clone, PartialEq, ::prost::Message)]
8855pub struct ConsensusDeterminedVersionAssignments {
8856 #[prost(int32, optional, tag = "1")]
8858 pub version: ::core::option::Option<i32>,
8859 #[prost(message, repeated, tag = "3")]
8861 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
8862}
8863#[non_exhaustive]
8865#[derive(Clone, PartialEq, ::prost::Message)]
8866pub struct AuthenticatorStateUpdate {
8867 #[prost(uint64, optional, tag = "1")]
8869 pub epoch: ::core::option::Option<u64>,
8870 #[prost(uint64, optional, tag = "2")]
8872 pub round: ::core::option::Option<u64>,
8873 #[prost(message, repeated, tag = "3")]
8875 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
8876 #[prost(uint64, optional, tag = "4")]
8878 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
8879}
8880#[non_exhaustive]
8882#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8883pub struct ActiveJwk {
8884 #[prost(message, optional, tag = "1")]
8886 pub id: ::core::option::Option<JwkId>,
8887 #[prost(message, optional, tag = "2")]
8889 pub jwk: ::core::option::Option<Jwk>,
8890 #[prost(uint64, optional, tag = "3")]
8892 pub epoch: ::core::option::Option<u64>,
8893}
8894#[non_exhaustive]
8897#[derive(Clone, PartialEq, ::prost::Message)]
8898pub struct EndOfEpochTransaction {
8899 #[prost(message, repeated, tag = "1")]
8900 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
8901}
8902#[non_exhaustive]
8904#[derive(Clone, PartialEq, ::prost::Message)]
8905pub struct EndOfEpochTransactionKind {
8906 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
8907 pub kind: ::core::option::Option<i32>,
8908 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
8909 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
8910}
8911pub mod end_of_epoch_transaction_kind {
8913 #[non_exhaustive]
8914 #[derive(
8915 Clone,
8916 Copy,
8917 Debug,
8918 PartialEq,
8919 Eq,
8920 Hash,
8921 PartialOrd,
8922 Ord,
8923 ::prost::Enumeration
8924 )]
8925 #[repr(i32)]
8926 pub enum Kind {
8927 Unknown = 0,
8928 ChangeEpoch = 1,
8930 AuthenticatorStateCreate = 2,
8932 AuthenticatorStateExpire = 3,
8934 RandomnessStateCreate = 4,
8936 DenyListStateCreate = 5,
8938 BridgeStateCreate = 6,
8940 BridgeCommitteeInit = 7,
8942 StoreExecutionTimeObservations = 8,
8944 AccumulatorRootCreate = 9,
8946 CoinRegistryCreate = 10,
8948 DisplayRegistryCreate = 11,
8950 AddressAliasStateCreate = 12,
8952 WriteAccumulatorStorageCost = 13,
8954 ForwardingAddressRegistryCreate = 14,
8956 }
8957 impl Kind {
8958 pub fn as_str_name(&self) -> &'static str {
8963 match self {
8964 Self::Unknown => "KIND_UNKNOWN",
8965 Self::ChangeEpoch => "CHANGE_EPOCH",
8966 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
8967 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
8968 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
8969 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
8970 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
8971 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
8972 Self::StoreExecutionTimeObservations => {
8973 "STORE_EXECUTION_TIME_OBSERVATIONS"
8974 }
8975 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
8976 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
8977 Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
8978 Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
8979 Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
8980 Self::ForwardingAddressRegistryCreate => {
8981 "FORWARDING_ADDRESS_REGISTRY_CREATE"
8982 }
8983 }
8984 }
8985 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8987 match value {
8988 "KIND_UNKNOWN" => Some(Self::Unknown),
8989 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8990 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
8991 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
8992 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
8993 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
8994 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
8995 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
8996 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
8997 Some(Self::StoreExecutionTimeObservations)
8998 }
8999 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
9000 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
9001 "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
9002 "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
9003 "WRITE_ACCUMULATOR_STORAGE_COST" => {
9004 Some(Self::WriteAccumulatorStorageCost)
9005 }
9006 "FORWARDING_ADDRESS_REGISTRY_CREATE" => {
9007 Some(Self::ForwardingAddressRegistryCreate)
9008 }
9009 _ => None,
9010 }
9011 }
9012 }
9013 #[non_exhaustive]
9014 #[derive(Clone, PartialEq, ::prost::Oneof)]
9015 pub enum Data {
9016 #[prost(message, tag = "2")]
9018 ChangeEpoch(super::ChangeEpoch),
9019 #[prost(message, tag = "3")]
9021 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
9022 #[prost(message, tag = "4")]
9024 ExecutionTimeObservations(super::ExecutionTimeObservations),
9025 #[prost(string, tag = "5")]
9027 BridgeChainId(::prost::alloc::string::String),
9028 #[prost(uint64, tag = "6")]
9030 BridgeObjectVersion(u64),
9031 #[prost(uint64, tag = "7")]
9033 StorageCost(u64),
9034 }
9035}
9036#[non_exhaustive]
9038#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
9039pub struct AuthenticatorStateExpire {
9040 #[prost(uint64, optional, tag = "1")]
9042 pub min_epoch: ::core::option::Option<u64>,
9043 #[prost(uint64, optional, tag = "2")]
9045 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
9046}
9047#[non_exhaustive]
9048#[derive(Clone, PartialEq, ::prost::Message)]
9049pub struct ExecutionTimeObservations {
9050 #[prost(int32, optional, tag = "1")]
9052 pub version: ::core::option::Option<i32>,
9053 #[prost(message, repeated, tag = "2")]
9054 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
9055}
9056#[non_exhaustive]
9057#[derive(Clone, PartialEq, ::prost::Message)]
9058pub struct ExecutionTimeObservation {
9059 #[prost(
9060 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
9061 optional,
9062 tag = "1"
9063 )]
9064 pub kind: ::core::option::Option<i32>,
9065 #[prost(message, optional, tag = "2")]
9066 pub move_entry_point: ::core::option::Option<MoveCall>,
9067 #[prost(message, repeated, tag = "3")]
9068 pub validator_observations: ::prost::alloc::vec::Vec<
9069 ValidatorExecutionTimeObservation,
9070 >,
9071}
9072pub mod execution_time_observation {
9074 #[non_exhaustive]
9075 #[derive(
9076 Clone,
9077 Copy,
9078 Debug,
9079 PartialEq,
9080 Eq,
9081 Hash,
9082 PartialOrd,
9083 Ord,
9084 ::prost::Enumeration
9085 )]
9086 #[repr(i32)]
9087 pub enum ExecutionTimeObservationKind {
9088 Unknown = 0,
9089 MoveEntryPoint = 1,
9090 TransferObjects = 2,
9091 SplitCoins = 3,
9092 MergeCoins = 4,
9093 Publish = 5,
9094 MakeMoveVector = 6,
9095 Upgrade = 7,
9096 }
9097 impl ExecutionTimeObservationKind {
9098 pub fn as_str_name(&self) -> &'static str {
9103 match self {
9104 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
9105 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
9106 Self::TransferObjects => "TRANSFER_OBJECTS",
9107 Self::SplitCoins => "SPLIT_COINS",
9108 Self::MergeCoins => "MERGE_COINS",
9109 Self::Publish => "PUBLISH",
9110 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
9111 Self::Upgrade => "UPGRADE",
9112 }
9113 }
9114 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9116 match value {
9117 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
9118 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
9119 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
9120 "SPLIT_COINS" => Some(Self::SplitCoins),
9121 "MERGE_COINS" => Some(Self::MergeCoins),
9122 "PUBLISH" => Some(Self::Publish),
9123 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
9124 "UPGRADE" => Some(Self::Upgrade),
9125 _ => None,
9126 }
9127 }
9128 }
9129}
9130#[non_exhaustive]
9131#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9132pub struct ValidatorExecutionTimeObservation {
9133 #[prost(bytes = "bytes", optional, tag = "1")]
9135 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
9136 #[prost(message, optional, tag = "2")]
9138 pub duration: ::core::option::Option<::prost_types::Duration>,
9139}
9140#[non_exhaustive]
9141#[derive(Clone, PartialEq, ::prost::Message)]
9142pub struct ExecuteTransactionRequest {
9143 #[prost(message, optional, tag = "1")]
9145 pub transaction: ::core::option::Option<Transaction>,
9146 #[prost(message, repeated, tag = "2")]
9149 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
9150 #[prost(message, optional, tag = "3")]
9153 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9154}
9155#[non_exhaustive]
9157#[derive(Clone, PartialEq, ::prost::Message)]
9158pub struct ExecuteTransactionResponse {
9159 #[prost(message, optional, tag = "1")]
9160 pub transaction: ::core::option::Option<ExecutedTransaction>,
9161}
9162#[non_exhaustive]
9163#[derive(Clone, PartialEq, ::prost::Message)]
9164pub struct SimulateTransactionRequest {
9165 #[prost(message, optional, tag = "1")]
9166 pub transaction: ::core::option::Option<Transaction>,
9167 #[prost(message, optional, tag = "2")]
9169 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9170 #[prost(
9172 enumeration = "simulate_transaction_request::TransactionChecks",
9173 optional,
9174 tag = "3"
9175 )]
9176 pub checks: ::core::option::Option<i32>,
9177 #[prost(bool, optional, tag = "4")]
9182 pub do_gas_selection: ::core::option::Option<bool>,
9183}
9184pub mod simulate_transaction_request {
9186 #[non_exhaustive]
9188 #[derive(
9189 Clone,
9190 Copy,
9191 Debug,
9192 PartialEq,
9193 Eq,
9194 Hash,
9195 PartialOrd,
9196 Ord,
9197 ::prost::Enumeration
9198 )]
9199 #[repr(i32)]
9200 pub enum TransactionChecks {
9201 Enabled = 0,
9202 Disabled = 1,
9203 }
9204 impl TransactionChecks {
9205 pub fn as_str_name(&self) -> &'static str {
9210 match self {
9211 Self::Enabled => "ENABLED",
9212 Self::Disabled => "DISABLED",
9213 }
9214 }
9215 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9217 match value {
9218 "ENABLED" => Some(Self::Enabled),
9219 "DISABLED" => Some(Self::Disabled),
9220 _ => None,
9221 }
9222 }
9223 }
9224}
9225#[non_exhaustive]
9226#[derive(Clone, PartialEq, ::prost::Message)]
9227pub struct SimulateTransactionResponse {
9228 #[prost(message, optional, tag = "1")]
9229 pub transaction: ::core::option::Option<ExecutedTransaction>,
9230 #[prost(message, repeated, tag = "2")]
9231 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
9232 #[prost(uint64, optional, tag = "3")]
9236 pub suggested_gas_price: ::core::option::Option<u64>,
9237}
9238#[non_exhaustive]
9240#[derive(Clone, PartialEq, ::prost::Message)]
9241pub struct CommandResult {
9242 #[prost(message, repeated, tag = "1")]
9243 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
9244 #[prost(message, repeated, tag = "2")]
9245 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
9246}
9247#[non_exhaustive]
9248#[derive(Clone, PartialEq, ::prost::Message)]
9249pub struct CommandOutput {
9250 #[prost(message, optional, tag = "1")]
9251 pub argument: ::core::option::Option<Argument>,
9252 #[prost(message, optional, tag = "2")]
9253 pub value: ::core::option::Option<Bcs>,
9254 #[prost(message, optional, boxed, tag = "3")]
9256 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
9257}
9258pub mod transaction_execution_service_client {
9260 #![allow(
9261 unused_variables,
9262 dead_code,
9263 missing_docs,
9264 clippy::wildcard_imports,
9265 clippy::let_unit_value,
9266 )]
9267 use tonic::codegen::*;
9268 use tonic::codegen::http::Uri;
9269 #[derive(Debug, Clone)]
9270 pub struct TransactionExecutionServiceClient<T> {
9271 inner: tonic::client::Grpc<T>,
9272 }
9273 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
9274 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9276 where
9277 D: TryInto<tonic::transport::Endpoint>,
9278 D::Error: Into<StdError>,
9279 {
9280 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9281 Ok(Self::new(conn))
9282 }
9283 }
9284 impl<T> TransactionExecutionServiceClient<T>
9285 where
9286 T: tonic::client::GrpcService<tonic::body::Body>,
9287 T::Error: Into<StdError>,
9288 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9289 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9290 {
9291 pub fn new(inner: T) -> Self {
9292 let inner = tonic::client::Grpc::new(inner);
9293 Self { inner }
9294 }
9295 pub fn with_origin(inner: T, origin: Uri) -> Self {
9296 let inner = tonic::client::Grpc::with_origin(inner, origin);
9297 Self { inner }
9298 }
9299 pub fn with_interceptor<F>(
9300 inner: T,
9301 interceptor: F,
9302 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
9303 where
9304 F: tonic::service::Interceptor,
9305 T::ResponseBody: Default,
9306 T: tonic::codegen::Service<
9307 http::Request<tonic::body::Body>,
9308 Response = http::Response<
9309 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9310 >,
9311 >,
9312 <T as tonic::codegen::Service<
9313 http::Request<tonic::body::Body>,
9314 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9315 {
9316 TransactionExecutionServiceClient::new(
9317 InterceptedService::new(inner, interceptor),
9318 )
9319 }
9320 #[must_use]
9325 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9326 self.inner = self.inner.send_compressed(encoding);
9327 self
9328 }
9329 #[must_use]
9331 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9332 self.inner = self.inner.accept_compressed(encoding);
9333 self
9334 }
9335 #[must_use]
9339 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9340 self.inner = self.inner.max_decoding_message_size(limit);
9341 self
9342 }
9343 #[must_use]
9347 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9348 self.inner = self.inner.max_encoding_message_size(limit);
9349 self
9350 }
9351 pub async fn execute_transaction(
9352 &mut self,
9353 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
9354 ) -> std::result::Result<
9355 tonic::Response<super::ExecuteTransactionResponse>,
9356 tonic::Status,
9357 > {
9358 self.inner
9359 .ready()
9360 .await
9361 .map_err(|e| {
9362 tonic::Status::unknown(
9363 format!("Service was not ready: {}", e.into()),
9364 )
9365 })?;
9366 let codec = tonic_prost::ProstCodec::default();
9367 let path = http::uri::PathAndQuery::from_static(
9368 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
9369 );
9370 let mut req = request.into_request();
9371 req.extensions_mut()
9372 .insert(
9373 GrpcMethod::new(
9374 "sui.rpc.v2.TransactionExecutionService",
9375 "ExecuteTransaction",
9376 ),
9377 );
9378 self.inner.unary(req, path, codec).await
9379 }
9380 pub async fn simulate_transaction(
9381 &mut self,
9382 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
9383 ) -> std::result::Result<
9384 tonic::Response<super::SimulateTransactionResponse>,
9385 tonic::Status,
9386 > {
9387 self.inner
9388 .ready()
9389 .await
9390 .map_err(|e| {
9391 tonic::Status::unknown(
9392 format!("Service was not ready: {}", e.into()),
9393 )
9394 })?;
9395 let codec = tonic_prost::ProstCodec::default();
9396 let path = http::uri::PathAndQuery::from_static(
9397 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
9398 );
9399 let mut req = request.into_request();
9400 req.extensions_mut()
9401 .insert(
9402 GrpcMethod::new(
9403 "sui.rpc.v2.TransactionExecutionService",
9404 "SimulateTransaction",
9405 ),
9406 );
9407 self.inner.unary(req, path, codec).await
9408 }
9409 }
9410}
9411pub mod transaction_execution_service_server {
9413 #![allow(
9414 unused_variables,
9415 dead_code,
9416 missing_docs,
9417 clippy::wildcard_imports,
9418 clippy::let_unit_value,
9419 )]
9420 use tonic::codegen::*;
9421 #[async_trait]
9423 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
9424 async fn execute_transaction(
9425 &self,
9426 request: tonic::Request<super::ExecuteTransactionRequest>,
9427 ) -> std::result::Result<
9428 tonic::Response<super::ExecuteTransactionResponse>,
9429 tonic::Status,
9430 > {
9431 Err(tonic::Status::unimplemented("Not yet implemented"))
9432 }
9433 async fn simulate_transaction(
9434 &self,
9435 request: tonic::Request<super::SimulateTransactionRequest>,
9436 ) -> std::result::Result<
9437 tonic::Response<super::SimulateTransactionResponse>,
9438 tonic::Status,
9439 > {
9440 Err(tonic::Status::unimplemented("Not yet implemented"))
9441 }
9442 }
9443 #[derive(Debug)]
9444 pub struct TransactionExecutionServiceServer<T> {
9445 inner: Arc<T>,
9446 accept_compression_encodings: EnabledCompressionEncodings,
9447 send_compression_encodings: EnabledCompressionEncodings,
9448 max_decoding_message_size: Option<usize>,
9449 max_encoding_message_size: Option<usize>,
9450 }
9451 impl<T> TransactionExecutionServiceServer<T> {
9452 pub fn new(inner: T) -> Self {
9453 Self::from_arc(Arc::new(inner))
9454 }
9455 pub fn from_arc(inner: Arc<T>) -> Self {
9456 Self {
9457 inner,
9458 accept_compression_encodings: Default::default(),
9459 send_compression_encodings: Default::default(),
9460 max_decoding_message_size: None,
9461 max_encoding_message_size: None,
9462 }
9463 }
9464 pub fn with_interceptor<F>(
9465 inner: T,
9466 interceptor: F,
9467 ) -> InterceptedService<Self, F>
9468 where
9469 F: tonic::service::Interceptor,
9470 {
9471 InterceptedService::new(Self::new(inner), interceptor)
9472 }
9473 #[must_use]
9475 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9476 self.accept_compression_encodings.enable(encoding);
9477 self
9478 }
9479 #[must_use]
9481 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9482 self.send_compression_encodings.enable(encoding);
9483 self
9484 }
9485 #[must_use]
9489 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9490 self.max_decoding_message_size = Some(limit);
9491 self
9492 }
9493 #[must_use]
9497 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9498 self.max_encoding_message_size = Some(limit);
9499 self
9500 }
9501 }
9502 impl<T, B> tonic::codegen::Service<http::Request<B>>
9503 for TransactionExecutionServiceServer<T>
9504 where
9505 T: TransactionExecutionService,
9506 B: Body + std::marker::Send + 'static,
9507 B::Error: Into<StdError> + std::marker::Send + 'static,
9508 {
9509 type Response = http::Response<tonic::body::Body>;
9510 type Error = std::convert::Infallible;
9511 type Future = BoxFuture<Self::Response, Self::Error>;
9512 fn poll_ready(
9513 &mut self,
9514 _cx: &mut Context<'_>,
9515 ) -> Poll<std::result::Result<(), Self::Error>> {
9516 Poll::Ready(Ok(()))
9517 }
9518 fn call(&mut self, req: http::Request<B>) -> Self::Future {
9519 match req.uri().path() {
9520 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
9521 #[allow(non_camel_case_types)]
9522 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
9523 pub Arc<T>,
9524 );
9525 impl<
9526 T: TransactionExecutionService,
9527 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
9528 for ExecuteTransactionSvc<T> {
9529 type Response = super::ExecuteTransactionResponse;
9530 type Future = BoxFuture<
9531 tonic::Response<Self::Response>,
9532 tonic::Status,
9533 >;
9534 fn call(
9535 &mut self,
9536 request: tonic::Request<super::ExecuteTransactionRequest>,
9537 ) -> Self::Future {
9538 let inner = Arc::clone(&self.0);
9539 let fut = async move {
9540 <T as TransactionExecutionService>::execute_transaction(
9541 &inner,
9542 request,
9543 )
9544 .await
9545 };
9546 Box::pin(fut)
9547 }
9548 }
9549 let accept_compression_encodings = self.accept_compression_encodings;
9550 let send_compression_encodings = self.send_compression_encodings;
9551 let max_decoding_message_size = self.max_decoding_message_size;
9552 let max_encoding_message_size = self.max_encoding_message_size;
9553 let inner = self.inner.clone();
9554 let fut = async move {
9555 let method = ExecuteTransactionSvc(inner);
9556 let codec = tonic_prost::ProstCodec::default();
9557 let mut grpc = tonic::server::Grpc::new(codec)
9558 .apply_compression_config(
9559 accept_compression_encodings,
9560 send_compression_encodings,
9561 )
9562 .apply_max_message_size_config(
9563 max_decoding_message_size,
9564 max_encoding_message_size,
9565 );
9566 let res = grpc.unary(method, req).await;
9567 Ok(res)
9568 };
9569 Box::pin(fut)
9570 }
9571 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
9572 #[allow(non_camel_case_types)]
9573 struct SimulateTransactionSvc<T: TransactionExecutionService>(
9574 pub Arc<T>,
9575 );
9576 impl<
9577 T: TransactionExecutionService,
9578 > tonic::server::UnaryService<super::SimulateTransactionRequest>
9579 for SimulateTransactionSvc<T> {
9580 type Response = super::SimulateTransactionResponse;
9581 type Future = BoxFuture<
9582 tonic::Response<Self::Response>,
9583 tonic::Status,
9584 >;
9585 fn call(
9586 &mut self,
9587 request: tonic::Request<super::SimulateTransactionRequest>,
9588 ) -> Self::Future {
9589 let inner = Arc::clone(&self.0);
9590 let fut = async move {
9591 <T as TransactionExecutionService>::simulate_transaction(
9592 &inner,
9593 request,
9594 )
9595 .await
9596 };
9597 Box::pin(fut)
9598 }
9599 }
9600 let accept_compression_encodings = self.accept_compression_encodings;
9601 let send_compression_encodings = self.send_compression_encodings;
9602 let max_decoding_message_size = self.max_decoding_message_size;
9603 let max_encoding_message_size = self.max_encoding_message_size;
9604 let inner = self.inner.clone();
9605 let fut = async move {
9606 let method = SimulateTransactionSvc(inner);
9607 let codec = tonic_prost::ProstCodec::default();
9608 let mut grpc = tonic::server::Grpc::new(codec)
9609 .apply_compression_config(
9610 accept_compression_encodings,
9611 send_compression_encodings,
9612 )
9613 .apply_max_message_size_config(
9614 max_decoding_message_size,
9615 max_encoding_message_size,
9616 );
9617 let res = grpc.unary(method, req).await;
9618 Ok(res)
9619 };
9620 Box::pin(fut)
9621 }
9622 _ => {
9623 Box::pin(async move {
9624 let mut response = http::Response::new(
9625 tonic::body::Body::default(),
9626 );
9627 let headers = response.headers_mut();
9628 headers
9629 .insert(
9630 tonic::Status::GRPC_STATUS,
9631 (tonic::Code::Unimplemented as i32).into(),
9632 );
9633 headers
9634 .insert(
9635 http::header::CONTENT_TYPE,
9636 tonic::metadata::GRPC_CONTENT_TYPE,
9637 );
9638 Ok(response)
9639 })
9640 }
9641 }
9642 }
9643 }
9644 impl<T> Clone for TransactionExecutionServiceServer<T> {
9645 fn clone(&self) -> Self {
9646 let inner = self.inner.clone();
9647 Self {
9648 inner,
9649 accept_compression_encodings: self.accept_compression_encodings,
9650 send_compression_encodings: self.send_compression_encodings,
9651 max_decoding_message_size: self.max_decoding_message_size,
9652 max_encoding_message_size: self.max_encoding_message_size,
9653 }
9654 }
9655 }
9656 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
9658 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
9659 const NAME: &'static str = SERVICE_NAME;
9660 }
9661}