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