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 }
1403 impl CommandArgumentErrorKind {
1404 pub fn as_str_name(&self) -> &'static str {
1409 match self {
1410 Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1411 Self::TypeMismatch => "TYPE_MISMATCH",
1412 Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1413 Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1414 Self::InvalidArgumentToPrivateEntryFunction => {
1415 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1416 }
1417 Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1418 Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1419 Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1420 Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1421 Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1422 Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1423 Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1424 Self::ConsensusObjectOperationNotAllowed => {
1425 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1426 }
1427 Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1428 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1429 Self::InvalidMakeMoveVecNonObjectArgument => {
1430 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1431 }
1432 Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1433 Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1434 Self::CannotWriteToExtendedReference => {
1435 "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1436 }
1437 Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1438 }
1439 }
1440 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1442 match value {
1443 "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1444 "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1445 "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1446 "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1447 Some(Self::InvalidUsageOfPureArgument)
1448 }
1449 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1450 Some(Self::InvalidArgumentToPrivateEntryFunction)
1451 }
1452 "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1453 "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1454 "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1455 "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1456 "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1457 "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1458 "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1459 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1460 Some(Self::ConsensusObjectOperationNotAllowed)
1461 }
1462 "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1463 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1464 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1465 Some(Self::InvalidMakeMoveVecNonObjectArgument)
1466 }
1467 "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1468 "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1469 "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1470 Some(Self::CannotWriteToExtendedReference)
1471 }
1472 "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1473 _ => None,
1474 }
1475 }
1476 }
1477}
1478#[non_exhaustive]
1480#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1481pub struct PackageUpgradeError {
1482 #[prost(
1483 enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1484 optional,
1485 tag = "1"
1486 )]
1487 pub kind: ::core::option::Option<i32>,
1488 #[prost(string, optional, tag = "2")]
1490 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1491 #[prost(string, optional, tag = "3")]
1493 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1494 #[prost(uint32, optional, tag = "4")]
1496 pub policy: ::core::option::Option<u32>,
1497 #[prost(string, optional, tag = "5")]
1499 pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1500}
1501pub mod package_upgrade_error {
1503 #[non_exhaustive]
1504 #[derive(
1505 Clone,
1506 Copy,
1507 Debug,
1508 PartialEq,
1509 Eq,
1510 Hash,
1511 PartialOrd,
1512 Ord,
1513 ::prost::Enumeration
1514 )]
1515 #[repr(i32)]
1516 pub enum PackageUpgradeErrorKind {
1517 Unknown = 0,
1518 UnableToFetchPackage = 1,
1520 NotAPackage = 2,
1522 IncompatibleUpgrade = 3,
1524 DigestDoesNotMatch = 4,
1526 UnknownUpgradePolicy = 5,
1528 PackageIdDoesNotMatch = 6,
1530 }
1531 impl PackageUpgradeErrorKind {
1532 pub fn as_str_name(&self) -> &'static str {
1537 match self {
1538 Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1539 Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1540 Self::NotAPackage => "NOT_A_PACKAGE",
1541 Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1542 Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1543 Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1544 Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1545 }
1546 }
1547 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1549 match value {
1550 "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1551 "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1552 "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1553 "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1554 "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1555 "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1556 "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1557 _ => None,
1558 }
1559 }
1560 }
1561}
1562#[non_exhaustive]
1564#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1565pub struct TypeArgumentError {
1566 #[prost(uint32, optional, tag = "1")]
1568 pub type_argument: ::core::option::Option<u32>,
1569 #[prost(
1570 enumeration = "type_argument_error::TypeArgumentErrorKind",
1571 optional,
1572 tag = "2"
1573 )]
1574 pub kind: ::core::option::Option<i32>,
1575}
1576pub mod type_argument_error {
1578 #[non_exhaustive]
1579 #[derive(
1580 Clone,
1581 Copy,
1582 Debug,
1583 PartialEq,
1584 Eq,
1585 Hash,
1586 PartialOrd,
1587 Ord,
1588 ::prost::Enumeration
1589 )]
1590 #[repr(i32)]
1591 pub enum TypeArgumentErrorKind {
1592 Unknown = 0,
1593 TypeNotFound = 1,
1595 ConstraintNotSatisfied = 2,
1597 }
1598 impl TypeArgumentErrorKind {
1599 pub fn as_str_name(&self) -> &'static str {
1604 match self {
1605 Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1606 Self::TypeNotFound => "TYPE_NOT_FOUND",
1607 Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1608 }
1609 }
1610 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1612 match value {
1613 "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1614 "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1615 "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1616 _ => None,
1617 }
1618 }
1619 }
1620}
1621#[derive(Eq, Hash)]
1626#[non_exhaustive]
1627#[derive(Clone, PartialEq, ::prost::Message)]
1628pub struct TransactionFilter {
1629 #[prost(message, repeated, tag = "1")]
1631 pub terms: ::prost::alloc::vec::Vec<TransactionTerm>,
1632}
1633#[derive(Eq, Hash)]
1635#[non_exhaustive]
1636#[derive(Clone, PartialEq, ::prost::Message)]
1637pub struct TransactionTerm {
1638 #[prost(message, repeated, tag = "1")]
1640 pub literals: ::prost::alloc::vec::Vec<TransactionLiteral>,
1641}
1642#[non_exhaustive]
1644#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1645pub struct TransactionLiteral {
1646 #[prost(bool, tag = "1")]
1649 pub negated: bool,
1650 #[prost(oneof = "transaction_literal::Predicate", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
1652 pub predicate: ::core::option::Option<transaction_literal::Predicate>,
1653}
1654pub mod transaction_literal {
1656 #[non_exhaustive]
1658 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1659 pub enum Predicate {
1660 #[prost(message, tag = "2")]
1662 Sender(super::SenderFilter),
1663 #[prost(message, tag = "3")]
1668 AffectedAddress(super::AffectedAddressFilter),
1669 #[prost(message, tag = "4")]
1672 AffectedObject(super::AffectedObjectFilter),
1673 #[prost(message, tag = "5")]
1675 MoveCall(super::MoveCallFilter),
1676 #[prost(message, tag = "6")]
1679 EmitModule(super::EmitModuleFilter),
1680 #[prost(message, tag = "7")]
1683 EventType(super::EventTypeFilter),
1684 #[prost(message, tag = "8")]
1687 EventStreamHead(super::EventStreamHeadFilter),
1688 #[prost(message, tag = "9")]
1691 PackageWrite(super::PackageWriteFilter),
1692 }
1693}
1694#[non_exhaustive]
1700#[derive(Clone, PartialEq, ::prost::Message)]
1701pub struct EventFilter {
1702 #[prost(message, repeated, tag = "1")]
1704 pub terms: ::prost::alloc::vec::Vec<EventTerm>,
1705}
1706#[non_exhaustive]
1708#[derive(Clone, PartialEq, ::prost::Message)]
1709pub struct EventTerm {
1710 #[prost(message, repeated, tag = "1")]
1712 pub literals: ::prost::alloc::vec::Vec<EventLiteral>,
1713}
1714#[non_exhaustive]
1716#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1717pub struct EventLiteral {
1718 #[prost(bool, tag = "1")]
1720 pub negated: bool,
1721 #[prost(oneof = "event_literal::Predicate", tags = "2, 3, 4, 5")]
1723 pub predicate: ::core::option::Option<event_literal::Predicate>,
1724}
1725pub mod event_literal {
1727 #[non_exhaustive]
1729 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1730 pub enum Predicate {
1731 #[prost(message, tag = "2")]
1733 Sender(super::SenderFilter),
1734 #[prost(message, tag = "3")]
1736 EmitModule(super::EmitModuleFilter),
1737 #[prost(message, tag = "4")]
1739 EventType(super::EventTypeFilter),
1740 #[prost(message, tag = "5")]
1742 EventStreamHead(super::EventStreamHeadFilter),
1743 }
1744}
1745#[non_exhaustive]
1747#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1748pub struct SenderFilter {
1749 #[prost(string, optional, tag = "1")]
1751 pub address: ::core::option::Option<::prost::alloc::string::String>,
1752}
1753#[non_exhaustive]
1758#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1759pub struct AffectedAddressFilter {
1760 #[prost(string, optional, tag = "1")]
1762 pub address: ::core::option::Option<::prost::alloc::string::String>,
1763}
1764#[non_exhaustive]
1766#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1767pub struct AffectedObjectFilter {
1768 #[prost(string, optional, tag = "1")]
1770 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1771}
1772#[non_exhaustive]
1779#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1780pub struct MoveCallFilter {
1781 #[prost(string, optional, tag = "1")]
1783 pub function: ::core::option::Option<::prost::alloc::string::String>,
1784}
1785#[non_exhaustive]
1792#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1793pub struct EmitModuleFilter {
1794 #[prost(string, optional, tag = "1")]
1796 pub module: ::core::option::Option<::prost::alloc::string::String>,
1797}
1798#[non_exhaustive]
1806#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1807pub struct EventTypeFilter {
1808 #[prost(string, optional, tag = "1")]
1811 pub event_type: ::core::option::Option<::prost::alloc::string::String>,
1812}
1813#[non_exhaustive]
1815#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1816pub struct EventStreamHeadFilter {
1817 #[prost(string, optional, tag = "1")]
1819 pub stream_id: ::core::option::Option<::prost::alloc::string::String>,
1820}
1821#[non_exhaustive]
1823#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1824pub struct PackageWriteFilter {}
1825#[non_exhaustive]
1827#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1828pub struct GasCostSummary {
1829 #[prost(uint64, optional, tag = "1")]
1831 pub computation_cost: ::core::option::Option<u64>,
1832 #[prost(uint64, optional, tag = "2")]
1834 pub storage_cost: ::core::option::Option<u64>,
1835 #[prost(uint64, optional, tag = "3")]
1838 pub storage_rebate: ::core::option::Option<u64>,
1839 #[prost(uint64, optional, tag = "4")]
1841 pub non_refundable_storage_fee: ::core::option::Option<u64>,
1842}
1843#[non_exhaustive]
1845#[derive(Clone, PartialEq, ::prost::Message)]
1846pub struct Input {
1847 #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1848 pub kind: ::core::option::Option<i32>,
1849 #[prost(bytes = "bytes", optional, tag = "2")]
1854 pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1855 #[prost(string, optional, tag = "3")]
1857 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1858 #[prost(uint64, optional, tag = "4")]
1862 pub version: ::core::option::Option<u64>,
1863 #[prost(string, optional, tag = "5")]
1865 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1866 #[prost(bool, optional, tag = "6")]
1869 pub mutable: ::core::option::Option<bool>,
1870 #[prost(enumeration = "input::Mutability", optional, tag = "7")]
1875 pub mutability: ::core::option::Option<i32>,
1876 #[prost(message, optional, tag = "8")]
1878 pub funds_withdrawal: ::core::option::Option<FundsWithdrawal>,
1879 #[prost(message, optional, boxed, tag = "1000")]
1883 pub literal: ::core::option::Option<
1884 ::prost::alloc::boxed::Box<::prost_types::Value>,
1885 >,
1886}
1887pub mod input {
1889 #[non_exhaustive]
1890 #[derive(
1891 Clone,
1892 Copy,
1893 Debug,
1894 PartialEq,
1895 Eq,
1896 Hash,
1897 PartialOrd,
1898 Ord,
1899 ::prost::Enumeration
1900 )]
1901 #[repr(i32)]
1902 pub enum InputKind {
1903 Unknown = 0,
1904 Pure = 1,
1906 ImmutableOrOwned = 2,
1908 Shared = 3,
1910 Receiving = 4,
1912 FundsWithdrawal = 5,
1914 }
1915 impl InputKind {
1916 pub fn as_str_name(&self) -> &'static str {
1921 match self {
1922 Self::Unknown => "INPUT_KIND_UNKNOWN",
1923 Self::Pure => "PURE",
1924 Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
1925 Self::Shared => "SHARED",
1926 Self::Receiving => "RECEIVING",
1927 Self::FundsWithdrawal => "FUNDS_WITHDRAWAL",
1928 }
1929 }
1930 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1932 match value {
1933 "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
1934 "PURE" => Some(Self::Pure),
1935 "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
1936 "SHARED" => Some(Self::Shared),
1937 "RECEIVING" => Some(Self::Receiving),
1938 "FUNDS_WITHDRAWAL" => Some(Self::FundsWithdrawal),
1939 _ => None,
1940 }
1941 }
1942 }
1943 #[non_exhaustive]
1944 #[derive(
1945 Clone,
1946 Copy,
1947 Debug,
1948 PartialEq,
1949 Eq,
1950 Hash,
1951 PartialOrd,
1952 Ord,
1953 ::prost::Enumeration
1954 )]
1955 #[repr(i32)]
1956 pub enum Mutability {
1957 Unknown = 0,
1958 Immutable = 1,
1959 Mutable = 2,
1960 NonExclusiveWrite = 3,
1964 }
1965 impl Mutability {
1966 pub fn as_str_name(&self) -> &'static str {
1971 match self {
1972 Self::Unknown => "MUTABILITY_UNKNOWN",
1973 Self::Immutable => "IMMUTABLE",
1974 Self::Mutable => "MUTABLE",
1975 Self::NonExclusiveWrite => "NON_EXCLUSIVE_WRITE",
1976 }
1977 }
1978 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1980 match value {
1981 "MUTABILITY_UNKNOWN" => Some(Self::Unknown),
1982 "IMMUTABLE" => Some(Self::Immutable),
1983 "MUTABLE" => Some(Self::Mutable),
1984 "NON_EXCLUSIVE_WRITE" => Some(Self::NonExclusiveWrite),
1985 _ => None,
1986 }
1987 }
1988 }
1989}
1990#[non_exhaustive]
1991#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1992pub struct FundsWithdrawal {
1993 #[prost(uint64, optional, tag = "1")]
1994 pub amount: ::core::option::Option<u64>,
1995 #[prost(string, optional, tag = "2")]
1996 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1997 #[prost(enumeration = "funds_withdrawal::Source", optional, tag = "3")]
1998 pub source: ::core::option::Option<i32>,
1999}
2000pub mod funds_withdrawal {
2002 #[non_exhaustive]
2003 #[derive(
2004 Clone,
2005 Copy,
2006 Debug,
2007 PartialEq,
2008 Eq,
2009 Hash,
2010 PartialOrd,
2011 Ord,
2012 ::prost::Enumeration
2013 )]
2014 #[repr(i32)]
2015 pub enum Source {
2016 Unknown = 0,
2017 Sender = 1,
2018 Sponsor = 2,
2019 }
2020 impl Source {
2021 pub fn as_str_name(&self) -> &'static str {
2026 match self {
2027 Self::Unknown => "SOURCE_UNKNOWN",
2028 Self::Sender => "SENDER",
2029 Self::Sponsor => "SPONSOR",
2030 }
2031 }
2032 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2034 match value {
2035 "SOURCE_UNKNOWN" => Some(Self::Unknown),
2036 "SENDER" => Some(Self::Sender),
2037 "SPONSOR" => Some(Self::Sponsor),
2038 _ => None,
2039 }
2040 }
2041 }
2042}
2043#[non_exhaustive]
2045#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2046pub struct JwkId {
2047 #[prost(string, optional, tag = "1")]
2049 pub iss: ::core::option::Option<::prost::alloc::string::String>,
2050 #[prost(string, optional, tag = "2")]
2052 pub kid: ::core::option::Option<::prost::alloc::string::String>,
2053}
2054#[non_exhaustive]
2060#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2061pub struct Jwk {
2062 #[prost(string, optional, tag = "1")]
2064 pub kty: ::core::option::Option<::prost::alloc::string::String>,
2065 #[prost(string, optional, tag = "2")]
2067 pub e: ::core::option::Option<::prost::alloc::string::String>,
2068 #[prost(string, optional, tag = "3")]
2070 pub n: ::core::option::Option<::prost::alloc::string::String>,
2071 #[prost(string, optional, tag = "4")]
2073 pub alg: ::core::option::Option<::prost::alloc::string::String>,
2074}
2075#[non_exhaustive]
2076#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2077pub struct GetServiceInfoRequest {}
2078#[non_exhaustive]
2079#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2080pub struct GetServiceInfoResponse {
2081 #[prost(string, optional, tag = "1")]
2086 pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
2087 #[prost(string, optional, tag = "2")]
2091 pub chain: ::core::option::Option<::prost::alloc::string::String>,
2092 #[prost(uint64, optional, tag = "3")]
2094 pub epoch: ::core::option::Option<u64>,
2095 #[prost(uint64, optional, tag = "4")]
2097 pub checkpoint_height: ::core::option::Option<u64>,
2098 #[prost(message, optional, tag = "5")]
2100 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
2101 #[prost(uint64, optional, tag = "6")]
2103 pub lowest_available_checkpoint: ::core::option::Option<u64>,
2104 #[prost(uint64, optional, tag = "7")]
2106 pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
2107 #[prost(string, optional, tag = "8")]
2109 pub server: ::core::option::Option<::prost::alloc::string::String>,
2110}
2111#[non_exhaustive]
2112#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2113pub struct GetObjectRequest {
2114 #[prost(string, optional, tag = "1")]
2116 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2117 #[prost(uint64, optional, tag = "2")]
2121 pub version: ::core::option::Option<u64>,
2122 #[prost(message, optional, tag = "3")]
2125 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2126}
2127#[non_exhaustive]
2128#[derive(Clone, PartialEq, ::prost::Message)]
2129pub struct GetObjectResponse {
2130 #[prost(message, optional, tag = "1")]
2131 pub object: ::core::option::Option<Object>,
2132}
2133#[non_exhaustive]
2134#[derive(Clone, PartialEq, ::prost::Message)]
2135pub struct BatchGetObjectsRequest {
2136 #[prost(message, repeated, tag = "1")]
2137 pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
2138 #[prost(message, optional, tag = "2")]
2141 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2142}
2143#[non_exhaustive]
2144#[derive(Clone, PartialEq, ::prost::Message)]
2145pub struct BatchGetObjectsResponse {
2146 #[prost(message, repeated, tag = "1")]
2147 pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
2148}
2149#[non_exhaustive]
2150#[derive(Clone, PartialEq, ::prost::Message)]
2151pub struct GetObjectResult {
2152 #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
2153 pub result: ::core::option::Option<get_object_result::Result>,
2154}
2155pub mod get_object_result {
2157 #[non_exhaustive]
2158 #[derive(Clone, PartialEq, ::prost::Oneof)]
2159 pub enum Result {
2160 #[prost(message, tag = "1")]
2161 Object(super::Object),
2162 #[prost(message, tag = "2")]
2163 Error(super::super::super::super::google::rpc::Status),
2164 }
2165}
2166#[non_exhaustive]
2167#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2168pub struct GetTransactionRequest {
2169 #[prost(string, optional, tag = "1")]
2171 pub digest: ::core::option::Option<::prost::alloc::string::String>,
2172 #[prost(message, optional, tag = "2")]
2175 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2176}
2177#[non_exhaustive]
2178#[derive(Clone, PartialEq, ::prost::Message)]
2179pub struct GetTransactionResponse {
2180 #[prost(message, optional, tag = "1")]
2181 pub transaction: ::core::option::Option<ExecutedTransaction>,
2182}
2183#[non_exhaustive]
2184#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2185pub struct BatchGetTransactionsRequest {
2186 #[prost(string, repeated, tag = "1")]
2188 pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2189 #[prost(message, optional, tag = "2")]
2192 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2193}
2194#[non_exhaustive]
2195#[derive(Clone, PartialEq, ::prost::Message)]
2196pub struct BatchGetTransactionsResponse {
2197 #[prost(message, repeated, tag = "1")]
2198 pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
2199}
2200#[non_exhaustive]
2201#[derive(Clone, PartialEq, ::prost::Message)]
2202pub struct GetTransactionResult {
2203 #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
2204 pub result: ::core::option::Option<get_transaction_result::Result>,
2205}
2206pub mod get_transaction_result {
2208 #[non_exhaustive]
2209 #[derive(Clone, PartialEq, ::prost::Oneof)]
2210 pub enum Result {
2211 #[prost(message, tag = "1")]
2212 Transaction(super::ExecutedTransaction),
2213 #[prost(message, tag = "2")]
2214 Error(super::super::super::super::google::rpc::Status),
2215 }
2216}
2217#[non_exhaustive]
2218#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2219pub struct GetCheckpointRequest {
2220 #[prost(message, optional, tag = "3")]
2223 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2224 #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
2226 pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
2227}
2228pub mod get_checkpoint_request {
2230 #[non_exhaustive]
2232 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2233 pub enum CheckpointId {
2234 #[prost(uint64, tag = "1")]
2236 SequenceNumber(u64),
2237 #[prost(string, tag = "2")]
2239 Digest(::prost::alloc::string::String),
2240 }
2241}
2242#[non_exhaustive]
2243#[derive(Clone, PartialEq, ::prost::Message)]
2244pub struct GetCheckpointResponse {
2245 #[prost(message, optional, tag = "1")]
2246 pub checkpoint: ::core::option::Option<Checkpoint>,
2247}
2248#[non_exhaustive]
2249#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2250pub struct GetEpochRequest {
2251 #[prost(uint64, optional, tag = "1")]
2254 pub epoch: ::core::option::Option<u64>,
2255 #[prost(message, optional, tag = "2")]
2258 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2259}
2260#[non_exhaustive]
2261#[derive(Clone, PartialEq, ::prost::Message)]
2262pub struct GetEpochResponse {
2263 #[prost(message, optional, tag = "1")]
2264 pub epoch: ::core::option::Option<Epoch>,
2265}
2266#[non_exhaustive]
2268#[derive(Clone, PartialEq, ::prost::Message)]
2269pub struct ListCheckpointsRequest {
2270 #[prost(message, optional, tag = "1")]
2273 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2274 #[prost(uint64, optional, tag = "2")]
2277 pub start_checkpoint: ::core::option::Option<u64>,
2278 #[prost(uint64, optional, tag = "3")]
2281 pub end_checkpoint: ::core::option::Option<u64>,
2282 #[prost(message, optional, tag = "4")]
2286 pub filter: ::core::option::Option<TransactionFilter>,
2287 #[prost(message, optional, tag = "5")]
2293 pub options: ::core::option::Option<QueryOptions>,
2294}
2295#[non_exhaustive]
2306#[derive(Clone, PartialEq, ::prost::Message)]
2307pub struct ListCheckpointsResponse {
2308 #[prost(message, optional, tag = "1")]
2310 pub checkpoint: ::core::option::Option<Checkpoint>,
2311 #[prost(message, optional, tag = "2")]
2315 pub watermark: ::core::option::Option<Watermark>,
2316 #[prost(message, optional, tag = "3")]
2318 pub end: ::core::option::Option<QueryEnd>,
2319}
2320#[non_exhaustive]
2322#[derive(Clone, PartialEq, ::prost::Message)]
2323pub struct ListTransactionsRequest {
2324 #[prost(message, optional, tag = "1")]
2327 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2328 #[prost(uint64, optional, tag = "2")]
2331 pub start_checkpoint: ::core::option::Option<u64>,
2332 #[prost(uint64, optional, tag = "3")]
2335 pub end_checkpoint: ::core::option::Option<u64>,
2336 #[prost(message, optional, tag = "4")]
2339 pub filter: ::core::option::Option<TransactionFilter>,
2340 #[prost(message, optional, tag = "5")]
2346 pub options: ::core::option::Option<QueryOptions>,
2347}
2348#[non_exhaustive]
2359#[derive(Clone, PartialEq, ::prost::Message)]
2360pub struct ListTransactionsResponse {
2361 #[prost(message, optional, tag = "1")]
2364 pub transaction: ::core::option::Option<ExecutedTransaction>,
2365 #[prost(message, optional, tag = "2")]
2369 pub watermark: ::core::option::Option<Watermark>,
2370 #[prost(message, optional, tag = "3")]
2372 pub end: ::core::option::Option<QueryEnd>,
2373}
2374#[non_exhaustive]
2376#[derive(Clone, PartialEq, ::prost::Message)]
2377pub struct ListEventsRequest {
2378 #[prost(message, optional, tag = "1")]
2380 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2381 #[prost(uint64, optional, tag = "2")]
2384 pub start_checkpoint: ::core::option::Option<u64>,
2385 #[prost(uint64, optional, tag = "3")]
2388 pub end_checkpoint: ::core::option::Option<u64>,
2389 #[prost(message, optional, tag = "4")]
2392 pub filter: ::core::option::Option<EventFilter>,
2393 #[prost(message, optional, tag = "5")]
2399 pub options: ::core::option::Option<QueryOptions>,
2400}
2401#[non_exhaustive]
2412#[derive(Clone, PartialEq, ::prost::Message)]
2413pub struct ListEventsResponse {
2414 #[prost(message, optional, tag = "1")]
2419 pub event: ::core::option::Option<Event>,
2420 #[prost(message, optional, tag = "2")]
2424 pub watermark: ::core::option::Option<Watermark>,
2425 #[prost(message, optional, tag = "3")]
2427 pub end: ::core::option::Option<QueryEnd>,
2428}
2429pub mod ledger_service_client {
2431 #![allow(
2432 unused_variables,
2433 dead_code,
2434 missing_docs,
2435 clippy::wildcard_imports,
2436 clippy::let_unit_value,
2437 )]
2438 use tonic::codegen::*;
2439 use tonic::codegen::http::Uri;
2440 #[derive(Debug, Clone)]
2441 pub struct LedgerServiceClient<T> {
2442 inner: tonic::client::Grpc<T>,
2443 }
2444 impl LedgerServiceClient<tonic::transport::Channel> {
2445 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2447 where
2448 D: TryInto<tonic::transport::Endpoint>,
2449 D::Error: Into<StdError>,
2450 {
2451 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2452 Ok(Self::new(conn))
2453 }
2454 }
2455 impl<T> LedgerServiceClient<T>
2456 where
2457 T: tonic::client::GrpcService<tonic::body::Body>,
2458 T::Error: Into<StdError>,
2459 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2460 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2461 {
2462 pub fn new(inner: T) -> Self {
2463 let inner = tonic::client::Grpc::new(inner);
2464 Self { inner }
2465 }
2466 pub fn with_origin(inner: T, origin: Uri) -> Self {
2467 let inner = tonic::client::Grpc::with_origin(inner, origin);
2468 Self { inner }
2469 }
2470 pub fn with_interceptor<F>(
2471 inner: T,
2472 interceptor: F,
2473 ) -> LedgerServiceClient<InterceptedService<T, F>>
2474 where
2475 F: tonic::service::Interceptor,
2476 T::ResponseBody: Default,
2477 T: tonic::codegen::Service<
2478 http::Request<tonic::body::Body>,
2479 Response = http::Response<
2480 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2481 >,
2482 >,
2483 <T as tonic::codegen::Service<
2484 http::Request<tonic::body::Body>,
2485 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2486 {
2487 LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
2488 }
2489 #[must_use]
2494 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2495 self.inner = self.inner.send_compressed(encoding);
2496 self
2497 }
2498 #[must_use]
2500 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2501 self.inner = self.inner.accept_compressed(encoding);
2502 self
2503 }
2504 #[must_use]
2508 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2509 self.inner = self.inner.max_decoding_message_size(limit);
2510 self
2511 }
2512 #[must_use]
2516 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2517 self.inner = self.inner.max_encoding_message_size(limit);
2518 self
2519 }
2520 pub async fn get_service_info(
2522 &mut self,
2523 request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
2524 ) -> std::result::Result<
2525 tonic::Response<super::GetServiceInfoResponse>,
2526 tonic::Status,
2527 > {
2528 self.inner
2529 .ready()
2530 .await
2531 .map_err(|e| {
2532 tonic::Status::unknown(
2533 format!("Service was not ready: {}", e.into()),
2534 )
2535 })?;
2536 let codec = tonic_prost::ProstCodec::default();
2537 let path = http::uri::PathAndQuery::from_static(
2538 "/sui.rpc.v2.LedgerService/GetServiceInfo",
2539 );
2540 let mut req = request.into_request();
2541 req.extensions_mut()
2542 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
2543 self.inner.unary(req, path, codec).await
2544 }
2545 pub async fn get_object(
2546 &mut self,
2547 request: impl tonic::IntoRequest<super::GetObjectRequest>,
2548 ) -> std::result::Result<
2549 tonic::Response<super::GetObjectResponse>,
2550 tonic::Status,
2551 > {
2552 self.inner
2553 .ready()
2554 .await
2555 .map_err(|e| {
2556 tonic::Status::unknown(
2557 format!("Service was not ready: {}", e.into()),
2558 )
2559 })?;
2560 let codec = tonic_prost::ProstCodec::default();
2561 let path = http::uri::PathAndQuery::from_static(
2562 "/sui.rpc.v2.LedgerService/GetObject",
2563 );
2564 let mut req = request.into_request();
2565 req.extensions_mut()
2566 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
2567 self.inner.unary(req, path, codec).await
2568 }
2569 pub async fn batch_get_objects(
2570 &mut self,
2571 request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
2572 ) -> std::result::Result<
2573 tonic::Response<super::BatchGetObjectsResponse>,
2574 tonic::Status,
2575 > {
2576 self.inner
2577 .ready()
2578 .await
2579 .map_err(|e| {
2580 tonic::Status::unknown(
2581 format!("Service was not ready: {}", e.into()),
2582 )
2583 })?;
2584 let codec = tonic_prost::ProstCodec::default();
2585 let path = http::uri::PathAndQuery::from_static(
2586 "/sui.rpc.v2.LedgerService/BatchGetObjects",
2587 );
2588 let mut req = request.into_request();
2589 req.extensions_mut()
2590 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
2591 self.inner.unary(req, path, codec).await
2592 }
2593 pub async fn get_transaction(
2594 &mut self,
2595 request: impl tonic::IntoRequest<super::GetTransactionRequest>,
2596 ) -> std::result::Result<
2597 tonic::Response<super::GetTransactionResponse>,
2598 tonic::Status,
2599 > {
2600 self.inner
2601 .ready()
2602 .await
2603 .map_err(|e| {
2604 tonic::Status::unknown(
2605 format!("Service was not ready: {}", e.into()),
2606 )
2607 })?;
2608 let codec = tonic_prost::ProstCodec::default();
2609 let path = http::uri::PathAndQuery::from_static(
2610 "/sui.rpc.v2.LedgerService/GetTransaction",
2611 );
2612 let mut req = request.into_request();
2613 req.extensions_mut()
2614 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
2615 self.inner.unary(req, path, codec).await
2616 }
2617 pub async fn batch_get_transactions(
2618 &mut self,
2619 request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
2620 ) -> std::result::Result<
2621 tonic::Response<super::BatchGetTransactionsResponse>,
2622 tonic::Status,
2623 > {
2624 self.inner
2625 .ready()
2626 .await
2627 .map_err(|e| {
2628 tonic::Status::unknown(
2629 format!("Service was not ready: {}", e.into()),
2630 )
2631 })?;
2632 let codec = tonic_prost::ProstCodec::default();
2633 let path = http::uri::PathAndQuery::from_static(
2634 "/sui.rpc.v2.LedgerService/BatchGetTransactions",
2635 );
2636 let mut req = request.into_request();
2637 req.extensions_mut()
2638 .insert(
2639 GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
2640 );
2641 self.inner.unary(req, path, codec).await
2642 }
2643 pub async fn get_checkpoint(
2644 &mut self,
2645 request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
2646 ) -> std::result::Result<
2647 tonic::Response<super::GetCheckpointResponse>,
2648 tonic::Status,
2649 > {
2650 self.inner
2651 .ready()
2652 .await
2653 .map_err(|e| {
2654 tonic::Status::unknown(
2655 format!("Service was not ready: {}", e.into()),
2656 )
2657 })?;
2658 let codec = tonic_prost::ProstCodec::default();
2659 let path = http::uri::PathAndQuery::from_static(
2660 "/sui.rpc.v2.LedgerService/GetCheckpoint",
2661 );
2662 let mut req = request.into_request();
2663 req.extensions_mut()
2664 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
2665 self.inner.unary(req, path, codec).await
2666 }
2667 pub async fn get_epoch(
2668 &mut self,
2669 request: impl tonic::IntoRequest<super::GetEpochRequest>,
2670 ) -> std::result::Result<
2671 tonic::Response<super::GetEpochResponse>,
2672 tonic::Status,
2673 > {
2674 self.inner
2675 .ready()
2676 .await
2677 .map_err(|e| {
2678 tonic::Status::unknown(
2679 format!("Service was not ready: {}", e.into()),
2680 )
2681 })?;
2682 let codec = tonic_prost::ProstCodec::default();
2683 let path = http::uri::PathAndQuery::from_static(
2684 "/sui.rpc.v2.LedgerService/GetEpoch",
2685 );
2686 let mut req = request.into_request();
2687 req.extensions_mut()
2688 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
2689 self.inner.unary(req, path, codec).await
2690 }
2691 pub async fn list_checkpoints(
2697 &mut self,
2698 request: impl tonic::IntoRequest<super::ListCheckpointsRequest>,
2699 ) -> std::result::Result<
2700 tonic::Response<tonic::codec::Streaming<super::ListCheckpointsResponse>>,
2701 tonic::Status,
2702 > {
2703 self.inner
2704 .ready()
2705 .await
2706 .map_err(|e| {
2707 tonic::Status::unknown(
2708 format!("Service was not ready: {}", e.into()),
2709 )
2710 })?;
2711 let codec = tonic_prost::ProstCodec::default();
2712 let path = http::uri::PathAndQuery::from_static(
2713 "/sui.rpc.v2.LedgerService/ListCheckpoints",
2714 );
2715 let mut req = request.into_request();
2716 req.extensions_mut()
2717 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListCheckpoints"));
2718 self.inner.server_streaming(req, path, codec).await
2719 }
2720 pub async fn list_transactions(
2725 &mut self,
2726 request: impl tonic::IntoRequest<super::ListTransactionsRequest>,
2727 ) -> std::result::Result<
2728 tonic::Response<tonic::codec::Streaming<super::ListTransactionsResponse>>,
2729 tonic::Status,
2730 > {
2731 self.inner
2732 .ready()
2733 .await
2734 .map_err(|e| {
2735 tonic::Status::unknown(
2736 format!("Service was not ready: {}", e.into()),
2737 )
2738 })?;
2739 let codec = tonic_prost::ProstCodec::default();
2740 let path = http::uri::PathAndQuery::from_static(
2741 "/sui.rpc.v2.LedgerService/ListTransactions",
2742 );
2743 let mut req = request.into_request();
2744 req.extensions_mut()
2745 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListTransactions"));
2746 self.inner.server_streaming(req, path, codec).await
2747 }
2748 pub async fn list_events(
2753 &mut self,
2754 request: impl tonic::IntoRequest<super::ListEventsRequest>,
2755 ) -> std::result::Result<
2756 tonic::Response<tonic::codec::Streaming<super::ListEventsResponse>>,
2757 tonic::Status,
2758 > {
2759 self.inner
2760 .ready()
2761 .await
2762 .map_err(|e| {
2763 tonic::Status::unknown(
2764 format!("Service was not ready: {}", e.into()),
2765 )
2766 })?;
2767 let codec = tonic_prost::ProstCodec::default();
2768 let path = http::uri::PathAndQuery::from_static(
2769 "/sui.rpc.v2.LedgerService/ListEvents",
2770 );
2771 let mut req = request.into_request();
2772 req.extensions_mut()
2773 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListEvents"));
2774 self.inner.server_streaming(req, path, codec).await
2775 }
2776 }
2777}
2778pub mod ledger_service_server {
2780 #![allow(
2781 unused_variables,
2782 dead_code,
2783 missing_docs,
2784 clippy::wildcard_imports,
2785 clippy::let_unit_value,
2786 )]
2787 use tonic::codegen::*;
2788 #[async_trait]
2790 pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2791 async fn get_service_info(
2793 &self,
2794 request: tonic::Request<super::GetServiceInfoRequest>,
2795 ) -> std::result::Result<
2796 tonic::Response<super::GetServiceInfoResponse>,
2797 tonic::Status,
2798 > {
2799 Err(tonic::Status::unimplemented("Not yet implemented"))
2800 }
2801 async fn get_object(
2802 &self,
2803 request: tonic::Request<super::GetObjectRequest>,
2804 ) -> std::result::Result<
2805 tonic::Response<super::GetObjectResponse>,
2806 tonic::Status,
2807 > {
2808 Err(tonic::Status::unimplemented("Not yet implemented"))
2809 }
2810 async fn batch_get_objects(
2811 &self,
2812 request: tonic::Request<super::BatchGetObjectsRequest>,
2813 ) -> std::result::Result<
2814 tonic::Response<super::BatchGetObjectsResponse>,
2815 tonic::Status,
2816 > {
2817 Err(tonic::Status::unimplemented("Not yet implemented"))
2818 }
2819 async fn get_transaction(
2820 &self,
2821 request: tonic::Request<super::GetTransactionRequest>,
2822 ) -> std::result::Result<
2823 tonic::Response<super::GetTransactionResponse>,
2824 tonic::Status,
2825 > {
2826 Err(tonic::Status::unimplemented("Not yet implemented"))
2827 }
2828 async fn batch_get_transactions(
2829 &self,
2830 request: tonic::Request<super::BatchGetTransactionsRequest>,
2831 ) -> std::result::Result<
2832 tonic::Response<super::BatchGetTransactionsResponse>,
2833 tonic::Status,
2834 > {
2835 Err(tonic::Status::unimplemented("Not yet implemented"))
2836 }
2837 async fn get_checkpoint(
2838 &self,
2839 request: tonic::Request<super::GetCheckpointRequest>,
2840 ) -> std::result::Result<
2841 tonic::Response<super::GetCheckpointResponse>,
2842 tonic::Status,
2843 > {
2844 Err(tonic::Status::unimplemented("Not yet implemented"))
2845 }
2846 async fn get_epoch(
2847 &self,
2848 request: tonic::Request<super::GetEpochRequest>,
2849 ) -> std::result::Result<
2850 tonic::Response<super::GetEpochResponse>,
2851 tonic::Status,
2852 > {
2853 Err(tonic::Status::unimplemented("Not yet implemented"))
2854 }
2855 async fn list_checkpoints(
2861 &self,
2862 request: tonic::Request<super::ListCheckpointsRequest>,
2863 ) -> std::result::Result<
2864 tonic::Response<BoxStream<super::ListCheckpointsResponse>>,
2865 tonic::Status,
2866 > {
2867 Err(tonic::Status::unimplemented("Not yet implemented"))
2868 }
2869 async fn list_transactions(
2874 &self,
2875 request: tonic::Request<super::ListTransactionsRequest>,
2876 ) -> std::result::Result<
2877 tonic::Response<BoxStream<super::ListTransactionsResponse>>,
2878 tonic::Status,
2879 > {
2880 Err(tonic::Status::unimplemented("Not yet implemented"))
2881 }
2882 async fn list_events(
2887 &self,
2888 request: tonic::Request<super::ListEventsRequest>,
2889 ) -> std::result::Result<
2890 tonic::Response<BoxStream<super::ListEventsResponse>>,
2891 tonic::Status,
2892 > {
2893 Err(tonic::Status::unimplemented("Not yet implemented"))
2894 }
2895 }
2896 #[derive(Debug)]
2897 pub struct LedgerServiceServer<T> {
2898 inner: Arc<T>,
2899 accept_compression_encodings: EnabledCompressionEncodings,
2900 send_compression_encodings: EnabledCompressionEncodings,
2901 max_decoding_message_size: Option<usize>,
2902 max_encoding_message_size: Option<usize>,
2903 }
2904 impl<T> LedgerServiceServer<T> {
2905 pub fn new(inner: T) -> Self {
2906 Self::from_arc(Arc::new(inner))
2907 }
2908 pub fn from_arc(inner: Arc<T>) -> Self {
2909 Self {
2910 inner,
2911 accept_compression_encodings: Default::default(),
2912 send_compression_encodings: Default::default(),
2913 max_decoding_message_size: None,
2914 max_encoding_message_size: None,
2915 }
2916 }
2917 pub fn with_interceptor<F>(
2918 inner: T,
2919 interceptor: F,
2920 ) -> InterceptedService<Self, F>
2921 where
2922 F: tonic::service::Interceptor,
2923 {
2924 InterceptedService::new(Self::new(inner), interceptor)
2925 }
2926 #[must_use]
2928 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2929 self.accept_compression_encodings.enable(encoding);
2930 self
2931 }
2932 #[must_use]
2934 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2935 self.send_compression_encodings.enable(encoding);
2936 self
2937 }
2938 #[must_use]
2942 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2943 self.max_decoding_message_size = Some(limit);
2944 self
2945 }
2946 #[must_use]
2950 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2951 self.max_encoding_message_size = Some(limit);
2952 self
2953 }
2954 }
2955 impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
2956 where
2957 T: LedgerService,
2958 B: Body + std::marker::Send + 'static,
2959 B::Error: Into<StdError> + std::marker::Send + 'static,
2960 {
2961 type Response = http::Response<tonic::body::Body>;
2962 type Error = std::convert::Infallible;
2963 type Future = BoxFuture<Self::Response, Self::Error>;
2964 fn poll_ready(
2965 &mut self,
2966 _cx: &mut Context<'_>,
2967 ) -> Poll<std::result::Result<(), Self::Error>> {
2968 Poll::Ready(Ok(()))
2969 }
2970 fn call(&mut self, req: http::Request<B>) -> Self::Future {
2971 match req.uri().path() {
2972 "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
2973 #[allow(non_camel_case_types)]
2974 struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
2975 impl<
2976 T: LedgerService,
2977 > tonic::server::UnaryService<super::GetServiceInfoRequest>
2978 for GetServiceInfoSvc<T> {
2979 type Response = super::GetServiceInfoResponse;
2980 type Future = BoxFuture<
2981 tonic::Response<Self::Response>,
2982 tonic::Status,
2983 >;
2984 fn call(
2985 &mut self,
2986 request: tonic::Request<super::GetServiceInfoRequest>,
2987 ) -> Self::Future {
2988 let inner = Arc::clone(&self.0);
2989 let fut = async move {
2990 <T as LedgerService>::get_service_info(&inner, request)
2991 .await
2992 };
2993 Box::pin(fut)
2994 }
2995 }
2996 let accept_compression_encodings = self.accept_compression_encodings;
2997 let send_compression_encodings = self.send_compression_encodings;
2998 let max_decoding_message_size = self.max_decoding_message_size;
2999 let max_encoding_message_size = self.max_encoding_message_size;
3000 let inner = self.inner.clone();
3001 let fut = async move {
3002 let method = GetServiceInfoSvc(inner);
3003 let codec = tonic_prost::ProstCodec::default();
3004 let mut grpc = tonic::server::Grpc::new(codec)
3005 .apply_compression_config(
3006 accept_compression_encodings,
3007 send_compression_encodings,
3008 )
3009 .apply_max_message_size_config(
3010 max_decoding_message_size,
3011 max_encoding_message_size,
3012 );
3013 let res = grpc.unary(method, req).await;
3014 Ok(res)
3015 };
3016 Box::pin(fut)
3017 }
3018 "/sui.rpc.v2.LedgerService/GetObject" => {
3019 #[allow(non_camel_case_types)]
3020 struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
3021 impl<
3022 T: LedgerService,
3023 > tonic::server::UnaryService<super::GetObjectRequest>
3024 for GetObjectSvc<T> {
3025 type Response = super::GetObjectResponse;
3026 type Future = BoxFuture<
3027 tonic::Response<Self::Response>,
3028 tonic::Status,
3029 >;
3030 fn call(
3031 &mut self,
3032 request: tonic::Request<super::GetObjectRequest>,
3033 ) -> Self::Future {
3034 let inner = Arc::clone(&self.0);
3035 let fut = async move {
3036 <T as LedgerService>::get_object(&inner, request).await
3037 };
3038 Box::pin(fut)
3039 }
3040 }
3041 let accept_compression_encodings = self.accept_compression_encodings;
3042 let send_compression_encodings = self.send_compression_encodings;
3043 let max_decoding_message_size = self.max_decoding_message_size;
3044 let max_encoding_message_size = self.max_encoding_message_size;
3045 let inner = self.inner.clone();
3046 let fut = async move {
3047 let method = GetObjectSvc(inner);
3048 let codec = tonic_prost::ProstCodec::default();
3049 let mut grpc = tonic::server::Grpc::new(codec)
3050 .apply_compression_config(
3051 accept_compression_encodings,
3052 send_compression_encodings,
3053 )
3054 .apply_max_message_size_config(
3055 max_decoding_message_size,
3056 max_encoding_message_size,
3057 );
3058 let res = grpc.unary(method, req).await;
3059 Ok(res)
3060 };
3061 Box::pin(fut)
3062 }
3063 "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
3064 #[allow(non_camel_case_types)]
3065 struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
3066 impl<
3067 T: LedgerService,
3068 > tonic::server::UnaryService<super::BatchGetObjectsRequest>
3069 for BatchGetObjectsSvc<T> {
3070 type Response = super::BatchGetObjectsResponse;
3071 type Future = BoxFuture<
3072 tonic::Response<Self::Response>,
3073 tonic::Status,
3074 >;
3075 fn call(
3076 &mut self,
3077 request: tonic::Request<super::BatchGetObjectsRequest>,
3078 ) -> Self::Future {
3079 let inner = Arc::clone(&self.0);
3080 let fut = async move {
3081 <T as LedgerService>::batch_get_objects(&inner, request)
3082 .await
3083 };
3084 Box::pin(fut)
3085 }
3086 }
3087 let accept_compression_encodings = self.accept_compression_encodings;
3088 let send_compression_encodings = self.send_compression_encodings;
3089 let max_decoding_message_size = self.max_decoding_message_size;
3090 let max_encoding_message_size = self.max_encoding_message_size;
3091 let inner = self.inner.clone();
3092 let fut = async move {
3093 let method = BatchGetObjectsSvc(inner);
3094 let codec = tonic_prost::ProstCodec::default();
3095 let mut grpc = tonic::server::Grpc::new(codec)
3096 .apply_compression_config(
3097 accept_compression_encodings,
3098 send_compression_encodings,
3099 )
3100 .apply_max_message_size_config(
3101 max_decoding_message_size,
3102 max_encoding_message_size,
3103 );
3104 let res = grpc.unary(method, req).await;
3105 Ok(res)
3106 };
3107 Box::pin(fut)
3108 }
3109 "/sui.rpc.v2.LedgerService/GetTransaction" => {
3110 #[allow(non_camel_case_types)]
3111 struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
3112 impl<
3113 T: LedgerService,
3114 > tonic::server::UnaryService<super::GetTransactionRequest>
3115 for GetTransactionSvc<T> {
3116 type Response = super::GetTransactionResponse;
3117 type Future = BoxFuture<
3118 tonic::Response<Self::Response>,
3119 tonic::Status,
3120 >;
3121 fn call(
3122 &mut self,
3123 request: tonic::Request<super::GetTransactionRequest>,
3124 ) -> Self::Future {
3125 let inner = Arc::clone(&self.0);
3126 let fut = async move {
3127 <T as LedgerService>::get_transaction(&inner, request).await
3128 };
3129 Box::pin(fut)
3130 }
3131 }
3132 let accept_compression_encodings = self.accept_compression_encodings;
3133 let send_compression_encodings = self.send_compression_encodings;
3134 let max_decoding_message_size = self.max_decoding_message_size;
3135 let max_encoding_message_size = self.max_encoding_message_size;
3136 let inner = self.inner.clone();
3137 let fut = async move {
3138 let method = GetTransactionSvc(inner);
3139 let codec = tonic_prost::ProstCodec::default();
3140 let mut grpc = tonic::server::Grpc::new(codec)
3141 .apply_compression_config(
3142 accept_compression_encodings,
3143 send_compression_encodings,
3144 )
3145 .apply_max_message_size_config(
3146 max_decoding_message_size,
3147 max_encoding_message_size,
3148 );
3149 let res = grpc.unary(method, req).await;
3150 Ok(res)
3151 };
3152 Box::pin(fut)
3153 }
3154 "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
3155 #[allow(non_camel_case_types)]
3156 struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
3157 impl<
3158 T: LedgerService,
3159 > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
3160 for BatchGetTransactionsSvc<T> {
3161 type Response = super::BatchGetTransactionsResponse;
3162 type Future = BoxFuture<
3163 tonic::Response<Self::Response>,
3164 tonic::Status,
3165 >;
3166 fn call(
3167 &mut self,
3168 request: tonic::Request<super::BatchGetTransactionsRequest>,
3169 ) -> Self::Future {
3170 let inner = Arc::clone(&self.0);
3171 let fut = async move {
3172 <T as LedgerService>::batch_get_transactions(
3173 &inner,
3174 request,
3175 )
3176 .await
3177 };
3178 Box::pin(fut)
3179 }
3180 }
3181 let accept_compression_encodings = self.accept_compression_encodings;
3182 let send_compression_encodings = self.send_compression_encodings;
3183 let max_decoding_message_size = self.max_decoding_message_size;
3184 let max_encoding_message_size = self.max_encoding_message_size;
3185 let inner = self.inner.clone();
3186 let fut = async move {
3187 let method = BatchGetTransactionsSvc(inner);
3188 let codec = tonic_prost::ProstCodec::default();
3189 let mut grpc = tonic::server::Grpc::new(codec)
3190 .apply_compression_config(
3191 accept_compression_encodings,
3192 send_compression_encodings,
3193 )
3194 .apply_max_message_size_config(
3195 max_decoding_message_size,
3196 max_encoding_message_size,
3197 );
3198 let res = grpc.unary(method, req).await;
3199 Ok(res)
3200 };
3201 Box::pin(fut)
3202 }
3203 "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
3204 #[allow(non_camel_case_types)]
3205 struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
3206 impl<
3207 T: LedgerService,
3208 > tonic::server::UnaryService<super::GetCheckpointRequest>
3209 for GetCheckpointSvc<T> {
3210 type Response = super::GetCheckpointResponse;
3211 type Future = BoxFuture<
3212 tonic::Response<Self::Response>,
3213 tonic::Status,
3214 >;
3215 fn call(
3216 &mut self,
3217 request: tonic::Request<super::GetCheckpointRequest>,
3218 ) -> Self::Future {
3219 let inner = Arc::clone(&self.0);
3220 let fut = async move {
3221 <T as LedgerService>::get_checkpoint(&inner, request).await
3222 };
3223 Box::pin(fut)
3224 }
3225 }
3226 let accept_compression_encodings = self.accept_compression_encodings;
3227 let send_compression_encodings = self.send_compression_encodings;
3228 let max_decoding_message_size = self.max_decoding_message_size;
3229 let max_encoding_message_size = self.max_encoding_message_size;
3230 let inner = self.inner.clone();
3231 let fut = async move {
3232 let method = GetCheckpointSvc(inner);
3233 let codec = tonic_prost::ProstCodec::default();
3234 let mut grpc = tonic::server::Grpc::new(codec)
3235 .apply_compression_config(
3236 accept_compression_encodings,
3237 send_compression_encodings,
3238 )
3239 .apply_max_message_size_config(
3240 max_decoding_message_size,
3241 max_encoding_message_size,
3242 );
3243 let res = grpc.unary(method, req).await;
3244 Ok(res)
3245 };
3246 Box::pin(fut)
3247 }
3248 "/sui.rpc.v2.LedgerService/GetEpoch" => {
3249 #[allow(non_camel_case_types)]
3250 struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
3251 impl<
3252 T: LedgerService,
3253 > tonic::server::UnaryService<super::GetEpochRequest>
3254 for GetEpochSvc<T> {
3255 type Response = super::GetEpochResponse;
3256 type Future = BoxFuture<
3257 tonic::Response<Self::Response>,
3258 tonic::Status,
3259 >;
3260 fn call(
3261 &mut self,
3262 request: tonic::Request<super::GetEpochRequest>,
3263 ) -> Self::Future {
3264 let inner = Arc::clone(&self.0);
3265 let fut = async move {
3266 <T as LedgerService>::get_epoch(&inner, request).await
3267 };
3268 Box::pin(fut)
3269 }
3270 }
3271 let accept_compression_encodings = self.accept_compression_encodings;
3272 let send_compression_encodings = self.send_compression_encodings;
3273 let max_decoding_message_size = self.max_decoding_message_size;
3274 let max_encoding_message_size = self.max_encoding_message_size;
3275 let inner = self.inner.clone();
3276 let fut = async move {
3277 let method = GetEpochSvc(inner);
3278 let codec = tonic_prost::ProstCodec::default();
3279 let mut grpc = tonic::server::Grpc::new(codec)
3280 .apply_compression_config(
3281 accept_compression_encodings,
3282 send_compression_encodings,
3283 )
3284 .apply_max_message_size_config(
3285 max_decoding_message_size,
3286 max_encoding_message_size,
3287 );
3288 let res = grpc.unary(method, req).await;
3289 Ok(res)
3290 };
3291 Box::pin(fut)
3292 }
3293 "/sui.rpc.v2.LedgerService/ListCheckpoints" => {
3294 #[allow(non_camel_case_types)]
3295 struct ListCheckpointsSvc<T: LedgerService>(pub Arc<T>);
3296 impl<
3297 T: LedgerService,
3298 > tonic::server::ServerStreamingService<
3299 super::ListCheckpointsRequest,
3300 > for ListCheckpointsSvc<T> {
3301 type Response = super::ListCheckpointsResponse;
3302 type ResponseStream = BoxStream<super::ListCheckpointsResponse>;
3303 type Future = BoxFuture<
3304 tonic::Response<Self::ResponseStream>,
3305 tonic::Status,
3306 >;
3307 fn call(
3308 &mut self,
3309 request: tonic::Request<super::ListCheckpointsRequest>,
3310 ) -> Self::Future {
3311 let inner = Arc::clone(&self.0);
3312 let fut = async move {
3313 <T as LedgerService>::list_checkpoints(&inner, request)
3314 .await
3315 };
3316 Box::pin(fut)
3317 }
3318 }
3319 let accept_compression_encodings = self.accept_compression_encodings;
3320 let send_compression_encodings = self.send_compression_encodings;
3321 let max_decoding_message_size = self.max_decoding_message_size;
3322 let max_encoding_message_size = self.max_encoding_message_size;
3323 let inner = self.inner.clone();
3324 let fut = async move {
3325 let method = ListCheckpointsSvc(inner);
3326 let codec = tonic_prost::ProstCodec::default();
3327 let mut grpc = tonic::server::Grpc::new(codec)
3328 .apply_compression_config(
3329 accept_compression_encodings,
3330 send_compression_encodings,
3331 )
3332 .apply_max_message_size_config(
3333 max_decoding_message_size,
3334 max_encoding_message_size,
3335 );
3336 let res = grpc.server_streaming(method, req).await;
3337 Ok(res)
3338 };
3339 Box::pin(fut)
3340 }
3341 "/sui.rpc.v2.LedgerService/ListTransactions" => {
3342 #[allow(non_camel_case_types)]
3343 struct ListTransactionsSvc<T: LedgerService>(pub Arc<T>);
3344 impl<
3345 T: LedgerService,
3346 > tonic::server::ServerStreamingService<
3347 super::ListTransactionsRequest,
3348 > for ListTransactionsSvc<T> {
3349 type Response = super::ListTransactionsResponse;
3350 type ResponseStream = BoxStream<super::ListTransactionsResponse>;
3351 type Future = BoxFuture<
3352 tonic::Response<Self::ResponseStream>,
3353 tonic::Status,
3354 >;
3355 fn call(
3356 &mut self,
3357 request: tonic::Request<super::ListTransactionsRequest>,
3358 ) -> Self::Future {
3359 let inner = Arc::clone(&self.0);
3360 let fut = async move {
3361 <T as LedgerService>::list_transactions(&inner, request)
3362 .await
3363 };
3364 Box::pin(fut)
3365 }
3366 }
3367 let accept_compression_encodings = self.accept_compression_encodings;
3368 let send_compression_encodings = self.send_compression_encodings;
3369 let max_decoding_message_size = self.max_decoding_message_size;
3370 let max_encoding_message_size = self.max_encoding_message_size;
3371 let inner = self.inner.clone();
3372 let fut = async move {
3373 let method = ListTransactionsSvc(inner);
3374 let codec = tonic_prost::ProstCodec::default();
3375 let mut grpc = tonic::server::Grpc::new(codec)
3376 .apply_compression_config(
3377 accept_compression_encodings,
3378 send_compression_encodings,
3379 )
3380 .apply_max_message_size_config(
3381 max_decoding_message_size,
3382 max_encoding_message_size,
3383 );
3384 let res = grpc.server_streaming(method, req).await;
3385 Ok(res)
3386 };
3387 Box::pin(fut)
3388 }
3389 "/sui.rpc.v2.LedgerService/ListEvents" => {
3390 #[allow(non_camel_case_types)]
3391 struct ListEventsSvc<T: LedgerService>(pub Arc<T>);
3392 impl<
3393 T: LedgerService,
3394 > tonic::server::ServerStreamingService<super::ListEventsRequest>
3395 for ListEventsSvc<T> {
3396 type Response = super::ListEventsResponse;
3397 type ResponseStream = BoxStream<super::ListEventsResponse>;
3398 type Future = BoxFuture<
3399 tonic::Response<Self::ResponseStream>,
3400 tonic::Status,
3401 >;
3402 fn call(
3403 &mut self,
3404 request: tonic::Request<super::ListEventsRequest>,
3405 ) -> Self::Future {
3406 let inner = Arc::clone(&self.0);
3407 let fut = async move {
3408 <T as LedgerService>::list_events(&inner, request).await
3409 };
3410 Box::pin(fut)
3411 }
3412 }
3413 let accept_compression_encodings = self.accept_compression_encodings;
3414 let send_compression_encodings = self.send_compression_encodings;
3415 let max_decoding_message_size = self.max_decoding_message_size;
3416 let max_encoding_message_size = self.max_encoding_message_size;
3417 let inner = self.inner.clone();
3418 let fut = async move {
3419 let method = ListEventsSvc(inner);
3420 let codec = tonic_prost::ProstCodec::default();
3421 let mut grpc = tonic::server::Grpc::new(codec)
3422 .apply_compression_config(
3423 accept_compression_encodings,
3424 send_compression_encodings,
3425 )
3426 .apply_max_message_size_config(
3427 max_decoding_message_size,
3428 max_encoding_message_size,
3429 );
3430 let res = grpc.server_streaming(method, req).await;
3431 Ok(res)
3432 };
3433 Box::pin(fut)
3434 }
3435 _ => {
3436 Box::pin(async move {
3437 let mut response = http::Response::new(
3438 tonic::body::Body::default(),
3439 );
3440 let headers = response.headers_mut();
3441 headers
3442 .insert(
3443 tonic::Status::GRPC_STATUS,
3444 (tonic::Code::Unimplemented as i32).into(),
3445 );
3446 headers
3447 .insert(
3448 http::header::CONTENT_TYPE,
3449 tonic::metadata::GRPC_CONTENT_TYPE,
3450 );
3451 Ok(response)
3452 })
3453 }
3454 }
3455 }
3456 }
3457 impl<T> Clone for LedgerServiceServer<T> {
3458 fn clone(&self) -> Self {
3459 let inner = self.inner.clone();
3460 Self {
3461 inner,
3462 accept_compression_encodings: self.accept_compression_encodings,
3463 send_compression_encodings: self.send_compression_encodings,
3464 max_decoding_message_size: self.max_decoding_message_size,
3465 max_encoding_message_size: self.max_encoding_message_size,
3466 }
3467 }
3468 }
3469 pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
3471 impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
3472 const NAME: &'static str = SERVICE_NAME;
3473 }
3474}
3475#[non_exhaustive]
3477#[derive(Clone, PartialEq, ::prost::Message)]
3478pub struct Package {
3479 #[prost(string, optional, tag = "1")]
3485 pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
3486 #[prost(string, optional, tag = "2")]
3493 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3494 #[prost(uint64, optional, tag = "3")]
3496 pub version: ::core::option::Option<u64>,
3497 #[prost(message, repeated, tag = "4")]
3499 pub modules: ::prost::alloc::vec::Vec<Module>,
3500 #[prost(message, repeated, tag = "5")]
3503 pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
3504 #[prost(message, repeated, tag = "6")]
3508 pub linkage: ::prost::alloc::vec::Vec<Linkage>,
3509}
3510#[non_exhaustive]
3512#[derive(Clone, PartialEq, ::prost::Message)]
3513pub struct Module {
3514 #[prost(string, optional, tag = "1")]
3516 pub name: ::core::option::Option<::prost::alloc::string::String>,
3517 #[prost(bytes = "bytes", optional, tag = "2")]
3519 pub contents: ::core::option::Option<::prost::bytes::Bytes>,
3520 #[prost(message, repeated, tag = "3")]
3522 pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
3523 #[prost(message, repeated, tag = "4")]
3525 pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
3526}
3527#[non_exhaustive]
3529#[derive(Clone, PartialEq, ::prost::Message)]
3530pub struct DatatypeDescriptor {
3531 #[prost(string, optional, tag = "1")]
3535 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3536 #[prost(string, optional, tag = "2")]
3540 pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
3541 #[prost(string, optional, tag = "3")]
3543 pub module: ::core::option::Option<::prost::alloc::string::String>,
3544 #[prost(string, optional, tag = "4")]
3546 pub name: ::core::option::Option<::prost::alloc::string::String>,
3547 #[prost(enumeration = "Ability", repeated, tag = "5")]
3549 pub abilities: ::prost::alloc::vec::Vec<i32>,
3550 #[prost(message, repeated, tag = "6")]
3552 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3553 #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
3555 pub kind: ::core::option::Option<i32>,
3556 #[prost(message, repeated, tag = "8")]
3560 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3561 #[prost(message, repeated, tag = "9")]
3565 pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
3566}
3567pub mod datatype_descriptor {
3569 #[non_exhaustive]
3570 #[derive(
3571 Clone,
3572 Copy,
3573 Debug,
3574 PartialEq,
3575 Eq,
3576 Hash,
3577 PartialOrd,
3578 Ord,
3579 ::prost::Enumeration
3580 )]
3581 #[repr(i32)]
3582 pub enum DatatypeKind {
3583 Unknown = 0,
3584 Struct = 1,
3585 Enum = 2,
3586 }
3587 impl DatatypeKind {
3588 pub fn as_str_name(&self) -> &'static str {
3593 match self {
3594 Self::Unknown => "DATATYPE_KIND_UNKNOWN",
3595 Self::Struct => "STRUCT",
3596 Self::Enum => "ENUM",
3597 }
3598 }
3599 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3601 match value {
3602 "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
3603 "STRUCT" => Some(Self::Struct),
3604 "ENUM" => Some(Self::Enum),
3605 _ => None,
3606 }
3607 }
3608 }
3609}
3610#[non_exhaustive]
3612#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3613pub struct TypeParameter {
3614 #[prost(enumeration = "Ability", repeated, tag = "1")]
3616 pub constraints: ::prost::alloc::vec::Vec<i32>,
3617 #[prost(bool, optional, tag = "2")]
3619 pub is_phantom: ::core::option::Option<bool>,
3620}
3621#[non_exhaustive]
3623#[derive(Clone, PartialEq, ::prost::Message)]
3624pub struct FieldDescriptor {
3625 #[prost(string, optional, tag = "1")]
3627 pub name: ::core::option::Option<::prost::alloc::string::String>,
3628 #[prost(uint32, optional, tag = "2")]
3630 pub position: ::core::option::Option<u32>,
3631 #[prost(message, optional, tag = "3")]
3633 pub r#type: ::core::option::Option<OpenSignatureBody>,
3634}
3635#[non_exhaustive]
3637#[derive(Clone, PartialEq, ::prost::Message)]
3638pub struct VariantDescriptor {
3639 #[prost(string, optional, tag = "1")]
3641 pub name: ::core::option::Option<::prost::alloc::string::String>,
3642 #[prost(uint32, optional, tag = "2")]
3644 pub position: ::core::option::Option<u32>,
3645 #[prost(message, repeated, tag = "3")]
3647 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3648}
3649#[non_exhaustive]
3651#[derive(Clone, PartialEq, ::prost::Message)]
3652pub struct OpenSignatureBody {
3653 #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
3655 pub r#type: ::core::option::Option<i32>,
3656 #[prost(string, optional, tag = "2")]
3658 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3659 #[prost(message, repeated, tag = "3")]
3661 pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
3662 #[prost(uint32, optional, tag = "4")]
3664 pub type_parameter: ::core::option::Option<u32>,
3665}
3666pub mod open_signature_body {
3668 #[non_exhaustive]
3669 #[derive(
3670 Clone,
3671 Copy,
3672 Debug,
3673 PartialEq,
3674 Eq,
3675 Hash,
3676 PartialOrd,
3677 Ord,
3678 ::prost::Enumeration
3679 )]
3680 #[repr(i32)]
3681 pub enum Type {
3682 Unknown = 0,
3683 Address = 1,
3684 Bool = 2,
3685 U8 = 3,
3686 U16 = 4,
3687 U32 = 5,
3688 U64 = 6,
3689 U128 = 7,
3690 U256 = 8,
3691 Vector = 9,
3692 Datatype = 10,
3693 Parameter = 11,
3694 }
3695 impl Type {
3696 pub fn as_str_name(&self) -> &'static str {
3701 match self {
3702 Self::Unknown => "TYPE_UNKNOWN",
3703 Self::Address => "ADDRESS",
3704 Self::Bool => "BOOL",
3705 Self::U8 => "U8",
3706 Self::U16 => "U16",
3707 Self::U32 => "U32",
3708 Self::U64 => "U64",
3709 Self::U128 => "U128",
3710 Self::U256 => "U256",
3711 Self::Vector => "VECTOR",
3712 Self::Datatype => "DATATYPE",
3713 Self::Parameter => "TYPE_PARAMETER",
3714 }
3715 }
3716 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3718 match value {
3719 "TYPE_UNKNOWN" => Some(Self::Unknown),
3720 "ADDRESS" => Some(Self::Address),
3721 "BOOL" => Some(Self::Bool),
3722 "U8" => Some(Self::U8),
3723 "U16" => Some(Self::U16),
3724 "U32" => Some(Self::U32),
3725 "U64" => Some(Self::U64),
3726 "U128" => Some(Self::U128),
3727 "U256" => Some(Self::U256),
3728 "VECTOR" => Some(Self::Vector),
3729 "DATATYPE" => Some(Self::Datatype),
3730 "TYPE_PARAMETER" => Some(Self::Parameter),
3731 _ => None,
3732 }
3733 }
3734 }
3735}
3736#[non_exhaustive]
3738#[derive(Clone, PartialEq, ::prost::Message)]
3739pub struct FunctionDescriptor {
3740 #[prost(string, optional, tag = "1")]
3742 pub name: ::core::option::Option<::prost::alloc::string::String>,
3743 #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
3745 pub visibility: ::core::option::Option<i32>,
3746 #[prost(bool, optional, tag = "6")]
3748 pub is_entry: ::core::option::Option<bool>,
3749 #[prost(message, repeated, tag = "7")]
3751 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3752 #[prost(message, repeated, tag = "8")]
3754 pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
3755 #[prost(message, repeated, tag = "9")]
3757 pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
3758}
3759pub mod function_descriptor {
3761 #[non_exhaustive]
3762 #[derive(
3763 Clone,
3764 Copy,
3765 Debug,
3766 PartialEq,
3767 Eq,
3768 Hash,
3769 PartialOrd,
3770 Ord,
3771 ::prost::Enumeration
3772 )]
3773 #[repr(i32)]
3774 pub enum Visibility {
3775 Unknown = 0,
3776 Private = 1,
3777 Public = 2,
3778 Friend = 3,
3779 }
3780 impl Visibility {
3781 pub fn as_str_name(&self) -> &'static str {
3786 match self {
3787 Self::Unknown => "VISIBILITY_UNKNOWN",
3788 Self::Private => "PRIVATE",
3789 Self::Public => "PUBLIC",
3790 Self::Friend => "FRIEND",
3791 }
3792 }
3793 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3795 match value {
3796 "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
3797 "PRIVATE" => Some(Self::Private),
3798 "PUBLIC" => Some(Self::Public),
3799 "FRIEND" => Some(Self::Friend),
3800 _ => None,
3801 }
3802 }
3803 }
3804}
3805#[non_exhaustive]
3807#[derive(Clone, PartialEq, ::prost::Message)]
3808pub struct OpenSignature {
3809 #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
3810 pub reference: ::core::option::Option<i32>,
3811 #[prost(message, optional, tag = "2")]
3812 pub body: ::core::option::Option<OpenSignatureBody>,
3813}
3814pub mod open_signature {
3816 #[non_exhaustive]
3817 #[derive(
3818 Clone,
3819 Copy,
3820 Debug,
3821 PartialEq,
3822 Eq,
3823 Hash,
3824 PartialOrd,
3825 Ord,
3826 ::prost::Enumeration
3827 )]
3828 #[repr(i32)]
3829 pub enum Reference {
3830 Unknown = 0,
3831 Immutable = 1,
3832 Mutable = 2,
3833 }
3834 impl Reference {
3835 pub fn as_str_name(&self) -> &'static str {
3840 match self {
3841 Self::Unknown => "REFERENCE_UNKNOWN",
3842 Self::Immutable => "IMMUTABLE",
3843 Self::Mutable => "MUTABLE",
3844 }
3845 }
3846 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3848 match value {
3849 "REFERENCE_UNKNOWN" => Some(Self::Unknown),
3850 "IMMUTABLE" => Some(Self::Immutable),
3851 "MUTABLE" => Some(Self::Mutable),
3852 _ => None,
3853 }
3854 }
3855 }
3856}
3857#[non_exhaustive]
3859#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3860pub struct TypeOrigin {
3861 #[prost(string, optional, tag = "1")]
3862 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3863 #[prost(string, optional, tag = "2")]
3864 pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
3865 #[prost(string, optional, tag = "3")]
3866 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3867}
3868#[non_exhaustive]
3870#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3871pub struct Linkage {
3872 #[prost(string, optional, tag = "1")]
3874 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3875 #[prost(string, optional, tag = "2")]
3877 pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
3878 #[prost(uint64, optional, tag = "3")]
3880 pub upgraded_version: ::core::option::Option<u64>,
3881}
3882#[non_exhaustive]
3884#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3885#[repr(i32)]
3886pub enum Ability {
3887 Unknown = 0,
3888 Copy = 1,
3890 Drop = 2,
3892 Store = 3,
3894 Key = 4,
3896}
3897impl Ability {
3898 pub fn as_str_name(&self) -> &'static str {
3903 match self {
3904 Self::Unknown => "ABILITY_UNKNOWN",
3905 Self::Copy => "COPY",
3906 Self::Drop => "DROP",
3907 Self::Store => "STORE",
3908 Self::Key => "KEY",
3909 }
3910 }
3911 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3913 match value {
3914 "ABILITY_UNKNOWN" => Some(Self::Unknown),
3915 "COPY" => Some(Self::Copy),
3916 "DROP" => Some(Self::Drop),
3917 "STORE" => Some(Self::Store),
3918 "KEY" => Some(Self::Key),
3919 _ => None,
3920 }
3921 }
3922}
3923#[non_exhaustive]
3924#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3925pub struct GetPackageRequest {
3926 #[prost(string, optional, tag = "1")]
3928 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3929}
3930#[non_exhaustive]
3931#[derive(Clone, PartialEq, ::prost::Message)]
3932pub struct GetPackageResponse {
3933 #[prost(message, optional, tag = "1")]
3935 pub package: ::core::option::Option<Package>,
3936}
3937#[non_exhaustive]
3938#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3939pub struct GetDatatypeRequest {
3940 #[prost(string, optional, tag = "1")]
3942 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3943 #[prost(string, optional, tag = "2")]
3945 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3946 #[prost(string, optional, tag = "3")]
3948 pub name: ::core::option::Option<::prost::alloc::string::String>,
3949}
3950#[non_exhaustive]
3951#[derive(Clone, PartialEq, ::prost::Message)]
3952pub struct GetDatatypeResponse {
3953 #[prost(message, optional, tag = "1")]
3955 pub datatype: ::core::option::Option<DatatypeDescriptor>,
3956}
3957#[non_exhaustive]
3958#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3959pub struct GetFunctionRequest {
3960 #[prost(string, optional, tag = "1")]
3962 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3963 #[prost(string, optional, tag = "2")]
3965 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3966 #[prost(string, optional, tag = "3")]
3968 pub name: ::core::option::Option<::prost::alloc::string::String>,
3969}
3970#[non_exhaustive]
3971#[derive(Clone, PartialEq, ::prost::Message)]
3972pub struct GetFunctionResponse {
3973 #[prost(message, optional, tag = "1")]
3975 pub function: ::core::option::Option<FunctionDescriptor>,
3976}
3977#[non_exhaustive]
3978#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3979pub struct ListPackageVersionsRequest {
3980 #[prost(string, optional, tag = "1")]
3982 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3983 #[prost(uint32, optional, tag = "2")]
3987 pub page_size: ::core::option::Option<u32>,
3988 #[prost(bytes = "bytes", optional, tag = "3")]
3994 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
3995}
3996#[non_exhaustive]
3997#[derive(Clone, PartialEq, ::prost::Message)]
3998pub struct ListPackageVersionsResponse {
3999 #[prost(message, repeated, tag = "1")]
4001 pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
4002 #[prost(bytes = "bytes", optional, tag = "2")]
4005 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
4006}
4007#[non_exhaustive]
4009#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4010pub struct PackageVersion {
4011 #[prost(string, optional, tag = "1")]
4013 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4014 #[prost(uint64, optional, tag = "2")]
4016 pub version: ::core::option::Option<u64>,
4017}
4018pub mod move_package_service_client {
4020 #![allow(
4021 unused_variables,
4022 dead_code,
4023 missing_docs,
4024 clippy::wildcard_imports,
4025 clippy::let_unit_value,
4026 )]
4027 use tonic::codegen::*;
4028 use tonic::codegen::http::Uri;
4029 #[derive(Debug, Clone)]
4030 pub struct MovePackageServiceClient<T> {
4031 inner: tonic::client::Grpc<T>,
4032 }
4033 impl MovePackageServiceClient<tonic::transport::Channel> {
4034 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4036 where
4037 D: TryInto<tonic::transport::Endpoint>,
4038 D::Error: Into<StdError>,
4039 {
4040 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4041 Ok(Self::new(conn))
4042 }
4043 }
4044 impl<T> MovePackageServiceClient<T>
4045 where
4046 T: tonic::client::GrpcService<tonic::body::Body>,
4047 T::Error: Into<StdError>,
4048 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4049 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4050 {
4051 pub fn new(inner: T) -> Self {
4052 let inner = tonic::client::Grpc::new(inner);
4053 Self { inner }
4054 }
4055 pub fn with_origin(inner: T, origin: Uri) -> Self {
4056 let inner = tonic::client::Grpc::with_origin(inner, origin);
4057 Self { inner }
4058 }
4059 pub fn with_interceptor<F>(
4060 inner: T,
4061 interceptor: F,
4062 ) -> MovePackageServiceClient<InterceptedService<T, F>>
4063 where
4064 F: tonic::service::Interceptor,
4065 T::ResponseBody: Default,
4066 T: tonic::codegen::Service<
4067 http::Request<tonic::body::Body>,
4068 Response = http::Response<
4069 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4070 >,
4071 >,
4072 <T as tonic::codegen::Service<
4073 http::Request<tonic::body::Body>,
4074 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4075 {
4076 MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
4077 }
4078 #[must_use]
4083 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4084 self.inner = self.inner.send_compressed(encoding);
4085 self
4086 }
4087 #[must_use]
4089 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4090 self.inner = self.inner.accept_compressed(encoding);
4091 self
4092 }
4093 #[must_use]
4097 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4098 self.inner = self.inner.max_decoding_message_size(limit);
4099 self
4100 }
4101 #[must_use]
4105 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4106 self.inner = self.inner.max_encoding_message_size(limit);
4107 self
4108 }
4109 pub async fn get_package(
4110 &mut self,
4111 request: impl tonic::IntoRequest<super::GetPackageRequest>,
4112 ) -> std::result::Result<
4113 tonic::Response<super::GetPackageResponse>,
4114 tonic::Status,
4115 > {
4116 self.inner
4117 .ready()
4118 .await
4119 .map_err(|e| {
4120 tonic::Status::unknown(
4121 format!("Service was not ready: {}", e.into()),
4122 )
4123 })?;
4124 let codec = tonic_prost::ProstCodec::default();
4125 let path = http::uri::PathAndQuery::from_static(
4126 "/sui.rpc.v2.MovePackageService/GetPackage",
4127 );
4128 let mut req = request.into_request();
4129 req.extensions_mut()
4130 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
4131 self.inner.unary(req, path, codec).await
4132 }
4133 pub async fn get_datatype(
4134 &mut self,
4135 request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
4136 ) -> std::result::Result<
4137 tonic::Response<super::GetDatatypeResponse>,
4138 tonic::Status,
4139 > {
4140 self.inner
4141 .ready()
4142 .await
4143 .map_err(|e| {
4144 tonic::Status::unknown(
4145 format!("Service was not ready: {}", e.into()),
4146 )
4147 })?;
4148 let codec = tonic_prost::ProstCodec::default();
4149 let path = http::uri::PathAndQuery::from_static(
4150 "/sui.rpc.v2.MovePackageService/GetDatatype",
4151 );
4152 let mut req = request.into_request();
4153 req.extensions_mut()
4154 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
4155 self.inner.unary(req, path, codec).await
4156 }
4157 pub async fn get_function(
4158 &mut self,
4159 request: impl tonic::IntoRequest<super::GetFunctionRequest>,
4160 ) -> std::result::Result<
4161 tonic::Response<super::GetFunctionResponse>,
4162 tonic::Status,
4163 > {
4164 self.inner
4165 .ready()
4166 .await
4167 .map_err(|e| {
4168 tonic::Status::unknown(
4169 format!("Service was not ready: {}", e.into()),
4170 )
4171 })?;
4172 let codec = tonic_prost::ProstCodec::default();
4173 let path = http::uri::PathAndQuery::from_static(
4174 "/sui.rpc.v2.MovePackageService/GetFunction",
4175 );
4176 let mut req = request.into_request();
4177 req.extensions_mut()
4178 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
4179 self.inner.unary(req, path, codec).await
4180 }
4181 pub async fn list_package_versions(
4182 &mut self,
4183 request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
4184 ) -> std::result::Result<
4185 tonic::Response<super::ListPackageVersionsResponse>,
4186 tonic::Status,
4187 > {
4188 self.inner
4189 .ready()
4190 .await
4191 .map_err(|e| {
4192 tonic::Status::unknown(
4193 format!("Service was not ready: {}", e.into()),
4194 )
4195 })?;
4196 let codec = tonic_prost::ProstCodec::default();
4197 let path = http::uri::PathAndQuery::from_static(
4198 "/sui.rpc.v2.MovePackageService/ListPackageVersions",
4199 );
4200 let mut req = request.into_request();
4201 req.extensions_mut()
4202 .insert(
4203 GrpcMethod::new(
4204 "sui.rpc.v2.MovePackageService",
4205 "ListPackageVersions",
4206 ),
4207 );
4208 self.inner.unary(req, path, codec).await
4209 }
4210 }
4211}
4212pub mod move_package_service_server {
4214 #![allow(
4215 unused_variables,
4216 dead_code,
4217 missing_docs,
4218 clippy::wildcard_imports,
4219 clippy::let_unit_value,
4220 )]
4221 use tonic::codegen::*;
4222 #[async_trait]
4224 pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
4225 async fn get_package(
4226 &self,
4227 request: tonic::Request<super::GetPackageRequest>,
4228 ) -> std::result::Result<
4229 tonic::Response<super::GetPackageResponse>,
4230 tonic::Status,
4231 > {
4232 Err(tonic::Status::unimplemented("Not yet implemented"))
4233 }
4234 async fn get_datatype(
4235 &self,
4236 request: tonic::Request<super::GetDatatypeRequest>,
4237 ) -> std::result::Result<
4238 tonic::Response<super::GetDatatypeResponse>,
4239 tonic::Status,
4240 > {
4241 Err(tonic::Status::unimplemented("Not yet implemented"))
4242 }
4243 async fn get_function(
4244 &self,
4245 request: tonic::Request<super::GetFunctionRequest>,
4246 ) -> std::result::Result<
4247 tonic::Response<super::GetFunctionResponse>,
4248 tonic::Status,
4249 > {
4250 Err(tonic::Status::unimplemented("Not yet implemented"))
4251 }
4252 async fn list_package_versions(
4253 &self,
4254 request: tonic::Request<super::ListPackageVersionsRequest>,
4255 ) -> std::result::Result<
4256 tonic::Response<super::ListPackageVersionsResponse>,
4257 tonic::Status,
4258 > {
4259 Err(tonic::Status::unimplemented("Not yet implemented"))
4260 }
4261 }
4262 #[derive(Debug)]
4263 pub struct MovePackageServiceServer<T> {
4264 inner: Arc<T>,
4265 accept_compression_encodings: EnabledCompressionEncodings,
4266 send_compression_encodings: EnabledCompressionEncodings,
4267 max_decoding_message_size: Option<usize>,
4268 max_encoding_message_size: Option<usize>,
4269 }
4270 impl<T> MovePackageServiceServer<T> {
4271 pub fn new(inner: T) -> Self {
4272 Self::from_arc(Arc::new(inner))
4273 }
4274 pub fn from_arc(inner: Arc<T>) -> Self {
4275 Self {
4276 inner,
4277 accept_compression_encodings: Default::default(),
4278 send_compression_encodings: Default::default(),
4279 max_decoding_message_size: None,
4280 max_encoding_message_size: None,
4281 }
4282 }
4283 pub fn with_interceptor<F>(
4284 inner: T,
4285 interceptor: F,
4286 ) -> InterceptedService<Self, F>
4287 where
4288 F: tonic::service::Interceptor,
4289 {
4290 InterceptedService::new(Self::new(inner), interceptor)
4291 }
4292 #[must_use]
4294 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4295 self.accept_compression_encodings.enable(encoding);
4296 self
4297 }
4298 #[must_use]
4300 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4301 self.send_compression_encodings.enable(encoding);
4302 self
4303 }
4304 #[must_use]
4308 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4309 self.max_decoding_message_size = Some(limit);
4310 self
4311 }
4312 #[must_use]
4316 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4317 self.max_encoding_message_size = Some(limit);
4318 self
4319 }
4320 }
4321 impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
4322 where
4323 T: MovePackageService,
4324 B: Body + std::marker::Send + 'static,
4325 B::Error: Into<StdError> + std::marker::Send + 'static,
4326 {
4327 type Response = http::Response<tonic::body::Body>;
4328 type Error = std::convert::Infallible;
4329 type Future = BoxFuture<Self::Response, Self::Error>;
4330 fn poll_ready(
4331 &mut self,
4332 _cx: &mut Context<'_>,
4333 ) -> Poll<std::result::Result<(), Self::Error>> {
4334 Poll::Ready(Ok(()))
4335 }
4336 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4337 match req.uri().path() {
4338 "/sui.rpc.v2.MovePackageService/GetPackage" => {
4339 #[allow(non_camel_case_types)]
4340 struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
4341 impl<
4342 T: MovePackageService,
4343 > tonic::server::UnaryService<super::GetPackageRequest>
4344 for GetPackageSvc<T> {
4345 type Response = super::GetPackageResponse;
4346 type Future = BoxFuture<
4347 tonic::Response<Self::Response>,
4348 tonic::Status,
4349 >;
4350 fn call(
4351 &mut self,
4352 request: tonic::Request<super::GetPackageRequest>,
4353 ) -> Self::Future {
4354 let inner = Arc::clone(&self.0);
4355 let fut = async move {
4356 <T as MovePackageService>::get_package(&inner, request)
4357 .await
4358 };
4359 Box::pin(fut)
4360 }
4361 }
4362 let accept_compression_encodings = self.accept_compression_encodings;
4363 let send_compression_encodings = self.send_compression_encodings;
4364 let max_decoding_message_size = self.max_decoding_message_size;
4365 let max_encoding_message_size = self.max_encoding_message_size;
4366 let inner = self.inner.clone();
4367 let fut = async move {
4368 let method = GetPackageSvc(inner);
4369 let codec = tonic_prost::ProstCodec::default();
4370 let mut grpc = tonic::server::Grpc::new(codec)
4371 .apply_compression_config(
4372 accept_compression_encodings,
4373 send_compression_encodings,
4374 )
4375 .apply_max_message_size_config(
4376 max_decoding_message_size,
4377 max_encoding_message_size,
4378 );
4379 let res = grpc.unary(method, req).await;
4380 Ok(res)
4381 };
4382 Box::pin(fut)
4383 }
4384 "/sui.rpc.v2.MovePackageService/GetDatatype" => {
4385 #[allow(non_camel_case_types)]
4386 struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
4387 impl<
4388 T: MovePackageService,
4389 > tonic::server::UnaryService<super::GetDatatypeRequest>
4390 for GetDatatypeSvc<T> {
4391 type Response = super::GetDatatypeResponse;
4392 type Future = BoxFuture<
4393 tonic::Response<Self::Response>,
4394 tonic::Status,
4395 >;
4396 fn call(
4397 &mut self,
4398 request: tonic::Request<super::GetDatatypeRequest>,
4399 ) -> Self::Future {
4400 let inner = Arc::clone(&self.0);
4401 let fut = async move {
4402 <T as MovePackageService>::get_datatype(&inner, request)
4403 .await
4404 };
4405 Box::pin(fut)
4406 }
4407 }
4408 let accept_compression_encodings = self.accept_compression_encodings;
4409 let send_compression_encodings = self.send_compression_encodings;
4410 let max_decoding_message_size = self.max_decoding_message_size;
4411 let max_encoding_message_size = self.max_encoding_message_size;
4412 let inner = self.inner.clone();
4413 let fut = async move {
4414 let method = GetDatatypeSvc(inner);
4415 let codec = tonic_prost::ProstCodec::default();
4416 let mut grpc = tonic::server::Grpc::new(codec)
4417 .apply_compression_config(
4418 accept_compression_encodings,
4419 send_compression_encodings,
4420 )
4421 .apply_max_message_size_config(
4422 max_decoding_message_size,
4423 max_encoding_message_size,
4424 );
4425 let res = grpc.unary(method, req).await;
4426 Ok(res)
4427 };
4428 Box::pin(fut)
4429 }
4430 "/sui.rpc.v2.MovePackageService/GetFunction" => {
4431 #[allow(non_camel_case_types)]
4432 struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
4433 impl<
4434 T: MovePackageService,
4435 > tonic::server::UnaryService<super::GetFunctionRequest>
4436 for GetFunctionSvc<T> {
4437 type Response = super::GetFunctionResponse;
4438 type Future = BoxFuture<
4439 tonic::Response<Self::Response>,
4440 tonic::Status,
4441 >;
4442 fn call(
4443 &mut self,
4444 request: tonic::Request<super::GetFunctionRequest>,
4445 ) -> Self::Future {
4446 let inner = Arc::clone(&self.0);
4447 let fut = async move {
4448 <T as MovePackageService>::get_function(&inner, request)
4449 .await
4450 };
4451 Box::pin(fut)
4452 }
4453 }
4454 let accept_compression_encodings = self.accept_compression_encodings;
4455 let send_compression_encodings = self.send_compression_encodings;
4456 let max_decoding_message_size = self.max_decoding_message_size;
4457 let max_encoding_message_size = self.max_encoding_message_size;
4458 let inner = self.inner.clone();
4459 let fut = async move {
4460 let method = GetFunctionSvc(inner);
4461 let codec = tonic_prost::ProstCodec::default();
4462 let mut grpc = tonic::server::Grpc::new(codec)
4463 .apply_compression_config(
4464 accept_compression_encodings,
4465 send_compression_encodings,
4466 )
4467 .apply_max_message_size_config(
4468 max_decoding_message_size,
4469 max_encoding_message_size,
4470 );
4471 let res = grpc.unary(method, req).await;
4472 Ok(res)
4473 };
4474 Box::pin(fut)
4475 }
4476 "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
4477 #[allow(non_camel_case_types)]
4478 struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
4479 impl<
4480 T: MovePackageService,
4481 > tonic::server::UnaryService<super::ListPackageVersionsRequest>
4482 for ListPackageVersionsSvc<T> {
4483 type Response = super::ListPackageVersionsResponse;
4484 type Future = BoxFuture<
4485 tonic::Response<Self::Response>,
4486 tonic::Status,
4487 >;
4488 fn call(
4489 &mut self,
4490 request: tonic::Request<super::ListPackageVersionsRequest>,
4491 ) -> Self::Future {
4492 let inner = Arc::clone(&self.0);
4493 let fut = async move {
4494 <T as MovePackageService>::list_package_versions(
4495 &inner,
4496 request,
4497 )
4498 .await
4499 };
4500 Box::pin(fut)
4501 }
4502 }
4503 let accept_compression_encodings = self.accept_compression_encodings;
4504 let send_compression_encodings = self.send_compression_encodings;
4505 let max_decoding_message_size = self.max_decoding_message_size;
4506 let max_encoding_message_size = self.max_encoding_message_size;
4507 let inner = self.inner.clone();
4508 let fut = async move {
4509 let method = ListPackageVersionsSvc(inner);
4510 let codec = tonic_prost::ProstCodec::default();
4511 let mut grpc = tonic::server::Grpc::new(codec)
4512 .apply_compression_config(
4513 accept_compression_encodings,
4514 send_compression_encodings,
4515 )
4516 .apply_max_message_size_config(
4517 max_decoding_message_size,
4518 max_encoding_message_size,
4519 );
4520 let res = grpc.unary(method, req).await;
4521 Ok(res)
4522 };
4523 Box::pin(fut)
4524 }
4525 _ => {
4526 Box::pin(async move {
4527 let mut response = http::Response::new(
4528 tonic::body::Body::default(),
4529 );
4530 let headers = response.headers_mut();
4531 headers
4532 .insert(
4533 tonic::Status::GRPC_STATUS,
4534 (tonic::Code::Unimplemented as i32).into(),
4535 );
4536 headers
4537 .insert(
4538 http::header::CONTENT_TYPE,
4539 tonic::metadata::GRPC_CONTENT_TYPE,
4540 );
4541 Ok(response)
4542 })
4543 }
4544 }
4545 }
4546 }
4547 impl<T> Clone for MovePackageServiceServer<T> {
4548 fn clone(&self) -> Self {
4549 let inner = self.inner.clone();
4550 Self {
4551 inner,
4552 accept_compression_encodings: self.accept_compression_encodings,
4553 send_compression_encodings: self.send_compression_encodings,
4554 max_decoding_message_size: self.max_decoding_message_size,
4555 max_encoding_message_size: self.max_encoding_message_size,
4556 }
4557 }
4558 }
4559 pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
4561 impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
4562 const NAME: &'static str = SERVICE_NAME;
4563 }
4564}
4565#[non_exhaustive]
4566#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4567pub struct LookupNameRequest {
4568 #[prost(string, optional, tag = "1")]
4572 pub name: ::core::option::Option<::prost::alloc::string::String>,
4573}
4574#[non_exhaustive]
4575#[derive(Clone, PartialEq, ::prost::Message)]
4576pub struct LookupNameResponse {
4577 #[prost(message, optional, tag = "1")]
4579 pub record: ::core::option::Option<NameRecord>,
4580}
4581#[non_exhaustive]
4582#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4583pub struct ReverseLookupNameRequest {
4584 #[prost(string, optional, tag = "1")]
4586 pub address: ::core::option::Option<::prost::alloc::string::String>,
4587}
4588#[non_exhaustive]
4589#[derive(Clone, PartialEq, ::prost::Message)]
4590pub struct ReverseLookupNameResponse {
4591 #[prost(message, optional, tag = "1")]
4593 pub record: ::core::option::Option<NameRecord>,
4594}
4595#[non_exhaustive]
4596#[derive(Clone, PartialEq, ::prost::Message)]
4597pub struct NameRecord {
4598 #[prost(string, optional, tag = "1")]
4603 pub id: ::core::option::Option<::prost::alloc::string::String>,
4604 #[prost(string, optional, tag = "2")]
4606 pub name: ::core::option::Option<::prost::alloc::string::String>,
4607 #[prost(string, optional, tag = "3")]
4615 pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
4616 #[prost(message, optional, tag = "4")]
4621 pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
4622 #[prost(string, optional, tag = "5")]
4624 pub target_address: ::core::option::Option<::prost::alloc::string::String>,
4625 #[prost(btree_map = "string, string", tag = "6")]
4627 pub data: ::prost::alloc::collections::BTreeMap<
4628 ::prost::alloc::string::String,
4629 ::prost::alloc::string::String,
4630 >,
4631}
4632pub mod name_service_client {
4634 #![allow(
4635 unused_variables,
4636 dead_code,
4637 missing_docs,
4638 clippy::wildcard_imports,
4639 clippy::let_unit_value,
4640 )]
4641 use tonic::codegen::*;
4642 use tonic::codegen::http::Uri;
4643 #[derive(Debug, Clone)]
4644 pub struct NameServiceClient<T> {
4645 inner: tonic::client::Grpc<T>,
4646 }
4647 impl NameServiceClient<tonic::transport::Channel> {
4648 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4650 where
4651 D: TryInto<tonic::transport::Endpoint>,
4652 D::Error: Into<StdError>,
4653 {
4654 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4655 Ok(Self::new(conn))
4656 }
4657 }
4658 impl<T> NameServiceClient<T>
4659 where
4660 T: tonic::client::GrpcService<tonic::body::Body>,
4661 T::Error: Into<StdError>,
4662 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4663 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4664 {
4665 pub fn new(inner: T) -> Self {
4666 let inner = tonic::client::Grpc::new(inner);
4667 Self { inner }
4668 }
4669 pub fn with_origin(inner: T, origin: Uri) -> Self {
4670 let inner = tonic::client::Grpc::with_origin(inner, origin);
4671 Self { inner }
4672 }
4673 pub fn with_interceptor<F>(
4674 inner: T,
4675 interceptor: F,
4676 ) -> NameServiceClient<InterceptedService<T, F>>
4677 where
4678 F: tonic::service::Interceptor,
4679 T::ResponseBody: Default,
4680 T: tonic::codegen::Service<
4681 http::Request<tonic::body::Body>,
4682 Response = http::Response<
4683 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4684 >,
4685 >,
4686 <T as tonic::codegen::Service<
4687 http::Request<tonic::body::Body>,
4688 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4689 {
4690 NameServiceClient::new(InterceptedService::new(inner, interceptor))
4691 }
4692 #[must_use]
4697 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4698 self.inner = self.inner.send_compressed(encoding);
4699 self
4700 }
4701 #[must_use]
4703 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4704 self.inner = self.inner.accept_compressed(encoding);
4705 self
4706 }
4707 #[must_use]
4711 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4712 self.inner = self.inner.max_decoding_message_size(limit);
4713 self
4714 }
4715 #[must_use]
4719 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4720 self.inner = self.inner.max_encoding_message_size(limit);
4721 self
4722 }
4723 pub async fn lookup_name(
4724 &mut self,
4725 request: impl tonic::IntoRequest<super::LookupNameRequest>,
4726 ) -> std::result::Result<
4727 tonic::Response<super::LookupNameResponse>,
4728 tonic::Status,
4729 > {
4730 self.inner
4731 .ready()
4732 .await
4733 .map_err(|e| {
4734 tonic::Status::unknown(
4735 format!("Service was not ready: {}", e.into()),
4736 )
4737 })?;
4738 let codec = tonic_prost::ProstCodec::default();
4739 let path = http::uri::PathAndQuery::from_static(
4740 "/sui.rpc.v2.NameService/LookupName",
4741 );
4742 let mut req = request.into_request();
4743 req.extensions_mut()
4744 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
4745 self.inner.unary(req, path, codec).await
4746 }
4747 pub async fn reverse_lookup_name(
4748 &mut self,
4749 request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
4750 ) -> std::result::Result<
4751 tonic::Response<super::ReverseLookupNameResponse>,
4752 tonic::Status,
4753 > {
4754 self.inner
4755 .ready()
4756 .await
4757 .map_err(|e| {
4758 tonic::Status::unknown(
4759 format!("Service was not ready: {}", e.into()),
4760 )
4761 })?;
4762 let codec = tonic_prost::ProstCodec::default();
4763 let path = http::uri::PathAndQuery::from_static(
4764 "/sui.rpc.v2.NameService/ReverseLookupName",
4765 );
4766 let mut req = request.into_request();
4767 req.extensions_mut()
4768 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
4769 self.inner.unary(req, path, codec).await
4770 }
4771 }
4772}
4773pub mod name_service_server {
4775 #![allow(
4776 unused_variables,
4777 dead_code,
4778 missing_docs,
4779 clippy::wildcard_imports,
4780 clippy::let_unit_value,
4781 )]
4782 use tonic::codegen::*;
4783 #[async_trait]
4785 pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
4786 async fn lookup_name(
4787 &self,
4788 request: tonic::Request<super::LookupNameRequest>,
4789 ) -> std::result::Result<
4790 tonic::Response<super::LookupNameResponse>,
4791 tonic::Status,
4792 > {
4793 Err(tonic::Status::unimplemented("Not yet implemented"))
4794 }
4795 async fn reverse_lookup_name(
4796 &self,
4797 request: tonic::Request<super::ReverseLookupNameRequest>,
4798 ) -> std::result::Result<
4799 tonic::Response<super::ReverseLookupNameResponse>,
4800 tonic::Status,
4801 > {
4802 Err(tonic::Status::unimplemented("Not yet implemented"))
4803 }
4804 }
4805 #[derive(Debug)]
4806 pub struct NameServiceServer<T> {
4807 inner: Arc<T>,
4808 accept_compression_encodings: EnabledCompressionEncodings,
4809 send_compression_encodings: EnabledCompressionEncodings,
4810 max_decoding_message_size: Option<usize>,
4811 max_encoding_message_size: Option<usize>,
4812 }
4813 impl<T> NameServiceServer<T> {
4814 pub fn new(inner: T) -> Self {
4815 Self::from_arc(Arc::new(inner))
4816 }
4817 pub fn from_arc(inner: Arc<T>) -> Self {
4818 Self {
4819 inner,
4820 accept_compression_encodings: Default::default(),
4821 send_compression_encodings: Default::default(),
4822 max_decoding_message_size: None,
4823 max_encoding_message_size: None,
4824 }
4825 }
4826 pub fn with_interceptor<F>(
4827 inner: T,
4828 interceptor: F,
4829 ) -> InterceptedService<Self, F>
4830 where
4831 F: tonic::service::Interceptor,
4832 {
4833 InterceptedService::new(Self::new(inner), interceptor)
4834 }
4835 #[must_use]
4837 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4838 self.accept_compression_encodings.enable(encoding);
4839 self
4840 }
4841 #[must_use]
4843 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4844 self.send_compression_encodings.enable(encoding);
4845 self
4846 }
4847 #[must_use]
4851 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4852 self.max_decoding_message_size = Some(limit);
4853 self
4854 }
4855 #[must_use]
4859 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4860 self.max_encoding_message_size = Some(limit);
4861 self
4862 }
4863 }
4864 impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
4865 where
4866 T: NameService,
4867 B: Body + std::marker::Send + 'static,
4868 B::Error: Into<StdError> + std::marker::Send + 'static,
4869 {
4870 type Response = http::Response<tonic::body::Body>;
4871 type Error = std::convert::Infallible;
4872 type Future = BoxFuture<Self::Response, Self::Error>;
4873 fn poll_ready(
4874 &mut self,
4875 _cx: &mut Context<'_>,
4876 ) -> Poll<std::result::Result<(), Self::Error>> {
4877 Poll::Ready(Ok(()))
4878 }
4879 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4880 match req.uri().path() {
4881 "/sui.rpc.v2.NameService/LookupName" => {
4882 #[allow(non_camel_case_types)]
4883 struct LookupNameSvc<T: NameService>(pub Arc<T>);
4884 impl<
4885 T: NameService,
4886 > tonic::server::UnaryService<super::LookupNameRequest>
4887 for LookupNameSvc<T> {
4888 type Response = super::LookupNameResponse;
4889 type Future = BoxFuture<
4890 tonic::Response<Self::Response>,
4891 tonic::Status,
4892 >;
4893 fn call(
4894 &mut self,
4895 request: tonic::Request<super::LookupNameRequest>,
4896 ) -> Self::Future {
4897 let inner = Arc::clone(&self.0);
4898 let fut = async move {
4899 <T as NameService>::lookup_name(&inner, request).await
4900 };
4901 Box::pin(fut)
4902 }
4903 }
4904 let accept_compression_encodings = self.accept_compression_encodings;
4905 let send_compression_encodings = self.send_compression_encodings;
4906 let max_decoding_message_size = self.max_decoding_message_size;
4907 let max_encoding_message_size = self.max_encoding_message_size;
4908 let inner = self.inner.clone();
4909 let fut = async move {
4910 let method = LookupNameSvc(inner);
4911 let codec = tonic_prost::ProstCodec::default();
4912 let mut grpc = tonic::server::Grpc::new(codec)
4913 .apply_compression_config(
4914 accept_compression_encodings,
4915 send_compression_encodings,
4916 )
4917 .apply_max_message_size_config(
4918 max_decoding_message_size,
4919 max_encoding_message_size,
4920 );
4921 let res = grpc.unary(method, req).await;
4922 Ok(res)
4923 };
4924 Box::pin(fut)
4925 }
4926 "/sui.rpc.v2.NameService/ReverseLookupName" => {
4927 #[allow(non_camel_case_types)]
4928 struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
4929 impl<
4930 T: NameService,
4931 > tonic::server::UnaryService<super::ReverseLookupNameRequest>
4932 for ReverseLookupNameSvc<T> {
4933 type Response = super::ReverseLookupNameResponse;
4934 type Future = BoxFuture<
4935 tonic::Response<Self::Response>,
4936 tonic::Status,
4937 >;
4938 fn call(
4939 &mut self,
4940 request: tonic::Request<super::ReverseLookupNameRequest>,
4941 ) -> Self::Future {
4942 let inner = Arc::clone(&self.0);
4943 let fut = async move {
4944 <T as NameService>::reverse_lookup_name(&inner, request)
4945 .await
4946 };
4947 Box::pin(fut)
4948 }
4949 }
4950 let accept_compression_encodings = self.accept_compression_encodings;
4951 let send_compression_encodings = self.send_compression_encodings;
4952 let max_decoding_message_size = self.max_decoding_message_size;
4953 let max_encoding_message_size = self.max_encoding_message_size;
4954 let inner = self.inner.clone();
4955 let fut = async move {
4956 let method = ReverseLookupNameSvc(inner);
4957 let codec = tonic_prost::ProstCodec::default();
4958 let mut grpc = tonic::server::Grpc::new(codec)
4959 .apply_compression_config(
4960 accept_compression_encodings,
4961 send_compression_encodings,
4962 )
4963 .apply_max_message_size_config(
4964 max_decoding_message_size,
4965 max_encoding_message_size,
4966 );
4967 let res = grpc.unary(method, req).await;
4968 Ok(res)
4969 };
4970 Box::pin(fut)
4971 }
4972 _ => {
4973 Box::pin(async move {
4974 let mut response = http::Response::new(
4975 tonic::body::Body::default(),
4976 );
4977 let headers = response.headers_mut();
4978 headers
4979 .insert(
4980 tonic::Status::GRPC_STATUS,
4981 (tonic::Code::Unimplemented as i32).into(),
4982 );
4983 headers
4984 .insert(
4985 http::header::CONTENT_TYPE,
4986 tonic::metadata::GRPC_CONTENT_TYPE,
4987 );
4988 Ok(response)
4989 })
4990 }
4991 }
4992 }
4993 }
4994 impl<T> Clone for NameServiceServer<T> {
4995 fn clone(&self) -> Self {
4996 let inner = self.inner.clone();
4997 Self {
4998 inner,
4999 accept_compression_encodings: self.accept_compression_encodings,
5000 send_compression_encodings: self.send_compression_encodings,
5001 max_decoding_message_size: self.max_decoding_message_size,
5002 max_encoding_message_size: self.max_encoding_message_size,
5003 }
5004 }
5005 }
5006 pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
5008 impl<T> tonic::server::NamedService for NameServiceServer<T> {
5009 const NAME: &'static str = SERVICE_NAME;
5010 }
5011}
5012#[non_exhaustive]
5014#[derive(Clone, PartialEq, ::prost::Message)]
5015pub struct Object {
5016 #[prost(message, optional, tag = "1")]
5018 pub bcs: ::core::option::Option<Bcs>,
5019 #[prost(string, optional, tag = "2")]
5021 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5022 #[prost(uint64, optional, tag = "3")]
5024 pub version: ::core::option::Option<u64>,
5025 #[prost(string, optional, tag = "4")]
5027 pub digest: ::core::option::Option<::prost::alloc::string::String>,
5028 #[prost(message, optional, tag = "5")]
5030 pub owner: ::core::option::Option<Owner>,
5031 #[prost(string, optional, tag = "6")]
5035 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5036 #[prost(bool, optional, tag = "7")]
5041 pub has_public_transfer: ::core::option::Option<bool>,
5042 #[prost(message, optional, tag = "8")]
5046 pub contents: ::core::option::Option<Bcs>,
5047 #[prost(message, optional, tag = "9")]
5049 pub package: ::core::option::Option<Package>,
5050 #[prost(string, optional, tag = "10")]
5052 pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
5053 #[prost(uint64, optional, tag = "11")]
5057 pub storage_rebate: ::core::option::Option<u64>,
5058 #[prost(message, optional, boxed, tag = "100")]
5060 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
5061 #[prost(uint64, optional, tag = "101")]
5063 pub balance: ::core::option::Option<u64>,
5064 #[prost(message, optional, boxed, tag = "102")]
5067 pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
5068}
5069#[non_exhaustive]
5071#[derive(Clone, PartialEq, ::prost::Message)]
5072pub struct ObjectSet {
5073 #[prost(message, repeated, tag = "1")]
5075 pub objects: ::prost::alloc::vec::Vec<Object>,
5076}
5077#[non_exhaustive]
5079#[derive(Clone, PartialEq, ::prost::Message)]
5080pub struct Display {
5081 #[prost(message, optional, tag = "1")]
5085 pub output: ::core::option::Option<::prost_types::Value>,
5086 #[prost(message, optional, tag = "2")]
5090 pub errors: ::core::option::Option<::prost_types::Value>,
5091}
5092#[non_exhaustive]
5094#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5095pub struct ObjectReference {
5096 #[prost(string, optional, tag = "1")]
5098 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5099 #[prost(uint64, optional, tag = "2")]
5101 pub version: ::core::option::Option<u64>,
5102 #[prost(string, optional, tag = "3")]
5104 pub digest: ::core::option::Option<::prost::alloc::string::String>,
5105}
5106#[non_exhaustive]
5108#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5109pub struct Owner {
5110 #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
5111 pub kind: ::core::option::Option<i32>,
5112 #[prost(string, optional, tag = "2")]
5114 pub address: ::core::option::Option<::prost::alloc::string::String>,
5115 #[prost(uint64, optional, tag = "3")]
5117 pub version: ::core::option::Option<u64>,
5118}
5119pub mod owner {
5121 #[non_exhaustive]
5122 #[derive(
5123 Clone,
5124 Copy,
5125 Debug,
5126 PartialEq,
5127 Eq,
5128 Hash,
5129 PartialOrd,
5130 Ord,
5131 ::prost::Enumeration
5132 )]
5133 #[repr(i32)]
5134 pub enum OwnerKind {
5135 Unknown = 0,
5136 Address = 1,
5137 Object = 2,
5138 Shared = 3,
5139 Immutable = 4,
5140 ConsensusAddress = 5,
5141 }
5142 impl OwnerKind {
5143 pub fn as_str_name(&self) -> &'static str {
5148 match self {
5149 Self::Unknown => "OWNER_KIND_UNKNOWN",
5150 Self::Address => "ADDRESS",
5151 Self::Object => "OBJECT",
5152 Self::Shared => "SHARED",
5153 Self::Immutable => "IMMUTABLE",
5154 Self::ConsensusAddress => "CONSENSUS_ADDRESS",
5155 }
5156 }
5157 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5159 match value {
5160 "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
5161 "ADDRESS" => Some(Self::Address),
5162 "OBJECT" => Some(Self::Object),
5163 "SHARED" => Some(Self::Shared),
5164 "IMMUTABLE" => Some(Self::Immutable),
5165 "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
5166 _ => None,
5167 }
5168 }
5169 }
5170}
5171#[non_exhaustive]
5172#[derive(Clone, PartialEq, ::prost::Message)]
5173pub struct ProtocolConfig {
5174 #[prost(uint64, optional, tag = "1")]
5175 pub protocol_version: ::core::option::Option<u64>,
5176 #[prost(btree_map = "string, bool", tag = "2")]
5178 pub feature_flags: ::prost::alloc::collections::BTreeMap<
5179 ::prost::alloc::string::String,
5180 bool,
5181 >,
5182 #[prost(btree_map = "string, string", tag = "3")]
5184 pub attributes: ::prost::alloc::collections::BTreeMap<
5185 ::prost::alloc::string::String,
5186 ::prost::alloc::string::String,
5187 >,
5188 #[prost(btree_map = "string, message", tag = "4")]
5189 pub configs: ::prost::alloc::collections::BTreeMap<
5190 ::prost::alloc::string::String,
5191 ::prost_types::Value,
5192 >,
5193}
5194#[non_exhaustive]
5214#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5215pub struct QueryOptions {
5216 #[prost(uint32, optional, tag = "1")]
5219 pub limit: ::core::option::Option<u32>,
5220 #[prost(bytes = "bytes", optional, tag = "2")]
5223 pub after: ::core::option::Option<::prost::bytes::Bytes>,
5224 #[prost(bytes = "bytes", optional, tag = "3")]
5227 pub before: ::core::option::Option<::prost::bytes::Bytes>,
5228 #[prost(enumeration = "Ordering", optional, tag = "4")]
5233 pub ordering: ::core::option::Option<i32>,
5234}
5235#[non_exhaustive]
5240#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5241pub struct Watermark {
5242 #[prost(bytes = "bytes", optional, tag = "1")]
5247 pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
5248 #[prost(uint64, optional, tag = "2")]
5261 pub checkpoint: ::core::option::Option<u64>,
5262}
5263#[non_exhaustive]
5274#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5275pub struct QueryEnd {
5276 #[prost(enumeration = "QueryEndReason", optional, tag = "1")]
5278 pub reason: ::core::option::Option<i32>,
5279}
5280#[non_exhaustive]
5282#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5283#[repr(i32)]
5284pub enum Ordering {
5285 Ascending = 0,
5287 Descending = 1,
5289}
5290impl Ordering {
5291 pub fn as_str_name(&self) -> &'static str {
5296 match self {
5297 Self::Ascending => "ORDERING_ASCENDING",
5298 Self::Descending => "ORDERING_DESCENDING",
5299 }
5300 }
5301 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5303 match value {
5304 "ORDERING_ASCENDING" => Some(Self::Ascending),
5305 "ORDERING_DESCENDING" => Some(Self::Descending),
5306 _ => None,
5307 }
5308 }
5309}
5310#[non_exhaustive]
5312#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5313#[repr(i32)]
5314pub enum QueryEndReason {
5315 Unknown = 0,
5317 ItemLimit = 1,
5321 ScanLimit = 2,
5326 CheckpointBound = 3,
5329 CursorBound = 4,
5333 LedgerTip = 5,
5336}
5337impl QueryEndReason {
5338 pub fn as_str_name(&self) -> &'static str {
5343 match self {
5344 Self::Unknown => "QUERY_END_REASON_UNKNOWN",
5345 Self::ItemLimit => "QUERY_END_REASON_ITEM_LIMIT",
5346 Self::ScanLimit => "QUERY_END_REASON_SCAN_LIMIT",
5347 Self::CheckpointBound => "QUERY_END_REASON_CHECKPOINT_BOUND",
5348 Self::CursorBound => "QUERY_END_REASON_CURSOR_BOUND",
5349 Self::LedgerTip => "QUERY_END_REASON_LEDGER_TIP",
5350 }
5351 }
5352 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5354 match value {
5355 "QUERY_END_REASON_UNKNOWN" => Some(Self::Unknown),
5356 "QUERY_END_REASON_ITEM_LIMIT" => Some(Self::ItemLimit),
5357 "QUERY_END_REASON_SCAN_LIMIT" => Some(Self::ScanLimit),
5358 "QUERY_END_REASON_CHECKPOINT_BOUND" => Some(Self::CheckpointBound),
5359 "QUERY_END_REASON_CURSOR_BOUND" => Some(Self::CursorBound),
5360 "QUERY_END_REASON_LEDGER_TIP" => Some(Self::LedgerTip),
5361 _ => None,
5362 }
5363 }
5364}
5365#[non_exhaustive]
5367#[derive(Clone, PartialEq, ::prost::Message)]
5368pub struct UserSignature {
5369 #[prost(message, optional, tag = "1")]
5374 pub bcs: ::core::option::Option<Bcs>,
5375 #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
5377 pub scheme: ::core::option::Option<i32>,
5378 #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
5379 pub signature: ::core::option::Option<user_signature::Signature>,
5380}
5381pub mod user_signature {
5383 #[non_exhaustive]
5384 #[derive(Clone, PartialEq, ::prost::Oneof)]
5385 pub enum Signature {
5386 #[prost(message, tag = "3")]
5388 Simple(super::SimpleSignature),
5389 #[prost(message, tag = "4")]
5391 Multisig(super::MultisigAggregatedSignature),
5392 #[prost(message, tag = "5")]
5394 Zklogin(super::ZkLoginAuthenticator),
5395 #[prost(message, tag = "6")]
5397 Passkey(super::PasskeyAuthenticator),
5398 }
5399}
5400#[non_exhaustive]
5402#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5403pub struct SimpleSignature {
5404 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5406 pub scheme: ::core::option::Option<i32>,
5407 #[prost(bytes = "bytes", optional, tag = "2")]
5409 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5410 #[prost(bytes = "bytes", optional, tag = "3")]
5412 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5413}
5414#[non_exhaustive]
5416#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5417pub struct ZkLoginPublicIdentifier {
5418 #[prost(string, optional, tag = "1")]
5419 pub iss: ::core::option::Option<::prost::alloc::string::String>,
5420 #[prost(string, optional, tag = "2")]
5422 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5423}
5424#[non_exhaustive]
5426#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5427pub struct MultisigMemberPublicKey {
5428 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5430 pub scheme: ::core::option::Option<i32>,
5431 #[prost(bytes = "bytes", optional, tag = "2")]
5433 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5434 #[prost(message, optional, tag = "3")]
5436 pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
5437}
5438#[non_exhaustive]
5440#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5441pub struct MultisigMember {
5442 #[prost(message, optional, tag = "1")]
5444 pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
5445 #[prost(uint32, optional, tag = "2")]
5447 pub weight: ::core::option::Option<u32>,
5448}
5449#[non_exhaustive]
5451#[derive(Clone, PartialEq, ::prost::Message)]
5452pub struct MultisigCommittee {
5453 #[prost(message, repeated, tag = "1")]
5455 pub members: ::prost::alloc::vec::Vec<MultisigMember>,
5456 #[prost(uint32, optional, tag = "2")]
5459 pub threshold: ::core::option::Option<u32>,
5460}
5461#[non_exhaustive]
5463#[derive(Clone, PartialEq, ::prost::Message)]
5464pub struct MultisigAggregatedSignature {
5465 #[prost(message, repeated, tag = "1")]
5469 pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
5470 #[prost(uint32, optional, tag = "2")]
5473 pub bitmap: ::core::option::Option<u32>,
5474 #[prost(bytes = "bytes", optional, tag = "3")]
5477 pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5478 #[prost(message, optional, tag = "4")]
5480 pub committee: ::core::option::Option<MultisigCommittee>,
5481}
5482#[non_exhaustive]
5484#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5485pub struct MultisigMemberSignature {
5486 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5488 pub scheme: ::core::option::Option<i32>,
5489 #[prost(bytes = "bytes", optional, tag = "2")]
5491 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5492 #[prost(message, optional, tag = "3")]
5494 pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
5495 #[prost(message, optional, tag = "4")]
5497 pub passkey: ::core::option::Option<PasskeyAuthenticator>,
5498}
5499#[non_exhaustive]
5501#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5502pub struct ZkLoginAuthenticator {
5503 #[prost(message, optional, tag = "1")]
5505 pub inputs: ::core::option::Option<ZkLoginInputs>,
5506 #[prost(uint64, optional, tag = "2")]
5508 pub max_epoch: ::core::option::Option<u64>,
5509 #[prost(message, optional, tag = "3")]
5511 pub signature: ::core::option::Option<SimpleSignature>,
5512 #[prost(message, optional, tag = "4")]
5514 pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
5515 #[prost(message, optional, tag = "5")]
5517 pub jwk_id: ::core::option::Option<JwkId>,
5518}
5519#[non_exhaustive]
5521#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5522pub struct ZkLoginInputs {
5523 #[prost(message, optional, tag = "1")]
5524 pub proof_points: ::core::option::Option<ZkLoginProof>,
5525 #[prost(message, optional, tag = "2")]
5526 pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
5527 #[prost(string, optional, tag = "3")]
5528 pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
5529 #[prost(string, optional, tag = "4")]
5531 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5532}
5533#[non_exhaustive]
5535#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5536pub struct ZkLoginProof {
5537 #[prost(message, optional, tag = "1")]
5538 pub a: ::core::option::Option<CircomG1>,
5539 #[prost(message, optional, tag = "2")]
5540 pub b: ::core::option::Option<CircomG2>,
5541 #[prost(message, optional, tag = "3")]
5542 pub c: ::core::option::Option<CircomG1>,
5543}
5544#[non_exhaustive]
5546#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5547pub struct ZkLoginClaim {
5548 #[prost(string, optional, tag = "1")]
5549 pub value: ::core::option::Option<::prost::alloc::string::String>,
5550 #[prost(uint32, optional, tag = "2")]
5551 pub index_mod_4: ::core::option::Option<u32>,
5552}
5553#[non_exhaustive]
5555#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5556pub struct CircomG1 {
5557 #[prost(string, optional, tag = "1")]
5559 pub e0: ::core::option::Option<::prost::alloc::string::String>,
5560 #[prost(string, optional, tag = "2")]
5562 pub e1: ::core::option::Option<::prost::alloc::string::String>,
5563 #[prost(string, optional, tag = "3")]
5565 pub e2: ::core::option::Option<::prost::alloc::string::String>,
5566}
5567#[non_exhaustive]
5569#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5570pub struct CircomG2 {
5571 #[prost(string, optional, tag = "1")]
5573 pub e00: ::core::option::Option<::prost::alloc::string::String>,
5574 #[prost(string, optional, tag = "2")]
5576 pub e01: ::core::option::Option<::prost::alloc::string::String>,
5577 #[prost(string, optional, tag = "3")]
5579 pub e10: ::core::option::Option<::prost::alloc::string::String>,
5580 #[prost(string, optional, tag = "4")]
5582 pub e11: ::core::option::Option<::prost::alloc::string::String>,
5583 #[prost(string, optional, tag = "5")]
5585 pub e20: ::core::option::Option<::prost::alloc::string::String>,
5586 #[prost(string, optional, tag = "6")]
5588 pub e21: ::core::option::Option<::prost::alloc::string::String>,
5589}
5590#[non_exhaustive]
5597#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5598pub struct PasskeyAuthenticator {
5599 #[prost(bytes = "bytes", optional, tag = "1")]
5604 pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
5605 #[prost(string, optional, tag = "2")]
5610 pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
5611 #[prost(message, optional, tag = "3")]
5613 pub signature: ::core::option::Option<SimpleSignature>,
5614}
5615#[non_exhaustive]
5617#[derive(Clone, PartialEq, ::prost::Message)]
5618pub struct ValidatorCommittee {
5619 #[prost(uint64, optional, tag = "1")]
5621 pub epoch: ::core::option::Option<u64>,
5622 #[prost(message, repeated, tag = "2")]
5624 pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
5625}
5626#[non_exhaustive]
5628#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5629pub struct ValidatorCommitteeMember {
5630 #[prost(bytes = "bytes", optional, tag = "1")]
5632 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5633 #[prost(uint64, optional, tag = "2")]
5635 pub weight: ::core::option::Option<u64>,
5636}
5637#[non_exhaustive]
5639#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5640pub struct ValidatorAggregatedSignature {
5641 #[prost(uint64, optional, tag = "1")]
5646 pub epoch: ::core::option::Option<u64>,
5647 #[prost(bytes = "bytes", optional, tag = "2")]
5649 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5650 #[prost(bytes = "bytes", optional, tag = "3")]
5653 pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5654}
5655#[non_exhaustive]
5662#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5663#[repr(i32)]
5664pub enum SignatureScheme {
5665 Ed25519 = 0,
5666 Secp256k1 = 1,
5667 Secp256r1 = 2,
5668 Multisig = 3,
5669 Bls12381 = 4,
5670 Zklogin = 5,
5671 Passkey = 6,
5672}
5673impl SignatureScheme {
5674 pub fn as_str_name(&self) -> &'static str {
5679 match self {
5680 Self::Ed25519 => "ED25519",
5681 Self::Secp256k1 => "SECP256K1",
5682 Self::Secp256r1 => "SECP256R1",
5683 Self::Multisig => "MULTISIG",
5684 Self::Bls12381 => "BLS12381",
5685 Self::Zklogin => "ZKLOGIN",
5686 Self::Passkey => "PASSKEY",
5687 }
5688 }
5689 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5691 match value {
5692 "ED25519" => Some(Self::Ed25519),
5693 "SECP256K1" => Some(Self::Secp256k1),
5694 "SECP256R1" => Some(Self::Secp256r1),
5695 "MULTISIG" => Some(Self::Multisig),
5696 "BLS12381" => Some(Self::Bls12381),
5697 "ZKLOGIN" => Some(Self::Zklogin),
5698 "PASSKEY" => Some(Self::Passkey),
5699 _ => None,
5700 }
5701 }
5702}
5703#[non_exhaustive]
5704#[derive(Clone, PartialEq, ::prost::Message)]
5705pub struct VerifySignatureRequest {
5706 #[prost(message, optional, tag = "1")]
5712 pub message: ::core::option::Option<Bcs>,
5713 #[prost(message, optional, tag = "2")]
5715 pub signature: ::core::option::Option<UserSignature>,
5716 #[prost(string, optional, tag = "3")]
5722 pub address: ::core::option::Option<::prost::alloc::string::String>,
5723 #[prost(message, repeated, tag = "4")]
5726 pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
5727}
5728#[non_exhaustive]
5729#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5730pub struct VerifySignatureResponse {
5731 #[prost(bool, optional, tag = "1")]
5733 pub is_valid: ::core::option::Option<bool>,
5734 #[prost(string, optional, tag = "2")]
5736 pub reason: ::core::option::Option<::prost::alloc::string::String>,
5737}
5738pub mod signature_verification_service_client {
5740 #![allow(
5741 unused_variables,
5742 dead_code,
5743 missing_docs,
5744 clippy::wildcard_imports,
5745 clippy::let_unit_value,
5746 )]
5747 use tonic::codegen::*;
5748 use tonic::codegen::http::Uri;
5749 #[derive(Debug, Clone)]
5750 pub struct SignatureVerificationServiceClient<T> {
5751 inner: tonic::client::Grpc<T>,
5752 }
5753 impl SignatureVerificationServiceClient<tonic::transport::Channel> {
5754 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5756 where
5757 D: TryInto<tonic::transport::Endpoint>,
5758 D::Error: Into<StdError>,
5759 {
5760 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5761 Ok(Self::new(conn))
5762 }
5763 }
5764 impl<T> SignatureVerificationServiceClient<T>
5765 where
5766 T: tonic::client::GrpcService<tonic::body::Body>,
5767 T::Error: Into<StdError>,
5768 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5769 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5770 {
5771 pub fn new(inner: T) -> Self {
5772 let inner = tonic::client::Grpc::new(inner);
5773 Self { inner }
5774 }
5775 pub fn with_origin(inner: T, origin: Uri) -> Self {
5776 let inner = tonic::client::Grpc::with_origin(inner, origin);
5777 Self { inner }
5778 }
5779 pub fn with_interceptor<F>(
5780 inner: T,
5781 interceptor: F,
5782 ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
5783 where
5784 F: tonic::service::Interceptor,
5785 T::ResponseBody: Default,
5786 T: tonic::codegen::Service<
5787 http::Request<tonic::body::Body>,
5788 Response = http::Response<
5789 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5790 >,
5791 >,
5792 <T as tonic::codegen::Service<
5793 http::Request<tonic::body::Body>,
5794 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5795 {
5796 SignatureVerificationServiceClient::new(
5797 InterceptedService::new(inner, interceptor),
5798 )
5799 }
5800 #[must_use]
5805 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5806 self.inner = self.inner.send_compressed(encoding);
5807 self
5808 }
5809 #[must_use]
5811 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5812 self.inner = self.inner.accept_compressed(encoding);
5813 self
5814 }
5815 #[must_use]
5819 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5820 self.inner = self.inner.max_decoding_message_size(limit);
5821 self
5822 }
5823 #[must_use]
5827 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5828 self.inner = self.inner.max_encoding_message_size(limit);
5829 self
5830 }
5831 pub async fn verify_signature(
5833 &mut self,
5834 request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
5835 ) -> std::result::Result<
5836 tonic::Response<super::VerifySignatureResponse>,
5837 tonic::Status,
5838 > {
5839 self.inner
5840 .ready()
5841 .await
5842 .map_err(|e| {
5843 tonic::Status::unknown(
5844 format!("Service was not ready: {}", e.into()),
5845 )
5846 })?;
5847 let codec = tonic_prost::ProstCodec::default();
5848 let path = http::uri::PathAndQuery::from_static(
5849 "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
5850 );
5851 let mut req = request.into_request();
5852 req.extensions_mut()
5853 .insert(
5854 GrpcMethod::new(
5855 "sui.rpc.v2.SignatureVerificationService",
5856 "VerifySignature",
5857 ),
5858 );
5859 self.inner.unary(req, path, codec).await
5860 }
5861 }
5862}
5863pub mod signature_verification_service_server {
5865 #![allow(
5866 unused_variables,
5867 dead_code,
5868 missing_docs,
5869 clippy::wildcard_imports,
5870 clippy::let_unit_value,
5871 )]
5872 use tonic::codegen::*;
5873 #[async_trait]
5875 pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
5876 async fn verify_signature(
5878 &self,
5879 request: tonic::Request<super::VerifySignatureRequest>,
5880 ) -> std::result::Result<
5881 tonic::Response<super::VerifySignatureResponse>,
5882 tonic::Status,
5883 > {
5884 Err(tonic::Status::unimplemented("Not yet implemented"))
5885 }
5886 }
5887 #[derive(Debug)]
5888 pub struct SignatureVerificationServiceServer<T> {
5889 inner: Arc<T>,
5890 accept_compression_encodings: EnabledCompressionEncodings,
5891 send_compression_encodings: EnabledCompressionEncodings,
5892 max_decoding_message_size: Option<usize>,
5893 max_encoding_message_size: Option<usize>,
5894 }
5895 impl<T> SignatureVerificationServiceServer<T> {
5896 pub fn new(inner: T) -> Self {
5897 Self::from_arc(Arc::new(inner))
5898 }
5899 pub fn from_arc(inner: Arc<T>) -> Self {
5900 Self {
5901 inner,
5902 accept_compression_encodings: Default::default(),
5903 send_compression_encodings: Default::default(),
5904 max_decoding_message_size: None,
5905 max_encoding_message_size: None,
5906 }
5907 }
5908 pub fn with_interceptor<F>(
5909 inner: T,
5910 interceptor: F,
5911 ) -> InterceptedService<Self, F>
5912 where
5913 F: tonic::service::Interceptor,
5914 {
5915 InterceptedService::new(Self::new(inner), interceptor)
5916 }
5917 #[must_use]
5919 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5920 self.accept_compression_encodings.enable(encoding);
5921 self
5922 }
5923 #[must_use]
5925 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5926 self.send_compression_encodings.enable(encoding);
5927 self
5928 }
5929 #[must_use]
5933 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5934 self.max_decoding_message_size = Some(limit);
5935 self
5936 }
5937 #[must_use]
5941 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5942 self.max_encoding_message_size = Some(limit);
5943 self
5944 }
5945 }
5946 impl<T, B> tonic::codegen::Service<http::Request<B>>
5947 for SignatureVerificationServiceServer<T>
5948 where
5949 T: SignatureVerificationService,
5950 B: Body + std::marker::Send + 'static,
5951 B::Error: Into<StdError> + std::marker::Send + 'static,
5952 {
5953 type Response = http::Response<tonic::body::Body>;
5954 type Error = std::convert::Infallible;
5955 type Future = BoxFuture<Self::Response, Self::Error>;
5956 fn poll_ready(
5957 &mut self,
5958 _cx: &mut Context<'_>,
5959 ) -> Poll<std::result::Result<(), Self::Error>> {
5960 Poll::Ready(Ok(()))
5961 }
5962 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5963 match req.uri().path() {
5964 "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
5965 #[allow(non_camel_case_types)]
5966 struct VerifySignatureSvc<T: SignatureVerificationService>(
5967 pub Arc<T>,
5968 );
5969 impl<
5970 T: SignatureVerificationService,
5971 > tonic::server::UnaryService<super::VerifySignatureRequest>
5972 for VerifySignatureSvc<T> {
5973 type Response = super::VerifySignatureResponse;
5974 type Future = BoxFuture<
5975 tonic::Response<Self::Response>,
5976 tonic::Status,
5977 >;
5978 fn call(
5979 &mut self,
5980 request: tonic::Request<super::VerifySignatureRequest>,
5981 ) -> Self::Future {
5982 let inner = Arc::clone(&self.0);
5983 let fut = async move {
5984 <T as SignatureVerificationService>::verify_signature(
5985 &inner,
5986 request,
5987 )
5988 .await
5989 };
5990 Box::pin(fut)
5991 }
5992 }
5993 let accept_compression_encodings = self.accept_compression_encodings;
5994 let send_compression_encodings = self.send_compression_encodings;
5995 let max_decoding_message_size = self.max_decoding_message_size;
5996 let max_encoding_message_size = self.max_encoding_message_size;
5997 let inner = self.inner.clone();
5998 let fut = async move {
5999 let method = VerifySignatureSvc(inner);
6000 let codec = tonic_prost::ProstCodec::default();
6001 let mut grpc = tonic::server::Grpc::new(codec)
6002 .apply_compression_config(
6003 accept_compression_encodings,
6004 send_compression_encodings,
6005 )
6006 .apply_max_message_size_config(
6007 max_decoding_message_size,
6008 max_encoding_message_size,
6009 );
6010 let res = grpc.unary(method, req).await;
6011 Ok(res)
6012 };
6013 Box::pin(fut)
6014 }
6015 _ => {
6016 Box::pin(async move {
6017 let mut response = http::Response::new(
6018 tonic::body::Body::default(),
6019 );
6020 let headers = response.headers_mut();
6021 headers
6022 .insert(
6023 tonic::Status::GRPC_STATUS,
6024 (tonic::Code::Unimplemented as i32).into(),
6025 );
6026 headers
6027 .insert(
6028 http::header::CONTENT_TYPE,
6029 tonic::metadata::GRPC_CONTENT_TYPE,
6030 );
6031 Ok(response)
6032 })
6033 }
6034 }
6035 }
6036 }
6037 impl<T> Clone for SignatureVerificationServiceServer<T> {
6038 fn clone(&self) -> Self {
6039 let inner = self.inner.clone();
6040 Self {
6041 inner,
6042 accept_compression_encodings: self.accept_compression_encodings,
6043 send_compression_encodings: self.send_compression_encodings,
6044 max_decoding_message_size: self.max_decoding_message_size,
6045 max_encoding_message_size: self.max_encoding_message_size,
6046 }
6047 }
6048 }
6049 pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
6051 impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
6052 const NAME: &'static str = SERVICE_NAME;
6053 }
6054}
6055#[non_exhaustive]
6057#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6058pub struct GetCoinInfoRequest {
6059 #[prost(string, optional, tag = "1")]
6061 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6062}
6063#[non_exhaustive]
6065#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6066pub struct GetCoinInfoResponse {
6067 #[prost(string, optional, tag = "1")]
6069 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6070 #[prost(message, optional, tag = "2")]
6073 pub metadata: ::core::option::Option<CoinMetadata>,
6074 #[prost(message, optional, tag = "3")]
6077 pub treasury: ::core::option::Option<CoinTreasury>,
6078 #[prost(message, optional, tag = "4")]
6086 pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
6087}
6088#[non_exhaustive]
6090#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6091pub struct CoinMetadata {
6092 #[prost(string, optional, tag = "1")]
6095 pub id: ::core::option::Option<::prost::alloc::string::String>,
6096 #[prost(uint32, optional, tag = "2")]
6098 pub decimals: ::core::option::Option<u32>,
6099 #[prost(string, optional, tag = "3")]
6101 pub name: ::core::option::Option<::prost::alloc::string::String>,
6102 #[prost(string, optional, tag = "4")]
6104 pub symbol: ::core::option::Option<::prost::alloc::string::String>,
6105 #[prost(string, optional, tag = "5")]
6107 pub description: ::core::option::Option<::prost::alloc::string::String>,
6108 #[prost(string, optional, tag = "6")]
6110 pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
6111 #[prost(string, optional, tag = "7")]
6115 pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6116 #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
6118 pub metadata_cap_state: ::core::option::Option<i32>,
6119}
6120pub mod coin_metadata {
6122 #[non_exhaustive]
6124 #[derive(
6125 Clone,
6126 Copy,
6127 Debug,
6128 PartialEq,
6129 Eq,
6130 Hash,
6131 PartialOrd,
6132 Ord,
6133 ::prost::Enumeration
6134 )]
6135 #[repr(i32)]
6136 pub enum MetadataCapState {
6137 Unknown = 0,
6140 Claimed = 1,
6142 Unclaimed = 2,
6144 Deleted = 3,
6146 }
6147 impl MetadataCapState {
6148 pub fn as_str_name(&self) -> &'static str {
6153 match self {
6154 Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
6155 Self::Claimed => "CLAIMED",
6156 Self::Unclaimed => "UNCLAIMED",
6157 Self::Deleted => "DELETED",
6158 }
6159 }
6160 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6162 match value {
6163 "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
6164 "CLAIMED" => Some(Self::Claimed),
6165 "UNCLAIMED" => Some(Self::Unclaimed),
6166 "DELETED" => Some(Self::Deleted),
6167 _ => None,
6168 }
6169 }
6170 }
6171}
6172#[non_exhaustive]
6174#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6175pub struct CoinTreasury {
6176 #[prost(string, optional, tag = "1")]
6178 pub id: ::core::option::Option<::prost::alloc::string::String>,
6179 #[prost(uint64, optional, tag = "2")]
6181 pub total_supply: ::core::option::Option<u64>,
6182 #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
6184 pub supply_state: ::core::option::Option<i32>,
6185}
6186pub mod coin_treasury {
6188 #[non_exhaustive]
6190 #[derive(
6191 Clone,
6192 Copy,
6193 Debug,
6194 PartialEq,
6195 Eq,
6196 Hash,
6197 PartialOrd,
6198 Ord,
6199 ::prost::Enumeration
6200 )]
6201 #[repr(i32)]
6202 pub enum SupplyState {
6203 Unknown = 0,
6205 Fixed = 1,
6207 BurnOnly = 2,
6209 }
6210 impl SupplyState {
6211 pub fn as_str_name(&self) -> &'static str {
6216 match self {
6217 Self::Unknown => "SUPPLY_STATE_UNKNOWN",
6218 Self::Fixed => "FIXED",
6219 Self::BurnOnly => "BURN_ONLY",
6220 }
6221 }
6222 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6224 match value {
6225 "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
6226 "FIXED" => Some(Self::Fixed),
6227 "BURN_ONLY" => Some(Self::BurnOnly),
6228 _ => None,
6229 }
6230 }
6231 }
6232}
6233#[non_exhaustive]
6235#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6236pub struct RegulatedCoinMetadata {
6237 #[prost(string, optional, tag = "1")]
6240 pub id: ::core::option::Option<::prost::alloc::string::String>,
6241 #[prost(string, optional, tag = "2")]
6243 pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
6244 #[prost(string, optional, tag = "3")]
6246 pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
6247 #[prost(bool, optional, tag = "4")]
6249 pub allow_global_pause: ::core::option::Option<bool>,
6250 #[prost(uint32, optional, tag = "5")]
6252 pub variant: ::core::option::Option<u32>,
6253 #[prost(
6255 enumeration = "regulated_coin_metadata::CoinRegulatedState",
6256 optional,
6257 tag = "6"
6258 )]
6259 pub coin_regulated_state: ::core::option::Option<i32>,
6260}
6261pub mod regulated_coin_metadata {
6263 #[non_exhaustive]
6265 #[derive(
6266 Clone,
6267 Copy,
6268 Debug,
6269 PartialEq,
6270 Eq,
6271 Hash,
6272 PartialOrd,
6273 Ord,
6274 ::prost::Enumeration
6275 )]
6276 #[repr(i32)]
6277 pub enum CoinRegulatedState {
6278 Unknown = 0,
6283 Regulated = 1,
6285 Unregulated = 2,
6287 }
6288 impl CoinRegulatedState {
6289 pub fn as_str_name(&self) -> &'static str {
6294 match self {
6295 Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
6296 Self::Regulated => "REGULATED",
6297 Self::Unregulated => "UNREGULATED",
6298 }
6299 }
6300 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6302 match value {
6303 "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
6304 "REGULATED" => Some(Self::Regulated),
6305 "UNREGULATED" => Some(Self::Unregulated),
6306 _ => None,
6307 }
6308 }
6309 }
6310}
6311#[non_exhaustive]
6313#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6314pub struct GetBalanceRequest {
6315 #[prost(string, optional, tag = "1")]
6317 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6318 #[prost(string, optional, tag = "2")]
6320 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6321}
6322#[non_exhaustive]
6325#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6326pub struct GetBalanceResponse {
6327 #[prost(message, optional, tag = "1")]
6329 pub balance: ::core::option::Option<Balance>,
6330}
6331#[non_exhaustive]
6333#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6334pub struct ListBalancesRequest {
6335 #[prost(string, optional, tag = "1")]
6337 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6338 #[prost(uint32, optional, tag = "2")]
6342 pub page_size: ::core::option::Option<u32>,
6343 #[prost(bytes = "bytes", optional, tag = "3")]
6349 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6350}
6351#[non_exhaustive]
6354#[derive(Clone, PartialEq, ::prost::Message)]
6355pub struct ListBalancesResponse {
6356 #[prost(message, repeated, tag = "1")]
6358 pub balances: ::prost::alloc::vec::Vec<Balance>,
6359 #[prost(bytes = "bytes", optional, tag = "2")]
6362 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6363}
6364#[non_exhaustive]
6366#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6367pub struct Balance {
6368 #[prost(string, optional, tag = "1")]
6370 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6371 #[prost(uint64, optional, tag = "3")]
6375 pub balance: ::core::option::Option<u64>,
6376 #[prost(uint64, optional, tag = "4")]
6378 pub address_balance: ::core::option::Option<u64>,
6379 #[prost(uint64, optional, tag = "5")]
6381 pub coin_balance: ::core::option::Option<u64>,
6382}
6383#[non_exhaustive]
6385#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6386pub struct ListDynamicFieldsRequest {
6387 #[prost(string, optional, tag = "1")]
6389 pub parent: ::core::option::Option<::prost::alloc::string::String>,
6390 #[prost(uint32, optional, tag = "2")]
6394 pub page_size: ::core::option::Option<u32>,
6395 #[prost(bytes = "bytes", optional, tag = "3")]
6401 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6402 #[prost(message, optional, tag = "4")]
6405 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6406}
6407#[non_exhaustive]
6409#[derive(Clone, PartialEq, ::prost::Message)]
6410pub struct ListDynamicFieldsResponse {
6411 #[prost(message, repeated, tag = "1")]
6413 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
6414 #[prost(bytes = "bytes", optional, tag = "2")]
6417 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6418}
6419#[non_exhaustive]
6420#[derive(Clone, PartialEq, ::prost::Message)]
6421pub struct DynamicField {
6422 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
6423 pub kind: ::core::option::Option<i32>,
6424 #[prost(string, optional, tag = "2")]
6426 pub parent: ::core::option::Option<::prost::alloc::string::String>,
6427 #[prost(string, optional, tag = "3")]
6429 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
6430 #[prost(message, optional, tag = "4")]
6432 pub field_object: ::core::option::Option<Object>,
6433 #[prost(message, optional, tag = "5")]
6435 pub name: ::core::option::Option<Bcs>,
6436 #[prost(message, optional, tag = "6")]
6438 pub value: ::core::option::Option<Bcs>,
6439 #[prost(string, optional, tag = "7")]
6445 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
6446 #[prost(string, optional, tag = "8")]
6452 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
6453 #[prost(message, optional, tag = "9")]
6455 pub child_object: ::core::option::Option<Object>,
6456}
6457pub mod dynamic_field {
6459 #[non_exhaustive]
6460 #[derive(
6461 Clone,
6462 Copy,
6463 Debug,
6464 PartialEq,
6465 Eq,
6466 Hash,
6467 PartialOrd,
6468 Ord,
6469 ::prost::Enumeration
6470 )]
6471 #[repr(i32)]
6472 pub enum DynamicFieldKind {
6473 Unknown = 0,
6474 Field = 1,
6475 Object = 2,
6476 }
6477 impl DynamicFieldKind {
6478 pub fn as_str_name(&self) -> &'static str {
6483 match self {
6484 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
6485 Self::Field => "FIELD",
6486 Self::Object => "OBJECT",
6487 }
6488 }
6489 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6491 match value {
6492 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
6493 "FIELD" => Some(Self::Field),
6494 "OBJECT" => Some(Self::Object),
6495 _ => None,
6496 }
6497 }
6498 }
6499}
6500#[non_exhaustive]
6501#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6502pub struct ListOwnedObjectsRequest {
6503 #[prost(string, optional, tag = "1")]
6505 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6506 #[prost(uint32, optional, tag = "2")]
6510 pub page_size: ::core::option::Option<u32>,
6511 #[prost(bytes = "bytes", optional, tag = "3")]
6517 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6518 #[prost(message, optional, tag = "4")]
6521 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6522 #[prost(string, optional, tag = "5")]
6531 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
6532}
6533#[non_exhaustive]
6534#[derive(Clone, PartialEq, ::prost::Message)]
6535pub struct ListOwnedObjectsResponse {
6536 #[prost(message, repeated, tag = "1")]
6538 pub objects: ::prost::alloc::vec::Vec<Object>,
6539 #[prost(bytes = "bytes", optional, tag = "2")]
6542 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6543}
6544pub mod state_service_client {
6546 #![allow(
6547 unused_variables,
6548 dead_code,
6549 missing_docs,
6550 clippy::wildcard_imports,
6551 clippy::let_unit_value,
6552 )]
6553 use tonic::codegen::*;
6554 use tonic::codegen::http::Uri;
6555 #[derive(Debug, Clone)]
6556 pub struct StateServiceClient<T> {
6557 inner: tonic::client::Grpc<T>,
6558 }
6559 impl StateServiceClient<tonic::transport::Channel> {
6560 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6562 where
6563 D: TryInto<tonic::transport::Endpoint>,
6564 D::Error: Into<StdError>,
6565 {
6566 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6567 Ok(Self::new(conn))
6568 }
6569 }
6570 impl<T> StateServiceClient<T>
6571 where
6572 T: tonic::client::GrpcService<tonic::body::Body>,
6573 T::Error: Into<StdError>,
6574 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6575 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6576 {
6577 pub fn new(inner: T) -> Self {
6578 let inner = tonic::client::Grpc::new(inner);
6579 Self { inner }
6580 }
6581 pub fn with_origin(inner: T, origin: Uri) -> Self {
6582 let inner = tonic::client::Grpc::with_origin(inner, origin);
6583 Self { inner }
6584 }
6585 pub fn with_interceptor<F>(
6586 inner: T,
6587 interceptor: F,
6588 ) -> StateServiceClient<InterceptedService<T, F>>
6589 where
6590 F: tonic::service::Interceptor,
6591 T::ResponseBody: Default,
6592 T: tonic::codegen::Service<
6593 http::Request<tonic::body::Body>,
6594 Response = http::Response<
6595 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6596 >,
6597 >,
6598 <T as tonic::codegen::Service<
6599 http::Request<tonic::body::Body>,
6600 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6601 {
6602 StateServiceClient::new(InterceptedService::new(inner, interceptor))
6603 }
6604 #[must_use]
6609 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6610 self.inner = self.inner.send_compressed(encoding);
6611 self
6612 }
6613 #[must_use]
6615 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6616 self.inner = self.inner.accept_compressed(encoding);
6617 self
6618 }
6619 #[must_use]
6623 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6624 self.inner = self.inner.max_decoding_message_size(limit);
6625 self
6626 }
6627 #[must_use]
6631 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6632 self.inner = self.inner.max_encoding_message_size(limit);
6633 self
6634 }
6635 pub async fn list_dynamic_fields(
6636 &mut self,
6637 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
6638 ) -> std::result::Result<
6639 tonic::Response<super::ListDynamicFieldsResponse>,
6640 tonic::Status,
6641 > {
6642 self.inner
6643 .ready()
6644 .await
6645 .map_err(|e| {
6646 tonic::Status::unknown(
6647 format!("Service was not ready: {}", e.into()),
6648 )
6649 })?;
6650 let codec = tonic_prost::ProstCodec::default();
6651 let path = http::uri::PathAndQuery::from_static(
6652 "/sui.rpc.v2.StateService/ListDynamicFields",
6653 );
6654 let mut req = request.into_request();
6655 req.extensions_mut()
6656 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
6657 self.inner.unary(req, path, codec).await
6658 }
6659 pub async fn list_owned_objects(
6660 &mut self,
6661 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
6662 ) -> std::result::Result<
6663 tonic::Response<super::ListOwnedObjectsResponse>,
6664 tonic::Status,
6665 > {
6666 self.inner
6667 .ready()
6668 .await
6669 .map_err(|e| {
6670 tonic::Status::unknown(
6671 format!("Service was not ready: {}", e.into()),
6672 )
6673 })?;
6674 let codec = tonic_prost::ProstCodec::default();
6675 let path = http::uri::PathAndQuery::from_static(
6676 "/sui.rpc.v2.StateService/ListOwnedObjects",
6677 );
6678 let mut req = request.into_request();
6679 req.extensions_mut()
6680 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
6681 self.inner.unary(req, path, codec).await
6682 }
6683 pub async fn get_coin_info(
6684 &mut self,
6685 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
6686 ) -> std::result::Result<
6687 tonic::Response<super::GetCoinInfoResponse>,
6688 tonic::Status,
6689 > {
6690 self.inner
6691 .ready()
6692 .await
6693 .map_err(|e| {
6694 tonic::Status::unknown(
6695 format!("Service was not ready: {}", e.into()),
6696 )
6697 })?;
6698 let codec = tonic_prost::ProstCodec::default();
6699 let path = http::uri::PathAndQuery::from_static(
6700 "/sui.rpc.v2.StateService/GetCoinInfo",
6701 );
6702 let mut req = request.into_request();
6703 req.extensions_mut()
6704 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
6705 self.inner.unary(req, path, codec).await
6706 }
6707 pub async fn get_balance(
6708 &mut self,
6709 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
6710 ) -> std::result::Result<
6711 tonic::Response<super::GetBalanceResponse>,
6712 tonic::Status,
6713 > {
6714 self.inner
6715 .ready()
6716 .await
6717 .map_err(|e| {
6718 tonic::Status::unknown(
6719 format!("Service was not ready: {}", e.into()),
6720 )
6721 })?;
6722 let codec = tonic_prost::ProstCodec::default();
6723 let path = http::uri::PathAndQuery::from_static(
6724 "/sui.rpc.v2.StateService/GetBalance",
6725 );
6726 let mut req = request.into_request();
6727 req.extensions_mut()
6728 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
6729 self.inner.unary(req, path, codec).await
6730 }
6731 pub async fn list_balances(
6732 &mut self,
6733 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
6734 ) -> std::result::Result<
6735 tonic::Response<super::ListBalancesResponse>,
6736 tonic::Status,
6737 > {
6738 self.inner
6739 .ready()
6740 .await
6741 .map_err(|e| {
6742 tonic::Status::unknown(
6743 format!("Service was not ready: {}", e.into()),
6744 )
6745 })?;
6746 let codec = tonic_prost::ProstCodec::default();
6747 let path = http::uri::PathAndQuery::from_static(
6748 "/sui.rpc.v2.StateService/ListBalances",
6749 );
6750 let mut req = request.into_request();
6751 req.extensions_mut()
6752 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
6753 self.inner.unary(req, path, codec).await
6754 }
6755 }
6756}
6757pub mod state_service_server {
6759 #![allow(
6760 unused_variables,
6761 dead_code,
6762 missing_docs,
6763 clippy::wildcard_imports,
6764 clippy::let_unit_value,
6765 )]
6766 use tonic::codegen::*;
6767 #[async_trait]
6769 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
6770 async fn list_dynamic_fields(
6771 &self,
6772 request: tonic::Request<super::ListDynamicFieldsRequest>,
6773 ) -> std::result::Result<
6774 tonic::Response<super::ListDynamicFieldsResponse>,
6775 tonic::Status,
6776 > {
6777 Err(tonic::Status::unimplemented("Not yet implemented"))
6778 }
6779 async fn list_owned_objects(
6780 &self,
6781 request: tonic::Request<super::ListOwnedObjectsRequest>,
6782 ) -> std::result::Result<
6783 tonic::Response<super::ListOwnedObjectsResponse>,
6784 tonic::Status,
6785 > {
6786 Err(tonic::Status::unimplemented("Not yet implemented"))
6787 }
6788 async fn get_coin_info(
6789 &self,
6790 request: tonic::Request<super::GetCoinInfoRequest>,
6791 ) -> std::result::Result<
6792 tonic::Response<super::GetCoinInfoResponse>,
6793 tonic::Status,
6794 > {
6795 Err(tonic::Status::unimplemented("Not yet implemented"))
6796 }
6797 async fn get_balance(
6798 &self,
6799 request: tonic::Request<super::GetBalanceRequest>,
6800 ) -> std::result::Result<
6801 tonic::Response<super::GetBalanceResponse>,
6802 tonic::Status,
6803 > {
6804 Err(tonic::Status::unimplemented("Not yet implemented"))
6805 }
6806 async fn list_balances(
6807 &self,
6808 request: tonic::Request<super::ListBalancesRequest>,
6809 ) -> std::result::Result<
6810 tonic::Response<super::ListBalancesResponse>,
6811 tonic::Status,
6812 > {
6813 Err(tonic::Status::unimplemented("Not yet implemented"))
6814 }
6815 }
6816 #[derive(Debug)]
6817 pub struct StateServiceServer<T> {
6818 inner: Arc<T>,
6819 accept_compression_encodings: EnabledCompressionEncodings,
6820 send_compression_encodings: EnabledCompressionEncodings,
6821 max_decoding_message_size: Option<usize>,
6822 max_encoding_message_size: Option<usize>,
6823 }
6824 impl<T> StateServiceServer<T> {
6825 pub fn new(inner: T) -> Self {
6826 Self::from_arc(Arc::new(inner))
6827 }
6828 pub fn from_arc(inner: Arc<T>) -> Self {
6829 Self {
6830 inner,
6831 accept_compression_encodings: Default::default(),
6832 send_compression_encodings: Default::default(),
6833 max_decoding_message_size: None,
6834 max_encoding_message_size: None,
6835 }
6836 }
6837 pub fn with_interceptor<F>(
6838 inner: T,
6839 interceptor: F,
6840 ) -> InterceptedService<Self, F>
6841 where
6842 F: tonic::service::Interceptor,
6843 {
6844 InterceptedService::new(Self::new(inner), interceptor)
6845 }
6846 #[must_use]
6848 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6849 self.accept_compression_encodings.enable(encoding);
6850 self
6851 }
6852 #[must_use]
6854 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6855 self.send_compression_encodings.enable(encoding);
6856 self
6857 }
6858 #[must_use]
6862 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6863 self.max_decoding_message_size = Some(limit);
6864 self
6865 }
6866 #[must_use]
6870 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6871 self.max_encoding_message_size = Some(limit);
6872 self
6873 }
6874 }
6875 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
6876 where
6877 T: StateService,
6878 B: Body + std::marker::Send + 'static,
6879 B::Error: Into<StdError> + std::marker::Send + 'static,
6880 {
6881 type Response = http::Response<tonic::body::Body>;
6882 type Error = std::convert::Infallible;
6883 type Future = BoxFuture<Self::Response, Self::Error>;
6884 fn poll_ready(
6885 &mut self,
6886 _cx: &mut Context<'_>,
6887 ) -> Poll<std::result::Result<(), Self::Error>> {
6888 Poll::Ready(Ok(()))
6889 }
6890 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6891 match req.uri().path() {
6892 "/sui.rpc.v2.StateService/ListDynamicFields" => {
6893 #[allow(non_camel_case_types)]
6894 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
6895 impl<
6896 T: StateService,
6897 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
6898 for ListDynamicFieldsSvc<T> {
6899 type Response = super::ListDynamicFieldsResponse;
6900 type Future = BoxFuture<
6901 tonic::Response<Self::Response>,
6902 tonic::Status,
6903 >;
6904 fn call(
6905 &mut self,
6906 request: tonic::Request<super::ListDynamicFieldsRequest>,
6907 ) -> Self::Future {
6908 let inner = Arc::clone(&self.0);
6909 let fut = async move {
6910 <T as StateService>::list_dynamic_fields(&inner, request)
6911 .await
6912 };
6913 Box::pin(fut)
6914 }
6915 }
6916 let accept_compression_encodings = self.accept_compression_encodings;
6917 let send_compression_encodings = self.send_compression_encodings;
6918 let max_decoding_message_size = self.max_decoding_message_size;
6919 let max_encoding_message_size = self.max_encoding_message_size;
6920 let inner = self.inner.clone();
6921 let fut = async move {
6922 let method = ListDynamicFieldsSvc(inner);
6923 let codec = tonic_prost::ProstCodec::default();
6924 let mut grpc = tonic::server::Grpc::new(codec)
6925 .apply_compression_config(
6926 accept_compression_encodings,
6927 send_compression_encodings,
6928 )
6929 .apply_max_message_size_config(
6930 max_decoding_message_size,
6931 max_encoding_message_size,
6932 );
6933 let res = grpc.unary(method, req).await;
6934 Ok(res)
6935 };
6936 Box::pin(fut)
6937 }
6938 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
6939 #[allow(non_camel_case_types)]
6940 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
6941 impl<
6942 T: StateService,
6943 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
6944 for ListOwnedObjectsSvc<T> {
6945 type Response = super::ListOwnedObjectsResponse;
6946 type Future = BoxFuture<
6947 tonic::Response<Self::Response>,
6948 tonic::Status,
6949 >;
6950 fn call(
6951 &mut self,
6952 request: tonic::Request<super::ListOwnedObjectsRequest>,
6953 ) -> Self::Future {
6954 let inner = Arc::clone(&self.0);
6955 let fut = async move {
6956 <T as StateService>::list_owned_objects(&inner, request)
6957 .await
6958 };
6959 Box::pin(fut)
6960 }
6961 }
6962 let accept_compression_encodings = self.accept_compression_encodings;
6963 let send_compression_encodings = self.send_compression_encodings;
6964 let max_decoding_message_size = self.max_decoding_message_size;
6965 let max_encoding_message_size = self.max_encoding_message_size;
6966 let inner = self.inner.clone();
6967 let fut = async move {
6968 let method = ListOwnedObjectsSvc(inner);
6969 let codec = tonic_prost::ProstCodec::default();
6970 let mut grpc = tonic::server::Grpc::new(codec)
6971 .apply_compression_config(
6972 accept_compression_encodings,
6973 send_compression_encodings,
6974 )
6975 .apply_max_message_size_config(
6976 max_decoding_message_size,
6977 max_encoding_message_size,
6978 );
6979 let res = grpc.unary(method, req).await;
6980 Ok(res)
6981 };
6982 Box::pin(fut)
6983 }
6984 "/sui.rpc.v2.StateService/GetCoinInfo" => {
6985 #[allow(non_camel_case_types)]
6986 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
6987 impl<
6988 T: StateService,
6989 > tonic::server::UnaryService<super::GetCoinInfoRequest>
6990 for GetCoinInfoSvc<T> {
6991 type Response = super::GetCoinInfoResponse;
6992 type Future = BoxFuture<
6993 tonic::Response<Self::Response>,
6994 tonic::Status,
6995 >;
6996 fn call(
6997 &mut self,
6998 request: tonic::Request<super::GetCoinInfoRequest>,
6999 ) -> Self::Future {
7000 let inner = Arc::clone(&self.0);
7001 let fut = async move {
7002 <T as StateService>::get_coin_info(&inner, request).await
7003 };
7004 Box::pin(fut)
7005 }
7006 }
7007 let accept_compression_encodings = self.accept_compression_encodings;
7008 let send_compression_encodings = self.send_compression_encodings;
7009 let max_decoding_message_size = self.max_decoding_message_size;
7010 let max_encoding_message_size = self.max_encoding_message_size;
7011 let inner = self.inner.clone();
7012 let fut = async move {
7013 let method = GetCoinInfoSvc(inner);
7014 let codec = tonic_prost::ProstCodec::default();
7015 let mut grpc = tonic::server::Grpc::new(codec)
7016 .apply_compression_config(
7017 accept_compression_encodings,
7018 send_compression_encodings,
7019 )
7020 .apply_max_message_size_config(
7021 max_decoding_message_size,
7022 max_encoding_message_size,
7023 );
7024 let res = grpc.unary(method, req).await;
7025 Ok(res)
7026 };
7027 Box::pin(fut)
7028 }
7029 "/sui.rpc.v2.StateService/GetBalance" => {
7030 #[allow(non_camel_case_types)]
7031 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
7032 impl<
7033 T: StateService,
7034 > tonic::server::UnaryService<super::GetBalanceRequest>
7035 for GetBalanceSvc<T> {
7036 type Response = super::GetBalanceResponse;
7037 type Future = BoxFuture<
7038 tonic::Response<Self::Response>,
7039 tonic::Status,
7040 >;
7041 fn call(
7042 &mut self,
7043 request: tonic::Request<super::GetBalanceRequest>,
7044 ) -> Self::Future {
7045 let inner = Arc::clone(&self.0);
7046 let fut = async move {
7047 <T as StateService>::get_balance(&inner, request).await
7048 };
7049 Box::pin(fut)
7050 }
7051 }
7052 let accept_compression_encodings = self.accept_compression_encodings;
7053 let send_compression_encodings = self.send_compression_encodings;
7054 let max_decoding_message_size = self.max_decoding_message_size;
7055 let max_encoding_message_size = self.max_encoding_message_size;
7056 let inner = self.inner.clone();
7057 let fut = async move {
7058 let method = GetBalanceSvc(inner);
7059 let codec = tonic_prost::ProstCodec::default();
7060 let mut grpc = tonic::server::Grpc::new(codec)
7061 .apply_compression_config(
7062 accept_compression_encodings,
7063 send_compression_encodings,
7064 )
7065 .apply_max_message_size_config(
7066 max_decoding_message_size,
7067 max_encoding_message_size,
7068 );
7069 let res = grpc.unary(method, req).await;
7070 Ok(res)
7071 };
7072 Box::pin(fut)
7073 }
7074 "/sui.rpc.v2.StateService/ListBalances" => {
7075 #[allow(non_camel_case_types)]
7076 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
7077 impl<
7078 T: StateService,
7079 > tonic::server::UnaryService<super::ListBalancesRequest>
7080 for ListBalancesSvc<T> {
7081 type Response = super::ListBalancesResponse;
7082 type Future = BoxFuture<
7083 tonic::Response<Self::Response>,
7084 tonic::Status,
7085 >;
7086 fn call(
7087 &mut self,
7088 request: tonic::Request<super::ListBalancesRequest>,
7089 ) -> Self::Future {
7090 let inner = Arc::clone(&self.0);
7091 let fut = async move {
7092 <T as StateService>::list_balances(&inner, request).await
7093 };
7094 Box::pin(fut)
7095 }
7096 }
7097 let accept_compression_encodings = self.accept_compression_encodings;
7098 let send_compression_encodings = self.send_compression_encodings;
7099 let max_decoding_message_size = self.max_decoding_message_size;
7100 let max_encoding_message_size = self.max_encoding_message_size;
7101 let inner = self.inner.clone();
7102 let fut = async move {
7103 let method = ListBalancesSvc(inner);
7104 let codec = tonic_prost::ProstCodec::default();
7105 let mut grpc = tonic::server::Grpc::new(codec)
7106 .apply_compression_config(
7107 accept_compression_encodings,
7108 send_compression_encodings,
7109 )
7110 .apply_max_message_size_config(
7111 max_decoding_message_size,
7112 max_encoding_message_size,
7113 );
7114 let res = grpc.unary(method, req).await;
7115 Ok(res)
7116 };
7117 Box::pin(fut)
7118 }
7119 _ => {
7120 Box::pin(async move {
7121 let mut response = http::Response::new(
7122 tonic::body::Body::default(),
7123 );
7124 let headers = response.headers_mut();
7125 headers
7126 .insert(
7127 tonic::Status::GRPC_STATUS,
7128 (tonic::Code::Unimplemented as i32).into(),
7129 );
7130 headers
7131 .insert(
7132 http::header::CONTENT_TYPE,
7133 tonic::metadata::GRPC_CONTENT_TYPE,
7134 );
7135 Ok(response)
7136 })
7137 }
7138 }
7139 }
7140 }
7141 impl<T> Clone for StateServiceServer<T> {
7142 fn clone(&self) -> Self {
7143 let inner = self.inner.clone();
7144 Self {
7145 inner,
7146 accept_compression_encodings: self.accept_compression_encodings,
7147 send_compression_encodings: self.send_compression_encodings,
7148 max_decoding_message_size: self.max_decoding_message_size,
7149 max_encoding_message_size: self.max_encoding_message_size,
7150 }
7151 }
7152 }
7153 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
7155 impl<T> tonic::server::NamedService for StateServiceServer<T> {
7156 const NAME: &'static str = SERVICE_NAME;
7157 }
7158}
7159#[derive(Eq, Hash)]
7161#[non_exhaustive]
7162#[derive(Clone, PartialEq, ::prost::Message)]
7163pub struct SubscribeCheckpointsRequest {
7164 #[prost(message, optional, tag = "1")]
7168 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7169 #[prost(message, optional, tag = "2")]
7173 pub filter: ::core::option::Option<TransactionFilter>,
7174}
7175#[non_exhaustive]
7183#[derive(Clone, PartialEq, ::prost::Message)]
7184pub struct SubscribeCheckpointsResponse {
7185 #[prost(uint64, optional, tag = "1")]
7190 pub cursor: ::core::option::Option<u64>,
7191 #[prost(message, optional, tag = "2")]
7194 pub checkpoint: ::core::option::Option<Checkpoint>,
7195}
7196#[non_exhaustive]
7198#[derive(Clone, PartialEq, ::prost::Message)]
7199pub struct SubscribeTransactionsRequest {
7200 #[prost(message, optional, tag = "1")]
7203 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7204 #[prost(message, optional, tag = "2")]
7207 pub filter: ::core::option::Option<TransactionFilter>,
7208}
7209#[non_exhaustive]
7214#[derive(Clone, PartialEq, ::prost::Message)]
7215pub struct SubscribeTransactionsResponse {
7216 #[prost(message, optional, tag = "1")]
7219 pub transaction: ::core::option::Option<ExecutedTransaction>,
7220 #[prost(message, optional, tag = "2")]
7222 pub watermark: ::core::option::Option<Watermark>,
7223}
7224#[non_exhaustive]
7226#[derive(Clone, PartialEq, ::prost::Message)]
7227pub struct SubscribeEventsRequest {
7228 #[prost(message, optional, tag = "1")]
7231 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7232 #[prost(message, optional, tag = "2")]
7235 pub filter: ::core::option::Option<EventFilter>,
7236}
7237#[non_exhaustive]
7242#[derive(Clone, PartialEq, ::prost::Message)]
7243pub struct SubscribeEventsResponse {
7244 #[prost(message, optional, tag = "1")]
7249 pub event: ::core::option::Option<Event>,
7250 #[prost(message, optional, tag = "2")]
7252 pub watermark: ::core::option::Option<Watermark>,
7253}
7254pub mod subscription_service_client {
7256 #![allow(
7257 unused_variables,
7258 dead_code,
7259 missing_docs,
7260 clippy::wildcard_imports,
7261 clippy::let_unit_value,
7262 )]
7263 use tonic::codegen::*;
7264 use tonic::codegen::http::Uri;
7265 #[derive(Debug, Clone)]
7293 pub struct SubscriptionServiceClient<T> {
7294 inner: tonic::client::Grpc<T>,
7295 }
7296 impl SubscriptionServiceClient<tonic::transport::Channel> {
7297 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7299 where
7300 D: TryInto<tonic::transport::Endpoint>,
7301 D::Error: Into<StdError>,
7302 {
7303 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7304 Ok(Self::new(conn))
7305 }
7306 }
7307 impl<T> SubscriptionServiceClient<T>
7308 where
7309 T: tonic::client::GrpcService<tonic::body::Body>,
7310 T::Error: Into<StdError>,
7311 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7312 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7313 {
7314 pub fn new(inner: T) -> Self {
7315 let inner = tonic::client::Grpc::new(inner);
7316 Self { inner }
7317 }
7318 pub fn with_origin(inner: T, origin: Uri) -> Self {
7319 let inner = tonic::client::Grpc::with_origin(inner, origin);
7320 Self { inner }
7321 }
7322 pub fn with_interceptor<F>(
7323 inner: T,
7324 interceptor: F,
7325 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
7326 where
7327 F: tonic::service::Interceptor,
7328 T::ResponseBody: Default,
7329 T: tonic::codegen::Service<
7330 http::Request<tonic::body::Body>,
7331 Response = http::Response<
7332 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7333 >,
7334 >,
7335 <T as tonic::codegen::Service<
7336 http::Request<tonic::body::Body>,
7337 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7338 {
7339 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
7340 }
7341 #[must_use]
7346 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7347 self.inner = self.inner.send_compressed(encoding);
7348 self
7349 }
7350 #[must_use]
7352 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7353 self.inner = self.inner.accept_compressed(encoding);
7354 self
7355 }
7356 #[must_use]
7360 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7361 self.inner = self.inner.max_decoding_message_size(limit);
7362 self
7363 }
7364 #[must_use]
7368 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7369 self.inner = self.inner.max_encoding_message_size(limit);
7370 self
7371 }
7372 pub async fn subscribe_checkpoints(
7379 &mut self,
7380 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
7381 ) -> std::result::Result<
7382 tonic::Response<
7383 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
7384 >,
7385 tonic::Status,
7386 > {
7387 self.inner
7388 .ready()
7389 .await
7390 .map_err(|e| {
7391 tonic::Status::unknown(
7392 format!("Service was not ready: {}", e.into()),
7393 )
7394 })?;
7395 let codec = tonic_prost::ProstCodec::default();
7396 let path = http::uri::PathAndQuery::from_static(
7397 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
7398 );
7399 let mut req = request.into_request();
7400 req.extensions_mut()
7401 .insert(
7402 GrpcMethod::new(
7403 "sui.rpc.v2.SubscriptionService",
7404 "SubscribeCheckpoints",
7405 ),
7406 );
7407 self.inner.server_streaming(req, path, codec).await
7408 }
7409 pub async fn subscribe_transactions(
7414 &mut self,
7415 request: impl tonic::IntoRequest<super::SubscribeTransactionsRequest>,
7416 ) -> std::result::Result<
7417 tonic::Response<
7418 tonic::codec::Streaming<super::SubscribeTransactionsResponse>,
7419 >,
7420 tonic::Status,
7421 > {
7422 self.inner
7423 .ready()
7424 .await
7425 .map_err(|e| {
7426 tonic::Status::unknown(
7427 format!("Service was not ready: {}", e.into()),
7428 )
7429 })?;
7430 let codec = tonic_prost::ProstCodec::default();
7431 let path = http::uri::PathAndQuery::from_static(
7432 "/sui.rpc.v2.SubscriptionService/SubscribeTransactions",
7433 );
7434 let mut req = request.into_request();
7435 req.extensions_mut()
7436 .insert(
7437 GrpcMethod::new(
7438 "sui.rpc.v2.SubscriptionService",
7439 "SubscribeTransactions",
7440 ),
7441 );
7442 self.inner.server_streaming(req, path, codec).await
7443 }
7444 pub async fn subscribe_events(
7449 &mut self,
7450 request: impl tonic::IntoRequest<super::SubscribeEventsRequest>,
7451 ) -> std::result::Result<
7452 tonic::Response<tonic::codec::Streaming<super::SubscribeEventsResponse>>,
7453 tonic::Status,
7454 > {
7455 self.inner
7456 .ready()
7457 .await
7458 .map_err(|e| {
7459 tonic::Status::unknown(
7460 format!("Service was not ready: {}", e.into()),
7461 )
7462 })?;
7463 let codec = tonic_prost::ProstCodec::default();
7464 let path = http::uri::PathAndQuery::from_static(
7465 "/sui.rpc.v2.SubscriptionService/SubscribeEvents",
7466 );
7467 let mut req = request.into_request();
7468 req.extensions_mut()
7469 .insert(
7470 GrpcMethod::new("sui.rpc.v2.SubscriptionService", "SubscribeEvents"),
7471 );
7472 self.inner.server_streaming(req, path, codec).await
7473 }
7474 }
7475}
7476pub mod subscription_service_server {
7478 #![allow(
7479 unused_variables,
7480 dead_code,
7481 missing_docs,
7482 clippy::wildcard_imports,
7483 clippy::let_unit_value,
7484 )]
7485 use tonic::codegen::*;
7486 #[async_trait]
7488 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
7489 async fn subscribe_checkpoints(
7496 &self,
7497 request: tonic::Request<super::SubscribeCheckpointsRequest>,
7498 ) -> std::result::Result<
7499 tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
7500 tonic::Status,
7501 > {
7502 Err(tonic::Status::unimplemented("Not yet implemented"))
7503 }
7504 async fn subscribe_transactions(
7509 &self,
7510 request: tonic::Request<super::SubscribeTransactionsRequest>,
7511 ) -> std::result::Result<
7512 tonic::Response<BoxStream<super::SubscribeTransactionsResponse>>,
7513 tonic::Status,
7514 > {
7515 Err(tonic::Status::unimplemented("Not yet implemented"))
7516 }
7517 async fn subscribe_events(
7522 &self,
7523 request: tonic::Request<super::SubscribeEventsRequest>,
7524 ) -> std::result::Result<
7525 tonic::Response<BoxStream<super::SubscribeEventsResponse>>,
7526 tonic::Status,
7527 > {
7528 Err(tonic::Status::unimplemented("Not yet implemented"))
7529 }
7530 }
7531 #[derive(Debug)]
7559 pub struct SubscriptionServiceServer<T> {
7560 inner: Arc<T>,
7561 accept_compression_encodings: EnabledCompressionEncodings,
7562 send_compression_encodings: EnabledCompressionEncodings,
7563 max_decoding_message_size: Option<usize>,
7564 max_encoding_message_size: Option<usize>,
7565 }
7566 impl<T> SubscriptionServiceServer<T> {
7567 pub fn new(inner: T) -> Self {
7568 Self::from_arc(Arc::new(inner))
7569 }
7570 pub fn from_arc(inner: Arc<T>) -> Self {
7571 Self {
7572 inner,
7573 accept_compression_encodings: Default::default(),
7574 send_compression_encodings: Default::default(),
7575 max_decoding_message_size: None,
7576 max_encoding_message_size: None,
7577 }
7578 }
7579 pub fn with_interceptor<F>(
7580 inner: T,
7581 interceptor: F,
7582 ) -> InterceptedService<Self, F>
7583 where
7584 F: tonic::service::Interceptor,
7585 {
7586 InterceptedService::new(Self::new(inner), interceptor)
7587 }
7588 #[must_use]
7590 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7591 self.accept_compression_encodings.enable(encoding);
7592 self
7593 }
7594 #[must_use]
7596 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7597 self.send_compression_encodings.enable(encoding);
7598 self
7599 }
7600 #[must_use]
7604 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7605 self.max_decoding_message_size = Some(limit);
7606 self
7607 }
7608 #[must_use]
7612 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7613 self.max_encoding_message_size = Some(limit);
7614 self
7615 }
7616 }
7617 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
7618 where
7619 T: SubscriptionService,
7620 B: Body + std::marker::Send + 'static,
7621 B::Error: Into<StdError> + std::marker::Send + 'static,
7622 {
7623 type Response = http::Response<tonic::body::Body>;
7624 type Error = std::convert::Infallible;
7625 type Future = BoxFuture<Self::Response, Self::Error>;
7626 fn poll_ready(
7627 &mut self,
7628 _cx: &mut Context<'_>,
7629 ) -> Poll<std::result::Result<(), Self::Error>> {
7630 Poll::Ready(Ok(()))
7631 }
7632 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7633 match req.uri().path() {
7634 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
7635 #[allow(non_camel_case_types)]
7636 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
7637 impl<
7638 T: SubscriptionService,
7639 > tonic::server::ServerStreamingService<
7640 super::SubscribeCheckpointsRequest,
7641 > for SubscribeCheckpointsSvc<T> {
7642 type Response = super::SubscribeCheckpointsResponse;
7643 type ResponseStream = BoxStream<
7644 super::SubscribeCheckpointsResponse,
7645 >;
7646 type Future = BoxFuture<
7647 tonic::Response<Self::ResponseStream>,
7648 tonic::Status,
7649 >;
7650 fn call(
7651 &mut self,
7652 request: tonic::Request<super::SubscribeCheckpointsRequest>,
7653 ) -> Self::Future {
7654 let inner = Arc::clone(&self.0);
7655 let fut = async move {
7656 <T as SubscriptionService>::subscribe_checkpoints(
7657 &inner,
7658 request,
7659 )
7660 .await
7661 };
7662 Box::pin(fut)
7663 }
7664 }
7665 let accept_compression_encodings = self.accept_compression_encodings;
7666 let send_compression_encodings = self.send_compression_encodings;
7667 let max_decoding_message_size = self.max_decoding_message_size;
7668 let max_encoding_message_size = self.max_encoding_message_size;
7669 let inner = self.inner.clone();
7670 let fut = async move {
7671 let method = SubscribeCheckpointsSvc(inner);
7672 let codec = tonic_prost::ProstCodec::default();
7673 let mut grpc = tonic::server::Grpc::new(codec)
7674 .apply_compression_config(
7675 accept_compression_encodings,
7676 send_compression_encodings,
7677 )
7678 .apply_max_message_size_config(
7679 max_decoding_message_size,
7680 max_encoding_message_size,
7681 );
7682 let res = grpc.server_streaming(method, req).await;
7683 Ok(res)
7684 };
7685 Box::pin(fut)
7686 }
7687 "/sui.rpc.v2.SubscriptionService/SubscribeTransactions" => {
7688 #[allow(non_camel_case_types)]
7689 struct SubscribeTransactionsSvc<T: SubscriptionService>(pub Arc<T>);
7690 impl<
7691 T: SubscriptionService,
7692 > tonic::server::ServerStreamingService<
7693 super::SubscribeTransactionsRequest,
7694 > for SubscribeTransactionsSvc<T> {
7695 type Response = super::SubscribeTransactionsResponse;
7696 type ResponseStream = BoxStream<
7697 super::SubscribeTransactionsResponse,
7698 >;
7699 type Future = BoxFuture<
7700 tonic::Response<Self::ResponseStream>,
7701 tonic::Status,
7702 >;
7703 fn call(
7704 &mut self,
7705 request: tonic::Request<super::SubscribeTransactionsRequest>,
7706 ) -> Self::Future {
7707 let inner = Arc::clone(&self.0);
7708 let fut = async move {
7709 <T as SubscriptionService>::subscribe_transactions(
7710 &inner,
7711 request,
7712 )
7713 .await
7714 };
7715 Box::pin(fut)
7716 }
7717 }
7718 let accept_compression_encodings = self.accept_compression_encodings;
7719 let send_compression_encodings = self.send_compression_encodings;
7720 let max_decoding_message_size = self.max_decoding_message_size;
7721 let max_encoding_message_size = self.max_encoding_message_size;
7722 let inner = self.inner.clone();
7723 let fut = async move {
7724 let method = SubscribeTransactionsSvc(inner);
7725 let codec = tonic_prost::ProstCodec::default();
7726 let mut grpc = tonic::server::Grpc::new(codec)
7727 .apply_compression_config(
7728 accept_compression_encodings,
7729 send_compression_encodings,
7730 )
7731 .apply_max_message_size_config(
7732 max_decoding_message_size,
7733 max_encoding_message_size,
7734 );
7735 let res = grpc.server_streaming(method, req).await;
7736 Ok(res)
7737 };
7738 Box::pin(fut)
7739 }
7740 "/sui.rpc.v2.SubscriptionService/SubscribeEvents" => {
7741 #[allow(non_camel_case_types)]
7742 struct SubscribeEventsSvc<T: SubscriptionService>(pub Arc<T>);
7743 impl<
7744 T: SubscriptionService,
7745 > tonic::server::ServerStreamingService<
7746 super::SubscribeEventsRequest,
7747 > for SubscribeEventsSvc<T> {
7748 type Response = super::SubscribeEventsResponse;
7749 type ResponseStream = BoxStream<super::SubscribeEventsResponse>;
7750 type Future = BoxFuture<
7751 tonic::Response<Self::ResponseStream>,
7752 tonic::Status,
7753 >;
7754 fn call(
7755 &mut self,
7756 request: tonic::Request<super::SubscribeEventsRequest>,
7757 ) -> Self::Future {
7758 let inner = Arc::clone(&self.0);
7759 let fut = async move {
7760 <T as SubscriptionService>::subscribe_events(
7761 &inner,
7762 request,
7763 )
7764 .await
7765 };
7766 Box::pin(fut)
7767 }
7768 }
7769 let accept_compression_encodings = self.accept_compression_encodings;
7770 let send_compression_encodings = self.send_compression_encodings;
7771 let max_decoding_message_size = self.max_decoding_message_size;
7772 let max_encoding_message_size = self.max_encoding_message_size;
7773 let inner = self.inner.clone();
7774 let fut = async move {
7775 let method = SubscribeEventsSvc(inner);
7776 let codec = tonic_prost::ProstCodec::default();
7777 let mut grpc = tonic::server::Grpc::new(codec)
7778 .apply_compression_config(
7779 accept_compression_encodings,
7780 send_compression_encodings,
7781 )
7782 .apply_max_message_size_config(
7783 max_decoding_message_size,
7784 max_encoding_message_size,
7785 );
7786 let res = grpc.server_streaming(method, req).await;
7787 Ok(res)
7788 };
7789 Box::pin(fut)
7790 }
7791 _ => {
7792 Box::pin(async move {
7793 let mut response = http::Response::new(
7794 tonic::body::Body::default(),
7795 );
7796 let headers = response.headers_mut();
7797 headers
7798 .insert(
7799 tonic::Status::GRPC_STATUS,
7800 (tonic::Code::Unimplemented as i32).into(),
7801 );
7802 headers
7803 .insert(
7804 http::header::CONTENT_TYPE,
7805 tonic::metadata::GRPC_CONTENT_TYPE,
7806 );
7807 Ok(response)
7808 })
7809 }
7810 }
7811 }
7812 }
7813 impl<T> Clone for SubscriptionServiceServer<T> {
7814 fn clone(&self) -> Self {
7815 let inner = self.inner.clone();
7816 Self {
7817 inner,
7818 accept_compression_encodings: self.accept_compression_encodings,
7819 send_compression_encodings: self.send_compression_encodings,
7820 max_decoding_message_size: self.max_decoding_message_size,
7821 max_encoding_message_size: self.max_encoding_message_size,
7822 }
7823 }
7824 }
7825 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
7827 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
7828 const NAME: &'static str = SERVICE_NAME;
7829 }
7830}
7831#[non_exhaustive]
7832#[derive(Clone, PartialEq, ::prost::Message)]
7833pub struct SystemState {
7834 #[prost(uint64, optional, tag = "1")]
7836 pub version: ::core::option::Option<u64>,
7837 #[prost(uint64, optional, tag = "2")]
7839 pub epoch: ::core::option::Option<u64>,
7840 #[prost(uint64, optional, tag = "3")]
7842 pub protocol_version: ::core::option::Option<u64>,
7843 #[prost(message, optional, tag = "4")]
7845 pub validators: ::core::option::Option<ValidatorSet>,
7846 #[prost(message, optional, tag = "5")]
7848 pub storage_fund: ::core::option::Option<StorageFund>,
7849 #[prost(message, optional, tag = "6")]
7851 pub parameters: ::core::option::Option<SystemParameters>,
7852 #[prost(uint64, optional, tag = "7")]
7854 pub reference_gas_price: ::core::option::Option<u64>,
7855 #[prost(message, repeated, tag = "8")]
7863 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
7864 #[prost(message, optional, tag = "9")]
7866 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
7867 #[prost(bool, optional, tag = "10")]
7874 pub safe_mode: ::core::option::Option<bool>,
7875 #[prost(uint64, optional, tag = "11")]
7877 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
7878 #[prost(uint64, optional, tag = "12")]
7880 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
7881 #[prost(uint64, optional, tag = "13")]
7883 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
7884 #[prost(uint64, optional, tag = "14")]
7886 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
7887 #[prost(uint64, optional, tag = "15")]
7889 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
7890 #[prost(message, optional, tag = "16")]
7892 pub extra_fields: ::core::option::Option<MoveTable>,
7893}
7894#[non_exhaustive]
7895#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7896pub struct ValidatorReportRecord {
7897 #[prost(string, optional, tag = "1")]
7899 pub reported: ::core::option::Option<::prost::alloc::string::String>,
7900 #[prost(string, repeated, tag = "2")]
7902 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7903}
7904#[non_exhaustive]
7905#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7906pub struct SystemParameters {
7907 #[prost(uint64, optional, tag = "1")]
7909 pub epoch_duration_ms: ::core::option::Option<u64>,
7910 #[prost(uint64, optional, tag = "2")]
7912 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
7913 #[prost(uint64, optional, tag = "3")]
7915 pub min_validator_count: ::core::option::Option<u64>,
7916 #[prost(uint64, optional, tag = "4")]
7919 pub max_validator_count: ::core::option::Option<u64>,
7920 #[prost(uint64, optional, tag = "5")]
7923 pub min_validator_joining_stake: ::core::option::Option<u64>,
7924 #[prost(uint64, optional, tag = "6")]
7929 pub validator_low_stake_threshold: ::core::option::Option<u64>,
7930 #[prost(uint64, optional, tag = "7")]
7934 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
7935 #[prost(uint64, optional, tag = "8")]
7938 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
7939 #[prost(message, optional, tag = "9")]
7941 pub extra_fields: ::core::option::Option<MoveTable>,
7942}
7943#[non_exhaustive]
7945#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7946pub struct MoveTable {
7947 #[prost(string, optional, tag = "1")]
7949 pub id: ::core::option::Option<::prost::alloc::string::String>,
7950 #[prost(uint64, optional, tag = "2")]
7952 pub size: ::core::option::Option<u64>,
7953}
7954#[non_exhaustive]
7955#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7956pub struct StakeSubsidy {
7957 #[prost(uint64, optional, tag = "1")]
7959 pub balance: ::core::option::Option<u64>,
7960 #[prost(uint64, optional, tag = "2")]
7962 pub distribution_counter: ::core::option::Option<u64>,
7963 #[prost(uint64, optional, tag = "3")]
7966 pub current_distribution_amount: ::core::option::Option<u64>,
7967 #[prost(uint64, optional, tag = "4")]
7969 pub stake_subsidy_period_length: ::core::option::Option<u64>,
7970 #[prost(uint32, optional, tag = "5")]
7973 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
7974 #[prost(message, optional, tag = "6")]
7976 pub extra_fields: ::core::option::Option<MoveTable>,
7977}
7978#[non_exhaustive]
7980#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7981pub struct StorageFund {
7982 #[prost(uint64, optional, tag = "1")]
7988 pub total_object_storage_rebates: ::core::option::Option<u64>,
7989 #[prost(uint64, optional, tag = "2")]
7992 pub non_refundable_balance: ::core::option::Option<u64>,
7993}
7994#[non_exhaustive]
7995#[derive(Clone, PartialEq, ::prost::Message)]
7996pub struct ValidatorSet {
7997 #[prost(uint64, optional, tag = "1")]
8000 pub total_stake: ::core::option::Option<u64>,
8001 #[prost(message, repeated, tag = "2")]
8003 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
8004 #[prost(message, optional, tag = "3")]
8009 pub pending_active_validators: ::core::option::Option<MoveTable>,
8010 #[prost(uint64, repeated, tag = "4")]
8013 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
8014 #[prost(message, optional, tag = "5")]
8018 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
8019 #[prost(message, optional, tag = "6")]
8025 pub inactive_validators: ::core::option::Option<MoveTable>,
8026 #[prost(message, optional, tag = "7")]
8034 pub validator_candidates: ::core::option::Option<MoveTable>,
8035 #[prost(btree_map = "string, uint64", tag = "8")]
8037 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
8038 ::prost::alloc::string::String,
8039 u64,
8040 >,
8041 #[prost(message, optional, tag = "9")]
8043 pub extra_fields: ::core::option::Option<MoveTable>,
8044}
8045#[non_exhaustive]
8049#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8050pub struct Validator {
8051 #[prost(string, optional, tag = "1")]
8053 pub name: ::core::option::Option<::prost::alloc::string::String>,
8054 #[prost(string, optional, tag = "2")]
8057 pub address: ::core::option::Option<::prost::alloc::string::String>,
8058 #[prost(string, optional, tag = "3")]
8059 pub description: ::core::option::Option<::prost::alloc::string::String>,
8060 #[prost(string, optional, tag = "4")]
8061 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
8062 #[prost(string, optional, tag = "5")]
8063 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
8064 #[prost(bytes = "bytes", optional, tag = "7")]
8067 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8068 #[prost(bytes = "bytes", optional, tag = "8")]
8070 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8071 #[prost(bytes = "bytes", optional, tag = "10")]
8074 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8075 #[prost(bytes = "bytes", optional, tag = "12")]
8077 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8078 #[prost(string, optional, tag = "13")]
8080 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
8081 #[prost(string, optional, tag = "14")]
8083 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8084 #[prost(string, optional, tag = "15")]
8086 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
8087 #[prost(string, optional, tag = "16")]
8089 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
8090 #[prost(bytes = "bytes", optional, tag = "18")]
8091 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8092 #[prost(bytes = "bytes", optional, tag = "19")]
8093 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8094 #[prost(bytes = "bytes", optional, tag = "21")]
8095 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8096 #[prost(bytes = "bytes", optional, tag = "23")]
8097 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8098 #[prost(string, optional, tag = "24")]
8099 pub next_epoch_network_address: ::core::option::Option<
8100 ::prost::alloc::string::String,
8101 >,
8102 #[prost(string, optional, tag = "25")]
8103 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8104 #[prost(string, optional, tag = "26")]
8105 pub next_epoch_primary_address: ::core::option::Option<
8106 ::prost::alloc::string::String,
8107 >,
8108 #[prost(string, optional, tag = "27")]
8109 pub next_epoch_worker_address: ::core::option::Option<
8110 ::prost::alloc::string::String,
8111 >,
8112 #[prost(message, optional, tag = "28")]
8114 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
8115 #[prost(uint64, optional, tag = "29")]
8118 pub voting_power: ::core::option::Option<u64>,
8119 #[prost(string, optional, tag = "30")]
8121 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
8122 #[prost(uint64, optional, tag = "31")]
8124 pub gas_price: ::core::option::Option<u64>,
8125 #[prost(message, optional, tag = "32")]
8127 pub staking_pool: ::core::option::Option<StakingPool>,
8128 #[prost(uint64, optional, tag = "33")]
8130 pub commission_rate: ::core::option::Option<u64>,
8131 #[prost(uint64, optional, tag = "34")]
8133 pub next_epoch_stake: ::core::option::Option<u64>,
8134 #[prost(uint64, optional, tag = "35")]
8136 pub next_epoch_gas_price: ::core::option::Option<u64>,
8137 #[prost(uint64, optional, tag = "36")]
8139 pub next_epoch_commission_rate: ::core::option::Option<u64>,
8140 #[prost(message, optional, tag = "37")]
8142 pub extra_fields: ::core::option::Option<MoveTable>,
8143}
8144#[non_exhaustive]
8146#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8147pub struct StakingPool {
8148 #[prost(string, optional, tag = "1")]
8150 pub id: ::core::option::Option<::prost::alloc::string::String>,
8151 #[prost(uint64, optional, tag = "2")]
8154 pub activation_epoch: ::core::option::Option<u64>,
8155 #[prost(uint64, optional, tag = "3")]
8158 pub deactivation_epoch: ::core::option::Option<u64>,
8159 #[prost(uint64, optional, tag = "4")]
8162 pub sui_balance: ::core::option::Option<u64>,
8163 #[prost(uint64, optional, tag = "5")]
8165 pub rewards_pool: ::core::option::Option<u64>,
8166 #[prost(uint64, optional, tag = "6")]
8168 pub pool_token_balance: ::core::option::Option<u64>,
8169 #[prost(message, optional, tag = "7")]
8176 pub exchange_rates: ::core::option::Option<MoveTable>,
8177 #[prost(uint64, optional, tag = "8")]
8179 pub pending_stake: ::core::option::Option<u64>,
8180 #[prost(uint64, optional, tag = "9")]
8183 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
8184 #[prost(uint64, optional, tag = "10")]
8186 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
8187 #[prost(message, optional, tag = "11")]
8189 pub extra_fields: ::core::option::Option<MoveTable>,
8190}
8191#[non_exhaustive]
8193#[derive(Clone, PartialEq, ::prost::Message)]
8194pub struct Transaction {
8195 #[prost(message, optional, tag = "1")]
8197 pub bcs: ::core::option::Option<Bcs>,
8198 #[prost(string, optional, tag = "2")]
8200 pub digest: ::core::option::Option<::prost::alloc::string::String>,
8201 #[prost(int32, optional, tag = "3")]
8203 pub version: ::core::option::Option<i32>,
8204 #[prost(message, optional, tag = "4")]
8205 pub kind: ::core::option::Option<TransactionKind>,
8206 #[prost(string, optional, tag = "5")]
8207 pub sender: ::core::option::Option<::prost::alloc::string::String>,
8208 #[prost(message, optional, tag = "6")]
8209 pub gas_payment: ::core::option::Option<GasPayment>,
8210 #[prost(message, optional, tag = "7")]
8211 pub expiration: ::core::option::Option<TransactionExpiration>,
8212}
8213#[non_exhaustive]
8215#[derive(Clone, PartialEq, ::prost::Message)]
8216pub struct GasPayment {
8217 #[prost(message, repeated, tag = "1")]
8219 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
8220 #[prost(string, optional, tag = "2")]
8222 pub owner: ::core::option::Option<::prost::alloc::string::String>,
8223 #[prost(uint64, optional, tag = "3")]
8227 pub price: ::core::option::Option<u64>,
8228 #[prost(uint64, optional, tag = "4")]
8230 pub budget: ::core::option::Option<u64>,
8231}
8232#[non_exhaustive]
8234#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8235pub struct TransactionExpiration {
8236 #[prost(
8237 enumeration = "transaction_expiration::TransactionExpirationKind",
8238 optional,
8239 tag = "1"
8240 )]
8241 pub kind: ::core::option::Option<i32>,
8242 #[prost(uint64, optional, tag = "2")]
8245 pub epoch: ::core::option::Option<u64>,
8246 #[prost(uint64, optional, tag = "3")]
8249 pub min_epoch: ::core::option::Option<u64>,
8250 #[prost(message, optional, tag = "4")]
8254 pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8255 #[prost(message, optional, tag = "5")]
8259 pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8260 #[prost(string, optional, tag = "6")]
8262 pub chain: ::core::option::Option<::prost::alloc::string::String>,
8263 #[prost(uint32, optional, tag = "7")]
8265 pub nonce: ::core::option::Option<u32>,
8266}
8267pub mod transaction_expiration {
8269 #[non_exhaustive]
8270 #[derive(
8271 Clone,
8272 Copy,
8273 Debug,
8274 PartialEq,
8275 Eq,
8276 Hash,
8277 PartialOrd,
8278 Ord,
8279 ::prost::Enumeration
8280 )]
8281 #[repr(i32)]
8282 pub enum TransactionExpirationKind {
8283 Unknown = 0,
8284 None = 1,
8286 Epoch = 2,
8289 ValidDuring = 3,
8299 }
8300 impl TransactionExpirationKind {
8301 pub fn as_str_name(&self) -> &'static str {
8306 match self {
8307 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
8308 Self::None => "NONE",
8309 Self::Epoch => "EPOCH",
8310 Self::ValidDuring => "VALID_DURING",
8311 }
8312 }
8313 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8315 match value {
8316 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
8317 "NONE" => Some(Self::None),
8318 "EPOCH" => Some(Self::Epoch),
8319 "VALID_DURING" => Some(Self::ValidDuring),
8320 _ => None,
8321 }
8322 }
8323 }
8324}
8325#[non_exhaustive]
8327#[derive(Clone, PartialEq, ::prost::Message)]
8328pub struct TransactionKind {
8329 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
8330 pub kind: ::core::option::Option<i32>,
8331 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
8332 pub data: ::core::option::Option<transaction_kind::Data>,
8333}
8334pub mod transaction_kind {
8336 #[non_exhaustive]
8337 #[derive(
8338 Clone,
8339 Copy,
8340 Debug,
8341 PartialEq,
8342 Eq,
8343 Hash,
8344 PartialOrd,
8345 Ord,
8346 ::prost::Enumeration
8347 )]
8348 #[repr(i32)]
8349 pub enum Kind {
8350 Unknown = 0,
8351 ProgrammableTransaction = 1,
8353 ChangeEpoch = 2,
8358 Genesis = 3,
8363 ConsensusCommitPrologueV1 = 4,
8365 AuthenticatorStateUpdate = 5,
8367 EndOfEpoch = 6,
8370 RandomnessStateUpdate = 7,
8372 ConsensusCommitPrologueV2 = 8,
8374 ConsensusCommitPrologueV3 = 9,
8376 ConsensusCommitPrologueV4 = 10,
8378 ProgrammableSystemTransaction = 11,
8380 }
8381 impl Kind {
8382 pub fn as_str_name(&self) -> &'static str {
8387 match self {
8388 Self::Unknown => "KIND_UNKNOWN",
8389 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
8390 Self::ChangeEpoch => "CHANGE_EPOCH",
8391 Self::Genesis => "GENESIS",
8392 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
8393 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
8394 Self::EndOfEpoch => "END_OF_EPOCH",
8395 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
8396 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
8397 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
8398 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
8399 Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
8400 }
8401 }
8402 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8404 match value {
8405 "KIND_UNKNOWN" => Some(Self::Unknown),
8406 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
8407 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8408 "GENESIS" => Some(Self::Genesis),
8409 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
8410 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
8411 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
8412 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
8413 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
8414 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
8415 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
8416 "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
8417 Some(Self::ProgrammableSystemTransaction)
8418 }
8419 _ => None,
8420 }
8421 }
8422 }
8423 #[non_exhaustive]
8424 #[derive(Clone, PartialEq, ::prost::Oneof)]
8425 pub enum Data {
8426 #[prost(message, tag = "2")]
8428 ProgrammableTransaction(super::ProgrammableTransaction),
8429 #[prost(message, tag = "3")]
8434 ChangeEpoch(super::ChangeEpoch),
8435 #[prost(message, tag = "4")]
8440 Genesis(super::GenesisTransaction),
8441 #[prost(message, tag = "5")]
8443 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
8444 #[prost(message, tag = "6")]
8446 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
8447 #[prost(message, tag = "7")]
8450 EndOfEpoch(super::EndOfEpochTransaction),
8451 #[prost(message, tag = "8")]
8453 RandomnessStateUpdate(super::RandomnessStateUpdate),
8454 }
8455}
8456#[non_exhaustive]
8461#[derive(Clone, PartialEq, ::prost::Message)]
8462pub struct ProgrammableTransaction {
8463 #[prost(message, repeated, tag = "1")]
8465 pub inputs: ::prost::alloc::vec::Vec<Input>,
8466 #[prost(message, repeated, tag = "2")]
8469 pub commands: ::prost::alloc::vec::Vec<Command>,
8470}
8471#[non_exhaustive]
8473#[derive(Clone, PartialEq, ::prost::Message)]
8474pub struct Command {
8475 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
8476 pub command: ::core::option::Option<command::Command>,
8477}
8478pub mod command {
8480 #[non_exhaustive]
8481 #[derive(Clone, PartialEq, ::prost::Oneof)]
8482 pub enum Command {
8483 #[prost(message, tag = "1")]
8485 MoveCall(super::MoveCall),
8486 #[prost(message, tag = "2")]
8491 TransferObjects(super::TransferObjects),
8492 #[prost(message, tag = "3")]
8495 SplitCoins(super::SplitCoins),
8496 #[prost(message, tag = "4")]
8499 MergeCoins(super::MergeCoins),
8500 #[prost(message, tag = "5")]
8503 Publish(super::Publish),
8504 #[prost(message, tag = "6")]
8508 MakeMoveVector(super::MakeMoveVector),
8509 #[prost(message, tag = "7")]
8518 Upgrade(super::Upgrade),
8519 }
8520}
8521#[non_exhaustive]
8526#[derive(Clone, PartialEq, ::prost::Message)]
8527pub struct MoveCall {
8528 #[prost(string, optional, tag = "1")]
8530 pub package: ::core::option::Option<::prost::alloc::string::String>,
8531 #[prost(string, optional, tag = "2")]
8533 pub module: ::core::option::Option<::prost::alloc::string::String>,
8534 #[prost(string, optional, tag = "3")]
8536 pub function: ::core::option::Option<::prost::alloc::string::String>,
8537 #[prost(string, repeated, tag = "4")]
8539 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8540 #[prost(message, repeated, tag = "5")]
8542 pub arguments: ::prost::alloc::vec::Vec<Argument>,
8543}
8544#[non_exhaustive]
8546#[derive(Clone, PartialEq, ::prost::Message)]
8547pub struct TransferObjects {
8548 #[prost(message, repeated, tag = "1")]
8550 pub objects: ::prost::alloc::vec::Vec<Argument>,
8551 #[prost(message, optional, tag = "2")]
8553 pub address: ::core::option::Option<Argument>,
8554}
8555#[non_exhaustive]
8557#[derive(Clone, PartialEq, ::prost::Message)]
8558pub struct SplitCoins {
8559 #[prost(message, optional, tag = "1")]
8561 pub coin: ::core::option::Option<Argument>,
8562 #[prost(message, repeated, tag = "2")]
8564 pub amounts: ::prost::alloc::vec::Vec<Argument>,
8565}
8566#[non_exhaustive]
8568#[derive(Clone, PartialEq, ::prost::Message)]
8569pub struct MergeCoins {
8570 #[prost(message, optional, tag = "1")]
8572 pub coin: ::core::option::Option<Argument>,
8573 #[prost(message, repeated, tag = "2")]
8577 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
8578}
8579#[non_exhaustive]
8581#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8582pub struct Publish {
8583 #[prost(bytes = "bytes", repeated, tag = "1")]
8585 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8586 #[prost(string, repeated, tag = "2")]
8588 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8589}
8590#[non_exhaustive]
8592#[derive(Clone, PartialEq, ::prost::Message)]
8593pub struct MakeMoveVector {
8594 #[prost(string, optional, tag = "1")]
8599 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
8600 #[prost(message, repeated, tag = "2")]
8602 pub elements: ::prost::alloc::vec::Vec<Argument>,
8603}
8604#[non_exhaustive]
8606#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8607pub struct Upgrade {
8608 #[prost(bytes = "bytes", repeated, tag = "1")]
8610 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8611 #[prost(string, repeated, tag = "2")]
8613 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8614 #[prost(string, optional, tag = "3")]
8616 pub package: ::core::option::Option<::prost::alloc::string::String>,
8617 #[prost(message, optional, tag = "4")]
8619 pub ticket: ::core::option::Option<Argument>,
8620}
8621#[non_exhaustive]
8623#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8624pub struct RandomnessStateUpdate {
8625 #[prost(uint64, optional, tag = "1")]
8627 pub epoch: ::core::option::Option<u64>,
8628 #[prost(uint64, optional, tag = "2")]
8630 pub randomness_round: ::core::option::Option<u64>,
8631 #[prost(bytes = "bytes", optional, tag = "3")]
8633 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
8634 #[prost(uint64, optional, tag = "4")]
8636 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
8637}
8638#[non_exhaustive]
8640#[derive(Clone, PartialEq, ::prost::Message)]
8641pub struct ChangeEpoch {
8642 #[prost(uint64, optional, tag = "1")]
8644 pub epoch: ::core::option::Option<u64>,
8645 #[prost(uint64, optional, tag = "2")]
8647 pub protocol_version: ::core::option::Option<u64>,
8648 #[prost(uint64, optional, tag = "3")]
8650 pub storage_charge: ::core::option::Option<u64>,
8651 #[prost(uint64, optional, tag = "4")]
8653 pub computation_charge: ::core::option::Option<u64>,
8654 #[prost(uint64, optional, tag = "5")]
8656 pub storage_rebate: ::core::option::Option<u64>,
8657 #[prost(uint64, optional, tag = "6")]
8659 pub non_refundable_storage_fee: ::core::option::Option<u64>,
8660 #[prost(message, optional, tag = "7")]
8662 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8663 #[prost(message, repeated, tag = "8")]
8669 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
8670}
8671#[non_exhaustive]
8673#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8674pub struct SystemPackage {
8675 #[prost(uint64, optional, tag = "1")]
8677 pub version: ::core::option::Option<u64>,
8678 #[prost(bytes = "bytes", repeated, tag = "2")]
8680 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8681 #[prost(string, repeated, tag = "3")]
8683 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8684}
8685#[non_exhaustive]
8687#[derive(Clone, PartialEq, ::prost::Message)]
8688pub struct GenesisTransaction {
8689 #[prost(message, repeated, tag = "1")]
8691 pub objects: ::prost::alloc::vec::Vec<Object>,
8692}
8693#[non_exhaustive]
8697#[derive(Clone, PartialEq, ::prost::Message)]
8698pub struct ConsensusCommitPrologue {
8699 #[prost(uint64, optional, tag = "1")]
8703 pub epoch: ::core::option::Option<u64>,
8704 #[prost(uint64, optional, tag = "2")]
8708 pub round: ::core::option::Option<u64>,
8709 #[prost(message, optional, tag = "3")]
8713 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8714 #[prost(string, optional, tag = "4")]
8718 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
8719 #[prost(uint64, optional, tag = "5")]
8724 pub sub_dag_index: ::core::option::Option<u64>,
8725 #[prost(message, optional, tag = "6")]
8729 pub consensus_determined_version_assignments: ::core::option::Option<
8730 ConsensusDeterminedVersionAssignments,
8731 >,
8732 #[prost(string, optional, tag = "7")]
8737 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
8738}
8739#[non_exhaustive]
8741#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8742pub struct VersionAssignment {
8743 #[prost(string, optional, tag = "1")]
8745 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
8746 #[prost(uint64, optional, tag = "2")]
8748 pub start_version: ::core::option::Option<u64>,
8749 #[prost(uint64, optional, tag = "3")]
8751 pub version: ::core::option::Option<u64>,
8752}
8753#[non_exhaustive]
8755#[derive(Clone, PartialEq, ::prost::Message)]
8756pub struct CanceledTransaction {
8757 #[prost(string, optional, tag = "1")]
8759 pub digest: ::core::option::Option<::prost::alloc::string::String>,
8760 #[prost(message, repeated, tag = "2")]
8762 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
8763}
8764#[non_exhaustive]
8766#[derive(Clone, PartialEq, ::prost::Message)]
8767pub struct ConsensusDeterminedVersionAssignments {
8768 #[prost(int32, optional, tag = "1")]
8770 pub version: ::core::option::Option<i32>,
8771 #[prost(message, repeated, tag = "3")]
8773 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
8774}
8775#[non_exhaustive]
8777#[derive(Clone, PartialEq, ::prost::Message)]
8778pub struct AuthenticatorStateUpdate {
8779 #[prost(uint64, optional, tag = "1")]
8781 pub epoch: ::core::option::Option<u64>,
8782 #[prost(uint64, optional, tag = "2")]
8784 pub round: ::core::option::Option<u64>,
8785 #[prost(message, repeated, tag = "3")]
8787 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
8788 #[prost(uint64, optional, tag = "4")]
8790 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
8791}
8792#[non_exhaustive]
8794#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8795pub struct ActiveJwk {
8796 #[prost(message, optional, tag = "1")]
8798 pub id: ::core::option::Option<JwkId>,
8799 #[prost(message, optional, tag = "2")]
8801 pub jwk: ::core::option::Option<Jwk>,
8802 #[prost(uint64, optional, tag = "3")]
8804 pub epoch: ::core::option::Option<u64>,
8805}
8806#[non_exhaustive]
8809#[derive(Clone, PartialEq, ::prost::Message)]
8810pub struct EndOfEpochTransaction {
8811 #[prost(message, repeated, tag = "1")]
8812 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
8813}
8814#[non_exhaustive]
8816#[derive(Clone, PartialEq, ::prost::Message)]
8817pub struct EndOfEpochTransactionKind {
8818 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
8819 pub kind: ::core::option::Option<i32>,
8820 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
8821 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
8822}
8823pub mod end_of_epoch_transaction_kind {
8825 #[non_exhaustive]
8826 #[derive(
8827 Clone,
8828 Copy,
8829 Debug,
8830 PartialEq,
8831 Eq,
8832 Hash,
8833 PartialOrd,
8834 Ord,
8835 ::prost::Enumeration
8836 )]
8837 #[repr(i32)]
8838 pub enum Kind {
8839 Unknown = 0,
8840 ChangeEpoch = 1,
8842 AuthenticatorStateCreate = 2,
8844 AuthenticatorStateExpire = 3,
8846 RandomnessStateCreate = 4,
8848 DenyListStateCreate = 5,
8850 BridgeStateCreate = 6,
8852 BridgeCommitteeInit = 7,
8854 StoreExecutionTimeObservations = 8,
8856 AccumulatorRootCreate = 9,
8858 CoinRegistryCreate = 10,
8860 DisplayRegistryCreate = 11,
8862 AddressAliasStateCreate = 12,
8864 WriteAccumulatorStorageCost = 13,
8866 }
8867 impl Kind {
8868 pub fn as_str_name(&self) -> &'static str {
8873 match self {
8874 Self::Unknown => "KIND_UNKNOWN",
8875 Self::ChangeEpoch => "CHANGE_EPOCH",
8876 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
8877 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
8878 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
8879 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
8880 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
8881 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
8882 Self::StoreExecutionTimeObservations => {
8883 "STORE_EXECUTION_TIME_OBSERVATIONS"
8884 }
8885 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
8886 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
8887 Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
8888 Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
8889 Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
8890 }
8891 }
8892 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8894 match value {
8895 "KIND_UNKNOWN" => Some(Self::Unknown),
8896 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8897 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
8898 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
8899 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
8900 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
8901 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
8902 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
8903 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
8904 Some(Self::StoreExecutionTimeObservations)
8905 }
8906 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
8907 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
8908 "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
8909 "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
8910 "WRITE_ACCUMULATOR_STORAGE_COST" => {
8911 Some(Self::WriteAccumulatorStorageCost)
8912 }
8913 _ => None,
8914 }
8915 }
8916 }
8917 #[non_exhaustive]
8918 #[derive(Clone, PartialEq, ::prost::Oneof)]
8919 pub enum Data {
8920 #[prost(message, tag = "2")]
8922 ChangeEpoch(super::ChangeEpoch),
8923 #[prost(message, tag = "3")]
8925 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
8926 #[prost(message, tag = "4")]
8928 ExecutionTimeObservations(super::ExecutionTimeObservations),
8929 #[prost(string, tag = "5")]
8931 BridgeChainId(::prost::alloc::string::String),
8932 #[prost(uint64, tag = "6")]
8934 BridgeObjectVersion(u64),
8935 #[prost(uint64, tag = "7")]
8937 StorageCost(u64),
8938 }
8939}
8940#[non_exhaustive]
8942#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8943pub struct AuthenticatorStateExpire {
8944 #[prost(uint64, optional, tag = "1")]
8946 pub min_epoch: ::core::option::Option<u64>,
8947 #[prost(uint64, optional, tag = "2")]
8949 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
8950}
8951#[non_exhaustive]
8952#[derive(Clone, PartialEq, ::prost::Message)]
8953pub struct ExecutionTimeObservations {
8954 #[prost(int32, optional, tag = "1")]
8956 pub version: ::core::option::Option<i32>,
8957 #[prost(message, repeated, tag = "2")]
8958 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
8959}
8960#[non_exhaustive]
8961#[derive(Clone, PartialEq, ::prost::Message)]
8962pub struct ExecutionTimeObservation {
8963 #[prost(
8964 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
8965 optional,
8966 tag = "1"
8967 )]
8968 pub kind: ::core::option::Option<i32>,
8969 #[prost(message, optional, tag = "2")]
8970 pub move_entry_point: ::core::option::Option<MoveCall>,
8971 #[prost(message, repeated, tag = "3")]
8972 pub validator_observations: ::prost::alloc::vec::Vec<
8973 ValidatorExecutionTimeObservation,
8974 >,
8975}
8976pub mod execution_time_observation {
8978 #[non_exhaustive]
8979 #[derive(
8980 Clone,
8981 Copy,
8982 Debug,
8983 PartialEq,
8984 Eq,
8985 Hash,
8986 PartialOrd,
8987 Ord,
8988 ::prost::Enumeration
8989 )]
8990 #[repr(i32)]
8991 pub enum ExecutionTimeObservationKind {
8992 Unknown = 0,
8993 MoveEntryPoint = 1,
8994 TransferObjects = 2,
8995 SplitCoins = 3,
8996 MergeCoins = 4,
8997 Publish = 5,
8998 MakeMoveVector = 6,
8999 Upgrade = 7,
9000 }
9001 impl ExecutionTimeObservationKind {
9002 pub fn as_str_name(&self) -> &'static str {
9007 match self {
9008 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
9009 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
9010 Self::TransferObjects => "TRANSFER_OBJECTS",
9011 Self::SplitCoins => "SPLIT_COINS",
9012 Self::MergeCoins => "MERGE_COINS",
9013 Self::Publish => "PUBLISH",
9014 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
9015 Self::Upgrade => "UPGRADE",
9016 }
9017 }
9018 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9020 match value {
9021 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
9022 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
9023 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
9024 "SPLIT_COINS" => Some(Self::SplitCoins),
9025 "MERGE_COINS" => Some(Self::MergeCoins),
9026 "PUBLISH" => Some(Self::Publish),
9027 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
9028 "UPGRADE" => Some(Self::Upgrade),
9029 _ => None,
9030 }
9031 }
9032 }
9033}
9034#[non_exhaustive]
9035#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9036pub struct ValidatorExecutionTimeObservation {
9037 #[prost(bytes = "bytes", optional, tag = "1")]
9039 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
9040 #[prost(message, optional, tag = "2")]
9042 pub duration: ::core::option::Option<::prost_types::Duration>,
9043}
9044#[non_exhaustive]
9045#[derive(Clone, PartialEq, ::prost::Message)]
9046pub struct ExecuteTransactionRequest {
9047 #[prost(message, optional, tag = "1")]
9049 pub transaction: ::core::option::Option<Transaction>,
9050 #[prost(message, repeated, tag = "2")]
9053 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
9054 #[prost(message, optional, tag = "3")]
9057 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9058}
9059#[non_exhaustive]
9061#[derive(Clone, PartialEq, ::prost::Message)]
9062pub struct ExecuteTransactionResponse {
9063 #[prost(message, optional, tag = "1")]
9064 pub transaction: ::core::option::Option<ExecutedTransaction>,
9065}
9066#[non_exhaustive]
9067#[derive(Clone, PartialEq, ::prost::Message)]
9068pub struct SimulateTransactionRequest {
9069 #[prost(message, optional, tag = "1")]
9070 pub transaction: ::core::option::Option<Transaction>,
9071 #[prost(message, optional, tag = "2")]
9073 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9074 #[prost(
9076 enumeration = "simulate_transaction_request::TransactionChecks",
9077 optional,
9078 tag = "3"
9079 )]
9080 pub checks: ::core::option::Option<i32>,
9081 #[prost(bool, optional, tag = "4")]
9086 pub do_gas_selection: ::core::option::Option<bool>,
9087}
9088pub mod simulate_transaction_request {
9090 #[non_exhaustive]
9092 #[derive(
9093 Clone,
9094 Copy,
9095 Debug,
9096 PartialEq,
9097 Eq,
9098 Hash,
9099 PartialOrd,
9100 Ord,
9101 ::prost::Enumeration
9102 )]
9103 #[repr(i32)]
9104 pub enum TransactionChecks {
9105 Enabled = 0,
9106 Disabled = 1,
9107 }
9108 impl TransactionChecks {
9109 pub fn as_str_name(&self) -> &'static str {
9114 match self {
9115 Self::Enabled => "ENABLED",
9116 Self::Disabled => "DISABLED",
9117 }
9118 }
9119 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9121 match value {
9122 "ENABLED" => Some(Self::Enabled),
9123 "DISABLED" => Some(Self::Disabled),
9124 _ => None,
9125 }
9126 }
9127 }
9128}
9129#[non_exhaustive]
9130#[derive(Clone, PartialEq, ::prost::Message)]
9131pub struct SimulateTransactionResponse {
9132 #[prost(message, optional, tag = "1")]
9133 pub transaction: ::core::option::Option<ExecutedTransaction>,
9134 #[prost(message, repeated, tag = "2")]
9135 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
9136 #[prost(uint64, optional, tag = "3")]
9140 pub suggested_gas_price: ::core::option::Option<u64>,
9141}
9142#[non_exhaustive]
9144#[derive(Clone, PartialEq, ::prost::Message)]
9145pub struct CommandResult {
9146 #[prost(message, repeated, tag = "1")]
9147 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
9148 #[prost(message, repeated, tag = "2")]
9149 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
9150}
9151#[non_exhaustive]
9152#[derive(Clone, PartialEq, ::prost::Message)]
9153pub struct CommandOutput {
9154 #[prost(message, optional, tag = "1")]
9155 pub argument: ::core::option::Option<Argument>,
9156 #[prost(message, optional, tag = "2")]
9157 pub value: ::core::option::Option<Bcs>,
9158 #[prost(message, optional, boxed, tag = "3")]
9160 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
9161}
9162pub mod transaction_execution_service_client {
9164 #![allow(
9165 unused_variables,
9166 dead_code,
9167 missing_docs,
9168 clippy::wildcard_imports,
9169 clippy::let_unit_value,
9170 )]
9171 use tonic::codegen::*;
9172 use tonic::codegen::http::Uri;
9173 #[derive(Debug, Clone)]
9174 pub struct TransactionExecutionServiceClient<T> {
9175 inner: tonic::client::Grpc<T>,
9176 }
9177 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
9178 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9180 where
9181 D: TryInto<tonic::transport::Endpoint>,
9182 D::Error: Into<StdError>,
9183 {
9184 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9185 Ok(Self::new(conn))
9186 }
9187 }
9188 impl<T> TransactionExecutionServiceClient<T>
9189 where
9190 T: tonic::client::GrpcService<tonic::body::Body>,
9191 T::Error: Into<StdError>,
9192 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9193 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9194 {
9195 pub fn new(inner: T) -> Self {
9196 let inner = tonic::client::Grpc::new(inner);
9197 Self { inner }
9198 }
9199 pub fn with_origin(inner: T, origin: Uri) -> Self {
9200 let inner = tonic::client::Grpc::with_origin(inner, origin);
9201 Self { inner }
9202 }
9203 pub fn with_interceptor<F>(
9204 inner: T,
9205 interceptor: F,
9206 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
9207 where
9208 F: tonic::service::Interceptor,
9209 T::ResponseBody: Default,
9210 T: tonic::codegen::Service<
9211 http::Request<tonic::body::Body>,
9212 Response = http::Response<
9213 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9214 >,
9215 >,
9216 <T as tonic::codegen::Service<
9217 http::Request<tonic::body::Body>,
9218 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9219 {
9220 TransactionExecutionServiceClient::new(
9221 InterceptedService::new(inner, interceptor),
9222 )
9223 }
9224 #[must_use]
9229 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9230 self.inner = self.inner.send_compressed(encoding);
9231 self
9232 }
9233 #[must_use]
9235 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9236 self.inner = self.inner.accept_compressed(encoding);
9237 self
9238 }
9239 #[must_use]
9243 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9244 self.inner = self.inner.max_decoding_message_size(limit);
9245 self
9246 }
9247 #[must_use]
9251 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9252 self.inner = self.inner.max_encoding_message_size(limit);
9253 self
9254 }
9255 pub async fn execute_transaction(
9256 &mut self,
9257 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
9258 ) -> std::result::Result<
9259 tonic::Response<super::ExecuteTransactionResponse>,
9260 tonic::Status,
9261 > {
9262 self.inner
9263 .ready()
9264 .await
9265 .map_err(|e| {
9266 tonic::Status::unknown(
9267 format!("Service was not ready: {}", e.into()),
9268 )
9269 })?;
9270 let codec = tonic_prost::ProstCodec::default();
9271 let path = http::uri::PathAndQuery::from_static(
9272 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
9273 );
9274 let mut req = request.into_request();
9275 req.extensions_mut()
9276 .insert(
9277 GrpcMethod::new(
9278 "sui.rpc.v2.TransactionExecutionService",
9279 "ExecuteTransaction",
9280 ),
9281 );
9282 self.inner.unary(req, path, codec).await
9283 }
9284 pub async fn simulate_transaction(
9285 &mut self,
9286 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
9287 ) -> std::result::Result<
9288 tonic::Response<super::SimulateTransactionResponse>,
9289 tonic::Status,
9290 > {
9291 self.inner
9292 .ready()
9293 .await
9294 .map_err(|e| {
9295 tonic::Status::unknown(
9296 format!("Service was not ready: {}", e.into()),
9297 )
9298 })?;
9299 let codec = tonic_prost::ProstCodec::default();
9300 let path = http::uri::PathAndQuery::from_static(
9301 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
9302 );
9303 let mut req = request.into_request();
9304 req.extensions_mut()
9305 .insert(
9306 GrpcMethod::new(
9307 "sui.rpc.v2.TransactionExecutionService",
9308 "SimulateTransaction",
9309 ),
9310 );
9311 self.inner.unary(req, path, codec).await
9312 }
9313 }
9314}
9315pub mod transaction_execution_service_server {
9317 #![allow(
9318 unused_variables,
9319 dead_code,
9320 missing_docs,
9321 clippy::wildcard_imports,
9322 clippy::let_unit_value,
9323 )]
9324 use tonic::codegen::*;
9325 #[async_trait]
9327 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
9328 async fn execute_transaction(
9329 &self,
9330 request: tonic::Request<super::ExecuteTransactionRequest>,
9331 ) -> std::result::Result<
9332 tonic::Response<super::ExecuteTransactionResponse>,
9333 tonic::Status,
9334 > {
9335 Err(tonic::Status::unimplemented("Not yet implemented"))
9336 }
9337 async fn simulate_transaction(
9338 &self,
9339 request: tonic::Request<super::SimulateTransactionRequest>,
9340 ) -> std::result::Result<
9341 tonic::Response<super::SimulateTransactionResponse>,
9342 tonic::Status,
9343 > {
9344 Err(tonic::Status::unimplemented("Not yet implemented"))
9345 }
9346 }
9347 #[derive(Debug)]
9348 pub struct TransactionExecutionServiceServer<T> {
9349 inner: Arc<T>,
9350 accept_compression_encodings: EnabledCompressionEncodings,
9351 send_compression_encodings: EnabledCompressionEncodings,
9352 max_decoding_message_size: Option<usize>,
9353 max_encoding_message_size: Option<usize>,
9354 }
9355 impl<T> TransactionExecutionServiceServer<T> {
9356 pub fn new(inner: T) -> Self {
9357 Self::from_arc(Arc::new(inner))
9358 }
9359 pub fn from_arc(inner: Arc<T>) -> Self {
9360 Self {
9361 inner,
9362 accept_compression_encodings: Default::default(),
9363 send_compression_encodings: Default::default(),
9364 max_decoding_message_size: None,
9365 max_encoding_message_size: None,
9366 }
9367 }
9368 pub fn with_interceptor<F>(
9369 inner: T,
9370 interceptor: F,
9371 ) -> InterceptedService<Self, F>
9372 where
9373 F: tonic::service::Interceptor,
9374 {
9375 InterceptedService::new(Self::new(inner), interceptor)
9376 }
9377 #[must_use]
9379 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9380 self.accept_compression_encodings.enable(encoding);
9381 self
9382 }
9383 #[must_use]
9385 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9386 self.send_compression_encodings.enable(encoding);
9387 self
9388 }
9389 #[must_use]
9393 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9394 self.max_decoding_message_size = Some(limit);
9395 self
9396 }
9397 #[must_use]
9401 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9402 self.max_encoding_message_size = Some(limit);
9403 self
9404 }
9405 }
9406 impl<T, B> tonic::codegen::Service<http::Request<B>>
9407 for TransactionExecutionServiceServer<T>
9408 where
9409 T: TransactionExecutionService,
9410 B: Body + std::marker::Send + 'static,
9411 B::Error: Into<StdError> + std::marker::Send + 'static,
9412 {
9413 type Response = http::Response<tonic::body::Body>;
9414 type Error = std::convert::Infallible;
9415 type Future = BoxFuture<Self::Response, Self::Error>;
9416 fn poll_ready(
9417 &mut self,
9418 _cx: &mut Context<'_>,
9419 ) -> Poll<std::result::Result<(), Self::Error>> {
9420 Poll::Ready(Ok(()))
9421 }
9422 fn call(&mut self, req: http::Request<B>) -> Self::Future {
9423 match req.uri().path() {
9424 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
9425 #[allow(non_camel_case_types)]
9426 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
9427 pub Arc<T>,
9428 );
9429 impl<
9430 T: TransactionExecutionService,
9431 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
9432 for ExecuteTransactionSvc<T> {
9433 type Response = super::ExecuteTransactionResponse;
9434 type Future = BoxFuture<
9435 tonic::Response<Self::Response>,
9436 tonic::Status,
9437 >;
9438 fn call(
9439 &mut self,
9440 request: tonic::Request<super::ExecuteTransactionRequest>,
9441 ) -> Self::Future {
9442 let inner = Arc::clone(&self.0);
9443 let fut = async move {
9444 <T as TransactionExecutionService>::execute_transaction(
9445 &inner,
9446 request,
9447 )
9448 .await
9449 };
9450 Box::pin(fut)
9451 }
9452 }
9453 let accept_compression_encodings = self.accept_compression_encodings;
9454 let send_compression_encodings = self.send_compression_encodings;
9455 let max_decoding_message_size = self.max_decoding_message_size;
9456 let max_encoding_message_size = self.max_encoding_message_size;
9457 let inner = self.inner.clone();
9458 let fut = async move {
9459 let method = ExecuteTransactionSvc(inner);
9460 let codec = tonic_prost::ProstCodec::default();
9461 let mut grpc = tonic::server::Grpc::new(codec)
9462 .apply_compression_config(
9463 accept_compression_encodings,
9464 send_compression_encodings,
9465 )
9466 .apply_max_message_size_config(
9467 max_decoding_message_size,
9468 max_encoding_message_size,
9469 );
9470 let res = grpc.unary(method, req).await;
9471 Ok(res)
9472 };
9473 Box::pin(fut)
9474 }
9475 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
9476 #[allow(non_camel_case_types)]
9477 struct SimulateTransactionSvc<T: TransactionExecutionService>(
9478 pub Arc<T>,
9479 );
9480 impl<
9481 T: TransactionExecutionService,
9482 > tonic::server::UnaryService<super::SimulateTransactionRequest>
9483 for SimulateTransactionSvc<T> {
9484 type Response = super::SimulateTransactionResponse;
9485 type Future = BoxFuture<
9486 tonic::Response<Self::Response>,
9487 tonic::Status,
9488 >;
9489 fn call(
9490 &mut self,
9491 request: tonic::Request<super::SimulateTransactionRequest>,
9492 ) -> Self::Future {
9493 let inner = Arc::clone(&self.0);
9494 let fut = async move {
9495 <T as TransactionExecutionService>::simulate_transaction(
9496 &inner,
9497 request,
9498 )
9499 .await
9500 };
9501 Box::pin(fut)
9502 }
9503 }
9504 let accept_compression_encodings = self.accept_compression_encodings;
9505 let send_compression_encodings = self.send_compression_encodings;
9506 let max_decoding_message_size = self.max_decoding_message_size;
9507 let max_encoding_message_size = self.max_encoding_message_size;
9508 let inner = self.inner.clone();
9509 let fut = async move {
9510 let method = SimulateTransactionSvc(inner);
9511 let codec = tonic_prost::ProstCodec::default();
9512 let mut grpc = tonic::server::Grpc::new(codec)
9513 .apply_compression_config(
9514 accept_compression_encodings,
9515 send_compression_encodings,
9516 )
9517 .apply_max_message_size_config(
9518 max_decoding_message_size,
9519 max_encoding_message_size,
9520 );
9521 let res = grpc.unary(method, req).await;
9522 Ok(res)
9523 };
9524 Box::pin(fut)
9525 }
9526 _ => {
9527 Box::pin(async move {
9528 let mut response = http::Response::new(
9529 tonic::body::Body::default(),
9530 );
9531 let headers = response.headers_mut();
9532 headers
9533 .insert(
9534 tonic::Status::GRPC_STATUS,
9535 (tonic::Code::Unimplemented as i32).into(),
9536 );
9537 headers
9538 .insert(
9539 http::header::CONTENT_TYPE,
9540 tonic::metadata::GRPC_CONTENT_TYPE,
9541 );
9542 Ok(response)
9543 })
9544 }
9545 }
9546 }
9547 }
9548 impl<T> Clone for TransactionExecutionServiceServer<T> {
9549 fn clone(&self) -> Self {
9550 let inner = self.inner.clone();
9551 Self {
9552 inner,
9553 accept_compression_encodings: self.accept_compression_encodings,
9554 send_compression_encodings: self.send_compression_encodings,
9555 max_decoding_message_size: self.max_decoding_message_size,
9556 max_encoding_message_size: self.max_encoding_message_size,
9557 }
9558 }
9559 }
9560 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
9562 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
9563 const NAME: &'static str = SERVICE_NAME;
9564 }
9565}