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 Allowance = 3,
2034 }
2035 impl Source {
2036 pub fn as_str_name(&self) -> &'static str {
2041 match self {
2042 Self::Unknown => "SOURCE_UNKNOWN",
2043 Self::Sender => "SENDER",
2044 Self::Sponsor => "SPONSOR",
2045 Self::Allowance => "ALLOWANCE",
2046 }
2047 }
2048 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2050 match value {
2051 "SOURCE_UNKNOWN" => Some(Self::Unknown),
2052 "SENDER" => Some(Self::Sender),
2053 "SPONSOR" => Some(Self::Sponsor),
2054 "ALLOWANCE" => Some(Self::Allowance),
2055 _ => None,
2056 }
2057 }
2058 }
2059}
2060#[non_exhaustive]
2062#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2063pub struct JwkId {
2064 #[prost(string, optional, tag = "1")]
2066 pub iss: ::core::option::Option<::prost::alloc::string::String>,
2067 #[prost(string, optional, tag = "2")]
2069 pub kid: ::core::option::Option<::prost::alloc::string::String>,
2070}
2071#[non_exhaustive]
2077#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2078pub struct Jwk {
2079 #[prost(string, optional, tag = "1")]
2081 pub kty: ::core::option::Option<::prost::alloc::string::String>,
2082 #[prost(string, optional, tag = "2")]
2084 pub e: ::core::option::Option<::prost::alloc::string::String>,
2085 #[prost(string, optional, tag = "3")]
2087 pub n: ::core::option::Option<::prost::alloc::string::String>,
2088 #[prost(string, optional, tag = "4")]
2090 pub alg: ::core::option::Option<::prost::alloc::string::String>,
2091}
2092#[non_exhaustive]
2093#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2094pub struct GetServiceInfoRequest {}
2095#[non_exhaustive]
2096#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2097pub struct GetServiceInfoResponse {
2098 #[prost(string, optional, tag = "1")]
2103 pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
2104 #[prost(string, optional, tag = "2")]
2108 pub chain: ::core::option::Option<::prost::alloc::string::String>,
2109 #[prost(uint64, optional, tag = "3")]
2111 pub epoch: ::core::option::Option<u64>,
2112 #[prost(uint64, optional, tag = "4")]
2114 pub checkpoint_height: ::core::option::Option<u64>,
2115 #[prost(message, optional, tag = "5")]
2117 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
2118 #[prost(uint64, optional, tag = "6")]
2120 pub lowest_available_checkpoint: ::core::option::Option<u64>,
2121 #[prost(uint64, optional, tag = "7")]
2123 pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
2124 #[prost(string, optional, tag = "8")]
2126 pub server: ::core::option::Option<::prost::alloc::string::String>,
2127}
2128#[non_exhaustive]
2129#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2130pub struct GetObjectRequest {
2131 #[prost(string, optional, tag = "1")]
2133 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2134 #[prost(uint64, optional, tag = "2")]
2138 pub version: ::core::option::Option<u64>,
2139 #[prost(message, optional, tag = "3")]
2142 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2143}
2144#[non_exhaustive]
2145#[derive(Clone, PartialEq, ::prost::Message)]
2146pub struct GetObjectResponse {
2147 #[prost(message, optional, tag = "1")]
2148 pub object: ::core::option::Option<Object>,
2149}
2150#[non_exhaustive]
2151#[derive(Clone, PartialEq, ::prost::Message)]
2152pub struct BatchGetObjectsRequest {
2153 #[prost(message, repeated, tag = "1")]
2154 pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
2155 #[prost(message, optional, tag = "2")]
2158 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2159}
2160#[non_exhaustive]
2161#[derive(Clone, PartialEq, ::prost::Message)]
2162pub struct BatchGetObjectsResponse {
2163 #[prost(message, repeated, tag = "1")]
2164 pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
2165}
2166#[non_exhaustive]
2167#[derive(Clone, PartialEq, ::prost::Message)]
2168pub struct GetObjectResult {
2169 #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
2170 pub result: ::core::option::Option<get_object_result::Result>,
2171}
2172pub mod get_object_result {
2174 #[non_exhaustive]
2175 #[derive(Clone, PartialEq, ::prost::Oneof)]
2176 pub enum Result {
2177 #[prost(message, tag = "1")]
2178 Object(super::Object),
2179 #[prost(message, tag = "2")]
2180 Error(super::super::super::super::google::rpc::Status),
2181 }
2182}
2183#[non_exhaustive]
2184#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2185pub struct GetTransactionRequest {
2186 #[prost(string, optional, tag = "1")]
2188 pub digest: ::core::option::Option<::prost::alloc::string::String>,
2189 #[prost(message, optional, tag = "2")]
2192 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2193}
2194#[non_exhaustive]
2195#[derive(Clone, PartialEq, ::prost::Message)]
2196pub struct GetTransactionResponse {
2197 #[prost(message, optional, tag = "1")]
2198 pub transaction: ::core::option::Option<ExecutedTransaction>,
2199}
2200#[non_exhaustive]
2201#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2202pub struct BatchGetTransactionsRequest {
2203 #[prost(string, repeated, tag = "1")]
2205 pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2206 #[prost(message, optional, tag = "2")]
2209 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2210}
2211#[non_exhaustive]
2212#[derive(Clone, PartialEq, ::prost::Message)]
2213pub struct BatchGetTransactionsResponse {
2214 #[prost(message, repeated, tag = "1")]
2215 pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
2216}
2217#[non_exhaustive]
2218#[derive(Clone, PartialEq, ::prost::Message)]
2219pub struct GetTransactionResult {
2220 #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
2221 pub result: ::core::option::Option<get_transaction_result::Result>,
2222}
2223pub mod get_transaction_result {
2225 #[non_exhaustive]
2226 #[derive(Clone, PartialEq, ::prost::Oneof)]
2227 pub enum Result {
2228 #[prost(message, tag = "1")]
2229 Transaction(super::ExecutedTransaction),
2230 #[prost(message, tag = "2")]
2231 Error(super::super::super::super::google::rpc::Status),
2232 }
2233}
2234#[non_exhaustive]
2235#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2236pub struct GetCheckpointRequest {
2237 #[prost(message, optional, tag = "3")]
2240 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2241 #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
2243 pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
2244}
2245pub mod get_checkpoint_request {
2247 #[non_exhaustive]
2249 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2250 pub enum CheckpointId {
2251 #[prost(uint64, tag = "1")]
2253 SequenceNumber(u64),
2254 #[prost(string, tag = "2")]
2256 Digest(::prost::alloc::string::String),
2257 }
2258}
2259#[non_exhaustive]
2260#[derive(Clone, PartialEq, ::prost::Message)]
2261pub struct GetCheckpointResponse {
2262 #[prost(message, optional, tag = "1")]
2263 pub checkpoint: ::core::option::Option<Checkpoint>,
2264}
2265#[non_exhaustive]
2266#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2267pub struct GetEpochRequest {
2268 #[prost(uint64, optional, tag = "1")]
2271 pub epoch: ::core::option::Option<u64>,
2272 #[prost(message, optional, tag = "2")]
2275 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2276}
2277#[non_exhaustive]
2278#[derive(Clone, PartialEq, ::prost::Message)]
2279pub struct GetEpochResponse {
2280 #[prost(message, optional, tag = "1")]
2281 pub epoch: ::core::option::Option<Epoch>,
2282}
2283#[non_exhaustive]
2285#[derive(Clone, PartialEq, ::prost::Message)]
2286pub struct ListCheckpointsRequest {
2287 #[prost(message, optional, tag = "1")]
2290 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2291 #[prost(uint64, optional, tag = "2")]
2294 pub start_checkpoint: ::core::option::Option<u64>,
2295 #[prost(uint64, optional, tag = "3")]
2298 pub end_checkpoint: ::core::option::Option<u64>,
2299 #[prost(message, optional, tag = "4")]
2303 pub filter: ::core::option::Option<TransactionFilter>,
2304 #[prost(message, optional, tag = "5")]
2310 pub options: ::core::option::Option<QueryOptions>,
2311}
2312#[non_exhaustive]
2323#[derive(Clone, PartialEq, ::prost::Message)]
2324pub struct ListCheckpointsResponse {
2325 #[prost(message, optional, tag = "1")]
2327 pub checkpoint: ::core::option::Option<Checkpoint>,
2328 #[prost(message, optional, tag = "2")]
2332 pub watermark: ::core::option::Option<Watermark>,
2333 #[prost(message, optional, tag = "3")]
2335 pub end: ::core::option::Option<QueryEnd>,
2336}
2337#[non_exhaustive]
2339#[derive(Clone, PartialEq, ::prost::Message)]
2340pub struct ListTransactionsRequest {
2341 #[prost(message, optional, tag = "1")]
2344 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2345 #[prost(uint64, optional, tag = "2")]
2348 pub start_checkpoint: ::core::option::Option<u64>,
2349 #[prost(uint64, optional, tag = "3")]
2352 pub end_checkpoint: ::core::option::Option<u64>,
2353 #[prost(message, optional, tag = "4")]
2356 pub filter: ::core::option::Option<TransactionFilter>,
2357 #[prost(message, optional, tag = "5")]
2363 pub options: ::core::option::Option<QueryOptions>,
2364}
2365#[non_exhaustive]
2376#[derive(Clone, PartialEq, ::prost::Message)]
2377pub struct ListTransactionsResponse {
2378 #[prost(message, optional, tag = "1")]
2381 pub transaction: ::core::option::Option<ExecutedTransaction>,
2382 #[prost(message, optional, tag = "2")]
2386 pub watermark: ::core::option::Option<Watermark>,
2387 #[prost(message, optional, tag = "3")]
2389 pub end: ::core::option::Option<QueryEnd>,
2390}
2391#[non_exhaustive]
2393#[derive(Clone, PartialEq, ::prost::Message)]
2394pub struct ListEventsRequest {
2395 #[prost(message, optional, tag = "1")]
2397 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2398 #[prost(uint64, optional, tag = "2")]
2401 pub start_checkpoint: ::core::option::Option<u64>,
2402 #[prost(uint64, optional, tag = "3")]
2405 pub end_checkpoint: ::core::option::Option<u64>,
2406 #[prost(message, optional, tag = "4")]
2409 pub filter: ::core::option::Option<EventFilter>,
2410 #[prost(message, optional, tag = "5")]
2416 pub options: ::core::option::Option<QueryOptions>,
2417}
2418#[non_exhaustive]
2429#[derive(Clone, PartialEq, ::prost::Message)]
2430pub struct ListEventsResponse {
2431 #[prost(message, optional, tag = "1")]
2436 pub event: ::core::option::Option<Event>,
2437 #[prost(message, optional, tag = "2")]
2441 pub watermark: ::core::option::Option<Watermark>,
2442 #[prost(message, optional, tag = "3")]
2444 pub end: ::core::option::Option<QueryEnd>,
2445}
2446pub mod ledger_service_client {
2448 #![allow(
2449 unused_variables,
2450 dead_code,
2451 missing_docs,
2452 clippy::wildcard_imports,
2453 clippy::let_unit_value,
2454 )]
2455 use tonic::codegen::*;
2456 use tonic::codegen::http::Uri;
2457 #[derive(Debug, Clone)]
2458 pub struct LedgerServiceClient<T> {
2459 inner: tonic::client::Grpc<T>,
2460 }
2461 impl LedgerServiceClient<tonic::transport::Channel> {
2462 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2464 where
2465 D: TryInto<tonic::transport::Endpoint>,
2466 D::Error: Into<StdError>,
2467 {
2468 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2469 Ok(Self::new(conn))
2470 }
2471 }
2472 impl<T> LedgerServiceClient<T>
2473 where
2474 T: tonic::client::GrpcService<tonic::body::Body>,
2475 T::Error: Into<StdError>,
2476 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2477 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2478 {
2479 pub fn new(inner: T) -> Self {
2480 let inner = tonic::client::Grpc::new(inner);
2481 Self { inner }
2482 }
2483 pub fn with_origin(inner: T, origin: Uri) -> Self {
2484 let inner = tonic::client::Grpc::with_origin(inner, origin);
2485 Self { inner }
2486 }
2487 pub fn with_interceptor<F>(
2488 inner: T,
2489 interceptor: F,
2490 ) -> LedgerServiceClient<InterceptedService<T, F>>
2491 where
2492 F: tonic::service::Interceptor,
2493 T::ResponseBody: Default,
2494 T: tonic::codegen::Service<
2495 http::Request<tonic::body::Body>,
2496 Response = http::Response<
2497 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2498 >,
2499 >,
2500 <T as tonic::codegen::Service<
2501 http::Request<tonic::body::Body>,
2502 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2503 {
2504 LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
2505 }
2506 #[must_use]
2511 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2512 self.inner = self.inner.send_compressed(encoding);
2513 self
2514 }
2515 #[must_use]
2517 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2518 self.inner = self.inner.accept_compressed(encoding);
2519 self
2520 }
2521 #[must_use]
2525 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2526 self.inner = self.inner.max_decoding_message_size(limit);
2527 self
2528 }
2529 #[must_use]
2533 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2534 self.inner = self.inner.max_encoding_message_size(limit);
2535 self
2536 }
2537 pub async fn get_service_info(
2539 &mut self,
2540 request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
2541 ) -> std::result::Result<
2542 tonic::Response<super::GetServiceInfoResponse>,
2543 tonic::Status,
2544 > {
2545 self.inner
2546 .ready()
2547 .await
2548 .map_err(|e| {
2549 tonic::Status::unknown(
2550 format!("Service was not ready: {}", e.into()),
2551 )
2552 })?;
2553 let codec = tonic_prost::ProstCodec::default();
2554 let path = http::uri::PathAndQuery::from_static(
2555 "/sui.rpc.v2.LedgerService/GetServiceInfo",
2556 );
2557 let mut req = request.into_request();
2558 req.extensions_mut()
2559 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
2560 self.inner.unary(req, path, codec).await
2561 }
2562 pub async fn get_object(
2563 &mut self,
2564 request: impl tonic::IntoRequest<super::GetObjectRequest>,
2565 ) -> std::result::Result<
2566 tonic::Response<super::GetObjectResponse>,
2567 tonic::Status,
2568 > {
2569 self.inner
2570 .ready()
2571 .await
2572 .map_err(|e| {
2573 tonic::Status::unknown(
2574 format!("Service was not ready: {}", e.into()),
2575 )
2576 })?;
2577 let codec = tonic_prost::ProstCodec::default();
2578 let path = http::uri::PathAndQuery::from_static(
2579 "/sui.rpc.v2.LedgerService/GetObject",
2580 );
2581 let mut req = request.into_request();
2582 req.extensions_mut()
2583 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
2584 self.inner.unary(req, path, codec).await
2585 }
2586 pub async fn batch_get_objects(
2587 &mut self,
2588 request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
2589 ) -> std::result::Result<
2590 tonic::Response<super::BatchGetObjectsResponse>,
2591 tonic::Status,
2592 > {
2593 self.inner
2594 .ready()
2595 .await
2596 .map_err(|e| {
2597 tonic::Status::unknown(
2598 format!("Service was not ready: {}", e.into()),
2599 )
2600 })?;
2601 let codec = tonic_prost::ProstCodec::default();
2602 let path = http::uri::PathAndQuery::from_static(
2603 "/sui.rpc.v2.LedgerService/BatchGetObjects",
2604 );
2605 let mut req = request.into_request();
2606 req.extensions_mut()
2607 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
2608 self.inner.unary(req, path, codec).await
2609 }
2610 pub async fn get_transaction(
2611 &mut self,
2612 request: impl tonic::IntoRequest<super::GetTransactionRequest>,
2613 ) -> std::result::Result<
2614 tonic::Response<super::GetTransactionResponse>,
2615 tonic::Status,
2616 > {
2617 self.inner
2618 .ready()
2619 .await
2620 .map_err(|e| {
2621 tonic::Status::unknown(
2622 format!("Service was not ready: {}", e.into()),
2623 )
2624 })?;
2625 let codec = tonic_prost::ProstCodec::default();
2626 let path = http::uri::PathAndQuery::from_static(
2627 "/sui.rpc.v2.LedgerService/GetTransaction",
2628 );
2629 let mut req = request.into_request();
2630 req.extensions_mut()
2631 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
2632 self.inner.unary(req, path, codec).await
2633 }
2634 pub async fn batch_get_transactions(
2635 &mut self,
2636 request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
2637 ) -> std::result::Result<
2638 tonic::Response<super::BatchGetTransactionsResponse>,
2639 tonic::Status,
2640 > {
2641 self.inner
2642 .ready()
2643 .await
2644 .map_err(|e| {
2645 tonic::Status::unknown(
2646 format!("Service was not ready: {}", e.into()),
2647 )
2648 })?;
2649 let codec = tonic_prost::ProstCodec::default();
2650 let path = http::uri::PathAndQuery::from_static(
2651 "/sui.rpc.v2.LedgerService/BatchGetTransactions",
2652 );
2653 let mut req = request.into_request();
2654 req.extensions_mut()
2655 .insert(
2656 GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
2657 );
2658 self.inner.unary(req, path, codec).await
2659 }
2660 pub async fn get_checkpoint(
2661 &mut self,
2662 request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
2663 ) -> std::result::Result<
2664 tonic::Response<super::GetCheckpointResponse>,
2665 tonic::Status,
2666 > {
2667 self.inner
2668 .ready()
2669 .await
2670 .map_err(|e| {
2671 tonic::Status::unknown(
2672 format!("Service was not ready: {}", e.into()),
2673 )
2674 })?;
2675 let codec = tonic_prost::ProstCodec::default();
2676 let path = http::uri::PathAndQuery::from_static(
2677 "/sui.rpc.v2.LedgerService/GetCheckpoint",
2678 );
2679 let mut req = request.into_request();
2680 req.extensions_mut()
2681 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
2682 self.inner.unary(req, path, codec).await
2683 }
2684 pub async fn get_epoch(
2685 &mut self,
2686 request: impl tonic::IntoRequest<super::GetEpochRequest>,
2687 ) -> std::result::Result<
2688 tonic::Response<super::GetEpochResponse>,
2689 tonic::Status,
2690 > {
2691 self.inner
2692 .ready()
2693 .await
2694 .map_err(|e| {
2695 tonic::Status::unknown(
2696 format!("Service was not ready: {}", e.into()),
2697 )
2698 })?;
2699 let codec = tonic_prost::ProstCodec::default();
2700 let path = http::uri::PathAndQuery::from_static(
2701 "/sui.rpc.v2.LedgerService/GetEpoch",
2702 );
2703 let mut req = request.into_request();
2704 req.extensions_mut()
2705 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
2706 self.inner.unary(req, path, codec).await
2707 }
2708 pub async fn list_checkpoints(
2714 &mut self,
2715 request: impl tonic::IntoRequest<super::ListCheckpointsRequest>,
2716 ) -> std::result::Result<
2717 tonic::Response<tonic::codec::Streaming<super::ListCheckpointsResponse>>,
2718 tonic::Status,
2719 > {
2720 self.inner
2721 .ready()
2722 .await
2723 .map_err(|e| {
2724 tonic::Status::unknown(
2725 format!("Service was not ready: {}", e.into()),
2726 )
2727 })?;
2728 let codec = tonic_prost::ProstCodec::default();
2729 let path = http::uri::PathAndQuery::from_static(
2730 "/sui.rpc.v2.LedgerService/ListCheckpoints",
2731 );
2732 let mut req = request.into_request();
2733 req.extensions_mut()
2734 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListCheckpoints"));
2735 self.inner.server_streaming(req, path, codec).await
2736 }
2737 pub async fn list_transactions(
2742 &mut self,
2743 request: impl tonic::IntoRequest<super::ListTransactionsRequest>,
2744 ) -> std::result::Result<
2745 tonic::Response<tonic::codec::Streaming<super::ListTransactionsResponse>>,
2746 tonic::Status,
2747 > {
2748 self.inner
2749 .ready()
2750 .await
2751 .map_err(|e| {
2752 tonic::Status::unknown(
2753 format!("Service was not ready: {}", e.into()),
2754 )
2755 })?;
2756 let codec = tonic_prost::ProstCodec::default();
2757 let path = http::uri::PathAndQuery::from_static(
2758 "/sui.rpc.v2.LedgerService/ListTransactions",
2759 );
2760 let mut req = request.into_request();
2761 req.extensions_mut()
2762 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListTransactions"));
2763 self.inner.server_streaming(req, path, codec).await
2764 }
2765 pub async fn list_events(
2770 &mut self,
2771 request: impl tonic::IntoRequest<super::ListEventsRequest>,
2772 ) -> std::result::Result<
2773 tonic::Response<tonic::codec::Streaming<super::ListEventsResponse>>,
2774 tonic::Status,
2775 > {
2776 self.inner
2777 .ready()
2778 .await
2779 .map_err(|e| {
2780 tonic::Status::unknown(
2781 format!("Service was not ready: {}", e.into()),
2782 )
2783 })?;
2784 let codec = tonic_prost::ProstCodec::default();
2785 let path = http::uri::PathAndQuery::from_static(
2786 "/sui.rpc.v2.LedgerService/ListEvents",
2787 );
2788 let mut req = request.into_request();
2789 req.extensions_mut()
2790 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListEvents"));
2791 self.inner.server_streaming(req, path, codec).await
2792 }
2793 }
2794}
2795pub mod ledger_service_server {
2797 #![allow(
2798 unused_variables,
2799 dead_code,
2800 missing_docs,
2801 clippy::wildcard_imports,
2802 clippy::let_unit_value,
2803 )]
2804 use tonic::codegen::*;
2805 #[async_trait]
2807 pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2808 async fn get_service_info(
2810 &self,
2811 request: tonic::Request<super::GetServiceInfoRequest>,
2812 ) -> std::result::Result<
2813 tonic::Response<super::GetServiceInfoResponse>,
2814 tonic::Status,
2815 > {
2816 Err(tonic::Status::unimplemented("Not yet implemented"))
2817 }
2818 async fn get_object(
2819 &self,
2820 request: tonic::Request<super::GetObjectRequest>,
2821 ) -> std::result::Result<
2822 tonic::Response<super::GetObjectResponse>,
2823 tonic::Status,
2824 > {
2825 Err(tonic::Status::unimplemented("Not yet implemented"))
2826 }
2827 async fn batch_get_objects(
2828 &self,
2829 request: tonic::Request<super::BatchGetObjectsRequest>,
2830 ) -> std::result::Result<
2831 tonic::Response<super::BatchGetObjectsResponse>,
2832 tonic::Status,
2833 > {
2834 Err(tonic::Status::unimplemented("Not yet implemented"))
2835 }
2836 async fn get_transaction(
2837 &self,
2838 request: tonic::Request<super::GetTransactionRequest>,
2839 ) -> std::result::Result<
2840 tonic::Response<super::GetTransactionResponse>,
2841 tonic::Status,
2842 > {
2843 Err(tonic::Status::unimplemented("Not yet implemented"))
2844 }
2845 async fn batch_get_transactions(
2846 &self,
2847 request: tonic::Request<super::BatchGetTransactionsRequest>,
2848 ) -> std::result::Result<
2849 tonic::Response<super::BatchGetTransactionsResponse>,
2850 tonic::Status,
2851 > {
2852 Err(tonic::Status::unimplemented("Not yet implemented"))
2853 }
2854 async fn get_checkpoint(
2855 &self,
2856 request: tonic::Request<super::GetCheckpointRequest>,
2857 ) -> std::result::Result<
2858 tonic::Response<super::GetCheckpointResponse>,
2859 tonic::Status,
2860 > {
2861 Err(tonic::Status::unimplemented("Not yet implemented"))
2862 }
2863 async fn get_epoch(
2864 &self,
2865 request: tonic::Request<super::GetEpochRequest>,
2866 ) -> std::result::Result<
2867 tonic::Response<super::GetEpochResponse>,
2868 tonic::Status,
2869 > {
2870 Err(tonic::Status::unimplemented("Not yet implemented"))
2871 }
2872 async fn list_checkpoints(
2878 &self,
2879 request: tonic::Request<super::ListCheckpointsRequest>,
2880 ) -> std::result::Result<
2881 tonic::Response<BoxStream<super::ListCheckpointsResponse>>,
2882 tonic::Status,
2883 > {
2884 Err(tonic::Status::unimplemented("Not yet implemented"))
2885 }
2886 async fn list_transactions(
2891 &self,
2892 request: tonic::Request<super::ListTransactionsRequest>,
2893 ) -> std::result::Result<
2894 tonic::Response<BoxStream<super::ListTransactionsResponse>>,
2895 tonic::Status,
2896 > {
2897 Err(tonic::Status::unimplemented("Not yet implemented"))
2898 }
2899 async fn list_events(
2904 &self,
2905 request: tonic::Request<super::ListEventsRequest>,
2906 ) -> std::result::Result<
2907 tonic::Response<BoxStream<super::ListEventsResponse>>,
2908 tonic::Status,
2909 > {
2910 Err(tonic::Status::unimplemented("Not yet implemented"))
2911 }
2912 }
2913 #[derive(Debug)]
2914 pub struct LedgerServiceServer<T> {
2915 inner: Arc<T>,
2916 accept_compression_encodings: EnabledCompressionEncodings,
2917 send_compression_encodings: EnabledCompressionEncodings,
2918 max_decoding_message_size: Option<usize>,
2919 max_encoding_message_size: Option<usize>,
2920 }
2921 impl<T> LedgerServiceServer<T> {
2922 pub fn new(inner: T) -> Self {
2923 Self::from_arc(Arc::new(inner))
2924 }
2925 pub fn from_arc(inner: Arc<T>) -> Self {
2926 Self {
2927 inner,
2928 accept_compression_encodings: Default::default(),
2929 send_compression_encodings: Default::default(),
2930 max_decoding_message_size: None,
2931 max_encoding_message_size: None,
2932 }
2933 }
2934 pub fn with_interceptor<F>(
2935 inner: T,
2936 interceptor: F,
2937 ) -> InterceptedService<Self, F>
2938 where
2939 F: tonic::service::Interceptor,
2940 {
2941 InterceptedService::new(Self::new(inner), interceptor)
2942 }
2943 #[must_use]
2945 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2946 self.accept_compression_encodings.enable(encoding);
2947 self
2948 }
2949 #[must_use]
2951 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2952 self.send_compression_encodings.enable(encoding);
2953 self
2954 }
2955 #[must_use]
2959 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2960 self.max_decoding_message_size = Some(limit);
2961 self
2962 }
2963 #[must_use]
2967 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2968 self.max_encoding_message_size = Some(limit);
2969 self
2970 }
2971 }
2972 impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
2973 where
2974 T: LedgerService,
2975 B: Body + std::marker::Send + 'static,
2976 B::Error: Into<StdError> + std::marker::Send + 'static,
2977 {
2978 type Response = http::Response<tonic::body::Body>;
2979 type Error = std::convert::Infallible;
2980 type Future = BoxFuture<Self::Response, Self::Error>;
2981 fn poll_ready(
2982 &mut self,
2983 _cx: &mut Context<'_>,
2984 ) -> Poll<std::result::Result<(), Self::Error>> {
2985 Poll::Ready(Ok(()))
2986 }
2987 fn call(&mut self, req: http::Request<B>) -> Self::Future {
2988 match req.uri().path() {
2989 "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
2990 #[allow(non_camel_case_types)]
2991 struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
2992 impl<
2993 T: LedgerService,
2994 > tonic::server::UnaryService<super::GetServiceInfoRequest>
2995 for GetServiceInfoSvc<T> {
2996 type Response = super::GetServiceInfoResponse;
2997 type Future = BoxFuture<
2998 tonic::Response<Self::Response>,
2999 tonic::Status,
3000 >;
3001 fn call(
3002 &mut self,
3003 request: tonic::Request<super::GetServiceInfoRequest>,
3004 ) -> Self::Future {
3005 let inner = Arc::clone(&self.0);
3006 let fut = async move {
3007 <T as LedgerService>::get_service_info(&inner, request)
3008 .await
3009 };
3010 Box::pin(fut)
3011 }
3012 }
3013 let accept_compression_encodings = self.accept_compression_encodings;
3014 let send_compression_encodings = self.send_compression_encodings;
3015 let max_decoding_message_size = self.max_decoding_message_size;
3016 let max_encoding_message_size = self.max_encoding_message_size;
3017 let inner = self.inner.clone();
3018 let fut = async move {
3019 let method = GetServiceInfoSvc(inner);
3020 let codec = tonic_prost::ProstCodec::default();
3021 let mut grpc = tonic::server::Grpc::new(codec)
3022 .apply_compression_config(
3023 accept_compression_encodings,
3024 send_compression_encodings,
3025 )
3026 .apply_max_message_size_config(
3027 max_decoding_message_size,
3028 max_encoding_message_size,
3029 );
3030 let res = grpc.unary(method, req).await;
3031 Ok(res)
3032 };
3033 Box::pin(fut)
3034 }
3035 "/sui.rpc.v2.LedgerService/GetObject" => {
3036 #[allow(non_camel_case_types)]
3037 struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
3038 impl<
3039 T: LedgerService,
3040 > tonic::server::UnaryService<super::GetObjectRequest>
3041 for GetObjectSvc<T> {
3042 type Response = super::GetObjectResponse;
3043 type Future = BoxFuture<
3044 tonic::Response<Self::Response>,
3045 tonic::Status,
3046 >;
3047 fn call(
3048 &mut self,
3049 request: tonic::Request<super::GetObjectRequest>,
3050 ) -> Self::Future {
3051 let inner = Arc::clone(&self.0);
3052 let fut = async move {
3053 <T as LedgerService>::get_object(&inner, request).await
3054 };
3055 Box::pin(fut)
3056 }
3057 }
3058 let accept_compression_encodings = self.accept_compression_encodings;
3059 let send_compression_encodings = self.send_compression_encodings;
3060 let max_decoding_message_size = self.max_decoding_message_size;
3061 let max_encoding_message_size = self.max_encoding_message_size;
3062 let inner = self.inner.clone();
3063 let fut = async move {
3064 let method = GetObjectSvc(inner);
3065 let codec = tonic_prost::ProstCodec::default();
3066 let mut grpc = tonic::server::Grpc::new(codec)
3067 .apply_compression_config(
3068 accept_compression_encodings,
3069 send_compression_encodings,
3070 )
3071 .apply_max_message_size_config(
3072 max_decoding_message_size,
3073 max_encoding_message_size,
3074 );
3075 let res = grpc.unary(method, req).await;
3076 Ok(res)
3077 };
3078 Box::pin(fut)
3079 }
3080 "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
3081 #[allow(non_camel_case_types)]
3082 struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
3083 impl<
3084 T: LedgerService,
3085 > tonic::server::UnaryService<super::BatchGetObjectsRequest>
3086 for BatchGetObjectsSvc<T> {
3087 type Response = super::BatchGetObjectsResponse;
3088 type Future = BoxFuture<
3089 tonic::Response<Self::Response>,
3090 tonic::Status,
3091 >;
3092 fn call(
3093 &mut self,
3094 request: tonic::Request<super::BatchGetObjectsRequest>,
3095 ) -> Self::Future {
3096 let inner = Arc::clone(&self.0);
3097 let fut = async move {
3098 <T as LedgerService>::batch_get_objects(&inner, request)
3099 .await
3100 };
3101 Box::pin(fut)
3102 }
3103 }
3104 let accept_compression_encodings = self.accept_compression_encodings;
3105 let send_compression_encodings = self.send_compression_encodings;
3106 let max_decoding_message_size = self.max_decoding_message_size;
3107 let max_encoding_message_size = self.max_encoding_message_size;
3108 let inner = self.inner.clone();
3109 let fut = async move {
3110 let method = BatchGetObjectsSvc(inner);
3111 let codec = tonic_prost::ProstCodec::default();
3112 let mut grpc = tonic::server::Grpc::new(codec)
3113 .apply_compression_config(
3114 accept_compression_encodings,
3115 send_compression_encodings,
3116 )
3117 .apply_max_message_size_config(
3118 max_decoding_message_size,
3119 max_encoding_message_size,
3120 );
3121 let res = grpc.unary(method, req).await;
3122 Ok(res)
3123 };
3124 Box::pin(fut)
3125 }
3126 "/sui.rpc.v2.LedgerService/GetTransaction" => {
3127 #[allow(non_camel_case_types)]
3128 struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
3129 impl<
3130 T: LedgerService,
3131 > tonic::server::UnaryService<super::GetTransactionRequest>
3132 for GetTransactionSvc<T> {
3133 type Response = super::GetTransactionResponse;
3134 type Future = BoxFuture<
3135 tonic::Response<Self::Response>,
3136 tonic::Status,
3137 >;
3138 fn call(
3139 &mut self,
3140 request: tonic::Request<super::GetTransactionRequest>,
3141 ) -> Self::Future {
3142 let inner = Arc::clone(&self.0);
3143 let fut = async move {
3144 <T as LedgerService>::get_transaction(&inner, request).await
3145 };
3146 Box::pin(fut)
3147 }
3148 }
3149 let accept_compression_encodings = self.accept_compression_encodings;
3150 let send_compression_encodings = self.send_compression_encodings;
3151 let max_decoding_message_size = self.max_decoding_message_size;
3152 let max_encoding_message_size = self.max_encoding_message_size;
3153 let inner = self.inner.clone();
3154 let fut = async move {
3155 let method = GetTransactionSvc(inner);
3156 let codec = tonic_prost::ProstCodec::default();
3157 let mut grpc = tonic::server::Grpc::new(codec)
3158 .apply_compression_config(
3159 accept_compression_encodings,
3160 send_compression_encodings,
3161 )
3162 .apply_max_message_size_config(
3163 max_decoding_message_size,
3164 max_encoding_message_size,
3165 );
3166 let res = grpc.unary(method, req).await;
3167 Ok(res)
3168 };
3169 Box::pin(fut)
3170 }
3171 "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
3172 #[allow(non_camel_case_types)]
3173 struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
3174 impl<
3175 T: LedgerService,
3176 > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
3177 for BatchGetTransactionsSvc<T> {
3178 type Response = super::BatchGetTransactionsResponse;
3179 type Future = BoxFuture<
3180 tonic::Response<Self::Response>,
3181 tonic::Status,
3182 >;
3183 fn call(
3184 &mut self,
3185 request: tonic::Request<super::BatchGetTransactionsRequest>,
3186 ) -> Self::Future {
3187 let inner = Arc::clone(&self.0);
3188 let fut = async move {
3189 <T as LedgerService>::batch_get_transactions(
3190 &inner,
3191 request,
3192 )
3193 .await
3194 };
3195 Box::pin(fut)
3196 }
3197 }
3198 let accept_compression_encodings = self.accept_compression_encodings;
3199 let send_compression_encodings = self.send_compression_encodings;
3200 let max_decoding_message_size = self.max_decoding_message_size;
3201 let max_encoding_message_size = self.max_encoding_message_size;
3202 let inner = self.inner.clone();
3203 let fut = async move {
3204 let method = BatchGetTransactionsSvc(inner);
3205 let codec = tonic_prost::ProstCodec::default();
3206 let mut grpc = tonic::server::Grpc::new(codec)
3207 .apply_compression_config(
3208 accept_compression_encodings,
3209 send_compression_encodings,
3210 )
3211 .apply_max_message_size_config(
3212 max_decoding_message_size,
3213 max_encoding_message_size,
3214 );
3215 let res = grpc.unary(method, req).await;
3216 Ok(res)
3217 };
3218 Box::pin(fut)
3219 }
3220 "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
3221 #[allow(non_camel_case_types)]
3222 struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
3223 impl<
3224 T: LedgerService,
3225 > tonic::server::UnaryService<super::GetCheckpointRequest>
3226 for GetCheckpointSvc<T> {
3227 type Response = super::GetCheckpointResponse;
3228 type Future = BoxFuture<
3229 tonic::Response<Self::Response>,
3230 tonic::Status,
3231 >;
3232 fn call(
3233 &mut self,
3234 request: tonic::Request<super::GetCheckpointRequest>,
3235 ) -> Self::Future {
3236 let inner = Arc::clone(&self.0);
3237 let fut = async move {
3238 <T as LedgerService>::get_checkpoint(&inner, request).await
3239 };
3240 Box::pin(fut)
3241 }
3242 }
3243 let accept_compression_encodings = self.accept_compression_encodings;
3244 let send_compression_encodings = self.send_compression_encodings;
3245 let max_decoding_message_size = self.max_decoding_message_size;
3246 let max_encoding_message_size = self.max_encoding_message_size;
3247 let inner = self.inner.clone();
3248 let fut = async move {
3249 let method = GetCheckpointSvc(inner);
3250 let codec = tonic_prost::ProstCodec::default();
3251 let mut grpc = tonic::server::Grpc::new(codec)
3252 .apply_compression_config(
3253 accept_compression_encodings,
3254 send_compression_encodings,
3255 )
3256 .apply_max_message_size_config(
3257 max_decoding_message_size,
3258 max_encoding_message_size,
3259 );
3260 let res = grpc.unary(method, req).await;
3261 Ok(res)
3262 };
3263 Box::pin(fut)
3264 }
3265 "/sui.rpc.v2.LedgerService/GetEpoch" => {
3266 #[allow(non_camel_case_types)]
3267 struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
3268 impl<
3269 T: LedgerService,
3270 > tonic::server::UnaryService<super::GetEpochRequest>
3271 for GetEpochSvc<T> {
3272 type Response = super::GetEpochResponse;
3273 type Future = BoxFuture<
3274 tonic::Response<Self::Response>,
3275 tonic::Status,
3276 >;
3277 fn call(
3278 &mut self,
3279 request: tonic::Request<super::GetEpochRequest>,
3280 ) -> Self::Future {
3281 let inner = Arc::clone(&self.0);
3282 let fut = async move {
3283 <T as LedgerService>::get_epoch(&inner, request).await
3284 };
3285 Box::pin(fut)
3286 }
3287 }
3288 let accept_compression_encodings = self.accept_compression_encodings;
3289 let send_compression_encodings = self.send_compression_encodings;
3290 let max_decoding_message_size = self.max_decoding_message_size;
3291 let max_encoding_message_size = self.max_encoding_message_size;
3292 let inner = self.inner.clone();
3293 let fut = async move {
3294 let method = GetEpochSvc(inner);
3295 let codec = tonic_prost::ProstCodec::default();
3296 let mut grpc = tonic::server::Grpc::new(codec)
3297 .apply_compression_config(
3298 accept_compression_encodings,
3299 send_compression_encodings,
3300 )
3301 .apply_max_message_size_config(
3302 max_decoding_message_size,
3303 max_encoding_message_size,
3304 );
3305 let res = grpc.unary(method, req).await;
3306 Ok(res)
3307 };
3308 Box::pin(fut)
3309 }
3310 "/sui.rpc.v2.LedgerService/ListCheckpoints" => {
3311 #[allow(non_camel_case_types)]
3312 struct ListCheckpointsSvc<T: LedgerService>(pub Arc<T>);
3313 impl<
3314 T: LedgerService,
3315 > tonic::server::ServerStreamingService<
3316 super::ListCheckpointsRequest,
3317 > for ListCheckpointsSvc<T> {
3318 type Response = super::ListCheckpointsResponse;
3319 type ResponseStream = BoxStream<super::ListCheckpointsResponse>;
3320 type Future = BoxFuture<
3321 tonic::Response<Self::ResponseStream>,
3322 tonic::Status,
3323 >;
3324 fn call(
3325 &mut self,
3326 request: tonic::Request<super::ListCheckpointsRequest>,
3327 ) -> Self::Future {
3328 let inner = Arc::clone(&self.0);
3329 let fut = async move {
3330 <T as LedgerService>::list_checkpoints(&inner, request)
3331 .await
3332 };
3333 Box::pin(fut)
3334 }
3335 }
3336 let accept_compression_encodings = self.accept_compression_encodings;
3337 let send_compression_encodings = self.send_compression_encodings;
3338 let max_decoding_message_size = self.max_decoding_message_size;
3339 let max_encoding_message_size = self.max_encoding_message_size;
3340 let inner = self.inner.clone();
3341 let fut = async move {
3342 let method = ListCheckpointsSvc(inner);
3343 let codec = tonic_prost::ProstCodec::default();
3344 let mut grpc = tonic::server::Grpc::new(codec)
3345 .apply_compression_config(
3346 accept_compression_encodings,
3347 send_compression_encodings,
3348 )
3349 .apply_max_message_size_config(
3350 max_decoding_message_size,
3351 max_encoding_message_size,
3352 );
3353 let res = grpc.server_streaming(method, req).await;
3354 Ok(res)
3355 };
3356 Box::pin(fut)
3357 }
3358 "/sui.rpc.v2.LedgerService/ListTransactions" => {
3359 #[allow(non_camel_case_types)]
3360 struct ListTransactionsSvc<T: LedgerService>(pub Arc<T>);
3361 impl<
3362 T: LedgerService,
3363 > tonic::server::ServerStreamingService<
3364 super::ListTransactionsRequest,
3365 > for ListTransactionsSvc<T> {
3366 type Response = super::ListTransactionsResponse;
3367 type ResponseStream = BoxStream<super::ListTransactionsResponse>;
3368 type Future = BoxFuture<
3369 tonic::Response<Self::ResponseStream>,
3370 tonic::Status,
3371 >;
3372 fn call(
3373 &mut self,
3374 request: tonic::Request<super::ListTransactionsRequest>,
3375 ) -> Self::Future {
3376 let inner = Arc::clone(&self.0);
3377 let fut = async move {
3378 <T as LedgerService>::list_transactions(&inner, request)
3379 .await
3380 };
3381 Box::pin(fut)
3382 }
3383 }
3384 let accept_compression_encodings = self.accept_compression_encodings;
3385 let send_compression_encodings = self.send_compression_encodings;
3386 let max_decoding_message_size = self.max_decoding_message_size;
3387 let max_encoding_message_size = self.max_encoding_message_size;
3388 let inner = self.inner.clone();
3389 let fut = async move {
3390 let method = ListTransactionsSvc(inner);
3391 let codec = tonic_prost::ProstCodec::default();
3392 let mut grpc = tonic::server::Grpc::new(codec)
3393 .apply_compression_config(
3394 accept_compression_encodings,
3395 send_compression_encodings,
3396 )
3397 .apply_max_message_size_config(
3398 max_decoding_message_size,
3399 max_encoding_message_size,
3400 );
3401 let res = grpc.server_streaming(method, req).await;
3402 Ok(res)
3403 };
3404 Box::pin(fut)
3405 }
3406 "/sui.rpc.v2.LedgerService/ListEvents" => {
3407 #[allow(non_camel_case_types)]
3408 struct ListEventsSvc<T: LedgerService>(pub Arc<T>);
3409 impl<
3410 T: LedgerService,
3411 > tonic::server::ServerStreamingService<super::ListEventsRequest>
3412 for ListEventsSvc<T> {
3413 type Response = super::ListEventsResponse;
3414 type ResponseStream = BoxStream<super::ListEventsResponse>;
3415 type Future = BoxFuture<
3416 tonic::Response<Self::ResponseStream>,
3417 tonic::Status,
3418 >;
3419 fn call(
3420 &mut self,
3421 request: tonic::Request<super::ListEventsRequest>,
3422 ) -> Self::Future {
3423 let inner = Arc::clone(&self.0);
3424 let fut = async move {
3425 <T as LedgerService>::list_events(&inner, request).await
3426 };
3427 Box::pin(fut)
3428 }
3429 }
3430 let accept_compression_encodings = self.accept_compression_encodings;
3431 let send_compression_encodings = self.send_compression_encodings;
3432 let max_decoding_message_size = self.max_decoding_message_size;
3433 let max_encoding_message_size = self.max_encoding_message_size;
3434 let inner = self.inner.clone();
3435 let fut = async move {
3436 let method = ListEventsSvc(inner);
3437 let codec = tonic_prost::ProstCodec::default();
3438 let mut grpc = tonic::server::Grpc::new(codec)
3439 .apply_compression_config(
3440 accept_compression_encodings,
3441 send_compression_encodings,
3442 )
3443 .apply_max_message_size_config(
3444 max_decoding_message_size,
3445 max_encoding_message_size,
3446 );
3447 let res = grpc.server_streaming(method, req).await;
3448 Ok(res)
3449 };
3450 Box::pin(fut)
3451 }
3452 _ => {
3453 Box::pin(async move {
3454 let mut response = http::Response::new(
3455 tonic::body::Body::default(),
3456 );
3457 let headers = response.headers_mut();
3458 headers
3459 .insert(
3460 tonic::Status::GRPC_STATUS,
3461 (tonic::Code::Unimplemented as i32).into(),
3462 );
3463 headers
3464 .insert(
3465 http::header::CONTENT_TYPE,
3466 tonic::metadata::GRPC_CONTENT_TYPE,
3467 );
3468 Ok(response)
3469 })
3470 }
3471 }
3472 }
3473 }
3474 impl<T> Clone for LedgerServiceServer<T> {
3475 fn clone(&self) -> Self {
3476 let inner = self.inner.clone();
3477 Self {
3478 inner,
3479 accept_compression_encodings: self.accept_compression_encodings,
3480 send_compression_encodings: self.send_compression_encodings,
3481 max_decoding_message_size: self.max_decoding_message_size,
3482 max_encoding_message_size: self.max_encoding_message_size,
3483 }
3484 }
3485 }
3486 pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
3488 impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
3489 const NAME: &'static str = SERVICE_NAME;
3490 }
3491}
3492#[non_exhaustive]
3494#[derive(Clone, PartialEq, ::prost::Message)]
3495pub struct Package {
3496 #[prost(string, optional, tag = "1")]
3502 pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
3503 #[prost(string, optional, tag = "2")]
3510 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3511 #[prost(uint64, optional, tag = "3")]
3513 pub version: ::core::option::Option<u64>,
3514 #[prost(message, repeated, tag = "4")]
3516 pub modules: ::prost::alloc::vec::Vec<Module>,
3517 #[prost(message, repeated, tag = "5")]
3520 pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
3521 #[prost(message, repeated, tag = "6")]
3525 pub linkage: ::prost::alloc::vec::Vec<Linkage>,
3526}
3527#[non_exhaustive]
3529#[derive(Clone, PartialEq, ::prost::Message)]
3530pub struct Module {
3531 #[prost(string, optional, tag = "1")]
3533 pub name: ::core::option::Option<::prost::alloc::string::String>,
3534 #[prost(bytes = "bytes", optional, tag = "2")]
3536 pub contents: ::core::option::Option<::prost::bytes::Bytes>,
3537 #[prost(message, repeated, tag = "3")]
3539 pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
3540 #[prost(message, repeated, tag = "4")]
3542 pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
3543}
3544#[non_exhaustive]
3546#[derive(Clone, PartialEq, ::prost::Message)]
3547pub struct DatatypeDescriptor {
3548 #[prost(string, optional, tag = "1")]
3552 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3553 #[prost(string, optional, tag = "2")]
3557 pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
3558 #[prost(string, optional, tag = "3")]
3560 pub module: ::core::option::Option<::prost::alloc::string::String>,
3561 #[prost(string, optional, tag = "4")]
3563 pub name: ::core::option::Option<::prost::alloc::string::String>,
3564 #[prost(enumeration = "Ability", repeated, tag = "5")]
3566 pub abilities: ::prost::alloc::vec::Vec<i32>,
3567 #[prost(message, repeated, tag = "6")]
3569 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3570 #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
3572 pub kind: ::core::option::Option<i32>,
3573 #[prost(message, repeated, tag = "8")]
3577 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3578 #[prost(message, repeated, tag = "9")]
3582 pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
3583}
3584pub mod datatype_descriptor {
3586 #[non_exhaustive]
3587 #[derive(
3588 Clone,
3589 Copy,
3590 Debug,
3591 PartialEq,
3592 Eq,
3593 Hash,
3594 PartialOrd,
3595 Ord,
3596 ::prost::Enumeration
3597 )]
3598 #[repr(i32)]
3599 pub enum DatatypeKind {
3600 Unknown = 0,
3601 Struct = 1,
3602 Enum = 2,
3603 }
3604 impl DatatypeKind {
3605 pub fn as_str_name(&self) -> &'static str {
3610 match self {
3611 Self::Unknown => "DATATYPE_KIND_UNKNOWN",
3612 Self::Struct => "STRUCT",
3613 Self::Enum => "ENUM",
3614 }
3615 }
3616 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3618 match value {
3619 "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
3620 "STRUCT" => Some(Self::Struct),
3621 "ENUM" => Some(Self::Enum),
3622 _ => None,
3623 }
3624 }
3625 }
3626}
3627#[non_exhaustive]
3629#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3630pub struct TypeParameter {
3631 #[prost(enumeration = "Ability", repeated, tag = "1")]
3633 pub constraints: ::prost::alloc::vec::Vec<i32>,
3634 #[prost(bool, optional, tag = "2")]
3636 pub is_phantom: ::core::option::Option<bool>,
3637}
3638#[non_exhaustive]
3640#[derive(Clone, PartialEq, ::prost::Message)]
3641pub struct FieldDescriptor {
3642 #[prost(string, optional, tag = "1")]
3644 pub name: ::core::option::Option<::prost::alloc::string::String>,
3645 #[prost(uint32, optional, tag = "2")]
3647 pub position: ::core::option::Option<u32>,
3648 #[prost(message, optional, tag = "3")]
3650 pub r#type: ::core::option::Option<OpenSignatureBody>,
3651}
3652#[non_exhaustive]
3654#[derive(Clone, PartialEq, ::prost::Message)]
3655pub struct VariantDescriptor {
3656 #[prost(string, optional, tag = "1")]
3658 pub name: ::core::option::Option<::prost::alloc::string::String>,
3659 #[prost(uint32, optional, tag = "2")]
3661 pub position: ::core::option::Option<u32>,
3662 #[prost(message, repeated, tag = "3")]
3664 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3665}
3666#[non_exhaustive]
3668#[derive(Clone, PartialEq, ::prost::Message)]
3669pub struct OpenSignatureBody {
3670 #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
3672 pub r#type: ::core::option::Option<i32>,
3673 #[prost(string, optional, tag = "2")]
3675 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3676 #[prost(message, repeated, tag = "3")]
3678 pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
3679 #[prost(uint32, optional, tag = "4")]
3681 pub type_parameter: ::core::option::Option<u32>,
3682}
3683pub mod open_signature_body {
3685 #[non_exhaustive]
3686 #[derive(
3687 Clone,
3688 Copy,
3689 Debug,
3690 PartialEq,
3691 Eq,
3692 Hash,
3693 PartialOrd,
3694 Ord,
3695 ::prost::Enumeration
3696 )]
3697 #[repr(i32)]
3698 pub enum Type {
3699 Unknown = 0,
3700 Address = 1,
3701 Bool = 2,
3702 U8 = 3,
3703 U16 = 4,
3704 U32 = 5,
3705 U64 = 6,
3706 U128 = 7,
3707 U256 = 8,
3708 Vector = 9,
3709 Datatype = 10,
3710 Parameter = 11,
3711 }
3712 impl Type {
3713 pub fn as_str_name(&self) -> &'static str {
3718 match self {
3719 Self::Unknown => "TYPE_UNKNOWN",
3720 Self::Address => "ADDRESS",
3721 Self::Bool => "BOOL",
3722 Self::U8 => "U8",
3723 Self::U16 => "U16",
3724 Self::U32 => "U32",
3725 Self::U64 => "U64",
3726 Self::U128 => "U128",
3727 Self::U256 => "U256",
3728 Self::Vector => "VECTOR",
3729 Self::Datatype => "DATATYPE",
3730 Self::Parameter => "TYPE_PARAMETER",
3731 }
3732 }
3733 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3735 match value {
3736 "TYPE_UNKNOWN" => Some(Self::Unknown),
3737 "ADDRESS" => Some(Self::Address),
3738 "BOOL" => Some(Self::Bool),
3739 "U8" => Some(Self::U8),
3740 "U16" => Some(Self::U16),
3741 "U32" => Some(Self::U32),
3742 "U64" => Some(Self::U64),
3743 "U128" => Some(Self::U128),
3744 "U256" => Some(Self::U256),
3745 "VECTOR" => Some(Self::Vector),
3746 "DATATYPE" => Some(Self::Datatype),
3747 "TYPE_PARAMETER" => Some(Self::Parameter),
3748 _ => None,
3749 }
3750 }
3751 }
3752}
3753#[non_exhaustive]
3755#[derive(Clone, PartialEq, ::prost::Message)]
3756pub struct FunctionDescriptor {
3757 #[prost(string, optional, tag = "1")]
3759 pub name: ::core::option::Option<::prost::alloc::string::String>,
3760 #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
3762 pub visibility: ::core::option::Option<i32>,
3763 #[prost(bool, optional, tag = "6")]
3765 pub is_entry: ::core::option::Option<bool>,
3766 #[prost(message, repeated, tag = "7")]
3768 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3769 #[prost(message, repeated, tag = "8")]
3771 pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
3772 #[prost(message, repeated, tag = "9")]
3774 pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
3775}
3776pub mod function_descriptor {
3778 #[non_exhaustive]
3779 #[derive(
3780 Clone,
3781 Copy,
3782 Debug,
3783 PartialEq,
3784 Eq,
3785 Hash,
3786 PartialOrd,
3787 Ord,
3788 ::prost::Enumeration
3789 )]
3790 #[repr(i32)]
3791 pub enum Visibility {
3792 Unknown = 0,
3793 Private = 1,
3794 Public = 2,
3795 Friend = 3,
3796 }
3797 impl Visibility {
3798 pub fn as_str_name(&self) -> &'static str {
3803 match self {
3804 Self::Unknown => "VISIBILITY_UNKNOWN",
3805 Self::Private => "PRIVATE",
3806 Self::Public => "PUBLIC",
3807 Self::Friend => "FRIEND",
3808 }
3809 }
3810 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3812 match value {
3813 "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
3814 "PRIVATE" => Some(Self::Private),
3815 "PUBLIC" => Some(Self::Public),
3816 "FRIEND" => Some(Self::Friend),
3817 _ => None,
3818 }
3819 }
3820 }
3821}
3822#[non_exhaustive]
3824#[derive(Clone, PartialEq, ::prost::Message)]
3825pub struct OpenSignature {
3826 #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
3827 pub reference: ::core::option::Option<i32>,
3828 #[prost(message, optional, tag = "2")]
3829 pub body: ::core::option::Option<OpenSignatureBody>,
3830}
3831pub mod open_signature {
3833 #[non_exhaustive]
3834 #[derive(
3835 Clone,
3836 Copy,
3837 Debug,
3838 PartialEq,
3839 Eq,
3840 Hash,
3841 PartialOrd,
3842 Ord,
3843 ::prost::Enumeration
3844 )]
3845 #[repr(i32)]
3846 pub enum Reference {
3847 Unknown = 0,
3848 Immutable = 1,
3849 Mutable = 2,
3850 }
3851 impl Reference {
3852 pub fn as_str_name(&self) -> &'static str {
3857 match self {
3858 Self::Unknown => "REFERENCE_UNKNOWN",
3859 Self::Immutable => "IMMUTABLE",
3860 Self::Mutable => "MUTABLE",
3861 }
3862 }
3863 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3865 match value {
3866 "REFERENCE_UNKNOWN" => Some(Self::Unknown),
3867 "IMMUTABLE" => Some(Self::Immutable),
3868 "MUTABLE" => Some(Self::Mutable),
3869 _ => None,
3870 }
3871 }
3872 }
3873}
3874#[non_exhaustive]
3876#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3877pub struct TypeOrigin {
3878 #[prost(string, optional, tag = "1")]
3879 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3880 #[prost(string, optional, tag = "2")]
3881 pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
3882 #[prost(string, optional, tag = "3")]
3883 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3884}
3885#[non_exhaustive]
3887#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3888pub struct Linkage {
3889 #[prost(string, optional, tag = "1")]
3891 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3892 #[prost(string, optional, tag = "2")]
3894 pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
3895 #[prost(uint64, optional, tag = "3")]
3897 pub upgraded_version: ::core::option::Option<u64>,
3898}
3899#[non_exhaustive]
3901#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3902#[repr(i32)]
3903pub enum Ability {
3904 Unknown = 0,
3905 Copy = 1,
3907 Drop = 2,
3909 Store = 3,
3911 Key = 4,
3913}
3914impl Ability {
3915 pub fn as_str_name(&self) -> &'static str {
3920 match self {
3921 Self::Unknown => "ABILITY_UNKNOWN",
3922 Self::Copy => "COPY",
3923 Self::Drop => "DROP",
3924 Self::Store => "STORE",
3925 Self::Key => "KEY",
3926 }
3927 }
3928 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3930 match value {
3931 "ABILITY_UNKNOWN" => Some(Self::Unknown),
3932 "COPY" => Some(Self::Copy),
3933 "DROP" => Some(Self::Drop),
3934 "STORE" => Some(Self::Store),
3935 "KEY" => Some(Self::Key),
3936 _ => None,
3937 }
3938 }
3939}
3940#[non_exhaustive]
3941#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3942pub struct GetPackageRequest {
3943 #[prost(string, optional, tag = "1")]
3945 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3946}
3947#[non_exhaustive]
3948#[derive(Clone, PartialEq, ::prost::Message)]
3949pub struct GetPackageResponse {
3950 #[prost(message, optional, tag = "1")]
3952 pub package: ::core::option::Option<Package>,
3953}
3954#[non_exhaustive]
3955#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3956pub struct GetDatatypeRequest {
3957 #[prost(string, optional, tag = "1")]
3959 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3960 #[prost(string, optional, tag = "2")]
3962 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3963 #[prost(string, optional, tag = "3")]
3965 pub name: ::core::option::Option<::prost::alloc::string::String>,
3966}
3967#[non_exhaustive]
3968#[derive(Clone, PartialEq, ::prost::Message)]
3969pub struct GetDatatypeResponse {
3970 #[prost(message, optional, tag = "1")]
3972 pub datatype: ::core::option::Option<DatatypeDescriptor>,
3973}
3974#[non_exhaustive]
3975#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3976pub struct GetFunctionRequest {
3977 #[prost(string, optional, tag = "1")]
3979 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3980 #[prost(string, optional, tag = "2")]
3982 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3983 #[prost(string, optional, tag = "3")]
3985 pub name: ::core::option::Option<::prost::alloc::string::String>,
3986}
3987#[non_exhaustive]
3988#[derive(Clone, PartialEq, ::prost::Message)]
3989pub struct GetFunctionResponse {
3990 #[prost(message, optional, tag = "1")]
3992 pub function: ::core::option::Option<FunctionDescriptor>,
3993}
3994#[non_exhaustive]
3995#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3996pub struct ListPackageVersionsRequest {
3997 #[prost(string, optional, tag = "1")]
3999 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4000 #[prost(uint32, optional, tag = "2")]
4004 pub page_size: ::core::option::Option<u32>,
4005 #[prost(bytes = "bytes", optional, tag = "3")]
4011 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
4012}
4013#[non_exhaustive]
4014#[derive(Clone, PartialEq, ::prost::Message)]
4015pub struct ListPackageVersionsResponse {
4016 #[prost(message, repeated, tag = "1")]
4018 pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
4019 #[prost(bytes = "bytes", optional, tag = "2")]
4022 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
4023}
4024#[non_exhaustive]
4026#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4027pub struct PackageVersion {
4028 #[prost(string, optional, tag = "1")]
4030 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4031 #[prost(uint64, optional, tag = "2")]
4033 pub version: ::core::option::Option<u64>,
4034}
4035pub mod move_package_service_client {
4037 #![allow(
4038 unused_variables,
4039 dead_code,
4040 missing_docs,
4041 clippy::wildcard_imports,
4042 clippy::let_unit_value,
4043 )]
4044 use tonic::codegen::*;
4045 use tonic::codegen::http::Uri;
4046 #[derive(Debug, Clone)]
4047 pub struct MovePackageServiceClient<T> {
4048 inner: tonic::client::Grpc<T>,
4049 }
4050 impl MovePackageServiceClient<tonic::transport::Channel> {
4051 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4053 where
4054 D: TryInto<tonic::transport::Endpoint>,
4055 D::Error: Into<StdError>,
4056 {
4057 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4058 Ok(Self::new(conn))
4059 }
4060 }
4061 impl<T> MovePackageServiceClient<T>
4062 where
4063 T: tonic::client::GrpcService<tonic::body::Body>,
4064 T::Error: Into<StdError>,
4065 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4066 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4067 {
4068 pub fn new(inner: T) -> Self {
4069 let inner = tonic::client::Grpc::new(inner);
4070 Self { inner }
4071 }
4072 pub fn with_origin(inner: T, origin: Uri) -> Self {
4073 let inner = tonic::client::Grpc::with_origin(inner, origin);
4074 Self { inner }
4075 }
4076 pub fn with_interceptor<F>(
4077 inner: T,
4078 interceptor: F,
4079 ) -> MovePackageServiceClient<InterceptedService<T, F>>
4080 where
4081 F: tonic::service::Interceptor,
4082 T::ResponseBody: Default,
4083 T: tonic::codegen::Service<
4084 http::Request<tonic::body::Body>,
4085 Response = http::Response<
4086 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4087 >,
4088 >,
4089 <T as tonic::codegen::Service<
4090 http::Request<tonic::body::Body>,
4091 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4092 {
4093 MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
4094 }
4095 #[must_use]
4100 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4101 self.inner = self.inner.send_compressed(encoding);
4102 self
4103 }
4104 #[must_use]
4106 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4107 self.inner = self.inner.accept_compressed(encoding);
4108 self
4109 }
4110 #[must_use]
4114 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4115 self.inner = self.inner.max_decoding_message_size(limit);
4116 self
4117 }
4118 #[must_use]
4122 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4123 self.inner = self.inner.max_encoding_message_size(limit);
4124 self
4125 }
4126 pub async fn get_package(
4127 &mut self,
4128 request: impl tonic::IntoRequest<super::GetPackageRequest>,
4129 ) -> std::result::Result<
4130 tonic::Response<super::GetPackageResponse>,
4131 tonic::Status,
4132 > {
4133 self.inner
4134 .ready()
4135 .await
4136 .map_err(|e| {
4137 tonic::Status::unknown(
4138 format!("Service was not ready: {}", e.into()),
4139 )
4140 })?;
4141 let codec = tonic_prost::ProstCodec::default();
4142 let path = http::uri::PathAndQuery::from_static(
4143 "/sui.rpc.v2.MovePackageService/GetPackage",
4144 );
4145 let mut req = request.into_request();
4146 req.extensions_mut()
4147 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
4148 self.inner.unary(req, path, codec).await
4149 }
4150 pub async fn get_datatype(
4151 &mut self,
4152 request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
4153 ) -> std::result::Result<
4154 tonic::Response<super::GetDatatypeResponse>,
4155 tonic::Status,
4156 > {
4157 self.inner
4158 .ready()
4159 .await
4160 .map_err(|e| {
4161 tonic::Status::unknown(
4162 format!("Service was not ready: {}", e.into()),
4163 )
4164 })?;
4165 let codec = tonic_prost::ProstCodec::default();
4166 let path = http::uri::PathAndQuery::from_static(
4167 "/sui.rpc.v2.MovePackageService/GetDatatype",
4168 );
4169 let mut req = request.into_request();
4170 req.extensions_mut()
4171 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
4172 self.inner.unary(req, path, codec).await
4173 }
4174 pub async fn get_function(
4175 &mut self,
4176 request: impl tonic::IntoRequest<super::GetFunctionRequest>,
4177 ) -> std::result::Result<
4178 tonic::Response<super::GetFunctionResponse>,
4179 tonic::Status,
4180 > {
4181 self.inner
4182 .ready()
4183 .await
4184 .map_err(|e| {
4185 tonic::Status::unknown(
4186 format!("Service was not ready: {}", e.into()),
4187 )
4188 })?;
4189 let codec = tonic_prost::ProstCodec::default();
4190 let path = http::uri::PathAndQuery::from_static(
4191 "/sui.rpc.v2.MovePackageService/GetFunction",
4192 );
4193 let mut req = request.into_request();
4194 req.extensions_mut()
4195 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
4196 self.inner.unary(req, path, codec).await
4197 }
4198 pub async fn list_package_versions(
4199 &mut self,
4200 request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
4201 ) -> std::result::Result<
4202 tonic::Response<super::ListPackageVersionsResponse>,
4203 tonic::Status,
4204 > {
4205 self.inner
4206 .ready()
4207 .await
4208 .map_err(|e| {
4209 tonic::Status::unknown(
4210 format!("Service was not ready: {}", e.into()),
4211 )
4212 })?;
4213 let codec = tonic_prost::ProstCodec::default();
4214 let path = http::uri::PathAndQuery::from_static(
4215 "/sui.rpc.v2.MovePackageService/ListPackageVersions",
4216 );
4217 let mut req = request.into_request();
4218 req.extensions_mut()
4219 .insert(
4220 GrpcMethod::new(
4221 "sui.rpc.v2.MovePackageService",
4222 "ListPackageVersions",
4223 ),
4224 );
4225 self.inner.unary(req, path, codec).await
4226 }
4227 }
4228}
4229pub mod move_package_service_server {
4231 #![allow(
4232 unused_variables,
4233 dead_code,
4234 missing_docs,
4235 clippy::wildcard_imports,
4236 clippy::let_unit_value,
4237 )]
4238 use tonic::codegen::*;
4239 #[async_trait]
4241 pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
4242 async fn get_package(
4243 &self,
4244 request: tonic::Request<super::GetPackageRequest>,
4245 ) -> std::result::Result<
4246 tonic::Response<super::GetPackageResponse>,
4247 tonic::Status,
4248 > {
4249 Err(tonic::Status::unimplemented("Not yet implemented"))
4250 }
4251 async fn get_datatype(
4252 &self,
4253 request: tonic::Request<super::GetDatatypeRequest>,
4254 ) -> std::result::Result<
4255 tonic::Response<super::GetDatatypeResponse>,
4256 tonic::Status,
4257 > {
4258 Err(tonic::Status::unimplemented("Not yet implemented"))
4259 }
4260 async fn get_function(
4261 &self,
4262 request: tonic::Request<super::GetFunctionRequest>,
4263 ) -> std::result::Result<
4264 tonic::Response<super::GetFunctionResponse>,
4265 tonic::Status,
4266 > {
4267 Err(tonic::Status::unimplemented("Not yet implemented"))
4268 }
4269 async fn list_package_versions(
4270 &self,
4271 request: tonic::Request<super::ListPackageVersionsRequest>,
4272 ) -> std::result::Result<
4273 tonic::Response<super::ListPackageVersionsResponse>,
4274 tonic::Status,
4275 > {
4276 Err(tonic::Status::unimplemented("Not yet implemented"))
4277 }
4278 }
4279 #[derive(Debug)]
4280 pub struct MovePackageServiceServer<T> {
4281 inner: Arc<T>,
4282 accept_compression_encodings: EnabledCompressionEncodings,
4283 send_compression_encodings: EnabledCompressionEncodings,
4284 max_decoding_message_size: Option<usize>,
4285 max_encoding_message_size: Option<usize>,
4286 }
4287 impl<T> MovePackageServiceServer<T> {
4288 pub fn new(inner: T) -> Self {
4289 Self::from_arc(Arc::new(inner))
4290 }
4291 pub fn from_arc(inner: Arc<T>) -> Self {
4292 Self {
4293 inner,
4294 accept_compression_encodings: Default::default(),
4295 send_compression_encodings: Default::default(),
4296 max_decoding_message_size: None,
4297 max_encoding_message_size: None,
4298 }
4299 }
4300 pub fn with_interceptor<F>(
4301 inner: T,
4302 interceptor: F,
4303 ) -> InterceptedService<Self, F>
4304 where
4305 F: tonic::service::Interceptor,
4306 {
4307 InterceptedService::new(Self::new(inner), interceptor)
4308 }
4309 #[must_use]
4311 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4312 self.accept_compression_encodings.enable(encoding);
4313 self
4314 }
4315 #[must_use]
4317 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4318 self.send_compression_encodings.enable(encoding);
4319 self
4320 }
4321 #[must_use]
4325 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4326 self.max_decoding_message_size = Some(limit);
4327 self
4328 }
4329 #[must_use]
4333 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4334 self.max_encoding_message_size = Some(limit);
4335 self
4336 }
4337 }
4338 impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
4339 where
4340 T: MovePackageService,
4341 B: Body + std::marker::Send + 'static,
4342 B::Error: Into<StdError> + std::marker::Send + 'static,
4343 {
4344 type Response = http::Response<tonic::body::Body>;
4345 type Error = std::convert::Infallible;
4346 type Future = BoxFuture<Self::Response, Self::Error>;
4347 fn poll_ready(
4348 &mut self,
4349 _cx: &mut Context<'_>,
4350 ) -> Poll<std::result::Result<(), Self::Error>> {
4351 Poll::Ready(Ok(()))
4352 }
4353 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4354 match req.uri().path() {
4355 "/sui.rpc.v2.MovePackageService/GetPackage" => {
4356 #[allow(non_camel_case_types)]
4357 struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
4358 impl<
4359 T: MovePackageService,
4360 > tonic::server::UnaryService<super::GetPackageRequest>
4361 for GetPackageSvc<T> {
4362 type Response = super::GetPackageResponse;
4363 type Future = BoxFuture<
4364 tonic::Response<Self::Response>,
4365 tonic::Status,
4366 >;
4367 fn call(
4368 &mut self,
4369 request: tonic::Request<super::GetPackageRequest>,
4370 ) -> Self::Future {
4371 let inner = Arc::clone(&self.0);
4372 let fut = async move {
4373 <T as MovePackageService>::get_package(&inner, request)
4374 .await
4375 };
4376 Box::pin(fut)
4377 }
4378 }
4379 let accept_compression_encodings = self.accept_compression_encodings;
4380 let send_compression_encodings = self.send_compression_encodings;
4381 let max_decoding_message_size = self.max_decoding_message_size;
4382 let max_encoding_message_size = self.max_encoding_message_size;
4383 let inner = self.inner.clone();
4384 let fut = async move {
4385 let method = GetPackageSvc(inner);
4386 let codec = tonic_prost::ProstCodec::default();
4387 let mut grpc = tonic::server::Grpc::new(codec)
4388 .apply_compression_config(
4389 accept_compression_encodings,
4390 send_compression_encodings,
4391 )
4392 .apply_max_message_size_config(
4393 max_decoding_message_size,
4394 max_encoding_message_size,
4395 );
4396 let res = grpc.unary(method, req).await;
4397 Ok(res)
4398 };
4399 Box::pin(fut)
4400 }
4401 "/sui.rpc.v2.MovePackageService/GetDatatype" => {
4402 #[allow(non_camel_case_types)]
4403 struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
4404 impl<
4405 T: MovePackageService,
4406 > tonic::server::UnaryService<super::GetDatatypeRequest>
4407 for GetDatatypeSvc<T> {
4408 type Response = super::GetDatatypeResponse;
4409 type Future = BoxFuture<
4410 tonic::Response<Self::Response>,
4411 tonic::Status,
4412 >;
4413 fn call(
4414 &mut self,
4415 request: tonic::Request<super::GetDatatypeRequest>,
4416 ) -> Self::Future {
4417 let inner = Arc::clone(&self.0);
4418 let fut = async move {
4419 <T as MovePackageService>::get_datatype(&inner, request)
4420 .await
4421 };
4422 Box::pin(fut)
4423 }
4424 }
4425 let accept_compression_encodings = self.accept_compression_encodings;
4426 let send_compression_encodings = self.send_compression_encodings;
4427 let max_decoding_message_size = self.max_decoding_message_size;
4428 let max_encoding_message_size = self.max_encoding_message_size;
4429 let inner = self.inner.clone();
4430 let fut = async move {
4431 let method = GetDatatypeSvc(inner);
4432 let codec = tonic_prost::ProstCodec::default();
4433 let mut grpc = tonic::server::Grpc::new(codec)
4434 .apply_compression_config(
4435 accept_compression_encodings,
4436 send_compression_encodings,
4437 )
4438 .apply_max_message_size_config(
4439 max_decoding_message_size,
4440 max_encoding_message_size,
4441 );
4442 let res = grpc.unary(method, req).await;
4443 Ok(res)
4444 };
4445 Box::pin(fut)
4446 }
4447 "/sui.rpc.v2.MovePackageService/GetFunction" => {
4448 #[allow(non_camel_case_types)]
4449 struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
4450 impl<
4451 T: MovePackageService,
4452 > tonic::server::UnaryService<super::GetFunctionRequest>
4453 for GetFunctionSvc<T> {
4454 type Response = super::GetFunctionResponse;
4455 type Future = BoxFuture<
4456 tonic::Response<Self::Response>,
4457 tonic::Status,
4458 >;
4459 fn call(
4460 &mut self,
4461 request: tonic::Request<super::GetFunctionRequest>,
4462 ) -> Self::Future {
4463 let inner = Arc::clone(&self.0);
4464 let fut = async move {
4465 <T as MovePackageService>::get_function(&inner, request)
4466 .await
4467 };
4468 Box::pin(fut)
4469 }
4470 }
4471 let accept_compression_encodings = self.accept_compression_encodings;
4472 let send_compression_encodings = self.send_compression_encodings;
4473 let max_decoding_message_size = self.max_decoding_message_size;
4474 let max_encoding_message_size = self.max_encoding_message_size;
4475 let inner = self.inner.clone();
4476 let fut = async move {
4477 let method = GetFunctionSvc(inner);
4478 let codec = tonic_prost::ProstCodec::default();
4479 let mut grpc = tonic::server::Grpc::new(codec)
4480 .apply_compression_config(
4481 accept_compression_encodings,
4482 send_compression_encodings,
4483 )
4484 .apply_max_message_size_config(
4485 max_decoding_message_size,
4486 max_encoding_message_size,
4487 );
4488 let res = grpc.unary(method, req).await;
4489 Ok(res)
4490 };
4491 Box::pin(fut)
4492 }
4493 "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
4494 #[allow(non_camel_case_types)]
4495 struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
4496 impl<
4497 T: MovePackageService,
4498 > tonic::server::UnaryService<super::ListPackageVersionsRequest>
4499 for ListPackageVersionsSvc<T> {
4500 type Response = super::ListPackageVersionsResponse;
4501 type Future = BoxFuture<
4502 tonic::Response<Self::Response>,
4503 tonic::Status,
4504 >;
4505 fn call(
4506 &mut self,
4507 request: tonic::Request<super::ListPackageVersionsRequest>,
4508 ) -> Self::Future {
4509 let inner = Arc::clone(&self.0);
4510 let fut = async move {
4511 <T as MovePackageService>::list_package_versions(
4512 &inner,
4513 request,
4514 )
4515 .await
4516 };
4517 Box::pin(fut)
4518 }
4519 }
4520 let accept_compression_encodings = self.accept_compression_encodings;
4521 let send_compression_encodings = self.send_compression_encodings;
4522 let max_decoding_message_size = self.max_decoding_message_size;
4523 let max_encoding_message_size = self.max_encoding_message_size;
4524 let inner = self.inner.clone();
4525 let fut = async move {
4526 let method = ListPackageVersionsSvc(inner);
4527 let codec = tonic_prost::ProstCodec::default();
4528 let mut grpc = tonic::server::Grpc::new(codec)
4529 .apply_compression_config(
4530 accept_compression_encodings,
4531 send_compression_encodings,
4532 )
4533 .apply_max_message_size_config(
4534 max_decoding_message_size,
4535 max_encoding_message_size,
4536 );
4537 let res = grpc.unary(method, req).await;
4538 Ok(res)
4539 };
4540 Box::pin(fut)
4541 }
4542 _ => {
4543 Box::pin(async move {
4544 let mut response = http::Response::new(
4545 tonic::body::Body::default(),
4546 );
4547 let headers = response.headers_mut();
4548 headers
4549 .insert(
4550 tonic::Status::GRPC_STATUS,
4551 (tonic::Code::Unimplemented as i32).into(),
4552 );
4553 headers
4554 .insert(
4555 http::header::CONTENT_TYPE,
4556 tonic::metadata::GRPC_CONTENT_TYPE,
4557 );
4558 Ok(response)
4559 })
4560 }
4561 }
4562 }
4563 }
4564 impl<T> Clone for MovePackageServiceServer<T> {
4565 fn clone(&self) -> Self {
4566 let inner = self.inner.clone();
4567 Self {
4568 inner,
4569 accept_compression_encodings: self.accept_compression_encodings,
4570 send_compression_encodings: self.send_compression_encodings,
4571 max_decoding_message_size: self.max_decoding_message_size,
4572 max_encoding_message_size: self.max_encoding_message_size,
4573 }
4574 }
4575 }
4576 pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
4578 impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
4579 const NAME: &'static str = SERVICE_NAME;
4580 }
4581}
4582#[non_exhaustive]
4583#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4584pub struct LookupNameRequest {
4585 #[prost(string, optional, tag = "1")]
4589 pub name: ::core::option::Option<::prost::alloc::string::String>,
4590}
4591#[non_exhaustive]
4592#[derive(Clone, PartialEq, ::prost::Message)]
4593pub struct LookupNameResponse {
4594 #[prost(message, optional, tag = "1")]
4596 pub record: ::core::option::Option<NameRecord>,
4597}
4598#[non_exhaustive]
4599#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4600pub struct ReverseLookupNameRequest {
4601 #[prost(string, optional, tag = "1")]
4603 pub address: ::core::option::Option<::prost::alloc::string::String>,
4604}
4605#[non_exhaustive]
4606#[derive(Clone, PartialEq, ::prost::Message)]
4607pub struct ReverseLookupNameResponse {
4608 #[prost(message, optional, tag = "1")]
4610 pub record: ::core::option::Option<NameRecord>,
4611}
4612#[non_exhaustive]
4613#[derive(Clone, PartialEq, ::prost::Message)]
4614pub struct NameRecord {
4615 #[prost(string, optional, tag = "1")]
4620 pub id: ::core::option::Option<::prost::alloc::string::String>,
4621 #[prost(string, optional, tag = "2")]
4623 pub name: ::core::option::Option<::prost::alloc::string::String>,
4624 #[prost(string, optional, tag = "3")]
4632 pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
4633 #[prost(message, optional, tag = "4")]
4638 pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
4639 #[prost(string, optional, tag = "5")]
4641 pub target_address: ::core::option::Option<::prost::alloc::string::String>,
4642 #[prost(btree_map = "string, string", tag = "6")]
4644 pub data: ::prost::alloc::collections::BTreeMap<
4645 ::prost::alloc::string::String,
4646 ::prost::alloc::string::String,
4647 >,
4648}
4649pub mod name_service_client {
4651 #![allow(
4652 unused_variables,
4653 dead_code,
4654 missing_docs,
4655 clippy::wildcard_imports,
4656 clippy::let_unit_value,
4657 )]
4658 use tonic::codegen::*;
4659 use tonic::codegen::http::Uri;
4660 #[derive(Debug, Clone)]
4661 pub struct NameServiceClient<T> {
4662 inner: tonic::client::Grpc<T>,
4663 }
4664 impl NameServiceClient<tonic::transport::Channel> {
4665 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4667 where
4668 D: TryInto<tonic::transport::Endpoint>,
4669 D::Error: Into<StdError>,
4670 {
4671 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4672 Ok(Self::new(conn))
4673 }
4674 }
4675 impl<T> NameServiceClient<T>
4676 where
4677 T: tonic::client::GrpcService<tonic::body::Body>,
4678 T::Error: Into<StdError>,
4679 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4680 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4681 {
4682 pub fn new(inner: T) -> Self {
4683 let inner = tonic::client::Grpc::new(inner);
4684 Self { inner }
4685 }
4686 pub fn with_origin(inner: T, origin: Uri) -> Self {
4687 let inner = tonic::client::Grpc::with_origin(inner, origin);
4688 Self { inner }
4689 }
4690 pub fn with_interceptor<F>(
4691 inner: T,
4692 interceptor: F,
4693 ) -> NameServiceClient<InterceptedService<T, F>>
4694 where
4695 F: tonic::service::Interceptor,
4696 T::ResponseBody: Default,
4697 T: tonic::codegen::Service<
4698 http::Request<tonic::body::Body>,
4699 Response = http::Response<
4700 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4701 >,
4702 >,
4703 <T as tonic::codegen::Service<
4704 http::Request<tonic::body::Body>,
4705 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4706 {
4707 NameServiceClient::new(InterceptedService::new(inner, interceptor))
4708 }
4709 #[must_use]
4714 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4715 self.inner = self.inner.send_compressed(encoding);
4716 self
4717 }
4718 #[must_use]
4720 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4721 self.inner = self.inner.accept_compressed(encoding);
4722 self
4723 }
4724 #[must_use]
4728 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4729 self.inner = self.inner.max_decoding_message_size(limit);
4730 self
4731 }
4732 #[must_use]
4736 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4737 self.inner = self.inner.max_encoding_message_size(limit);
4738 self
4739 }
4740 pub async fn lookup_name(
4741 &mut self,
4742 request: impl tonic::IntoRequest<super::LookupNameRequest>,
4743 ) -> std::result::Result<
4744 tonic::Response<super::LookupNameResponse>,
4745 tonic::Status,
4746 > {
4747 self.inner
4748 .ready()
4749 .await
4750 .map_err(|e| {
4751 tonic::Status::unknown(
4752 format!("Service was not ready: {}", e.into()),
4753 )
4754 })?;
4755 let codec = tonic_prost::ProstCodec::default();
4756 let path = http::uri::PathAndQuery::from_static(
4757 "/sui.rpc.v2.NameService/LookupName",
4758 );
4759 let mut req = request.into_request();
4760 req.extensions_mut()
4761 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
4762 self.inner.unary(req, path, codec).await
4763 }
4764 pub async fn reverse_lookup_name(
4765 &mut self,
4766 request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
4767 ) -> std::result::Result<
4768 tonic::Response<super::ReverseLookupNameResponse>,
4769 tonic::Status,
4770 > {
4771 self.inner
4772 .ready()
4773 .await
4774 .map_err(|e| {
4775 tonic::Status::unknown(
4776 format!("Service was not ready: {}", e.into()),
4777 )
4778 })?;
4779 let codec = tonic_prost::ProstCodec::default();
4780 let path = http::uri::PathAndQuery::from_static(
4781 "/sui.rpc.v2.NameService/ReverseLookupName",
4782 );
4783 let mut req = request.into_request();
4784 req.extensions_mut()
4785 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
4786 self.inner.unary(req, path, codec).await
4787 }
4788 }
4789}
4790pub mod name_service_server {
4792 #![allow(
4793 unused_variables,
4794 dead_code,
4795 missing_docs,
4796 clippy::wildcard_imports,
4797 clippy::let_unit_value,
4798 )]
4799 use tonic::codegen::*;
4800 #[async_trait]
4802 pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
4803 async fn lookup_name(
4804 &self,
4805 request: tonic::Request<super::LookupNameRequest>,
4806 ) -> std::result::Result<
4807 tonic::Response<super::LookupNameResponse>,
4808 tonic::Status,
4809 > {
4810 Err(tonic::Status::unimplemented("Not yet implemented"))
4811 }
4812 async fn reverse_lookup_name(
4813 &self,
4814 request: tonic::Request<super::ReverseLookupNameRequest>,
4815 ) -> std::result::Result<
4816 tonic::Response<super::ReverseLookupNameResponse>,
4817 tonic::Status,
4818 > {
4819 Err(tonic::Status::unimplemented("Not yet implemented"))
4820 }
4821 }
4822 #[derive(Debug)]
4823 pub struct NameServiceServer<T> {
4824 inner: Arc<T>,
4825 accept_compression_encodings: EnabledCompressionEncodings,
4826 send_compression_encodings: EnabledCompressionEncodings,
4827 max_decoding_message_size: Option<usize>,
4828 max_encoding_message_size: Option<usize>,
4829 }
4830 impl<T> NameServiceServer<T> {
4831 pub fn new(inner: T) -> Self {
4832 Self::from_arc(Arc::new(inner))
4833 }
4834 pub fn from_arc(inner: Arc<T>) -> Self {
4835 Self {
4836 inner,
4837 accept_compression_encodings: Default::default(),
4838 send_compression_encodings: Default::default(),
4839 max_decoding_message_size: None,
4840 max_encoding_message_size: None,
4841 }
4842 }
4843 pub fn with_interceptor<F>(
4844 inner: T,
4845 interceptor: F,
4846 ) -> InterceptedService<Self, F>
4847 where
4848 F: tonic::service::Interceptor,
4849 {
4850 InterceptedService::new(Self::new(inner), interceptor)
4851 }
4852 #[must_use]
4854 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4855 self.accept_compression_encodings.enable(encoding);
4856 self
4857 }
4858 #[must_use]
4860 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4861 self.send_compression_encodings.enable(encoding);
4862 self
4863 }
4864 #[must_use]
4868 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4869 self.max_decoding_message_size = Some(limit);
4870 self
4871 }
4872 #[must_use]
4876 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4877 self.max_encoding_message_size = Some(limit);
4878 self
4879 }
4880 }
4881 impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
4882 where
4883 T: NameService,
4884 B: Body + std::marker::Send + 'static,
4885 B::Error: Into<StdError> + std::marker::Send + 'static,
4886 {
4887 type Response = http::Response<tonic::body::Body>;
4888 type Error = std::convert::Infallible;
4889 type Future = BoxFuture<Self::Response, Self::Error>;
4890 fn poll_ready(
4891 &mut self,
4892 _cx: &mut Context<'_>,
4893 ) -> Poll<std::result::Result<(), Self::Error>> {
4894 Poll::Ready(Ok(()))
4895 }
4896 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4897 match req.uri().path() {
4898 "/sui.rpc.v2.NameService/LookupName" => {
4899 #[allow(non_camel_case_types)]
4900 struct LookupNameSvc<T: NameService>(pub Arc<T>);
4901 impl<
4902 T: NameService,
4903 > tonic::server::UnaryService<super::LookupNameRequest>
4904 for LookupNameSvc<T> {
4905 type Response = super::LookupNameResponse;
4906 type Future = BoxFuture<
4907 tonic::Response<Self::Response>,
4908 tonic::Status,
4909 >;
4910 fn call(
4911 &mut self,
4912 request: tonic::Request<super::LookupNameRequest>,
4913 ) -> Self::Future {
4914 let inner = Arc::clone(&self.0);
4915 let fut = async move {
4916 <T as NameService>::lookup_name(&inner, request).await
4917 };
4918 Box::pin(fut)
4919 }
4920 }
4921 let accept_compression_encodings = self.accept_compression_encodings;
4922 let send_compression_encodings = self.send_compression_encodings;
4923 let max_decoding_message_size = self.max_decoding_message_size;
4924 let max_encoding_message_size = self.max_encoding_message_size;
4925 let inner = self.inner.clone();
4926 let fut = async move {
4927 let method = LookupNameSvc(inner);
4928 let codec = tonic_prost::ProstCodec::default();
4929 let mut grpc = tonic::server::Grpc::new(codec)
4930 .apply_compression_config(
4931 accept_compression_encodings,
4932 send_compression_encodings,
4933 )
4934 .apply_max_message_size_config(
4935 max_decoding_message_size,
4936 max_encoding_message_size,
4937 );
4938 let res = grpc.unary(method, req).await;
4939 Ok(res)
4940 };
4941 Box::pin(fut)
4942 }
4943 "/sui.rpc.v2.NameService/ReverseLookupName" => {
4944 #[allow(non_camel_case_types)]
4945 struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
4946 impl<
4947 T: NameService,
4948 > tonic::server::UnaryService<super::ReverseLookupNameRequest>
4949 for ReverseLookupNameSvc<T> {
4950 type Response = super::ReverseLookupNameResponse;
4951 type Future = BoxFuture<
4952 tonic::Response<Self::Response>,
4953 tonic::Status,
4954 >;
4955 fn call(
4956 &mut self,
4957 request: tonic::Request<super::ReverseLookupNameRequest>,
4958 ) -> Self::Future {
4959 let inner = Arc::clone(&self.0);
4960 let fut = async move {
4961 <T as NameService>::reverse_lookup_name(&inner, request)
4962 .await
4963 };
4964 Box::pin(fut)
4965 }
4966 }
4967 let accept_compression_encodings = self.accept_compression_encodings;
4968 let send_compression_encodings = self.send_compression_encodings;
4969 let max_decoding_message_size = self.max_decoding_message_size;
4970 let max_encoding_message_size = self.max_encoding_message_size;
4971 let inner = self.inner.clone();
4972 let fut = async move {
4973 let method = ReverseLookupNameSvc(inner);
4974 let codec = tonic_prost::ProstCodec::default();
4975 let mut grpc = tonic::server::Grpc::new(codec)
4976 .apply_compression_config(
4977 accept_compression_encodings,
4978 send_compression_encodings,
4979 )
4980 .apply_max_message_size_config(
4981 max_decoding_message_size,
4982 max_encoding_message_size,
4983 );
4984 let res = grpc.unary(method, req).await;
4985 Ok(res)
4986 };
4987 Box::pin(fut)
4988 }
4989 _ => {
4990 Box::pin(async move {
4991 let mut response = http::Response::new(
4992 tonic::body::Body::default(),
4993 );
4994 let headers = response.headers_mut();
4995 headers
4996 .insert(
4997 tonic::Status::GRPC_STATUS,
4998 (tonic::Code::Unimplemented as i32).into(),
4999 );
5000 headers
5001 .insert(
5002 http::header::CONTENT_TYPE,
5003 tonic::metadata::GRPC_CONTENT_TYPE,
5004 );
5005 Ok(response)
5006 })
5007 }
5008 }
5009 }
5010 }
5011 impl<T> Clone for NameServiceServer<T> {
5012 fn clone(&self) -> Self {
5013 let inner = self.inner.clone();
5014 Self {
5015 inner,
5016 accept_compression_encodings: self.accept_compression_encodings,
5017 send_compression_encodings: self.send_compression_encodings,
5018 max_decoding_message_size: self.max_decoding_message_size,
5019 max_encoding_message_size: self.max_encoding_message_size,
5020 }
5021 }
5022 }
5023 pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
5025 impl<T> tonic::server::NamedService for NameServiceServer<T> {
5026 const NAME: &'static str = SERVICE_NAME;
5027 }
5028}
5029#[non_exhaustive]
5031#[derive(Clone, PartialEq, ::prost::Message)]
5032pub struct Object {
5033 #[prost(message, optional, tag = "1")]
5035 pub bcs: ::core::option::Option<Bcs>,
5036 #[prost(string, optional, tag = "2")]
5038 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5039 #[prost(uint64, optional, tag = "3")]
5041 pub version: ::core::option::Option<u64>,
5042 #[prost(string, optional, tag = "4")]
5044 pub digest: ::core::option::Option<::prost::alloc::string::String>,
5045 #[prost(message, optional, tag = "5")]
5047 pub owner: ::core::option::Option<Owner>,
5048 #[prost(string, optional, tag = "6")]
5052 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5053 #[prost(bool, optional, tag = "7")]
5058 pub has_public_transfer: ::core::option::Option<bool>,
5059 #[prost(message, optional, tag = "8")]
5063 pub contents: ::core::option::Option<Bcs>,
5064 #[prost(message, optional, tag = "9")]
5066 pub package: ::core::option::Option<Package>,
5067 #[prost(string, optional, tag = "10")]
5069 pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
5070 #[prost(uint64, optional, tag = "11")]
5074 pub storage_rebate: ::core::option::Option<u64>,
5075 #[prost(message, optional, boxed, tag = "100")]
5077 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
5078 #[prost(uint64, optional, tag = "101")]
5080 pub balance: ::core::option::Option<u64>,
5081 #[prost(message, optional, boxed, tag = "102")]
5084 pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
5085}
5086#[non_exhaustive]
5088#[derive(Clone, PartialEq, ::prost::Message)]
5089pub struct ObjectSet {
5090 #[prost(message, repeated, tag = "1")]
5092 pub objects: ::prost::alloc::vec::Vec<Object>,
5093}
5094#[non_exhaustive]
5096#[derive(Clone, PartialEq, ::prost::Message)]
5097pub struct Display {
5098 #[prost(message, optional, tag = "1")]
5102 pub output: ::core::option::Option<::prost_types::Value>,
5103 #[prost(message, optional, tag = "2")]
5107 pub errors: ::core::option::Option<::prost_types::Value>,
5108}
5109#[non_exhaustive]
5111#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5112pub struct ObjectReference {
5113 #[prost(string, optional, tag = "1")]
5115 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5116 #[prost(uint64, optional, tag = "2")]
5118 pub version: ::core::option::Option<u64>,
5119 #[prost(string, optional, tag = "3")]
5121 pub digest: ::core::option::Option<::prost::alloc::string::String>,
5122}
5123#[non_exhaustive]
5125#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5126pub struct Owner {
5127 #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
5128 pub kind: ::core::option::Option<i32>,
5129 #[prost(string, optional, tag = "2")]
5131 pub address: ::core::option::Option<::prost::alloc::string::String>,
5132 #[prost(uint64, optional, tag = "3")]
5134 pub version: ::core::option::Option<u64>,
5135}
5136pub mod owner {
5138 #[non_exhaustive]
5139 #[derive(
5140 Clone,
5141 Copy,
5142 Debug,
5143 PartialEq,
5144 Eq,
5145 Hash,
5146 PartialOrd,
5147 Ord,
5148 ::prost::Enumeration
5149 )]
5150 #[repr(i32)]
5151 pub enum OwnerKind {
5152 Unknown = 0,
5153 Address = 1,
5154 Object = 2,
5155 Shared = 3,
5156 Immutable = 4,
5157 ConsensusAddress = 5,
5158 }
5159 impl OwnerKind {
5160 pub fn as_str_name(&self) -> &'static str {
5165 match self {
5166 Self::Unknown => "OWNER_KIND_UNKNOWN",
5167 Self::Address => "ADDRESS",
5168 Self::Object => "OBJECT",
5169 Self::Shared => "SHARED",
5170 Self::Immutable => "IMMUTABLE",
5171 Self::ConsensusAddress => "CONSENSUS_ADDRESS",
5172 }
5173 }
5174 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5176 match value {
5177 "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
5178 "ADDRESS" => Some(Self::Address),
5179 "OBJECT" => Some(Self::Object),
5180 "SHARED" => Some(Self::Shared),
5181 "IMMUTABLE" => Some(Self::Immutable),
5182 "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
5183 _ => None,
5184 }
5185 }
5186 }
5187}
5188#[non_exhaustive]
5189#[derive(Clone, PartialEq, ::prost::Message)]
5190pub struct ProtocolConfig {
5191 #[prost(uint64, optional, tag = "1")]
5192 pub protocol_version: ::core::option::Option<u64>,
5193 #[prost(btree_map = "string, bool", tag = "2")]
5195 pub feature_flags: ::prost::alloc::collections::BTreeMap<
5196 ::prost::alloc::string::String,
5197 bool,
5198 >,
5199 #[prost(btree_map = "string, string", tag = "3")]
5201 pub attributes: ::prost::alloc::collections::BTreeMap<
5202 ::prost::alloc::string::String,
5203 ::prost::alloc::string::String,
5204 >,
5205 #[prost(btree_map = "string, message", tag = "4")]
5206 pub configs: ::prost::alloc::collections::BTreeMap<
5207 ::prost::alloc::string::String,
5208 ::prost_types::Value,
5209 >,
5210}
5211#[non_exhaustive]
5231#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5232pub struct QueryOptions {
5233 #[prost(uint32, optional, tag = "1")]
5236 pub limit: ::core::option::Option<u32>,
5237 #[prost(bytes = "bytes", optional, tag = "2")]
5240 pub after: ::core::option::Option<::prost::bytes::Bytes>,
5241 #[prost(bytes = "bytes", optional, tag = "3")]
5244 pub before: ::core::option::Option<::prost::bytes::Bytes>,
5245 #[prost(enumeration = "Ordering", optional, tag = "4")]
5250 pub ordering: ::core::option::Option<i32>,
5251}
5252#[non_exhaustive]
5257#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5258pub struct Watermark {
5259 #[prost(bytes = "bytes", optional, tag = "1")]
5264 pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
5265 #[prost(uint64, optional, tag = "2")]
5278 pub checkpoint: ::core::option::Option<u64>,
5279}
5280#[non_exhaustive]
5291#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5292pub struct QueryEnd {
5293 #[prost(enumeration = "QueryEndReason", optional, tag = "1")]
5295 pub reason: ::core::option::Option<i32>,
5296}
5297#[non_exhaustive]
5299#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5300#[repr(i32)]
5301pub enum Ordering {
5302 Ascending = 0,
5304 Descending = 1,
5306}
5307impl Ordering {
5308 pub fn as_str_name(&self) -> &'static str {
5313 match self {
5314 Self::Ascending => "ORDERING_ASCENDING",
5315 Self::Descending => "ORDERING_DESCENDING",
5316 }
5317 }
5318 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5320 match value {
5321 "ORDERING_ASCENDING" => Some(Self::Ascending),
5322 "ORDERING_DESCENDING" => Some(Self::Descending),
5323 _ => None,
5324 }
5325 }
5326}
5327#[non_exhaustive]
5329#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5330#[repr(i32)]
5331pub enum QueryEndReason {
5332 Unknown = 0,
5334 ItemLimit = 1,
5338 ScanLimit = 2,
5343 CheckpointBound = 3,
5346 CursorBound = 4,
5350 LedgerTip = 5,
5353}
5354impl QueryEndReason {
5355 pub fn as_str_name(&self) -> &'static str {
5360 match self {
5361 Self::Unknown => "QUERY_END_REASON_UNKNOWN",
5362 Self::ItemLimit => "QUERY_END_REASON_ITEM_LIMIT",
5363 Self::ScanLimit => "QUERY_END_REASON_SCAN_LIMIT",
5364 Self::CheckpointBound => "QUERY_END_REASON_CHECKPOINT_BOUND",
5365 Self::CursorBound => "QUERY_END_REASON_CURSOR_BOUND",
5366 Self::LedgerTip => "QUERY_END_REASON_LEDGER_TIP",
5367 }
5368 }
5369 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5371 match value {
5372 "QUERY_END_REASON_UNKNOWN" => Some(Self::Unknown),
5373 "QUERY_END_REASON_ITEM_LIMIT" => Some(Self::ItemLimit),
5374 "QUERY_END_REASON_SCAN_LIMIT" => Some(Self::ScanLimit),
5375 "QUERY_END_REASON_CHECKPOINT_BOUND" => Some(Self::CheckpointBound),
5376 "QUERY_END_REASON_CURSOR_BOUND" => Some(Self::CursorBound),
5377 "QUERY_END_REASON_LEDGER_TIP" => Some(Self::LedgerTip),
5378 _ => None,
5379 }
5380 }
5381}
5382#[non_exhaustive]
5384#[derive(Clone, PartialEq, ::prost::Message)]
5385pub struct UserSignature {
5386 #[prost(message, optional, tag = "1")]
5391 pub bcs: ::core::option::Option<Bcs>,
5392 #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
5394 pub scheme: ::core::option::Option<i32>,
5395 #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
5396 pub signature: ::core::option::Option<user_signature::Signature>,
5397}
5398pub mod user_signature {
5400 #[non_exhaustive]
5401 #[derive(Clone, PartialEq, ::prost::Oneof)]
5402 pub enum Signature {
5403 #[prost(message, tag = "3")]
5405 Simple(super::SimpleSignature),
5406 #[prost(message, tag = "4")]
5408 Multisig(super::MultisigAggregatedSignature),
5409 #[prost(message, tag = "5")]
5411 Zklogin(super::ZkLoginAuthenticator),
5412 #[prost(message, tag = "6")]
5414 Passkey(super::PasskeyAuthenticator),
5415 }
5416}
5417#[non_exhaustive]
5419#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5420pub struct SimpleSignature {
5421 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5423 pub scheme: ::core::option::Option<i32>,
5424 #[prost(bytes = "bytes", optional, tag = "2")]
5426 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5427 #[prost(bytes = "bytes", optional, tag = "3")]
5429 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5430}
5431#[non_exhaustive]
5433#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5434pub struct ZkLoginPublicIdentifier {
5435 #[prost(string, optional, tag = "1")]
5436 pub iss: ::core::option::Option<::prost::alloc::string::String>,
5437 #[prost(string, optional, tag = "2")]
5439 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5440}
5441#[non_exhaustive]
5443#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5444pub struct MultisigMemberPublicKey {
5445 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5447 pub scheme: ::core::option::Option<i32>,
5448 #[prost(bytes = "bytes", optional, tag = "2")]
5450 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5451 #[prost(message, optional, tag = "3")]
5453 pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
5454}
5455#[non_exhaustive]
5457#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5458pub struct MultisigMember {
5459 #[prost(message, optional, tag = "1")]
5461 pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
5462 #[prost(uint32, optional, tag = "2")]
5464 pub weight: ::core::option::Option<u32>,
5465}
5466#[non_exhaustive]
5468#[derive(Clone, PartialEq, ::prost::Message)]
5469pub struct MultisigCommittee {
5470 #[prost(message, repeated, tag = "1")]
5472 pub members: ::prost::alloc::vec::Vec<MultisigMember>,
5473 #[prost(uint32, optional, tag = "2")]
5476 pub threshold: ::core::option::Option<u32>,
5477}
5478#[non_exhaustive]
5480#[derive(Clone, PartialEq, ::prost::Message)]
5481pub struct MultisigAggregatedSignature {
5482 #[prost(message, repeated, tag = "1")]
5486 pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
5487 #[prost(uint32, optional, tag = "2")]
5490 pub bitmap: ::core::option::Option<u32>,
5491 #[prost(bytes = "bytes", optional, tag = "3")]
5494 pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5495 #[prost(message, optional, tag = "4")]
5497 pub committee: ::core::option::Option<MultisigCommittee>,
5498}
5499#[non_exhaustive]
5501#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5502pub struct MultisigMemberSignature {
5503 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5505 pub scheme: ::core::option::Option<i32>,
5506 #[prost(bytes = "bytes", optional, tag = "2")]
5508 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5509 #[prost(message, optional, tag = "3")]
5511 pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
5512 #[prost(message, optional, tag = "4")]
5514 pub passkey: ::core::option::Option<PasskeyAuthenticator>,
5515}
5516#[non_exhaustive]
5518#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5519pub struct ZkLoginAuthenticator {
5520 #[prost(message, optional, tag = "1")]
5522 pub inputs: ::core::option::Option<ZkLoginInputs>,
5523 #[prost(uint64, optional, tag = "2")]
5525 pub max_epoch: ::core::option::Option<u64>,
5526 #[prost(message, optional, tag = "3")]
5528 pub signature: ::core::option::Option<SimpleSignature>,
5529 #[prost(message, optional, tag = "4")]
5531 pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
5532 #[prost(message, optional, tag = "5")]
5534 pub jwk_id: ::core::option::Option<JwkId>,
5535}
5536#[non_exhaustive]
5538#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5539pub struct ZkLoginInputs {
5540 #[prost(message, optional, tag = "1")]
5541 pub proof_points: ::core::option::Option<ZkLoginProof>,
5542 #[prost(message, optional, tag = "2")]
5543 pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
5544 #[prost(string, optional, tag = "3")]
5545 pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
5546 #[prost(string, optional, tag = "4")]
5548 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5549}
5550#[non_exhaustive]
5552#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5553pub struct ZkLoginProof {
5554 #[prost(message, optional, tag = "1")]
5555 pub a: ::core::option::Option<CircomG1>,
5556 #[prost(message, optional, tag = "2")]
5557 pub b: ::core::option::Option<CircomG2>,
5558 #[prost(message, optional, tag = "3")]
5559 pub c: ::core::option::Option<CircomG1>,
5560}
5561#[non_exhaustive]
5563#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5564pub struct ZkLoginClaim {
5565 #[prost(string, optional, tag = "1")]
5566 pub value: ::core::option::Option<::prost::alloc::string::String>,
5567 #[prost(uint32, optional, tag = "2")]
5568 pub index_mod_4: ::core::option::Option<u32>,
5569}
5570#[non_exhaustive]
5572#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5573pub struct CircomG1 {
5574 #[prost(string, optional, tag = "1")]
5576 pub e0: ::core::option::Option<::prost::alloc::string::String>,
5577 #[prost(string, optional, tag = "2")]
5579 pub e1: ::core::option::Option<::prost::alloc::string::String>,
5580 #[prost(string, optional, tag = "3")]
5582 pub e2: ::core::option::Option<::prost::alloc::string::String>,
5583}
5584#[non_exhaustive]
5586#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5587pub struct CircomG2 {
5588 #[prost(string, optional, tag = "1")]
5590 pub e00: ::core::option::Option<::prost::alloc::string::String>,
5591 #[prost(string, optional, tag = "2")]
5593 pub e01: ::core::option::Option<::prost::alloc::string::String>,
5594 #[prost(string, optional, tag = "3")]
5596 pub e10: ::core::option::Option<::prost::alloc::string::String>,
5597 #[prost(string, optional, tag = "4")]
5599 pub e11: ::core::option::Option<::prost::alloc::string::String>,
5600 #[prost(string, optional, tag = "5")]
5602 pub e20: ::core::option::Option<::prost::alloc::string::String>,
5603 #[prost(string, optional, tag = "6")]
5605 pub e21: ::core::option::Option<::prost::alloc::string::String>,
5606}
5607#[non_exhaustive]
5614#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5615pub struct PasskeyAuthenticator {
5616 #[prost(bytes = "bytes", optional, tag = "1")]
5621 pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
5622 #[prost(string, optional, tag = "2")]
5627 pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
5628 #[prost(message, optional, tag = "3")]
5630 pub signature: ::core::option::Option<SimpleSignature>,
5631}
5632#[non_exhaustive]
5634#[derive(Clone, PartialEq, ::prost::Message)]
5635pub struct ValidatorCommittee {
5636 #[prost(uint64, optional, tag = "1")]
5638 pub epoch: ::core::option::Option<u64>,
5639 #[prost(message, repeated, tag = "2")]
5641 pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
5642}
5643#[non_exhaustive]
5645#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5646pub struct ValidatorCommitteeMember {
5647 #[prost(bytes = "bytes", optional, tag = "1")]
5649 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5650 #[prost(uint64, optional, tag = "2")]
5652 pub weight: ::core::option::Option<u64>,
5653}
5654#[non_exhaustive]
5656#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5657pub struct ValidatorAggregatedSignature {
5658 #[prost(uint64, optional, tag = "1")]
5663 pub epoch: ::core::option::Option<u64>,
5664 #[prost(bytes = "bytes", optional, tag = "2")]
5666 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5667 #[prost(bytes = "bytes", optional, tag = "3")]
5670 pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5671}
5672#[non_exhaustive]
5679#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5680#[repr(i32)]
5681pub enum SignatureScheme {
5682 Ed25519 = 0,
5683 Secp256k1 = 1,
5684 Secp256r1 = 2,
5685 Multisig = 3,
5686 Bls12381 = 4,
5687 Zklogin = 5,
5688 Passkey = 6,
5689}
5690impl SignatureScheme {
5691 pub fn as_str_name(&self) -> &'static str {
5696 match self {
5697 Self::Ed25519 => "ED25519",
5698 Self::Secp256k1 => "SECP256K1",
5699 Self::Secp256r1 => "SECP256R1",
5700 Self::Multisig => "MULTISIG",
5701 Self::Bls12381 => "BLS12381",
5702 Self::Zklogin => "ZKLOGIN",
5703 Self::Passkey => "PASSKEY",
5704 }
5705 }
5706 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5708 match value {
5709 "ED25519" => Some(Self::Ed25519),
5710 "SECP256K1" => Some(Self::Secp256k1),
5711 "SECP256R1" => Some(Self::Secp256r1),
5712 "MULTISIG" => Some(Self::Multisig),
5713 "BLS12381" => Some(Self::Bls12381),
5714 "ZKLOGIN" => Some(Self::Zklogin),
5715 "PASSKEY" => Some(Self::Passkey),
5716 _ => None,
5717 }
5718 }
5719}
5720#[non_exhaustive]
5721#[derive(Clone, PartialEq, ::prost::Message)]
5722pub struct VerifySignatureRequest {
5723 #[prost(message, optional, tag = "1")]
5729 pub message: ::core::option::Option<Bcs>,
5730 #[prost(message, optional, tag = "2")]
5732 pub signature: ::core::option::Option<UserSignature>,
5733 #[prost(string, optional, tag = "3")]
5739 pub address: ::core::option::Option<::prost::alloc::string::String>,
5740 #[prost(message, repeated, tag = "4")]
5743 pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
5744}
5745#[non_exhaustive]
5746#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5747pub struct VerifySignatureResponse {
5748 #[prost(bool, optional, tag = "1")]
5750 pub is_valid: ::core::option::Option<bool>,
5751 #[prost(string, optional, tag = "2")]
5753 pub reason: ::core::option::Option<::prost::alloc::string::String>,
5754}
5755pub mod signature_verification_service_client {
5757 #![allow(
5758 unused_variables,
5759 dead_code,
5760 missing_docs,
5761 clippy::wildcard_imports,
5762 clippy::let_unit_value,
5763 )]
5764 use tonic::codegen::*;
5765 use tonic::codegen::http::Uri;
5766 #[derive(Debug, Clone)]
5767 pub struct SignatureVerificationServiceClient<T> {
5768 inner: tonic::client::Grpc<T>,
5769 }
5770 impl SignatureVerificationServiceClient<tonic::transport::Channel> {
5771 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5773 where
5774 D: TryInto<tonic::transport::Endpoint>,
5775 D::Error: Into<StdError>,
5776 {
5777 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5778 Ok(Self::new(conn))
5779 }
5780 }
5781 impl<T> SignatureVerificationServiceClient<T>
5782 where
5783 T: tonic::client::GrpcService<tonic::body::Body>,
5784 T::Error: Into<StdError>,
5785 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5786 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5787 {
5788 pub fn new(inner: T) -> Self {
5789 let inner = tonic::client::Grpc::new(inner);
5790 Self { inner }
5791 }
5792 pub fn with_origin(inner: T, origin: Uri) -> Self {
5793 let inner = tonic::client::Grpc::with_origin(inner, origin);
5794 Self { inner }
5795 }
5796 pub fn with_interceptor<F>(
5797 inner: T,
5798 interceptor: F,
5799 ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
5800 where
5801 F: tonic::service::Interceptor,
5802 T::ResponseBody: Default,
5803 T: tonic::codegen::Service<
5804 http::Request<tonic::body::Body>,
5805 Response = http::Response<
5806 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5807 >,
5808 >,
5809 <T as tonic::codegen::Service<
5810 http::Request<tonic::body::Body>,
5811 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5812 {
5813 SignatureVerificationServiceClient::new(
5814 InterceptedService::new(inner, interceptor),
5815 )
5816 }
5817 #[must_use]
5822 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5823 self.inner = self.inner.send_compressed(encoding);
5824 self
5825 }
5826 #[must_use]
5828 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5829 self.inner = self.inner.accept_compressed(encoding);
5830 self
5831 }
5832 #[must_use]
5836 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5837 self.inner = self.inner.max_decoding_message_size(limit);
5838 self
5839 }
5840 #[must_use]
5844 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5845 self.inner = self.inner.max_encoding_message_size(limit);
5846 self
5847 }
5848 pub async fn verify_signature(
5850 &mut self,
5851 request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
5852 ) -> std::result::Result<
5853 tonic::Response<super::VerifySignatureResponse>,
5854 tonic::Status,
5855 > {
5856 self.inner
5857 .ready()
5858 .await
5859 .map_err(|e| {
5860 tonic::Status::unknown(
5861 format!("Service was not ready: {}", e.into()),
5862 )
5863 })?;
5864 let codec = tonic_prost::ProstCodec::default();
5865 let path = http::uri::PathAndQuery::from_static(
5866 "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
5867 );
5868 let mut req = request.into_request();
5869 req.extensions_mut()
5870 .insert(
5871 GrpcMethod::new(
5872 "sui.rpc.v2.SignatureVerificationService",
5873 "VerifySignature",
5874 ),
5875 );
5876 self.inner.unary(req, path, codec).await
5877 }
5878 }
5879}
5880pub mod signature_verification_service_server {
5882 #![allow(
5883 unused_variables,
5884 dead_code,
5885 missing_docs,
5886 clippy::wildcard_imports,
5887 clippy::let_unit_value,
5888 )]
5889 use tonic::codegen::*;
5890 #[async_trait]
5892 pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
5893 async fn verify_signature(
5895 &self,
5896 request: tonic::Request<super::VerifySignatureRequest>,
5897 ) -> std::result::Result<
5898 tonic::Response<super::VerifySignatureResponse>,
5899 tonic::Status,
5900 > {
5901 Err(tonic::Status::unimplemented("Not yet implemented"))
5902 }
5903 }
5904 #[derive(Debug)]
5905 pub struct SignatureVerificationServiceServer<T> {
5906 inner: Arc<T>,
5907 accept_compression_encodings: EnabledCompressionEncodings,
5908 send_compression_encodings: EnabledCompressionEncodings,
5909 max_decoding_message_size: Option<usize>,
5910 max_encoding_message_size: Option<usize>,
5911 }
5912 impl<T> SignatureVerificationServiceServer<T> {
5913 pub fn new(inner: T) -> Self {
5914 Self::from_arc(Arc::new(inner))
5915 }
5916 pub fn from_arc(inner: Arc<T>) -> Self {
5917 Self {
5918 inner,
5919 accept_compression_encodings: Default::default(),
5920 send_compression_encodings: Default::default(),
5921 max_decoding_message_size: None,
5922 max_encoding_message_size: None,
5923 }
5924 }
5925 pub fn with_interceptor<F>(
5926 inner: T,
5927 interceptor: F,
5928 ) -> InterceptedService<Self, F>
5929 where
5930 F: tonic::service::Interceptor,
5931 {
5932 InterceptedService::new(Self::new(inner), interceptor)
5933 }
5934 #[must_use]
5936 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5937 self.accept_compression_encodings.enable(encoding);
5938 self
5939 }
5940 #[must_use]
5942 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5943 self.send_compression_encodings.enable(encoding);
5944 self
5945 }
5946 #[must_use]
5950 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5951 self.max_decoding_message_size = Some(limit);
5952 self
5953 }
5954 #[must_use]
5958 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5959 self.max_encoding_message_size = Some(limit);
5960 self
5961 }
5962 }
5963 impl<T, B> tonic::codegen::Service<http::Request<B>>
5964 for SignatureVerificationServiceServer<T>
5965 where
5966 T: SignatureVerificationService,
5967 B: Body + std::marker::Send + 'static,
5968 B::Error: Into<StdError> + std::marker::Send + 'static,
5969 {
5970 type Response = http::Response<tonic::body::Body>;
5971 type Error = std::convert::Infallible;
5972 type Future = BoxFuture<Self::Response, Self::Error>;
5973 fn poll_ready(
5974 &mut self,
5975 _cx: &mut Context<'_>,
5976 ) -> Poll<std::result::Result<(), Self::Error>> {
5977 Poll::Ready(Ok(()))
5978 }
5979 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5980 match req.uri().path() {
5981 "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
5982 #[allow(non_camel_case_types)]
5983 struct VerifySignatureSvc<T: SignatureVerificationService>(
5984 pub Arc<T>,
5985 );
5986 impl<
5987 T: SignatureVerificationService,
5988 > tonic::server::UnaryService<super::VerifySignatureRequest>
5989 for VerifySignatureSvc<T> {
5990 type Response = super::VerifySignatureResponse;
5991 type Future = BoxFuture<
5992 tonic::Response<Self::Response>,
5993 tonic::Status,
5994 >;
5995 fn call(
5996 &mut self,
5997 request: tonic::Request<super::VerifySignatureRequest>,
5998 ) -> Self::Future {
5999 let inner = Arc::clone(&self.0);
6000 let fut = async move {
6001 <T as SignatureVerificationService>::verify_signature(
6002 &inner,
6003 request,
6004 )
6005 .await
6006 };
6007 Box::pin(fut)
6008 }
6009 }
6010 let accept_compression_encodings = self.accept_compression_encodings;
6011 let send_compression_encodings = self.send_compression_encodings;
6012 let max_decoding_message_size = self.max_decoding_message_size;
6013 let max_encoding_message_size = self.max_encoding_message_size;
6014 let inner = self.inner.clone();
6015 let fut = async move {
6016 let method = VerifySignatureSvc(inner);
6017 let codec = tonic_prost::ProstCodec::default();
6018 let mut grpc = tonic::server::Grpc::new(codec)
6019 .apply_compression_config(
6020 accept_compression_encodings,
6021 send_compression_encodings,
6022 )
6023 .apply_max_message_size_config(
6024 max_decoding_message_size,
6025 max_encoding_message_size,
6026 );
6027 let res = grpc.unary(method, req).await;
6028 Ok(res)
6029 };
6030 Box::pin(fut)
6031 }
6032 _ => {
6033 Box::pin(async move {
6034 let mut response = http::Response::new(
6035 tonic::body::Body::default(),
6036 );
6037 let headers = response.headers_mut();
6038 headers
6039 .insert(
6040 tonic::Status::GRPC_STATUS,
6041 (tonic::Code::Unimplemented as i32).into(),
6042 );
6043 headers
6044 .insert(
6045 http::header::CONTENT_TYPE,
6046 tonic::metadata::GRPC_CONTENT_TYPE,
6047 );
6048 Ok(response)
6049 })
6050 }
6051 }
6052 }
6053 }
6054 impl<T> Clone for SignatureVerificationServiceServer<T> {
6055 fn clone(&self) -> Self {
6056 let inner = self.inner.clone();
6057 Self {
6058 inner,
6059 accept_compression_encodings: self.accept_compression_encodings,
6060 send_compression_encodings: self.send_compression_encodings,
6061 max_decoding_message_size: self.max_decoding_message_size,
6062 max_encoding_message_size: self.max_encoding_message_size,
6063 }
6064 }
6065 }
6066 pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
6068 impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
6069 const NAME: &'static str = SERVICE_NAME;
6070 }
6071}
6072#[non_exhaustive]
6074#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6075pub struct GetCoinInfoRequest {
6076 #[prost(string, optional, tag = "1")]
6078 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6079}
6080#[non_exhaustive]
6082#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6083pub struct GetCoinInfoResponse {
6084 #[prost(string, optional, tag = "1")]
6086 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6087 #[prost(message, optional, tag = "2")]
6090 pub metadata: ::core::option::Option<CoinMetadata>,
6091 #[prost(message, optional, tag = "3")]
6094 pub treasury: ::core::option::Option<CoinTreasury>,
6095 #[prost(message, optional, tag = "4")]
6103 pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
6104}
6105#[non_exhaustive]
6107#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6108pub struct CoinMetadata {
6109 #[prost(string, optional, tag = "1")]
6112 pub id: ::core::option::Option<::prost::alloc::string::String>,
6113 #[prost(uint32, optional, tag = "2")]
6115 pub decimals: ::core::option::Option<u32>,
6116 #[prost(string, optional, tag = "3")]
6118 pub name: ::core::option::Option<::prost::alloc::string::String>,
6119 #[prost(string, optional, tag = "4")]
6121 pub symbol: ::core::option::Option<::prost::alloc::string::String>,
6122 #[prost(string, optional, tag = "5")]
6124 pub description: ::core::option::Option<::prost::alloc::string::String>,
6125 #[prost(string, optional, tag = "6")]
6127 pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
6128 #[prost(string, optional, tag = "7")]
6132 pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6133 #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
6135 pub metadata_cap_state: ::core::option::Option<i32>,
6136}
6137pub mod coin_metadata {
6139 #[non_exhaustive]
6141 #[derive(
6142 Clone,
6143 Copy,
6144 Debug,
6145 PartialEq,
6146 Eq,
6147 Hash,
6148 PartialOrd,
6149 Ord,
6150 ::prost::Enumeration
6151 )]
6152 #[repr(i32)]
6153 pub enum MetadataCapState {
6154 Unknown = 0,
6157 Claimed = 1,
6159 Unclaimed = 2,
6161 Deleted = 3,
6163 }
6164 impl MetadataCapState {
6165 pub fn as_str_name(&self) -> &'static str {
6170 match self {
6171 Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
6172 Self::Claimed => "CLAIMED",
6173 Self::Unclaimed => "UNCLAIMED",
6174 Self::Deleted => "DELETED",
6175 }
6176 }
6177 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6179 match value {
6180 "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
6181 "CLAIMED" => Some(Self::Claimed),
6182 "UNCLAIMED" => Some(Self::Unclaimed),
6183 "DELETED" => Some(Self::Deleted),
6184 _ => None,
6185 }
6186 }
6187 }
6188}
6189#[non_exhaustive]
6191#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6192pub struct CoinTreasury {
6193 #[prost(string, optional, tag = "1")]
6195 pub id: ::core::option::Option<::prost::alloc::string::String>,
6196 #[prost(uint64, optional, tag = "2")]
6198 pub total_supply: ::core::option::Option<u64>,
6199 #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
6201 pub supply_state: ::core::option::Option<i32>,
6202}
6203pub mod coin_treasury {
6205 #[non_exhaustive]
6207 #[derive(
6208 Clone,
6209 Copy,
6210 Debug,
6211 PartialEq,
6212 Eq,
6213 Hash,
6214 PartialOrd,
6215 Ord,
6216 ::prost::Enumeration
6217 )]
6218 #[repr(i32)]
6219 pub enum SupplyState {
6220 Unknown = 0,
6222 Fixed = 1,
6224 BurnOnly = 2,
6226 }
6227 impl SupplyState {
6228 pub fn as_str_name(&self) -> &'static str {
6233 match self {
6234 Self::Unknown => "SUPPLY_STATE_UNKNOWN",
6235 Self::Fixed => "FIXED",
6236 Self::BurnOnly => "BURN_ONLY",
6237 }
6238 }
6239 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6241 match value {
6242 "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
6243 "FIXED" => Some(Self::Fixed),
6244 "BURN_ONLY" => Some(Self::BurnOnly),
6245 _ => None,
6246 }
6247 }
6248 }
6249}
6250#[non_exhaustive]
6252#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6253pub struct RegulatedCoinMetadata {
6254 #[prost(string, optional, tag = "1")]
6257 pub id: ::core::option::Option<::prost::alloc::string::String>,
6258 #[prost(string, optional, tag = "2")]
6260 pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
6261 #[prost(string, optional, tag = "3")]
6263 pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
6264 #[prost(bool, optional, tag = "4")]
6266 pub allow_global_pause: ::core::option::Option<bool>,
6267 #[prost(uint32, optional, tag = "5")]
6269 pub variant: ::core::option::Option<u32>,
6270 #[prost(
6272 enumeration = "regulated_coin_metadata::CoinRegulatedState",
6273 optional,
6274 tag = "6"
6275 )]
6276 pub coin_regulated_state: ::core::option::Option<i32>,
6277}
6278pub mod regulated_coin_metadata {
6280 #[non_exhaustive]
6282 #[derive(
6283 Clone,
6284 Copy,
6285 Debug,
6286 PartialEq,
6287 Eq,
6288 Hash,
6289 PartialOrd,
6290 Ord,
6291 ::prost::Enumeration
6292 )]
6293 #[repr(i32)]
6294 pub enum CoinRegulatedState {
6295 Unknown = 0,
6300 Regulated = 1,
6302 Unregulated = 2,
6304 }
6305 impl CoinRegulatedState {
6306 pub fn as_str_name(&self) -> &'static str {
6311 match self {
6312 Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
6313 Self::Regulated => "REGULATED",
6314 Self::Unregulated => "UNREGULATED",
6315 }
6316 }
6317 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6319 match value {
6320 "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
6321 "REGULATED" => Some(Self::Regulated),
6322 "UNREGULATED" => Some(Self::Unregulated),
6323 _ => None,
6324 }
6325 }
6326 }
6327}
6328#[non_exhaustive]
6330#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6331pub struct GetBalanceRequest {
6332 #[prost(string, optional, tag = "1")]
6334 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6335 #[prost(string, optional, tag = "2")]
6337 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6338}
6339#[non_exhaustive]
6342#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6343pub struct GetBalanceResponse {
6344 #[prost(message, optional, tag = "1")]
6346 pub balance: ::core::option::Option<Balance>,
6347}
6348#[non_exhaustive]
6350#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6351pub struct ListBalancesRequest {
6352 #[prost(string, optional, tag = "1")]
6354 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6355 #[prost(uint32, optional, tag = "2")]
6359 pub page_size: ::core::option::Option<u32>,
6360 #[prost(bytes = "bytes", optional, tag = "3")]
6366 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6367}
6368#[non_exhaustive]
6371#[derive(Clone, PartialEq, ::prost::Message)]
6372pub struct ListBalancesResponse {
6373 #[prost(message, repeated, tag = "1")]
6375 pub balances: ::prost::alloc::vec::Vec<Balance>,
6376 #[prost(bytes = "bytes", optional, tag = "2")]
6379 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6380}
6381#[non_exhaustive]
6383#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6384pub struct Balance {
6385 #[prost(string, optional, tag = "1")]
6387 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6388 #[prost(uint64, optional, tag = "3")]
6392 pub balance: ::core::option::Option<u64>,
6393 #[prost(uint64, optional, tag = "4")]
6395 pub address_balance: ::core::option::Option<u64>,
6396 #[prost(uint64, optional, tag = "5")]
6398 pub coin_balance: ::core::option::Option<u64>,
6399}
6400#[non_exhaustive]
6402#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6403pub struct ListDynamicFieldsRequest {
6404 #[prost(string, optional, tag = "1")]
6406 pub parent: ::core::option::Option<::prost::alloc::string::String>,
6407 #[prost(uint32, optional, tag = "2")]
6411 pub page_size: ::core::option::Option<u32>,
6412 #[prost(bytes = "bytes", optional, tag = "3")]
6418 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6419 #[prost(message, optional, tag = "4")]
6422 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6423}
6424#[non_exhaustive]
6426#[derive(Clone, PartialEq, ::prost::Message)]
6427pub struct ListDynamicFieldsResponse {
6428 #[prost(message, repeated, tag = "1")]
6430 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
6431 #[prost(bytes = "bytes", optional, tag = "2")]
6434 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6435}
6436#[non_exhaustive]
6437#[derive(Clone, PartialEq, ::prost::Message)]
6438pub struct DynamicField {
6439 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
6440 pub kind: ::core::option::Option<i32>,
6441 #[prost(string, optional, tag = "2")]
6443 pub parent: ::core::option::Option<::prost::alloc::string::String>,
6444 #[prost(string, optional, tag = "3")]
6446 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
6447 #[prost(message, optional, tag = "4")]
6449 pub field_object: ::core::option::Option<Object>,
6450 #[prost(message, optional, tag = "5")]
6452 pub name: ::core::option::Option<Bcs>,
6453 #[prost(message, optional, tag = "6")]
6455 pub value: ::core::option::Option<Bcs>,
6456 #[prost(string, optional, tag = "7")]
6462 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
6463 #[prost(string, optional, tag = "8")]
6469 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
6470 #[prost(message, optional, tag = "9")]
6472 pub child_object: ::core::option::Option<Object>,
6473}
6474pub mod dynamic_field {
6476 #[non_exhaustive]
6477 #[derive(
6478 Clone,
6479 Copy,
6480 Debug,
6481 PartialEq,
6482 Eq,
6483 Hash,
6484 PartialOrd,
6485 Ord,
6486 ::prost::Enumeration
6487 )]
6488 #[repr(i32)]
6489 pub enum DynamicFieldKind {
6490 Unknown = 0,
6491 Field = 1,
6492 Object = 2,
6493 }
6494 impl DynamicFieldKind {
6495 pub fn as_str_name(&self) -> &'static str {
6500 match self {
6501 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
6502 Self::Field => "FIELD",
6503 Self::Object => "OBJECT",
6504 }
6505 }
6506 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6508 match value {
6509 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
6510 "FIELD" => Some(Self::Field),
6511 "OBJECT" => Some(Self::Object),
6512 _ => None,
6513 }
6514 }
6515 }
6516}
6517#[non_exhaustive]
6518#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6519pub struct ListOwnedObjectsRequest {
6520 #[prost(string, optional, tag = "1")]
6522 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6523 #[prost(uint32, optional, tag = "2")]
6527 pub page_size: ::core::option::Option<u32>,
6528 #[prost(bytes = "bytes", optional, tag = "3")]
6534 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6535 #[prost(message, optional, tag = "4")]
6538 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6539 #[prost(string, optional, tag = "5")]
6548 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
6549}
6550#[non_exhaustive]
6551#[derive(Clone, PartialEq, ::prost::Message)]
6552pub struct ListOwnedObjectsResponse {
6553 #[prost(message, repeated, tag = "1")]
6555 pub objects: ::prost::alloc::vec::Vec<Object>,
6556 #[prost(bytes = "bytes", optional, tag = "2")]
6559 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6560}
6561pub mod state_service_client {
6563 #![allow(
6564 unused_variables,
6565 dead_code,
6566 missing_docs,
6567 clippy::wildcard_imports,
6568 clippy::let_unit_value,
6569 )]
6570 use tonic::codegen::*;
6571 use tonic::codegen::http::Uri;
6572 #[derive(Debug, Clone)]
6573 pub struct StateServiceClient<T> {
6574 inner: tonic::client::Grpc<T>,
6575 }
6576 impl StateServiceClient<tonic::transport::Channel> {
6577 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6579 where
6580 D: TryInto<tonic::transport::Endpoint>,
6581 D::Error: Into<StdError>,
6582 {
6583 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6584 Ok(Self::new(conn))
6585 }
6586 }
6587 impl<T> StateServiceClient<T>
6588 where
6589 T: tonic::client::GrpcService<tonic::body::Body>,
6590 T::Error: Into<StdError>,
6591 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6592 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6593 {
6594 pub fn new(inner: T) -> Self {
6595 let inner = tonic::client::Grpc::new(inner);
6596 Self { inner }
6597 }
6598 pub fn with_origin(inner: T, origin: Uri) -> Self {
6599 let inner = tonic::client::Grpc::with_origin(inner, origin);
6600 Self { inner }
6601 }
6602 pub fn with_interceptor<F>(
6603 inner: T,
6604 interceptor: F,
6605 ) -> StateServiceClient<InterceptedService<T, F>>
6606 where
6607 F: tonic::service::Interceptor,
6608 T::ResponseBody: Default,
6609 T: tonic::codegen::Service<
6610 http::Request<tonic::body::Body>,
6611 Response = http::Response<
6612 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6613 >,
6614 >,
6615 <T as tonic::codegen::Service<
6616 http::Request<tonic::body::Body>,
6617 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6618 {
6619 StateServiceClient::new(InterceptedService::new(inner, interceptor))
6620 }
6621 #[must_use]
6626 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6627 self.inner = self.inner.send_compressed(encoding);
6628 self
6629 }
6630 #[must_use]
6632 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6633 self.inner = self.inner.accept_compressed(encoding);
6634 self
6635 }
6636 #[must_use]
6640 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6641 self.inner = self.inner.max_decoding_message_size(limit);
6642 self
6643 }
6644 #[must_use]
6648 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6649 self.inner = self.inner.max_encoding_message_size(limit);
6650 self
6651 }
6652 pub async fn list_dynamic_fields(
6653 &mut self,
6654 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
6655 ) -> std::result::Result<
6656 tonic::Response<super::ListDynamicFieldsResponse>,
6657 tonic::Status,
6658 > {
6659 self.inner
6660 .ready()
6661 .await
6662 .map_err(|e| {
6663 tonic::Status::unknown(
6664 format!("Service was not ready: {}", e.into()),
6665 )
6666 })?;
6667 let codec = tonic_prost::ProstCodec::default();
6668 let path = http::uri::PathAndQuery::from_static(
6669 "/sui.rpc.v2.StateService/ListDynamicFields",
6670 );
6671 let mut req = request.into_request();
6672 req.extensions_mut()
6673 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
6674 self.inner.unary(req, path, codec).await
6675 }
6676 pub async fn list_owned_objects(
6677 &mut self,
6678 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
6679 ) -> std::result::Result<
6680 tonic::Response<super::ListOwnedObjectsResponse>,
6681 tonic::Status,
6682 > {
6683 self.inner
6684 .ready()
6685 .await
6686 .map_err(|e| {
6687 tonic::Status::unknown(
6688 format!("Service was not ready: {}", e.into()),
6689 )
6690 })?;
6691 let codec = tonic_prost::ProstCodec::default();
6692 let path = http::uri::PathAndQuery::from_static(
6693 "/sui.rpc.v2.StateService/ListOwnedObjects",
6694 );
6695 let mut req = request.into_request();
6696 req.extensions_mut()
6697 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
6698 self.inner.unary(req, path, codec).await
6699 }
6700 pub async fn get_coin_info(
6701 &mut self,
6702 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
6703 ) -> std::result::Result<
6704 tonic::Response<super::GetCoinInfoResponse>,
6705 tonic::Status,
6706 > {
6707 self.inner
6708 .ready()
6709 .await
6710 .map_err(|e| {
6711 tonic::Status::unknown(
6712 format!("Service was not ready: {}", e.into()),
6713 )
6714 })?;
6715 let codec = tonic_prost::ProstCodec::default();
6716 let path = http::uri::PathAndQuery::from_static(
6717 "/sui.rpc.v2.StateService/GetCoinInfo",
6718 );
6719 let mut req = request.into_request();
6720 req.extensions_mut()
6721 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
6722 self.inner.unary(req, path, codec).await
6723 }
6724 pub async fn get_balance(
6725 &mut self,
6726 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
6727 ) -> std::result::Result<
6728 tonic::Response<super::GetBalanceResponse>,
6729 tonic::Status,
6730 > {
6731 self.inner
6732 .ready()
6733 .await
6734 .map_err(|e| {
6735 tonic::Status::unknown(
6736 format!("Service was not ready: {}", e.into()),
6737 )
6738 })?;
6739 let codec = tonic_prost::ProstCodec::default();
6740 let path = http::uri::PathAndQuery::from_static(
6741 "/sui.rpc.v2.StateService/GetBalance",
6742 );
6743 let mut req = request.into_request();
6744 req.extensions_mut()
6745 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
6746 self.inner.unary(req, path, codec).await
6747 }
6748 pub async fn list_balances(
6749 &mut self,
6750 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
6751 ) -> std::result::Result<
6752 tonic::Response<super::ListBalancesResponse>,
6753 tonic::Status,
6754 > {
6755 self.inner
6756 .ready()
6757 .await
6758 .map_err(|e| {
6759 tonic::Status::unknown(
6760 format!("Service was not ready: {}", e.into()),
6761 )
6762 })?;
6763 let codec = tonic_prost::ProstCodec::default();
6764 let path = http::uri::PathAndQuery::from_static(
6765 "/sui.rpc.v2.StateService/ListBalances",
6766 );
6767 let mut req = request.into_request();
6768 req.extensions_mut()
6769 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
6770 self.inner.unary(req, path, codec).await
6771 }
6772 }
6773}
6774pub mod state_service_server {
6776 #![allow(
6777 unused_variables,
6778 dead_code,
6779 missing_docs,
6780 clippy::wildcard_imports,
6781 clippy::let_unit_value,
6782 )]
6783 use tonic::codegen::*;
6784 #[async_trait]
6786 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
6787 async fn list_dynamic_fields(
6788 &self,
6789 request: tonic::Request<super::ListDynamicFieldsRequest>,
6790 ) -> std::result::Result<
6791 tonic::Response<super::ListDynamicFieldsResponse>,
6792 tonic::Status,
6793 > {
6794 Err(tonic::Status::unimplemented("Not yet implemented"))
6795 }
6796 async fn list_owned_objects(
6797 &self,
6798 request: tonic::Request<super::ListOwnedObjectsRequest>,
6799 ) -> std::result::Result<
6800 tonic::Response<super::ListOwnedObjectsResponse>,
6801 tonic::Status,
6802 > {
6803 Err(tonic::Status::unimplemented("Not yet implemented"))
6804 }
6805 async fn get_coin_info(
6806 &self,
6807 request: tonic::Request<super::GetCoinInfoRequest>,
6808 ) -> std::result::Result<
6809 tonic::Response<super::GetCoinInfoResponse>,
6810 tonic::Status,
6811 > {
6812 Err(tonic::Status::unimplemented("Not yet implemented"))
6813 }
6814 async fn get_balance(
6815 &self,
6816 request: tonic::Request<super::GetBalanceRequest>,
6817 ) -> std::result::Result<
6818 tonic::Response<super::GetBalanceResponse>,
6819 tonic::Status,
6820 > {
6821 Err(tonic::Status::unimplemented("Not yet implemented"))
6822 }
6823 async fn list_balances(
6824 &self,
6825 request: tonic::Request<super::ListBalancesRequest>,
6826 ) -> std::result::Result<
6827 tonic::Response<super::ListBalancesResponse>,
6828 tonic::Status,
6829 > {
6830 Err(tonic::Status::unimplemented("Not yet implemented"))
6831 }
6832 }
6833 #[derive(Debug)]
6834 pub struct StateServiceServer<T> {
6835 inner: Arc<T>,
6836 accept_compression_encodings: EnabledCompressionEncodings,
6837 send_compression_encodings: EnabledCompressionEncodings,
6838 max_decoding_message_size: Option<usize>,
6839 max_encoding_message_size: Option<usize>,
6840 }
6841 impl<T> StateServiceServer<T> {
6842 pub fn new(inner: T) -> Self {
6843 Self::from_arc(Arc::new(inner))
6844 }
6845 pub fn from_arc(inner: Arc<T>) -> Self {
6846 Self {
6847 inner,
6848 accept_compression_encodings: Default::default(),
6849 send_compression_encodings: Default::default(),
6850 max_decoding_message_size: None,
6851 max_encoding_message_size: None,
6852 }
6853 }
6854 pub fn with_interceptor<F>(
6855 inner: T,
6856 interceptor: F,
6857 ) -> InterceptedService<Self, F>
6858 where
6859 F: tonic::service::Interceptor,
6860 {
6861 InterceptedService::new(Self::new(inner), interceptor)
6862 }
6863 #[must_use]
6865 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6866 self.accept_compression_encodings.enable(encoding);
6867 self
6868 }
6869 #[must_use]
6871 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6872 self.send_compression_encodings.enable(encoding);
6873 self
6874 }
6875 #[must_use]
6879 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6880 self.max_decoding_message_size = Some(limit);
6881 self
6882 }
6883 #[must_use]
6887 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6888 self.max_encoding_message_size = Some(limit);
6889 self
6890 }
6891 }
6892 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
6893 where
6894 T: StateService,
6895 B: Body + std::marker::Send + 'static,
6896 B::Error: Into<StdError> + std::marker::Send + 'static,
6897 {
6898 type Response = http::Response<tonic::body::Body>;
6899 type Error = std::convert::Infallible;
6900 type Future = BoxFuture<Self::Response, Self::Error>;
6901 fn poll_ready(
6902 &mut self,
6903 _cx: &mut Context<'_>,
6904 ) -> Poll<std::result::Result<(), Self::Error>> {
6905 Poll::Ready(Ok(()))
6906 }
6907 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6908 match req.uri().path() {
6909 "/sui.rpc.v2.StateService/ListDynamicFields" => {
6910 #[allow(non_camel_case_types)]
6911 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
6912 impl<
6913 T: StateService,
6914 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
6915 for ListDynamicFieldsSvc<T> {
6916 type Response = super::ListDynamicFieldsResponse;
6917 type Future = BoxFuture<
6918 tonic::Response<Self::Response>,
6919 tonic::Status,
6920 >;
6921 fn call(
6922 &mut self,
6923 request: tonic::Request<super::ListDynamicFieldsRequest>,
6924 ) -> Self::Future {
6925 let inner = Arc::clone(&self.0);
6926 let fut = async move {
6927 <T as StateService>::list_dynamic_fields(&inner, request)
6928 .await
6929 };
6930 Box::pin(fut)
6931 }
6932 }
6933 let accept_compression_encodings = self.accept_compression_encodings;
6934 let send_compression_encodings = self.send_compression_encodings;
6935 let max_decoding_message_size = self.max_decoding_message_size;
6936 let max_encoding_message_size = self.max_encoding_message_size;
6937 let inner = self.inner.clone();
6938 let fut = async move {
6939 let method = ListDynamicFieldsSvc(inner);
6940 let codec = tonic_prost::ProstCodec::default();
6941 let mut grpc = tonic::server::Grpc::new(codec)
6942 .apply_compression_config(
6943 accept_compression_encodings,
6944 send_compression_encodings,
6945 )
6946 .apply_max_message_size_config(
6947 max_decoding_message_size,
6948 max_encoding_message_size,
6949 );
6950 let res = grpc.unary(method, req).await;
6951 Ok(res)
6952 };
6953 Box::pin(fut)
6954 }
6955 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
6956 #[allow(non_camel_case_types)]
6957 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
6958 impl<
6959 T: StateService,
6960 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
6961 for ListOwnedObjectsSvc<T> {
6962 type Response = super::ListOwnedObjectsResponse;
6963 type Future = BoxFuture<
6964 tonic::Response<Self::Response>,
6965 tonic::Status,
6966 >;
6967 fn call(
6968 &mut self,
6969 request: tonic::Request<super::ListOwnedObjectsRequest>,
6970 ) -> Self::Future {
6971 let inner = Arc::clone(&self.0);
6972 let fut = async move {
6973 <T as StateService>::list_owned_objects(&inner, request)
6974 .await
6975 };
6976 Box::pin(fut)
6977 }
6978 }
6979 let accept_compression_encodings = self.accept_compression_encodings;
6980 let send_compression_encodings = self.send_compression_encodings;
6981 let max_decoding_message_size = self.max_decoding_message_size;
6982 let max_encoding_message_size = self.max_encoding_message_size;
6983 let inner = self.inner.clone();
6984 let fut = async move {
6985 let method = ListOwnedObjectsSvc(inner);
6986 let codec = tonic_prost::ProstCodec::default();
6987 let mut grpc = tonic::server::Grpc::new(codec)
6988 .apply_compression_config(
6989 accept_compression_encodings,
6990 send_compression_encodings,
6991 )
6992 .apply_max_message_size_config(
6993 max_decoding_message_size,
6994 max_encoding_message_size,
6995 );
6996 let res = grpc.unary(method, req).await;
6997 Ok(res)
6998 };
6999 Box::pin(fut)
7000 }
7001 "/sui.rpc.v2.StateService/GetCoinInfo" => {
7002 #[allow(non_camel_case_types)]
7003 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
7004 impl<
7005 T: StateService,
7006 > tonic::server::UnaryService<super::GetCoinInfoRequest>
7007 for GetCoinInfoSvc<T> {
7008 type Response = super::GetCoinInfoResponse;
7009 type Future = BoxFuture<
7010 tonic::Response<Self::Response>,
7011 tonic::Status,
7012 >;
7013 fn call(
7014 &mut self,
7015 request: tonic::Request<super::GetCoinInfoRequest>,
7016 ) -> Self::Future {
7017 let inner = Arc::clone(&self.0);
7018 let fut = async move {
7019 <T as StateService>::get_coin_info(&inner, request).await
7020 };
7021 Box::pin(fut)
7022 }
7023 }
7024 let accept_compression_encodings = self.accept_compression_encodings;
7025 let send_compression_encodings = self.send_compression_encodings;
7026 let max_decoding_message_size = self.max_decoding_message_size;
7027 let max_encoding_message_size = self.max_encoding_message_size;
7028 let inner = self.inner.clone();
7029 let fut = async move {
7030 let method = GetCoinInfoSvc(inner);
7031 let codec = tonic_prost::ProstCodec::default();
7032 let mut grpc = tonic::server::Grpc::new(codec)
7033 .apply_compression_config(
7034 accept_compression_encodings,
7035 send_compression_encodings,
7036 )
7037 .apply_max_message_size_config(
7038 max_decoding_message_size,
7039 max_encoding_message_size,
7040 );
7041 let res = grpc.unary(method, req).await;
7042 Ok(res)
7043 };
7044 Box::pin(fut)
7045 }
7046 "/sui.rpc.v2.StateService/GetBalance" => {
7047 #[allow(non_camel_case_types)]
7048 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
7049 impl<
7050 T: StateService,
7051 > tonic::server::UnaryService<super::GetBalanceRequest>
7052 for GetBalanceSvc<T> {
7053 type Response = super::GetBalanceResponse;
7054 type Future = BoxFuture<
7055 tonic::Response<Self::Response>,
7056 tonic::Status,
7057 >;
7058 fn call(
7059 &mut self,
7060 request: tonic::Request<super::GetBalanceRequest>,
7061 ) -> Self::Future {
7062 let inner = Arc::clone(&self.0);
7063 let fut = async move {
7064 <T as StateService>::get_balance(&inner, request).await
7065 };
7066 Box::pin(fut)
7067 }
7068 }
7069 let accept_compression_encodings = self.accept_compression_encodings;
7070 let send_compression_encodings = self.send_compression_encodings;
7071 let max_decoding_message_size = self.max_decoding_message_size;
7072 let max_encoding_message_size = self.max_encoding_message_size;
7073 let inner = self.inner.clone();
7074 let fut = async move {
7075 let method = GetBalanceSvc(inner);
7076 let codec = tonic_prost::ProstCodec::default();
7077 let mut grpc = tonic::server::Grpc::new(codec)
7078 .apply_compression_config(
7079 accept_compression_encodings,
7080 send_compression_encodings,
7081 )
7082 .apply_max_message_size_config(
7083 max_decoding_message_size,
7084 max_encoding_message_size,
7085 );
7086 let res = grpc.unary(method, req).await;
7087 Ok(res)
7088 };
7089 Box::pin(fut)
7090 }
7091 "/sui.rpc.v2.StateService/ListBalances" => {
7092 #[allow(non_camel_case_types)]
7093 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
7094 impl<
7095 T: StateService,
7096 > tonic::server::UnaryService<super::ListBalancesRequest>
7097 for ListBalancesSvc<T> {
7098 type Response = super::ListBalancesResponse;
7099 type Future = BoxFuture<
7100 tonic::Response<Self::Response>,
7101 tonic::Status,
7102 >;
7103 fn call(
7104 &mut self,
7105 request: tonic::Request<super::ListBalancesRequest>,
7106 ) -> Self::Future {
7107 let inner = Arc::clone(&self.0);
7108 let fut = async move {
7109 <T as StateService>::list_balances(&inner, request).await
7110 };
7111 Box::pin(fut)
7112 }
7113 }
7114 let accept_compression_encodings = self.accept_compression_encodings;
7115 let send_compression_encodings = self.send_compression_encodings;
7116 let max_decoding_message_size = self.max_decoding_message_size;
7117 let max_encoding_message_size = self.max_encoding_message_size;
7118 let inner = self.inner.clone();
7119 let fut = async move {
7120 let method = ListBalancesSvc(inner);
7121 let codec = tonic_prost::ProstCodec::default();
7122 let mut grpc = tonic::server::Grpc::new(codec)
7123 .apply_compression_config(
7124 accept_compression_encodings,
7125 send_compression_encodings,
7126 )
7127 .apply_max_message_size_config(
7128 max_decoding_message_size,
7129 max_encoding_message_size,
7130 );
7131 let res = grpc.unary(method, req).await;
7132 Ok(res)
7133 };
7134 Box::pin(fut)
7135 }
7136 _ => {
7137 Box::pin(async move {
7138 let mut response = http::Response::new(
7139 tonic::body::Body::default(),
7140 );
7141 let headers = response.headers_mut();
7142 headers
7143 .insert(
7144 tonic::Status::GRPC_STATUS,
7145 (tonic::Code::Unimplemented as i32).into(),
7146 );
7147 headers
7148 .insert(
7149 http::header::CONTENT_TYPE,
7150 tonic::metadata::GRPC_CONTENT_TYPE,
7151 );
7152 Ok(response)
7153 })
7154 }
7155 }
7156 }
7157 }
7158 impl<T> Clone for StateServiceServer<T> {
7159 fn clone(&self) -> Self {
7160 let inner = self.inner.clone();
7161 Self {
7162 inner,
7163 accept_compression_encodings: self.accept_compression_encodings,
7164 send_compression_encodings: self.send_compression_encodings,
7165 max_decoding_message_size: self.max_decoding_message_size,
7166 max_encoding_message_size: self.max_encoding_message_size,
7167 }
7168 }
7169 }
7170 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
7172 impl<T> tonic::server::NamedService for StateServiceServer<T> {
7173 const NAME: &'static str = SERVICE_NAME;
7174 }
7175}
7176#[derive(Eq, Hash)]
7178#[non_exhaustive]
7179#[derive(Clone, PartialEq, ::prost::Message)]
7180pub struct SubscribeCheckpointsRequest {
7181 #[prost(message, optional, tag = "1")]
7185 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7186 #[prost(message, optional, tag = "2")]
7190 pub filter: ::core::option::Option<TransactionFilter>,
7191}
7192#[non_exhaustive]
7200#[derive(Clone, PartialEq, ::prost::Message)]
7201pub struct SubscribeCheckpointsResponse {
7202 #[prost(uint64, optional, tag = "1")]
7207 pub cursor: ::core::option::Option<u64>,
7208 #[prost(message, optional, tag = "2")]
7211 pub checkpoint: ::core::option::Option<Checkpoint>,
7212}
7213#[non_exhaustive]
7215#[derive(Clone, PartialEq, ::prost::Message)]
7216pub struct SubscribeTransactionsRequest {
7217 #[prost(message, optional, tag = "1")]
7220 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7221 #[prost(message, optional, tag = "2")]
7224 pub filter: ::core::option::Option<TransactionFilter>,
7225}
7226#[non_exhaustive]
7231#[derive(Clone, PartialEq, ::prost::Message)]
7232pub struct SubscribeTransactionsResponse {
7233 #[prost(message, optional, tag = "1")]
7236 pub transaction: ::core::option::Option<ExecutedTransaction>,
7237 #[prost(message, optional, tag = "2")]
7239 pub watermark: ::core::option::Option<Watermark>,
7240}
7241#[non_exhaustive]
7243#[derive(Clone, PartialEq, ::prost::Message)]
7244pub struct SubscribeEventsRequest {
7245 #[prost(message, optional, tag = "1")]
7248 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7249 #[prost(message, optional, tag = "2")]
7252 pub filter: ::core::option::Option<EventFilter>,
7253}
7254#[non_exhaustive]
7259#[derive(Clone, PartialEq, ::prost::Message)]
7260pub struct SubscribeEventsResponse {
7261 #[prost(message, optional, tag = "1")]
7266 pub event: ::core::option::Option<Event>,
7267 #[prost(message, optional, tag = "2")]
7269 pub watermark: ::core::option::Option<Watermark>,
7270}
7271pub mod subscription_service_client {
7273 #![allow(
7274 unused_variables,
7275 dead_code,
7276 missing_docs,
7277 clippy::wildcard_imports,
7278 clippy::let_unit_value,
7279 )]
7280 use tonic::codegen::*;
7281 use tonic::codegen::http::Uri;
7282 #[derive(Debug, Clone)]
7310 pub struct SubscriptionServiceClient<T> {
7311 inner: tonic::client::Grpc<T>,
7312 }
7313 impl SubscriptionServiceClient<tonic::transport::Channel> {
7314 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7316 where
7317 D: TryInto<tonic::transport::Endpoint>,
7318 D::Error: Into<StdError>,
7319 {
7320 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7321 Ok(Self::new(conn))
7322 }
7323 }
7324 impl<T> SubscriptionServiceClient<T>
7325 where
7326 T: tonic::client::GrpcService<tonic::body::Body>,
7327 T::Error: Into<StdError>,
7328 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7329 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7330 {
7331 pub fn new(inner: T) -> Self {
7332 let inner = tonic::client::Grpc::new(inner);
7333 Self { inner }
7334 }
7335 pub fn with_origin(inner: T, origin: Uri) -> Self {
7336 let inner = tonic::client::Grpc::with_origin(inner, origin);
7337 Self { inner }
7338 }
7339 pub fn with_interceptor<F>(
7340 inner: T,
7341 interceptor: F,
7342 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
7343 where
7344 F: tonic::service::Interceptor,
7345 T::ResponseBody: Default,
7346 T: tonic::codegen::Service<
7347 http::Request<tonic::body::Body>,
7348 Response = http::Response<
7349 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7350 >,
7351 >,
7352 <T as tonic::codegen::Service<
7353 http::Request<tonic::body::Body>,
7354 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7355 {
7356 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
7357 }
7358 #[must_use]
7363 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7364 self.inner = self.inner.send_compressed(encoding);
7365 self
7366 }
7367 #[must_use]
7369 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7370 self.inner = self.inner.accept_compressed(encoding);
7371 self
7372 }
7373 #[must_use]
7377 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7378 self.inner = self.inner.max_decoding_message_size(limit);
7379 self
7380 }
7381 #[must_use]
7385 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7386 self.inner = self.inner.max_encoding_message_size(limit);
7387 self
7388 }
7389 pub async fn subscribe_checkpoints(
7396 &mut self,
7397 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
7398 ) -> std::result::Result<
7399 tonic::Response<
7400 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
7401 >,
7402 tonic::Status,
7403 > {
7404 self.inner
7405 .ready()
7406 .await
7407 .map_err(|e| {
7408 tonic::Status::unknown(
7409 format!("Service was not ready: {}", e.into()),
7410 )
7411 })?;
7412 let codec = tonic_prost::ProstCodec::default();
7413 let path = http::uri::PathAndQuery::from_static(
7414 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
7415 );
7416 let mut req = request.into_request();
7417 req.extensions_mut()
7418 .insert(
7419 GrpcMethod::new(
7420 "sui.rpc.v2.SubscriptionService",
7421 "SubscribeCheckpoints",
7422 ),
7423 );
7424 self.inner.server_streaming(req, path, codec).await
7425 }
7426 pub async fn subscribe_transactions(
7431 &mut self,
7432 request: impl tonic::IntoRequest<super::SubscribeTransactionsRequest>,
7433 ) -> std::result::Result<
7434 tonic::Response<
7435 tonic::codec::Streaming<super::SubscribeTransactionsResponse>,
7436 >,
7437 tonic::Status,
7438 > {
7439 self.inner
7440 .ready()
7441 .await
7442 .map_err(|e| {
7443 tonic::Status::unknown(
7444 format!("Service was not ready: {}", e.into()),
7445 )
7446 })?;
7447 let codec = tonic_prost::ProstCodec::default();
7448 let path = http::uri::PathAndQuery::from_static(
7449 "/sui.rpc.v2.SubscriptionService/SubscribeTransactions",
7450 );
7451 let mut req = request.into_request();
7452 req.extensions_mut()
7453 .insert(
7454 GrpcMethod::new(
7455 "sui.rpc.v2.SubscriptionService",
7456 "SubscribeTransactions",
7457 ),
7458 );
7459 self.inner.server_streaming(req, path, codec).await
7460 }
7461 pub async fn subscribe_events(
7466 &mut self,
7467 request: impl tonic::IntoRequest<super::SubscribeEventsRequest>,
7468 ) -> std::result::Result<
7469 tonic::Response<tonic::codec::Streaming<super::SubscribeEventsResponse>>,
7470 tonic::Status,
7471 > {
7472 self.inner
7473 .ready()
7474 .await
7475 .map_err(|e| {
7476 tonic::Status::unknown(
7477 format!("Service was not ready: {}", e.into()),
7478 )
7479 })?;
7480 let codec = tonic_prost::ProstCodec::default();
7481 let path = http::uri::PathAndQuery::from_static(
7482 "/sui.rpc.v2.SubscriptionService/SubscribeEvents",
7483 );
7484 let mut req = request.into_request();
7485 req.extensions_mut()
7486 .insert(
7487 GrpcMethod::new("sui.rpc.v2.SubscriptionService", "SubscribeEvents"),
7488 );
7489 self.inner.server_streaming(req, path, codec).await
7490 }
7491 }
7492}
7493pub mod subscription_service_server {
7495 #![allow(
7496 unused_variables,
7497 dead_code,
7498 missing_docs,
7499 clippy::wildcard_imports,
7500 clippy::let_unit_value,
7501 )]
7502 use tonic::codegen::*;
7503 #[async_trait]
7505 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
7506 async fn subscribe_checkpoints(
7513 &self,
7514 request: tonic::Request<super::SubscribeCheckpointsRequest>,
7515 ) -> std::result::Result<
7516 tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
7517 tonic::Status,
7518 > {
7519 Err(tonic::Status::unimplemented("Not yet implemented"))
7520 }
7521 async fn subscribe_transactions(
7526 &self,
7527 request: tonic::Request<super::SubscribeTransactionsRequest>,
7528 ) -> std::result::Result<
7529 tonic::Response<BoxStream<super::SubscribeTransactionsResponse>>,
7530 tonic::Status,
7531 > {
7532 Err(tonic::Status::unimplemented("Not yet implemented"))
7533 }
7534 async fn subscribe_events(
7539 &self,
7540 request: tonic::Request<super::SubscribeEventsRequest>,
7541 ) -> std::result::Result<
7542 tonic::Response<BoxStream<super::SubscribeEventsResponse>>,
7543 tonic::Status,
7544 > {
7545 Err(tonic::Status::unimplemented("Not yet implemented"))
7546 }
7547 }
7548 #[derive(Debug)]
7576 pub struct SubscriptionServiceServer<T> {
7577 inner: Arc<T>,
7578 accept_compression_encodings: EnabledCompressionEncodings,
7579 send_compression_encodings: EnabledCompressionEncodings,
7580 max_decoding_message_size: Option<usize>,
7581 max_encoding_message_size: Option<usize>,
7582 }
7583 impl<T> SubscriptionServiceServer<T> {
7584 pub fn new(inner: T) -> Self {
7585 Self::from_arc(Arc::new(inner))
7586 }
7587 pub fn from_arc(inner: Arc<T>) -> Self {
7588 Self {
7589 inner,
7590 accept_compression_encodings: Default::default(),
7591 send_compression_encodings: Default::default(),
7592 max_decoding_message_size: None,
7593 max_encoding_message_size: None,
7594 }
7595 }
7596 pub fn with_interceptor<F>(
7597 inner: T,
7598 interceptor: F,
7599 ) -> InterceptedService<Self, F>
7600 where
7601 F: tonic::service::Interceptor,
7602 {
7603 InterceptedService::new(Self::new(inner), interceptor)
7604 }
7605 #[must_use]
7607 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7608 self.accept_compression_encodings.enable(encoding);
7609 self
7610 }
7611 #[must_use]
7613 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7614 self.send_compression_encodings.enable(encoding);
7615 self
7616 }
7617 #[must_use]
7621 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7622 self.max_decoding_message_size = Some(limit);
7623 self
7624 }
7625 #[must_use]
7629 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7630 self.max_encoding_message_size = Some(limit);
7631 self
7632 }
7633 }
7634 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
7635 where
7636 T: SubscriptionService,
7637 B: Body + std::marker::Send + 'static,
7638 B::Error: Into<StdError> + std::marker::Send + 'static,
7639 {
7640 type Response = http::Response<tonic::body::Body>;
7641 type Error = std::convert::Infallible;
7642 type Future = BoxFuture<Self::Response, Self::Error>;
7643 fn poll_ready(
7644 &mut self,
7645 _cx: &mut Context<'_>,
7646 ) -> Poll<std::result::Result<(), Self::Error>> {
7647 Poll::Ready(Ok(()))
7648 }
7649 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7650 match req.uri().path() {
7651 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
7652 #[allow(non_camel_case_types)]
7653 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
7654 impl<
7655 T: SubscriptionService,
7656 > tonic::server::ServerStreamingService<
7657 super::SubscribeCheckpointsRequest,
7658 > for SubscribeCheckpointsSvc<T> {
7659 type Response = super::SubscribeCheckpointsResponse;
7660 type ResponseStream = BoxStream<
7661 super::SubscribeCheckpointsResponse,
7662 >;
7663 type Future = BoxFuture<
7664 tonic::Response<Self::ResponseStream>,
7665 tonic::Status,
7666 >;
7667 fn call(
7668 &mut self,
7669 request: tonic::Request<super::SubscribeCheckpointsRequest>,
7670 ) -> Self::Future {
7671 let inner = Arc::clone(&self.0);
7672 let fut = async move {
7673 <T as SubscriptionService>::subscribe_checkpoints(
7674 &inner,
7675 request,
7676 )
7677 .await
7678 };
7679 Box::pin(fut)
7680 }
7681 }
7682 let accept_compression_encodings = self.accept_compression_encodings;
7683 let send_compression_encodings = self.send_compression_encodings;
7684 let max_decoding_message_size = self.max_decoding_message_size;
7685 let max_encoding_message_size = self.max_encoding_message_size;
7686 let inner = self.inner.clone();
7687 let fut = async move {
7688 let method = SubscribeCheckpointsSvc(inner);
7689 let codec = tonic_prost::ProstCodec::default();
7690 let mut grpc = tonic::server::Grpc::new(codec)
7691 .apply_compression_config(
7692 accept_compression_encodings,
7693 send_compression_encodings,
7694 )
7695 .apply_max_message_size_config(
7696 max_decoding_message_size,
7697 max_encoding_message_size,
7698 );
7699 let res = grpc.server_streaming(method, req).await;
7700 Ok(res)
7701 };
7702 Box::pin(fut)
7703 }
7704 "/sui.rpc.v2.SubscriptionService/SubscribeTransactions" => {
7705 #[allow(non_camel_case_types)]
7706 struct SubscribeTransactionsSvc<T: SubscriptionService>(pub Arc<T>);
7707 impl<
7708 T: SubscriptionService,
7709 > tonic::server::ServerStreamingService<
7710 super::SubscribeTransactionsRequest,
7711 > for SubscribeTransactionsSvc<T> {
7712 type Response = super::SubscribeTransactionsResponse;
7713 type ResponseStream = BoxStream<
7714 super::SubscribeTransactionsResponse,
7715 >;
7716 type Future = BoxFuture<
7717 tonic::Response<Self::ResponseStream>,
7718 tonic::Status,
7719 >;
7720 fn call(
7721 &mut self,
7722 request: tonic::Request<super::SubscribeTransactionsRequest>,
7723 ) -> Self::Future {
7724 let inner = Arc::clone(&self.0);
7725 let fut = async move {
7726 <T as SubscriptionService>::subscribe_transactions(
7727 &inner,
7728 request,
7729 )
7730 .await
7731 };
7732 Box::pin(fut)
7733 }
7734 }
7735 let accept_compression_encodings = self.accept_compression_encodings;
7736 let send_compression_encodings = self.send_compression_encodings;
7737 let max_decoding_message_size = self.max_decoding_message_size;
7738 let max_encoding_message_size = self.max_encoding_message_size;
7739 let inner = self.inner.clone();
7740 let fut = async move {
7741 let method = SubscribeTransactionsSvc(inner);
7742 let codec = tonic_prost::ProstCodec::default();
7743 let mut grpc = tonic::server::Grpc::new(codec)
7744 .apply_compression_config(
7745 accept_compression_encodings,
7746 send_compression_encodings,
7747 )
7748 .apply_max_message_size_config(
7749 max_decoding_message_size,
7750 max_encoding_message_size,
7751 );
7752 let res = grpc.server_streaming(method, req).await;
7753 Ok(res)
7754 };
7755 Box::pin(fut)
7756 }
7757 "/sui.rpc.v2.SubscriptionService/SubscribeEvents" => {
7758 #[allow(non_camel_case_types)]
7759 struct SubscribeEventsSvc<T: SubscriptionService>(pub Arc<T>);
7760 impl<
7761 T: SubscriptionService,
7762 > tonic::server::ServerStreamingService<
7763 super::SubscribeEventsRequest,
7764 > for SubscribeEventsSvc<T> {
7765 type Response = super::SubscribeEventsResponse;
7766 type ResponseStream = BoxStream<super::SubscribeEventsResponse>;
7767 type Future = BoxFuture<
7768 tonic::Response<Self::ResponseStream>,
7769 tonic::Status,
7770 >;
7771 fn call(
7772 &mut self,
7773 request: tonic::Request<super::SubscribeEventsRequest>,
7774 ) -> Self::Future {
7775 let inner = Arc::clone(&self.0);
7776 let fut = async move {
7777 <T as SubscriptionService>::subscribe_events(
7778 &inner,
7779 request,
7780 )
7781 .await
7782 };
7783 Box::pin(fut)
7784 }
7785 }
7786 let accept_compression_encodings = self.accept_compression_encodings;
7787 let send_compression_encodings = self.send_compression_encodings;
7788 let max_decoding_message_size = self.max_decoding_message_size;
7789 let max_encoding_message_size = self.max_encoding_message_size;
7790 let inner = self.inner.clone();
7791 let fut = async move {
7792 let method = SubscribeEventsSvc(inner);
7793 let codec = tonic_prost::ProstCodec::default();
7794 let mut grpc = tonic::server::Grpc::new(codec)
7795 .apply_compression_config(
7796 accept_compression_encodings,
7797 send_compression_encodings,
7798 )
7799 .apply_max_message_size_config(
7800 max_decoding_message_size,
7801 max_encoding_message_size,
7802 );
7803 let res = grpc.server_streaming(method, req).await;
7804 Ok(res)
7805 };
7806 Box::pin(fut)
7807 }
7808 _ => {
7809 Box::pin(async move {
7810 let mut response = http::Response::new(
7811 tonic::body::Body::default(),
7812 );
7813 let headers = response.headers_mut();
7814 headers
7815 .insert(
7816 tonic::Status::GRPC_STATUS,
7817 (tonic::Code::Unimplemented as i32).into(),
7818 );
7819 headers
7820 .insert(
7821 http::header::CONTENT_TYPE,
7822 tonic::metadata::GRPC_CONTENT_TYPE,
7823 );
7824 Ok(response)
7825 })
7826 }
7827 }
7828 }
7829 }
7830 impl<T> Clone for SubscriptionServiceServer<T> {
7831 fn clone(&self) -> Self {
7832 let inner = self.inner.clone();
7833 Self {
7834 inner,
7835 accept_compression_encodings: self.accept_compression_encodings,
7836 send_compression_encodings: self.send_compression_encodings,
7837 max_decoding_message_size: self.max_decoding_message_size,
7838 max_encoding_message_size: self.max_encoding_message_size,
7839 }
7840 }
7841 }
7842 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
7844 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
7845 const NAME: &'static str = SERVICE_NAME;
7846 }
7847}
7848#[non_exhaustive]
7849#[derive(Clone, PartialEq, ::prost::Message)]
7850pub struct SystemState {
7851 #[prost(uint64, optional, tag = "1")]
7853 pub version: ::core::option::Option<u64>,
7854 #[prost(uint64, optional, tag = "2")]
7856 pub epoch: ::core::option::Option<u64>,
7857 #[prost(uint64, optional, tag = "3")]
7859 pub protocol_version: ::core::option::Option<u64>,
7860 #[prost(message, optional, tag = "4")]
7862 pub validators: ::core::option::Option<ValidatorSet>,
7863 #[prost(message, optional, tag = "5")]
7865 pub storage_fund: ::core::option::Option<StorageFund>,
7866 #[prost(message, optional, tag = "6")]
7868 pub parameters: ::core::option::Option<SystemParameters>,
7869 #[prost(uint64, optional, tag = "7")]
7871 pub reference_gas_price: ::core::option::Option<u64>,
7872 #[prost(message, repeated, tag = "8")]
7880 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
7881 #[prost(message, optional, tag = "9")]
7883 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
7884 #[prost(bool, optional, tag = "10")]
7891 pub safe_mode: ::core::option::Option<bool>,
7892 #[prost(uint64, optional, tag = "11")]
7894 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
7895 #[prost(uint64, optional, tag = "12")]
7897 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
7898 #[prost(uint64, optional, tag = "13")]
7900 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
7901 #[prost(uint64, optional, tag = "14")]
7903 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
7904 #[prost(uint64, optional, tag = "15")]
7906 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
7907 #[prost(message, optional, tag = "16")]
7909 pub extra_fields: ::core::option::Option<MoveTable>,
7910}
7911#[non_exhaustive]
7912#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7913pub struct ValidatorReportRecord {
7914 #[prost(string, optional, tag = "1")]
7916 pub reported: ::core::option::Option<::prost::alloc::string::String>,
7917 #[prost(string, repeated, tag = "2")]
7919 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7920}
7921#[non_exhaustive]
7922#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7923pub struct SystemParameters {
7924 #[prost(uint64, optional, tag = "1")]
7926 pub epoch_duration_ms: ::core::option::Option<u64>,
7927 #[prost(uint64, optional, tag = "2")]
7929 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
7930 #[prost(uint64, optional, tag = "3")]
7932 pub min_validator_count: ::core::option::Option<u64>,
7933 #[prost(uint64, optional, tag = "4")]
7936 pub max_validator_count: ::core::option::Option<u64>,
7937 #[prost(uint64, optional, tag = "5")]
7940 pub min_validator_joining_stake: ::core::option::Option<u64>,
7941 #[prost(uint64, optional, tag = "6")]
7946 pub validator_low_stake_threshold: ::core::option::Option<u64>,
7947 #[prost(uint64, optional, tag = "7")]
7951 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
7952 #[prost(uint64, optional, tag = "8")]
7955 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
7956 #[prost(message, optional, tag = "9")]
7958 pub extra_fields: ::core::option::Option<MoveTable>,
7959}
7960#[non_exhaustive]
7962#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7963pub struct MoveTable {
7964 #[prost(string, optional, tag = "1")]
7966 pub id: ::core::option::Option<::prost::alloc::string::String>,
7967 #[prost(uint64, optional, tag = "2")]
7969 pub size: ::core::option::Option<u64>,
7970}
7971#[non_exhaustive]
7972#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7973pub struct StakeSubsidy {
7974 #[prost(uint64, optional, tag = "1")]
7976 pub balance: ::core::option::Option<u64>,
7977 #[prost(uint64, optional, tag = "2")]
7979 pub distribution_counter: ::core::option::Option<u64>,
7980 #[prost(uint64, optional, tag = "3")]
7983 pub current_distribution_amount: ::core::option::Option<u64>,
7984 #[prost(uint64, optional, tag = "4")]
7986 pub stake_subsidy_period_length: ::core::option::Option<u64>,
7987 #[prost(uint32, optional, tag = "5")]
7990 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
7991 #[prost(message, optional, tag = "6")]
7993 pub extra_fields: ::core::option::Option<MoveTable>,
7994}
7995#[non_exhaustive]
7997#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7998pub struct StorageFund {
7999 #[prost(uint64, optional, tag = "1")]
8005 pub total_object_storage_rebates: ::core::option::Option<u64>,
8006 #[prost(uint64, optional, tag = "2")]
8009 pub non_refundable_balance: ::core::option::Option<u64>,
8010}
8011#[non_exhaustive]
8012#[derive(Clone, PartialEq, ::prost::Message)]
8013pub struct ValidatorSet {
8014 #[prost(uint64, optional, tag = "1")]
8017 pub total_stake: ::core::option::Option<u64>,
8018 #[prost(message, repeated, tag = "2")]
8020 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
8021 #[prost(message, optional, tag = "3")]
8026 pub pending_active_validators: ::core::option::Option<MoveTable>,
8027 #[prost(uint64, repeated, tag = "4")]
8030 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
8031 #[prost(message, optional, tag = "5")]
8035 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
8036 #[prost(message, optional, tag = "6")]
8042 pub inactive_validators: ::core::option::Option<MoveTable>,
8043 #[prost(message, optional, tag = "7")]
8051 pub validator_candidates: ::core::option::Option<MoveTable>,
8052 #[prost(btree_map = "string, uint64", tag = "8")]
8054 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
8055 ::prost::alloc::string::String,
8056 u64,
8057 >,
8058 #[prost(message, optional, tag = "9")]
8060 pub extra_fields: ::core::option::Option<MoveTable>,
8061}
8062#[non_exhaustive]
8066#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8067pub struct Validator {
8068 #[prost(string, optional, tag = "1")]
8070 pub name: ::core::option::Option<::prost::alloc::string::String>,
8071 #[prost(string, optional, tag = "2")]
8074 pub address: ::core::option::Option<::prost::alloc::string::String>,
8075 #[prost(string, optional, tag = "3")]
8076 pub description: ::core::option::Option<::prost::alloc::string::String>,
8077 #[prost(string, optional, tag = "4")]
8078 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
8079 #[prost(string, optional, tag = "5")]
8080 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
8081 #[prost(bytes = "bytes", optional, tag = "7")]
8084 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8085 #[prost(bytes = "bytes", optional, tag = "8")]
8087 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8088 #[prost(bytes = "bytes", optional, tag = "10")]
8091 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8092 #[prost(bytes = "bytes", optional, tag = "12")]
8094 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8095 #[prost(string, optional, tag = "13")]
8097 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
8098 #[prost(string, optional, tag = "14")]
8100 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8101 #[prost(string, optional, tag = "15")]
8103 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
8104 #[prost(string, optional, tag = "16")]
8106 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
8107 #[prost(bytes = "bytes", optional, tag = "18")]
8108 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8109 #[prost(bytes = "bytes", optional, tag = "19")]
8110 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8111 #[prost(bytes = "bytes", optional, tag = "21")]
8112 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8113 #[prost(bytes = "bytes", optional, tag = "23")]
8114 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8115 #[prost(string, optional, tag = "24")]
8116 pub next_epoch_network_address: ::core::option::Option<
8117 ::prost::alloc::string::String,
8118 >,
8119 #[prost(string, optional, tag = "25")]
8120 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8121 #[prost(string, optional, tag = "26")]
8122 pub next_epoch_primary_address: ::core::option::Option<
8123 ::prost::alloc::string::String,
8124 >,
8125 #[prost(string, optional, tag = "27")]
8126 pub next_epoch_worker_address: ::core::option::Option<
8127 ::prost::alloc::string::String,
8128 >,
8129 #[prost(message, optional, tag = "28")]
8131 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
8132 #[prost(uint64, optional, tag = "29")]
8135 pub voting_power: ::core::option::Option<u64>,
8136 #[prost(string, optional, tag = "30")]
8138 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
8139 #[prost(uint64, optional, tag = "31")]
8141 pub gas_price: ::core::option::Option<u64>,
8142 #[prost(message, optional, tag = "32")]
8144 pub staking_pool: ::core::option::Option<StakingPool>,
8145 #[prost(uint64, optional, tag = "33")]
8147 pub commission_rate: ::core::option::Option<u64>,
8148 #[prost(uint64, optional, tag = "34")]
8150 pub next_epoch_stake: ::core::option::Option<u64>,
8151 #[prost(uint64, optional, tag = "35")]
8153 pub next_epoch_gas_price: ::core::option::Option<u64>,
8154 #[prost(uint64, optional, tag = "36")]
8156 pub next_epoch_commission_rate: ::core::option::Option<u64>,
8157 #[prost(message, optional, tag = "37")]
8159 pub extra_fields: ::core::option::Option<MoveTable>,
8160}
8161#[non_exhaustive]
8163#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8164pub struct StakingPool {
8165 #[prost(string, optional, tag = "1")]
8167 pub id: ::core::option::Option<::prost::alloc::string::String>,
8168 #[prost(uint64, optional, tag = "2")]
8171 pub activation_epoch: ::core::option::Option<u64>,
8172 #[prost(uint64, optional, tag = "3")]
8175 pub deactivation_epoch: ::core::option::Option<u64>,
8176 #[prost(uint64, optional, tag = "4")]
8179 pub sui_balance: ::core::option::Option<u64>,
8180 #[prost(uint64, optional, tag = "5")]
8182 pub rewards_pool: ::core::option::Option<u64>,
8183 #[prost(uint64, optional, tag = "6")]
8185 pub pool_token_balance: ::core::option::Option<u64>,
8186 #[prost(message, optional, tag = "7")]
8193 pub exchange_rates: ::core::option::Option<MoveTable>,
8194 #[prost(uint64, optional, tag = "8")]
8196 pub pending_stake: ::core::option::Option<u64>,
8197 #[prost(uint64, optional, tag = "9")]
8200 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
8201 #[prost(uint64, optional, tag = "10")]
8203 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
8204 #[prost(message, optional, tag = "11")]
8206 pub extra_fields: ::core::option::Option<MoveTable>,
8207}
8208#[non_exhaustive]
8210#[derive(Clone, PartialEq, ::prost::Message)]
8211pub struct Transaction {
8212 #[prost(message, optional, tag = "1")]
8214 pub bcs: ::core::option::Option<Bcs>,
8215 #[prost(string, optional, tag = "2")]
8217 pub digest: ::core::option::Option<::prost::alloc::string::String>,
8218 #[prost(int32, optional, tag = "3")]
8220 pub version: ::core::option::Option<i32>,
8221 #[prost(message, optional, tag = "4")]
8222 pub kind: ::core::option::Option<TransactionKind>,
8223 #[prost(string, optional, tag = "5")]
8224 pub sender: ::core::option::Option<::prost::alloc::string::String>,
8225 #[prost(message, optional, tag = "6")]
8226 pub gas_payment: ::core::option::Option<GasPayment>,
8227 #[prost(message, optional, tag = "7")]
8228 pub expiration: ::core::option::Option<TransactionExpiration>,
8229}
8230#[non_exhaustive]
8232#[derive(Clone, PartialEq, ::prost::Message)]
8233pub struct GasPayment {
8234 #[prost(message, repeated, tag = "1")]
8236 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
8237 #[prost(string, optional, tag = "2")]
8239 pub owner: ::core::option::Option<::prost::alloc::string::String>,
8240 #[prost(uint64, optional, tag = "3")]
8244 pub price: ::core::option::Option<u64>,
8245 #[prost(uint64, optional, tag = "4")]
8247 pub budget: ::core::option::Option<u64>,
8248}
8249#[non_exhaustive]
8251#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8252pub struct TransactionExpiration {
8253 #[prost(
8254 enumeration = "transaction_expiration::TransactionExpirationKind",
8255 optional,
8256 tag = "1"
8257 )]
8258 pub kind: ::core::option::Option<i32>,
8259 #[prost(uint64, optional, tag = "2")]
8262 pub epoch: ::core::option::Option<u64>,
8263 #[prost(uint64, optional, tag = "3")]
8266 pub min_epoch: ::core::option::Option<u64>,
8267 #[prost(message, optional, tag = "4")]
8271 pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8272 #[prost(message, optional, tag = "5")]
8276 pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8277 #[prost(string, optional, tag = "6")]
8279 pub chain: ::core::option::Option<::prost::alloc::string::String>,
8280 #[prost(uint32, optional, tag = "7")]
8282 pub nonce: ::core::option::Option<u32>,
8283}
8284pub mod transaction_expiration {
8286 #[non_exhaustive]
8287 #[derive(
8288 Clone,
8289 Copy,
8290 Debug,
8291 PartialEq,
8292 Eq,
8293 Hash,
8294 PartialOrd,
8295 Ord,
8296 ::prost::Enumeration
8297 )]
8298 #[repr(i32)]
8299 pub enum TransactionExpirationKind {
8300 Unknown = 0,
8301 None = 1,
8303 Epoch = 2,
8306 ValidDuring = 3,
8316 }
8317 impl TransactionExpirationKind {
8318 pub fn as_str_name(&self) -> &'static str {
8323 match self {
8324 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
8325 Self::None => "NONE",
8326 Self::Epoch => "EPOCH",
8327 Self::ValidDuring => "VALID_DURING",
8328 }
8329 }
8330 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8332 match value {
8333 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
8334 "NONE" => Some(Self::None),
8335 "EPOCH" => Some(Self::Epoch),
8336 "VALID_DURING" => Some(Self::ValidDuring),
8337 _ => None,
8338 }
8339 }
8340 }
8341}
8342#[non_exhaustive]
8344#[derive(Clone, PartialEq, ::prost::Message)]
8345pub struct TransactionKind {
8346 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
8347 pub kind: ::core::option::Option<i32>,
8348 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
8349 pub data: ::core::option::Option<transaction_kind::Data>,
8350}
8351pub mod transaction_kind {
8353 #[non_exhaustive]
8354 #[derive(
8355 Clone,
8356 Copy,
8357 Debug,
8358 PartialEq,
8359 Eq,
8360 Hash,
8361 PartialOrd,
8362 Ord,
8363 ::prost::Enumeration
8364 )]
8365 #[repr(i32)]
8366 pub enum Kind {
8367 Unknown = 0,
8368 ProgrammableTransaction = 1,
8370 ChangeEpoch = 2,
8375 Genesis = 3,
8380 ConsensusCommitPrologueV1 = 4,
8382 AuthenticatorStateUpdate = 5,
8384 EndOfEpoch = 6,
8387 RandomnessStateUpdate = 7,
8389 ConsensusCommitPrologueV2 = 8,
8391 ConsensusCommitPrologueV3 = 9,
8393 ConsensusCommitPrologueV4 = 10,
8395 ProgrammableSystemTransaction = 11,
8397 }
8398 impl Kind {
8399 pub fn as_str_name(&self) -> &'static str {
8404 match self {
8405 Self::Unknown => "KIND_UNKNOWN",
8406 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
8407 Self::ChangeEpoch => "CHANGE_EPOCH",
8408 Self::Genesis => "GENESIS",
8409 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
8410 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
8411 Self::EndOfEpoch => "END_OF_EPOCH",
8412 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
8413 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
8414 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
8415 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
8416 Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
8417 }
8418 }
8419 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8421 match value {
8422 "KIND_UNKNOWN" => Some(Self::Unknown),
8423 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
8424 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8425 "GENESIS" => Some(Self::Genesis),
8426 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
8427 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
8428 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
8429 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
8430 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
8431 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
8432 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
8433 "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
8434 Some(Self::ProgrammableSystemTransaction)
8435 }
8436 _ => None,
8437 }
8438 }
8439 }
8440 #[non_exhaustive]
8441 #[derive(Clone, PartialEq, ::prost::Oneof)]
8442 pub enum Data {
8443 #[prost(message, tag = "2")]
8445 ProgrammableTransaction(super::ProgrammableTransaction),
8446 #[prost(message, tag = "3")]
8451 ChangeEpoch(super::ChangeEpoch),
8452 #[prost(message, tag = "4")]
8457 Genesis(super::GenesisTransaction),
8458 #[prost(message, tag = "5")]
8460 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
8461 #[prost(message, tag = "6")]
8463 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
8464 #[prost(message, tag = "7")]
8467 EndOfEpoch(super::EndOfEpochTransaction),
8468 #[prost(message, tag = "8")]
8470 RandomnessStateUpdate(super::RandomnessStateUpdate),
8471 }
8472}
8473#[non_exhaustive]
8478#[derive(Clone, PartialEq, ::prost::Message)]
8479pub struct ProgrammableTransaction {
8480 #[prost(message, repeated, tag = "1")]
8482 pub inputs: ::prost::alloc::vec::Vec<Input>,
8483 #[prost(message, repeated, tag = "2")]
8486 pub commands: ::prost::alloc::vec::Vec<Command>,
8487}
8488#[non_exhaustive]
8490#[derive(Clone, PartialEq, ::prost::Message)]
8491pub struct Command {
8492 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
8493 pub command: ::core::option::Option<command::Command>,
8494}
8495pub mod command {
8497 #[non_exhaustive]
8498 #[derive(Clone, PartialEq, ::prost::Oneof)]
8499 pub enum Command {
8500 #[prost(message, tag = "1")]
8502 MoveCall(super::MoveCall),
8503 #[prost(message, tag = "2")]
8508 TransferObjects(super::TransferObjects),
8509 #[prost(message, tag = "3")]
8512 SplitCoins(super::SplitCoins),
8513 #[prost(message, tag = "4")]
8516 MergeCoins(super::MergeCoins),
8517 #[prost(message, tag = "5")]
8520 Publish(super::Publish),
8521 #[prost(message, tag = "6")]
8525 MakeMoveVector(super::MakeMoveVector),
8526 #[prost(message, tag = "7")]
8535 Upgrade(super::Upgrade),
8536 }
8537}
8538#[non_exhaustive]
8543#[derive(Clone, PartialEq, ::prost::Message)]
8544pub struct MoveCall {
8545 #[prost(string, optional, tag = "1")]
8547 pub package: ::core::option::Option<::prost::alloc::string::String>,
8548 #[prost(string, optional, tag = "2")]
8550 pub module: ::core::option::Option<::prost::alloc::string::String>,
8551 #[prost(string, optional, tag = "3")]
8553 pub function: ::core::option::Option<::prost::alloc::string::String>,
8554 #[prost(string, repeated, tag = "4")]
8556 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8557 #[prost(message, repeated, tag = "5")]
8559 pub arguments: ::prost::alloc::vec::Vec<Argument>,
8560}
8561#[non_exhaustive]
8563#[derive(Clone, PartialEq, ::prost::Message)]
8564pub struct TransferObjects {
8565 #[prost(message, repeated, tag = "1")]
8567 pub objects: ::prost::alloc::vec::Vec<Argument>,
8568 #[prost(message, optional, tag = "2")]
8570 pub address: ::core::option::Option<Argument>,
8571}
8572#[non_exhaustive]
8574#[derive(Clone, PartialEq, ::prost::Message)]
8575pub struct SplitCoins {
8576 #[prost(message, optional, tag = "1")]
8578 pub coin: ::core::option::Option<Argument>,
8579 #[prost(message, repeated, tag = "2")]
8581 pub amounts: ::prost::alloc::vec::Vec<Argument>,
8582}
8583#[non_exhaustive]
8585#[derive(Clone, PartialEq, ::prost::Message)]
8586pub struct MergeCoins {
8587 #[prost(message, optional, tag = "1")]
8589 pub coin: ::core::option::Option<Argument>,
8590 #[prost(message, repeated, tag = "2")]
8594 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
8595}
8596#[non_exhaustive]
8598#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8599pub struct Publish {
8600 #[prost(bytes = "bytes", repeated, tag = "1")]
8602 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8603 #[prost(string, repeated, tag = "2")]
8605 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8606}
8607#[non_exhaustive]
8609#[derive(Clone, PartialEq, ::prost::Message)]
8610pub struct MakeMoveVector {
8611 #[prost(string, optional, tag = "1")]
8616 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
8617 #[prost(message, repeated, tag = "2")]
8619 pub elements: ::prost::alloc::vec::Vec<Argument>,
8620}
8621#[non_exhaustive]
8623#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8624pub struct Upgrade {
8625 #[prost(bytes = "bytes", repeated, tag = "1")]
8627 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8628 #[prost(string, repeated, tag = "2")]
8630 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8631 #[prost(string, optional, tag = "3")]
8633 pub package: ::core::option::Option<::prost::alloc::string::String>,
8634 #[prost(message, optional, tag = "4")]
8636 pub ticket: ::core::option::Option<Argument>,
8637}
8638#[non_exhaustive]
8640#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8641pub struct RandomnessStateUpdate {
8642 #[prost(uint64, optional, tag = "1")]
8644 pub epoch: ::core::option::Option<u64>,
8645 #[prost(uint64, optional, tag = "2")]
8647 pub randomness_round: ::core::option::Option<u64>,
8648 #[prost(bytes = "bytes", optional, tag = "3")]
8650 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
8651 #[prost(uint64, optional, tag = "4")]
8653 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
8654}
8655#[non_exhaustive]
8657#[derive(Clone, PartialEq, ::prost::Message)]
8658pub struct ChangeEpoch {
8659 #[prost(uint64, optional, tag = "1")]
8661 pub epoch: ::core::option::Option<u64>,
8662 #[prost(uint64, optional, tag = "2")]
8664 pub protocol_version: ::core::option::Option<u64>,
8665 #[prost(uint64, optional, tag = "3")]
8667 pub storage_charge: ::core::option::Option<u64>,
8668 #[prost(uint64, optional, tag = "4")]
8670 pub computation_charge: ::core::option::Option<u64>,
8671 #[prost(uint64, optional, tag = "5")]
8673 pub storage_rebate: ::core::option::Option<u64>,
8674 #[prost(uint64, optional, tag = "6")]
8676 pub non_refundable_storage_fee: ::core::option::Option<u64>,
8677 #[prost(message, optional, tag = "7")]
8679 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8680 #[prost(message, repeated, tag = "8")]
8686 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
8687}
8688#[non_exhaustive]
8690#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8691pub struct SystemPackage {
8692 #[prost(uint64, optional, tag = "1")]
8694 pub version: ::core::option::Option<u64>,
8695 #[prost(bytes = "bytes", repeated, tag = "2")]
8697 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8698 #[prost(string, repeated, tag = "3")]
8700 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8701}
8702#[non_exhaustive]
8704#[derive(Clone, PartialEq, ::prost::Message)]
8705pub struct GenesisTransaction {
8706 #[prost(message, repeated, tag = "1")]
8708 pub objects: ::prost::alloc::vec::Vec<Object>,
8709}
8710#[non_exhaustive]
8714#[derive(Clone, PartialEq, ::prost::Message)]
8715pub struct ConsensusCommitPrologue {
8716 #[prost(uint64, optional, tag = "1")]
8720 pub epoch: ::core::option::Option<u64>,
8721 #[prost(uint64, optional, tag = "2")]
8725 pub round: ::core::option::Option<u64>,
8726 #[prost(message, optional, tag = "3")]
8730 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8731 #[prost(string, optional, tag = "4")]
8735 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
8736 #[prost(uint64, optional, tag = "5")]
8741 pub sub_dag_index: ::core::option::Option<u64>,
8742 #[prost(message, optional, tag = "6")]
8746 pub consensus_determined_version_assignments: ::core::option::Option<
8747 ConsensusDeterminedVersionAssignments,
8748 >,
8749 #[prost(string, optional, tag = "7")]
8754 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
8755}
8756#[non_exhaustive]
8758#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8759pub struct VersionAssignment {
8760 #[prost(string, optional, tag = "1")]
8762 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
8763 #[prost(uint64, optional, tag = "2")]
8765 pub start_version: ::core::option::Option<u64>,
8766 #[prost(uint64, optional, tag = "3")]
8768 pub version: ::core::option::Option<u64>,
8769}
8770#[non_exhaustive]
8772#[derive(Clone, PartialEq, ::prost::Message)]
8773pub struct CanceledTransaction {
8774 #[prost(string, optional, tag = "1")]
8776 pub digest: ::core::option::Option<::prost::alloc::string::String>,
8777 #[prost(message, repeated, tag = "2")]
8779 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
8780}
8781#[non_exhaustive]
8783#[derive(Clone, PartialEq, ::prost::Message)]
8784pub struct ConsensusDeterminedVersionAssignments {
8785 #[prost(int32, optional, tag = "1")]
8787 pub version: ::core::option::Option<i32>,
8788 #[prost(message, repeated, tag = "3")]
8790 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
8791}
8792#[non_exhaustive]
8794#[derive(Clone, PartialEq, ::prost::Message)]
8795pub struct AuthenticatorStateUpdate {
8796 #[prost(uint64, optional, tag = "1")]
8798 pub epoch: ::core::option::Option<u64>,
8799 #[prost(uint64, optional, tag = "2")]
8801 pub round: ::core::option::Option<u64>,
8802 #[prost(message, repeated, tag = "3")]
8804 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
8805 #[prost(uint64, optional, tag = "4")]
8807 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
8808}
8809#[non_exhaustive]
8811#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8812pub struct ActiveJwk {
8813 #[prost(message, optional, tag = "1")]
8815 pub id: ::core::option::Option<JwkId>,
8816 #[prost(message, optional, tag = "2")]
8818 pub jwk: ::core::option::Option<Jwk>,
8819 #[prost(uint64, optional, tag = "3")]
8821 pub epoch: ::core::option::Option<u64>,
8822}
8823#[non_exhaustive]
8826#[derive(Clone, PartialEq, ::prost::Message)]
8827pub struct EndOfEpochTransaction {
8828 #[prost(message, repeated, tag = "1")]
8829 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
8830}
8831#[non_exhaustive]
8833#[derive(Clone, PartialEq, ::prost::Message)]
8834pub struct EndOfEpochTransactionKind {
8835 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
8836 pub kind: ::core::option::Option<i32>,
8837 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
8838 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
8839}
8840pub mod end_of_epoch_transaction_kind {
8842 #[non_exhaustive]
8843 #[derive(
8844 Clone,
8845 Copy,
8846 Debug,
8847 PartialEq,
8848 Eq,
8849 Hash,
8850 PartialOrd,
8851 Ord,
8852 ::prost::Enumeration
8853 )]
8854 #[repr(i32)]
8855 pub enum Kind {
8856 Unknown = 0,
8857 ChangeEpoch = 1,
8859 AuthenticatorStateCreate = 2,
8861 AuthenticatorStateExpire = 3,
8863 RandomnessStateCreate = 4,
8865 DenyListStateCreate = 5,
8867 BridgeStateCreate = 6,
8869 BridgeCommitteeInit = 7,
8871 StoreExecutionTimeObservations = 8,
8873 AccumulatorRootCreate = 9,
8875 CoinRegistryCreate = 10,
8877 DisplayRegistryCreate = 11,
8879 AddressAliasStateCreate = 12,
8881 WriteAccumulatorStorageCost = 13,
8883 ForwardingAddressRegistryCreate = 14,
8885 }
8886 impl Kind {
8887 pub fn as_str_name(&self) -> &'static str {
8892 match self {
8893 Self::Unknown => "KIND_UNKNOWN",
8894 Self::ChangeEpoch => "CHANGE_EPOCH",
8895 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
8896 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
8897 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
8898 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
8899 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
8900 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
8901 Self::StoreExecutionTimeObservations => {
8902 "STORE_EXECUTION_TIME_OBSERVATIONS"
8903 }
8904 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
8905 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
8906 Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
8907 Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
8908 Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
8909 Self::ForwardingAddressRegistryCreate => {
8910 "FORWARDING_ADDRESS_REGISTRY_CREATE"
8911 }
8912 }
8913 }
8914 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8916 match value {
8917 "KIND_UNKNOWN" => Some(Self::Unknown),
8918 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8919 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
8920 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
8921 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
8922 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
8923 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
8924 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
8925 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
8926 Some(Self::StoreExecutionTimeObservations)
8927 }
8928 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
8929 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
8930 "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
8931 "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
8932 "WRITE_ACCUMULATOR_STORAGE_COST" => {
8933 Some(Self::WriteAccumulatorStorageCost)
8934 }
8935 "FORWARDING_ADDRESS_REGISTRY_CREATE" => {
8936 Some(Self::ForwardingAddressRegistryCreate)
8937 }
8938 _ => None,
8939 }
8940 }
8941 }
8942 #[non_exhaustive]
8943 #[derive(Clone, PartialEq, ::prost::Oneof)]
8944 pub enum Data {
8945 #[prost(message, tag = "2")]
8947 ChangeEpoch(super::ChangeEpoch),
8948 #[prost(message, tag = "3")]
8950 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
8951 #[prost(message, tag = "4")]
8953 ExecutionTimeObservations(super::ExecutionTimeObservations),
8954 #[prost(string, tag = "5")]
8956 BridgeChainId(::prost::alloc::string::String),
8957 #[prost(uint64, tag = "6")]
8959 BridgeObjectVersion(u64),
8960 #[prost(uint64, tag = "7")]
8962 StorageCost(u64),
8963 }
8964}
8965#[non_exhaustive]
8967#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8968pub struct AuthenticatorStateExpire {
8969 #[prost(uint64, optional, tag = "1")]
8971 pub min_epoch: ::core::option::Option<u64>,
8972 #[prost(uint64, optional, tag = "2")]
8974 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
8975}
8976#[non_exhaustive]
8977#[derive(Clone, PartialEq, ::prost::Message)]
8978pub struct ExecutionTimeObservations {
8979 #[prost(int32, optional, tag = "1")]
8981 pub version: ::core::option::Option<i32>,
8982 #[prost(message, repeated, tag = "2")]
8983 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
8984}
8985#[non_exhaustive]
8986#[derive(Clone, PartialEq, ::prost::Message)]
8987pub struct ExecutionTimeObservation {
8988 #[prost(
8989 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
8990 optional,
8991 tag = "1"
8992 )]
8993 pub kind: ::core::option::Option<i32>,
8994 #[prost(message, optional, tag = "2")]
8995 pub move_entry_point: ::core::option::Option<MoveCall>,
8996 #[prost(message, repeated, tag = "3")]
8997 pub validator_observations: ::prost::alloc::vec::Vec<
8998 ValidatorExecutionTimeObservation,
8999 >,
9000}
9001pub mod execution_time_observation {
9003 #[non_exhaustive]
9004 #[derive(
9005 Clone,
9006 Copy,
9007 Debug,
9008 PartialEq,
9009 Eq,
9010 Hash,
9011 PartialOrd,
9012 Ord,
9013 ::prost::Enumeration
9014 )]
9015 #[repr(i32)]
9016 pub enum ExecutionTimeObservationKind {
9017 Unknown = 0,
9018 MoveEntryPoint = 1,
9019 TransferObjects = 2,
9020 SplitCoins = 3,
9021 MergeCoins = 4,
9022 Publish = 5,
9023 MakeMoveVector = 6,
9024 Upgrade = 7,
9025 }
9026 impl ExecutionTimeObservationKind {
9027 pub fn as_str_name(&self) -> &'static str {
9032 match self {
9033 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
9034 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
9035 Self::TransferObjects => "TRANSFER_OBJECTS",
9036 Self::SplitCoins => "SPLIT_COINS",
9037 Self::MergeCoins => "MERGE_COINS",
9038 Self::Publish => "PUBLISH",
9039 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
9040 Self::Upgrade => "UPGRADE",
9041 }
9042 }
9043 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9045 match value {
9046 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
9047 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
9048 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
9049 "SPLIT_COINS" => Some(Self::SplitCoins),
9050 "MERGE_COINS" => Some(Self::MergeCoins),
9051 "PUBLISH" => Some(Self::Publish),
9052 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
9053 "UPGRADE" => Some(Self::Upgrade),
9054 _ => None,
9055 }
9056 }
9057 }
9058}
9059#[non_exhaustive]
9060#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9061pub struct ValidatorExecutionTimeObservation {
9062 #[prost(bytes = "bytes", optional, tag = "1")]
9064 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
9065 #[prost(message, optional, tag = "2")]
9067 pub duration: ::core::option::Option<::prost_types::Duration>,
9068}
9069#[non_exhaustive]
9070#[derive(Clone, PartialEq, ::prost::Message)]
9071pub struct ExecuteTransactionRequest {
9072 #[prost(message, optional, tag = "1")]
9074 pub transaction: ::core::option::Option<Transaction>,
9075 #[prost(message, repeated, tag = "2")]
9078 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
9079 #[prost(message, optional, tag = "3")]
9082 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9083}
9084#[non_exhaustive]
9086#[derive(Clone, PartialEq, ::prost::Message)]
9087pub struct ExecuteTransactionResponse {
9088 #[prost(message, optional, tag = "1")]
9089 pub transaction: ::core::option::Option<ExecutedTransaction>,
9090}
9091#[non_exhaustive]
9092#[derive(Clone, PartialEq, ::prost::Message)]
9093pub struct SimulateTransactionRequest {
9094 #[prost(message, optional, tag = "1")]
9095 pub transaction: ::core::option::Option<Transaction>,
9096 #[prost(message, optional, tag = "2")]
9098 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9099 #[prost(
9101 enumeration = "simulate_transaction_request::TransactionChecks",
9102 optional,
9103 tag = "3"
9104 )]
9105 pub checks: ::core::option::Option<i32>,
9106 #[prost(bool, optional, tag = "4")]
9111 pub do_gas_selection: ::core::option::Option<bool>,
9112}
9113pub mod simulate_transaction_request {
9115 #[non_exhaustive]
9117 #[derive(
9118 Clone,
9119 Copy,
9120 Debug,
9121 PartialEq,
9122 Eq,
9123 Hash,
9124 PartialOrd,
9125 Ord,
9126 ::prost::Enumeration
9127 )]
9128 #[repr(i32)]
9129 pub enum TransactionChecks {
9130 Enabled = 0,
9131 Disabled = 1,
9132 }
9133 impl TransactionChecks {
9134 pub fn as_str_name(&self) -> &'static str {
9139 match self {
9140 Self::Enabled => "ENABLED",
9141 Self::Disabled => "DISABLED",
9142 }
9143 }
9144 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9146 match value {
9147 "ENABLED" => Some(Self::Enabled),
9148 "DISABLED" => Some(Self::Disabled),
9149 _ => None,
9150 }
9151 }
9152 }
9153}
9154#[non_exhaustive]
9155#[derive(Clone, PartialEq, ::prost::Message)]
9156pub struct SimulateTransactionResponse {
9157 #[prost(message, optional, tag = "1")]
9158 pub transaction: ::core::option::Option<ExecutedTransaction>,
9159 #[prost(message, repeated, tag = "2")]
9160 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
9161 #[prost(uint64, optional, tag = "3")]
9165 pub suggested_gas_price: ::core::option::Option<u64>,
9166}
9167#[non_exhaustive]
9169#[derive(Clone, PartialEq, ::prost::Message)]
9170pub struct CommandResult {
9171 #[prost(message, repeated, tag = "1")]
9172 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
9173 #[prost(message, repeated, tag = "2")]
9174 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
9175}
9176#[non_exhaustive]
9177#[derive(Clone, PartialEq, ::prost::Message)]
9178pub struct CommandOutput {
9179 #[prost(message, optional, tag = "1")]
9180 pub argument: ::core::option::Option<Argument>,
9181 #[prost(message, optional, tag = "2")]
9182 pub value: ::core::option::Option<Bcs>,
9183 #[prost(message, optional, boxed, tag = "3")]
9185 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
9186}
9187pub mod transaction_execution_service_client {
9189 #![allow(
9190 unused_variables,
9191 dead_code,
9192 missing_docs,
9193 clippy::wildcard_imports,
9194 clippy::let_unit_value,
9195 )]
9196 use tonic::codegen::*;
9197 use tonic::codegen::http::Uri;
9198 #[derive(Debug, Clone)]
9199 pub struct TransactionExecutionServiceClient<T> {
9200 inner: tonic::client::Grpc<T>,
9201 }
9202 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
9203 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9205 where
9206 D: TryInto<tonic::transport::Endpoint>,
9207 D::Error: Into<StdError>,
9208 {
9209 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9210 Ok(Self::new(conn))
9211 }
9212 }
9213 impl<T> TransactionExecutionServiceClient<T>
9214 where
9215 T: tonic::client::GrpcService<tonic::body::Body>,
9216 T::Error: Into<StdError>,
9217 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9218 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9219 {
9220 pub fn new(inner: T) -> Self {
9221 let inner = tonic::client::Grpc::new(inner);
9222 Self { inner }
9223 }
9224 pub fn with_origin(inner: T, origin: Uri) -> Self {
9225 let inner = tonic::client::Grpc::with_origin(inner, origin);
9226 Self { inner }
9227 }
9228 pub fn with_interceptor<F>(
9229 inner: T,
9230 interceptor: F,
9231 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
9232 where
9233 F: tonic::service::Interceptor,
9234 T::ResponseBody: Default,
9235 T: tonic::codegen::Service<
9236 http::Request<tonic::body::Body>,
9237 Response = http::Response<
9238 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9239 >,
9240 >,
9241 <T as tonic::codegen::Service<
9242 http::Request<tonic::body::Body>,
9243 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9244 {
9245 TransactionExecutionServiceClient::new(
9246 InterceptedService::new(inner, interceptor),
9247 )
9248 }
9249 #[must_use]
9254 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9255 self.inner = self.inner.send_compressed(encoding);
9256 self
9257 }
9258 #[must_use]
9260 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9261 self.inner = self.inner.accept_compressed(encoding);
9262 self
9263 }
9264 #[must_use]
9268 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9269 self.inner = self.inner.max_decoding_message_size(limit);
9270 self
9271 }
9272 #[must_use]
9276 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9277 self.inner = self.inner.max_encoding_message_size(limit);
9278 self
9279 }
9280 pub async fn execute_transaction(
9281 &mut self,
9282 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
9283 ) -> std::result::Result<
9284 tonic::Response<super::ExecuteTransactionResponse>,
9285 tonic::Status,
9286 > {
9287 self.inner
9288 .ready()
9289 .await
9290 .map_err(|e| {
9291 tonic::Status::unknown(
9292 format!("Service was not ready: {}", e.into()),
9293 )
9294 })?;
9295 let codec = tonic_prost::ProstCodec::default();
9296 let path = http::uri::PathAndQuery::from_static(
9297 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
9298 );
9299 let mut req = request.into_request();
9300 req.extensions_mut()
9301 .insert(
9302 GrpcMethod::new(
9303 "sui.rpc.v2.TransactionExecutionService",
9304 "ExecuteTransaction",
9305 ),
9306 );
9307 self.inner.unary(req, path, codec).await
9308 }
9309 pub async fn simulate_transaction(
9310 &mut self,
9311 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
9312 ) -> std::result::Result<
9313 tonic::Response<super::SimulateTransactionResponse>,
9314 tonic::Status,
9315 > {
9316 self.inner
9317 .ready()
9318 .await
9319 .map_err(|e| {
9320 tonic::Status::unknown(
9321 format!("Service was not ready: {}", e.into()),
9322 )
9323 })?;
9324 let codec = tonic_prost::ProstCodec::default();
9325 let path = http::uri::PathAndQuery::from_static(
9326 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
9327 );
9328 let mut req = request.into_request();
9329 req.extensions_mut()
9330 .insert(
9331 GrpcMethod::new(
9332 "sui.rpc.v2.TransactionExecutionService",
9333 "SimulateTransaction",
9334 ),
9335 );
9336 self.inner.unary(req, path, codec).await
9337 }
9338 }
9339}
9340pub mod transaction_execution_service_server {
9342 #![allow(
9343 unused_variables,
9344 dead_code,
9345 missing_docs,
9346 clippy::wildcard_imports,
9347 clippy::let_unit_value,
9348 )]
9349 use tonic::codegen::*;
9350 #[async_trait]
9352 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
9353 async fn execute_transaction(
9354 &self,
9355 request: tonic::Request<super::ExecuteTransactionRequest>,
9356 ) -> std::result::Result<
9357 tonic::Response<super::ExecuteTransactionResponse>,
9358 tonic::Status,
9359 > {
9360 Err(tonic::Status::unimplemented("Not yet implemented"))
9361 }
9362 async fn simulate_transaction(
9363 &self,
9364 request: tonic::Request<super::SimulateTransactionRequest>,
9365 ) -> std::result::Result<
9366 tonic::Response<super::SimulateTransactionResponse>,
9367 tonic::Status,
9368 > {
9369 Err(tonic::Status::unimplemented("Not yet implemented"))
9370 }
9371 }
9372 #[derive(Debug)]
9373 pub struct TransactionExecutionServiceServer<T> {
9374 inner: Arc<T>,
9375 accept_compression_encodings: EnabledCompressionEncodings,
9376 send_compression_encodings: EnabledCompressionEncodings,
9377 max_decoding_message_size: Option<usize>,
9378 max_encoding_message_size: Option<usize>,
9379 }
9380 impl<T> TransactionExecutionServiceServer<T> {
9381 pub fn new(inner: T) -> Self {
9382 Self::from_arc(Arc::new(inner))
9383 }
9384 pub fn from_arc(inner: Arc<T>) -> Self {
9385 Self {
9386 inner,
9387 accept_compression_encodings: Default::default(),
9388 send_compression_encodings: Default::default(),
9389 max_decoding_message_size: None,
9390 max_encoding_message_size: None,
9391 }
9392 }
9393 pub fn with_interceptor<F>(
9394 inner: T,
9395 interceptor: F,
9396 ) -> InterceptedService<Self, F>
9397 where
9398 F: tonic::service::Interceptor,
9399 {
9400 InterceptedService::new(Self::new(inner), interceptor)
9401 }
9402 #[must_use]
9404 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9405 self.accept_compression_encodings.enable(encoding);
9406 self
9407 }
9408 #[must_use]
9410 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9411 self.send_compression_encodings.enable(encoding);
9412 self
9413 }
9414 #[must_use]
9418 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9419 self.max_decoding_message_size = Some(limit);
9420 self
9421 }
9422 #[must_use]
9426 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9427 self.max_encoding_message_size = Some(limit);
9428 self
9429 }
9430 }
9431 impl<T, B> tonic::codegen::Service<http::Request<B>>
9432 for TransactionExecutionServiceServer<T>
9433 where
9434 T: TransactionExecutionService,
9435 B: Body + std::marker::Send + 'static,
9436 B::Error: Into<StdError> + std::marker::Send + 'static,
9437 {
9438 type Response = http::Response<tonic::body::Body>;
9439 type Error = std::convert::Infallible;
9440 type Future = BoxFuture<Self::Response, Self::Error>;
9441 fn poll_ready(
9442 &mut self,
9443 _cx: &mut Context<'_>,
9444 ) -> Poll<std::result::Result<(), Self::Error>> {
9445 Poll::Ready(Ok(()))
9446 }
9447 fn call(&mut self, req: http::Request<B>) -> Self::Future {
9448 match req.uri().path() {
9449 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
9450 #[allow(non_camel_case_types)]
9451 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
9452 pub Arc<T>,
9453 );
9454 impl<
9455 T: TransactionExecutionService,
9456 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
9457 for ExecuteTransactionSvc<T> {
9458 type Response = super::ExecuteTransactionResponse;
9459 type Future = BoxFuture<
9460 tonic::Response<Self::Response>,
9461 tonic::Status,
9462 >;
9463 fn call(
9464 &mut self,
9465 request: tonic::Request<super::ExecuteTransactionRequest>,
9466 ) -> Self::Future {
9467 let inner = Arc::clone(&self.0);
9468 let fut = async move {
9469 <T as TransactionExecutionService>::execute_transaction(
9470 &inner,
9471 request,
9472 )
9473 .await
9474 };
9475 Box::pin(fut)
9476 }
9477 }
9478 let accept_compression_encodings = self.accept_compression_encodings;
9479 let send_compression_encodings = self.send_compression_encodings;
9480 let max_decoding_message_size = self.max_decoding_message_size;
9481 let max_encoding_message_size = self.max_encoding_message_size;
9482 let inner = self.inner.clone();
9483 let fut = async move {
9484 let method = ExecuteTransactionSvc(inner);
9485 let codec = tonic_prost::ProstCodec::default();
9486 let mut grpc = tonic::server::Grpc::new(codec)
9487 .apply_compression_config(
9488 accept_compression_encodings,
9489 send_compression_encodings,
9490 )
9491 .apply_max_message_size_config(
9492 max_decoding_message_size,
9493 max_encoding_message_size,
9494 );
9495 let res = grpc.unary(method, req).await;
9496 Ok(res)
9497 };
9498 Box::pin(fut)
9499 }
9500 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
9501 #[allow(non_camel_case_types)]
9502 struct SimulateTransactionSvc<T: TransactionExecutionService>(
9503 pub Arc<T>,
9504 );
9505 impl<
9506 T: TransactionExecutionService,
9507 > tonic::server::UnaryService<super::SimulateTransactionRequest>
9508 for SimulateTransactionSvc<T> {
9509 type Response = super::SimulateTransactionResponse;
9510 type Future = BoxFuture<
9511 tonic::Response<Self::Response>,
9512 tonic::Status,
9513 >;
9514 fn call(
9515 &mut self,
9516 request: tonic::Request<super::SimulateTransactionRequest>,
9517 ) -> Self::Future {
9518 let inner = Arc::clone(&self.0);
9519 let fut = async move {
9520 <T as TransactionExecutionService>::simulate_transaction(
9521 &inner,
9522 request,
9523 )
9524 .await
9525 };
9526 Box::pin(fut)
9527 }
9528 }
9529 let accept_compression_encodings = self.accept_compression_encodings;
9530 let send_compression_encodings = self.send_compression_encodings;
9531 let max_decoding_message_size = self.max_decoding_message_size;
9532 let max_encoding_message_size = self.max_encoding_message_size;
9533 let inner = self.inner.clone();
9534 let fut = async move {
9535 let method = SimulateTransactionSvc(inner);
9536 let codec = tonic_prost::ProstCodec::default();
9537 let mut grpc = tonic::server::Grpc::new(codec)
9538 .apply_compression_config(
9539 accept_compression_encodings,
9540 send_compression_encodings,
9541 )
9542 .apply_max_message_size_config(
9543 max_decoding_message_size,
9544 max_encoding_message_size,
9545 );
9546 let res = grpc.unary(method, req).await;
9547 Ok(res)
9548 };
9549 Box::pin(fut)
9550 }
9551 _ => {
9552 Box::pin(async move {
9553 let mut response = http::Response::new(
9554 tonic::body::Body::default(),
9555 );
9556 let headers = response.headers_mut();
9557 headers
9558 .insert(
9559 tonic::Status::GRPC_STATUS,
9560 (tonic::Code::Unimplemented as i32).into(),
9561 );
9562 headers
9563 .insert(
9564 http::header::CONTENT_TYPE,
9565 tonic::metadata::GRPC_CONTENT_TYPE,
9566 );
9567 Ok(response)
9568 })
9569 }
9570 }
9571 }
9572 }
9573 impl<T> Clone for TransactionExecutionServiceServer<T> {
9574 fn clone(&self) -> Self {
9575 let inner = self.inner.clone();
9576 Self {
9577 inner,
9578 accept_compression_encodings: self.accept_compression_encodings,
9579 send_compression_encodings: self.send_compression_encodings,
9580 max_decoding_message_size: self.max_decoding_message_size,
9581 max_encoding_message_size: self.max_encoding_message_size,
9582 }
9583 }
9584 }
9585 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
9587 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
9588 const NAME: &'static str = SERVICE_NAME;
9589 }
9590}