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")]
3962 pub selector: ::core::option::Option<get_package_request::Selector>,
3963}
3964pub mod get_package_request {
3966 #[non_exhaustive]
3976 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
3977 pub enum Selector {
3978 #[prost(uint64, tag = "2")]
3979 Version(u64),
3980 #[prost(uint64, tag = "3")]
3981 AtCheckpoint(u64),
3982 }
3983}
3984#[non_exhaustive]
3985#[derive(Clone, PartialEq, ::prost::Message)]
3986pub struct GetPackageResponse {
3987 #[prost(message, optional, tag = "1")]
3989 pub package: ::core::option::Option<Package>,
3990}
3991#[non_exhaustive]
3992#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3993pub struct GetDatatypeRequest {
3994 #[prost(string, optional, tag = "1")]
3996 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3997 #[prost(string, optional, tag = "2")]
3999 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4000 #[prost(string, optional, tag = "3")]
4002 pub name: ::core::option::Option<::prost::alloc::string::String>,
4003}
4004#[non_exhaustive]
4005#[derive(Clone, PartialEq, ::prost::Message)]
4006pub struct GetDatatypeResponse {
4007 #[prost(message, optional, tag = "1")]
4009 pub datatype: ::core::option::Option<DatatypeDescriptor>,
4010}
4011#[non_exhaustive]
4012#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4013pub struct GetFunctionRequest {
4014 #[prost(string, optional, tag = "1")]
4016 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4017 #[prost(string, optional, tag = "2")]
4019 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4020 #[prost(string, optional, tag = "3")]
4022 pub name: ::core::option::Option<::prost::alloc::string::String>,
4023}
4024#[non_exhaustive]
4025#[derive(Clone, PartialEq, ::prost::Message)]
4026pub struct GetFunctionResponse {
4027 #[prost(message, optional, tag = "1")]
4029 pub function: ::core::option::Option<FunctionDescriptor>,
4030}
4031#[non_exhaustive]
4032#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4033pub struct ListPackageVersionsRequest {
4034 #[prost(string, optional, tag = "1")]
4036 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4037 #[prost(uint32, optional, tag = "2")]
4041 pub page_size: ::core::option::Option<u32>,
4042 #[prost(bytes = "bytes", optional, tag = "3")]
4048 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
4049}
4050#[non_exhaustive]
4051#[derive(Clone, PartialEq, ::prost::Message)]
4052pub struct ListPackageVersionsResponse {
4053 #[prost(message, repeated, tag = "1")]
4055 pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
4056 #[prost(bytes = "bytes", optional, tag = "2")]
4059 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
4060}
4061#[non_exhaustive]
4063#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4064pub struct PackageVersion {
4065 #[prost(string, optional, tag = "1")]
4067 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4068 #[prost(uint64, optional, tag = "2")]
4070 pub version: ::core::option::Option<u64>,
4071}
4072pub mod move_package_service_client {
4074 #![allow(
4075 unused_variables,
4076 dead_code,
4077 missing_docs,
4078 clippy::wildcard_imports,
4079 clippy::let_unit_value,
4080 )]
4081 use tonic::codegen::*;
4082 use tonic::codegen::http::Uri;
4083 #[derive(Debug, Clone)]
4084 pub struct MovePackageServiceClient<T> {
4085 inner: tonic::client::Grpc<T>,
4086 }
4087 impl MovePackageServiceClient<tonic::transport::Channel> {
4088 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4090 where
4091 D: TryInto<tonic::transport::Endpoint>,
4092 D::Error: Into<StdError>,
4093 {
4094 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4095 Ok(Self::new(conn))
4096 }
4097 }
4098 impl<T> MovePackageServiceClient<T>
4099 where
4100 T: tonic::client::GrpcService<tonic::body::Body>,
4101 T::Error: Into<StdError>,
4102 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4103 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4104 {
4105 pub fn new(inner: T) -> Self {
4106 let inner = tonic::client::Grpc::new(inner);
4107 Self { inner }
4108 }
4109 pub fn with_origin(inner: T, origin: Uri) -> Self {
4110 let inner = tonic::client::Grpc::with_origin(inner, origin);
4111 Self { inner }
4112 }
4113 pub fn with_interceptor<F>(
4114 inner: T,
4115 interceptor: F,
4116 ) -> MovePackageServiceClient<InterceptedService<T, F>>
4117 where
4118 F: tonic::service::Interceptor,
4119 T::ResponseBody: Default,
4120 T: tonic::codegen::Service<
4121 http::Request<tonic::body::Body>,
4122 Response = http::Response<
4123 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4124 >,
4125 >,
4126 <T as tonic::codegen::Service<
4127 http::Request<tonic::body::Body>,
4128 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4129 {
4130 MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
4131 }
4132 #[must_use]
4137 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4138 self.inner = self.inner.send_compressed(encoding);
4139 self
4140 }
4141 #[must_use]
4143 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4144 self.inner = self.inner.accept_compressed(encoding);
4145 self
4146 }
4147 #[must_use]
4151 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4152 self.inner = self.inner.max_decoding_message_size(limit);
4153 self
4154 }
4155 #[must_use]
4159 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4160 self.inner = self.inner.max_encoding_message_size(limit);
4161 self
4162 }
4163 pub async fn get_package(
4164 &mut self,
4165 request: impl tonic::IntoRequest<super::GetPackageRequest>,
4166 ) -> std::result::Result<
4167 tonic::Response<super::GetPackageResponse>,
4168 tonic::Status,
4169 > {
4170 self.inner
4171 .ready()
4172 .await
4173 .map_err(|e| {
4174 tonic::Status::unknown(
4175 format!("Service was not ready: {}", e.into()),
4176 )
4177 })?;
4178 let codec = tonic_prost::ProstCodec::default();
4179 let path = http::uri::PathAndQuery::from_static(
4180 "/sui.rpc.v2.MovePackageService/GetPackage",
4181 );
4182 let mut req = request.into_request();
4183 req.extensions_mut()
4184 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
4185 self.inner.unary(req, path, codec).await
4186 }
4187 pub async fn get_datatype(
4188 &mut self,
4189 request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
4190 ) -> std::result::Result<
4191 tonic::Response<super::GetDatatypeResponse>,
4192 tonic::Status,
4193 > {
4194 self.inner
4195 .ready()
4196 .await
4197 .map_err(|e| {
4198 tonic::Status::unknown(
4199 format!("Service was not ready: {}", e.into()),
4200 )
4201 })?;
4202 let codec = tonic_prost::ProstCodec::default();
4203 let path = http::uri::PathAndQuery::from_static(
4204 "/sui.rpc.v2.MovePackageService/GetDatatype",
4205 );
4206 let mut req = request.into_request();
4207 req.extensions_mut()
4208 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
4209 self.inner.unary(req, path, codec).await
4210 }
4211 pub async fn get_function(
4212 &mut self,
4213 request: impl tonic::IntoRequest<super::GetFunctionRequest>,
4214 ) -> std::result::Result<
4215 tonic::Response<super::GetFunctionResponse>,
4216 tonic::Status,
4217 > {
4218 self.inner
4219 .ready()
4220 .await
4221 .map_err(|e| {
4222 tonic::Status::unknown(
4223 format!("Service was not ready: {}", e.into()),
4224 )
4225 })?;
4226 let codec = tonic_prost::ProstCodec::default();
4227 let path = http::uri::PathAndQuery::from_static(
4228 "/sui.rpc.v2.MovePackageService/GetFunction",
4229 );
4230 let mut req = request.into_request();
4231 req.extensions_mut()
4232 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
4233 self.inner.unary(req, path, codec).await
4234 }
4235 pub async fn list_package_versions(
4236 &mut self,
4237 request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
4238 ) -> std::result::Result<
4239 tonic::Response<super::ListPackageVersionsResponse>,
4240 tonic::Status,
4241 > {
4242 self.inner
4243 .ready()
4244 .await
4245 .map_err(|e| {
4246 tonic::Status::unknown(
4247 format!("Service was not ready: {}", e.into()),
4248 )
4249 })?;
4250 let codec = tonic_prost::ProstCodec::default();
4251 let path = http::uri::PathAndQuery::from_static(
4252 "/sui.rpc.v2.MovePackageService/ListPackageVersions",
4253 );
4254 let mut req = request.into_request();
4255 req.extensions_mut()
4256 .insert(
4257 GrpcMethod::new(
4258 "sui.rpc.v2.MovePackageService",
4259 "ListPackageVersions",
4260 ),
4261 );
4262 self.inner.unary(req, path, codec).await
4263 }
4264 }
4265}
4266pub mod move_package_service_server {
4268 #![allow(
4269 unused_variables,
4270 dead_code,
4271 missing_docs,
4272 clippy::wildcard_imports,
4273 clippy::let_unit_value,
4274 )]
4275 use tonic::codegen::*;
4276 #[async_trait]
4278 pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
4279 async fn get_package(
4280 &self,
4281 request: tonic::Request<super::GetPackageRequest>,
4282 ) -> std::result::Result<
4283 tonic::Response<super::GetPackageResponse>,
4284 tonic::Status,
4285 > {
4286 Err(tonic::Status::unimplemented("Not yet implemented"))
4287 }
4288 async fn get_datatype(
4289 &self,
4290 request: tonic::Request<super::GetDatatypeRequest>,
4291 ) -> std::result::Result<
4292 tonic::Response<super::GetDatatypeResponse>,
4293 tonic::Status,
4294 > {
4295 Err(tonic::Status::unimplemented("Not yet implemented"))
4296 }
4297 async fn get_function(
4298 &self,
4299 request: tonic::Request<super::GetFunctionRequest>,
4300 ) -> std::result::Result<
4301 tonic::Response<super::GetFunctionResponse>,
4302 tonic::Status,
4303 > {
4304 Err(tonic::Status::unimplemented("Not yet implemented"))
4305 }
4306 async fn list_package_versions(
4307 &self,
4308 request: tonic::Request<super::ListPackageVersionsRequest>,
4309 ) -> std::result::Result<
4310 tonic::Response<super::ListPackageVersionsResponse>,
4311 tonic::Status,
4312 > {
4313 Err(tonic::Status::unimplemented("Not yet implemented"))
4314 }
4315 }
4316 #[derive(Debug)]
4317 pub struct MovePackageServiceServer<T> {
4318 inner: Arc<T>,
4319 accept_compression_encodings: EnabledCompressionEncodings,
4320 send_compression_encodings: EnabledCompressionEncodings,
4321 max_decoding_message_size: Option<usize>,
4322 max_encoding_message_size: Option<usize>,
4323 }
4324 impl<T> MovePackageServiceServer<T> {
4325 pub fn new(inner: T) -> Self {
4326 Self::from_arc(Arc::new(inner))
4327 }
4328 pub fn from_arc(inner: Arc<T>) -> Self {
4329 Self {
4330 inner,
4331 accept_compression_encodings: Default::default(),
4332 send_compression_encodings: Default::default(),
4333 max_decoding_message_size: None,
4334 max_encoding_message_size: None,
4335 }
4336 }
4337 pub fn with_interceptor<F>(
4338 inner: T,
4339 interceptor: F,
4340 ) -> InterceptedService<Self, F>
4341 where
4342 F: tonic::service::Interceptor,
4343 {
4344 InterceptedService::new(Self::new(inner), interceptor)
4345 }
4346 #[must_use]
4348 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4349 self.accept_compression_encodings.enable(encoding);
4350 self
4351 }
4352 #[must_use]
4354 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4355 self.send_compression_encodings.enable(encoding);
4356 self
4357 }
4358 #[must_use]
4362 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4363 self.max_decoding_message_size = Some(limit);
4364 self
4365 }
4366 #[must_use]
4370 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4371 self.max_encoding_message_size = Some(limit);
4372 self
4373 }
4374 }
4375 impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
4376 where
4377 T: MovePackageService,
4378 B: Body + std::marker::Send + 'static,
4379 B::Error: Into<StdError> + std::marker::Send + 'static,
4380 {
4381 type Response = http::Response<tonic::body::Body>;
4382 type Error = std::convert::Infallible;
4383 type Future = BoxFuture<Self::Response, Self::Error>;
4384 fn poll_ready(
4385 &mut self,
4386 _cx: &mut Context<'_>,
4387 ) -> Poll<std::result::Result<(), Self::Error>> {
4388 Poll::Ready(Ok(()))
4389 }
4390 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4391 match req.uri().path() {
4392 "/sui.rpc.v2.MovePackageService/GetPackage" => {
4393 #[allow(non_camel_case_types)]
4394 struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
4395 impl<
4396 T: MovePackageService,
4397 > tonic::server::UnaryService<super::GetPackageRequest>
4398 for GetPackageSvc<T> {
4399 type Response = super::GetPackageResponse;
4400 type Future = BoxFuture<
4401 tonic::Response<Self::Response>,
4402 tonic::Status,
4403 >;
4404 fn call(
4405 &mut self,
4406 request: tonic::Request<super::GetPackageRequest>,
4407 ) -> Self::Future {
4408 let inner = Arc::clone(&self.0);
4409 let fut = async move {
4410 <T as MovePackageService>::get_package(&inner, request)
4411 .await
4412 };
4413 Box::pin(fut)
4414 }
4415 }
4416 let accept_compression_encodings = self.accept_compression_encodings;
4417 let send_compression_encodings = self.send_compression_encodings;
4418 let max_decoding_message_size = self.max_decoding_message_size;
4419 let max_encoding_message_size = self.max_encoding_message_size;
4420 let inner = self.inner.clone();
4421 let fut = async move {
4422 let method = GetPackageSvc(inner);
4423 let codec = tonic_prost::ProstCodec::default();
4424 let mut grpc = tonic::server::Grpc::new(codec)
4425 .apply_compression_config(
4426 accept_compression_encodings,
4427 send_compression_encodings,
4428 )
4429 .apply_max_message_size_config(
4430 max_decoding_message_size,
4431 max_encoding_message_size,
4432 );
4433 let res = grpc.unary(method, req).await;
4434 Ok(res)
4435 };
4436 Box::pin(fut)
4437 }
4438 "/sui.rpc.v2.MovePackageService/GetDatatype" => {
4439 #[allow(non_camel_case_types)]
4440 struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
4441 impl<
4442 T: MovePackageService,
4443 > tonic::server::UnaryService<super::GetDatatypeRequest>
4444 for GetDatatypeSvc<T> {
4445 type Response = super::GetDatatypeResponse;
4446 type Future = BoxFuture<
4447 tonic::Response<Self::Response>,
4448 tonic::Status,
4449 >;
4450 fn call(
4451 &mut self,
4452 request: tonic::Request<super::GetDatatypeRequest>,
4453 ) -> Self::Future {
4454 let inner = Arc::clone(&self.0);
4455 let fut = async move {
4456 <T as MovePackageService>::get_datatype(&inner, request)
4457 .await
4458 };
4459 Box::pin(fut)
4460 }
4461 }
4462 let accept_compression_encodings = self.accept_compression_encodings;
4463 let send_compression_encodings = self.send_compression_encodings;
4464 let max_decoding_message_size = self.max_decoding_message_size;
4465 let max_encoding_message_size = self.max_encoding_message_size;
4466 let inner = self.inner.clone();
4467 let fut = async move {
4468 let method = GetDatatypeSvc(inner);
4469 let codec = tonic_prost::ProstCodec::default();
4470 let mut grpc = tonic::server::Grpc::new(codec)
4471 .apply_compression_config(
4472 accept_compression_encodings,
4473 send_compression_encodings,
4474 )
4475 .apply_max_message_size_config(
4476 max_decoding_message_size,
4477 max_encoding_message_size,
4478 );
4479 let res = grpc.unary(method, req).await;
4480 Ok(res)
4481 };
4482 Box::pin(fut)
4483 }
4484 "/sui.rpc.v2.MovePackageService/GetFunction" => {
4485 #[allow(non_camel_case_types)]
4486 struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
4487 impl<
4488 T: MovePackageService,
4489 > tonic::server::UnaryService<super::GetFunctionRequest>
4490 for GetFunctionSvc<T> {
4491 type Response = super::GetFunctionResponse;
4492 type Future = BoxFuture<
4493 tonic::Response<Self::Response>,
4494 tonic::Status,
4495 >;
4496 fn call(
4497 &mut self,
4498 request: tonic::Request<super::GetFunctionRequest>,
4499 ) -> Self::Future {
4500 let inner = Arc::clone(&self.0);
4501 let fut = async move {
4502 <T as MovePackageService>::get_function(&inner, request)
4503 .await
4504 };
4505 Box::pin(fut)
4506 }
4507 }
4508 let accept_compression_encodings = self.accept_compression_encodings;
4509 let send_compression_encodings = self.send_compression_encodings;
4510 let max_decoding_message_size = self.max_decoding_message_size;
4511 let max_encoding_message_size = self.max_encoding_message_size;
4512 let inner = self.inner.clone();
4513 let fut = async move {
4514 let method = GetFunctionSvc(inner);
4515 let codec = tonic_prost::ProstCodec::default();
4516 let mut grpc = tonic::server::Grpc::new(codec)
4517 .apply_compression_config(
4518 accept_compression_encodings,
4519 send_compression_encodings,
4520 )
4521 .apply_max_message_size_config(
4522 max_decoding_message_size,
4523 max_encoding_message_size,
4524 );
4525 let res = grpc.unary(method, req).await;
4526 Ok(res)
4527 };
4528 Box::pin(fut)
4529 }
4530 "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
4531 #[allow(non_camel_case_types)]
4532 struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
4533 impl<
4534 T: MovePackageService,
4535 > tonic::server::UnaryService<super::ListPackageVersionsRequest>
4536 for ListPackageVersionsSvc<T> {
4537 type Response = super::ListPackageVersionsResponse;
4538 type Future = BoxFuture<
4539 tonic::Response<Self::Response>,
4540 tonic::Status,
4541 >;
4542 fn call(
4543 &mut self,
4544 request: tonic::Request<super::ListPackageVersionsRequest>,
4545 ) -> Self::Future {
4546 let inner = Arc::clone(&self.0);
4547 let fut = async move {
4548 <T as MovePackageService>::list_package_versions(
4549 &inner,
4550 request,
4551 )
4552 .await
4553 };
4554 Box::pin(fut)
4555 }
4556 }
4557 let accept_compression_encodings = self.accept_compression_encodings;
4558 let send_compression_encodings = self.send_compression_encodings;
4559 let max_decoding_message_size = self.max_decoding_message_size;
4560 let max_encoding_message_size = self.max_encoding_message_size;
4561 let inner = self.inner.clone();
4562 let fut = async move {
4563 let method = ListPackageVersionsSvc(inner);
4564 let codec = tonic_prost::ProstCodec::default();
4565 let mut grpc = tonic::server::Grpc::new(codec)
4566 .apply_compression_config(
4567 accept_compression_encodings,
4568 send_compression_encodings,
4569 )
4570 .apply_max_message_size_config(
4571 max_decoding_message_size,
4572 max_encoding_message_size,
4573 );
4574 let res = grpc.unary(method, req).await;
4575 Ok(res)
4576 };
4577 Box::pin(fut)
4578 }
4579 _ => {
4580 Box::pin(async move {
4581 let mut response = http::Response::new(
4582 tonic::body::Body::default(),
4583 );
4584 let headers = response.headers_mut();
4585 headers
4586 .insert(
4587 tonic::Status::GRPC_STATUS,
4588 (tonic::Code::Unimplemented as i32).into(),
4589 );
4590 headers
4591 .insert(
4592 http::header::CONTENT_TYPE,
4593 tonic::metadata::GRPC_CONTENT_TYPE,
4594 );
4595 Ok(response)
4596 })
4597 }
4598 }
4599 }
4600 }
4601 impl<T> Clone for MovePackageServiceServer<T> {
4602 fn clone(&self) -> Self {
4603 let inner = self.inner.clone();
4604 Self {
4605 inner,
4606 accept_compression_encodings: self.accept_compression_encodings,
4607 send_compression_encodings: self.send_compression_encodings,
4608 max_decoding_message_size: self.max_decoding_message_size,
4609 max_encoding_message_size: self.max_encoding_message_size,
4610 }
4611 }
4612 }
4613 pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
4615 impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
4616 const NAME: &'static str = SERVICE_NAME;
4617 }
4618}
4619#[non_exhaustive]
4620#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4621pub struct LookupNameRequest {
4622 #[prost(string, optional, tag = "1")]
4626 pub name: ::core::option::Option<::prost::alloc::string::String>,
4627}
4628#[non_exhaustive]
4629#[derive(Clone, PartialEq, ::prost::Message)]
4630pub struct LookupNameResponse {
4631 #[prost(message, optional, tag = "1")]
4633 pub record: ::core::option::Option<NameRecord>,
4634}
4635#[non_exhaustive]
4636#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4637pub struct ReverseLookupNameRequest {
4638 #[prost(string, optional, tag = "1")]
4640 pub address: ::core::option::Option<::prost::alloc::string::String>,
4641}
4642#[non_exhaustive]
4643#[derive(Clone, PartialEq, ::prost::Message)]
4644pub struct ReverseLookupNameResponse {
4645 #[prost(message, optional, tag = "1")]
4647 pub record: ::core::option::Option<NameRecord>,
4648}
4649#[non_exhaustive]
4650#[derive(Clone, PartialEq, ::prost::Message)]
4651pub struct NameRecord {
4652 #[prost(string, optional, tag = "1")]
4657 pub id: ::core::option::Option<::prost::alloc::string::String>,
4658 #[prost(string, optional, tag = "2")]
4660 pub name: ::core::option::Option<::prost::alloc::string::String>,
4661 #[prost(string, optional, tag = "3")]
4669 pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
4670 #[prost(message, optional, tag = "4")]
4675 pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
4676 #[prost(string, optional, tag = "5")]
4678 pub target_address: ::core::option::Option<::prost::alloc::string::String>,
4679 #[prost(btree_map = "string, string", tag = "6")]
4681 pub data: ::prost::alloc::collections::BTreeMap<
4682 ::prost::alloc::string::String,
4683 ::prost::alloc::string::String,
4684 >,
4685}
4686pub mod name_service_client {
4688 #![allow(
4689 unused_variables,
4690 dead_code,
4691 missing_docs,
4692 clippy::wildcard_imports,
4693 clippy::let_unit_value,
4694 )]
4695 use tonic::codegen::*;
4696 use tonic::codegen::http::Uri;
4697 #[derive(Debug, Clone)]
4698 pub struct NameServiceClient<T> {
4699 inner: tonic::client::Grpc<T>,
4700 }
4701 impl NameServiceClient<tonic::transport::Channel> {
4702 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4704 where
4705 D: TryInto<tonic::transport::Endpoint>,
4706 D::Error: Into<StdError>,
4707 {
4708 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4709 Ok(Self::new(conn))
4710 }
4711 }
4712 impl<T> NameServiceClient<T>
4713 where
4714 T: tonic::client::GrpcService<tonic::body::Body>,
4715 T::Error: Into<StdError>,
4716 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4717 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4718 {
4719 pub fn new(inner: T) -> Self {
4720 let inner = tonic::client::Grpc::new(inner);
4721 Self { inner }
4722 }
4723 pub fn with_origin(inner: T, origin: Uri) -> Self {
4724 let inner = tonic::client::Grpc::with_origin(inner, origin);
4725 Self { inner }
4726 }
4727 pub fn with_interceptor<F>(
4728 inner: T,
4729 interceptor: F,
4730 ) -> NameServiceClient<InterceptedService<T, F>>
4731 where
4732 F: tonic::service::Interceptor,
4733 T::ResponseBody: Default,
4734 T: tonic::codegen::Service<
4735 http::Request<tonic::body::Body>,
4736 Response = http::Response<
4737 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4738 >,
4739 >,
4740 <T as tonic::codegen::Service<
4741 http::Request<tonic::body::Body>,
4742 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4743 {
4744 NameServiceClient::new(InterceptedService::new(inner, interceptor))
4745 }
4746 #[must_use]
4751 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4752 self.inner = self.inner.send_compressed(encoding);
4753 self
4754 }
4755 #[must_use]
4757 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4758 self.inner = self.inner.accept_compressed(encoding);
4759 self
4760 }
4761 #[must_use]
4765 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4766 self.inner = self.inner.max_decoding_message_size(limit);
4767 self
4768 }
4769 #[must_use]
4773 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4774 self.inner = self.inner.max_encoding_message_size(limit);
4775 self
4776 }
4777 pub async fn lookup_name(
4778 &mut self,
4779 request: impl tonic::IntoRequest<super::LookupNameRequest>,
4780 ) -> std::result::Result<
4781 tonic::Response<super::LookupNameResponse>,
4782 tonic::Status,
4783 > {
4784 self.inner
4785 .ready()
4786 .await
4787 .map_err(|e| {
4788 tonic::Status::unknown(
4789 format!("Service was not ready: {}", e.into()),
4790 )
4791 })?;
4792 let codec = tonic_prost::ProstCodec::default();
4793 let path = http::uri::PathAndQuery::from_static(
4794 "/sui.rpc.v2.NameService/LookupName",
4795 );
4796 let mut req = request.into_request();
4797 req.extensions_mut()
4798 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
4799 self.inner.unary(req, path, codec).await
4800 }
4801 pub async fn reverse_lookup_name(
4802 &mut self,
4803 request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
4804 ) -> std::result::Result<
4805 tonic::Response<super::ReverseLookupNameResponse>,
4806 tonic::Status,
4807 > {
4808 self.inner
4809 .ready()
4810 .await
4811 .map_err(|e| {
4812 tonic::Status::unknown(
4813 format!("Service was not ready: {}", e.into()),
4814 )
4815 })?;
4816 let codec = tonic_prost::ProstCodec::default();
4817 let path = http::uri::PathAndQuery::from_static(
4818 "/sui.rpc.v2.NameService/ReverseLookupName",
4819 );
4820 let mut req = request.into_request();
4821 req.extensions_mut()
4822 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
4823 self.inner.unary(req, path, codec).await
4824 }
4825 }
4826}
4827pub mod name_service_server {
4829 #![allow(
4830 unused_variables,
4831 dead_code,
4832 missing_docs,
4833 clippy::wildcard_imports,
4834 clippy::let_unit_value,
4835 )]
4836 use tonic::codegen::*;
4837 #[async_trait]
4839 pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
4840 async fn lookup_name(
4841 &self,
4842 request: tonic::Request<super::LookupNameRequest>,
4843 ) -> std::result::Result<
4844 tonic::Response<super::LookupNameResponse>,
4845 tonic::Status,
4846 > {
4847 Err(tonic::Status::unimplemented("Not yet implemented"))
4848 }
4849 async fn reverse_lookup_name(
4850 &self,
4851 request: tonic::Request<super::ReverseLookupNameRequest>,
4852 ) -> std::result::Result<
4853 tonic::Response<super::ReverseLookupNameResponse>,
4854 tonic::Status,
4855 > {
4856 Err(tonic::Status::unimplemented("Not yet implemented"))
4857 }
4858 }
4859 #[derive(Debug)]
4860 pub struct NameServiceServer<T> {
4861 inner: Arc<T>,
4862 accept_compression_encodings: EnabledCompressionEncodings,
4863 send_compression_encodings: EnabledCompressionEncodings,
4864 max_decoding_message_size: Option<usize>,
4865 max_encoding_message_size: Option<usize>,
4866 }
4867 impl<T> NameServiceServer<T> {
4868 pub fn new(inner: T) -> Self {
4869 Self::from_arc(Arc::new(inner))
4870 }
4871 pub fn from_arc(inner: Arc<T>) -> Self {
4872 Self {
4873 inner,
4874 accept_compression_encodings: Default::default(),
4875 send_compression_encodings: Default::default(),
4876 max_decoding_message_size: None,
4877 max_encoding_message_size: None,
4878 }
4879 }
4880 pub fn with_interceptor<F>(
4881 inner: T,
4882 interceptor: F,
4883 ) -> InterceptedService<Self, F>
4884 where
4885 F: tonic::service::Interceptor,
4886 {
4887 InterceptedService::new(Self::new(inner), interceptor)
4888 }
4889 #[must_use]
4891 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4892 self.accept_compression_encodings.enable(encoding);
4893 self
4894 }
4895 #[must_use]
4897 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4898 self.send_compression_encodings.enable(encoding);
4899 self
4900 }
4901 #[must_use]
4905 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4906 self.max_decoding_message_size = Some(limit);
4907 self
4908 }
4909 #[must_use]
4913 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4914 self.max_encoding_message_size = Some(limit);
4915 self
4916 }
4917 }
4918 impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
4919 where
4920 T: NameService,
4921 B: Body + std::marker::Send + 'static,
4922 B::Error: Into<StdError> + std::marker::Send + 'static,
4923 {
4924 type Response = http::Response<tonic::body::Body>;
4925 type Error = std::convert::Infallible;
4926 type Future = BoxFuture<Self::Response, Self::Error>;
4927 fn poll_ready(
4928 &mut self,
4929 _cx: &mut Context<'_>,
4930 ) -> Poll<std::result::Result<(), Self::Error>> {
4931 Poll::Ready(Ok(()))
4932 }
4933 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4934 match req.uri().path() {
4935 "/sui.rpc.v2.NameService/LookupName" => {
4936 #[allow(non_camel_case_types)]
4937 struct LookupNameSvc<T: NameService>(pub Arc<T>);
4938 impl<
4939 T: NameService,
4940 > tonic::server::UnaryService<super::LookupNameRequest>
4941 for LookupNameSvc<T> {
4942 type Response = super::LookupNameResponse;
4943 type Future = BoxFuture<
4944 tonic::Response<Self::Response>,
4945 tonic::Status,
4946 >;
4947 fn call(
4948 &mut self,
4949 request: tonic::Request<super::LookupNameRequest>,
4950 ) -> Self::Future {
4951 let inner = Arc::clone(&self.0);
4952 let fut = async move {
4953 <T as NameService>::lookup_name(&inner, request).await
4954 };
4955 Box::pin(fut)
4956 }
4957 }
4958 let accept_compression_encodings = self.accept_compression_encodings;
4959 let send_compression_encodings = self.send_compression_encodings;
4960 let max_decoding_message_size = self.max_decoding_message_size;
4961 let max_encoding_message_size = self.max_encoding_message_size;
4962 let inner = self.inner.clone();
4963 let fut = async move {
4964 let method = LookupNameSvc(inner);
4965 let codec = tonic_prost::ProstCodec::default();
4966 let mut grpc = tonic::server::Grpc::new(codec)
4967 .apply_compression_config(
4968 accept_compression_encodings,
4969 send_compression_encodings,
4970 )
4971 .apply_max_message_size_config(
4972 max_decoding_message_size,
4973 max_encoding_message_size,
4974 );
4975 let res = grpc.unary(method, req).await;
4976 Ok(res)
4977 };
4978 Box::pin(fut)
4979 }
4980 "/sui.rpc.v2.NameService/ReverseLookupName" => {
4981 #[allow(non_camel_case_types)]
4982 struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
4983 impl<
4984 T: NameService,
4985 > tonic::server::UnaryService<super::ReverseLookupNameRequest>
4986 for ReverseLookupNameSvc<T> {
4987 type Response = super::ReverseLookupNameResponse;
4988 type Future = BoxFuture<
4989 tonic::Response<Self::Response>,
4990 tonic::Status,
4991 >;
4992 fn call(
4993 &mut self,
4994 request: tonic::Request<super::ReverseLookupNameRequest>,
4995 ) -> Self::Future {
4996 let inner = Arc::clone(&self.0);
4997 let fut = async move {
4998 <T as NameService>::reverse_lookup_name(&inner, request)
4999 .await
5000 };
5001 Box::pin(fut)
5002 }
5003 }
5004 let accept_compression_encodings = self.accept_compression_encodings;
5005 let send_compression_encodings = self.send_compression_encodings;
5006 let max_decoding_message_size = self.max_decoding_message_size;
5007 let max_encoding_message_size = self.max_encoding_message_size;
5008 let inner = self.inner.clone();
5009 let fut = async move {
5010 let method = ReverseLookupNameSvc(inner);
5011 let codec = tonic_prost::ProstCodec::default();
5012 let mut grpc = tonic::server::Grpc::new(codec)
5013 .apply_compression_config(
5014 accept_compression_encodings,
5015 send_compression_encodings,
5016 )
5017 .apply_max_message_size_config(
5018 max_decoding_message_size,
5019 max_encoding_message_size,
5020 );
5021 let res = grpc.unary(method, req).await;
5022 Ok(res)
5023 };
5024 Box::pin(fut)
5025 }
5026 _ => {
5027 Box::pin(async move {
5028 let mut response = http::Response::new(
5029 tonic::body::Body::default(),
5030 );
5031 let headers = response.headers_mut();
5032 headers
5033 .insert(
5034 tonic::Status::GRPC_STATUS,
5035 (tonic::Code::Unimplemented as i32).into(),
5036 );
5037 headers
5038 .insert(
5039 http::header::CONTENT_TYPE,
5040 tonic::metadata::GRPC_CONTENT_TYPE,
5041 );
5042 Ok(response)
5043 })
5044 }
5045 }
5046 }
5047 }
5048 impl<T> Clone for NameServiceServer<T> {
5049 fn clone(&self) -> Self {
5050 let inner = self.inner.clone();
5051 Self {
5052 inner,
5053 accept_compression_encodings: self.accept_compression_encodings,
5054 send_compression_encodings: self.send_compression_encodings,
5055 max_decoding_message_size: self.max_decoding_message_size,
5056 max_encoding_message_size: self.max_encoding_message_size,
5057 }
5058 }
5059 }
5060 pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
5062 impl<T> tonic::server::NamedService for NameServiceServer<T> {
5063 const NAME: &'static str = SERVICE_NAME;
5064 }
5065}
5066#[non_exhaustive]
5068#[derive(Clone, PartialEq, ::prost::Message)]
5069pub struct Object {
5070 #[prost(message, optional, tag = "1")]
5072 pub bcs: ::core::option::Option<Bcs>,
5073 #[prost(string, optional, tag = "2")]
5075 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5076 #[prost(uint64, optional, tag = "3")]
5078 pub version: ::core::option::Option<u64>,
5079 #[prost(string, optional, tag = "4")]
5081 pub digest: ::core::option::Option<::prost::alloc::string::String>,
5082 #[prost(message, optional, tag = "5")]
5084 pub owner: ::core::option::Option<Owner>,
5085 #[prost(string, optional, tag = "6")]
5089 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5090 #[prost(bool, optional, tag = "7")]
5095 pub has_public_transfer: ::core::option::Option<bool>,
5096 #[prost(message, optional, tag = "8")]
5100 pub contents: ::core::option::Option<Bcs>,
5101 #[prost(message, optional, tag = "9")]
5103 pub package: ::core::option::Option<Package>,
5104 #[prost(string, optional, tag = "10")]
5106 pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
5107 #[prost(uint64, optional, tag = "11")]
5111 pub storage_rebate: ::core::option::Option<u64>,
5112 #[prost(message, optional, boxed, tag = "100")]
5114 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
5115 #[prost(uint64, optional, tag = "101")]
5117 pub balance: ::core::option::Option<u64>,
5118 #[prost(message, optional, boxed, tag = "102")]
5121 pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
5122}
5123#[non_exhaustive]
5125#[derive(Clone, PartialEq, ::prost::Message)]
5126pub struct ObjectSet {
5127 #[prost(message, repeated, tag = "1")]
5129 pub objects: ::prost::alloc::vec::Vec<Object>,
5130}
5131#[non_exhaustive]
5133#[derive(Clone, PartialEq, ::prost::Message)]
5134pub struct Display {
5135 #[prost(message, optional, tag = "1")]
5139 pub output: ::core::option::Option<::prost_types::Value>,
5140 #[prost(message, optional, tag = "2")]
5144 pub errors: ::core::option::Option<::prost_types::Value>,
5145}
5146#[non_exhaustive]
5148#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5149pub struct ObjectReference {
5150 #[prost(string, optional, tag = "1")]
5152 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5153 #[prost(uint64, optional, tag = "2")]
5155 pub version: ::core::option::Option<u64>,
5156 #[prost(string, optional, tag = "3")]
5158 pub digest: ::core::option::Option<::prost::alloc::string::String>,
5159}
5160#[non_exhaustive]
5162#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5163pub struct Owner {
5164 #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
5165 pub kind: ::core::option::Option<i32>,
5166 #[prost(string, optional, tag = "2")]
5168 pub address: ::core::option::Option<::prost::alloc::string::String>,
5169 #[prost(uint64, optional, tag = "3")]
5171 pub version: ::core::option::Option<u64>,
5172}
5173pub mod owner {
5175 #[non_exhaustive]
5176 #[derive(
5177 Clone,
5178 Copy,
5179 Debug,
5180 PartialEq,
5181 Eq,
5182 Hash,
5183 PartialOrd,
5184 Ord,
5185 ::prost::Enumeration
5186 )]
5187 #[repr(i32)]
5188 pub enum OwnerKind {
5189 Unknown = 0,
5190 Address = 1,
5191 Object = 2,
5192 Shared = 3,
5193 Immutable = 4,
5194 ConsensusAddress = 5,
5195 }
5196 impl OwnerKind {
5197 pub fn as_str_name(&self) -> &'static str {
5202 match self {
5203 Self::Unknown => "OWNER_KIND_UNKNOWN",
5204 Self::Address => "ADDRESS",
5205 Self::Object => "OBJECT",
5206 Self::Shared => "SHARED",
5207 Self::Immutable => "IMMUTABLE",
5208 Self::ConsensusAddress => "CONSENSUS_ADDRESS",
5209 }
5210 }
5211 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5213 match value {
5214 "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
5215 "ADDRESS" => Some(Self::Address),
5216 "OBJECT" => Some(Self::Object),
5217 "SHARED" => Some(Self::Shared),
5218 "IMMUTABLE" => Some(Self::Immutable),
5219 "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
5220 _ => None,
5221 }
5222 }
5223 }
5224}
5225#[non_exhaustive]
5226#[derive(Clone, PartialEq, ::prost::Message)]
5227pub struct ProtocolConfig {
5228 #[prost(uint64, optional, tag = "1")]
5229 pub protocol_version: ::core::option::Option<u64>,
5230 #[prost(btree_map = "string, bool", tag = "2")]
5232 pub feature_flags: ::prost::alloc::collections::BTreeMap<
5233 ::prost::alloc::string::String,
5234 bool,
5235 >,
5236 #[prost(btree_map = "string, string", tag = "3")]
5238 pub attributes: ::prost::alloc::collections::BTreeMap<
5239 ::prost::alloc::string::String,
5240 ::prost::alloc::string::String,
5241 >,
5242 #[prost(btree_map = "string, message", tag = "4")]
5243 pub configs: ::prost::alloc::collections::BTreeMap<
5244 ::prost::alloc::string::String,
5245 ::prost_types::Value,
5246 >,
5247}
5248#[non_exhaustive]
5268#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5269pub struct QueryOptions {
5270 #[prost(uint32, optional, tag = "1")]
5273 pub limit: ::core::option::Option<u32>,
5274 #[prost(bytes = "bytes", optional, tag = "2")]
5277 pub after: ::core::option::Option<::prost::bytes::Bytes>,
5278 #[prost(bytes = "bytes", optional, tag = "3")]
5281 pub before: ::core::option::Option<::prost::bytes::Bytes>,
5282 #[prost(enumeration = "Ordering", optional, tag = "4")]
5287 pub ordering: ::core::option::Option<i32>,
5288}
5289#[non_exhaustive]
5294#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5295pub struct Watermark {
5296 #[prost(bytes = "bytes", optional, tag = "1")]
5301 pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
5302 #[prost(uint64, optional, tag = "2")]
5315 pub checkpoint: ::core::option::Option<u64>,
5316}
5317#[non_exhaustive]
5328#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5329pub struct QueryEnd {
5330 #[prost(enumeration = "QueryEndReason", optional, tag = "1")]
5332 pub reason: ::core::option::Option<i32>,
5333}
5334#[non_exhaustive]
5336#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5337#[repr(i32)]
5338pub enum Ordering {
5339 Ascending = 0,
5341 Descending = 1,
5343}
5344impl Ordering {
5345 pub fn as_str_name(&self) -> &'static str {
5350 match self {
5351 Self::Ascending => "ORDERING_ASCENDING",
5352 Self::Descending => "ORDERING_DESCENDING",
5353 }
5354 }
5355 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5357 match value {
5358 "ORDERING_ASCENDING" => Some(Self::Ascending),
5359 "ORDERING_DESCENDING" => Some(Self::Descending),
5360 _ => None,
5361 }
5362 }
5363}
5364#[non_exhaustive]
5366#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5367#[repr(i32)]
5368pub enum QueryEndReason {
5369 Unknown = 0,
5371 ItemLimit = 1,
5375 ScanLimit = 2,
5380 CheckpointBound = 3,
5383 CursorBound = 4,
5387 LedgerTip = 5,
5390}
5391impl QueryEndReason {
5392 pub fn as_str_name(&self) -> &'static str {
5397 match self {
5398 Self::Unknown => "QUERY_END_REASON_UNKNOWN",
5399 Self::ItemLimit => "QUERY_END_REASON_ITEM_LIMIT",
5400 Self::ScanLimit => "QUERY_END_REASON_SCAN_LIMIT",
5401 Self::CheckpointBound => "QUERY_END_REASON_CHECKPOINT_BOUND",
5402 Self::CursorBound => "QUERY_END_REASON_CURSOR_BOUND",
5403 Self::LedgerTip => "QUERY_END_REASON_LEDGER_TIP",
5404 }
5405 }
5406 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5408 match value {
5409 "QUERY_END_REASON_UNKNOWN" => Some(Self::Unknown),
5410 "QUERY_END_REASON_ITEM_LIMIT" => Some(Self::ItemLimit),
5411 "QUERY_END_REASON_SCAN_LIMIT" => Some(Self::ScanLimit),
5412 "QUERY_END_REASON_CHECKPOINT_BOUND" => Some(Self::CheckpointBound),
5413 "QUERY_END_REASON_CURSOR_BOUND" => Some(Self::CursorBound),
5414 "QUERY_END_REASON_LEDGER_TIP" => Some(Self::LedgerTip),
5415 _ => None,
5416 }
5417 }
5418}
5419#[non_exhaustive]
5421#[derive(Clone, PartialEq, ::prost::Message)]
5422pub struct UserSignature {
5423 #[prost(message, optional, tag = "1")]
5428 pub bcs: ::core::option::Option<Bcs>,
5429 #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
5431 pub scheme: ::core::option::Option<i32>,
5432 #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
5433 pub signature: ::core::option::Option<user_signature::Signature>,
5434}
5435pub mod user_signature {
5437 #[non_exhaustive]
5438 #[derive(Clone, PartialEq, ::prost::Oneof)]
5439 pub enum Signature {
5440 #[prost(message, tag = "3")]
5442 Simple(super::SimpleSignature),
5443 #[prost(message, tag = "4")]
5445 Multisig(super::MultisigAggregatedSignature),
5446 #[prost(message, tag = "5")]
5448 Zklogin(super::ZkLoginAuthenticator),
5449 #[prost(message, tag = "6")]
5451 Passkey(super::PasskeyAuthenticator),
5452 }
5453}
5454#[non_exhaustive]
5456#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5457pub struct SimpleSignature {
5458 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5460 pub scheme: ::core::option::Option<i32>,
5461 #[prost(bytes = "bytes", optional, tag = "2")]
5463 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5464 #[prost(bytes = "bytes", optional, tag = "3")]
5466 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5467}
5468#[non_exhaustive]
5470#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5471pub struct ZkLoginPublicIdentifier {
5472 #[prost(string, optional, tag = "1")]
5473 pub iss: ::core::option::Option<::prost::alloc::string::String>,
5474 #[prost(string, optional, tag = "2")]
5476 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5477}
5478#[non_exhaustive]
5480#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5481pub struct MultisigMemberPublicKey {
5482 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5484 pub scheme: ::core::option::Option<i32>,
5485 #[prost(bytes = "bytes", optional, tag = "2")]
5487 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5488 #[prost(message, optional, tag = "3")]
5490 pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
5491}
5492#[non_exhaustive]
5494#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5495pub struct MultisigMember {
5496 #[prost(message, optional, tag = "1")]
5498 pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
5499 #[prost(uint32, optional, tag = "2")]
5501 pub weight: ::core::option::Option<u32>,
5502}
5503#[non_exhaustive]
5505#[derive(Clone, PartialEq, ::prost::Message)]
5506pub struct MultisigCommittee {
5507 #[prost(message, repeated, tag = "1")]
5509 pub members: ::prost::alloc::vec::Vec<MultisigMember>,
5510 #[prost(uint32, optional, tag = "2")]
5513 pub threshold: ::core::option::Option<u32>,
5514}
5515#[non_exhaustive]
5517#[derive(Clone, PartialEq, ::prost::Message)]
5518pub struct MultisigAggregatedSignature {
5519 #[prost(message, repeated, tag = "1")]
5523 pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
5524 #[prost(uint32, optional, tag = "2")]
5527 pub bitmap: ::core::option::Option<u32>,
5528 #[prost(bytes = "bytes", optional, tag = "3")]
5531 pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5532 #[prost(message, optional, tag = "4")]
5534 pub committee: ::core::option::Option<MultisigCommittee>,
5535}
5536#[non_exhaustive]
5538#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5539pub struct MultisigMemberSignature {
5540 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5542 pub scheme: ::core::option::Option<i32>,
5543 #[prost(bytes = "bytes", optional, tag = "2")]
5545 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5546 #[prost(message, optional, tag = "3")]
5548 pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
5549 #[prost(message, optional, tag = "4")]
5551 pub passkey: ::core::option::Option<PasskeyAuthenticator>,
5552}
5553#[non_exhaustive]
5555#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5556pub struct ZkLoginAuthenticator {
5557 #[prost(message, optional, tag = "1")]
5559 pub inputs: ::core::option::Option<ZkLoginInputs>,
5560 #[prost(uint64, optional, tag = "2")]
5562 pub max_epoch: ::core::option::Option<u64>,
5563 #[prost(message, optional, tag = "3")]
5565 pub signature: ::core::option::Option<SimpleSignature>,
5566 #[prost(message, optional, tag = "4")]
5568 pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
5569 #[prost(message, optional, tag = "5")]
5571 pub jwk_id: ::core::option::Option<JwkId>,
5572}
5573#[non_exhaustive]
5575#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5576pub struct ZkLoginInputs {
5577 #[prost(message, optional, tag = "1")]
5578 pub proof_points: ::core::option::Option<ZkLoginProof>,
5579 #[prost(message, optional, tag = "2")]
5580 pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
5581 #[prost(string, optional, tag = "3")]
5582 pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
5583 #[prost(string, optional, tag = "4")]
5585 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5586}
5587#[non_exhaustive]
5589#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5590pub struct ZkLoginProof {
5591 #[prost(message, optional, tag = "1")]
5592 pub a: ::core::option::Option<CircomG1>,
5593 #[prost(message, optional, tag = "2")]
5594 pub b: ::core::option::Option<CircomG2>,
5595 #[prost(message, optional, tag = "3")]
5596 pub c: ::core::option::Option<CircomG1>,
5597}
5598#[non_exhaustive]
5600#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5601pub struct ZkLoginClaim {
5602 #[prost(string, optional, tag = "1")]
5603 pub value: ::core::option::Option<::prost::alloc::string::String>,
5604 #[prost(uint32, optional, tag = "2")]
5605 pub index_mod_4: ::core::option::Option<u32>,
5606}
5607#[non_exhaustive]
5609#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5610pub struct CircomG1 {
5611 #[prost(string, optional, tag = "1")]
5613 pub e0: ::core::option::Option<::prost::alloc::string::String>,
5614 #[prost(string, optional, tag = "2")]
5616 pub e1: ::core::option::Option<::prost::alloc::string::String>,
5617 #[prost(string, optional, tag = "3")]
5619 pub e2: ::core::option::Option<::prost::alloc::string::String>,
5620}
5621#[non_exhaustive]
5623#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5624pub struct CircomG2 {
5625 #[prost(string, optional, tag = "1")]
5627 pub e00: ::core::option::Option<::prost::alloc::string::String>,
5628 #[prost(string, optional, tag = "2")]
5630 pub e01: ::core::option::Option<::prost::alloc::string::String>,
5631 #[prost(string, optional, tag = "3")]
5633 pub e10: ::core::option::Option<::prost::alloc::string::String>,
5634 #[prost(string, optional, tag = "4")]
5636 pub e11: ::core::option::Option<::prost::alloc::string::String>,
5637 #[prost(string, optional, tag = "5")]
5639 pub e20: ::core::option::Option<::prost::alloc::string::String>,
5640 #[prost(string, optional, tag = "6")]
5642 pub e21: ::core::option::Option<::prost::alloc::string::String>,
5643}
5644#[non_exhaustive]
5651#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5652pub struct PasskeyAuthenticator {
5653 #[prost(bytes = "bytes", optional, tag = "1")]
5658 pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
5659 #[prost(string, optional, tag = "2")]
5664 pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
5665 #[prost(message, optional, tag = "3")]
5667 pub signature: ::core::option::Option<SimpleSignature>,
5668}
5669#[non_exhaustive]
5671#[derive(Clone, PartialEq, ::prost::Message)]
5672pub struct ValidatorCommittee {
5673 #[prost(uint64, optional, tag = "1")]
5675 pub epoch: ::core::option::Option<u64>,
5676 #[prost(message, repeated, tag = "2")]
5678 pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
5679}
5680#[non_exhaustive]
5682#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5683pub struct ValidatorCommitteeMember {
5684 #[prost(bytes = "bytes", optional, tag = "1")]
5686 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5687 #[prost(uint64, optional, tag = "2")]
5689 pub weight: ::core::option::Option<u64>,
5690}
5691#[non_exhaustive]
5693#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5694pub struct ValidatorAggregatedSignature {
5695 #[prost(uint64, optional, tag = "1")]
5700 pub epoch: ::core::option::Option<u64>,
5701 #[prost(bytes = "bytes", optional, tag = "2")]
5703 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5704 #[prost(bytes = "bytes", optional, tag = "3")]
5707 pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5708}
5709#[non_exhaustive]
5716#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5717#[repr(i32)]
5718pub enum SignatureScheme {
5719 Ed25519 = 0,
5720 Secp256k1 = 1,
5721 Secp256r1 = 2,
5722 Multisig = 3,
5723 Bls12381 = 4,
5724 Zklogin = 5,
5725 Passkey = 6,
5726}
5727impl SignatureScheme {
5728 pub fn as_str_name(&self) -> &'static str {
5733 match self {
5734 Self::Ed25519 => "ED25519",
5735 Self::Secp256k1 => "SECP256K1",
5736 Self::Secp256r1 => "SECP256R1",
5737 Self::Multisig => "MULTISIG",
5738 Self::Bls12381 => "BLS12381",
5739 Self::Zklogin => "ZKLOGIN",
5740 Self::Passkey => "PASSKEY",
5741 }
5742 }
5743 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5745 match value {
5746 "ED25519" => Some(Self::Ed25519),
5747 "SECP256K1" => Some(Self::Secp256k1),
5748 "SECP256R1" => Some(Self::Secp256r1),
5749 "MULTISIG" => Some(Self::Multisig),
5750 "BLS12381" => Some(Self::Bls12381),
5751 "ZKLOGIN" => Some(Self::Zklogin),
5752 "PASSKEY" => Some(Self::Passkey),
5753 _ => None,
5754 }
5755 }
5756}
5757#[non_exhaustive]
5758#[derive(Clone, PartialEq, ::prost::Message)]
5759pub struct VerifySignatureRequest {
5760 #[prost(message, optional, tag = "1")]
5766 pub message: ::core::option::Option<Bcs>,
5767 #[prost(message, optional, tag = "2")]
5769 pub signature: ::core::option::Option<UserSignature>,
5770 #[prost(string, optional, tag = "3")]
5776 pub address: ::core::option::Option<::prost::alloc::string::String>,
5777 #[prost(message, repeated, tag = "4")]
5780 pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
5781}
5782#[non_exhaustive]
5783#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5784pub struct VerifySignatureResponse {
5785 #[prost(bool, optional, tag = "1")]
5787 pub is_valid: ::core::option::Option<bool>,
5788 #[prost(string, optional, tag = "2")]
5790 pub reason: ::core::option::Option<::prost::alloc::string::String>,
5791}
5792pub mod signature_verification_service_client {
5794 #![allow(
5795 unused_variables,
5796 dead_code,
5797 missing_docs,
5798 clippy::wildcard_imports,
5799 clippy::let_unit_value,
5800 )]
5801 use tonic::codegen::*;
5802 use tonic::codegen::http::Uri;
5803 #[derive(Debug, Clone)]
5804 pub struct SignatureVerificationServiceClient<T> {
5805 inner: tonic::client::Grpc<T>,
5806 }
5807 impl SignatureVerificationServiceClient<tonic::transport::Channel> {
5808 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5810 where
5811 D: TryInto<tonic::transport::Endpoint>,
5812 D::Error: Into<StdError>,
5813 {
5814 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5815 Ok(Self::new(conn))
5816 }
5817 }
5818 impl<T> SignatureVerificationServiceClient<T>
5819 where
5820 T: tonic::client::GrpcService<tonic::body::Body>,
5821 T::Error: Into<StdError>,
5822 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5823 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5824 {
5825 pub fn new(inner: T) -> Self {
5826 let inner = tonic::client::Grpc::new(inner);
5827 Self { inner }
5828 }
5829 pub fn with_origin(inner: T, origin: Uri) -> Self {
5830 let inner = tonic::client::Grpc::with_origin(inner, origin);
5831 Self { inner }
5832 }
5833 pub fn with_interceptor<F>(
5834 inner: T,
5835 interceptor: F,
5836 ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
5837 where
5838 F: tonic::service::Interceptor,
5839 T::ResponseBody: Default,
5840 T: tonic::codegen::Service<
5841 http::Request<tonic::body::Body>,
5842 Response = http::Response<
5843 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5844 >,
5845 >,
5846 <T as tonic::codegen::Service<
5847 http::Request<tonic::body::Body>,
5848 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5849 {
5850 SignatureVerificationServiceClient::new(
5851 InterceptedService::new(inner, interceptor),
5852 )
5853 }
5854 #[must_use]
5859 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5860 self.inner = self.inner.send_compressed(encoding);
5861 self
5862 }
5863 #[must_use]
5865 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5866 self.inner = self.inner.accept_compressed(encoding);
5867 self
5868 }
5869 #[must_use]
5873 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5874 self.inner = self.inner.max_decoding_message_size(limit);
5875 self
5876 }
5877 #[must_use]
5881 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5882 self.inner = self.inner.max_encoding_message_size(limit);
5883 self
5884 }
5885 pub async fn verify_signature(
5887 &mut self,
5888 request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
5889 ) -> std::result::Result<
5890 tonic::Response<super::VerifySignatureResponse>,
5891 tonic::Status,
5892 > {
5893 self.inner
5894 .ready()
5895 .await
5896 .map_err(|e| {
5897 tonic::Status::unknown(
5898 format!("Service was not ready: {}", e.into()),
5899 )
5900 })?;
5901 let codec = tonic_prost::ProstCodec::default();
5902 let path = http::uri::PathAndQuery::from_static(
5903 "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
5904 );
5905 let mut req = request.into_request();
5906 req.extensions_mut()
5907 .insert(
5908 GrpcMethod::new(
5909 "sui.rpc.v2.SignatureVerificationService",
5910 "VerifySignature",
5911 ),
5912 );
5913 self.inner.unary(req, path, codec).await
5914 }
5915 }
5916}
5917pub mod signature_verification_service_server {
5919 #![allow(
5920 unused_variables,
5921 dead_code,
5922 missing_docs,
5923 clippy::wildcard_imports,
5924 clippy::let_unit_value,
5925 )]
5926 use tonic::codegen::*;
5927 #[async_trait]
5929 pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
5930 async fn verify_signature(
5932 &self,
5933 request: tonic::Request<super::VerifySignatureRequest>,
5934 ) -> std::result::Result<
5935 tonic::Response<super::VerifySignatureResponse>,
5936 tonic::Status,
5937 > {
5938 Err(tonic::Status::unimplemented("Not yet implemented"))
5939 }
5940 }
5941 #[derive(Debug)]
5942 pub struct SignatureVerificationServiceServer<T> {
5943 inner: Arc<T>,
5944 accept_compression_encodings: EnabledCompressionEncodings,
5945 send_compression_encodings: EnabledCompressionEncodings,
5946 max_decoding_message_size: Option<usize>,
5947 max_encoding_message_size: Option<usize>,
5948 }
5949 impl<T> SignatureVerificationServiceServer<T> {
5950 pub fn new(inner: T) -> Self {
5951 Self::from_arc(Arc::new(inner))
5952 }
5953 pub fn from_arc(inner: Arc<T>) -> Self {
5954 Self {
5955 inner,
5956 accept_compression_encodings: Default::default(),
5957 send_compression_encodings: Default::default(),
5958 max_decoding_message_size: None,
5959 max_encoding_message_size: None,
5960 }
5961 }
5962 pub fn with_interceptor<F>(
5963 inner: T,
5964 interceptor: F,
5965 ) -> InterceptedService<Self, F>
5966 where
5967 F: tonic::service::Interceptor,
5968 {
5969 InterceptedService::new(Self::new(inner), interceptor)
5970 }
5971 #[must_use]
5973 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5974 self.accept_compression_encodings.enable(encoding);
5975 self
5976 }
5977 #[must_use]
5979 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5980 self.send_compression_encodings.enable(encoding);
5981 self
5982 }
5983 #[must_use]
5987 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5988 self.max_decoding_message_size = Some(limit);
5989 self
5990 }
5991 #[must_use]
5995 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5996 self.max_encoding_message_size = Some(limit);
5997 self
5998 }
5999 }
6000 impl<T, B> tonic::codegen::Service<http::Request<B>>
6001 for SignatureVerificationServiceServer<T>
6002 where
6003 T: SignatureVerificationService,
6004 B: Body + std::marker::Send + 'static,
6005 B::Error: Into<StdError> + std::marker::Send + 'static,
6006 {
6007 type Response = http::Response<tonic::body::Body>;
6008 type Error = std::convert::Infallible;
6009 type Future = BoxFuture<Self::Response, Self::Error>;
6010 fn poll_ready(
6011 &mut self,
6012 _cx: &mut Context<'_>,
6013 ) -> Poll<std::result::Result<(), Self::Error>> {
6014 Poll::Ready(Ok(()))
6015 }
6016 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6017 match req.uri().path() {
6018 "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
6019 #[allow(non_camel_case_types)]
6020 struct VerifySignatureSvc<T: SignatureVerificationService>(
6021 pub Arc<T>,
6022 );
6023 impl<
6024 T: SignatureVerificationService,
6025 > tonic::server::UnaryService<super::VerifySignatureRequest>
6026 for VerifySignatureSvc<T> {
6027 type Response = super::VerifySignatureResponse;
6028 type Future = BoxFuture<
6029 tonic::Response<Self::Response>,
6030 tonic::Status,
6031 >;
6032 fn call(
6033 &mut self,
6034 request: tonic::Request<super::VerifySignatureRequest>,
6035 ) -> Self::Future {
6036 let inner = Arc::clone(&self.0);
6037 let fut = async move {
6038 <T as SignatureVerificationService>::verify_signature(
6039 &inner,
6040 request,
6041 )
6042 .await
6043 };
6044 Box::pin(fut)
6045 }
6046 }
6047 let accept_compression_encodings = self.accept_compression_encodings;
6048 let send_compression_encodings = self.send_compression_encodings;
6049 let max_decoding_message_size = self.max_decoding_message_size;
6050 let max_encoding_message_size = self.max_encoding_message_size;
6051 let inner = self.inner.clone();
6052 let fut = async move {
6053 let method = VerifySignatureSvc(inner);
6054 let codec = tonic_prost::ProstCodec::default();
6055 let mut grpc = tonic::server::Grpc::new(codec)
6056 .apply_compression_config(
6057 accept_compression_encodings,
6058 send_compression_encodings,
6059 )
6060 .apply_max_message_size_config(
6061 max_decoding_message_size,
6062 max_encoding_message_size,
6063 );
6064 let res = grpc.unary(method, req).await;
6065 Ok(res)
6066 };
6067 Box::pin(fut)
6068 }
6069 _ => {
6070 Box::pin(async move {
6071 let mut response = http::Response::new(
6072 tonic::body::Body::default(),
6073 );
6074 let headers = response.headers_mut();
6075 headers
6076 .insert(
6077 tonic::Status::GRPC_STATUS,
6078 (tonic::Code::Unimplemented as i32).into(),
6079 );
6080 headers
6081 .insert(
6082 http::header::CONTENT_TYPE,
6083 tonic::metadata::GRPC_CONTENT_TYPE,
6084 );
6085 Ok(response)
6086 })
6087 }
6088 }
6089 }
6090 }
6091 impl<T> Clone for SignatureVerificationServiceServer<T> {
6092 fn clone(&self) -> Self {
6093 let inner = self.inner.clone();
6094 Self {
6095 inner,
6096 accept_compression_encodings: self.accept_compression_encodings,
6097 send_compression_encodings: self.send_compression_encodings,
6098 max_decoding_message_size: self.max_decoding_message_size,
6099 max_encoding_message_size: self.max_encoding_message_size,
6100 }
6101 }
6102 }
6103 pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
6105 impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
6106 const NAME: &'static str = SERVICE_NAME;
6107 }
6108}
6109#[non_exhaustive]
6111#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6112pub struct GetCoinInfoRequest {
6113 #[prost(string, optional, tag = "1")]
6115 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6116}
6117#[non_exhaustive]
6119#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6120pub struct GetCoinInfoResponse {
6121 #[prost(string, optional, tag = "1")]
6123 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6124 #[prost(message, optional, tag = "2")]
6127 pub metadata: ::core::option::Option<CoinMetadata>,
6128 #[prost(message, optional, tag = "3")]
6131 pub treasury: ::core::option::Option<CoinTreasury>,
6132 #[prost(message, optional, tag = "4")]
6140 pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
6141}
6142#[non_exhaustive]
6144#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6145pub struct CoinMetadata {
6146 #[prost(string, optional, tag = "1")]
6149 pub id: ::core::option::Option<::prost::alloc::string::String>,
6150 #[prost(uint32, optional, tag = "2")]
6152 pub decimals: ::core::option::Option<u32>,
6153 #[prost(string, optional, tag = "3")]
6155 pub name: ::core::option::Option<::prost::alloc::string::String>,
6156 #[prost(string, optional, tag = "4")]
6158 pub symbol: ::core::option::Option<::prost::alloc::string::String>,
6159 #[prost(string, optional, tag = "5")]
6161 pub description: ::core::option::Option<::prost::alloc::string::String>,
6162 #[prost(string, optional, tag = "6")]
6164 pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
6165 #[prost(string, optional, tag = "7")]
6169 pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6170 #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
6172 pub metadata_cap_state: ::core::option::Option<i32>,
6173}
6174pub mod coin_metadata {
6176 #[non_exhaustive]
6178 #[derive(
6179 Clone,
6180 Copy,
6181 Debug,
6182 PartialEq,
6183 Eq,
6184 Hash,
6185 PartialOrd,
6186 Ord,
6187 ::prost::Enumeration
6188 )]
6189 #[repr(i32)]
6190 pub enum MetadataCapState {
6191 Unknown = 0,
6194 Claimed = 1,
6196 Unclaimed = 2,
6198 Deleted = 3,
6200 }
6201 impl MetadataCapState {
6202 pub fn as_str_name(&self) -> &'static str {
6207 match self {
6208 Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
6209 Self::Claimed => "CLAIMED",
6210 Self::Unclaimed => "UNCLAIMED",
6211 Self::Deleted => "DELETED",
6212 }
6213 }
6214 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6216 match value {
6217 "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
6218 "CLAIMED" => Some(Self::Claimed),
6219 "UNCLAIMED" => Some(Self::Unclaimed),
6220 "DELETED" => Some(Self::Deleted),
6221 _ => None,
6222 }
6223 }
6224 }
6225}
6226#[non_exhaustive]
6228#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6229pub struct CoinTreasury {
6230 #[prost(string, optional, tag = "1")]
6232 pub id: ::core::option::Option<::prost::alloc::string::String>,
6233 #[prost(uint64, optional, tag = "2")]
6235 pub total_supply: ::core::option::Option<u64>,
6236 #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
6238 pub supply_state: ::core::option::Option<i32>,
6239}
6240pub mod coin_treasury {
6242 #[non_exhaustive]
6244 #[derive(
6245 Clone,
6246 Copy,
6247 Debug,
6248 PartialEq,
6249 Eq,
6250 Hash,
6251 PartialOrd,
6252 Ord,
6253 ::prost::Enumeration
6254 )]
6255 #[repr(i32)]
6256 pub enum SupplyState {
6257 Unknown = 0,
6259 Fixed = 1,
6261 BurnOnly = 2,
6263 }
6264 impl SupplyState {
6265 pub fn as_str_name(&self) -> &'static str {
6270 match self {
6271 Self::Unknown => "SUPPLY_STATE_UNKNOWN",
6272 Self::Fixed => "FIXED",
6273 Self::BurnOnly => "BURN_ONLY",
6274 }
6275 }
6276 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6278 match value {
6279 "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
6280 "FIXED" => Some(Self::Fixed),
6281 "BURN_ONLY" => Some(Self::BurnOnly),
6282 _ => None,
6283 }
6284 }
6285 }
6286}
6287#[non_exhaustive]
6289#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6290pub struct RegulatedCoinMetadata {
6291 #[prost(string, optional, tag = "1")]
6294 pub id: ::core::option::Option<::prost::alloc::string::String>,
6295 #[prost(string, optional, tag = "2")]
6297 pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
6298 #[prost(string, optional, tag = "3")]
6300 pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
6301 #[prost(bool, optional, tag = "4")]
6303 pub allow_global_pause: ::core::option::Option<bool>,
6304 #[prost(uint32, optional, tag = "5")]
6306 pub variant: ::core::option::Option<u32>,
6307 #[prost(
6309 enumeration = "regulated_coin_metadata::CoinRegulatedState",
6310 optional,
6311 tag = "6"
6312 )]
6313 pub coin_regulated_state: ::core::option::Option<i32>,
6314}
6315pub mod regulated_coin_metadata {
6317 #[non_exhaustive]
6319 #[derive(
6320 Clone,
6321 Copy,
6322 Debug,
6323 PartialEq,
6324 Eq,
6325 Hash,
6326 PartialOrd,
6327 Ord,
6328 ::prost::Enumeration
6329 )]
6330 #[repr(i32)]
6331 pub enum CoinRegulatedState {
6332 Unknown = 0,
6337 Regulated = 1,
6339 Unregulated = 2,
6341 }
6342 impl CoinRegulatedState {
6343 pub fn as_str_name(&self) -> &'static str {
6348 match self {
6349 Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
6350 Self::Regulated => "REGULATED",
6351 Self::Unregulated => "UNREGULATED",
6352 }
6353 }
6354 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6356 match value {
6357 "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
6358 "REGULATED" => Some(Self::Regulated),
6359 "UNREGULATED" => Some(Self::Unregulated),
6360 _ => None,
6361 }
6362 }
6363 }
6364}
6365#[non_exhaustive]
6367#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6368pub struct GetBalanceRequest {
6369 #[prost(string, optional, tag = "1")]
6371 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6372 #[prost(string, optional, tag = "2")]
6374 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6375}
6376#[non_exhaustive]
6379#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6380pub struct GetBalanceResponse {
6381 #[prost(message, optional, tag = "1")]
6383 pub balance: ::core::option::Option<Balance>,
6384}
6385#[non_exhaustive]
6387#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6388pub struct ListBalancesRequest {
6389 #[prost(string, optional, tag = "1")]
6391 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6392 #[prost(uint32, optional, tag = "2")]
6396 pub page_size: ::core::option::Option<u32>,
6397 #[prost(bytes = "bytes", optional, tag = "3")]
6403 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6404}
6405#[non_exhaustive]
6408#[derive(Clone, PartialEq, ::prost::Message)]
6409pub struct ListBalancesResponse {
6410 #[prost(message, repeated, tag = "1")]
6412 pub balances: ::prost::alloc::vec::Vec<Balance>,
6413 #[prost(bytes = "bytes", optional, tag = "2")]
6416 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6417}
6418#[non_exhaustive]
6420#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6421pub struct Balance {
6422 #[prost(string, optional, tag = "1")]
6424 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6425 #[prost(uint64, optional, tag = "3")]
6429 pub balance: ::core::option::Option<u64>,
6430 #[prost(uint64, optional, tag = "4")]
6432 pub address_balance: ::core::option::Option<u64>,
6433 #[prost(uint64, optional, tag = "5")]
6435 pub coin_balance: ::core::option::Option<u64>,
6436}
6437#[non_exhaustive]
6439#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6440pub struct ListDynamicFieldsRequest {
6441 #[prost(string, optional, tag = "1")]
6443 pub parent: ::core::option::Option<::prost::alloc::string::String>,
6444 #[prost(uint32, optional, tag = "2")]
6448 pub page_size: ::core::option::Option<u32>,
6449 #[prost(bytes = "bytes", optional, tag = "3")]
6455 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6456 #[prost(message, optional, tag = "4")]
6459 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6460}
6461#[non_exhaustive]
6463#[derive(Clone, PartialEq, ::prost::Message)]
6464pub struct ListDynamicFieldsResponse {
6465 #[prost(message, repeated, tag = "1")]
6467 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
6468 #[prost(bytes = "bytes", optional, tag = "2")]
6471 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6472}
6473#[non_exhaustive]
6474#[derive(Clone, PartialEq, ::prost::Message)]
6475pub struct DynamicField {
6476 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
6477 pub kind: ::core::option::Option<i32>,
6478 #[prost(string, optional, tag = "2")]
6480 pub parent: ::core::option::Option<::prost::alloc::string::String>,
6481 #[prost(string, optional, tag = "3")]
6483 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
6484 #[prost(message, optional, tag = "4")]
6486 pub field_object: ::core::option::Option<Object>,
6487 #[prost(message, optional, tag = "5")]
6489 pub name: ::core::option::Option<Bcs>,
6490 #[prost(message, optional, tag = "6")]
6492 pub value: ::core::option::Option<Bcs>,
6493 #[prost(string, optional, tag = "7")]
6499 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
6500 #[prost(string, optional, tag = "8")]
6506 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
6507 #[prost(message, optional, tag = "9")]
6509 pub child_object: ::core::option::Option<Object>,
6510}
6511pub mod dynamic_field {
6513 #[non_exhaustive]
6514 #[derive(
6515 Clone,
6516 Copy,
6517 Debug,
6518 PartialEq,
6519 Eq,
6520 Hash,
6521 PartialOrd,
6522 Ord,
6523 ::prost::Enumeration
6524 )]
6525 #[repr(i32)]
6526 pub enum DynamicFieldKind {
6527 Unknown = 0,
6528 Field = 1,
6529 Object = 2,
6530 }
6531 impl DynamicFieldKind {
6532 pub fn as_str_name(&self) -> &'static str {
6537 match self {
6538 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
6539 Self::Field => "FIELD",
6540 Self::Object => "OBJECT",
6541 }
6542 }
6543 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6545 match value {
6546 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
6547 "FIELD" => Some(Self::Field),
6548 "OBJECT" => Some(Self::Object),
6549 _ => None,
6550 }
6551 }
6552 }
6553}
6554#[non_exhaustive]
6555#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6556pub struct ListOwnedObjectsRequest {
6557 #[prost(string, optional, tag = "1")]
6559 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6560 #[prost(uint32, optional, tag = "2")]
6564 pub page_size: ::core::option::Option<u32>,
6565 #[prost(bytes = "bytes", optional, tag = "3")]
6571 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6572 #[prost(message, optional, tag = "4")]
6575 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6576 #[prost(string, optional, tag = "5")]
6585 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
6586}
6587#[non_exhaustive]
6588#[derive(Clone, PartialEq, ::prost::Message)]
6589pub struct ListOwnedObjectsResponse {
6590 #[prost(message, repeated, tag = "1")]
6592 pub objects: ::prost::alloc::vec::Vec<Object>,
6593 #[prost(bytes = "bytes", optional, tag = "2")]
6596 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6597}
6598pub mod state_service_client {
6600 #![allow(
6601 unused_variables,
6602 dead_code,
6603 missing_docs,
6604 clippy::wildcard_imports,
6605 clippy::let_unit_value,
6606 )]
6607 use tonic::codegen::*;
6608 use tonic::codegen::http::Uri;
6609 #[derive(Debug, Clone)]
6610 pub struct StateServiceClient<T> {
6611 inner: tonic::client::Grpc<T>,
6612 }
6613 impl StateServiceClient<tonic::transport::Channel> {
6614 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6616 where
6617 D: TryInto<tonic::transport::Endpoint>,
6618 D::Error: Into<StdError>,
6619 {
6620 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6621 Ok(Self::new(conn))
6622 }
6623 }
6624 impl<T> StateServiceClient<T>
6625 where
6626 T: tonic::client::GrpcService<tonic::body::Body>,
6627 T::Error: Into<StdError>,
6628 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6629 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6630 {
6631 pub fn new(inner: T) -> Self {
6632 let inner = tonic::client::Grpc::new(inner);
6633 Self { inner }
6634 }
6635 pub fn with_origin(inner: T, origin: Uri) -> Self {
6636 let inner = tonic::client::Grpc::with_origin(inner, origin);
6637 Self { inner }
6638 }
6639 pub fn with_interceptor<F>(
6640 inner: T,
6641 interceptor: F,
6642 ) -> StateServiceClient<InterceptedService<T, F>>
6643 where
6644 F: tonic::service::Interceptor,
6645 T::ResponseBody: Default,
6646 T: tonic::codegen::Service<
6647 http::Request<tonic::body::Body>,
6648 Response = http::Response<
6649 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6650 >,
6651 >,
6652 <T as tonic::codegen::Service<
6653 http::Request<tonic::body::Body>,
6654 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6655 {
6656 StateServiceClient::new(InterceptedService::new(inner, interceptor))
6657 }
6658 #[must_use]
6663 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6664 self.inner = self.inner.send_compressed(encoding);
6665 self
6666 }
6667 #[must_use]
6669 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6670 self.inner = self.inner.accept_compressed(encoding);
6671 self
6672 }
6673 #[must_use]
6677 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6678 self.inner = self.inner.max_decoding_message_size(limit);
6679 self
6680 }
6681 #[must_use]
6685 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6686 self.inner = self.inner.max_encoding_message_size(limit);
6687 self
6688 }
6689 pub async fn list_dynamic_fields(
6690 &mut self,
6691 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
6692 ) -> std::result::Result<
6693 tonic::Response<super::ListDynamicFieldsResponse>,
6694 tonic::Status,
6695 > {
6696 self.inner
6697 .ready()
6698 .await
6699 .map_err(|e| {
6700 tonic::Status::unknown(
6701 format!("Service was not ready: {}", e.into()),
6702 )
6703 })?;
6704 let codec = tonic_prost::ProstCodec::default();
6705 let path = http::uri::PathAndQuery::from_static(
6706 "/sui.rpc.v2.StateService/ListDynamicFields",
6707 );
6708 let mut req = request.into_request();
6709 req.extensions_mut()
6710 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
6711 self.inner.unary(req, path, codec).await
6712 }
6713 pub async fn list_owned_objects(
6714 &mut self,
6715 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
6716 ) -> std::result::Result<
6717 tonic::Response<super::ListOwnedObjectsResponse>,
6718 tonic::Status,
6719 > {
6720 self.inner
6721 .ready()
6722 .await
6723 .map_err(|e| {
6724 tonic::Status::unknown(
6725 format!("Service was not ready: {}", e.into()),
6726 )
6727 })?;
6728 let codec = tonic_prost::ProstCodec::default();
6729 let path = http::uri::PathAndQuery::from_static(
6730 "/sui.rpc.v2.StateService/ListOwnedObjects",
6731 );
6732 let mut req = request.into_request();
6733 req.extensions_mut()
6734 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
6735 self.inner.unary(req, path, codec).await
6736 }
6737 pub async fn get_coin_info(
6738 &mut self,
6739 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
6740 ) -> std::result::Result<
6741 tonic::Response<super::GetCoinInfoResponse>,
6742 tonic::Status,
6743 > {
6744 self.inner
6745 .ready()
6746 .await
6747 .map_err(|e| {
6748 tonic::Status::unknown(
6749 format!("Service was not ready: {}", e.into()),
6750 )
6751 })?;
6752 let codec = tonic_prost::ProstCodec::default();
6753 let path = http::uri::PathAndQuery::from_static(
6754 "/sui.rpc.v2.StateService/GetCoinInfo",
6755 );
6756 let mut req = request.into_request();
6757 req.extensions_mut()
6758 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
6759 self.inner.unary(req, path, codec).await
6760 }
6761 pub async fn get_balance(
6762 &mut self,
6763 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
6764 ) -> std::result::Result<
6765 tonic::Response<super::GetBalanceResponse>,
6766 tonic::Status,
6767 > {
6768 self.inner
6769 .ready()
6770 .await
6771 .map_err(|e| {
6772 tonic::Status::unknown(
6773 format!("Service was not ready: {}", e.into()),
6774 )
6775 })?;
6776 let codec = tonic_prost::ProstCodec::default();
6777 let path = http::uri::PathAndQuery::from_static(
6778 "/sui.rpc.v2.StateService/GetBalance",
6779 );
6780 let mut req = request.into_request();
6781 req.extensions_mut()
6782 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
6783 self.inner.unary(req, path, codec).await
6784 }
6785 pub async fn list_balances(
6786 &mut self,
6787 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
6788 ) -> std::result::Result<
6789 tonic::Response<super::ListBalancesResponse>,
6790 tonic::Status,
6791 > {
6792 self.inner
6793 .ready()
6794 .await
6795 .map_err(|e| {
6796 tonic::Status::unknown(
6797 format!("Service was not ready: {}", e.into()),
6798 )
6799 })?;
6800 let codec = tonic_prost::ProstCodec::default();
6801 let path = http::uri::PathAndQuery::from_static(
6802 "/sui.rpc.v2.StateService/ListBalances",
6803 );
6804 let mut req = request.into_request();
6805 req.extensions_mut()
6806 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
6807 self.inner.unary(req, path, codec).await
6808 }
6809 }
6810}
6811pub mod state_service_server {
6813 #![allow(
6814 unused_variables,
6815 dead_code,
6816 missing_docs,
6817 clippy::wildcard_imports,
6818 clippy::let_unit_value,
6819 )]
6820 use tonic::codegen::*;
6821 #[async_trait]
6823 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
6824 async fn list_dynamic_fields(
6825 &self,
6826 request: tonic::Request<super::ListDynamicFieldsRequest>,
6827 ) -> std::result::Result<
6828 tonic::Response<super::ListDynamicFieldsResponse>,
6829 tonic::Status,
6830 > {
6831 Err(tonic::Status::unimplemented("Not yet implemented"))
6832 }
6833 async fn list_owned_objects(
6834 &self,
6835 request: tonic::Request<super::ListOwnedObjectsRequest>,
6836 ) -> std::result::Result<
6837 tonic::Response<super::ListOwnedObjectsResponse>,
6838 tonic::Status,
6839 > {
6840 Err(tonic::Status::unimplemented("Not yet implemented"))
6841 }
6842 async fn get_coin_info(
6843 &self,
6844 request: tonic::Request<super::GetCoinInfoRequest>,
6845 ) -> std::result::Result<
6846 tonic::Response<super::GetCoinInfoResponse>,
6847 tonic::Status,
6848 > {
6849 Err(tonic::Status::unimplemented("Not yet implemented"))
6850 }
6851 async fn get_balance(
6852 &self,
6853 request: tonic::Request<super::GetBalanceRequest>,
6854 ) -> std::result::Result<
6855 tonic::Response<super::GetBalanceResponse>,
6856 tonic::Status,
6857 > {
6858 Err(tonic::Status::unimplemented("Not yet implemented"))
6859 }
6860 async fn list_balances(
6861 &self,
6862 request: tonic::Request<super::ListBalancesRequest>,
6863 ) -> std::result::Result<
6864 tonic::Response<super::ListBalancesResponse>,
6865 tonic::Status,
6866 > {
6867 Err(tonic::Status::unimplemented("Not yet implemented"))
6868 }
6869 }
6870 #[derive(Debug)]
6871 pub struct StateServiceServer<T> {
6872 inner: Arc<T>,
6873 accept_compression_encodings: EnabledCompressionEncodings,
6874 send_compression_encodings: EnabledCompressionEncodings,
6875 max_decoding_message_size: Option<usize>,
6876 max_encoding_message_size: Option<usize>,
6877 }
6878 impl<T> StateServiceServer<T> {
6879 pub fn new(inner: T) -> Self {
6880 Self::from_arc(Arc::new(inner))
6881 }
6882 pub fn from_arc(inner: Arc<T>) -> Self {
6883 Self {
6884 inner,
6885 accept_compression_encodings: Default::default(),
6886 send_compression_encodings: Default::default(),
6887 max_decoding_message_size: None,
6888 max_encoding_message_size: None,
6889 }
6890 }
6891 pub fn with_interceptor<F>(
6892 inner: T,
6893 interceptor: F,
6894 ) -> InterceptedService<Self, F>
6895 where
6896 F: tonic::service::Interceptor,
6897 {
6898 InterceptedService::new(Self::new(inner), interceptor)
6899 }
6900 #[must_use]
6902 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6903 self.accept_compression_encodings.enable(encoding);
6904 self
6905 }
6906 #[must_use]
6908 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6909 self.send_compression_encodings.enable(encoding);
6910 self
6911 }
6912 #[must_use]
6916 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6917 self.max_decoding_message_size = Some(limit);
6918 self
6919 }
6920 #[must_use]
6924 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6925 self.max_encoding_message_size = Some(limit);
6926 self
6927 }
6928 }
6929 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
6930 where
6931 T: StateService,
6932 B: Body + std::marker::Send + 'static,
6933 B::Error: Into<StdError> + std::marker::Send + 'static,
6934 {
6935 type Response = http::Response<tonic::body::Body>;
6936 type Error = std::convert::Infallible;
6937 type Future = BoxFuture<Self::Response, Self::Error>;
6938 fn poll_ready(
6939 &mut self,
6940 _cx: &mut Context<'_>,
6941 ) -> Poll<std::result::Result<(), Self::Error>> {
6942 Poll::Ready(Ok(()))
6943 }
6944 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6945 match req.uri().path() {
6946 "/sui.rpc.v2.StateService/ListDynamicFields" => {
6947 #[allow(non_camel_case_types)]
6948 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
6949 impl<
6950 T: StateService,
6951 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
6952 for ListDynamicFieldsSvc<T> {
6953 type Response = super::ListDynamicFieldsResponse;
6954 type Future = BoxFuture<
6955 tonic::Response<Self::Response>,
6956 tonic::Status,
6957 >;
6958 fn call(
6959 &mut self,
6960 request: tonic::Request<super::ListDynamicFieldsRequest>,
6961 ) -> Self::Future {
6962 let inner = Arc::clone(&self.0);
6963 let fut = async move {
6964 <T as StateService>::list_dynamic_fields(&inner, request)
6965 .await
6966 };
6967 Box::pin(fut)
6968 }
6969 }
6970 let accept_compression_encodings = self.accept_compression_encodings;
6971 let send_compression_encodings = self.send_compression_encodings;
6972 let max_decoding_message_size = self.max_decoding_message_size;
6973 let max_encoding_message_size = self.max_encoding_message_size;
6974 let inner = self.inner.clone();
6975 let fut = async move {
6976 let method = ListDynamicFieldsSvc(inner);
6977 let codec = tonic_prost::ProstCodec::default();
6978 let mut grpc = tonic::server::Grpc::new(codec)
6979 .apply_compression_config(
6980 accept_compression_encodings,
6981 send_compression_encodings,
6982 )
6983 .apply_max_message_size_config(
6984 max_decoding_message_size,
6985 max_encoding_message_size,
6986 );
6987 let res = grpc.unary(method, req).await;
6988 Ok(res)
6989 };
6990 Box::pin(fut)
6991 }
6992 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
6993 #[allow(non_camel_case_types)]
6994 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
6995 impl<
6996 T: StateService,
6997 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
6998 for ListOwnedObjectsSvc<T> {
6999 type Response = super::ListOwnedObjectsResponse;
7000 type Future = BoxFuture<
7001 tonic::Response<Self::Response>,
7002 tonic::Status,
7003 >;
7004 fn call(
7005 &mut self,
7006 request: tonic::Request<super::ListOwnedObjectsRequest>,
7007 ) -> Self::Future {
7008 let inner = Arc::clone(&self.0);
7009 let fut = async move {
7010 <T as StateService>::list_owned_objects(&inner, request)
7011 .await
7012 };
7013 Box::pin(fut)
7014 }
7015 }
7016 let accept_compression_encodings = self.accept_compression_encodings;
7017 let send_compression_encodings = self.send_compression_encodings;
7018 let max_decoding_message_size = self.max_decoding_message_size;
7019 let max_encoding_message_size = self.max_encoding_message_size;
7020 let inner = self.inner.clone();
7021 let fut = async move {
7022 let method = ListOwnedObjectsSvc(inner);
7023 let codec = tonic_prost::ProstCodec::default();
7024 let mut grpc = tonic::server::Grpc::new(codec)
7025 .apply_compression_config(
7026 accept_compression_encodings,
7027 send_compression_encodings,
7028 )
7029 .apply_max_message_size_config(
7030 max_decoding_message_size,
7031 max_encoding_message_size,
7032 );
7033 let res = grpc.unary(method, req).await;
7034 Ok(res)
7035 };
7036 Box::pin(fut)
7037 }
7038 "/sui.rpc.v2.StateService/GetCoinInfo" => {
7039 #[allow(non_camel_case_types)]
7040 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
7041 impl<
7042 T: StateService,
7043 > tonic::server::UnaryService<super::GetCoinInfoRequest>
7044 for GetCoinInfoSvc<T> {
7045 type Response = super::GetCoinInfoResponse;
7046 type Future = BoxFuture<
7047 tonic::Response<Self::Response>,
7048 tonic::Status,
7049 >;
7050 fn call(
7051 &mut self,
7052 request: tonic::Request<super::GetCoinInfoRequest>,
7053 ) -> Self::Future {
7054 let inner = Arc::clone(&self.0);
7055 let fut = async move {
7056 <T as StateService>::get_coin_info(&inner, request).await
7057 };
7058 Box::pin(fut)
7059 }
7060 }
7061 let accept_compression_encodings = self.accept_compression_encodings;
7062 let send_compression_encodings = self.send_compression_encodings;
7063 let max_decoding_message_size = self.max_decoding_message_size;
7064 let max_encoding_message_size = self.max_encoding_message_size;
7065 let inner = self.inner.clone();
7066 let fut = async move {
7067 let method = GetCoinInfoSvc(inner);
7068 let codec = tonic_prost::ProstCodec::default();
7069 let mut grpc = tonic::server::Grpc::new(codec)
7070 .apply_compression_config(
7071 accept_compression_encodings,
7072 send_compression_encodings,
7073 )
7074 .apply_max_message_size_config(
7075 max_decoding_message_size,
7076 max_encoding_message_size,
7077 );
7078 let res = grpc.unary(method, req).await;
7079 Ok(res)
7080 };
7081 Box::pin(fut)
7082 }
7083 "/sui.rpc.v2.StateService/GetBalance" => {
7084 #[allow(non_camel_case_types)]
7085 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
7086 impl<
7087 T: StateService,
7088 > tonic::server::UnaryService<super::GetBalanceRequest>
7089 for GetBalanceSvc<T> {
7090 type Response = super::GetBalanceResponse;
7091 type Future = BoxFuture<
7092 tonic::Response<Self::Response>,
7093 tonic::Status,
7094 >;
7095 fn call(
7096 &mut self,
7097 request: tonic::Request<super::GetBalanceRequest>,
7098 ) -> Self::Future {
7099 let inner = Arc::clone(&self.0);
7100 let fut = async move {
7101 <T as StateService>::get_balance(&inner, request).await
7102 };
7103 Box::pin(fut)
7104 }
7105 }
7106 let accept_compression_encodings = self.accept_compression_encodings;
7107 let send_compression_encodings = self.send_compression_encodings;
7108 let max_decoding_message_size = self.max_decoding_message_size;
7109 let max_encoding_message_size = self.max_encoding_message_size;
7110 let inner = self.inner.clone();
7111 let fut = async move {
7112 let method = GetBalanceSvc(inner);
7113 let codec = tonic_prost::ProstCodec::default();
7114 let mut grpc = tonic::server::Grpc::new(codec)
7115 .apply_compression_config(
7116 accept_compression_encodings,
7117 send_compression_encodings,
7118 )
7119 .apply_max_message_size_config(
7120 max_decoding_message_size,
7121 max_encoding_message_size,
7122 );
7123 let res = grpc.unary(method, req).await;
7124 Ok(res)
7125 };
7126 Box::pin(fut)
7127 }
7128 "/sui.rpc.v2.StateService/ListBalances" => {
7129 #[allow(non_camel_case_types)]
7130 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
7131 impl<
7132 T: StateService,
7133 > tonic::server::UnaryService<super::ListBalancesRequest>
7134 for ListBalancesSvc<T> {
7135 type Response = super::ListBalancesResponse;
7136 type Future = BoxFuture<
7137 tonic::Response<Self::Response>,
7138 tonic::Status,
7139 >;
7140 fn call(
7141 &mut self,
7142 request: tonic::Request<super::ListBalancesRequest>,
7143 ) -> Self::Future {
7144 let inner = Arc::clone(&self.0);
7145 let fut = async move {
7146 <T as StateService>::list_balances(&inner, request).await
7147 };
7148 Box::pin(fut)
7149 }
7150 }
7151 let accept_compression_encodings = self.accept_compression_encodings;
7152 let send_compression_encodings = self.send_compression_encodings;
7153 let max_decoding_message_size = self.max_decoding_message_size;
7154 let max_encoding_message_size = self.max_encoding_message_size;
7155 let inner = self.inner.clone();
7156 let fut = async move {
7157 let method = ListBalancesSvc(inner);
7158 let codec = tonic_prost::ProstCodec::default();
7159 let mut grpc = tonic::server::Grpc::new(codec)
7160 .apply_compression_config(
7161 accept_compression_encodings,
7162 send_compression_encodings,
7163 )
7164 .apply_max_message_size_config(
7165 max_decoding_message_size,
7166 max_encoding_message_size,
7167 );
7168 let res = grpc.unary(method, req).await;
7169 Ok(res)
7170 };
7171 Box::pin(fut)
7172 }
7173 _ => {
7174 Box::pin(async move {
7175 let mut response = http::Response::new(
7176 tonic::body::Body::default(),
7177 );
7178 let headers = response.headers_mut();
7179 headers
7180 .insert(
7181 tonic::Status::GRPC_STATUS,
7182 (tonic::Code::Unimplemented as i32).into(),
7183 );
7184 headers
7185 .insert(
7186 http::header::CONTENT_TYPE,
7187 tonic::metadata::GRPC_CONTENT_TYPE,
7188 );
7189 Ok(response)
7190 })
7191 }
7192 }
7193 }
7194 }
7195 impl<T> Clone for StateServiceServer<T> {
7196 fn clone(&self) -> Self {
7197 let inner = self.inner.clone();
7198 Self {
7199 inner,
7200 accept_compression_encodings: self.accept_compression_encodings,
7201 send_compression_encodings: self.send_compression_encodings,
7202 max_decoding_message_size: self.max_decoding_message_size,
7203 max_encoding_message_size: self.max_encoding_message_size,
7204 }
7205 }
7206 }
7207 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
7209 impl<T> tonic::server::NamedService for StateServiceServer<T> {
7210 const NAME: &'static str = SERVICE_NAME;
7211 }
7212}
7213#[derive(Eq, Hash)]
7215#[non_exhaustive]
7216#[derive(Clone, PartialEq, ::prost::Message)]
7217pub struct SubscribeCheckpointsRequest {
7218 #[prost(message, optional, tag = "1")]
7222 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7223 #[prost(message, optional, tag = "2")]
7227 pub filter: ::core::option::Option<TransactionFilter>,
7228}
7229#[non_exhaustive]
7237#[derive(Clone, PartialEq, ::prost::Message)]
7238pub struct SubscribeCheckpointsResponse {
7239 #[prost(uint64, optional, tag = "1")]
7244 pub cursor: ::core::option::Option<u64>,
7245 #[prost(message, optional, tag = "2")]
7248 pub checkpoint: ::core::option::Option<Checkpoint>,
7249}
7250#[non_exhaustive]
7252#[derive(Clone, PartialEq, ::prost::Message)]
7253pub struct SubscribeTransactionsRequest {
7254 #[prost(message, optional, tag = "1")]
7257 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7258 #[prost(message, optional, tag = "2")]
7261 pub filter: ::core::option::Option<TransactionFilter>,
7262}
7263#[non_exhaustive]
7268#[derive(Clone, PartialEq, ::prost::Message)]
7269pub struct SubscribeTransactionsResponse {
7270 #[prost(message, optional, tag = "1")]
7273 pub transaction: ::core::option::Option<ExecutedTransaction>,
7274 #[prost(message, optional, tag = "2")]
7276 pub watermark: ::core::option::Option<Watermark>,
7277}
7278#[non_exhaustive]
7280#[derive(Clone, PartialEq, ::prost::Message)]
7281pub struct SubscribeEventsRequest {
7282 #[prost(message, optional, tag = "1")]
7285 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7286 #[prost(message, optional, tag = "2")]
7289 pub filter: ::core::option::Option<EventFilter>,
7290}
7291#[non_exhaustive]
7296#[derive(Clone, PartialEq, ::prost::Message)]
7297pub struct SubscribeEventsResponse {
7298 #[prost(message, optional, tag = "1")]
7303 pub event: ::core::option::Option<Event>,
7304 #[prost(message, optional, tag = "2")]
7306 pub watermark: ::core::option::Option<Watermark>,
7307}
7308pub mod subscription_service_client {
7310 #![allow(
7311 unused_variables,
7312 dead_code,
7313 missing_docs,
7314 clippy::wildcard_imports,
7315 clippy::let_unit_value,
7316 )]
7317 use tonic::codegen::*;
7318 use tonic::codegen::http::Uri;
7319 #[derive(Debug, Clone)]
7347 pub struct SubscriptionServiceClient<T> {
7348 inner: tonic::client::Grpc<T>,
7349 }
7350 impl SubscriptionServiceClient<tonic::transport::Channel> {
7351 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7353 where
7354 D: TryInto<tonic::transport::Endpoint>,
7355 D::Error: Into<StdError>,
7356 {
7357 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7358 Ok(Self::new(conn))
7359 }
7360 }
7361 impl<T> SubscriptionServiceClient<T>
7362 where
7363 T: tonic::client::GrpcService<tonic::body::Body>,
7364 T::Error: Into<StdError>,
7365 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7366 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7367 {
7368 pub fn new(inner: T) -> Self {
7369 let inner = tonic::client::Grpc::new(inner);
7370 Self { inner }
7371 }
7372 pub fn with_origin(inner: T, origin: Uri) -> Self {
7373 let inner = tonic::client::Grpc::with_origin(inner, origin);
7374 Self { inner }
7375 }
7376 pub fn with_interceptor<F>(
7377 inner: T,
7378 interceptor: F,
7379 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
7380 where
7381 F: tonic::service::Interceptor,
7382 T::ResponseBody: Default,
7383 T: tonic::codegen::Service<
7384 http::Request<tonic::body::Body>,
7385 Response = http::Response<
7386 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7387 >,
7388 >,
7389 <T as tonic::codegen::Service<
7390 http::Request<tonic::body::Body>,
7391 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7392 {
7393 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
7394 }
7395 #[must_use]
7400 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7401 self.inner = self.inner.send_compressed(encoding);
7402 self
7403 }
7404 #[must_use]
7406 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7407 self.inner = self.inner.accept_compressed(encoding);
7408 self
7409 }
7410 #[must_use]
7414 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7415 self.inner = self.inner.max_decoding_message_size(limit);
7416 self
7417 }
7418 #[must_use]
7422 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7423 self.inner = self.inner.max_encoding_message_size(limit);
7424 self
7425 }
7426 pub async fn subscribe_checkpoints(
7433 &mut self,
7434 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
7435 ) -> std::result::Result<
7436 tonic::Response<
7437 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
7438 >,
7439 tonic::Status,
7440 > {
7441 self.inner
7442 .ready()
7443 .await
7444 .map_err(|e| {
7445 tonic::Status::unknown(
7446 format!("Service was not ready: {}", e.into()),
7447 )
7448 })?;
7449 let codec = tonic_prost::ProstCodec::default();
7450 let path = http::uri::PathAndQuery::from_static(
7451 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
7452 );
7453 let mut req = request.into_request();
7454 req.extensions_mut()
7455 .insert(
7456 GrpcMethod::new(
7457 "sui.rpc.v2.SubscriptionService",
7458 "SubscribeCheckpoints",
7459 ),
7460 );
7461 self.inner.server_streaming(req, path, codec).await
7462 }
7463 pub async fn subscribe_transactions(
7468 &mut self,
7469 request: impl tonic::IntoRequest<super::SubscribeTransactionsRequest>,
7470 ) -> std::result::Result<
7471 tonic::Response<
7472 tonic::codec::Streaming<super::SubscribeTransactionsResponse>,
7473 >,
7474 tonic::Status,
7475 > {
7476 self.inner
7477 .ready()
7478 .await
7479 .map_err(|e| {
7480 tonic::Status::unknown(
7481 format!("Service was not ready: {}", e.into()),
7482 )
7483 })?;
7484 let codec = tonic_prost::ProstCodec::default();
7485 let path = http::uri::PathAndQuery::from_static(
7486 "/sui.rpc.v2.SubscriptionService/SubscribeTransactions",
7487 );
7488 let mut req = request.into_request();
7489 req.extensions_mut()
7490 .insert(
7491 GrpcMethod::new(
7492 "sui.rpc.v2.SubscriptionService",
7493 "SubscribeTransactions",
7494 ),
7495 );
7496 self.inner.server_streaming(req, path, codec).await
7497 }
7498 pub async fn subscribe_events(
7503 &mut self,
7504 request: impl tonic::IntoRequest<super::SubscribeEventsRequest>,
7505 ) -> std::result::Result<
7506 tonic::Response<tonic::codec::Streaming<super::SubscribeEventsResponse>>,
7507 tonic::Status,
7508 > {
7509 self.inner
7510 .ready()
7511 .await
7512 .map_err(|e| {
7513 tonic::Status::unknown(
7514 format!("Service was not ready: {}", e.into()),
7515 )
7516 })?;
7517 let codec = tonic_prost::ProstCodec::default();
7518 let path = http::uri::PathAndQuery::from_static(
7519 "/sui.rpc.v2.SubscriptionService/SubscribeEvents",
7520 );
7521 let mut req = request.into_request();
7522 req.extensions_mut()
7523 .insert(
7524 GrpcMethod::new("sui.rpc.v2.SubscriptionService", "SubscribeEvents"),
7525 );
7526 self.inner.server_streaming(req, path, codec).await
7527 }
7528 }
7529}
7530pub mod subscription_service_server {
7532 #![allow(
7533 unused_variables,
7534 dead_code,
7535 missing_docs,
7536 clippy::wildcard_imports,
7537 clippy::let_unit_value,
7538 )]
7539 use tonic::codegen::*;
7540 #[async_trait]
7542 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
7543 async fn subscribe_checkpoints(
7550 &self,
7551 request: tonic::Request<super::SubscribeCheckpointsRequest>,
7552 ) -> std::result::Result<
7553 tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
7554 tonic::Status,
7555 > {
7556 Err(tonic::Status::unimplemented("Not yet implemented"))
7557 }
7558 async fn subscribe_transactions(
7563 &self,
7564 request: tonic::Request<super::SubscribeTransactionsRequest>,
7565 ) -> std::result::Result<
7566 tonic::Response<BoxStream<super::SubscribeTransactionsResponse>>,
7567 tonic::Status,
7568 > {
7569 Err(tonic::Status::unimplemented("Not yet implemented"))
7570 }
7571 async fn subscribe_events(
7576 &self,
7577 request: tonic::Request<super::SubscribeEventsRequest>,
7578 ) -> std::result::Result<
7579 tonic::Response<BoxStream<super::SubscribeEventsResponse>>,
7580 tonic::Status,
7581 > {
7582 Err(tonic::Status::unimplemented("Not yet implemented"))
7583 }
7584 }
7585 #[derive(Debug)]
7613 pub struct SubscriptionServiceServer<T> {
7614 inner: Arc<T>,
7615 accept_compression_encodings: EnabledCompressionEncodings,
7616 send_compression_encodings: EnabledCompressionEncodings,
7617 max_decoding_message_size: Option<usize>,
7618 max_encoding_message_size: Option<usize>,
7619 }
7620 impl<T> SubscriptionServiceServer<T> {
7621 pub fn new(inner: T) -> Self {
7622 Self::from_arc(Arc::new(inner))
7623 }
7624 pub fn from_arc(inner: Arc<T>) -> Self {
7625 Self {
7626 inner,
7627 accept_compression_encodings: Default::default(),
7628 send_compression_encodings: Default::default(),
7629 max_decoding_message_size: None,
7630 max_encoding_message_size: None,
7631 }
7632 }
7633 pub fn with_interceptor<F>(
7634 inner: T,
7635 interceptor: F,
7636 ) -> InterceptedService<Self, F>
7637 where
7638 F: tonic::service::Interceptor,
7639 {
7640 InterceptedService::new(Self::new(inner), interceptor)
7641 }
7642 #[must_use]
7644 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7645 self.accept_compression_encodings.enable(encoding);
7646 self
7647 }
7648 #[must_use]
7650 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7651 self.send_compression_encodings.enable(encoding);
7652 self
7653 }
7654 #[must_use]
7658 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7659 self.max_decoding_message_size = Some(limit);
7660 self
7661 }
7662 #[must_use]
7666 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7667 self.max_encoding_message_size = Some(limit);
7668 self
7669 }
7670 }
7671 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
7672 where
7673 T: SubscriptionService,
7674 B: Body + std::marker::Send + 'static,
7675 B::Error: Into<StdError> + std::marker::Send + 'static,
7676 {
7677 type Response = http::Response<tonic::body::Body>;
7678 type Error = std::convert::Infallible;
7679 type Future = BoxFuture<Self::Response, Self::Error>;
7680 fn poll_ready(
7681 &mut self,
7682 _cx: &mut Context<'_>,
7683 ) -> Poll<std::result::Result<(), Self::Error>> {
7684 Poll::Ready(Ok(()))
7685 }
7686 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7687 match req.uri().path() {
7688 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
7689 #[allow(non_camel_case_types)]
7690 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
7691 impl<
7692 T: SubscriptionService,
7693 > tonic::server::ServerStreamingService<
7694 super::SubscribeCheckpointsRequest,
7695 > for SubscribeCheckpointsSvc<T> {
7696 type Response = super::SubscribeCheckpointsResponse;
7697 type ResponseStream = BoxStream<
7698 super::SubscribeCheckpointsResponse,
7699 >;
7700 type Future = BoxFuture<
7701 tonic::Response<Self::ResponseStream>,
7702 tonic::Status,
7703 >;
7704 fn call(
7705 &mut self,
7706 request: tonic::Request<super::SubscribeCheckpointsRequest>,
7707 ) -> Self::Future {
7708 let inner = Arc::clone(&self.0);
7709 let fut = async move {
7710 <T as SubscriptionService>::subscribe_checkpoints(
7711 &inner,
7712 request,
7713 )
7714 .await
7715 };
7716 Box::pin(fut)
7717 }
7718 }
7719 let accept_compression_encodings = self.accept_compression_encodings;
7720 let send_compression_encodings = self.send_compression_encodings;
7721 let max_decoding_message_size = self.max_decoding_message_size;
7722 let max_encoding_message_size = self.max_encoding_message_size;
7723 let inner = self.inner.clone();
7724 let fut = async move {
7725 let method = SubscribeCheckpointsSvc(inner);
7726 let codec = tonic_prost::ProstCodec::default();
7727 let mut grpc = tonic::server::Grpc::new(codec)
7728 .apply_compression_config(
7729 accept_compression_encodings,
7730 send_compression_encodings,
7731 )
7732 .apply_max_message_size_config(
7733 max_decoding_message_size,
7734 max_encoding_message_size,
7735 );
7736 let res = grpc.server_streaming(method, req).await;
7737 Ok(res)
7738 };
7739 Box::pin(fut)
7740 }
7741 "/sui.rpc.v2.SubscriptionService/SubscribeTransactions" => {
7742 #[allow(non_camel_case_types)]
7743 struct SubscribeTransactionsSvc<T: SubscriptionService>(pub Arc<T>);
7744 impl<
7745 T: SubscriptionService,
7746 > tonic::server::ServerStreamingService<
7747 super::SubscribeTransactionsRequest,
7748 > for SubscribeTransactionsSvc<T> {
7749 type Response = super::SubscribeTransactionsResponse;
7750 type ResponseStream = BoxStream<
7751 super::SubscribeTransactionsResponse,
7752 >;
7753 type Future = BoxFuture<
7754 tonic::Response<Self::ResponseStream>,
7755 tonic::Status,
7756 >;
7757 fn call(
7758 &mut self,
7759 request: tonic::Request<super::SubscribeTransactionsRequest>,
7760 ) -> Self::Future {
7761 let inner = Arc::clone(&self.0);
7762 let fut = async move {
7763 <T as SubscriptionService>::subscribe_transactions(
7764 &inner,
7765 request,
7766 )
7767 .await
7768 };
7769 Box::pin(fut)
7770 }
7771 }
7772 let accept_compression_encodings = self.accept_compression_encodings;
7773 let send_compression_encodings = self.send_compression_encodings;
7774 let max_decoding_message_size = self.max_decoding_message_size;
7775 let max_encoding_message_size = self.max_encoding_message_size;
7776 let inner = self.inner.clone();
7777 let fut = async move {
7778 let method = SubscribeTransactionsSvc(inner);
7779 let codec = tonic_prost::ProstCodec::default();
7780 let mut grpc = tonic::server::Grpc::new(codec)
7781 .apply_compression_config(
7782 accept_compression_encodings,
7783 send_compression_encodings,
7784 )
7785 .apply_max_message_size_config(
7786 max_decoding_message_size,
7787 max_encoding_message_size,
7788 );
7789 let res = grpc.server_streaming(method, req).await;
7790 Ok(res)
7791 };
7792 Box::pin(fut)
7793 }
7794 "/sui.rpc.v2.SubscriptionService/SubscribeEvents" => {
7795 #[allow(non_camel_case_types)]
7796 struct SubscribeEventsSvc<T: SubscriptionService>(pub Arc<T>);
7797 impl<
7798 T: SubscriptionService,
7799 > tonic::server::ServerStreamingService<
7800 super::SubscribeEventsRequest,
7801 > for SubscribeEventsSvc<T> {
7802 type Response = super::SubscribeEventsResponse;
7803 type ResponseStream = BoxStream<super::SubscribeEventsResponse>;
7804 type Future = BoxFuture<
7805 tonic::Response<Self::ResponseStream>,
7806 tonic::Status,
7807 >;
7808 fn call(
7809 &mut self,
7810 request: tonic::Request<super::SubscribeEventsRequest>,
7811 ) -> Self::Future {
7812 let inner = Arc::clone(&self.0);
7813 let fut = async move {
7814 <T as SubscriptionService>::subscribe_events(
7815 &inner,
7816 request,
7817 )
7818 .await
7819 };
7820 Box::pin(fut)
7821 }
7822 }
7823 let accept_compression_encodings = self.accept_compression_encodings;
7824 let send_compression_encodings = self.send_compression_encodings;
7825 let max_decoding_message_size = self.max_decoding_message_size;
7826 let max_encoding_message_size = self.max_encoding_message_size;
7827 let inner = self.inner.clone();
7828 let fut = async move {
7829 let method = SubscribeEventsSvc(inner);
7830 let codec = tonic_prost::ProstCodec::default();
7831 let mut grpc = tonic::server::Grpc::new(codec)
7832 .apply_compression_config(
7833 accept_compression_encodings,
7834 send_compression_encodings,
7835 )
7836 .apply_max_message_size_config(
7837 max_decoding_message_size,
7838 max_encoding_message_size,
7839 );
7840 let res = grpc.server_streaming(method, req).await;
7841 Ok(res)
7842 };
7843 Box::pin(fut)
7844 }
7845 _ => {
7846 Box::pin(async move {
7847 let mut response = http::Response::new(
7848 tonic::body::Body::default(),
7849 );
7850 let headers = response.headers_mut();
7851 headers
7852 .insert(
7853 tonic::Status::GRPC_STATUS,
7854 (tonic::Code::Unimplemented as i32).into(),
7855 );
7856 headers
7857 .insert(
7858 http::header::CONTENT_TYPE,
7859 tonic::metadata::GRPC_CONTENT_TYPE,
7860 );
7861 Ok(response)
7862 })
7863 }
7864 }
7865 }
7866 }
7867 impl<T> Clone for SubscriptionServiceServer<T> {
7868 fn clone(&self) -> Self {
7869 let inner = self.inner.clone();
7870 Self {
7871 inner,
7872 accept_compression_encodings: self.accept_compression_encodings,
7873 send_compression_encodings: self.send_compression_encodings,
7874 max_decoding_message_size: self.max_decoding_message_size,
7875 max_encoding_message_size: self.max_encoding_message_size,
7876 }
7877 }
7878 }
7879 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
7881 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
7882 const NAME: &'static str = SERVICE_NAME;
7883 }
7884}
7885#[non_exhaustive]
7886#[derive(Clone, PartialEq, ::prost::Message)]
7887pub struct SystemState {
7888 #[prost(uint64, optional, tag = "1")]
7890 pub version: ::core::option::Option<u64>,
7891 #[prost(uint64, optional, tag = "2")]
7893 pub epoch: ::core::option::Option<u64>,
7894 #[prost(uint64, optional, tag = "3")]
7896 pub protocol_version: ::core::option::Option<u64>,
7897 #[prost(message, optional, tag = "4")]
7899 pub validators: ::core::option::Option<ValidatorSet>,
7900 #[prost(message, optional, tag = "5")]
7902 pub storage_fund: ::core::option::Option<StorageFund>,
7903 #[prost(message, optional, tag = "6")]
7905 pub parameters: ::core::option::Option<SystemParameters>,
7906 #[prost(uint64, optional, tag = "7")]
7908 pub reference_gas_price: ::core::option::Option<u64>,
7909 #[prost(message, repeated, tag = "8")]
7917 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
7918 #[prost(message, optional, tag = "9")]
7920 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
7921 #[prost(bool, optional, tag = "10")]
7928 pub safe_mode: ::core::option::Option<bool>,
7929 #[prost(uint64, optional, tag = "11")]
7931 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
7932 #[prost(uint64, optional, tag = "12")]
7934 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
7935 #[prost(uint64, optional, tag = "13")]
7937 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
7938 #[prost(uint64, optional, tag = "14")]
7940 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
7941 #[prost(uint64, optional, tag = "15")]
7943 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
7944 #[prost(message, optional, tag = "16")]
7946 pub extra_fields: ::core::option::Option<MoveTable>,
7947}
7948#[non_exhaustive]
7949#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7950pub struct ValidatorReportRecord {
7951 #[prost(string, optional, tag = "1")]
7953 pub reported: ::core::option::Option<::prost::alloc::string::String>,
7954 #[prost(string, repeated, tag = "2")]
7956 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7957}
7958#[non_exhaustive]
7959#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7960pub struct SystemParameters {
7961 #[prost(uint64, optional, tag = "1")]
7963 pub epoch_duration_ms: ::core::option::Option<u64>,
7964 #[prost(uint64, optional, tag = "2")]
7966 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
7967 #[prost(uint64, optional, tag = "3")]
7969 pub min_validator_count: ::core::option::Option<u64>,
7970 #[prost(uint64, optional, tag = "4")]
7973 pub max_validator_count: ::core::option::Option<u64>,
7974 #[prost(uint64, optional, tag = "5")]
7977 pub min_validator_joining_stake: ::core::option::Option<u64>,
7978 #[prost(uint64, optional, tag = "6")]
7983 pub validator_low_stake_threshold: ::core::option::Option<u64>,
7984 #[prost(uint64, optional, tag = "7")]
7988 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
7989 #[prost(uint64, optional, tag = "8")]
7992 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
7993 #[prost(message, optional, tag = "9")]
7995 pub extra_fields: ::core::option::Option<MoveTable>,
7996}
7997#[non_exhaustive]
7999#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8000pub struct MoveTable {
8001 #[prost(string, optional, tag = "1")]
8003 pub id: ::core::option::Option<::prost::alloc::string::String>,
8004 #[prost(uint64, optional, tag = "2")]
8006 pub size: ::core::option::Option<u64>,
8007}
8008#[non_exhaustive]
8009#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8010pub struct StakeSubsidy {
8011 #[prost(uint64, optional, tag = "1")]
8013 pub balance: ::core::option::Option<u64>,
8014 #[prost(uint64, optional, tag = "2")]
8016 pub distribution_counter: ::core::option::Option<u64>,
8017 #[prost(uint64, optional, tag = "3")]
8020 pub current_distribution_amount: ::core::option::Option<u64>,
8021 #[prost(uint64, optional, tag = "4")]
8023 pub stake_subsidy_period_length: ::core::option::Option<u64>,
8024 #[prost(uint32, optional, tag = "5")]
8027 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
8028 #[prost(message, optional, tag = "6")]
8030 pub extra_fields: ::core::option::Option<MoveTable>,
8031}
8032#[non_exhaustive]
8034#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8035pub struct StorageFund {
8036 #[prost(uint64, optional, tag = "1")]
8042 pub total_object_storage_rebates: ::core::option::Option<u64>,
8043 #[prost(uint64, optional, tag = "2")]
8046 pub non_refundable_balance: ::core::option::Option<u64>,
8047}
8048#[non_exhaustive]
8049#[derive(Clone, PartialEq, ::prost::Message)]
8050pub struct ValidatorSet {
8051 #[prost(uint64, optional, tag = "1")]
8054 pub total_stake: ::core::option::Option<u64>,
8055 #[prost(message, repeated, tag = "2")]
8057 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
8058 #[prost(message, optional, tag = "3")]
8063 pub pending_active_validators: ::core::option::Option<MoveTable>,
8064 #[prost(uint64, repeated, tag = "4")]
8067 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
8068 #[prost(message, optional, tag = "5")]
8072 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
8073 #[prost(message, optional, tag = "6")]
8079 pub inactive_validators: ::core::option::Option<MoveTable>,
8080 #[prost(message, optional, tag = "7")]
8088 pub validator_candidates: ::core::option::Option<MoveTable>,
8089 #[prost(btree_map = "string, uint64", tag = "8")]
8091 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
8092 ::prost::alloc::string::String,
8093 u64,
8094 >,
8095 #[prost(message, optional, tag = "9")]
8097 pub extra_fields: ::core::option::Option<MoveTable>,
8098}
8099#[non_exhaustive]
8103#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8104pub struct Validator {
8105 #[prost(string, optional, tag = "1")]
8107 pub name: ::core::option::Option<::prost::alloc::string::String>,
8108 #[prost(string, optional, tag = "2")]
8111 pub address: ::core::option::Option<::prost::alloc::string::String>,
8112 #[prost(string, optional, tag = "3")]
8113 pub description: ::core::option::Option<::prost::alloc::string::String>,
8114 #[prost(string, optional, tag = "4")]
8115 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
8116 #[prost(string, optional, tag = "5")]
8117 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
8118 #[prost(bytes = "bytes", optional, tag = "7")]
8121 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8122 #[prost(bytes = "bytes", optional, tag = "8")]
8124 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8125 #[prost(bytes = "bytes", optional, tag = "10")]
8128 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8129 #[prost(bytes = "bytes", optional, tag = "12")]
8131 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8132 #[prost(string, optional, tag = "13")]
8134 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
8135 #[prost(string, optional, tag = "14")]
8137 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8138 #[prost(string, optional, tag = "15")]
8140 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
8141 #[prost(string, optional, tag = "16")]
8143 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
8144 #[prost(bytes = "bytes", optional, tag = "18")]
8145 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8146 #[prost(bytes = "bytes", optional, tag = "19")]
8147 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8148 #[prost(bytes = "bytes", optional, tag = "21")]
8149 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8150 #[prost(bytes = "bytes", optional, tag = "23")]
8151 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8152 #[prost(string, optional, tag = "24")]
8153 pub next_epoch_network_address: ::core::option::Option<
8154 ::prost::alloc::string::String,
8155 >,
8156 #[prost(string, optional, tag = "25")]
8157 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8158 #[prost(string, optional, tag = "26")]
8159 pub next_epoch_primary_address: ::core::option::Option<
8160 ::prost::alloc::string::String,
8161 >,
8162 #[prost(string, optional, tag = "27")]
8163 pub next_epoch_worker_address: ::core::option::Option<
8164 ::prost::alloc::string::String,
8165 >,
8166 #[prost(message, optional, tag = "28")]
8168 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
8169 #[prost(uint64, optional, tag = "29")]
8172 pub voting_power: ::core::option::Option<u64>,
8173 #[prost(string, optional, tag = "30")]
8175 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
8176 #[prost(uint64, optional, tag = "31")]
8178 pub gas_price: ::core::option::Option<u64>,
8179 #[prost(message, optional, tag = "32")]
8181 pub staking_pool: ::core::option::Option<StakingPool>,
8182 #[prost(uint64, optional, tag = "33")]
8184 pub commission_rate: ::core::option::Option<u64>,
8185 #[prost(uint64, optional, tag = "34")]
8187 pub next_epoch_stake: ::core::option::Option<u64>,
8188 #[prost(uint64, optional, tag = "35")]
8190 pub next_epoch_gas_price: ::core::option::Option<u64>,
8191 #[prost(uint64, optional, tag = "36")]
8193 pub next_epoch_commission_rate: ::core::option::Option<u64>,
8194 #[prost(message, optional, tag = "37")]
8196 pub extra_fields: ::core::option::Option<MoveTable>,
8197}
8198#[non_exhaustive]
8200#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8201pub struct StakingPool {
8202 #[prost(string, optional, tag = "1")]
8204 pub id: ::core::option::Option<::prost::alloc::string::String>,
8205 #[prost(uint64, optional, tag = "2")]
8208 pub activation_epoch: ::core::option::Option<u64>,
8209 #[prost(uint64, optional, tag = "3")]
8212 pub deactivation_epoch: ::core::option::Option<u64>,
8213 #[prost(uint64, optional, tag = "4")]
8216 pub sui_balance: ::core::option::Option<u64>,
8217 #[prost(uint64, optional, tag = "5")]
8219 pub rewards_pool: ::core::option::Option<u64>,
8220 #[prost(uint64, optional, tag = "6")]
8222 pub pool_token_balance: ::core::option::Option<u64>,
8223 #[prost(message, optional, tag = "7")]
8230 pub exchange_rates: ::core::option::Option<MoveTable>,
8231 #[prost(uint64, optional, tag = "8")]
8233 pub pending_stake: ::core::option::Option<u64>,
8234 #[prost(uint64, optional, tag = "9")]
8237 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
8238 #[prost(uint64, optional, tag = "10")]
8240 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
8241 #[prost(message, optional, tag = "11")]
8243 pub extra_fields: ::core::option::Option<MoveTable>,
8244}
8245#[non_exhaustive]
8247#[derive(Clone, PartialEq, ::prost::Message)]
8248pub struct Transaction {
8249 #[prost(message, optional, tag = "1")]
8251 pub bcs: ::core::option::Option<Bcs>,
8252 #[prost(string, optional, tag = "2")]
8254 pub digest: ::core::option::Option<::prost::alloc::string::String>,
8255 #[prost(int32, optional, tag = "3")]
8257 pub version: ::core::option::Option<i32>,
8258 #[prost(message, optional, tag = "4")]
8259 pub kind: ::core::option::Option<TransactionKind>,
8260 #[prost(string, optional, tag = "5")]
8261 pub sender: ::core::option::Option<::prost::alloc::string::String>,
8262 #[prost(message, optional, tag = "6")]
8263 pub gas_payment: ::core::option::Option<GasPayment>,
8264 #[prost(message, optional, tag = "7")]
8265 pub expiration: ::core::option::Option<TransactionExpiration>,
8266}
8267#[non_exhaustive]
8269#[derive(Clone, PartialEq, ::prost::Message)]
8270pub struct GasPayment {
8271 #[prost(message, repeated, tag = "1")]
8273 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
8274 #[prost(string, optional, tag = "2")]
8276 pub owner: ::core::option::Option<::prost::alloc::string::String>,
8277 #[prost(uint64, optional, tag = "3")]
8281 pub price: ::core::option::Option<u64>,
8282 #[prost(uint64, optional, tag = "4")]
8284 pub budget: ::core::option::Option<u64>,
8285}
8286#[non_exhaustive]
8288#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8289pub struct TransactionExpiration {
8290 #[prost(
8291 enumeration = "transaction_expiration::TransactionExpirationKind",
8292 optional,
8293 tag = "1"
8294 )]
8295 pub kind: ::core::option::Option<i32>,
8296 #[prost(uint64, optional, tag = "2")]
8299 pub epoch: ::core::option::Option<u64>,
8300 #[prost(uint64, optional, tag = "3")]
8303 pub min_epoch: ::core::option::Option<u64>,
8304 #[prost(message, optional, tag = "4")]
8308 pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8309 #[prost(message, optional, tag = "5")]
8313 pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8314 #[prost(string, optional, tag = "6")]
8316 pub chain: ::core::option::Option<::prost::alloc::string::String>,
8317 #[prost(uint32, optional, tag = "7")]
8319 pub nonce: ::core::option::Option<u32>,
8320 #[prost(message, optional, tag = "8")]
8323 pub allowed_proposers: ::core::option::Option<AllowedProposers>,
8324}
8325pub mod transaction_expiration {
8327 #[non_exhaustive]
8328 #[derive(
8329 Clone,
8330 Copy,
8331 Debug,
8332 PartialEq,
8333 Eq,
8334 Hash,
8335 PartialOrd,
8336 Ord,
8337 ::prost::Enumeration
8338 )]
8339 #[repr(i32)]
8340 pub enum TransactionExpirationKind {
8341 Unknown = 0,
8342 None = 1,
8344 Epoch = 2,
8347 ValidDuring = 3,
8357 Validity = 4,
8360 }
8361 impl TransactionExpirationKind {
8362 pub fn as_str_name(&self) -> &'static str {
8367 match self {
8368 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
8369 Self::None => "NONE",
8370 Self::Epoch => "EPOCH",
8371 Self::ValidDuring => "VALID_DURING",
8372 Self::Validity => "VALIDITY",
8373 }
8374 }
8375 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8377 match value {
8378 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
8379 "NONE" => Some(Self::None),
8380 "EPOCH" => Some(Self::Epoch),
8381 "VALID_DURING" => Some(Self::ValidDuring),
8382 "VALIDITY" => Some(Self::Validity),
8383 _ => None,
8384 }
8385 }
8386 }
8387}
8388#[non_exhaustive]
8392#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8393pub struct AllowedProposers {
8394 #[prost(uint64, optional, tag = "1")]
8399 pub epoch: ::core::option::Option<u64>,
8400 #[prost(uint32, repeated, tag = "2")]
8405 pub proposers: ::prost::alloc::vec::Vec<u32>,
8406}
8407#[non_exhaustive]
8409#[derive(Clone, PartialEq, ::prost::Message)]
8410pub struct TransactionKind {
8411 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
8412 pub kind: ::core::option::Option<i32>,
8413 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
8414 pub data: ::core::option::Option<transaction_kind::Data>,
8415}
8416pub mod transaction_kind {
8418 #[non_exhaustive]
8419 #[derive(
8420 Clone,
8421 Copy,
8422 Debug,
8423 PartialEq,
8424 Eq,
8425 Hash,
8426 PartialOrd,
8427 Ord,
8428 ::prost::Enumeration
8429 )]
8430 #[repr(i32)]
8431 pub enum Kind {
8432 Unknown = 0,
8433 ProgrammableTransaction = 1,
8435 ChangeEpoch = 2,
8440 Genesis = 3,
8445 ConsensusCommitPrologueV1 = 4,
8447 AuthenticatorStateUpdate = 5,
8449 EndOfEpoch = 6,
8452 RandomnessStateUpdate = 7,
8454 ConsensusCommitPrologueV2 = 8,
8456 ConsensusCommitPrologueV3 = 9,
8458 ConsensusCommitPrologueV4 = 10,
8460 ProgrammableSystemTransaction = 11,
8462 }
8463 impl Kind {
8464 pub fn as_str_name(&self) -> &'static str {
8469 match self {
8470 Self::Unknown => "KIND_UNKNOWN",
8471 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
8472 Self::ChangeEpoch => "CHANGE_EPOCH",
8473 Self::Genesis => "GENESIS",
8474 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
8475 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
8476 Self::EndOfEpoch => "END_OF_EPOCH",
8477 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
8478 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
8479 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
8480 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
8481 Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
8482 }
8483 }
8484 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8486 match value {
8487 "KIND_UNKNOWN" => Some(Self::Unknown),
8488 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
8489 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8490 "GENESIS" => Some(Self::Genesis),
8491 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
8492 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
8493 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
8494 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
8495 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
8496 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
8497 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
8498 "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
8499 Some(Self::ProgrammableSystemTransaction)
8500 }
8501 _ => None,
8502 }
8503 }
8504 }
8505 #[non_exhaustive]
8506 #[derive(Clone, PartialEq, ::prost::Oneof)]
8507 pub enum Data {
8508 #[prost(message, tag = "2")]
8510 ProgrammableTransaction(super::ProgrammableTransaction),
8511 #[prost(message, tag = "3")]
8516 ChangeEpoch(super::ChangeEpoch),
8517 #[prost(message, tag = "4")]
8522 Genesis(super::GenesisTransaction),
8523 #[prost(message, tag = "5")]
8525 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
8526 #[prost(message, tag = "6")]
8528 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
8529 #[prost(message, tag = "7")]
8532 EndOfEpoch(super::EndOfEpochTransaction),
8533 #[prost(message, tag = "8")]
8535 RandomnessStateUpdate(super::RandomnessStateUpdate),
8536 }
8537}
8538#[non_exhaustive]
8543#[derive(Clone, PartialEq, ::prost::Message)]
8544pub struct ProgrammableTransaction {
8545 #[prost(message, repeated, tag = "1")]
8547 pub inputs: ::prost::alloc::vec::Vec<Input>,
8548 #[prost(message, repeated, tag = "2")]
8551 pub commands: ::prost::alloc::vec::Vec<Command>,
8552}
8553#[non_exhaustive]
8555#[derive(Clone, PartialEq, ::prost::Message)]
8556pub struct Command {
8557 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
8558 pub command: ::core::option::Option<command::Command>,
8559}
8560pub mod command {
8562 #[non_exhaustive]
8563 #[derive(Clone, PartialEq, ::prost::Oneof)]
8564 pub enum Command {
8565 #[prost(message, tag = "1")]
8567 MoveCall(super::MoveCall),
8568 #[prost(message, tag = "2")]
8573 TransferObjects(super::TransferObjects),
8574 #[prost(message, tag = "3")]
8577 SplitCoins(super::SplitCoins),
8578 #[prost(message, tag = "4")]
8581 MergeCoins(super::MergeCoins),
8582 #[prost(message, tag = "5")]
8585 Publish(super::Publish),
8586 #[prost(message, tag = "6")]
8590 MakeMoveVector(super::MakeMoveVector),
8591 #[prost(message, tag = "7")]
8600 Upgrade(super::Upgrade),
8601 }
8602}
8603#[non_exhaustive]
8608#[derive(Clone, PartialEq, ::prost::Message)]
8609pub struct MoveCall {
8610 #[prost(string, optional, tag = "1")]
8612 pub package: ::core::option::Option<::prost::alloc::string::String>,
8613 #[prost(string, optional, tag = "2")]
8615 pub module: ::core::option::Option<::prost::alloc::string::String>,
8616 #[prost(string, optional, tag = "3")]
8618 pub function: ::core::option::Option<::prost::alloc::string::String>,
8619 #[prost(string, repeated, tag = "4")]
8621 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8622 #[prost(message, repeated, tag = "5")]
8624 pub arguments: ::prost::alloc::vec::Vec<Argument>,
8625}
8626#[non_exhaustive]
8628#[derive(Clone, PartialEq, ::prost::Message)]
8629pub struct TransferObjects {
8630 #[prost(message, repeated, tag = "1")]
8632 pub objects: ::prost::alloc::vec::Vec<Argument>,
8633 #[prost(message, optional, tag = "2")]
8635 pub address: ::core::option::Option<Argument>,
8636}
8637#[non_exhaustive]
8639#[derive(Clone, PartialEq, ::prost::Message)]
8640pub struct SplitCoins {
8641 #[prost(message, optional, tag = "1")]
8643 pub coin: ::core::option::Option<Argument>,
8644 #[prost(message, repeated, tag = "2")]
8646 pub amounts: ::prost::alloc::vec::Vec<Argument>,
8647}
8648#[non_exhaustive]
8650#[derive(Clone, PartialEq, ::prost::Message)]
8651pub struct MergeCoins {
8652 #[prost(message, optional, tag = "1")]
8654 pub coin: ::core::option::Option<Argument>,
8655 #[prost(message, repeated, tag = "2")]
8659 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
8660}
8661#[non_exhaustive]
8663#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8664pub struct Publish {
8665 #[prost(bytes = "bytes", repeated, tag = "1")]
8667 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8668 #[prost(string, repeated, tag = "2")]
8670 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8671}
8672#[non_exhaustive]
8674#[derive(Clone, PartialEq, ::prost::Message)]
8675pub struct MakeMoveVector {
8676 #[prost(string, optional, tag = "1")]
8681 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
8682 #[prost(message, repeated, tag = "2")]
8684 pub elements: ::prost::alloc::vec::Vec<Argument>,
8685}
8686#[non_exhaustive]
8688#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8689pub struct Upgrade {
8690 #[prost(bytes = "bytes", repeated, tag = "1")]
8692 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8693 #[prost(string, repeated, tag = "2")]
8695 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8696 #[prost(string, optional, tag = "3")]
8698 pub package: ::core::option::Option<::prost::alloc::string::String>,
8699 #[prost(message, optional, tag = "4")]
8701 pub ticket: ::core::option::Option<Argument>,
8702}
8703#[non_exhaustive]
8705#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8706pub struct RandomnessStateUpdate {
8707 #[prost(uint64, optional, tag = "1")]
8709 pub epoch: ::core::option::Option<u64>,
8710 #[prost(uint64, optional, tag = "2")]
8712 pub randomness_round: ::core::option::Option<u64>,
8713 #[prost(bytes = "bytes", optional, tag = "3")]
8715 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
8716 #[prost(uint64, optional, tag = "4")]
8718 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
8719}
8720#[non_exhaustive]
8722#[derive(Clone, PartialEq, ::prost::Message)]
8723pub struct ChangeEpoch {
8724 #[prost(uint64, optional, tag = "1")]
8726 pub epoch: ::core::option::Option<u64>,
8727 #[prost(uint64, optional, tag = "2")]
8729 pub protocol_version: ::core::option::Option<u64>,
8730 #[prost(uint64, optional, tag = "3")]
8732 pub storage_charge: ::core::option::Option<u64>,
8733 #[prost(uint64, optional, tag = "4")]
8735 pub computation_charge: ::core::option::Option<u64>,
8736 #[prost(uint64, optional, tag = "5")]
8738 pub storage_rebate: ::core::option::Option<u64>,
8739 #[prost(uint64, optional, tag = "6")]
8741 pub non_refundable_storage_fee: ::core::option::Option<u64>,
8742 #[prost(message, optional, tag = "7")]
8744 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8745 #[prost(message, repeated, tag = "8")]
8751 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
8752}
8753#[non_exhaustive]
8755#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8756pub struct SystemPackage {
8757 #[prost(uint64, optional, tag = "1")]
8759 pub version: ::core::option::Option<u64>,
8760 #[prost(bytes = "bytes", repeated, tag = "2")]
8762 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8763 #[prost(string, repeated, tag = "3")]
8765 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8766}
8767#[non_exhaustive]
8769#[derive(Clone, PartialEq, ::prost::Message)]
8770pub struct GenesisTransaction {
8771 #[prost(message, repeated, tag = "1")]
8773 pub objects: ::prost::alloc::vec::Vec<Object>,
8774}
8775#[non_exhaustive]
8779#[derive(Clone, PartialEq, ::prost::Message)]
8780pub struct ConsensusCommitPrologue {
8781 #[prost(uint64, optional, tag = "1")]
8785 pub epoch: ::core::option::Option<u64>,
8786 #[prost(uint64, optional, tag = "2")]
8790 pub round: ::core::option::Option<u64>,
8791 #[prost(message, optional, tag = "3")]
8795 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8796 #[prost(string, optional, tag = "4")]
8800 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
8801 #[prost(uint64, optional, tag = "5")]
8806 pub sub_dag_index: ::core::option::Option<u64>,
8807 #[prost(message, optional, tag = "6")]
8811 pub consensus_determined_version_assignments: ::core::option::Option<
8812 ConsensusDeterminedVersionAssignments,
8813 >,
8814 #[prost(string, optional, tag = "7")]
8819 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
8820}
8821#[non_exhaustive]
8823#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8824pub struct VersionAssignment {
8825 #[prost(string, optional, tag = "1")]
8827 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
8828 #[prost(uint64, optional, tag = "2")]
8830 pub start_version: ::core::option::Option<u64>,
8831 #[prost(uint64, optional, tag = "3")]
8833 pub version: ::core::option::Option<u64>,
8834}
8835#[non_exhaustive]
8837#[derive(Clone, PartialEq, ::prost::Message)]
8838pub struct CanceledTransaction {
8839 #[prost(string, optional, tag = "1")]
8841 pub digest: ::core::option::Option<::prost::alloc::string::String>,
8842 #[prost(message, repeated, tag = "2")]
8844 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
8845}
8846#[non_exhaustive]
8848#[derive(Clone, PartialEq, ::prost::Message)]
8849pub struct ConsensusDeterminedVersionAssignments {
8850 #[prost(int32, optional, tag = "1")]
8852 pub version: ::core::option::Option<i32>,
8853 #[prost(message, repeated, tag = "3")]
8855 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
8856}
8857#[non_exhaustive]
8859#[derive(Clone, PartialEq, ::prost::Message)]
8860pub struct AuthenticatorStateUpdate {
8861 #[prost(uint64, optional, tag = "1")]
8863 pub epoch: ::core::option::Option<u64>,
8864 #[prost(uint64, optional, tag = "2")]
8866 pub round: ::core::option::Option<u64>,
8867 #[prost(message, repeated, tag = "3")]
8869 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
8870 #[prost(uint64, optional, tag = "4")]
8872 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
8873}
8874#[non_exhaustive]
8876#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8877pub struct ActiveJwk {
8878 #[prost(message, optional, tag = "1")]
8880 pub id: ::core::option::Option<JwkId>,
8881 #[prost(message, optional, tag = "2")]
8883 pub jwk: ::core::option::Option<Jwk>,
8884 #[prost(uint64, optional, tag = "3")]
8886 pub epoch: ::core::option::Option<u64>,
8887}
8888#[non_exhaustive]
8891#[derive(Clone, PartialEq, ::prost::Message)]
8892pub struct EndOfEpochTransaction {
8893 #[prost(message, repeated, tag = "1")]
8894 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
8895}
8896#[non_exhaustive]
8898#[derive(Clone, PartialEq, ::prost::Message)]
8899pub struct EndOfEpochTransactionKind {
8900 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
8901 pub kind: ::core::option::Option<i32>,
8902 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
8903 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
8904}
8905pub mod end_of_epoch_transaction_kind {
8907 #[non_exhaustive]
8908 #[derive(
8909 Clone,
8910 Copy,
8911 Debug,
8912 PartialEq,
8913 Eq,
8914 Hash,
8915 PartialOrd,
8916 Ord,
8917 ::prost::Enumeration
8918 )]
8919 #[repr(i32)]
8920 pub enum Kind {
8921 Unknown = 0,
8922 ChangeEpoch = 1,
8924 AuthenticatorStateCreate = 2,
8926 AuthenticatorStateExpire = 3,
8928 RandomnessStateCreate = 4,
8930 DenyListStateCreate = 5,
8932 BridgeStateCreate = 6,
8934 BridgeCommitteeInit = 7,
8936 StoreExecutionTimeObservations = 8,
8938 AccumulatorRootCreate = 9,
8940 CoinRegistryCreate = 10,
8942 DisplayRegistryCreate = 11,
8944 AddressAliasStateCreate = 12,
8946 WriteAccumulatorStorageCost = 13,
8948 ForwardingAddressRegistryCreate = 14,
8950 }
8951 impl Kind {
8952 pub fn as_str_name(&self) -> &'static str {
8957 match self {
8958 Self::Unknown => "KIND_UNKNOWN",
8959 Self::ChangeEpoch => "CHANGE_EPOCH",
8960 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
8961 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
8962 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
8963 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
8964 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
8965 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
8966 Self::StoreExecutionTimeObservations => {
8967 "STORE_EXECUTION_TIME_OBSERVATIONS"
8968 }
8969 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
8970 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
8971 Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
8972 Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
8973 Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
8974 Self::ForwardingAddressRegistryCreate => {
8975 "FORWARDING_ADDRESS_REGISTRY_CREATE"
8976 }
8977 }
8978 }
8979 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8981 match value {
8982 "KIND_UNKNOWN" => Some(Self::Unknown),
8983 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8984 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
8985 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
8986 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
8987 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
8988 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
8989 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
8990 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
8991 Some(Self::StoreExecutionTimeObservations)
8992 }
8993 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
8994 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
8995 "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
8996 "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
8997 "WRITE_ACCUMULATOR_STORAGE_COST" => {
8998 Some(Self::WriteAccumulatorStorageCost)
8999 }
9000 "FORWARDING_ADDRESS_REGISTRY_CREATE" => {
9001 Some(Self::ForwardingAddressRegistryCreate)
9002 }
9003 _ => None,
9004 }
9005 }
9006 }
9007 #[non_exhaustive]
9008 #[derive(Clone, PartialEq, ::prost::Oneof)]
9009 pub enum Data {
9010 #[prost(message, tag = "2")]
9012 ChangeEpoch(super::ChangeEpoch),
9013 #[prost(message, tag = "3")]
9015 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
9016 #[prost(message, tag = "4")]
9018 ExecutionTimeObservations(super::ExecutionTimeObservations),
9019 #[prost(string, tag = "5")]
9021 BridgeChainId(::prost::alloc::string::String),
9022 #[prost(uint64, tag = "6")]
9024 BridgeObjectVersion(u64),
9025 #[prost(uint64, tag = "7")]
9027 StorageCost(u64),
9028 }
9029}
9030#[non_exhaustive]
9032#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
9033pub struct AuthenticatorStateExpire {
9034 #[prost(uint64, optional, tag = "1")]
9036 pub min_epoch: ::core::option::Option<u64>,
9037 #[prost(uint64, optional, tag = "2")]
9039 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
9040}
9041#[non_exhaustive]
9042#[derive(Clone, PartialEq, ::prost::Message)]
9043pub struct ExecutionTimeObservations {
9044 #[prost(int32, optional, tag = "1")]
9046 pub version: ::core::option::Option<i32>,
9047 #[prost(message, repeated, tag = "2")]
9048 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
9049}
9050#[non_exhaustive]
9051#[derive(Clone, PartialEq, ::prost::Message)]
9052pub struct ExecutionTimeObservation {
9053 #[prost(
9054 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
9055 optional,
9056 tag = "1"
9057 )]
9058 pub kind: ::core::option::Option<i32>,
9059 #[prost(message, optional, tag = "2")]
9060 pub move_entry_point: ::core::option::Option<MoveCall>,
9061 #[prost(message, repeated, tag = "3")]
9062 pub validator_observations: ::prost::alloc::vec::Vec<
9063 ValidatorExecutionTimeObservation,
9064 >,
9065}
9066pub mod execution_time_observation {
9068 #[non_exhaustive]
9069 #[derive(
9070 Clone,
9071 Copy,
9072 Debug,
9073 PartialEq,
9074 Eq,
9075 Hash,
9076 PartialOrd,
9077 Ord,
9078 ::prost::Enumeration
9079 )]
9080 #[repr(i32)]
9081 pub enum ExecutionTimeObservationKind {
9082 Unknown = 0,
9083 MoveEntryPoint = 1,
9084 TransferObjects = 2,
9085 SplitCoins = 3,
9086 MergeCoins = 4,
9087 Publish = 5,
9088 MakeMoveVector = 6,
9089 Upgrade = 7,
9090 }
9091 impl ExecutionTimeObservationKind {
9092 pub fn as_str_name(&self) -> &'static str {
9097 match self {
9098 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
9099 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
9100 Self::TransferObjects => "TRANSFER_OBJECTS",
9101 Self::SplitCoins => "SPLIT_COINS",
9102 Self::MergeCoins => "MERGE_COINS",
9103 Self::Publish => "PUBLISH",
9104 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
9105 Self::Upgrade => "UPGRADE",
9106 }
9107 }
9108 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9110 match value {
9111 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
9112 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
9113 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
9114 "SPLIT_COINS" => Some(Self::SplitCoins),
9115 "MERGE_COINS" => Some(Self::MergeCoins),
9116 "PUBLISH" => Some(Self::Publish),
9117 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
9118 "UPGRADE" => Some(Self::Upgrade),
9119 _ => None,
9120 }
9121 }
9122 }
9123}
9124#[non_exhaustive]
9125#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9126pub struct ValidatorExecutionTimeObservation {
9127 #[prost(bytes = "bytes", optional, tag = "1")]
9129 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
9130 #[prost(message, optional, tag = "2")]
9132 pub duration: ::core::option::Option<::prost_types::Duration>,
9133}
9134#[non_exhaustive]
9135#[derive(Clone, PartialEq, ::prost::Message)]
9136pub struct ExecuteTransactionRequest {
9137 #[prost(message, optional, tag = "1")]
9139 pub transaction: ::core::option::Option<Transaction>,
9140 #[prost(message, repeated, tag = "2")]
9143 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
9144 #[prost(message, optional, tag = "3")]
9147 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9148}
9149#[non_exhaustive]
9151#[derive(Clone, PartialEq, ::prost::Message)]
9152pub struct ExecuteTransactionResponse {
9153 #[prost(message, optional, tag = "1")]
9154 pub transaction: ::core::option::Option<ExecutedTransaction>,
9155}
9156#[non_exhaustive]
9157#[derive(Clone, PartialEq, ::prost::Message)]
9158pub struct SimulateTransactionRequest {
9159 #[prost(message, optional, tag = "1")]
9160 pub transaction: ::core::option::Option<Transaction>,
9161 #[prost(message, optional, tag = "2")]
9163 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9164 #[prost(
9166 enumeration = "simulate_transaction_request::TransactionChecks",
9167 optional,
9168 tag = "3"
9169 )]
9170 pub checks: ::core::option::Option<i32>,
9171 #[prost(bool, optional, tag = "4")]
9176 pub do_gas_selection: ::core::option::Option<bool>,
9177}
9178pub mod simulate_transaction_request {
9180 #[non_exhaustive]
9182 #[derive(
9183 Clone,
9184 Copy,
9185 Debug,
9186 PartialEq,
9187 Eq,
9188 Hash,
9189 PartialOrd,
9190 Ord,
9191 ::prost::Enumeration
9192 )]
9193 #[repr(i32)]
9194 pub enum TransactionChecks {
9195 Enabled = 0,
9196 Disabled = 1,
9197 }
9198 impl TransactionChecks {
9199 pub fn as_str_name(&self) -> &'static str {
9204 match self {
9205 Self::Enabled => "ENABLED",
9206 Self::Disabled => "DISABLED",
9207 }
9208 }
9209 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9211 match value {
9212 "ENABLED" => Some(Self::Enabled),
9213 "DISABLED" => Some(Self::Disabled),
9214 _ => None,
9215 }
9216 }
9217 }
9218}
9219#[non_exhaustive]
9220#[derive(Clone, PartialEq, ::prost::Message)]
9221pub struct SimulateTransactionResponse {
9222 #[prost(message, optional, tag = "1")]
9223 pub transaction: ::core::option::Option<ExecutedTransaction>,
9224 #[prost(message, repeated, tag = "2")]
9225 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
9226 #[prost(uint64, optional, tag = "3")]
9230 pub suggested_gas_price: ::core::option::Option<u64>,
9231}
9232#[non_exhaustive]
9234#[derive(Clone, PartialEq, ::prost::Message)]
9235pub struct CommandResult {
9236 #[prost(message, repeated, tag = "1")]
9237 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
9238 #[prost(message, repeated, tag = "2")]
9239 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
9240}
9241#[non_exhaustive]
9242#[derive(Clone, PartialEq, ::prost::Message)]
9243pub struct CommandOutput {
9244 #[prost(message, optional, tag = "1")]
9245 pub argument: ::core::option::Option<Argument>,
9246 #[prost(message, optional, tag = "2")]
9247 pub value: ::core::option::Option<Bcs>,
9248 #[prost(message, optional, boxed, tag = "3")]
9250 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
9251}
9252pub mod transaction_execution_service_client {
9254 #![allow(
9255 unused_variables,
9256 dead_code,
9257 missing_docs,
9258 clippy::wildcard_imports,
9259 clippy::let_unit_value,
9260 )]
9261 use tonic::codegen::*;
9262 use tonic::codegen::http::Uri;
9263 #[derive(Debug, Clone)]
9264 pub struct TransactionExecutionServiceClient<T> {
9265 inner: tonic::client::Grpc<T>,
9266 }
9267 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
9268 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9270 where
9271 D: TryInto<tonic::transport::Endpoint>,
9272 D::Error: Into<StdError>,
9273 {
9274 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9275 Ok(Self::new(conn))
9276 }
9277 }
9278 impl<T> TransactionExecutionServiceClient<T>
9279 where
9280 T: tonic::client::GrpcService<tonic::body::Body>,
9281 T::Error: Into<StdError>,
9282 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9283 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9284 {
9285 pub fn new(inner: T) -> Self {
9286 let inner = tonic::client::Grpc::new(inner);
9287 Self { inner }
9288 }
9289 pub fn with_origin(inner: T, origin: Uri) -> Self {
9290 let inner = tonic::client::Grpc::with_origin(inner, origin);
9291 Self { inner }
9292 }
9293 pub fn with_interceptor<F>(
9294 inner: T,
9295 interceptor: F,
9296 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
9297 where
9298 F: tonic::service::Interceptor,
9299 T::ResponseBody: Default,
9300 T: tonic::codegen::Service<
9301 http::Request<tonic::body::Body>,
9302 Response = http::Response<
9303 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9304 >,
9305 >,
9306 <T as tonic::codegen::Service<
9307 http::Request<tonic::body::Body>,
9308 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9309 {
9310 TransactionExecutionServiceClient::new(
9311 InterceptedService::new(inner, interceptor),
9312 )
9313 }
9314 #[must_use]
9319 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9320 self.inner = self.inner.send_compressed(encoding);
9321 self
9322 }
9323 #[must_use]
9325 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9326 self.inner = self.inner.accept_compressed(encoding);
9327 self
9328 }
9329 #[must_use]
9333 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9334 self.inner = self.inner.max_decoding_message_size(limit);
9335 self
9336 }
9337 #[must_use]
9341 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9342 self.inner = self.inner.max_encoding_message_size(limit);
9343 self
9344 }
9345 pub async fn execute_transaction(
9346 &mut self,
9347 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
9348 ) -> std::result::Result<
9349 tonic::Response<super::ExecuteTransactionResponse>,
9350 tonic::Status,
9351 > {
9352 self.inner
9353 .ready()
9354 .await
9355 .map_err(|e| {
9356 tonic::Status::unknown(
9357 format!("Service was not ready: {}", e.into()),
9358 )
9359 })?;
9360 let codec = tonic_prost::ProstCodec::default();
9361 let path = http::uri::PathAndQuery::from_static(
9362 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
9363 );
9364 let mut req = request.into_request();
9365 req.extensions_mut()
9366 .insert(
9367 GrpcMethod::new(
9368 "sui.rpc.v2.TransactionExecutionService",
9369 "ExecuteTransaction",
9370 ),
9371 );
9372 self.inner.unary(req, path, codec).await
9373 }
9374 pub async fn simulate_transaction(
9375 &mut self,
9376 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
9377 ) -> std::result::Result<
9378 tonic::Response<super::SimulateTransactionResponse>,
9379 tonic::Status,
9380 > {
9381 self.inner
9382 .ready()
9383 .await
9384 .map_err(|e| {
9385 tonic::Status::unknown(
9386 format!("Service was not ready: {}", e.into()),
9387 )
9388 })?;
9389 let codec = tonic_prost::ProstCodec::default();
9390 let path = http::uri::PathAndQuery::from_static(
9391 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
9392 );
9393 let mut req = request.into_request();
9394 req.extensions_mut()
9395 .insert(
9396 GrpcMethod::new(
9397 "sui.rpc.v2.TransactionExecutionService",
9398 "SimulateTransaction",
9399 ),
9400 );
9401 self.inner.unary(req, path, codec).await
9402 }
9403 }
9404}
9405pub mod transaction_execution_service_server {
9407 #![allow(
9408 unused_variables,
9409 dead_code,
9410 missing_docs,
9411 clippy::wildcard_imports,
9412 clippy::let_unit_value,
9413 )]
9414 use tonic::codegen::*;
9415 #[async_trait]
9417 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
9418 async fn execute_transaction(
9419 &self,
9420 request: tonic::Request<super::ExecuteTransactionRequest>,
9421 ) -> std::result::Result<
9422 tonic::Response<super::ExecuteTransactionResponse>,
9423 tonic::Status,
9424 > {
9425 Err(tonic::Status::unimplemented("Not yet implemented"))
9426 }
9427 async fn simulate_transaction(
9428 &self,
9429 request: tonic::Request<super::SimulateTransactionRequest>,
9430 ) -> std::result::Result<
9431 tonic::Response<super::SimulateTransactionResponse>,
9432 tonic::Status,
9433 > {
9434 Err(tonic::Status::unimplemented("Not yet implemented"))
9435 }
9436 }
9437 #[derive(Debug)]
9438 pub struct TransactionExecutionServiceServer<T> {
9439 inner: Arc<T>,
9440 accept_compression_encodings: EnabledCompressionEncodings,
9441 send_compression_encodings: EnabledCompressionEncodings,
9442 max_decoding_message_size: Option<usize>,
9443 max_encoding_message_size: Option<usize>,
9444 }
9445 impl<T> TransactionExecutionServiceServer<T> {
9446 pub fn new(inner: T) -> Self {
9447 Self::from_arc(Arc::new(inner))
9448 }
9449 pub fn from_arc(inner: Arc<T>) -> Self {
9450 Self {
9451 inner,
9452 accept_compression_encodings: Default::default(),
9453 send_compression_encodings: Default::default(),
9454 max_decoding_message_size: None,
9455 max_encoding_message_size: None,
9456 }
9457 }
9458 pub fn with_interceptor<F>(
9459 inner: T,
9460 interceptor: F,
9461 ) -> InterceptedService<Self, F>
9462 where
9463 F: tonic::service::Interceptor,
9464 {
9465 InterceptedService::new(Self::new(inner), interceptor)
9466 }
9467 #[must_use]
9469 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9470 self.accept_compression_encodings.enable(encoding);
9471 self
9472 }
9473 #[must_use]
9475 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9476 self.send_compression_encodings.enable(encoding);
9477 self
9478 }
9479 #[must_use]
9483 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9484 self.max_decoding_message_size = Some(limit);
9485 self
9486 }
9487 #[must_use]
9491 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9492 self.max_encoding_message_size = Some(limit);
9493 self
9494 }
9495 }
9496 impl<T, B> tonic::codegen::Service<http::Request<B>>
9497 for TransactionExecutionServiceServer<T>
9498 where
9499 T: TransactionExecutionService,
9500 B: Body + std::marker::Send + 'static,
9501 B::Error: Into<StdError> + std::marker::Send + 'static,
9502 {
9503 type Response = http::Response<tonic::body::Body>;
9504 type Error = std::convert::Infallible;
9505 type Future = BoxFuture<Self::Response, Self::Error>;
9506 fn poll_ready(
9507 &mut self,
9508 _cx: &mut Context<'_>,
9509 ) -> Poll<std::result::Result<(), Self::Error>> {
9510 Poll::Ready(Ok(()))
9511 }
9512 fn call(&mut self, req: http::Request<B>) -> Self::Future {
9513 match req.uri().path() {
9514 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
9515 #[allow(non_camel_case_types)]
9516 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
9517 pub Arc<T>,
9518 );
9519 impl<
9520 T: TransactionExecutionService,
9521 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
9522 for ExecuteTransactionSvc<T> {
9523 type Response = super::ExecuteTransactionResponse;
9524 type Future = BoxFuture<
9525 tonic::Response<Self::Response>,
9526 tonic::Status,
9527 >;
9528 fn call(
9529 &mut self,
9530 request: tonic::Request<super::ExecuteTransactionRequest>,
9531 ) -> Self::Future {
9532 let inner = Arc::clone(&self.0);
9533 let fut = async move {
9534 <T as TransactionExecutionService>::execute_transaction(
9535 &inner,
9536 request,
9537 )
9538 .await
9539 };
9540 Box::pin(fut)
9541 }
9542 }
9543 let accept_compression_encodings = self.accept_compression_encodings;
9544 let send_compression_encodings = self.send_compression_encodings;
9545 let max_decoding_message_size = self.max_decoding_message_size;
9546 let max_encoding_message_size = self.max_encoding_message_size;
9547 let inner = self.inner.clone();
9548 let fut = async move {
9549 let method = ExecuteTransactionSvc(inner);
9550 let codec = tonic_prost::ProstCodec::default();
9551 let mut grpc = tonic::server::Grpc::new(codec)
9552 .apply_compression_config(
9553 accept_compression_encodings,
9554 send_compression_encodings,
9555 )
9556 .apply_max_message_size_config(
9557 max_decoding_message_size,
9558 max_encoding_message_size,
9559 );
9560 let res = grpc.unary(method, req).await;
9561 Ok(res)
9562 };
9563 Box::pin(fut)
9564 }
9565 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
9566 #[allow(non_camel_case_types)]
9567 struct SimulateTransactionSvc<T: TransactionExecutionService>(
9568 pub Arc<T>,
9569 );
9570 impl<
9571 T: TransactionExecutionService,
9572 > tonic::server::UnaryService<super::SimulateTransactionRequest>
9573 for SimulateTransactionSvc<T> {
9574 type Response = super::SimulateTransactionResponse;
9575 type Future = BoxFuture<
9576 tonic::Response<Self::Response>,
9577 tonic::Status,
9578 >;
9579 fn call(
9580 &mut self,
9581 request: tonic::Request<super::SimulateTransactionRequest>,
9582 ) -> Self::Future {
9583 let inner = Arc::clone(&self.0);
9584 let fut = async move {
9585 <T as TransactionExecutionService>::simulate_transaction(
9586 &inner,
9587 request,
9588 )
9589 .await
9590 };
9591 Box::pin(fut)
9592 }
9593 }
9594 let accept_compression_encodings = self.accept_compression_encodings;
9595 let send_compression_encodings = self.send_compression_encodings;
9596 let max_decoding_message_size = self.max_decoding_message_size;
9597 let max_encoding_message_size = self.max_encoding_message_size;
9598 let inner = self.inner.clone();
9599 let fut = async move {
9600 let method = SimulateTransactionSvc(inner);
9601 let codec = tonic_prost::ProstCodec::default();
9602 let mut grpc = tonic::server::Grpc::new(codec)
9603 .apply_compression_config(
9604 accept_compression_encodings,
9605 send_compression_encodings,
9606 )
9607 .apply_max_message_size_config(
9608 max_decoding_message_size,
9609 max_encoding_message_size,
9610 );
9611 let res = grpc.unary(method, req).await;
9612 Ok(res)
9613 };
9614 Box::pin(fut)
9615 }
9616 _ => {
9617 Box::pin(async move {
9618 let mut response = http::Response::new(
9619 tonic::body::Body::default(),
9620 );
9621 let headers = response.headers_mut();
9622 headers
9623 .insert(
9624 tonic::Status::GRPC_STATUS,
9625 (tonic::Code::Unimplemented as i32).into(),
9626 );
9627 headers
9628 .insert(
9629 http::header::CONTENT_TYPE,
9630 tonic::metadata::GRPC_CONTENT_TYPE,
9631 );
9632 Ok(response)
9633 })
9634 }
9635 }
9636 }
9637 }
9638 impl<T> Clone for TransactionExecutionServiceServer<T> {
9639 fn clone(&self) -> Self {
9640 let inner = self.inner.clone();
9641 Self {
9642 inner,
9643 accept_compression_encodings: self.accept_compression_encodings,
9644 send_compression_encodings: self.send_compression_encodings,
9645 max_decoding_message_size: self.max_decoding_message_size,
9646 max_encoding_message_size: self.max_encoding_message_size,
9647 }
9648 }
9649 }
9650 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
9652 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
9653 const NAME: &'static str = SERVICE_NAME;
9654 }
9655}