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}
846#[non_exhaustive]
847#[derive(Clone, PartialEq, ::prost::Message)]
848pub struct ExecutedTransaction {
849 #[prost(string, optional, tag = "1")]
851 pub digest: ::core::option::Option<::prost::alloc::string::String>,
852 #[prost(message, optional, tag = "2")]
854 pub transaction: ::core::option::Option<Transaction>,
855 #[prost(message, repeated, tag = "3")]
858 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
859 #[prost(message, optional, tag = "4")]
861 pub effects: ::core::option::Option<TransactionEffects>,
862 #[prost(message, optional, tag = "5")]
869 pub events: ::core::option::Option<TransactionEvents>,
870 #[prost(uint64, optional, tag = "6")]
872 pub checkpoint: ::core::option::Option<u64>,
873 #[prost(message, optional, tag = "7")]
875 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
876 #[prost(message, repeated, tag = "8")]
877 pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
878 #[prost(message, optional, tag = "9")]
881 pub objects: ::core::option::Option<ObjectSet>,
882}
883#[non_exhaustive]
885#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
886pub struct ExecutionStatus {
887 #[prost(bool, optional, tag = "1")]
889 pub success: ::core::option::Option<bool>,
890 #[prost(message, optional, tag = "2")]
892 pub error: ::core::option::Option<ExecutionError>,
893}
894#[non_exhaustive]
896#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
897pub struct ExecutionError {
898 #[prost(string, optional, tag = "1")]
900 pub description: ::core::option::Option<::prost::alloc::string::String>,
901 #[prost(uint64, optional, tag = "2")]
903 pub command: ::core::option::Option<u64>,
904 #[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
905 pub kind: ::core::option::Option<i32>,
906 #[prost(
907 oneof = "execution_error::ErrorDetails",
908 tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
909 )]
910 pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
911}
912pub mod execution_error {
914 #[non_exhaustive]
915 #[derive(
916 Clone,
917 Copy,
918 Debug,
919 PartialEq,
920 Eq,
921 Hash,
922 PartialOrd,
923 Ord,
924 ::prost::Enumeration
925 )]
926 #[repr(i32)]
927 pub enum ExecutionErrorKind {
928 Unknown = 0,
929 InsufficientGas = 1,
931 InvalidGasObject = 2,
933 InvariantViolation = 3,
935 FeatureNotYetSupported = 4,
937 ObjectTooBig = 5,
939 PackageTooBig = 6,
941 CircularObjectOwnership = 7,
943 InsufficientCoinBalance = 8,
945 CoinBalanceOverflow = 9,
947 PublishErrorNonZeroAddress = 10,
950 SuiMoveVerificationError = 11,
952 MovePrimitiveRuntimeError = 12,
956 MoveAbort = 13,
958 VmVerificationOrDeserializationError = 14,
960 VmInvariantViolation = 15,
962 FunctionNotFound = 16,
964 ArityMismatch = 17,
967 TypeArityMismatch = 18,
970 NonEntryFunctionInvoked = 19,
972 CommandArgumentError = 20,
974 TypeArgumentError = 21,
976 UnusedValueWithoutDrop = 22,
978 InvalidPublicFunctionReturnType = 23,
981 InvalidTransferObject = 24,
983 EffectsTooLarge = 25,
985 PublishUpgradeMissingDependency = 26,
987 PublishUpgradeDependencyDowngrade = 27,
993 PackageUpgradeError = 28,
995 WrittenObjectsTooLarge = 29,
997 CertificateDenied = 30,
999 SuiMoveVerificationTimedout = 31,
1001 ConsensusObjectOperationNotAllowed = 32,
1003 InputObjectDeleted = 33,
1005 ExecutionCanceledDueToConsensusObjectCongestion = 34,
1007 AddressDeniedForCoin = 35,
1009 CoinTypeGlobalPause = 36,
1011 ExecutionCanceledDueToRandomnessUnavailable = 37,
1013 MoveVectorElemTooBig = 38,
1017 MoveRawValueTooBig = 39,
1021 InvalidLinkage = 40,
1023 InsufficientFundsForWithdraw = 41,
1025 NonExclusiveWriteInputObjectModified = 42,
1027 }
1028 impl ExecutionErrorKind {
1029 pub fn as_str_name(&self) -> &'static str {
1034 match self {
1035 Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
1036 Self::InsufficientGas => "INSUFFICIENT_GAS",
1037 Self::InvalidGasObject => "INVALID_GAS_OBJECT",
1038 Self::InvariantViolation => "INVARIANT_VIOLATION",
1039 Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
1040 Self::ObjectTooBig => "OBJECT_TOO_BIG",
1041 Self::PackageTooBig => "PACKAGE_TOO_BIG",
1042 Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
1043 Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
1044 Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
1045 Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
1046 Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
1047 Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
1048 Self::MoveAbort => "MOVE_ABORT",
1049 Self::VmVerificationOrDeserializationError => {
1050 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
1051 }
1052 Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
1053 Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
1054 Self::ArityMismatch => "ARITY_MISMATCH",
1055 Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
1056 Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
1057 Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
1058 Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
1059 Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
1060 Self::InvalidPublicFunctionReturnType => {
1061 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
1062 }
1063 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1064 Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
1065 Self::PublishUpgradeMissingDependency => {
1066 "PUBLISH_UPGRADE_MISSING_DEPENDENCY"
1067 }
1068 Self::PublishUpgradeDependencyDowngrade => {
1069 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
1070 }
1071 Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
1072 Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
1073 Self::CertificateDenied => "CERTIFICATE_DENIED",
1074 Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
1075 Self::ConsensusObjectOperationNotAllowed => {
1076 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1077 }
1078 Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
1079 Self::ExecutionCanceledDueToConsensusObjectCongestion => {
1080 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION"
1081 }
1082 Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
1083 Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
1084 Self::ExecutionCanceledDueToRandomnessUnavailable => {
1085 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
1086 }
1087 Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
1088 Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
1089 Self::InvalidLinkage => "INVALID_LINKAGE",
1090 Self::InsufficientFundsForWithdraw => "INSUFFICIENT_FUNDS_FOR_WITHDRAW",
1091 Self::NonExclusiveWriteInputObjectModified => {
1092 "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED"
1093 }
1094 }
1095 }
1096 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1098 match value {
1099 "EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1100 "INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
1101 "INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
1102 "INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
1103 "FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
1104 "OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
1105 "PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
1106 "CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
1107 "INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
1108 "COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
1109 "PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
1110 Some(Self::PublishErrorNonZeroAddress)
1111 }
1112 "SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
1113 "MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
1114 "MOVE_ABORT" => Some(Self::MoveAbort),
1115 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
1116 Some(Self::VmVerificationOrDeserializationError)
1117 }
1118 "VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
1119 "FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
1120 "ARITY_MISMATCH" => Some(Self::ArityMismatch),
1121 "TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
1122 "NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
1123 "COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
1124 "TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
1125 "UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
1126 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
1127 Some(Self::InvalidPublicFunctionReturnType)
1128 }
1129 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1130 "EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
1131 "PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
1132 Some(Self::PublishUpgradeMissingDependency)
1133 }
1134 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
1135 Some(Self::PublishUpgradeDependencyDowngrade)
1136 }
1137 "PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
1138 "WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
1139 "CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
1140 "SUI_MOVE_VERIFICATION_TIMEDOUT" => {
1141 Some(Self::SuiMoveVerificationTimedout)
1142 }
1143 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1144 Some(Self::ConsensusObjectOperationNotAllowed)
1145 }
1146 "INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
1147 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION" => {
1148 Some(Self::ExecutionCanceledDueToConsensusObjectCongestion)
1149 }
1150 "ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
1151 "COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
1152 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
1153 Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
1154 }
1155 "MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
1156 "MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
1157 "INVALID_LINKAGE" => Some(Self::InvalidLinkage),
1158 "INSUFFICIENT_FUNDS_FOR_WITHDRAW" => {
1159 Some(Self::InsufficientFundsForWithdraw)
1160 }
1161 "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED" => {
1162 Some(Self::NonExclusiveWriteInputObjectModified)
1163 }
1164 _ => None,
1165 }
1166 }
1167 }
1168 #[non_exhaustive]
1169 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1170 pub enum ErrorDetails {
1171 #[prost(message, tag = "4")]
1172 Abort(super::MoveAbort),
1173 #[prost(message, tag = "5")]
1174 SizeError(super::SizeError),
1175 #[prost(message, tag = "6")]
1176 CommandArgumentError(super::CommandArgumentError),
1177 #[prost(message, tag = "7")]
1178 TypeArgumentError(super::TypeArgumentError),
1179 #[prost(message, tag = "8")]
1180 PackageUpgradeError(super::PackageUpgradeError),
1181 #[prost(message, tag = "9")]
1182 IndexError(super::IndexError),
1183 #[prost(string, tag = "10")]
1184 ObjectId(::prost::alloc::string::String),
1185 #[prost(message, tag = "11")]
1186 CoinDenyListError(super::CoinDenyListError),
1187 #[prost(message, tag = "12")]
1189 CongestedObjects(super::CongestedObjects),
1190 }
1191}
1192#[non_exhaustive]
1193#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1194pub struct MoveAbort {
1195 #[prost(uint64, optional, tag = "1")]
1196 pub abort_code: ::core::option::Option<u64>,
1197 #[prost(message, optional, tag = "2")]
1199 pub location: ::core::option::Option<MoveLocation>,
1200 #[prost(message, optional, tag = "3")]
1202 pub clever_error: ::core::option::Option<CleverError>,
1203}
1204#[non_exhaustive]
1206#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1207pub struct MoveLocation {
1208 #[prost(string, optional, tag = "1")]
1210 pub package: ::core::option::Option<::prost::alloc::string::String>,
1211 #[prost(string, optional, tag = "2")]
1213 pub module: ::core::option::Option<::prost::alloc::string::String>,
1214 #[prost(uint32, optional, tag = "3")]
1216 pub function: ::core::option::Option<u32>,
1217 #[prost(uint32, optional, tag = "4")]
1219 pub instruction: ::core::option::Option<u32>,
1220 #[prost(string, optional, tag = "5")]
1222 pub function_name: ::core::option::Option<::prost::alloc::string::String>,
1223}
1224#[non_exhaustive]
1225#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1226pub struct CleverError {
1227 #[prost(uint64, optional, tag = "1")]
1228 pub error_code: ::core::option::Option<u64>,
1229 #[prost(uint64, optional, tag = "2")]
1230 pub line_number: ::core::option::Option<u64>,
1231 #[prost(string, optional, tag = "3")]
1232 pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
1233 #[prost(string, optional, tag = "4")]
1234 pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
1235 #[prost(oneof = "clever_error::Value", tags = "5, 6")]
1236 pub value: ::core::option::Option<clever_error::Value>,
1237}
1238pub mod clever_error {
1240 #[non_exhaustive]
1241 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1242 pub enum Value {
1243 #[prost(string, tag = "5")]
1244 Rendered(::prost::alloc::string::String),
1245 #[prost(bytes, tag = "6")]
1246 Raw(::prost::bytes::Bytes),
1247 }
1248}
1249#[non_exhaustive]
1251#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1252pub struct SizeError {
1253 #[prost(uint64, optional, tag = "1")]
1255 pub size: ::core::option::Option<u64>,
1256 #[prost(uint64, optional, tag = "2")]
1258 pub max_size: ::core::option::Option<u64>,
1259}
1260#[non_exhaustive]
1261#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1262pub struct IndexError {
1263 #[prost(uint32, optional, tag = "1")]
1265 pub index: ::core::option::Option<u32>,
1266 #[prost(uint32, optional, tag = "2")]
1268 pub subresult: ::core::option::Option<u32>,
1269}
1270#[non_exhaustive]
1271#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1272pub struct CoinDenyListError {
1273 #[prost(string, optional, tag = "1")]
1275 pub address: ::core::option::Option<::prost::alloc::string::String>,
1276 #[prost(string, optional, tag = "2")]
1278 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1279}
1280#[non_exhaustive]
1282#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1283pub struct CongestedObjects {
1284 #[prost(string, repeated, tag = "1")]
1285 pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1286}
1287#[non_exhaustive]
1289#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1290pub struct CommandArgumentError {
1291 #[prost(uint32, optional, tag = "1")]
1293 pub argument: ::core::option::Option<u32>,
1294 #[prost(
1295 enumeration = "command_argument_error::CommandArgumentErrorKind",
1296 optional,
1297 tag = "2"
1298 )]
1299 pub kind: ::core::option::Option<i32>,
1300 #[prost(message, optional, tag = "3")]
1301 pub index_error: ::core::option::Option<IndexError>,
1302}
1303pub mod command_argument_error {
1305 #[non_exhaustive]
1306 #[derive(
1307 Clone,
1308 Copy,
1309 Debug,
1310 PartialEq,
1311 Eq,
1312 Hash,
1313 PartialOrd,
1314 Ord,
1315 ::prost::Enumeration
1316 )]
1317 #[repr(i32)]
1318 pub enum CommandArgumentErrorKind {
1319 Unknown = 0,
1320 TypeMismatch = 1,
1322 InvalidBcsBytes = 2,
1324 InvalidUsageOfPureArgument = 3,
1326 InvalidArgumentToPrivateEntryFunction = 4,
1329 IndexOutOfBounds = 5,
1333 SecondaryIndexOutOfBounds = 6,
1337 InvalidResultArity = 7,
1341 InvalidGasCoinUsage = 8,
1344 InvalidValueUsage = 9,
1349 InvalidObjectByValue = 10,
1351 InvalidObjectByMutRef = 11,
1353 ConsensusObjectOperationNotAllowed = 12,
1356 InvalidArgumentArity = 13,
1359 InvalidTransferObject = 14,
1361 InvalidMakeMoveVecNonObjectArgument = 15,
1364 ArgumentWithoutValue = 16,
1366 CannotMoveBorrowedValue = 17,
1371 CannotWriteToExtendedReference = 18,
1375 InvalidReferenceArgument = 19,
1379 }
1380 impl CommandArgumentErrorKind {
1381 pub fn as_str_name(&self) -> &'static str {
1386 match self {
1387 Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1388 Self::TypeMismatch => "TYPE_MISMATCH",
1389 Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1390 Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1391 Self::InvalidArgumentToPrivateEntryFunction => {
1392 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1393 }
1394 Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1395 Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1396 Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1397 Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1398 Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1399 Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1400 Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1401 Self::ConsensusObjectOperationNotAllowed => {
1402 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1403 }
1404 Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1405 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1406 Self::InvalidMakeMoveVecNonObjectArgument => {
1407 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1408 }
1409 Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1410 Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1411 Self::CannotWriteToExtendedReference => {
1412 "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1413 }
1414 Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1415 }
1416 }
1417 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1419 match value {
1420 "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1421 "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1422 "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1423 "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1424 Some(Self::InvalidUsageOfPureArgument)
1425 }
1426 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1427 Some(Self::InvalidArgumentToPrivateEntryFunction)
1428 }
1429 "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1430 "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1431 "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1432 "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1433 "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1434 "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1435 "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1436 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1437 Some(Self::ConsensusObjectOperationNotAllowed)
1438 }
1439 "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1440 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1441 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1442 Some(Self::InvalidMakeMoveVecNonObjectArgument)
1443 }
1444 "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1445 "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1446 "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1447 Some(Self::CannotWriteToExtendedReference)
1448 }
1449 "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1450 _ => None,
1451 }
1452 }
1453 }
1454}
1455#[non_exhaustive]
1457#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1458pub struct PackageUpgradeError {
1459 #[prost(
1460 enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1461 optional,
1462 tag = "1"
1463 )]
1464 pub kind: ::core::option::Option<i32>,
1465 #[prost(string, optional, tag = "2")]
1467 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1468 #[prost(string, optional, tag = "3")]
1470 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1471 #[prost(uint32, optional, tag = "4")]
1473 pub policy: ::core::option::Option<u32>,
1474 #[prost(string, optional, tag = "5")]
1476 pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1477}
1478pub mod package_upgrade_error {
1480 #[non_exhaustive]
1481 #[derive(
1482 Clone,
1483 Copy,
1484 Debug,
1485 PartialEq,
1486 Eq,
1487 Hash,
1488 PartialOrd,
1489 Ord,
1490 ::prost::Enumeration
1491 )]
1492 #[repr(i32)]
1493 pub enum PackageUpgradeErrorKind {
1494 Unknown = 0,
1495 UnableToFetchPackage = 1,
1497 NotAPackage = 2,
1499 IncompatibleUpgrade = 3,
1501 DigestDoesNotMatch = 4,
1503 UnknownUpgradePolicy = 5,
1505 PackageIdDoesNotMatch = 6,
1507 }
1508 impl PackageUpgradeErrorKind {
1509 pub fn as_str_name(&self) -> &'static str {
1514 match self {
1515 Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1516 Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1517 Self::NotAPackage => "NOT_A_PACKAGE",
1518 Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1519 Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1520 Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1521 Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1522 }
1523 }
1524 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1526 match value {
1527 "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1528 "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1529 "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1530 "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1531 "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1532 "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1533 "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1534 _ => None,
1535 }
1536 }
1537 }
1538}
1539#[non_exhaustive]
1541#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1542pub struct TypeArgumentError {
1543 #[prost(uint32, optional, tag = "1")]
1545 pub type_argument: ::core::option::Option<u32>,
1546 #[prost(
1547 enumeration = "type_argument_error::TypeArgumentErrorKind",
1548 optional,
1549 tag = "2"
1550 )]
1551 pub kind: ::core::option::Option<i32>,
1552}
1553pub mod type_argument_error {
1555 #[non_exhaustive]
1556 #[derive(
1557 Clone,
1558 Copy,
1559 Debug,
1560 PartialEq,
1561 Eq,
1562 Hash,
1563 PartialOrd,
1564 Ord,
1565 ::prost::Enumeration
1566 )]
1567 #[repr(i32)]
1568 pub enum TypeArgumentErrorKind {
1569 Unknown = 0,
1570 TypeNotFound = 1,
1572 ConstraintNotSatisfied = 2,
1574 }
1575 impl TypeArgumentErrorKind {
1576 pub fn as_str_name(&self) -> &'static str {
1581 match self {
1582 Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1583 Self::TypeNotFound => "TYPE_NOT_FOUND",
1584 Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1585 }
1586 }
1587 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1589 match value {
1590 "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1591 "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1592 "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1593 _ => None,
1594 }
1595 }
1596 }
1597}
1598#[non_exhaustive]
1600#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1601pub struct GasCostSummary {
1602 #[prost(uint64, optional, tag = "1")]
1604 pub computation_cost: ::core::option::Option<u64>,
1605 #[prost(uint64, optional, tag = "2")]
1607 pub storage_cost: ::core::option::Option<u64>,
1608 #[prost(uint64, optional, tag = "3")]
1611 pub storage_rebate: ::core::option::Option<u64>,
1612 #[prost(uint64, optional, tag = "4")]
1614 pub non_refundable_storage_fee: ::core::option::Option<u64>,
1615}
1616#[non_exhaustive]
1618#[derive(Clone, PartialEq, ::prost::Message)]
1619pub struct Input {
1620 #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1621 pub kind: ::core::option::Option<i32>,
1622 #[prost(bytes = "bytes", optional, tag = "2")]
1627 pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1628 #[prost(string, optional, tag = "3")]
1630 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1631 #[prost(uint64, optional, tag = "4")]
1635 pub version: ::core::option::Option<u64>,
1636 #[prost(string, optional, tag = "5")]
1638 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1639 #[prost(bool, optional, tag = "6")]
1642 pub mutable: ::core::option::Option<bool>,
1643 #[prost(enumeration = "input::Mutability", optional, tag = "7")]
1648 pub mutability: ::core::option::Option<i32>,
1649 #[prost(message, optional, tag = "8")]
1651 pub funds_withdrawal: ::core::option::Option<FundsWithdrawal>,
1652 #[prost(message, optional, boxed, tag = "1000")]
1656 pub literal: ::core::option::Option<
1657 ::prost::alloc::boxed::Box<::prost_types::Value>,
1658 >,
1659}
1660pub mod input {
1662 #[non_exhaustive]
1663 #[derive(
1664 Clone,
1665 Copy,
1666 Debug,
1667 PartialEq,
1668 Eq,
1669 Hash,
1670 PartialOrd,
1671 Ord,
1672 ::prost::Enumeration
1673 )]
1674 #[repr(i32)]
1675 pub enum InputKind {
1676 Unknown = 0,
1677 Pure = 1,
1679 ImmutableOrOwned = 2,
1681 Shared = 3,
1683 Receiving = 4,
1685 FundsWithdrawal = 5,
1687 }
1688 impl InputKind {
1689 pub fn as_str_name(&self) -> &'static str {
1694 match self {
1695 Self::Unknown => "INPUT_KIND_UNKNOWN",
1696 Self::Pure => "PURE",
1697 Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
1698 Self::Shared => "SHARED",
1699 Self::Receiving => "RECEIVING",
1700 Self::FundsWithdrawal => "FUNDS_WITHDRAWAL",
1701 }
1702 }
1703 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1705 match value {
1706 "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
1707 "PURE" => Some(Self::Pure),
1708 "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
1709 "SHARED" => Some(Self::Shared),
1710 "RECEIVING" => Some(Self::Receiving),
1711 "FUNDS_WITHDRAWAL" => Some(Self::FundsWithdrawal),
1712 _ => None,
1713 }
1714 }
1715 }
1716 #[non_exhaustive]
1717 #[derive(
1718 Clone,
1719 Copy,
1720 Debug,
1721 PartialEq,
1722 Eq,
1723 Hash,
1724 PartialOrd,
1725 Ord,
1726 ::prost::Enumeration
1727 )]
1728 #[repr(i32)]
1729 pub enum Mutability {
1730 Unknown = 0,
1731 Immutable = 1,
1732 Mutable = 2,
1733 NonExclusiveWrite = 3,
1737 }
1738 impl Mutability {
1739 pub fn as_str_name(&self) -> &'static str {
1744 match self {
1745 Self::Unknown => "MUTABILITY_UNKNOWN",
1746 Self::Immutable => "IMMUTABLE",
1747 Self::Mutable => "MUTABLE",
1748 Self::NonExclusiveWrite => "NON_EXCLUSIVE_WRITE",
1749 }
1750 }
1751 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1753 match value {
1754 "MUTABILITY_UNKNOWN" => Some(Self::Unknown),
1755 "IMMUTABLE" => Some(Self::Immutable),
1756 "MUTABLE" => Some(Self::Mutable),
1757 "NON_EXCLUSIVE_WRITE" => Some(Self::NonExclusiveWrite),
1758 _ => None,
1759 }
1760 }
1761 }
1762}
1763#[non_exhaustive]
1764#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1765pub struct FundsWithdrawal {
1766 #[prost(uint64, optional, tag = "1")]
1767 pub amount: ::core::option::Option<u64>,
1768 #[prost(string, optional, tag = "2")]
1769 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1770 #[prost(enumeration = "funds_withdrawal::Source", optional, tag = "3")]
1771 pub source: ::core::option::Option<i32>,
1772}
1773pub mod funds_withdrawal {
1775 #[non_exhaustive]
1776 #[derive(
1777 Clone,
1778 Copy,
1779 Debug,
1780 PartialEq,
1781 Eq,
1782 Hash,
1783 PartialOrd,
1784 Ord,
1785 ::prost::Enumeration
1786 )]
1787 #[repr(i32)]
1788 pub enum Source {
1789 Unknown = 0,
1790 Sender = 1,
1791 Sponsor = 2,
1792 }
1793 impl Source {
1794 pub fn as_str_name(&self) -> &'static str {
1799 match self {
1800 Self::Unknown => "SOURCE_UNKNOWN",
1801 Self::Sender => "SENDER",
1802 Self::Sponsor => "SPONSOR",
1803 }
1804 }
1805 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1807 match value {
1808 "SOURCE_UNKNOWN" => Some(Self::Unknown),
1809 "SENDER" => Some(Self::Sender),
1810 "SPONSOR" => Some(Self::Sponsor),
1811 _ => None,
1812 }
1813 }
1814 }
1815}
1816#[non_exhaustive]
1818#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1819pub struct JwkId {
1820 #[prost(string, optional, tag = "1")]
1822 pub iss: ::core::option::Option<::prost::alloc::string::String>,
1823 #[prost(string, optional, tag = "2")]
1825 pub kid: ::core::option::Option<::prost::alloc::string::String>,
1826}
1827#[non_exhaustive]
1833#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1834pub struct Jwk {
1835 #[prost(string, optional, tag = "1")]
1837 pub kty: ::core::option::Option<::prost::alloc::string::String>,
1838 #[prost(string, optional, tag = "2")]
1840 pub e: ::core::option::Option<::prost::alloc::string::String>,
1841 #[prost(string, optional, tag = "3")]
1843 pub n: ::core::option::Option<::prost::alloc::string::String>,
1844 #[prost(string, optional, tag = "4")]
1846 pub alg: ::core::option::Option<::prost::alloc::string::String>,
1847}
1848#[non_exhaustive]
1849#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1850pub struct GetServiceInfoRequest {}
1851#[non_exhaustive]
1852#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1853pub struct GetServiceInfoResponse {
1854 #[prost(string, optional, tag = "1")]
1859 pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
1860 #[prost(string, optional, tag = "2")]
1864 pub chain: ::core::option::Option<::prost::alloc::string::String>,
1865 #[prost(uint64, optional, tag = "3")]
1867 pub epoch: ::core::option::Option<u64>,
1868 #[prost(uint64, optional, tag = "4")]
1870 pub checkpoint_height: ::core::option::Option<u64>,
1871 #[prost(message, optional, tag = "5")]
1873 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
1874 #[prost(uint64, optional, tag = "6")]
1876 pub lowest_available_checkpoint: ::core::option::Option<u64>,
1877 #[prost(uint64, optional, tag = "7")]
1879 pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
1880 #[prost(string, optional, tag = "8")]
1882 pub server: ::core::option::Option<::prost::alloc::string::String>,
1883}
1884#[non_exhaustive]
1885#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1886pub struct GetObjectRequest {
1887 #[prost(string, optional, tag = "1")]
1889 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1890 #[prost(uint64, optional, tag = "2")]
1894 pub version: ::core::option::Option<u64>,
1895 #[prost(message, optional, tag = "3")]
1898 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1899}
1900#[non_exhaustive]
1901#[derive(Clone, PartialEq, ::prost::Message)]
1902pub struct GetObjectResponse {
1903 #[prost(message, optional, tag = "1")]
1904 pub object: ::core::option::Option<Object>,
1905}
1906#[non_exhaustive]
1907#[derive(Clone, PartialEq, ::prost::Message)]
1908pub struct BatchGetObjectsRequest {
1909 #[prost(message, repeated, tag = "1")]
1910 pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
1911 #[prost(message, optional, tag = "2")]
1914 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1915}
1916#[non_exhaustive]
1917#[derive(Clone, PartialEq, ::prost::Message)]
1918pub struct BatchGetObjectsResponse {
1919 #[prost(message, repeated, tag = "1")]
1920 pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
1921}
1922#[non_exhaustive]
1923#[derive(Clone, PartialEq, ::prost::Message)]
1924pub struct GetObjectResult {
1925 #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
1926 pub result: ::core::option::Option<get_object_result::Result>,
1927}
1928pub mod get_object_result {
1930 #[non_exhaustive]
1931 #[derive(Clone, PartialEq, ::prost::Oneof)]
1932 pub enum Result {
1933 #[prost(message, tag = "1")]
1934 Object(super::Object),
1935 #[prost(message, tag = "2")]
1936 Error(super::super::super::super::google::rpc::Status),
1937 }
1938}
1939#[non_exhaustive]
1940#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1941pub struct GetTransactionRequest {
1942 #[prost(string, optional, tag = "1")]
1944 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1945 #[prost(message, optional, tag = "2")]
1948 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1949}
1950#[non_exhaustive]
1951#[derive(Clone, PartialEq, ::prost::Message)]
1952pub struct GetTransactionResponse {
1953 #[prost(message, optional, tag = "1")]
1954 pub transaction: ::core::option::Option<ExecutedTransaction>,
1955}
1956#[non_exhaustive]
1957#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1958pub struct BatchGetTransactionsRequest {
1959 #[prost(string, repeated, tag = "1")]
1961 pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1962 #[prost(message, optional, tag = "2")]
1965 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1966}
1967#[non_exhaustive]
1968#[derive(Clone, PartialEq, ::prost::Message)]
1969pub struct BatchGetTransactionsResponse {
1970 #[prost(message, repeated, tag = "1")]
1971 pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
1972}
1973#[non_exhaustive]
1974#[derive(Clone, PartialEq, ::prost::Message)]
1975pub struct GetTransactionResult {
1976 #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
1977 pub result: ::core::option::Option<get_transaction_result::Result>,
1978}
1979pub mod get_transaction_result {
1981 #[non_exhaustive]
1982 #[derive(Clone, PartialEq, ::prost::Oneof)]
1983 pub enum Result {
1984 #[prost(message, tag = "1")]
1985 Transaction(super::ExecutedTransaction),
1986 #[prost(message, tag = "2")]
1987 Error(super::super::super::super::google::rpc::Status),
1988 }
1989}
1990#[non_exhaustive]
1991#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1992pub struct GetCheckpointRequest {
1993 #[prost(message, optional, tag = "3")]
1996 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1997 #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
1999 pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
2000}
2001pub mod get_checkpoint_request {
2003 #[non_exhaustive]
2005 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2006 pub enum CheckpointId {
2007 #[prost(uint64, tag = "1")]
2009 SequenceNumber(u64),
2010 #[prost(string, tag = "2")]
2012 Digest(::prost::alloc::string::String),
2013 }
2014}
2015#[non_exhaustive]
2016#[derive(Clone, PartialEq, ::prost::Message)]
2017pub struct GetCheckpointResponse {
2018 #[prost(message, optional, tag = "1")]
2019 pub checkpoint: ::core::option::Option<Checkpoint>,
2020}
2021#[non_exhaustive]
2022#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2023pub struct GetEpochRequest {
2024 #[prost(uint64, optional, tag = "1")]
2027 pub epoch: ::core::option::Option<u64>,
2028 #[prost(message, optional, tag = "2")]
2031 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2032}
2033#[non_exhaustive]
2034#[derive(Clone, PartialEq, ::prost::Message)]
2035pub struct GetEpochResponse {
2036 #[prost(message, optional, tag = "1")]
2037 pub epoch: ::core::option::Option<Epoch>,
2038}
2039pub mod ledger_service_client {
2041 #![allow(
2042 unused_variables,
2043 dead_code,
2044 missing_docs,
2045 clippy::wildcard_imports,
2046 clippy::let_unit_value,
2047 )]
2048 use tonic::codegen::*;
2049 use tonic::codegen::http::Uri;
2050 #[derive(Debug, Clone)]
2051 pub struct LedgerServiceClient<T> {
2052 inner: tonic::client::Grpc<T>,
2053 }
2054 impl LedgerServiceClient<tonic::transport::Channel> {
2055 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2057 where
2058 D: TryInto<tonic::transport::Endpoint>,
2059 D::Error: Into<StdError>,
2060 {
2061 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2062 Ok(Self::new(conn))
2063 }
2064 }
2065 impl<T> LedgerServiceClient<T>
2066 where
2067 T: tonic::client::GrpcService<tonic::body::Body>,
2068 T::Error: Into<StdError>,
2069 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2070 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2071 {
2072 pub fn new(inner: T) -> Self {
2073 let inner = tonic::client::Grpc::new(inner);
2074 Self { inner }
2075 }
2076 pub fn with_origin(inner: T, origin: Uri) -> Self {
2077 let inner = tonic::client::Grpc::with_origin(inner, origin);
2078 Self { inner }
2079 }
2080 pub fn with_interceptor<F>(
2081 inner: T,
2082 interceptor: F,
2083 ) -> LedgerServiceClient<InterceptedService<T, F>>
2084 where
2085 F: tonic::service::Interceptor,
2086 T::ResponseBody: Default,
2087 T: tonic::codegen::Service<
2088 http::Request<tonic::body::Body>,
2089 Response = http::Response<
2090 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2091 >,
2092 >,
2093 <T as tonic::codegen::Service<
2094 http::Request<tonic::body::Body>,
2095 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2096 {
2097 LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
2098 }
2099 #[must_use]
2104 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2105 self.inner = self.inner.send_compressed(encoding);
2106 self
2107 }
2108 #[must_use]
2110 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2111 self.inner = self.inner.accept_compressed(encoding);
2112 self
2113 }
2114 #[must_use]
2118 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2119 self.inner = self.inner.max_decoding_message_size(limit);
2120 self
2121 }
2122 #[must_use]
2126 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2127 self.inner = self.inner.max_encoding_message_size(limit);
2128 self
2129 }
2130 pub async fn get_service_info(
2132 &mut self,
2133 request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
2134 ) -> std::result::Result<
2135 tonic::Response<super::GetServiceInfoResponse>,
2136 tonic::Status,
2137 > {
2138 self.inner
2139 .ready()
2140 .await
2141 .map_err(|e| {
2142 tonic::Status::unknown(
2143 format!("Service was not ready: {}", e.into()),
2144 )
2145 })?;
2146 let codec = tonic_prost::ProstCodec::default();
2147 let path = http::uri::PathAndQuery::from_static(
2148 "/sui.rpc.v2.LedgerService/GetServiceInfo",
2149 );
2150 let mut req = request.into_request();
2151 req.extensions_mut()
2152 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
2153 self.inner.unary(req, path, codec).await
2154 }
2155 pub async fn get_object(
2156 &mut self,
2157 request: impl tonic::IntoRequest<super::GetObjectRequest>,
2158 ) -> std::result::Result<
2159 tonic::Response<super::GetObjectResponse>,
2160 tonic::Status,
2161 > {
2162 self.inner
2163 .ready()
2164 .await
2165 .map_err(|e| {
2166 tonic::Status::unknown(
2167 format!("Service was not ready: {}", e.into()),
2168 )
2169 })?;
2170 let codec = tonic_prost::ProstCodec::default();
2171 let path = http::uri::PathAndQuery::from_static(
2172 "/sui.rpc.v2.LedgerService/GetObject",
2173 );
2174 let mut req = request.into_request();
2175 req.extensions_mut()
2176 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
2177 self.inner.unary(req, path, codec).await
2178 }
2179 pub async fn batch_get_objects(
2180 &mut self,
2181 request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
2182 ) -> std::result::Result<
2183 tonic::Response<super::BatchGetObjectsResponse>,
2184 tonic::Status,
2185 > {
2186 self.inner
2187 .ready()
2188 .await
2189 .map_err(|e| {
2190 tonic::Status::unknown(
2191 format!("Service was not ready: {}", e.into()),
2192 )
2193 })?;
2194 let codec = tonic_prost::ProstCodec::default();
2195 let path = http::uri::PathAndQuery::from_static(
2196 "/sui.rpc.v2.LedgerService/BatchGetObjects",
2197 );
2198 let mut req = request.into_request();
2199 req.extensions_mut()
2200 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
2201 self.inner.unary(req, path, codec).await
2202 }
2203 pub async fn get_transaction(
2204 &mut self,
2205 request: impl tonic::IntoRequest<super::GetTransactionRequest>,
2206 ) -> std::result::Result<
2207 tonic::Response<super::GetTransactionResponse>,
2208 tonic::Status,
2209 > {
2210 self.inner
2211 .ready()
2212 .await
2213 .map_err(|e| {
2214 tonic::Status::unknown(
2215 format!("Service was not ready: {}", e.into()),
2216 )
2217 })?;
2218 let codec = tonic_prost::ProstCodec::default();
2219 let path = http::uri::PathAndQuery::from_static(
2220 "/sui.rpc.v2.LedgerService/GetTransaction",
2221 );
2222 let mut req = request.into_request();
2223 req.extensions_mut()
2224 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
2225 self.inner.unary(req, path, codec).await
2226 }
2227 pub async fn batch_get_transactions(
2228 &mut self,
2229 request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
2230 ) -> std::result::Result<
2231 tonic::Response<super::BatchGetTransactionsResponse>,
2232 tonic::Status,
2233 > {
2234 self.inner
2235 .ready()
2236 .await
2237 .map_err(|e| {
2238 tonic::Status::unknown(
2239 format!("Service was not ready: {}", e.into()),
2240 )
2241 })?;
2242 let codec = tonic_prost::ProstCodec::default();
2243 let path = http::uri::PathAndQuery::from_static(
2244 "/sui.rpc.v2.LedgerService/BatchGetTransactions",
2245 );
2246 let mut req = request.into_request();
2247 req.extensions_mut()
2248 .insert(
2249 GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
2250 );
2251 self.inner.unary(req, path, codec).await
2252 }
2253 pub async fn get_checkpoint(
2254 &mut self,
2255 request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
2256 ) -> std::result::Result<
2257 tonic::Response<super::GetCheckpointResponse>,
2258 tonic::Status,
2259 > {
2260 self.inner
2261 .ready()
2262 .await
2263 .map_err(|e| {
2264 tonic::Status::unknown(
2265 format!("Service was not ready: {}", e.into()),
2266 )
2267 })?;
2268 let codec = tonic_prost::ProstCodec::default();
2269 let path = http::uri::PathAndQuery::from_static(
2270 "/sui.rpc.v2.LedgerService/GetCheckpoint",
2271 );
2272 let mut req = request.into_request();
2273 req.extensions_mut()
2274 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
2275 self.inner.unary(req, path, codec).await
2276 }
2277 pub async fn get_epoch(
2278 &mut self,
2279 request: impl tonic::IntoRequest<super::GetEpochRequest>,
2280 ) -> std::result::Result<
2281 tonic::Response<super::GetEpochResponse>,
2282 tonic::Status,
2283 > {
2284 self.inner
2285 .ready()
2286 .await
2287 .map_err(|e| {
2288 tonic::Status::unknown(
2289 format!("Service was not ready: {}", e.into()),
2290 )
2291 })?;
2292 let codec = tonic_prost::ProstCodec::default();
2293 let path = http::uri::PathAndQuery::from_static(
2294 "/sui.rpc.v2.LedgerService/GetEpoch",
2295 );
2296 let mut req = request.into_request();
2297 req.extensions_mut()
2298 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
2299 self.inner.unary(req, path, codec).await
2300 }
2301 }
2302}
2303pub mod ledger_service_server {
2305 #![allow(
2306 unused_variables,
2307 dead_code,
2308 missing_docs,
2309 clippy::wildcard_imports,
2310 clippy::let_unit_value,
2311 )]
2312 use tonic::codegen::*;
2313 #[async_trait]
2315 pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2316 async fn get_service_info(
2318 &self,
2319 request: tonic::Request<super::GetServiceInfoRequest>,
2320 ) -> std::result::Result<
2321 tonic::Response<super::GetServiceInfoResponse>,
2322 tonic::Status,
2323 > {
2324 Err(tonic::Status::unimplemented("Not yet implemented"))
2325 }
2326 async fn get_object(
2327 &self,
2328 request: tonic::Request<super::GetObjectRequest>,
2329 ) -> std::result::Result<
2330 tonic::Response<super::GetObjectResponse>,
2331 tonic::Status,
2332 > {
2333 Err(tonic::Status::unimplemented("Not yet implemented"))
2334 }
2335 async fn batch_get_objects(
2336 &self,
2337 request: tonic::Request<super::BatchGetObjectsRequest>,
2338 ) -> std::result::Result<
2339 tonic::Response<super::BatchGetObjectsResponse>,
2340 tonic::Status,
2341 > {
2342 Err(tonic::Status::unimplemented("Not yet implemented"))
2343 }
2344 async fn get_transaction(
2345 &self,
2346 request: tonic::Request<super::GetTransactionRequest>,
2347 ) -> std::result::Result<
2348 tonic::Response<super::GetTransactionResponse>,
2349 tonic::Status,
2350 > {
2351 Err(tonic::Status::unimplemented("Not yet implemented"))
2352 }
2353 async fn batch_get_transactions(
2354 &self,
2355 request: tonic::Request<super::BatchGetTransactionsRequest>,
2356 ) -> std::result::Result<
2357 tonic::Response<super::BatchGetTransactionsResponse>,
2358 tonic::Status,
2359 > {
2360 Err(tonic::Status::unimplemented("Not yet implemented"))
2361 }
2362 async fn get_checkpoint(
2363 &self,
2364 request: tonic::Request<super::GetCheckpointRequest>,
2365 ) -> std::result::Result<
2366 tonic::Response<super::GetCheckpointResponse>,
2367 tonic::Status,
2368 > {
2369 Err(tonic::Status::unimplemented("Not yet implemented"))
2370 }
2371 async fn get_epoch(
2372 &self,
2373 request: tonic::Request<super::GetEpochRequest>,
2374 ) -> std::result::Result<
2375 tonic::Response<super::GetEpochResponse>,
2376 tonic::Status,
2377 > {
2378 Err(tonic::Status::unimplemented("Not yet implemented"))
2379 }
2380 }
2381 #[derive(Debug)]
2382 pub struct LedgerServiceServer<T> {
2383 inner: Arc<T>,
2384 accept_compression_encodings: EnabledCompressionEncodings,
2385 send_compression_encodings: EnabledCompressionEncodings,
2386 max_decoding_message_size: Option<usize>,
2387 max_encoding_message_size: Option<usize>,
2388 }
2389 impl<T> LedgerServiceServer<T> {
2390 pub fn new(inner: T) -> Self {
2391 Self::from_arc(Arc::new(inner))
2392 }
2393 pub fn from_arc(inner: Arc<T>) -> Self {
2394 Self {
2395 inner,
2396 accept_compression_encodings: Default::default(),
2397 send_compression_encodings: Default::default(),
2398 max_decoding_message_size: None,
2399 max_encoding_message_size: None,
2400 }
2401 }
2402 pub fn with_interceptor<F>(
2403 inner: T,
2404 interceptor: F,
2405 ) -> InterceptedService<Self, F>
2406 where
2407 F: tonic::service::Interceptor,
2408 {
2409 InterceptedService::new(Self::new(inner), interceptor)
2410 }
2411 #[must_use]
2413 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2414 self.accept_compression_encodings.enable(encoding);
2415 self
2416 }
2417 #[must_use]
2419 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2420 self.send_compression_encodings.enable(encoding);
2421 self
2422 }
2423 #[must_use]
2427 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2428 self.max_decoding_message_size = Some(limit);
2429 self
2430 }
2431 #[must_use]
2435 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2436 self.max_encoding_message_size = Some(limit);
2437 self
2438 }
2439 }
2440 impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
2441 where
2442 T: LedgerService,
2443 B: Body + std::marker::Send + 'static,
2444 B::Error: Into<StdError> + std::marker::Send + 'static,
2445 {
2446 type Response = http::Response<tonic::body::Body>;
2447 type Error = std::convert::Infallible;
2448 type Future = BoxFuture<Self::Response, Self::Error>;
2449 fn poll_ready(
2450 &mut self,
2451 _cx: &mut Context<'_>,
2452 ) -> Poll<std::result::Result<(), Self::Error>> {
2453 Poll::Ready(Ok(()))
2454 }
2455 fn call(&mut self, req: http::Request<B>) -> Self::Future {
2456 match req.uri().path() {
2457 "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
2458 #[allow(non_camel_case_types)]
2459 struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
2460 impl<
2461 T: LedgerService,
2462 > tonic::server::UnaryService<super::GetServiceInfoRequest>
2463 for GetServiceInfoSvc<T> {
2464 type Response = super::GetServiceInfoResponse;
2465 type Future = BoxFuture<
2466 tonic::Response<Self::Response>,
2467 tonic::Status,
2468 >;
2469 fn call(
2470 &mut self,
2471 request: tonic::Request<super::GetServiceInfoRequest>,
2472 ) -> Self::Future {
2473 let inner = Arc::clone(&self.0);
2474 let fut = async move {
2475 <T as LedgerService>::get_service_info(&inner, request)
2476 .await
2477 };
2478 Box::pin(fut)
2479 }
2480 }
2481 let accept_compression_encodings = self.accept_compression_encodings;
2482 let send_compression_encodings = self.send_compression_encodings;
2483 let max_decoding_message_size = self.max_decoding_message_size;
2484 let max_encoding_message_size = self.max_encoding_message_size;
2485 let inner = self.inner.clone();
2486 let fut = async move {
2487 let method = GetServiceInfoSvc(inner);
2488 let codec = tonic_prost::ProstCodec::default();
2489 let mut grpc = tonic::server::Grpc::new(codec)
2490 .apply_compression_config(
2491 accept_compression_encodings,
2492 send_compression_encodings,
2493 )
2494 .apply_max_message_size_config(
2495 max_decoding_message_size,
2496 max_encoding_message_size,
2497 );
2498 let res = grpc.unary(method, req).await;
2499 Ok(res)
2500 };
2501 Box::pin(fut)
2502 }
2503 "/sui.rpc.v2.LedgerService/GetObject" => {
2504 #[allow(non_camel_case_types)]
2505 struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
2506 impl<
2507 T: LedgerService,
2508 > tonic::server::UnaryService<super::GetObjectRequest>
2509 for GetObjectSvc<T> {
2510 type Response = super::GetObjectResponse;
2511 type Future = BoxFuture<
2512 tonic::Response<Self::Response>,
2513 tonic::Status,
2514 >;
2515 fn call(
2516 &mut self,
2517 request: tonic::Request<super::GetObjectRequest>,
2518 ) -> Self::Future {
2519 let inner = Arc::clone(&self.0);
2520 let fut = async move {
2521 <T as LedgerService>::get_object(&inner, request).await
2522 };
2523 Box::pin(fut)
2524 }
2525 }
2526 let accept_compression_encodings = self.accept_compression_encodings;
2527 let send_compression_encodings = self.send_compression_encodings;
2528 let max_decoding_message_size = self.max_decoding_message_size;
2529 let max_encoding_message_size = self.max_encoding_message_size;
2530 let inner = self.inner.clone();
2531 let fut = async move {
2532 let method = GetObjectSvc(inner);
2533 let codec = tonic_prost::ProstCodec::default();
2534 let mut grpc = tonic::server::Grpc::new(codec)
2535 .apply_compression_config(
2536 accept_compression_encodings,
2537 send_compression_encodings,
2538 )
2539 .apply_max_message_size_config(
2540 max_decoding_message_size,
2541 max_encoding_message_size,
2542 );
2543 let res = grpc.unary(method, req).await;
2544 Ok(res)
2545 };
2546 Box::pin(fut)
2547 }
2548 "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
2549 #[allow(non_camel_case_types)]
2550 struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
2551 impl<
2552 T: LedgerService,
2553 > tonic::server::UnaryService<super::BatchGetObjectsRequest>
2554 for BatchGetObjectsSvc<T> {
2555 type Response = super::BatchGetObjectsResponse;
2556 type Future = BoxFuture<
2557 tonic::Response<Self::Response>,
2558 tonic::Status,
2559 >;
2560 fn call(
2561 &mut self,
2562 request: tonic::Request<super::BatchGetObjectsRequest>,
2563 ) -> Self::Future {
2564 let inner = Arc::clone(&self.0);
2565 let fut = async move {
2566 <T as LedgerService>::batch_get_objects(&inner, request)
2567 .await
2568 };
2569 Box::pin(fut)
2570 }
2571 }
2572 let accept_compression_encodings = self.accept_compression_encodings;
2573 let send_compression_encodings = self.send_compression_encodings;
2574 let max_decoding_message_size = self.max_decoding_message_size;
2575 let max_encoding_message_size = self.max_encoding_message_size;
2576 let inner = self.inner.clone();
2577 let fut = async move {
2578 let method = BatchGetObjectsSvc(inner);
2579 let codec = tonic_prost::ProstCodec::default();
2580 let mut grpc = tonic::server::Grpc::new(codec)
2581 .apply_compression_config(
2582 accept_compression_encodings,
2583 send_compression_encodings,
2584 )
2585 .apply_max_message_size_config(
2586 max_decoding_message_size,
2587 max_encoding_message_size,
2588 );
2589 let res = grpc.unary(method, req).await;
2590 Ok(res)
2591 };
2592 Box::pin(fut)
2593 }
2594 "/sui.rpc.v2.LedgerService/GetTransaction" => {
2595 #[allow(non_camel_case_types)]
2596 struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
2597 impl<
2598 T: LedgerService,
2599 > tonic::server::UnaryService<super::GetTransactionRequest>
2600 for GetTransactionSvc<T> {
2601 type Response = super::GetTransactionResponse;
2602 type Future = BoxFuture<
2603 tonic::Response<Self::Response>,
2604 tonic::Status,
2605 >;
2606 fn call(
2607 &mut self,
2608 request: tonic::Request<super::GetTransactionRequest>,
2609 ) -> Self::Future {
2610 let inner = Arc::clone(&self.0);
2611 let fut = async move {
2612 <T as LedgerService>::get_transaction(&inner, request).await
2613 };
2614 Box::pin(fut)
2615 }
2616 }
2617 let accept_compression_encodings = self.accept_compression_encodings;
2618 let send_compression_encodings = self.send_compression_encodings;
2619 let max_decoding_message_size = self.max_decoding_message_size;
2620 let max_encoding_message_size = self.max_encoding_message_size;
2621 let inner = self.inner.clone();
2622 let fut = async move {
2623 let method = GetTransactionSvc(inner);
2624 let codec = tonic_prost::ProstCodec::default();
2625 let mut grpc = tonic::server::Grpc::new(codec)
2626 .apply_compression_config(
2627 accept_compression_encodings,
2628 send_compression_encodings,
2629 )
2630 .apply_max_message_size_config(
2631 max_decoding_message_size,
2632 max_encoding_message_size,
2633 );
2634 let res = grpc.unary(method, req).await;
2635 Ok(res)
2636 };
2637 Box::pin(fut)
2638 }
2639 "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
2640 #[allow(non_camel_case_types)]
2641 struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
2642 impl<
2643 T: LedgerService,
2644 > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
2645 for BatchGetTransactionsSvc<T> {
2646 type Response = super::BatchGetTransactionsResponse;
2647 type Future = BoxFuture<
2648 tonic::Response<Self::Response>,
2649 tonic::Status,
2650 >;
2651 fn call(
2652 &mut self,
2653 request: tonic::Request<super::BatchGetTransactionsRequest>,
2654 ) -> Self::Future {
2655 let inner = Arc::clone(&self.0);
2656 let fut = async move {
2657 <T as LedgerService>::batch_get_transactions(
2658 &inner,
2659 request,
2660 )
2661 .await
2662 };
2663 Box::pin(fut)
2664 }
2665 }
2666 let accept_compression_encodings = self.accept_compression_encodings;
2667 let send_compression_encodings = self.send_compression_encodings;
2668 let max_decoding_message_size = self.max_decoding_message_size;
2669 let max_encoding_message_size = self.max_encoding_message_size;
2670 let inner = self.inner.clone();
2671 let fut = async move {
2672 let method = BatchGetTransactionsSvc(inner);
2673 let codec = tonic_prost::ProstCodec::default();
2674 let mut grpc = tonic::server::Grpc::new(codec)
2675 .apply_compression_config(
2676 accept_compression_encodings,
2677 send_compression_encodings,
2678 )
2679 .apply_max_message_size_config(
2680 max_decoding_message_size,
2681 max_encoding_message_size,
2682 );
2683 let res = grpc.unary(method, req).await;
2684 Ok(res)
2685 };
2686 Box::pin(fut)
2687 }
2688 "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
2689 #[allow(non_camel_case_types)]
2690 struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
2691 impl<
2692 T: LedgerService,
2693 > tonic::server::UnaryService<super::GetCheckpointRequest>
2694 for GetCheckpointSvc<T> {
2695 type Response = super::GetCheckpointResponse;
2696 type Future = BoxFuture<
2697 tonic::Response<Self::Response>,
2698 tonic::Status,
2699 >;
2700 fn call(
2701 &mut self,
2702 request: tonic::Request<super::GetCheckpointRequest>,
2703 ) -> Self::Future {
2704 let inner = Arc::clone(&self.0);
2705 let fut = async move {
2706 <T as LedgerService>::get_checkpoint(&inner, request).await
2707 };
2708 Box::pin(fut)
2709 }
2710 }
2711 let accept_compression_encodings = self.accept_compression_encodings;
2712 let send_compression_encodings = self.send_compression_encodings;
2713 let max_decoding_message_size = self.max_decoding_message_size;
2714 let max_encoding_message_size = self.max_encoding_message_size;
2715 let inner = self.inner.clone();
2716 let fut = async move {
2717 let method = GetCheckpointSvc(inner);
2718 let codec = tonic_prost::ProstCodec::default();
2719 let mut grpc = tonic::server::Grpc::new(codec)
2720 .apply_compression_config(
2721 accept_compression_encodings,
2722 send_compression_encodings,
2723 )
2724 .apply_max_message_size_config(
2725 max_decoding_message_size,
2726 max_encoding_message_size,
2727 );
2728 let res = grpc.unary(method, req).await;
2729 Ok(res)
2730 };
2731 Box::pin(fut)
2732 }
2733 "/sui.rpc.v2.LedgerService/GetEpoch" => {
2734 #[allow(non_camel_case_types)]
2735 struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
2736 impl<
2737 T: LedgerService,
2738 > tonic::server::UnaryService<super::GetEpochRequest>
2739 for GetEpochSvc<T> {
2740 type Response = super::GetEpochResponse;
2741 type Future = BoxFuture<
2742 tonic::Response<Self::Response>,
2743 tonic::Status,
2744 >;
2745 fn call(
2746 &mut self,
2747 request: tonic::Request<super::GetEpochRequest>,
2748 ) -> Self::Future {
2749 let inner = Arc::clone(&self.0);
2750 let fut = async move {
2751 <T as LedgerService>::get_epoch(&inner, request).await
2752 };
2753 Box::pin(fut)
2754 }
2755 }
2756 let accept_compression_encodings = self.accept_compression_encodings;
2757 let send_compression_encodings = self.send_compression_encodings;
2758 let max_decoding_message_size = self.max_decoding_message_size;
2759 let max_encoding_message_size = self.max_encoding_message_size;
2760 let inner = self.inner.clone();
2761 let fut = async move {
2762 let method = GetEpochSvc(inner);
2763 let codec = tonic_prost::ProstCodec::default();
2764 let mut grpc = tonic::server::Grpc::new(codec)
2765 .apply_compression_config(
2766 accept_compression_encodings,
2767 send_compression_encodings,
2768 )
2769 .apply_max_message_size_config(
2770 max_decoding_message_size,
2771 max_encoding_message_size,
2772 );
2773 let res = grpc.unary(method, req).await;
2774 Ok(res)
2775 };
2776 Box::pin(fut)
2777 }
2778 _ => {
2779 Box::pin(async move {
2780 let mut response = http::Response::new(
2781 tonic::body::Body::default(),
2782 );
2783 let headers = response.headers_mut();
2784 headers
2785 .insert(
2786 tonic::Status::GRPC_STATUS,
2787 (tonic::Code::Unimplemented as i32).into(),
2788 );
2789 headers
2790 .insert(
2791 http::header::CONTENT_TYPE,
2792 tonic::metadata::GRPC_CONTENT_TYPE,
2793 );
2794 Ok(response)
2795 })
2796 }
2797 }
2798 }
2799 }
2800 impl<T> Clone for LedgerServiceServer<T> {
2801 fn clone(&self) -> Self {
2802 let inner = self.inner.clone();
2803 Self {
2804 inner,
2805 accept_compression_encodings: self.accept_compression_encodings,
2806 send_compression_encodings: self.send_compression_encodings,
2807 max_decoding_message_size: self.max_decoding_message_size,
2808 max_encoding_message_size: self.max_encoding_message_size,
2809 }
2810 }
2811 }
2812 pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
2814 impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
2815 const NAME: &'static str = SERVICE_NAME;
2816 }
2817}
2818#[non_exhaustive]
2820#[derive(Clone, PartialEq, ::prost::Message)]
2821pub struct Package {
2822 #[prost(string, optional, tag = "1")]
2828 pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
2829 #[prost(string, optional, tag = "2")]
2836 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
2837 #[prost(uint64, optional, tag = "3")]
2839 pub version: ::core::option::Option<u64>,
2840 #[prost(message, repeated, tag = "4")]
2842 pub modules: ::prost::alloc::vec::Vec<Module>,
2843 #[prost(message, repeated, tag = "5")]
2846 pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
2847 #[prost(message, repeated, tag = "6")]
2851 pub linkage: ::prost::alloc::vec::Vec<Linkage>,
2852}
2853#[non_exhaustive]
2855#[derive(Clone, PartialEq, ::prost::Message)]
2856pub struct Module {
2857 #[prost(string, optional, tag = "1")]
2859 pub name: ::core::option::Option<::prost::alloc::string::String>,
2860 #[prost(bytes = "bytes", optional, tag = "2")]
2862 pub contents: ::core::option::Option<::prost::bytes::Bytes>,
2863 #[prost(message, repeated, tag = "3")]
2865 pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
2866 #[prost(message, repeated, tag = "4")]
2868 pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
2869}
2870#[non_exhaustive]
2872#[derive(Clone, PartialEq, ::prost::Message)]
2873pub struct DatatypeDescriptor {
2874 #[prost(string, optional, tag = "1")]
2878 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
2879 #[prost(string, optional, tag = "2")]
2883 pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
2884 #[prost(string, optional, tag = "3")]
2886 pub module: ::core::option::Option<::prost::alloc::string::String>,
2887 #[prost(string, optional, tag = "4")]
2889 pub name: ::core::option::Option<::prost::alloc::string::String>,
2890 #[prost(enumeration = "Ability", repeated, tag = "5")]
2892 pub abilities: ::prost::alloc::vec::Vec<i32>,
2893 #[prost(message, repeated, tag = "6")]
2895 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
2896 #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
2898 pub kind: ::core::option::Option<i32>,
2899 #[prost(message, repeated, tag = "8")]
2903 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
2904 #[prost(message, repeated, tag = "9")]
2908 pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
2909}
2910pub mod datatype_descriptor {
2912 #[non_exhaustive]
2913 #[derive(
2914 Clone,
2915 Copy,
2916 Debug,
2917 PartialEq,
2918 Eq,
2919 Hash,
2920 PartialOrd,
2921 Ord,
2922 ::prost::Enumeration
2923 )]
2924 #[repr(i32)]
2925 pub enum DatatypeKind {
2926 Unknown = 0,
2927 Struct = 1,
2928 Enum = 2,
2929 }
2930 impl DatatypeKind {
2931 pub fn as_str_name(&self) -> &'static str {
2936 match self {
2937 Self::Unknown => "DATATYPE_KIND_UNKNOWN",
2938 Self::Struct => "STRUCT",
2939 Self::Enum => "ENUM",
2940 }
2941 }
2942 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2944 match value {
2945 "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
2946 "STRUCT" => Some(Self::Struct),
2947 "ENUM" => Some(Self::Enum),
2948 _ => None,
2949 }
2950 }
2951 }
2952}
2953#[non_exhaustive]
2955#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2956pub struct TypeParameter {
2957 #[prost(enumeration = "Ability", repeated, tag = "1")]
2959 pub constraints: ::prost::alloc::vec::Vec<i32>,
2960 #[prost(bool, optional, tag = "2")]
2962 pub is_phantom: ::core::option::Option<bool>,
2963}
2964#[non_exhaustive]
2966#[derive(Clone, PartialEq, ::prost::Message)]
2967pub struct FieldDescriptor {
2968 #[prost(string, optional, tag = "1")]
2970 pub name: ::core::option::Option<::prost::alloc::string::String>,
2971 #[prost(uint32, optional, tag = "2")]
2973 pub position: ::core::option::Option<u32>,
2974 #[prost(message, optional, tag = "3")]
2976 pub r#type: ::core::option::Option<OpenSignatureBody>,
2977}
2978#[non_exhaustive]
2980#[derive(Clone, PartialEq, ::prost::Message)]
2981pub struct VariantDescriptor {
2982 #[prost(string, optional, tag = "1")]
2984 pub name: ::core::option::Option<::prost::alloc::string::String>,
2985 #[prost(uint32, optional, tag = "2")]
2987 pub position: ::core::option::Option<u32>,
2988 #[prost(message, repeated, tag = "3")]
2990 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
2991}
2992#[non_exhaustive]
2994#[derive(Clone, PartialEq, ::prost::Message)]
2995pub struct OpenSignatureBody {
2996 #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
2998 pub r#type: ::core::option::Option<i32>,
2999 #[prost(string, optional, tag = "2")]
3001 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3002 #[prost(message, repeated, tag = "3")]
3004 pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
3005 #[prost(uint32, optional, tag = "4")]
3007 pub type_parameter: ::core::option::Option<u32>,
3008}
3009pub mod open_signature_body {
3011 #[non_exhaustive]
3012 #[derive(
3013 Clone,
3014 Copy,
3015 Debug,
3016 PartialEq,
3017 Eq,
3018 Hash,
3019 PartialOrd,
3020 Ord,
3021 ::prost::Enumeration
3022 )]
3023 #[repr(i32)]
3024 pub enum Type {
3025 Unknown = 0,
3026 Address = 1,
3027 Bool = 2,
3028 U8 = 3,
3029 U16 = 4,
3030 U32 = 5,
3031 U64 = 6,
3032 U128 = 7,
3033 U256 = 8,
3034 Vector = 9,
3035 Datatype = 10,
3036 Parameter = 11,
3037 }
3038 impl Type {
3039 pub fn as_str_name(&self) -> &'static str {
3044 match self {
3045 Self::Unknown => "TYPE_UNKNOWN",
3046 Self::Address => "ADDRESS",
3047 Self::Bool => "BOOL",
3048 Self::U8 => "U8",
3049 Self::U16 => "U16",
3050 Self::U32 => "U32",
3051 Self::U64 => "U64",
3052 Self::U128 => "U128",
3053 Self::U256 => "U256",
3054 Self::Vector => "VECTOR",
3055 Self::Datatype => "DATATYPE",
3056 Self::Parameter => "TYPE_PARAMETER",
3057 }
3058 }
3059 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3061 match value {
3062 "TYPE_UNKNOWN" => Some(Self::Unknown),
3063 "ADDRESS" => Some(Self::Address),
3064 "BOOL" => Some(Self::Bool),
3065 "U8" => Some(Self::U8),
3066 "U16" => Some(Self::U16),
3067 "U32" => Some(Self::U32),
3068 "U64" => Some(Self::U64),
3069 "U128" => Some(Self::U128),
3070 "U256" => Some(Self::U256),
3071 "VECTOR" => Some(Self::Vector),
3072 "DATATYPE" => Some(Self::Datatype),
3073 "TYPE_PARAMETER" => Some(Self::Parameter),
3074 _ => None,
3075 }
3076 }
3077 }
3078}
3079#[non_exhaustive]
3081#[derive(Clone, PartialEq, ::prost::Message)]
3082pub struct FunctionDescriptor {
3083 #[prost(string, optional, tag = "1")]
3085 pub name: ::core::option::Option<::prost::alloc::string::String>,
3086 #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
3088 pub visibility: ::core::option::Option<i32>,
3089 #[prost(bool, optional, tag = "6")]
3091 pub is_entry: ::core::option::Option<bool>,
3092 #[prost(message, repeated, tag = "7")]
3094 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3095 #[prost(message, repeated, tag = "8")]
3097 pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
3098 #[prost(message, repeated, tag = "9")]
3100 pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
3101}
3102pub mod function_descriptor {
3104 #[non_exhaustive]
3105 #[derive(
3106 Clone,
3107 Copy,
3108 Debug,
3109 PartialEq,
3110 Eq,
3111 Hash,
3112 PartialOrd,
3113 Ord,
3114 ::prost::Enumeration
3115 )]
3116 #[repr(i32)]
3117 pub enum Visibility {
3118 Unknown = 0,
3119 Private = 1,
3120 Public = 2,
3121 Friend = 3,
3122 }
3123 impl Visibility {
3124 pub fn as_str_name(&self) -> &'static str {
3129 match self {
3130 Self::Unknown => "VISIBILITY_UNKNOWN",
3131 Self::Private => "PRIVATE",
3132 Self::Public => "PUBLIC",
3133 Self::Friend => "FRIEND",
3134 }
3135 }
3136 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3138 match value {
3139 "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
3140 "PRIVATE" => Some(Self::Private),
3141 "PUBLIC" => Some(Self::Public),
3142 "FRIEND" => Some(Self::Friend),
3143 _ => None,
3144 }
3145 }
3146 }
3147}
3148#[non_exhaustive]
3150#[derive(Clone, PartialEq, ::prost::Message)]
3151pub struct OpenSignature {
3152 #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
3153 pub reference: ::core::option::Option<i32>,
3154 #[prost(message, optional, tag = "2")]
3155 pub body: ::core::option::Option<OpenSignatureBody>,
3156}
3157pub mod open_signature {
3159 #[non_exhaustive]
3160 #[derive(
3161 Clone,
3162 Copy,
3163 Debug,
3164 PartialEq,
3165 Eq,
3166 Hash,
3167 PartialOrd,
3168 Ord,
3169 ::prost::Enumeration
3170 )]
3171 #[repr(i32)]
3172 pub enum Reference {
3173 Unknown = 0,
3174 Immutable = 1,
3175 Mutable = 2,
3176 }
3177 impl Reference {
3178 pub fn as_str_name(&self) -> &'static str {
3183 match self {
3184 Self::Unknown => "REFERENCE_UNKNOWN",
3185 Self::Immutable => "IMMUTABLE",
3186 Self::Mutable => "MUTABLE",
3187 }
3188 }
3189 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3191 match value {
3192 "REFERENCE_UNKNOWN" => Some(Self::Unknown),
3193 "IMMUTABLE" => Some(Self::Immutable),
3194 "MUTABLE" => Some(Self::Mutable),
3195 _ => None,
3196 }
3197 }
3198 }
3199}
3200#[non_exhaustive]
3202#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3203pub struct TypeOrigin {
3204 #[prost(string, optional, tag = "1")]
3205 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3206 #[prost(string, optional, tag = "2")]
3207 pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
3208 #[prost(string, optional, tag = "3")]
3209 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3210}
3211#[non_exhaustive]
3213#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3214pub struct Linkage {
3215 #[prost(string, optional, tag = "1")]
3217 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3218 #[prost(string, optional, tag = "2")]
3220 pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
3221 #[prost(uint64, optional, tag = "3")]
3223 pub upgraded_version: ::core::option::Option<u64>,
3224}
3225#[non_exhaustive]
3227#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3228#[repr(i32)]
3229pub enum Ability {
3230 Unknown = 0,
3231 Copy = 1,
3233 Drop = 2,
3235 Store = 3,
3237 Key = 4,
3239}
3240impl Ability {
3241 pub fn as_str_name(&self) -> &'static str {
3246 match self {
3247 Self::Unknown => "ABILITY_UNKNOWN",
3248 Self::Copy => "COPY",
3249 Self::Drop => "DROP",
3250 Self::Store => "STORE",
3251 Self::Key => "KEY",
3252 }
3253 }
3254 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3256 match value {
3257 "ABILITY_UNKNOWN" => Some(Self::Unknown),
3258 "COPY" => Some(Self::Copy),
3259 "DROP" => Some(Self::Drop),
3260 "STORE" => Some(Self::Store),
3261 "KEY" => Some(Self::Key),
3262 _ => None,
3263 }
3264 }
3265}
3266#[non_exhaustive]
3267#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3268pub struct GetPackageRequest {
3269 #[prost(string, optional, tag = "1")]
3271 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3272}
3273#[non_exhaustive]
3274#[derive(Clone, PartialEq, ::prost::Message)]
3275pub struct GetPackageResponse {
3276 #[prost(message, optional, tag = "1")]
3278 pub package: ::core::option::Option<Package>,
3279}
3280#[non_exhaustive]
3281#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3282pub struct GetDatatypeRequest {
3283 #[prost(string, optional, tag = "1")]
3285 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3286 #[prost(string, optional, tag = "2")]
3288 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3289 #[prost(string, optional, tag = "3")]
3291 pub name: ::core::option::Option<::prost::alloc::string::String>,
3292}
3293#[non_exhaustive]
3294#[derive(Clone, PartialEq, ::prost::Message)]
3295pub struct GetDatatypeResponse {
3296 #[prost(message, optional, tag = "1")]
3298 pub datatype: ::core::option::Option<DatatypeDescriptor>,
3299}
3300#[non_exhaustive]
3301#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3302pub struct GetFunctionRequest {
3303 #[prost(string, optional, tag = "1")]
3305 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3306 #[prost(string, optional, tag = "2")]
3308 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3309 #[prost(string, optional, tag = "3")]
3311 pub name: ::core::option::Option<::prost::alloc::string::String>,
3312}
3313#[non_exhaustive]
3314#[derive(Clone, PartialEq, ::prost::Message)]
3315pub struct GetFunctionResponse {
3316 #[prost(message, optional, tag = "1")]
3318 pub function: ::core::option::Option<FunctionDescriptor>,
3319}
3320#[non_exhaustive]
3321#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3322pub struct ListPackageVersionsRequest {
3323 #[prost(string, optional, tag = "1")]
3325 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3326 #[prost(uint32, optional, tag = "2")]
3330 pub page_size: ::core::option::Option<u32>,
3331 #[prost(bytes = "bytes", optional, tag = "3")]
3337 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
3338}
3339#[non_exhaustive]
3340#[derive(Clone, PartialEq, ::prost::Message)]
3341pub struct ListPackageVersionsResponse {
3342 #[prost(message, repeated, tag = "1")]
3344 pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
3345 #[prost(bytes = "bytes", optional, tag = "2")]
3348 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
3349}
3350#[non_exhaustive]
3352#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3353pub struct PackageVersion {
3354 #[prost(string, optional, tag = "1")]
3356 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3357 #[prost(uint64, optional, tag = "2")]
3359 pub version: ::core::option::Option<u64>,
3360}
3361pub mod move_package_service_client {
3363 #![allow(
3364 unused_variables,
3365 dead_code,
3366 missing_docs,
3367 clippy::wildcard_imports,
3368 clippy::let_unit_value,
3369 )]
3370 use tonic::codegen::*;
3371 use tonic::codegen::http::Uri;
3372 #[derive(Debug, Clone)]
3373 pub struct MovePackageServiceClient<T> {
3374 inner: tonic::client::Grpc<T>,
3375 }
3376 impl MovePackageServiceClient<tonic::transport::Channel> {
3377 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3379 where
3380 D: TryInto<tonic::transport::Endpoint>,
3381 D::Error: Into<StdError>,
3382 {
3383 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3384 Ok(Self::new(conn))
3385 }
3386 }
3387 impl<T> MovePackageServiceClient<T>
3388 where
3389 T: tonic::client::GrpcService<tonic::body::Body>,
3390 T::Error: Into<StdError>,
3391 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3392 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3393 {
3394 pub fn new(inner: T) -> Self {
3395 let inner = tonic::client::Grpc::new(inner);
3396 Self { inner }
3397 }
3398 pub fn with_origin(inner: T, origin: Uri) -> Self {
3399 let inner = tonic::client::Grpc::with_origin(inner, origin);
3400 Self { inner }
3401 }
3402 pub fn with_interceptor<F>(
3403 inner: T,
3404 interceptor: F,
3405 ) -> MovePackageServiceClient<InterceptedService<T, F>>
3406 where
3407 F: tonic::service::Interceptor,
3408 T::ResponseBody: Default,
3409 T: tonic::codegen::Service<
3410 http::Request<tonic::body::Body>,
3411 Response = http::Response<
3412 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3413 >,
3414 >,
3415 <T as tonic::codegen::Service<
3416 http::Request<tonic::body::Body>,
3417 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3418 {
3419 MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
3420 }
3421 #[must_use]
3426 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3427 self.inner = self.inner.send_compressed(encoding);
3428 self
3429 }
3430 #[must_use]
3432 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3433 self.inner = self.inner.accept_compressed(encoding);
3434 self
3435 }
3436 #[must_use]
3440 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3441 self.inner = self.inner.max_decoding_message_size(limit);
3442 self
3443 }
3444 #[must_use]
3448 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3449 self.inner = self.inner.max_encoding_message_size(limit);
3450 self
3451 }
3452 pub async fn get_package(
3453 &mut self,
3454 request: impl tonic::IntoRequest<super::GetPackageRequest>,
3455 ) -> std::result::Result<
3456 tonic::Response<super::GetPackageResponse>,
3457 tonic::Status,
3458 > {
3459 self.inner
3460 .ready()
3461 .await
3462 .map_err(|e| {
3463 tonic::Status::unknown(
3464 format!("Service was not ready: {}", e.into()),
3465 )
3466 })?;
3467 let codec = tonic_prost::ProstCodec::default();
3468 let path = http::uri::PathAndQuery::from_static(
3469 "/sui.rpc.v2.MovePackageService/GetPackage",
3470 );
3471 let mut req = request.into_request();
3472 req.extensions_mut()
3473 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
3474 self.inner.unary(req, path, codec).await
3475 }
3476 pub async fn get_datatype(
3477 &mut self,
3478 request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
3479 ) -> std::result::Result<
3480 tonic::Response<super::GetDatatypeResponse>,
3481 tonic::Status,
3482 > {
3483 self.inner
3484 .ready()
3485 .await
3486 .map_err(|e| {
3487 tonic::Status::unknown(
3488 format!("Service was not ready: {}", e.into()),
3489 )
3490 })?;
3491 let codec = tonic_prost::ProstCodec::default();
3492 let path = http::uri::PathAndQuery::from_static(
3493 "/sui.rpc.v2.MovePackageService/GetDatatype",
3494 );
3495 let mut req = request.into_request();
3496 req.extensions_mut()
3497 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
3498 self.inner.unary(req, path, codec).await
3499 }
3500 pub async fn get_function(
3501 &mut self,
3502 request: impl tonic::IntoRequest<super::GetFunctionRequest>,
3503 ) -> std::result::Result<
3504 tonic::Response<super::GetFunctionResponse>,
3505 tonic::Status,
3506 > {
3507 self.inner
3508 .ready()
3509 .await
3510 .map_err(|e| {
3511 tonic::Status::unknown(
3512 format!("Service was not ready: {}", e.into()),
3513 )
3514 })?;
3515 let codec = tonic_prost::ProstCodec::default();
3516 let path = http::uri::PathAndQuery::from_static(
3517 "/sui.rpc.v2.MovePackageService/GetFunction",
3518 );
3519 let mut req = request.into_request();
3520 req.extensions_mut()
3521 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
3522 self.inner.unary(req, path, codec).await
3523 }
3524 pub async fn list_package_versions(
3525 &mut self,
3526 request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
3527 ) -> std::result::Result<
3528 tonic::Response<super::ListPackageVersionsResponse>,
3529 tonic::Status,
3530 > {
3531 self.inner
3532 .ready()
3533 .await
3534 .map_err(|e| {
3535 tonic::Status::unknown(
3536 format!("Service was not ready: {}", e.into()),
3537 )
3538 })?;
3539 let codec = tonic_prost::ProstCodec::default();
3540 let path = http::uri::PathAndQuery::from_static(
3541 "/sui.rpc.v2.MovePackageService/ListPackageVersions",
3542 );
3543 let mut req = request.into_request();
3544 req.extensions_mut()
3545 .insert(
3546 GrpcMethod::new(
3547 "sui.rpc.v2.MovePackageService",
3548 "ListPackageVersions",
3549 ),
3550 );
3551 self.inner.unary(req, path, codec).await
3552 }
3553 }
3554}
3555pub mod move_package_service_server {
3557 #![allow(
3558 unused_variables,
3559 dead_code,
3560 missing_docs,
3561 clippy::wildcard_imports,
3562 clippy::let_unit_value,
3563 )]
3564 use tonic::codegen::*;
3565 #[async_trait]
3567 pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
3568 async fn get_package(
3569 &self,
3570 request: tonic::Request<super::GetPackageRequest>,
3571 ) -> std::result::Result<
3572 tonic::Response<super::GetPackageResponse>,
3573 tonic::Status,
3574 > {
3575 Err(tonic::Status::unimplemented("Not yet implemented"))
3576 }
3577 async fn get_datatype(
3578 &self,
3579 request: tonic::Request<super::GetDatatypeRequest>,
3580 ) -> std::result::Result<
3581 tonic::Response<super::GetDatatypeResponse>,
3582 tonic::Status,
3583 > {
3584 Err(tonic::Status::unimplemented("Not yet implemented"))
3585 }
3586 async fn get_function(
3587 &self,
3588 request: tonic::Request<super::GetFunctionRequest>,
3589 ) -> std::result::Result<
3590 tonic::Response<super::GetFunctionResponse>,
3591 tonic::Status,
3592 > {
3593 Err(tonic::Status::unimplemented("Not yet implemented"))
3594 }
3595 async fn list_package_versions(
3596 &self,
3597 request: tonic::Request<super::ListPackageVersionsRequest>,
3598 ) -> std::result::Result<
3599 tonic::Response<super::ListPackageVersionsResponse>,
3600 tonic::Status,
3601 > {
3602 Err(tonic::Status::unimplemented("Not yet implemented"))
3603 }
3604 }
3605 #[derive(Debug)]
3606 pub struct MovePackageServiceServer<T> {
3607 inner: Arc<T>,
3608 accept_compression_encodings: EnabledCompressionEncodings,
3609 send_compression_encodings: EnabledCompressionEncodings,
3610 max_decoding_message_size: Option<usize>,
3611 max_encoding_message_size: Option<usize>,
3612 }
3613 impl<T> MovePackageServiceServer<T> {
3614 pub fn new(inner: T) -> Self {
3615 Self::from_arc(Arc::new(inner))
3616 }
3617 pub fn from_arc(inner: Arc<T>) -> Self {
3618 Self {
3619 inner,
3620 accept_compression_encodings: Default::default(),
3621 send_compression_encodings: Default::default(),
3622 max_decoding_message_size: None,
3623 max_encoding_message_size: None,
3624 }
3625 }
3626 pub fn with_interceptor<F>(
3627 inner: T,
3628 interceptor: F,
3629 ) -> InterceptedService<Self, F>
3630 where
3631 F: tonic::service::Interceptor,
3632 {
3633 InterceptedService::new(Self::new(inner), interceptor)
3634 }
3635 #[must_use]
3637 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3638 self.accept_compression_encodings.enable(encoding);
3639 self
3640 }
3641 #[must_use]
3643 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3644 self.send_compression_encodings.enable(encoding);
3645 self
3646 }
3647 #[must_use]
3651 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3652 self.max_decoding_message_size = Some(limit);
3653 self
3654 }
3655 #[must_use]
3659 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3660 self.max_encoding_message_size = Some(limit);
3661 self
3662 }
3663 }
3664 impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
3665 where
3666 T: MovePackageService,
3667 B: Body + std::marker::Send + 'static,
3668 B::Error: Into<StdError> + std::marker::Send + 'static,
3669 {
3670 type Response = http::Response<tonic::body::Body>;
3671 type Error = std::convert::Infallible;
3672 type Future = BoxFuture<Self::Response, Self::Error>;
3673 fn poll_ready(
3674 &mut self,
3675 _cx: &mut Context<'_>,
3676 ) -> Poll<std::result::Result<(), Self::Error>> {
3677 Poll::Ready(Ok(()))
3678 }
3679 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3680 match req.uri().path() {
3681 "/sui.rpc.v2.MovePackageService/GetPackage" => {
3682 #[allow(non_camel_case_types)]
3683 struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
3684 impl<
3685 T: MovePackageService,
3686 > tonic::server::UnaryService<super::GetPackageRequest>
3687 for GetPackageSvc<T> {
3688 type Response = super::GetPackageResponse;
3689 type Future = BoxFuture<
3690 tonic::Response<Self::Response>,
3691 tonic::Status,
3692 >;
3693 fn call(
3694 &mut self,
3695 request: tonic::Request<super::GetPackageRequest>,
3696 ) -> Self::Future {
3697 let inner = Arc::clone(&self.0);
3698 let fut = async move {
3699 <T as MovePackageService>::get_package(&inner, request)
3700 .await
3701 };
3702 Box::pin(fut)
3703 }
3704 }
3705 let accept_compression_encodings = self.accept_compression_encodings;
3706 let send_compression_encodings = self.send_compression_encodings;
3707 let max_decoding_message_size = self.max_decoding_message_size;
3708 let max_encoding_message_size = self.max_encoding_message_size;
3709 let inner = self.inner.clone();
3710 let fut = async move {
3711 let method = GetPackageSvc(inner);
3712 let codec = tonic_prost::ProstCodec::default();
3713 let mut grpc = tonic::server::Grpc::new(codec)
3714 .apply_compression_config(
3715 accept_compression_encodings,
3716 send_compression_encodings,
3717 )
3718 .apply_max_message_size_config(
3719 max_decoding_message_size,
3720 max_encoding_message_size,
3721 );
3722 let res = grpc.unary(method, req).await;
3723 Ok(res)
3724 };
3725 Box::pin(fut)
3726 }
3727 "/sui.rpc.v2.MovePackageService/GetDatatype" => {
3728 #[allow(non_camel_case_types)]
3729 struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
3730 impl<
3731 T: MovePackageService,
3732 > tonic::server::UnaryService<super::GetDatatypeRequest>
3733 for GetDatatypeSvc<T> {
3734 type Response = super::GetDatatypeResponse;
3735 type Future = BoxFuture<
3736 tonic::Response<Self::Response>,
3737 tonic::Status,
3738 >;
3739 fn call(
3740 &mut self,
3741 request: tonic::Request<super::GetDatatypeRequest>,
3742 ) -> Self::Future {
3743 let inner = Arc::clone(&self.0);
3744 let fut = async move {
3745 <T as MovePackageService>::get_datatype(&inner, request)
3746 .await
3747 };
3748 Box::pin(fut)
3749 }
3750 }
3751 let accept_compression_encodings = self.accept_compression_encodings;
3752 let send_compression_encodings = self.send_compression_encodings;
3753 let max_decoding_message_size = self.max_decoding_message_size;
3754 let max_encoding_message_size = self.max_encoding_message_size;
3755 let inner = self.inner.clone();
3756 let fut = async move {
3757 let method = GetDatatypeSvc(inner);
3758 let codec = tonic_prost::ProstCodec::default();
3759 let mut grpc = tonic::server::Grpc::new(codec)
3760 .apply_compression_config(
3761 accept_compression_encodings,
3762 send_compression_encodings,
3763 )
3764 .apply_max_message_size_config(
3765 max_decoding_message_size,
3766 max_encoding_message_size,
3767 );
3768 let res = grpc.unary(method, req).await;
3769 Ok(res)
3770 };
3771 Box::pin(fut)
3772 }
3773 "/sui.rpc.v2.MovePackageService/GetFunction" => {
3774 #[allow(non_camel_case_types)]
3775 struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
3776 impl<
3777 T: MovePackageService,
3778 > tonic::server::UnaryService<super::GetFunctionRequest>
3779 for GetFunctionSvc<T> {
3780 type Response = super::GetFunctionResponse;
3781 type Future = BoxFuture<
3782 tonic::Response<Self::Response>,
3783 tonic::Status,
3784 >;
3785 fn call(
3786 &mut self,
3787 request: tonic::Request<super::GetFunctionRequest>,
3788 ) -> Self::Future {
3789 let inner = Arc::clone(&self.0);
3790 let fut = async move {
3791 <T as MovePackageService>::get_function(&inner, request)
3792 .await
3793 };
3794 Box::pin(fut)
3795 }
3796 }
3797 let accept_compression_encodings = self.accept_compression_encodings;
3798 let send_compression_encodings = self.send_compression_encodings;
3799 let max_decoding_message_size = self.max_decoding_message_size;
3800 let max_encoding_message_size = self.max_encoding_message_size;
3801 let inner = self.inner.clone();
3802 let fut = async move {
3803 let method = GetFunctionSvc(inner);
3804 let codec = tonic_prost::ProstCodec::default();
3805 let mut grpc = tonic::server::Grpc::new(codec)
3806 .apply_compression_config(
3807 accept_compression_encodings,
3808 send_compression_encodings,
3809 )
3810 .apply_max_message_size_config(
3811 max_decoding_message_size,
3812 max_encoding_message_size,
3813 );
3814 let res = grpc.unary(method, req).await;
3815 Ok(res)
3816 };
3817 Box::pin(fut)
3818 }
3819 "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
3820 #[allow(non_camel_case_types)]
3821 struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
3822 impl<
3823 T: MovePackageService,
3824 > tonic::server::UnaryService<super::ListPackageVersionsRequest>
3825 for ListPackageVersionsSvc<T> {
3826 type Response = super::ListPackageVersionsResponse;
3827 type Future = BoxFuture<
3828 tonic::Response<Self::Response>,
3829 tonic::Status,
3830 >;
3831 fn call(
3832 &mut self,
3833 request: tonic::Request<super::ListPackageVersionsRequest>,
3834 ) -> Self::Future {
3835 let inner = Arc::clone(&self.0);
3836 let fut = async move {
3837 <T as MovePackageService>::list_package_versions(
3838 &inner,
3839 request,
3840 )
3841 .await
3842 };
3843 Box::pin(fut)
3844 }
3845 }
3846 let accept_compression_encodings = self.accept_compression_encodings;
3847 let send_compression_encodings = self.send_compression_encodings;
3848 let max_decoding_message_size = self.max_decoding_message_size;
3849 let max_encoding_message_size = self.max_encoding_message_size;
3850 let inner = self.inner.clone();
3851 let fut = async move {
3852 let method = ListPackageVersionsSvc(inner);
3853 let codec = tonic_prost::ProstCodec::default();
3854 let mut grpc = tonic::server::Grpc::new(codec)
3855 .apply_compression_config(
3856 accept_compression_encodings,
3857 send_compression_encodings,
3858 )
3859 .apply_max_message_size_config(
3860 max_decoding_message_size,
3861 max_encoding_message_size,
3862 );
3863 let res = grpc.unary(method, req).await;
3864 Ok(res)
3865 };
3866 Box::pin(fut)
3867 }
3868 _ => {
3869 Box::pin(async move {
3870 let mut response = http::Response::new(
3871 tonic::body::Body::default(),
3872 );
3873 let headers = response.headers_mut();
3874 headers
3875 .insert(
3876 tonic::Status::GRPC_STATUS,
3877 (tonic::Code::Unimplemented as i32).into(),
3878 );
3879 headers
3880 .insert(
3881 http::header::CONTENT_TYPE,
3882 tonic::metadata::GRPC_CONTENT_TYPE,
3883 );
3884 Ok(response)
3885 })
3886 }
3887 }
3888 }
3889 }
3890 impl<T> Clone for MovePackageServiceServer<T> {
3891 fn clone(&self) -> Self {
3892 let inner = self.inner.clone();
3893 Self {
3894 inner,
3895 accept_compression_encodings: self.accept_compression_encodings,
3896 send_compression_encodings: self.send_compression_encodings,
3897 max_decoding_message_size: self.max_decoding_message_size,
3898 max_encoding_message_size: self.max_encoding_message_size,
3899 }
3900 }
3901 }
3902 pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
3904 impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
3905 const NAME: &'static str = SERVICE_NAME;
3906 }
3907}
3908#[non_exhaustive]
3909#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3910pub struct LookupNameRequest {
3911 #[prost(string, optional, tag = "1")]
3915 pub name: ::core::option::Option<::prost::alloc::string::String>,
3916}
3917#[non_exhaustive]
3918#[derive(Clone, PartialEq, ::prost::Message)]
3919pub struct LookupNameResponse {
3920 #[prost(message, optional, tag = "1")]
3922 pub record: ::core::option::Option<NameRecord>,
3923}
3924#[non_exhaustive]
3925#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3926pub struct ReverseLookupNameRequest {
3927 #[prost(string, optional, tag = "1")]
3929 pub address: ::core::option::Option<::prost::alloc::string::String>,
3930}
3931#[non_exhaustive]
3932#[derive(Clone, PartialEq, ::prost::Message)]
3933pub struct ReverseLookupNameResponse {
3934 #[prost(message, optional, tag = "1")]
3936 pub record: ::core::option::Option<NameRecord>,
3937}
3938#[non_exhaustive]
3939#[derive(Clone, PartialEq, ::prost::Message)]
3940pub struct NameRecord {
3941 #[prost(string, optional, tag = "1")]
3946 pub id: ::core::option::Option<::prost::alloc::string::String>,
3947 #[prost(string, optional, tag = "2")]
3949 pub name: ::core::option::Option<::prost::alloc::string::String>,
3950 #[prost(string, optional, tag = "3")]
3958 pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
3959 #[prost(message, optional, tag = "4")]
3964 pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
3965 #[prost(string, optional, tag = "5")]
3967 pub target_address: ::core::option::Option<::prost::alloc::string::String>,
3968 #[prost(btree_map = "string, string", tag = "6")]
3970 pub data: ::prost::alloc::collections::BTreeMap<
3971 ::prost::alloc::string::String,
3972 ::prost::alloc::string::String,
3973 >,
3974}
3975pub mod name_service_client {
3977 #![allow(
3978 unused_variables,
3979 dead_code,
3980 missing_docs,
3981 clippy::wildcard_imports,
3982 clippy::let_unit_value,
3983 )]
3984 use tonic::codegen::*;
3985 use tonic::codegen::http::Uri;
3986 #[derive(Debug, Clone)]
3987 pub struct NameServiceClient<T> {
3988 inner: tonic::client::Grpc<T>,
3989 }
3990 impl NameServiceClient<tonic::transport::Channel> {
3991 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3993 where
3994 D: TryInto<tonic::transport::Endpoint>,
3995 D::Error: Into<StdError>,
3996 {
3997 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3998 Ok(Self::new(conn))
3999 }
4000 }
4001 impl<T> NameServiceClient<T>
4002 where
4003 T: tonic::client::GrpcService<tonic::body::Body>,
4004 T::Error: Into<StdError>,
4005 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4006 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4007 {
4008 pub fn new(inner: T) -> Self {
4009 let inner = tonic::client::Grpc::new(inner);
4010 Self { inner }
4011 }
4012 pub fn with_origin(inner: T, origin: Uri) -> Self {
4013 let inner = tonic::client::Grpc::with_origin(inner, origin);
4014 Self { inner }
4015 }
4016 pub fn with_interceptor<F>(
4017 inner: T,
4018 interceptor: F,
4019 ) -> NameServiceClient<InterceptedService<T, F>>
4020 where
4021 F: tonic::service::Interceptor,
4022 T::ResponseBody: Default,
4023 T: tonic::codegen::Service<
4024 http::Request<tonic::body::Body>,
4025 Response = http::Response<
4026 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4027 >,
4028 >,
4029 <T as tonic::codegen::Service<
4030 http::Request<tonic::body::Body>,
4031 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4032 {
4033 NameServiceClient::new(InterceptedService::new(inner, interceptor))
4034 }
4035 #[must_use]
4040 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4041 self.inner = self.inner.send_compressed(encoding);
4042 self
4043 }
4044 #[must_use]
4046 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4047 self.inner = self.inner.accept_compressed(encoding);
4048 self
4049 }
4050 #[must_use]
4054 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4055 self.inner = self.inner.max_decoding_message_size(limit);
4056 self
4057 }
4058 #[must_use]
4062 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4063 self.inner = self.inner.max_encoding_message_size(limit);
4064 self
4065 }
4066 pub async fn lookup_name(
4067 &mut self,
4068 request: impl tonic::IntoRequest<super::LookupNameRequest>,
4069 ) -> std::result::Result<
4070 tonic::Response<super::LookupNameResponse>,
4071 tonic::Status,
4072 > {
4073 self.inner
4074 .ready()
4075 .await
4076 .map_err(|e| {
4077 tonic::Status::unknown(
4078 format!("Service was not ready: {}", e.into()),
4079 )
4080 })?;
4081 let codec = tonic_prost::ProstCodec::default();
4082 let path = http::uri::PathAndQuery::from_static(
4083 "/sui.rpc.v2.NameService/LookupName",
4084 );
4085 let mut req = request.into_request();
4086 req.extensions_mut()
4087 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
4088 self.inner.unary(req, path, codec).await
4089 }
4090 pub async fn reverse_lookup_name(
4091 &mut self,
4092 request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
4093 ) -> std::result::Result<
4094 tonic::Response<super::ReverseLookupNameResponse>,
4095 tonic::Status,
4096 > {
4097 self.inner
4098 .ready()
4099 .await
4100 .map_err(|e| {
4101 tonic::Status::unknown(
4102 format!("Service was not ready: {}", e.into()),
4103 )
4104 })?;
4105 let codec = tonic_prost::ProstCodec::default();
4106 let path = http::uri::PathAndQuery::from_static(
4107 "/sui.rpc.v2.NameService/ReverseLookupName",
4108 );
4109 let mut req = request.into_request();
4110 req.extensions_mut()
4111 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
4112 self.inner.unary(req, path, codec).await
4113 }
4114 }
4115}
4116pub mod name_service_server {
4118 #![allow(
4119 unused_variables,
4120 dead_code,
4121 missing_docs,
4122 clippy::wildcard_imports,
4123 clippy::let_unit_value,
4124 )]
4125 use tonic::codegen::*;
4126 #[async_trait]
4128 pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
4129 async fn lookup_name(
4130 &self,
4131 request: tonic::Request<super::LookupNameRequest>,
4132 ) -> std::result::Result<
4133 tonic::Response<super::LookupNameResponse>,
4134 tonic::Status,
4135 > {
4136 Err(tonic::Status::unimplemented("Not yet implemented"))
4137 }
4138 async fn reverse_lookup_name(
4139 &self,
4140 request: tonic::Request<super::ReverseLookupNameRequest>,
4141 ) -> std::result::Result<
4142 tonic::Response<super::ReverseLookupNameResponse>,
4143 tonic::Status,
4144 > {
4145 Err(tonic::Status::unimplemented("Not yet implemented"))
4146 }
4147 }
4148 #[derive(Debug)]
4149 pub struct NameServiceServer<T> {
4150 inner: Arc<T>,
4151 accept_compression_encodings: EnabledCompressionEncodings,
4152 send_compression_encodings: EnabledCompressionEncodings,
4153 max_decoding_message_size: Option<usize>,
4154 max_encoding_message_size: Option<usize>,
4155 }
4156 impl<T> NameServiceServer<T> {
4157 pub fn new(inner: T) -> Self {
4158 Self::from_arc(Arc::new(inner))
4159 }
4160 pub fn from_arc(inner: Arc<T>) -> Self {
4161 Self {
4162 inner,
4163 accept_compression_encodings: Default::default(),
4164 send_compression_encodings: Default::default(),
4165 max_decoding_message_size: None,
4166 max_encoding_message_size: None,
4167 }
4168 }
4169 pub fn with_interceptor<F>(
4170 inner: T,
4171 interceptor: F,
4172 ) -> InterceptedService<Self, F>
4173 where
4174 F: tonic::service::Interceptor,
4175 {
4176 InterceptedService::new(Self::new(inner), interceptor)
4177 }
4178 #[must_use]
4180 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4181 self.accept_compression_encodings.enable(encoding);
4182 self
4183 }
4184 #[must_use]
4186 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4187 self.send_compression_encodings.enable(encoding);
4188 self
4189 }
4190 #[must_use]
4194 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4195 self.max_decoding_message_size = Some(limit);
4196 self
4197 }
4198 #[must_use]
4202 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4203 self.max_encoding_message_size = Some(limit);
4204 self
4205 }
4206 }
4207 impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
4208 where
4209 T: NameService,
4210 B: Body + std::marker::Send + 'static,
4211 B::Error: Into<StdError> + std::marker::Send + 'static,
4212 {
4213 type Response = http::Response<tonic::body::Body>;
4214 type Error = std::convert::Infallible;
4215 type Future = BoxFuture<Self::Response, Self::Error>;
4216 fn poll_ready(
4217 &mut self,
4218 _cx: &mut Context<'_>,
4219 ) -> Poll<std::result::Result<(), Self::Error>> {
4220 Poll::Ready(Ok(()))
4221 }
4222 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4223 match req.uri().path() {
4224 "/sui.rpc.v2.NameService/LookupName" => {
4225 #[allow(non_camel_case_types)]
4226 struct LookupNameSvc<T: NameService>(pub Arc<T>);
4227 impl<
4228 T: NameService,
4229 > tonic::server::UnaryService<super::LookupNameRequest>
4230 for LookupNameSvc<T> {
4231 type Response = super::LookupNameResponse;
4232 type Future = BoxFuture<
4233 tonic::Response<Self::Response>,
4234 tonic::Status,
4235 >;
4236 fn call(
4237 &mut self,
4238 request: tonic::Request<super::LookupNameRequest>,
4239 ) -> Self::Future {
4240 let inner = Arc::clone(&self.0);
4241 let fut = async move {
4242 <T as NameService>::lookup_name(&inner, request).await
4243 };
4244 Box::pin(fut)
4245 }
4246 }
4247 let accept_compression_encodings = self.accept_compression_encodings;
4248 let send_compression_encodings = self.send_compression_encodings;
4249 let max_decoding_message_size = self.max_decoding_message_size;
4250 let max_encoding_message_size = self.max_encoding_message_size;
4251 let inner = self.inner.clone();
4252 let fut = async move {
4253 let method = LookupNameSvc(inner);
4254 let codec = tonic_prost::ProstCodec::default();
4255 let mut grpc = tonic::server::Grpc::new(codec)
4256 .apply_compression_config(
4257 accept_compression_encodings,
4258 send_compression_encodings,
4259 )
4260 .apply_max_message_size_config(
4261 max_decoding_message_size,
4262 max_encoding_message_size,
4263 );
4264 let res = grpc.unary(method, req).await;
4265 Ok(res)
4266 };
4267 Box::pin(fut)
4268 }
4269 "/sui.rpc.v2.NameService/ReverseLookupName" => {
4270 #[allow(non_camel_case_types)]
4271 struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
4272 impl<
4273 T: NameService,
4274 > tonic::server::UnaryService<super::ReverseLookupNameRequest>
4275 for ReverseLookupNameSvc<T> {
4276 type Response = super::ReverseLookupNameResponse;
4277 type Future = BoxFuture<
4278 tonic::Response<Self::Response>,
4279 tonic::Status,
4280 >;
4281 fn call(
4282 &mut self,
4283 request: tonic::Request<super::ReverseLookupNameRequest>,
4284 ) -> Self::Future {
4285 let inner = Arc::clone(&self.0);
4286 let fut = async move {
4287 <T as NameService>::reverse_lookup_name(&inner, request)
4288 .await
4289 };
4290 Box::pin(fut)
4291 }
4292 }
4293 let accept_compression_encodings = self.accept_compression_encodings;
4294 let send_compression_encodings = self.send_compression_encodings;
4295 let max_decoding_message_size = self.max_decoding_message_size;
4296 let max_encoding_message_size = self.max_encoding_message_size;
4297 let inner = self.inner.clone();
4298 let fut = async move {
4299 let method = ReverseLookupNameSvc(inner);
4300 let codec = tonic_prost::ProstCodec::default();
4301 let mut grpc = tonic::server::Grpc::new(codec)
4302 .apply_compression_config(
4303 accept_compression_encodings,
4304 send_compression_encodings,
4305 )
4306 .apply_max_message_size_config(
4307 max_decoding_message_size,
4308 max_encoding_message_size,
4309 );
4310 let res = grpc.unary(method, req).await;
4311 Ok(res)
4312 };
4313 Box::pin(fut)
4314 }
4315 _ => {
4316 Box::pin(async move {
4317 let mut response = http::Response::new(
4318 tonic::body::Body::default(),
4319 );
4320 let headers = response.headers_mut();
4321 headers
4322 .insert(
4323 tonic::Status::GRPC_STATUS,
4324 (tonic::Code::Unimplemented as i32).into(),
4325 );
4326 headers
4327 .insert(
4328 http::header::CONTENT_TYPE,
4329 tonic::metadata::GRPC_CONTENT_TYPE,
4330 );
4331 Ok(response)
4332 })
4333 }
4334 }
4335 }
4336 }
4337 impl<T> Clone for NameServiceServer<T> {
4338 fn clone(&self) -> Self {
4339 let inner = self.inner.clone();
4340 Self {
4341 inner,
4342 accept_compression_encodings: self.accept_compression_encodings,
4343 send_compression_encodings: self.send_compression_encodings,
4344 max_decoding_message_size: self.max_decoding_message_size,
4345 max_encoding_message_size: self.max_encoding_message_size,
4346 }
4347 }
4348 }
4349 pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
4351 impl<T> tonic::server::NamedService for NameServiceServer<T> {
4352 const NAME: &'static str = SERVICE_NAME;
4353 }
4354}
4355#[non_exhaustive]
4357#[derive(Clone, PartialEq, ::prost::Message)]
4358pub struct Object {
4359 #[prost(message, optional, tag = "1")]
4361 pub bcs: ::core::option::Option<Bcs>,
4362 #[prost(string, optional, tag = "2")]
4364 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4365 #[prost(uint64, optional, tag = "3")]
4367 pub version: ::core::option::Option<u64>,
4368 #[prost(string, optional, tag = "4")]
4370 pub digest: ::core::option::Option<::prost::alloc::string::String>,
4371 #[prost(message, optional, tag = "5")]
4373 pub owner: ::core::option::Option<Owner>,
4374 #[prost(string, optional, tag = "6")]
4378 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
4379 #[prost(bool, optional, tag = "7")]
4384 pub has_public_transfer: ::core::option::Option<bool>,
4385 #[prost(message, optional, tag = "8")]
4389 pub contents: ::core::option::Option<Bcs>,
4390 #[prost(message, optional, tag = "9")]
4392 pub package: ::core::option::Option<Package>,
4393 #[prost(string, optional, tag = "10")]
4395 pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
4396 #[prost(uint64, optional, tag = "11")]
4400 pub storage_rebate: ::core::option::Option<u64>,
4401 #[prost(message, optional, boxed, tag = "100")]
4403 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
4404 #[prost(uint64, optional, tag = "101")]
4406 pub balance: ::core::option::Option<u64>,
4407 #[prost(message, optional, boxed, tag = "102")]
4410 pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
4411}
4412#[non_exhaustive]
4414#[derive(Clone, PartialEq, ::prost::Message)]
4415pub struct ObjectSet {
4416 #[prost(message, repeated, tag = "1")]
4418 pub objects: ::prost::alloc::vec::Vec<Object>,
4419}
4420#[non_exhaustive]
4422#[derive(Clone, PartialEq, ::prost::Message)]
4423pub struct Display {
4424 #[prost(message, optional, tag = "1")]
4428 pub output: ::core::option::Option<::prost_types::Value>,
4429 #[prost(message, optional, tag = "2")]
4433 pub errors: ::core::option::Option<::prost_types::Value>,
4434}
4435#[non_exhaustive]
4437#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4438pub struct ObjectReference {
4439 #[prost(string, optional, tag = "1")]
4441 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4442 #[prost(uint64, optional, tag = "2")]
4444 pub version: ::core::option::Option<u64>,
4445 #[prost(string, optional, tag = "3")]
4447 pub digest: ::core::option::Option<::prost::alloc::string::String>,
4448}
4449#[non_exhaustive]
4451#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4452pub struct Owner {
4453 #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
4454 pub kind: ::core::option::Option<i32>,
4455 #[prost(string, optional, tag = "2")]
4457 pub address: ::core::option::Option<::prost::alloc::string::String>,
4458 #[prost(uint64, optional, tag = "3")]
4460 pub version: ::core::option::Option<u64>,
4461}
4462pub mod owner {
4464 #[non_exhaustive]
4465 #[derive(
4466 Clone,
4467 Copy,
4468 Debug,
4469 PartialEq,
4470 Eq,
4471 Hash,
4472 PartialOrd,
4473 Ord,
4474 ::prost::Enumeration
4475 )]
4476 #[repr(i32)]
4477 pub enum OwnerKind {
4478 Unknown = 0,
4479 Address = 1,
4480 Object = 2,
4481 Shared = 3,
4482 Immutable = 4,
4483 ConsensusAddress = 5,
4484 }
4485 impl OwnerKind {
4486 pub fn as_str_name(&self) -> &'static str {
4491 match self {
4492 Self::Unknown => "OWNER_KIND_UNKNOWN",
4493 Self::Address => "ADDRESS",
4494 Self::Object => "OBJECT",
4495 Self::Shared => "SHARED",
4496 Self::Immutable => "IMMUTABLE",
4497 Self::ConsensusAddress => "CONSENSUS_ADDRESS",
4498 }
4499 }
4500 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4502 match value {
4503 "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
4504 "ADDRESS" => Some(Self::Address),
4505 "OBJECT" => Some(Self::Object),
4506 "SHARED" => Some(Self::Shared),
4507 "IMMUTABLE" => Some(Self::Immutable),
4508 "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
4509 _ => None,
4510 }
4511 }
4512 }
4513}
4514#[non_exhaustive]
4515#[derive(Clone, PartialEq, ::prost::Message)]
4516pub struct ProtocolConfig {
4517 #[prost(uint64, optional, tag = "1")]
4518 pub protocol_version: ::core::option::Option<u64>,
4519 #[prost(btree_map = "string, bool", tag = "2")]
4520 pub feature_flags: ::prost::alloc::collections::BTreeMap<
4521 ::prost::alloc::string::String,
4522 bool,
4523 >,
4524 #[prost(btree_map = "string, string", tag = "3")]
4525 pub attributes: ::prost::alloc::collections::BTreeMap<
4526 ::prost::alloc::string::String,
4527 ::prost::alloc::string::String,
4528 >,
4529}
4530#[non_exhaustive]
4532#[derive(Clone, PartialEq, ::prost::Message)]
4533pub struct UserSignature {
4534 #[prost(message, optional, tag = "1")]
4539 pub bcs: ::core::option::Option<Bcs>,
4540 #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
4542 pub scheme: ::core::option::Option<i32>,
4543 #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
4544 pub signature: ::core::option::Option<user_signature::Signature>,
4545}
4546pub mod user_signature {
4548 #[non_exhaustive]
4549 #[derive(Clone, PartialEq, ::prost::Oneof)]
4550 pub enum Signature {
4551 #[prost(message, tag = "3")]
4553 Simple(super::SimpleSignature),
4554 #[prost(message, tag = "4")]
4556 Multisig(super::MultisigAggregatedSignature),
4557 #[prost(message, tag = "5")]
4559 Zklogin(super::ZkLoginAuthenticator),
4560 #[prost(message, tag = "6")]
4562 Passkey(super::PasskeyAuthenticator),
4563 }
4564}
4565#[non_exhaustive]
4567#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4568pub struct SimpleSignature {
4569 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4571 pub scheme: ::core::option::Option<i32>,
4572 #[prost(bytes = "bytes", optional, tag = "2")]
4574 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4575 #[prost(bytes = "bytes", optional, tag = "3")]
4577 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4578}
4579#[non_exhaustive]
4581#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4582pub struct ZkLoginPublicIdentifier {
4583 #[prost(string, optional, tag = "1")]
4584 pub iss: ::core::option::Option<::prost::alloc::string::String>,
4585 #[prost(string, optional, tag = "2")]
4587 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4588}
4589#[non_exhaustive]
4591#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4592pub struct MultisigMemberPublicKey {
4593 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4595 pub scheme: ::core::option::Option<i32>,
4596 #[prost(bytes = "bytes", optional, tag = "2")]
4598 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4599 #[prost(message, optional, tag = "3")]
4601 pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
4602}
4603#[non_exhaustive]
4605#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4606pub struct MultisigMember {
4607 #[prost(message, optional, tag = "1")]
4609 pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
4610 #[prost(uint32, optional, tag = "2")]
4612 pub weight: ::core::option::Option<u32>,
4613}
4614#[non_exhaustive]
4616#[derive(Clone, PartialEq, ::prost::Message)]
4617pub struct MultisigCommittee {
4618 #[prost(message, repeated, tag = "1")]
4620 pub members: ::prost::alloc::vec::Vec<MultisigMember>,
4621 #[prost(uint32, optional, tag = "2")]
4624 pub threshold: ::core::option::Option<u32>,
4625}
4626#[non_exhaustive]
4628#[derive(Clone, PartialEq, ::prost::Message)]
4629pub struct MultisigAggregatedSignature {
4630 #[prost(message, repeated, tag = "1")]
4634 pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
4635 #[prost(uint32, optional, tag = "2")]
4638 pub bitmap: ::core::option::Option<u32>,
4639 #[prost(bytes = "bytes", optional, tag = "3")]
4642 pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4643 #[prost(message, optional, tag = "4")]
4645 pub committee: ::core::option::Option<MultisigCommittee>,
4646}
4647#[non_exhaustive]
4649#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4650pub struct MultisigMemberSignature {
4651 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4653 pub scheme: ::core::option::Option<i32>,
4654 #[prost(bytes = "bytes", optional, tag = "2")]
4656 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4657 #[prost(message, optional, tag = "3")]
4659 pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
4660 #[prost(message, optional, tag = "4")]
4662 pub passkey: ::core::option::Option<PasskeyAuthenticator>,
4663}
4664#[non_exhaustive]
4666#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4667pub struct ZkLoginAuthenticator {
4668 #[prost(message, optional, tag = "1")]
4670 pub inputs: ::core::option::Option<ZkLoginInputs>,
4671 #[prost(uint64, optional, tag = "2")]
4673 pub max_epoch: ::core::option::Option<u64>,
4674 #[prost(message, optional, tag = "3")]
4676 pub signature: ::core::option::Option<SimpleSignature>,
4677 #[prost(message, optional, tag = "4")]
4679 pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
4680 #[prost(message, optional, tag = "5")]
4682 pub jwk_id: ::core::option::Option<JwkId>,
4683}
4684#[non_exhaustive]
4686#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4687pub struct ZkLoginInputs {
4688 #[prost(message, optional, tag = "1")]
4689 pub proof_points: ::core::option::Option<ZkLoginProof>,
4690 #[prost(message, optional, tag = "2")]
4691 pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
4692 #[prost(string, optional, tag = "3")]
4693 pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
4694 #[prost(string, optional, tag = "4")]
4696 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4697}
4698#[non_exhaustive]
4700#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4701pub struct ZkLoginProof {
4702 #[prost(message, optional, tag = "1")]
4703 pub a: ::core::option::Option<CircomG1>,
4704 #[prost(message, optional, tag = "2")]
4705 pub b: ::core::option::Option<CircomG2>,
4706 #[prost(message, optional, tag = "3")]
4707 pub c: ::core::option::Option<CircomG1>,
4708}
4709#[non_exhaustive]
4711#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4712pub struct ZkLoginClaim {
4713 #[prost(string, optional, tag = "1")]
4714 pub value: ::core::option::Option<::prost::alloc::string::String>,
4715 #[prost(uint32, optional, tag = "2")]
4716 pub index_mod_4: ::core::option::Option<u32>,
4717}
4718#[non_exhaustive]
4720#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4721pub struct CircomG1 {
4722 #[prost(string, optional, tag = "1")]
4724 pub e0: ::core::option::Option<::prost::alloc::string::String>,
4725 #[prost(string, optional, tag = "2")]
4727 pub e1: ::core::option::Option<::prost::alloc::string::String>,
4728 #[prost(string, optional, tag = "3")]
4730 pub e2: ::core::option::Option<::prost::alloc::string::String>,
4731}
4732#[non_exhaustive]
4734#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4735pub struct CircomG2 {
4736 #[prost(string, optional, tag = "1")]
4738 pub e00: ::core::option::Option<::prost::alloc::string::String>,
4739 #[prost(string, optional, tag = "2")]
4741 pub e01: ::core::option::Option<::prost::alloc::string::String>,
4742 #[prost(string, optional, tag = "3")]
4744 pub e10: ::core::option::Option<::prost::alloc::string::String>,
4745 #[prost(string, optional, tag = "4")]
4747 pub e11: ::core::option::Option<::prost::alloc::string::String>,
4748 #[prost(string, optional, tag = "5")]
4750 pub e20: ::core::option::Option<::prost::alloc::string::String>,
4751 #[prost(string, optional, tag = "6")]
4753 pub e21: ::core::option::Option<::prost::alloc::string::String>,
4754}
4755#[non_exhaustive]
4762#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4763pub struct PasskeyAuthenticator {
4764 #[prost(bytes = "bytes", optional, tag = "1")]
4769 pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
4770 #[prost(string, optional, tag = "2")]
4775 pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
4776 #[prost(message, optional, tag = "3")]
4778 pub signature: ::core::option::Option<SimpleSignature>,
4779}
4780#[non_exhaustive]
4782#[derive(Clone, PartialEq, ::prost::Message)]
4783pub struct ValidatorCommittee {
4784 #[prost(uint64, optional, tag = "1")]
4786 pub epoch: ::core::option::Option<u64>,
4787 #[prost(message, repeated, tag = "2")]
4789 pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
4790}
4791#[non_exhaustive]
4793#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4794pub struct ValidatorCommitteeMember {
4795 #[prost(bytes = "bytes", optional, tag = "1")]
4797 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4798 #[prost(uint64, optional, tag = "2")]
4800 pub weight: ::core::option::Option<u64>,
4801}
4802#[non_exhaustive]
4804#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4805pub struct ValidatorAggregatedSignature {
4806 #[prost(uint64, optional, tag = "1")]
4811 pub epoch: ::core::option::Option<u64>,
4812 #[prost(bytes = "bytes", optional, tag = "2")]
4814 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4815 #[prost(bytes = "bytes", optional, tag = "3")]
4818 pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4819}
4820#[non_exhaustive]
4827#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4828#[repr(i32)]
4829pub enum SignatureScheme {
4830 Ed25519 = 0,
4831 Secp256k1 = 1,
4832 Secp256r1 = 2,
4833 Multisig = 3,
4834 Bls12381 = 4,
4835 Zklogin = 5,
4836 Passkey = 6,
4837}
4838impl SignatureScheme {
4839 pub fn as_str_name(&self) -> &'static str {
4844 match self {
4845 Self::Ed25519 => "ED25519",
4846 Self::Secp256k1 => "SECP256K1",
4847 Self::Secp256r1 => "SECP256R1",
4848 Self::Multisig => "MULTISIG",
4849 Self::Bls12381 => "BLS12381",
4850 Self::Zklogin => "ZKLOGIN",
4851 Self::Passkey => "PASSKEY",
4852 }
4853 }
4854 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4856 match value {
4857 "ED25519" => Some(Self::Ed25519),
4858 "SECP256K1" => Some(Self::Secp256k1),
4859 "SECP256R1" => Some(Self::Secp256r1),
4860 "MULTISIG" => Some(Self::Multisig),
4861 "BLS12381" => Some(Self::Bls12381),
4862 "ZKLOGIN" => Some(Self::Zklogin),
4863 "PASSKEY" => Some(Self::Passkey),
4864 _ => None,
4865 }
4866 }
4867}
4868#[non_exhaustive]
4869#[derive(Clone, PartialEq, ::prost::Message)]
4870pub struct VerifySignatureRequest {
4871 #[prost(message, optional, tag = "1")]
4877 pub message: ::core::option::Option<Bcs>,
4878 #[prost(message, optional, tag = "2")]
4880 pub signature: ::core::option::Option<UserSignature>,
4881 #[prost(string, optional, tag = "3")]
4887 pub address: ::core::option::Option<::prost::alloc::string::String>,
4888 #[prost(message, repeated, tag = "4")]
4891 pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
4892}
4893#[non_exhaustive]
4894#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4895pub struct VerifySignatureResponse {
4896 #[prost(bool, optional, tag = "1")]
4898 pub is_valid: ::core::option::Option<bool>,
4899 #[prost(string, optional, tag = "2")]
4901 pub reason: ::core::option::Option<::prost::alloc::string::String>,
4902}
4903pub mod signature_verification_service_client {
4905 #![allow(
4906 unused_variables,
4907 dead_code,
4908 missing_docs,
4909 clippy::wildcard_imports,
4910 clippy::let_unit_value,
4911 )]
4912 use tonic::codegen::*;
4913 use tonic::codegen::http::Uri;
4914 #[derive(Debug, Clone)]
4915 pub struct SignatureVerificationServiceClient<T> {
4916 inner: tonic::client::Grpc<T>,
4917 }
4918 impl SignatureVerificationServiceClient<tonic::transport::Channel> {
4919 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4921 where
4922 D: TryInto<tonic::transport::Endpoint>,
4923 D::Error: Into<StdError>,
4924 {
4925 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4926 Ok(Self::new(conn))
4927 }
4928 }
4929 impl<T> SignatureVerificationServiceClient<T>
4930 where
4931 T: tonic::client::GrpcService<tonic::body::Body>,
4932 T::Error: Into<StdError>,
4933 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4934 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4935 {
4936 pub fn new(inner: T) -> Self {
4937 let inner = tonic::client::Grpc::new(inner);
4938 Self { inner }
4939 }
4940 pub fn with_origin(inner: T, origin: Uri) -> Self {
4941 let inner = tonic::client::Grpc::with_origin(inner, origin);
4942 Self { inner }
4943 }
4944 pub fn with_interceptor<F>(
4945 inner: T,
4946 interceptor: F,
4947 ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
4948 where
4949 F: tonic::service::Interceptor,
4950 T::ResponseBody: Default,
4951 T: tonic::codegen::Service<
4952 http::Request<tonic::body::Body>,
4953 Response = http::Response<
4954 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4955 >,
4956 >,
4957 <T as tonic::codegen::Service<
4958 http::Request<tonic::body::Body>,
4959 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4960 {
4961 SignatureVerificationServiceClient::new(
4962 InterceptedService::new(inner, interceptor),
4963 )
4964 }
4965 #[must_use]
4970 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4971 self.inner = self.inner.send_compressed(encoding);
4972 self
4973 }
4974 #[must_use]
4976 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4977 self.inner = self.inner.accept_compressed(encoding);
4978 self
4979 }
4980 #[must_use]
4984 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4985 self.inner = self.inner.max_decoding_message_size(limit);
4986 self
4987 }
4988 #[must_use]
4992 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4993 self.inner = self.inner.max_encoding_message_size(limit);
4994 self
4995 }
4996 pub async fn verify_signature(
4998 &mut self,
4999 request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
5000 ) -> std::result::Result<
5001 tonic::Response<super::VerifySignatureResponse>,
5002 tonic::Status,
5003 > {
5004 self.inner
5005 .ready()
5006 .await
5007 .map_err(|e| {
5008 tonic::Status::unknown(
5009 format!("Service was not ready: {}", e.into()),
5010 )
5011 })?;
5012 let codec = tonic_prost::ProstCodec::default();
5013 let path = http::uri::PathAndQuery::from_static(
5014 "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
5015 );
5016 let mut req = request.into_request();
5017 req.extensions_mut()
5018 .insert(
5019 GrpcMethod::new(
5020 "sui.rpc.v2.SignatureVerificationService",
5021 "VerifySignature",
5022 ),
5023 );
5024 self.inner.unary(req, path, codec).await
5025 }
5026 }
5027}
5028pub mod signature_verification_service_server {
5030 #![allow(
5031 unused_variables,
5032 dead_code,
5033 missing_docs,
5034 clippy::wildcard_imports,
5035 clippy::let_unit_value,
5036 )]
5037 use tonic::codegen::*;
5038 #[async_trait]
5040 pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
5041 async fn verify_signature(
5043 &self,
5044 request: tonic::Request<super::VerifySignatureRequest>,
5045 ) -> std::result::Result<
5046 tonic::Response<super::VerifySignatureResponse>,
5047 tonic::Status,
5048 > {
5049 Err(tonic::Status::unimplemented("Not yet implemented"))
5050 }
5051 }
5052 #[derive(Debug)]
5053 pub struct SignatureVerificationServiceServer<T> {
5054 inner: Arc<T>,
5055 accept_compression_encodings: EnabledCompressionEncodings,
5056 send_compression_encodings: EnabledCompressionEncodings,
5057 max_decoding_message_size: Option<usize>,
5058 max_encoding_message_size: Option<usize>,
5059 }
5060 impl<T> SignatureVerificationServiceServer<T> {
5061 pub fn new(inner: T) -> Self {
5062 Self::from_arc(Arc::new(inner))
5063 }
5064 pub fn from_arc(inner: Arc<T>) -> Self {
5065 Self {
5066 inner,
5067 accept_compression_encodings: Default::default(),
5068 send_compression_encodings: Default::default(),
5069 max_decoding_message_size: None,
5070 max_encoding_message_size: None,
5071 }
5072 }
5073 pub fn with_interceptor<F>(
5074 inner: T,
5075 interceptor: F,
5076 ) -> InterceptedService<Self, F>
5077 where
5078 F: tonic::service::Interceptor,
5079 {
5080 InterceptedService::new(Self::new(inner), interceptor)
5081 }
5082 #[must_use]
5084 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5085 self.accept_compression_encodings.enable(encoding);
5086 self
5087 }
5088 #[must_use]
5090 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5091 self.send_compression_encodings.enable(encoding);
5092 self
5093 }
5094 #[must_use]
5098 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5099 self.max_decoding_message_size = Some(limit);
5100 self
5101 }
5102 #[must_use]
5106 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5107 self.max_encoding_message_size = Some(limit);
5108 self
5109 }
5110 }
5111 impl<T, B> tonic::codegen::Service<http::Request<B>>
5112 for SignatureVerificationServiceServer<T>
5113 where
5114 T: SignatureVerificationService,
5115 B: Body + std::marker::Send + 'static,
5116 B::Error: Into<StdError> + std::marker::Send + 'static,
5117 {
5118 type Response = http::Response<tonic::body::Body>;
5119 type Error = std::convert::Infallible;
5120 type Future = BoxFuture<Self::Response, Self::Error>;
5121 fn poll_ready(
5122 &mut self,
5123 _cx: &mut Context<'_>,
5124 ) -> Poll<std::result::Result<(), Self::Error>> {
5125 Poll::Ready(Ok(()))
5126 }
5127 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5128 match req.uri().path() {
5129 "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
5130 #[allow(non_camel_case_types)]
5131 struct VerifySignatureSvc<T: SignatureVerificationService>(
5132 pub Arc<T>,
5133 );
5134 impl<
5135 T: SignatureVerificationService,
5136 > tonic::server::UnaryService<super::VerifySignatureRequest>
5137 for VerifySignatureSvc<T> {
5138 type Response = super::VerifySignatureResponse;
5139 type Future = BoxFuture<
5140 tonic::Response<Self::Response>,
5141 tonic::Status,
5142 >;
5143 fn call(
5144 &mut self,
5145 request: tonic::Request<super::VerifySignatureRequest>,
5146 ) -> Self::Future {
5147 let inner = Arc::clone(&self.0);
5148 let fut = async move {
5149 <T as SignatureVerificationService>::verify_signature(
5150 &inner,
5151 request,
5152 )
5153 .await
5154 };
5155 Box::pin(fut)
5156 }
5157 }
5158 let accept_compression_encodings = self.accept_compression_encodings;
5159 let send_compression_encodings = self.send_compression_encodings;
5160 let max_decoding_message_size = self.max_decoding_message_size;
5161 let max_encoding_message_size = self.max_encoding_message_size;
5162 let inner = self.inner.clone();
5163 let fut = async move {
5164 let method = VerifySignatureSvc(inner);
5165 let codec = tonic_prost::ProstCodec::default();
5166 let mut grpc = tonic::server::Grpc::new(codec)
5167 .apply_compression_config(
5168 accept_compression_encodings,
5169 send_compression_encodings,
5170 )
5171 .apply_max_message_size_config(
5172 max_decoding_message_size,
5173 max_encoding_message_size,
5174 );
5175 let res = grpc.unary(method, req).await;
5176 Ok(res)
5177 };
5178 Box::pin(fut)
5179 }
5180 _ => {
5181 Box::pin(async move {
5182 let mut response = http::Response::new(
5183 tonic::body::Body::default(),
5184 );
5185 let headers = response.headers_mut();
5186 headers
5187 .insert(
5188 tonic::Status::GRPC_STATUS,
5189 (tonic::Code::Unimplemented as i32).into(),
5190 );
5191 headers
5192 .insert(
5193 http::header::CONTENT_TYPE,
5194 tonic::metadata::GRPC_CONTENT_TYPE,
5195 );
5196 Ok(response)
5197 })
5198 }
5199 }
5200 }
5201 }
5202 impl<T> Clone for SignatureVerificationServiceServer<T> {
5203 fn clone(&self) -> Self {
5204 let inner = self.inner.clone();
5205 Self {
5206 inner,
5207 accept_compression_encodings: self.accept_compression_encodings,
5208 send_compression_encodings: self.send_compression_encodings,
5209 max_decoding_message_size: self.max_decoding_message_size,
5210 max_encoding_message_size: self.max_encoding_message_size,
5211 }
5212 }
5213 }
5214 pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
5216 impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
5217 const NAME: &'static str = SERVICE_NAME;
5218 }
5219}
5220#[non_exhaustive]
5222#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5223pub struct GetCoinInfoRequest {
5224 #[prost(string, optional, tag = "1")]
5226 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5227}
5228#[non_exhaustive]
5230#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5231pub struct GetCoinInfoResponse {
5232 #[prost(string, optional, tag = "1")]
5234 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5235 #[prost(message, optional, tag = "2")]
5238 pub metadata: ::core::option::Option<CoinMetadata>,
5239 #[prost(message, optional, tag = "3")]
5242 pub treasury: ::core::option::Option<CoinTreasury>,
5243 #[prost(message, optional, tag = "4")]
5251 pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
5252}
5253#[non_exhaustive]
5255#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5256pub struct CoinMetadata {
5257 #[prost(string, optional, tag = "1")]
5260 pub id: ::core::option::Option<::prost::alloc::string::String>,
5261 #[prost(uint32, optional, tag = "2")]
5263 pub decimals: ::core::option::Option<u32>,
5264 #[prost(string, optional, tag = "3")]
5266 pub name: ::core::option::Option<::prost::alloc::string::String>,
5267 #[prost(string, optional, tag = "4")]
5269 pub symbol: ::core::option::Option<::prost::alloc::string::String>,
5270 #[prost(string, optional, tag = "5")]
5272 pub description: ::core::option::Option<::prost::alloc::string::String>,
5273 #[prost(string, optional, tag = "6")]
5275 pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
5276 #[prost(string, optional, tag = "7")]
5280 pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
5281 #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
5283 pub metadata_cap_state: ::core::option::Option<i32>,
5284}
5285pub mod coin_metadata {
5287 #[non_exhaustive]
5289 #[derive(
5290 Clone,
5291 Copy,
5292 Debug,
5293 PartialEq,
5294 Eq,
5295 Hash,
5296 PartialOrd,
5297 Ord,
5298 ::prost::Enumeration
5299 )]
5300 #[repr(i32)]
5301 pub enum MetadataCapState {
5302 Unknown = 0,
5305 Claimed = 1,
5307 Unclaimed = 2,
5309 Deleted = 3,
5311 }
5312 impl MetadataCapState {
5313 pub fn as_str_name(&self) -> &'static str {
5318 match self {
5319 Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
5320 Self::Claimed => "CLAIMED",
5321 Self::Unclaimed => "UNCLAIMED",
5322 Self::Deleted => "DELETED",
5323 }
5324 }
5325 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5327 match value {
5328 "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
5329 "CLAIMED" => Some(Self::Claimed),
5330 "UNCLAIMED" => Some(Self::Unclaimed),
5331 "DELETED" => Some(Self::Deleted),
5332 _ => None,
5333 }
5334 }
5335 }
5336}
5337#[non_exhaustive]
5339#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5340pub struct CoinTreasury {
5341 #[prost(string, optional, tag = "1")]
5343 pub id: ::core::option::Option<::prost::alloc::string::String>,
5344 #[prost(uint64, optional, tag = "2")]
5346 pub total_supply: ::core::option::Option<u64>,
5347 #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
5349 pub supply_state: ::core::option::Option<i32>,
5350}
5351pub mod coin_treasury {
5353 #[non_exhaustive]
5355 #[derive(
5356 Clone,
5357 Copy,
5358 Debug,
5359 PartialEq,
5360 Eq,
5361 Hash,
5362 PartialOrd,
5363 Ord,
5364 ::prost::Enumeration
5365 )]
5366 #[repr(i32)]
5367 pub enum SupplyState {
5368 Unknown = 0,
5370 Fixed = 1,
5372 BurnOnly = 2,
5374 }
5375 impl SupplyState {
5376 pub fn as_str_name(&self) -> &'static str {
5381 match self {
5382 Self::Unknown => "SUPPLY_STATE_UNKNOWN",
5383 Self::Fixed => "FIXED",
5384 Self::BurnOnly => "BURN_ONLY",
5385 }
5386 }
5387 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5389 match value {
5390 "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
5391 "FIXED" => Some(Self::Fixed),
5392 "BURN_ONLY" => Some(Self::BurnOnly),
5393 _ => None,
5394 }
5395 }
5396 }
5397}
5398#[non_exhaustive]
5400#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5401pub struct RegulatedCoinMetadata {
5402 #[prost(string, optional, tag = "1")]
5405 pub id: ::core::option::Option<::prost::alloc::string::String>,
5406 #[prost(string, optional, tag = "2")]
5408 pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
5409 #[prost(string, optional, tag = "3")]
5411 pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
5412 #[prost(bool, optional, tag = "4")]
5414 pub allow_global_pause: ::core::option::Option<bool>,
5415 #[prost(uint32, optional, tag = "5")]
5417 pub variant: ::core::option::Option<u32>,
5418 #[prost(
5420 enumeration = "regulated_coin_metadata::CoinRegulatedState",
5421 optional,
5422 tag = "6"
5423 )]
5424 pub coin_regulated_state: ::core::option::Option<i32>,
5425}
5426pub mod regulated_coin_metadata {
5428 #[non_exhaustive]
5430 #[derive(
5431 Clone,
5432 Copy,
5433 Debug,
5434 PartialEq,
5435 Eq,
5436 Hash,
5437 PartialOrd,
5438 Ord,
5439 ::prost::Enumeration
5440 )]
5441 #[repr(i32)]
5442 pub enum CoinRegulatedState {
5443 Unknown = 0,
5448 Regulated = 1,
5450 Unregulated = 2,
5452 }
5453 impl CoinRegulatedState {
5454 pub fn as_str_name(&self) -> &'static str {
5459 match self {
5460 Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
5461 Self::Regulated => "REGULATED",
5462 Self::Unregulated => "UNREGULATED",
5463 }
5464 }
5465 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5467 match value {
5468 "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
5469 "REGULATED" => Some(Self::Regulated),
5470 "UNREGULATED" => Some(Self::Unregulated),
5471 _ => None,
5472 }
5473 }
5474 }
5475}
5476#[non_exhaustive]
5478#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5479pub struct GetBalanceRequest {
5480 #[prost(string, optional, tag = "1")]
5482 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5483 #[prost(string, optional, tag = "2")]
5485 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5486}
5487#[non_exhaustive]
5490#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5491pub struct GetBalanceResponse {
5492 #[prost(message, optional, tag = "1")]
5494 pub balance: ::core::option::Option<Balance>,
5495}
5496#[non_exhaustive]
5498#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5499pub struct ListBalancesRequest {
5500 #[prost(string, optional, tag = "1")]
5502 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5503 #[prost(uint32, optional, tag = "2")]
5507 pub page_size: ::core::option::Option<u32>,
5508 #[prost(bytes = "bytes", optional, tag = "3")]
5514 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5515}
5516#[non_exhaustive]
5519#[derive(Clone, PartialEq, ::prost::Message)]
5520pub struct ListBalancesResponse {
5521 #[prost(message, repeated, tag = "1")]
5523 pub balances: ::prost::alloc::vec::Vec<Balance>,
5524 #[prost(bytes = "bytes", optional, tag = "2")]
5527 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5528}
5529#[non_exhaustive]
5531#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5532pub struct Balance {
5533 #[prost(string, optional, tag = "1")]
5535 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5536 #[prost(uint64, optional, tag = "3")]
5540 pub balance: ::core::option::Option<u64>,
5541 #[prost(uint64, optional, tag = "4")]
5543 pub address_balance: ::core::option::Option<u64>,
5544 #[prost(uint64, optional, tag = "5")]
5546 pub coin_balance: ::core::option::Option<u64>,
5547}
5548#[non_exhaustive]
5550#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5551pub struct ListDynamicFieldsRequest {
5552 #[prost(string, optional, tag = "1")]
5554 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5555 #[prost(uint32, optional, tag = "2")]
5559 pub page_size: ::core::option::Option<u32>,
5560 #[prost(bytes = "bytes", optional, tag = "3")]
5566 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5567 #[prost(message, optional, tag = "4")]
5570 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5571}
5572#[non_exhaustive]
5574#[derive(Clone, PartialEq, ::prost::Message)]
5575pub struct ListDynamicFieldsResponse {
5576 #[prost(message, repeated, tag = "1")]
5578 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
5579 #[prost(bytes = "bytes", optional, tag = "2")]
5582 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5583}
5584#[non_exhaustive]
5585#[derive(Clone, PartialEq, ::prost::Message)]
5586pub struct DynamicField {
5587 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
5588 pub kind: ::core::option::Option<i32>,
5589 #[prost(string, optional, tag = "2")]
5591 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5592 #[prost(string, optional, tag = "3")]
5594 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
5595 #[prost(message, optional, tag = "4")]
5597 pub field_object: ::core::option::Option<Object>,
5598 #[prost(message, optional, tag = "5")]
5600 pub name: ::core::option::Option<Bcs>,
5601 #[prost(message, optional, tag = "6")]
5603 pub value: ::core::option::Option<Bcs>,
5604 #[prost(string, optional, tag = "7")]
5610 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
5611 #[prost(string, optional, tag = "8")]
5617 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
5618 #[prost(message, optional, tag = "9")]
5620 pub child_object: ::core::option::Option<Object>,
5621}
5622pub mod dynamic_field {
5624 #[non_exhaustive]
5625 #[derive(
5626 Clone,
5627 Copy,
5628 Debug,
5629 PartialEq,
5630 Eq,
5631 Hash,
5632 PartialOrd,
5633 Ord,
5634 ::prost::Enumeration
5635 )]
5636 #[repr(i32)]
5637 pub enum DynamicFieldKind {
5638 Unknown = 0,
5639 Field = 1,
5640 Object = 2,
5641 }
5642 impl DynamicFieldKind {
5643 pub fn as_str_name(&self) -> &'static str {
5648 match self {
5649 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
5650 Self::Field => "FIELD",
5651 Self::Object => "OBJECT",
5652 }
5653 }
5654 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5656 match value {
5657 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
5658 "FIELD" => Some(Self::Field),
5659 "OBJECT" => Some(Self::Object),
5660 _ => None,
5661 }
5662 }
5663 }
5664}
5665#[non_exhaustive]
5666#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5667pub struct ListOwnedObjectsRequest {
5668 #[prost(string, optional, tag = "1")]
5670 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5671 #[prost(uint32, optional, tag = "2")]
5675 pub page_size: ::core::option::Option<u32>,
5676 #[prost(bytes = "bytes", optional, tag = "3")]
5682 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5683 #[prost(message, optional, tag = "4")]
5686 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5687 #[prost(string, optional, tag = "5")]
5696 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5697}
5698#[non_exhaustive]
5699#[derive(Clone, PartialEq, ::prost::Message)]
5700pub struct ListOwnedObjectsResponse {
5701 #[prost(message, repeated, tag = "1")]
5703 pub objects: ::prost::alloc::vec::Vec<Object>,
5704 #[prost(bytes = "bytes", optional, tag = "2")]
5707 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5708}
5709pub mod state_service_client {
5711 #![allow(
5712 unused_variables,
5713 dead_code,
5714 missing_docs,
5715 clippy::wildcard_imports,
5716 clippy::let_unit_value,
5717 )]
5718 use tonic::codegen::*;
5719 use tonic::codegen::http::Uri;
5720 #[derive(Debug, Clone)]
5721 pub struct StateServiceClient<T> {
5722 inner: tonic::client::Grpc<T>,
5723 }
5724 impl StateServiceClient<tonic::transport::Channel> {
5725 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5727 where
5728 D: TryInto<tonic::transport::Endpoint>,
5729 D::Error: Into<StdError>,
5730 {
5731 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5732 Ok(Self::new(conn))
5733 }
5734 }
5735 impl<T> StateServiceClient<T>
5736 where
5737 T: tonic::client::GrpcService<tonic::body::Body>,
5738 T::Error: Into<StdError>,
5739 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5740 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5741 {
5742 pub fn new(inner: T) -> Self {
5743 let inner = tonic::client::Grpc::new(inner);
5744 Self { inner }
5745 }
5746 pub fn with_origin(inner: T, origin: Uri) -> Self {
5747 let inner = tonic::client::Grpc::with_origin(inner, origin);
5748 Self { inner }
5749 }
5750 pub fn with_interceptor<F>(
5751 inner: T,
5752 interceptor: F,
5753 ) -> StateServiceClient<InterceptedService<T, F>>
5754 where
5755 F: tonic::service::Interceptor,
5756 T::ResponseBody: Default,
5757 T: tonic::codegen::Service<
5758 http::Request<tonic::body::Body>,
5759 Response = http::Response<
5760 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5761 >,
5762 >,
5763 <T as tonic::codegen::Service<
5764 http::Request<tonic::body::Body>,
5765 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5766 {
5767 StateServiceClient::new(InterceptedService::new(inner, interceptor))
5768 }
5769 #[must_use]
5774 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5775 self.inner = self.inner.send_compressed(encoding);
5776 self
5777 }
5778 #[must_use]
5780 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5781 self.inner = self.inner.accept_compressed(encoding);
5782 self
5783 }
5784 #[must_use]
5788 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5789 self.inner = self.inner.max_decoding_message_size(limit);
5790 self
5791 }
5792 #[must_use]
5796 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5797 self.inner = self.inner.max_encoding_message_size(limit);
5798 self
5799 }
5800 pub async fn list_dynamic_fields(
5801 &mut self,
5802 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
5803 ) -> std::result::Result<
5804 tonic::Response<super::ListDynamicFieldsResponse>,
5805 tonic::Status,
5806 > {
5807 self.inner
5808 .ready()
5809 .await
5810 .map_err(|e| {
5811 tonic::Status::unknown(
5812 format!("Service was not ready: {}", e.into()),
5813 )
5814 })?;
5815 let codec = tonic_prost::ProstCodec::default();
5816 let path = http::uri::PathAndQuery::from_static(
5817 "/sui.rpc.v2.StateService/ListDynamicFields",
5818 );
5819 let mut req = request.into_request();
5820 req.extensions_mut()
5821 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
5822 self.inner.unary(req, path, codec).await
5823 }
5824 pub async fn list_owned_objects(
5825 &mut self,
5826 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
5827 ) -> std::result::Result<
5828 tonic::Response<super::ListOwnedObjectsResponse>,
5829 tonic::Status,
5830 > {
5831 self.inner
5832 .ready()
5833 .await
5834 .map_err(|e| {
5835 tonic::Status::unknown(
5836 format!("Service was not ready: {}", e.into()),
5837 )
5838 })?;
5839 let codec = tonic_prost::ProstCodec::default();
5840 let path = http::uri::PathAndQuery::from_static(
5841 "/sui.rpc.v2.StateService/ListOwnedObjects",
5842 );
5843 let mut req = request.into_request();
5844 req.extensions_mut()
5845 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
5846 self.inner.unary(req, path, codec).await
5847 }
5848 pub async fn get_coin_info(
5849 &mut self,
5850 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
5851 ) -> std::result::Result<
5852 tonic::Response<super::GetCoinInfoResponse>,
5853 tonic::Status,
5854 > {
5855 self.inner
5856 .ready()
5857 .await
5858 .map_err(|e| {
5859 tonic::Status::unknown(
5860 format!("Service was not ready: {}", e.into()),
5861 )
5862 })?;
5863 let codec = tonic_prost::ProstCodec::default();
5864 let path = http::uri::PathAndQuery::from_static(
5865 "/sui.rpc.v2.StateService/GetCoinInfo",
5866 );
5867 let mut req = request.into_request();
5868 req.extensions_mut()
5869 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
5870 self.inner.unary(req, path, codec).await
5871 }
5872 pub async fn get_balance(
5873 &mut self,
5874 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
5875 ) -> std::result::Result<
5876 tonic::Response<super::GetBalanceResponse>,
5877 tonic::Status,
5878 > {
5879 self.inner
5880 .ready()
5881 .await
5882 .map_err(|e| {
5883 tonic::Status::unknown(
5884 format!("Service was not ready: {}", e.into()),
5885 )
5886 })?;
5887 let codec = tonic_prost::ProstCodec::default();
5888 let path = http::uri::PathAndQuery::from_static(
5889 "/sui.rpc.v2.StateService/GetBalance",
5890 );
5891 let mut req = request.into_request();
5892 req.extensions_mut()
5893 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
5894 self.inner.unary(req, path, codec).await
5895 }
5896 pub async fn list_balances(
5897 &mut self,
5898 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
5899 ) -> std::result::Result<
5900 tonic::Response<super::ListBalancesResponse>,
5901 tonic::Status,
5902 > {
5903 self.inner
5904 .ready()
5905 .await
5906 .map_err(|e| {
5907 tonic::Status::unknown(
5908 format!("Service was not ready: {}", e.into()),
5909 )
5910 })?;
5911 let codec = tonic_prost::ProstCodec::default();
5912 let path = http::uri::PathAndQuery::from_static(
5913 "/sui.rpc.v2.StateService/ListBalances",
5914 );
5915 let mut req = request.into_request();
5916 req.extensions_mut()
5917 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
5918 self.inner.unary(req, path, codec).await
5919 }
5920 }
5921}
5922pub mod state_service_server {
5924 #![allow(
5925 unused_variables,
5926 dead_code,
5927 missing_docs,
5928 clippy::wildcard_imports,
5929 clippy::let_unit_value,
5930 )]
5931 use tonic::codegen::*;
5932 #[async_trait]
5934 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
5935 async fn list_dynamic_fields(
5936 &self,
5937 request: tonic::Request<super::ListDynamicFieldsRequest>,
5938 ) -> std::result::Result<
5939 tonic::Response<super::ListDynamicFieldsResponse>,
5940 tonic::Status,
5941 > {
5942 Err(tonic::Status::unimplemented("Not yet implemented"))
5943 }
5944 async fn list_owned_objects(
5945 &self,
5946 request: tonic::Request<super::ListOwnedObjectsRequest>,
5947 ) -> std::result::Result<
5948 tonic::Response<super::ListOwnedObjectsResponse>,
5949 tonic::Status,
5950 > {
5951 Err(tonic::Status::unimplemented("Not yet implemented"))
5952 }
5953 async fn get_coin_info(
5954 &self,
5955 request: tonic::Request<super::GetCoinInfoRequest>,
5956 ) -> std::result::Result<
5957 tonic::Response<super::GetCoinInfoResponse>,
5958 tonic::Status,
5959 > {
5960 Err(tonic::Status::unimplemented("Not yet implemented"))
5961 }
5962 async fn get_balance(
5963 &self,
5964 request: tonic::Request<super::GetBalanceRequest>,
5965 ) -> std::result::Result<
5966 tonic::Response<super::GetBalanceResponse>,
5967 tonic::Status,
5968 > {
5969 Err(tonic::Status::unimplemented("Not yet implemented"))
5970 }
5971 async fn list_balances(
5972 &self,
5973 request: tonic::Request<super::ListBalancesRequest>,
5974 ) -> std::result::Result<
5975 tonic::Response<super::ListBalancesResponse>,
5976 tonic::Status,
5977 > {
5978 Err(tonic::Status::unimplemented("Not yet implemented"))
5979 }
5980 }
5981 #[derive(Debug)]
5982 pub struct StateServiceServer<T> {
5983 inner: Arc<T>,
5984 accept_compression_encodings: EnabledCompressionEncodings,
5985 send_compression_encodings: EnabledCompressionEncodings,
5986 max_decoding_message_size: Option<usize>,
5987 max_encoding_message_size: Option<usize>,
5988 }
5989 impl<T> StateServiceServer<T> {
5990 pub fn new(inner: T) -> Self {
5991 Self::from_arc(Arc::new(inner))
5992 }
5993 pub fn from_arc(inner: Arc<T>) -> Self {
5994 Self {
5995 inner,
5996 accept_compression_encodings: Default::default(),
5997 send_compression_encodings: Default::default(),
5998 max_decoding_message_size: None,
5999 max_encoding_message_size: None,
6000 }
6001 }
6002 pub fn with_interceptor<F>(
6003 inner: T,
6004 interceptor: F,
6005 ) -> InterceptedService<Self, F>
6006 where
6007 F: tonic::service::Interceptor,
6008 {
6009 InterceptedService::new(Self::new(inner), interceptor)
6010 }
6011 #[must_use]
6013 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6014 self.accept_compression_encodings.enable(encoding);
6015 self
6016 }
6017 #[must_use]
6019 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6020 self.send_compression_encodings.enable(encoding);
6021 self
6022 }
6023 #[must_use]
6027 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6028 self.max_decoding_message_size = Some(limit);
6029 self
6030 }
6031 #[must_use]
6035 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6036 self.max_encoding_message_size = Some(limit);
6037 self
6038 }
6039 }
6040 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
6041 where
6042 T: StateService,
6043 B: Body + std::marker::Send + 'static,
6044 B::Error: Into<StdError> + std::marker::Send + 'static,
6045 {
6046 type Response = http::Response<tonic::body::Body>;
6047 type Error = std::convert::Infallible;
6048 type Future = BoxFuture<Self::Response, Self::Error>;
6049 fn poll_ready(
6050 &mut self,
6051 _cx: &mut Context<'_>,
6052 ) -> Poll<std::result::Result<(), Self::Error>> {
6053 Poll::Ready(Ok(()))
6054 }
6055 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6056 match req.uri().path() {
6057 "/sui.rpc.v2.StateService/ListDynamicFields" => {
6058 #[allow(non_camel_case_types)]
6059 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
6060 impl<
6061 T: StateService,
6062 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
6063 for ListDynamicFieldsSvc<T> {
6064 type Response = super::ListDynamicFieldsResponse;
6065 type Future = BoxFuture<
6066 tonic::Response<Self::Response>,
6067 tonic::Status,
6068 >;
6069 fn call(
6070 &mut self,
6071 request: tonic::Request<super::ListDynamicFieldsRequest>,
6072 ) -> Self::Future {
6073 let inner = Arc::clone(&self.0);
6074 let fut = async move {
6075 <T as StateService>::list_dynamic_fields(&inner, request)
6076 .await
6077 };
6078 Box::pin(fut)
6079 }
6080 }
6081 let accept_compression_encodings = self.accept_compression_encodings;
6082 let send_compression_encodings = self.send_compression_encodings;
6083 let max_decoding_message_size = self.max_decoding_message_size;
6084 let max_encoding_message_size = self.max_encoding_message_size;
6085 let inner = self.inner.clone();
6086 let fut = async move {
6087 let method = ListDynamicFieldsSvc(inner);
6088 let codec = tonic_prost::ProstCodec::default();
6089 let mut grpc = tonic::server::Grpc::new(codec)
6090 .apply_compression_config(
6091 accept_compression_encodings,
6092 send_compression_encodings,
6093 )
6094 .apply_max_message_size_config(
6095 max_decoding_message_size,
6096 max_encoding_message_size,
6097 );
6098 let res = grpc.unary(method, req).await;
6099 Ok(res)
6100 };
6101 Box::pin(fut)
6102 }
6103 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
6104 #[allow(non_camel_case_types)]
6105 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
6106 impl<
6107 T: StateService,
6108 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
6109 for ListOwnedObjectsSvc<T> {
6110 type Response = super::ListOwnedObjectsResponse;
6111 type Future = BoxFuture<
6112 tonic::Response<Self::Response>,
6113 tonic::Status,
6114 >;
6115 fn call(
6116 &mut self,
6117 request: tonic::Request<super::ListOwnedObjectsRequest>,
6118 ) -> Self::Future {
6119 let inner = Arc::clone(&self.0);
6120 let fut = async move {
6121 <T as StateService>::list_owned_objects(&inner, request)
6122 .await
6123 };
6124 Box::pin(fut)
6125 }
6126 }
6127 let accept_compression_encodings = self.accept_compression_encodings;
6128 let send_compression_encodings = self.send_compression_encodings;
6129 let max_decoding_message_size = self.max_decoding_message_size;
6130 let max_encoding_message_size = self.max_encoding_message_size;
6131 let inner = self.inner.clone();
6132 let fut = async move {
6133 let method = ListOwnedObjectsSvc(inner);
6134 let codec = tonic_prost::ProstCodec::default();
6135 let mut grpc = tonic::server::Grpc::new(codec)
6136 .apply_compression_config(
6137 accept_compression_encodings,
6138 send_compression_encodings,
6139 )
6140 .apply_max_message_size_config(
6141 max_decoding_message_size,
6142 max_encoding_message_size,
6143 );
6144 let res = grpc.unary(method, req).await;
6145 Ok(res)
6146 };
6147 Box::pin(fut)
6148 }
6149 "/sui.rpc.v2.StateService/GetCoinInfo" => {
6150 #[allow(non_camel_case_types)]
6151 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
6152 impl<
6153 T: StateService,
6154 > tonic::server::UnaryService<super::GetCoinInfoRequest>
6155 for GetCoinInfoSvc<T> {
6156 type Response = super::GetCoinInfoResponse;
6157 type Future = BoxFuture<
6158 tonic::Response<Self::Response>,
6159 tonic::Status,
6160 >;
6161 fn call(
6162 &mut self,
6163 request: tonic::Request<super::GetCoinInfoRequest>,
6164 ) -> Self::Future {
6165 let inner = Arc::clone(&self.0);
6166 let fut = async move {
6167 <T as StateService>::get_coin_info(&inner, request).await
6168 };
6169 Box::pin(fut)
6170 }
6171 }
6172 let accept_compression_encodings = self.accept_compression_encodings;
6173 let send_compression_encodings = self.send_compression_encodings;
6174 let max_decoding_message_size = self.max_decoding_message_size;
6175 let max_encoding_message_size = self.max_encoding_message_size;
6176 let inner = self.inner.clone();
6177 let fut = async move {
6178 let method = GetCoinInfoSvc(inner);
6179 let codec = tonic_prost::ProstCodec::default();
6180 let mut grpc = tonic::server::Grpc::new(codec)
6181 .apply_compression_config(
6182 accept_compression_encodings,
6183 send_compression_encodings,
6184 )
6185 .apply_max_message_size_config(
6186 max_decoding_message_size,
6187 max_encoding_message_size,
6188 );
6189 let res = grpc.unary(method, req).await;
6190 Ok(res)
6191 };
6192 Box::pin(fut)
6193 }
6194 "/sui.rpc.v2.StateService/GetBalance" => {
6195 #[allow(non_camel_case_types)]
6196 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
6197 impl<
6198 T: StateService,
6199 > tonic::server::UnaryService<super::GetBalanceRequest>
6200 for GetBalanceSvc<T> {
6201 type Response = super::GetBalanceResponse;
6202 type Future = BoxFuture<
6203 tonic::Response<Self::Response>,
6204 tonic::Status,
6205 >;
6206 fn call(
6207 &mut self,
6208 request: tonic::Request<super::GetBalanceRequest>,
6209 ) -> Self::Future {
6210 let inner = Arc::clone(&self.0);
6211 let fut = async move {
6212 <T as StateService>::get_balance(&inner, request).await
6213 };
6214 Box::pin(fut)
6215 }
6216 }
6217 let accept_compression_encodings = self.accept_compression_encodings;
6218 let send_compression_encodings = self.send_compression_encodings;
6219 let max_decoding_message_size = self.max_decoding_message_size;
6220 let max_encoding_message_size = self.max_encoding_message_size;
6221 let inner = self.inner.clone();
6222 let fut = async move {
6223 let method = GetBalanceSvc(inner);
6224 let codec = tonic_prost::ProstCodec::default();
6225 let mut grpc = tonic::server::Grpc::new(codec)
6226 .apply_compression_config(
6227 accept_compression_encodings,
6228 send_compression_encodings,
6229 )
6230 .apply_max_message_size_config(
6231 max_decoding_message_size,
6232 max_encoding_message_size,
6233 );
6234 let res = grpc.unary(method, req).await;
6235 Ok(res)
6236 };
6237 Box::pin(fut)
6238 }
6239 "/sui.rpc.v2.StateService/ListBalances" => {
6240 #[allow(non_camel_case_types)]
6241 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
6242 impl<
6243 T: StateService,
6244 > tonic::server::UnaryService<super::ListBalancesRequest>
6245 for ListBalancesSvc<T> {
6246 type Response = super::ListBalancesResponse;
6247 type Future = BoxFuture<
6248 tonic::Response<Self::Response>,
6249 tonic::Status,
6250 >;
6251 fn call(
6252 &mut self,
6253 request: tonic::Request<super::ListBalancesRequest>,
6254 ) -> Self::Future {
6255 let inner = Arc::clone(&self.0);
6256 let fut = async move {
6257 <T as StateService>::list_balances(&inner, request).await
6258 };
6259 Box::pin(fut)
6260 }
6261 }
6262 let accept_compression_encodings = self.accept_compression_encodings;
6263 let send_compression_encodings = self.send_compression_encodings;
6264 let max_decoding_message_size = self.max_decoding_message_size;
6265 let max_encoding_message_size = self.max_encoding_message_size;
6266 let inner = self.inner.clone();
6267 let fut = async move {
6268 let method = ListBalancesSvc(inner);
6269 let codec = tonic_prost::ProstCodec::default();
6270 let mut grpc = tonic::server::Grpc::new(codec)
6271 .apply_compression_config(
6272 accept_compression_encodings,
6273 send_compression_encodings,
6274 )
6275 .apply_max_message_size_config(
6276 max_decoding_message_size,
6277 max_encoding_message_size,
6278 );
6279 let res = grpc.unary(method, req).await;
6280 Ok(res)
6281 };
6282 Box::pin(fut)
6283 }
6284 _ => {
6285 Box::pin(async move {
6286 let mut response = http::Response::new(
6287 tonic::body::Body::default(),
6288 );
6289 let headers = response.headers_mut();
6290 headers
6291 .insert(
6292 tonic::Status::GRPC_STATUS,
6293 (tonic::Code::Unimplemented as i32).into(),
6294 );
6295 headers
6296 .insert(
6297 http::header::CONTENT_TYPE,
6298 tonic::metadata::GRPC_CONTENT_TYPE,
6299 );
6300 Ok(response)
6301 })
6302 }
6303 }
6304 }
6305 }
6306 impl<T> Clone for StateServiceServer<T> {
6307 fn clone(&self) -> Self {
6308 let inner = self.inner.clone();
6309 Self {
6310 inner,
6311 accept_compression_encodings: self.accept_compression_encodings,
6312 send_compression_encodings: self.send_compression_encodings,
6313 max_decoding_message_size: self.max_decoding_message_size,
6314 max_encoding_message_size: self.max_encoding_message_size,
6315 }
6316 }
6317 }
6318 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
6320 impl<T> tonic::server::NamedService for StateServiceServer<T> {
6321 const NAME: &'static str = SERVICE_NAME;
6322 }
6323}
6324#[non_exhaustive]
6326#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6327pub struct SubscribeCheckpointsRequest {
6328 #[prost(message, optional, tag = "1")]
6331 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6332}
6333#[non_exhaustive]
6335#[derive(Clone, PartialEq, ::prost::Message)]
6336pub struct SubscribeCheckpointsResponse {
6337 #[prost(uint64, optional, tag = "1")]
6340 pub cursor: ::core::option::Option<u64>,
6341 #[prost(message, optional, tag = "2")]
6343 pub checkpoint: ::core::option::Option<Checkpoint>,
6344}
6345pub mod subscription_service_client {
6347 #![allow(
6348 unused_variables,
6349 dead_code,
6350 missing_docs,
6351 clippy::wildcard_imports,
6352 clippy::let_unit_value,
6353 )]
6354 use tonic::codegen::*;
6355 use tonic::codegen::http::Uri;
6356 #[derive(Debug, Clone)]
6357 pub struct SubscriptionServiceClient<T> {
6358 inner: tonic::client::Grpc<T>,
6359 }
6360 impl SubscriptionServiceClient<tonic::transport::Channel> {
6361 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6363 where
6364 D: TryInto<tonic::transport::Endpoint>,
6365 D::Error: Into<StdError>,
6366 {
6367 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6368 Ok(Self::new(conn))
6369 }
6370 }
6371 impl<T> SubscriptionServiceClient<T>
6372 where
6373 T: tonic::client::GrpcService<tonic::body::Body>,
6374 T::Error: Into<StdError>,
6375 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6376 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6377 {
6378 pub fn new(inner: T) -> Self {
6379 let inner = tonic::client::Grpc::new(inner);
6380 Self { inner }
6381 }
6382 pub fn with_origin(inner: T, origin: Uri) -> Self {
6383 let inner = tonic::client::Grpc::with_origin(inner, origin);
6384 Self { inner }
6385 }
6386 pub fn with_interceptor<F>(
6387 inner: T,
6388 interceptor: F,
6389 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
6390 where
6391 F: tonic::service::Interceptor,
6392 T::ResponseBody: Default,
6393 T: tonic::codegen::Service<
6394 http::Request<tonic::body::Body>,
6395 Response = http::Response<
6396 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6397 >,
6398 >,
6399 <T as tonic::codegen::Service<
6400 http::Request<tonic::body::Body>,
6401 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6402 {
6403 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
6404 }
6405 #[must_use]
6410 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6411 self.inner = self.inner.send_compressed(encoding);
6412 self
6413 }
6414 #[must_use]
6416 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6417 self.inner = self.inner.accept_compressed(encoding);
6418 self
6419 }
6420 #[must_use]
6424 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6425 self.inner = self.inner.max_decoding_message_size(limit);
6426 self
6427 }
6428 #[must_use]
6432 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6433 self.inner = self.inner.max_encoding_message_size(limit);
6434 self
6435 }
6436 pub async fn subscribe_checkpoints(
6448 &mut self,
6449 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
6450 ) -> std::result::Result<
6451 tonic::Response<
6452 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
6453 >,
6454 tonic::Status,
6455 > {
6456 self.inner
6457 .ready()
6458 .await
6459 .map_err(|e| {
6460 tonic::Status::unknown(
6461 format!("Service was not ready: {}", e.into()),
6462 )
6463 })?;
6464 let codec = tonic_prost::ProstCodec::default();
6465 let path = http::uri::PathAndQuery::from_static(
6466 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
6467 );
6468 let mut req = request.into_request();
6469 req.extensions_mut()
6470 .insert(
6471 GrpcMethod::new(
6472 "sui.rpc.v2.SubscriptionService",
6473 "SubscribeCheckpoints",
6474 ),
6475 );
6476 self.inner.server_streaming(req, path, codec).await
6477 }
6478 }
6479}
6480pub mod subscription_service_server {
6482 #![allow(
6483 unused_variables,
6484 dead_code,
6485 missing_docs,
6486 clippy::wildcard_imports,
6487 clippy::let_unit_value,
6488 )]
6489 use tonic::codegen::*;
6490 #[async_trait]
6492 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
6493 async fn subscribe_checkpoints(
6505 &self,
6506 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6507 ) -> std::result::Result<
6508 tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
6509 tonic::Status,
6510 > {
6511 Err(tonic::Status::unimplemented("Not yet implemented"))
6512 }
6513 }
6514 #[derive(Debug)]
6515 pub struct SubscriptionServiceServer<T> {
6516 inner: Arc<T>,
6517 accept_compression_encodings: EnabledCompressionEncodings,
6518 send_compression_encodings: EnabledCompressionEncodings,
6519 max_decoding_message_size: Option<usize>,
6520 max_encoding_message_size: Option<usize>,
6521 }
6522 impl<T> SubscriptionServiceServer<T> {
6523 pub fn new(inner: T) -> Self {
6524 Self::from_arc(Arc::new(inner))
6525 }
6526 pub fn from_arc(inner: Arc<T>) -> Self {
6527 Self {
6528 inner,
6529 accept_compression_encodings: Default::default(),
6530 send_compression_encodings: Default::default(),
6531 max_decoding_message_size: None,
6532 max_encoding_message_size: None,
6533 }
6534 }
6535 pub fn with_interceptor<F>(
6536 inner: T,
6537 interceptor: F,
6538 ) -> InterceptedService<Self, F>
6539 where
6540 F: tonic::service::Interceptor,
6541 {
6542 InterceptedService::new(Self::new(inner), interceptor)
6543 }
6544 #[must_use]
6546 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6547 self.accept_compression_encodings.enable(encoding);
6548 self
6549 }
6550 #[must_use]
6552 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6553 self.send_compression_encodings.enable(encoding);
6554 self
6555 }
6556 #[must_use]
6560 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6561 self.max_decoding_message_size = Some(limit);
6562 self
6563 }
6564 #[must_use]
6568 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6569 self.max_encoding_message_size = Some(limit);
6570 self
6571 }
6572 }
6573 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
6574 where
6575 T: SubscriptionService,
6576 B: Body + std::marker::Send + 'static,
6577 B::Error: Into<StdError> + std::marker::Send + 'static,
6578 {
6579 type Response = http::Response<tonic::body::Body>;
6580 type Error = std::convert::Infallible;
6581 type Future = BoxFuture<Self::Response, Self::Error>;
6582 fn poll_ready(
6583 &mut self,
6584 _cx: &mut Context<'_>,
6585 ) -> Poll<std::result::Result<(), Self::Error>> {
6586 Poll::Ready(Ok(()))
6587 }
6588 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6589 match req.uri().path() {
6590 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
6591 #[allow(non_camel_case_types)]
6592 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
6593 impl<
6594 T: SubscriptionService,
6595 > tonic::server::ServerStreamingService<
6596 super::SubscribeCheckpointsRequest,
6597 > for SubscribeCheckpointsSvc<T> {
6598 type Response = super::SubscribeCheckpointsResponse;
6599 type ResponseStream = BoxStream<
6600 super::SubscribeCheckpointsResponse,
6601 >;
6602 type Future = BoxFuture<
6603 tonic::Response<Self::ResponseStream>,
6604 tonic::Status,
6605 >;
6606 fn call(
6607 &mut self,
6608 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6609 ) -> Self::Future {
6610 let inner = Arc::clone(&self.0);
6611 let fut = async move {
6612 <T as SubscriptionService>::subscribe_checkpoints(
6613 &inner,
6614 request,
6615 )
6616 .await
6617 };
6618 Box::pin(fut)
6619 }
6620 }
6621 let accept_compression_encodings = self.accept_compression_encodings;
6622 let send_compression_encodings = self.send_compression_encodings;
6623 let max_decoding_message_size = self.max_decoding_message_size;
6624 let max_encoding_message_size = self.max_encoding_message_size;
6625 let inner = self.inner.clone();
6626 let fut = async move {
6627 let method = SubscribeCheckpointsSvc(inner);
6628 let codec = tonic_prost::ProstCodec::default();
6629 let mut grpc = tonic::server::Grpc::new(codec)
6630 .apply_compression_config(
6631 accept_compression_encodings,
6632 send_compression_encodings,
6633 )
6634 .apply_max_message_size_config(
6635 max_decoding_message_size,
6636 max_encoding_message_size,
6637 );
6638 let res = grpc.server_streaming(method, req).await;
6639 Ok(res)
6640 };
6641 Box::pin(fut)
6642 }
6643 _ => {
6644 Box::pin(async move {
6645 let mut response = http::Response::new(
6646 tonic::body::Body::default(),
6647 );
6648 let headers = response.headers_mut();
6649 headers
6650 .insert(
6651 tonic::Status::GRPC_STATUS,
6652 (tonic::Code::Unimplemented as i32).into(),
6653 );
6654 headers
6655 .insert(
6656 http::header::CONTENT_TYPE,
6657 tonic::metadata::GRPC_CONTENT_TYPE,
6658 );
6659 Ok(response)
6660 })
6661 }
6662 }
6663 }
6664 }
6665 impl<T> Clone for SubscriptionServiceServer<T> {
6666 fn clone(&self) -> Self {
6667 let inner = self.inner.clone();
6668 Self {
6669 inner,
6670 accept_compression_encodings: self.accept_compression_encodings,
6671 send_compression_encodings: self.send_compression_encodings,
6672 max_decoding_message_size: self.max_decoding_message_size,
6673 max_encoding_message_size: self.max_encoding_message_size,
6674 }
6675 }
6676 }
6677 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
6679 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
6680 const NAME: &'static str = SERVICE_NAME;
6681 }
6682}
6683#[non_exhaustive]
6684#[derive(Clone, PartialEq, ::prost::Message)]
6685pub struct SystemState {
6686 #[prost(uint64, optional, tag = "1")]
6688 pub version: ::core::option::Option<u64>,
6689 #[prost(uint64, optional, tag = "2")]
6691 pub epoch: ::core::option::Option<u64>,
6692 #[prost(uint64, optional, tag = "3")]
6694 pub protocol_version: ::core::option::Option<u64>,
6695 #[prost(message, optional, tag = "4")]
6697 pub validators: ::core::option::Option<ValidatorSet>,
6698 #[prost(message, optional, tag = "5")]
6700 pub storage_fund: ::core::option::Option<StorageFund>,
6701 #[prost(message, optional, tag = "6")]
6703 pub parameters: ::core::option::Option<SystemParameters>,
6704 #[prost(uint64, optional, tag = "7")]
6706 pub reference_gas_price: ::core::option::Option<u64>,
6707 #[prost(message, repeated, tag = "8")]
6715 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
6716 #[prost(message, optional, tag = "9")]
6718 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
6719 #[prost(bool, optional, tag = "10")]
6726 pub safe_mode: ::core::option::Option<bool>,
6727 #[prost(uint64, optional, tag = "11")]
6729 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
6730 #[prost(uint64, optional, tag = "12")]
6732 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
6733 #[prost(uint64, optional, tag = "13")]
6735 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
6736 #[prost(uint64, optional, tag = "14")]
6738 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
6739 #[prost(uint64, optional, tag = "15")]
6741 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
6742 #[prost(message, optional, tag = "16")]
6744 pub extra_fields: ::core::option::Option<MoveTable>,
6745}
6746#[non_exhaustive]
6747#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6748pub struct ValidatorReportRecord {
6749 #[prost(string, optional, tag = "1")]
6751 pub reported: ::core::option::Option<::prost::alloc::string::String>,
6752 #[prost(string, repeated, tag = "2")]
6754 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6755}
6756#[non_exhaustive]
6757#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6758pub struct SystemParameters {
6759 #[prost(uint64, optional, tag = "1")]
6761 pub epoch_duration_ms: ::core::option::Option<u64>,
6762 #[prost(uint64, optional, tag = "2")]
6764 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
6765 #[prost(uint64, optional, tag = "3")]
6767 pub min_validator_count: ::core::option::Option<u64>,
6768 #[prost(uint64, optional, tag = "4")]
6771 pub max_validator_count: ::core::option::Option<u64>,
6772 #[prost(uint64, optional, tag = "5")]
6775 pub min_validator_joining_stake: ::core::option::Option<u64>,
6776 #[prost(uint64, optional, tag = "6")]
6781 pub validator_low_stake_threshold: ::core::option::Option<u64>,
6782 #[prost(uint64, optional, tag = "7")]
6786 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
6787 #[prost(uint64, optional, tag = "8")]
6790 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
6791 #[prost(message, optional, tag = "9")]
6793 pub extra_fields: ::core::option::Option<MoveTable>,
6794}
6795#[non_exhaustive]
6797#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6798pub struct MoveTable {
6799 #[prost(string, optional, tag = "1")]
6801 pub id: ::core::option::Option<::prost::alloc::string::String>,
6802 #[prost(uint64, optional, tag = "2")]
6804 pub size: ::core::option::Option<u64>,
6805}
6806#[non_exhaustive]
6807#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6808pub struct StakeSubsidy {
6809 #[prost(uint64, optional, tag = "1")]
6811 pub balance: ::core::option::Option<u64>,
6812 #[prost(uint64, optional, tag = "2")]
6814 pub distribution_counter: ::core::option::Option<u64>,
6815 #[prost(uint64, optional, tag = "3")]
6818 pub current_distribution_amount: ::core::option::Option<u64>,
6819 #[prost(uint64, optional, tag = "4")]
6821 pub stake_subsidy_period_length: ::core::option::Option<u64>,
6822 #[prost(uint32, optional, tag = "5")]
6825 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
6826 #[prost(message, optional, tag = "6")]
6828 pub extra_fields: ::core::option::Option<MoveTable>,
6829}
6830#[non_exhaustive]
6832#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6833pub struct StorageFund {
6834 #[prost(uint64, optional, tag = "1")]
6840 pub total_object_storage_rebates: ::core::option::Option<u64>,
6841 #[prost(uint64, optional, tag = "2")]
6844 pub non_refundable_balance: ::core::option::Option<u64>,
6845}
6846#[non_exhaustive]
6847#[derive(Clone, PartialEq, ::prost::Message)]
6848pub struct ValidatorSet {
6849 #[prost(uint64, optional, tag = "1")]
6852 pub total_stake: ::core::option::Option<u64>,
6853 #[prost(message, repeated, tag = "2")]
6855 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
6856 #[prost(message, optional, tag = "3")]
6861 pub pending_active_validators: ::core::option::Option<MoveTable>,
6862 #[prost(uint64, repeated, tag = "4")]
6865 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
6866 #[prost(message, optional, tag = "5")]
6870 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
6871 #[prost(message, optional, tag = "6")]
6877 pub inactive_validators: ::core::option::Option<MoveTable>,
6878 #[prost(message, optional, tag = "7")]
6886 pub validator_candidates: ::core::option::Option<MoveTable>,
6887 #[prost(btree_map = "string, uint64", tag = "8")]
6889 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
6890 ::prost::alloc::string::String,
6891 u64,
6892 >,
6893 #[prost(message, optional, tag = "9")]
6895 pub extra_fields: ::core::option::Option<MoveTable>,
6896}
6897#[non_exhaustive]
6901#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6902pub struct Validator {
6903 #[prost(string, optional, tag = "1")]
6905 pub name: ::core::option::Option<::prost::alloc::string::String>,
6906 #[prost(string, optional, tag = "2")]
6909 pub address: ::core::option::Option<::prost::alloc::string::String>,
6910 #[prost(string, optional, tag = "3")]
6911 pub description: ::core::option::Option<::prost::alloc::string::String>,
6912 #[prost(string, optional, tag = "4")]
6913 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
6914 #[prost(string, optional, tag = "5")]
6915 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
6916 #[prost(bytes = "bytes", optional, tag = "7")]
6919 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6920 #[prost(bytes = "bytes", optional, tag = "8")]
6922 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6923 #[prost(bytes = "bytes", optional, tag = "10")]
6926 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6927 #[prost(bytes = "bytes", optional, tag = "12")]
6929 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6930 #[prost(string, optional, tag = "13")]
6932 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
6933 #[prost(string, optional, tag = "14")]
6935 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6936 #[prost(string, optional, tag = "15")]
6938 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
6939 #[prost(string, optional, tag = "16")]
6941 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
6942 #[prost(bytes = "bytes", optional, tag = "18")]
6943 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6944 #[prost(bytes = "bytes", optional, tag = "19")]
6945 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6946 #[prost(bytes = "bytes", optional, tag = "21")]
6947 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6948 #[prost(bytes = "bytes", optional, tag = "23")]
6949 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6950 #[prost(string, optional, tag = "24")]
6951 pub next_epoch_network_address: ::core::option::Option<
6952 ::prost::alloc::string::String,
6953 >,
6954 #[prost(string, optional, tag = "25")]
6955 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6956 #[prost(string, optional, tag = "26")]
6957 pub next_epoch_primary_address: ::core::option::Option<
6958 ::prost::alloc::string::String,
6959 >,
6960 #[prost(string, optional, tag = "27")]
6961 pub next_epoch_worker_address: ::core::option::Option<
6962 ::prost::alloc::string::String,
6963 >,
6964 #[prost(message, optional, tag = "28")]
6966 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
6967 #[prost(uint64, optional, tag = "29")]
6970 pub voting_power: ::core::option::Option<u64>,
6971 #[prost(string, optional, tag = "30")]
6973 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6974 #[prost(uint64, optional, tag = "31")]
6976 pub gas_price: ::core::option::Option<u64>,
6977 #[prost(message, optional, tag = "32")]
6979 pub staking_pool: ::core::option::Option<StakingPool>,
6980 #[prost(uint64, optional, tag = "33")]
6982 pub commission_rate: ::core::option::Option<u64>,
6983 #[prost(uint64, optional, tag = "34")]
6985 pub next_epoch_stake: ::core::option::Option<u64>,
6986 #[prost(uint64, optional, tag = "35")]
6988 pub next_epoch_gas_price: ::core::option::Option<u64>,
6989 #[prost(uint64, optional, tag = "36")]
6991 pub next_epoch_commission_rate: ::core::option::Option<u64>,
6992 #[prost(message, optional, tag = "37")]
6994 pub extra_fields: ::core::option::Option<MoveTable>,
6995}
6996#[non_exhaustive]
6998#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6999pub struct StakingPool {
7000 #[prost(string, optional, tag = "1")]
7002 pub id: ::core::option::Option<::prost::alloc::string::String>,
7003 #[prost(uint64, optional, tag = "2")]
7006 pub activation_epoch: ::core::option::Option<u64>,
7007 #[prost(uint64, optional, tag = "3")]
7010 pub deactivation_epoch: ::core::option::Option<u64>,
7011 #[prost(uint64, optional, tag = "4")]
7014 pub sui_balance: ::core::option::Option<u64>,
7015 #[prost(uint64, optional, tag = "5")]
7017 pub rewards_pool: ::core::option::Option<u64>,
7018 #[prost(uint64, optional, tag = "6")]
7020 pub pool_token_balance: ::core::option::Option<u64>,
7021 #[prost(message, optional, tag = "7")]
7028 pub exchange_rates: ::core::option::Option<MoveTable>,
7029 #[prost(uint64, optional, tag = "8")]
7031 pub pending_stake: ::core::option::Option<u64>,
7032 #[prost(uint64, optional, tag = "9")]
7035 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
7036 #[prost(uint64, optional, tag = "10")]
7038 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
7039 #[prost(message, optional, tag = "11")]
7041 pub extra_fields: ::core::option::Option<MoveTable>,
7042}
7043#[non_exhaustive]
7045#[derive(Clone, PartialEq, ::prost::Message)]
7046pub struct Transaction {
7047 #[prost(message, optional, tag = "1")]
7049 pub bcs: ::core::option::Option<Bcs>,
7050 #[prost(string, optional, tag = "2")]
7052 pub digest: ::core::option::Option<::prost::alloc::string::String>,
7053 #[prost(int32, optional, tag = "3")]
7055 pub version: ::core::option::Option<i32>,
7056 #[prost(message, optional, tag = "4")]
7057 pub kind: ::core::option::Option<TransactionKind>,
7058 #[prost(string, optional, tag = "5")]
7059 pub sender: ::core::option::Option<::prost::alloc::string::String>,
7060 #[prost(message, optional, tag = "6")]
7061 pub gas_payment: ::core::option::Option<GasPayment>,
7062 #[prost(message, optional, tag = "7")]
7063 pub expiration: ::core::option::Option<TransactionExpiration>,
7064}
7065#[non_exhaustive]
7067#[derive(Clone, PartialEq, ::prost::Message)]
7068pub struct GasPayment {
7069 #[prost(message, repeated, tag = "1")]
7071 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
7072 #[prost(string, optional, tag = "2")]
7074 pub owner: ::core::option::Option<::prost::alloc::string::String>,
7075 #[prost(uint64, optional, tag = "3")]
7079 pub price: ::core::option::Option<u64>,
7080 #[prost(uint64, optional, tag = "4")]
7082 pub budget: ::core::option::Option<u64>,
7083}
7084#[non_exhaustive]
7086#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7087pub struct TransactionExpiration {
7088 #[prost(
7089 enumeration = "transaction_expiration::TransactionExpirationKind",
7090 optional,
7091 tag = "1"
7092 )]
7093 pub kind: ::core::option::Option<i32>,
7094 #[prost(uint64, optional, tag = "2")]
7097 pub epoch: ::core::option::Option<u64>,
7098 #[prost(uint64, optional, tag = "3")]
7101 pub min_epoch: ::core::option::Option<u64>,
7102 #[prost(message, optional, tag = "4")]
7106 pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7107 #[prost(message, optional, tag = "5")]
7111 pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7112 #[prost(string, optional, tag = "6")]
7114 pub chain: ::core::option::Option<::prost::alloc::string::String>,
7115 #[prost(uint32, optional, tag = "7")]
7117 pub nonce: ::core::option::Option<u32>,
7118}
7119pub mod transaction_expiration {
7121 #[non_exhaustive]
7122 #[derive(
7123 Clone,
7124 Copy,
7125 Debug,
7126 PartialEq,
7127 Eq,
7128 Hash,
7129 PartialOrd,
7130 Ord,
7131 ::prost::Enumeration
7132 )]
7133 #[repr(i32)]
7134 pub enum TransactionExpirationKind {
7135 Unknown = 0,
7136 None = 1,
7138 Epoch = 2,
7141 ValidDuring = 3,
7151 }
7152 impl TransactionExpirationKind {
7153 pub fn as_str_name(&self) -> &'static str {
7158 match self {
7159 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
7160 Self::None => "NONE",
7161 Self::Epoch => "EPOCH",
7162 Self::ValidDuring => "VALID_DURING",
7163 }
7164 }
7165 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7167 match value {
7168 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
7169 "NONE" => Some(Self::None),
7170 "EPOCH" => Some(Self::Epoch),
7171 "VALID_DURING" => Some(Self::ValidDuring),
7172 _ => None,
7173 }
7174 }
7175 }
7176}
7177#[non_exhaustive]
7179#[derive(Clone, PartialEq, ::prost::Message)]
7180pub struct TransactionKind {
7181 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
7182 pub kind: ::core::option::Option<i32>,
7183 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
7184 pub data: ::core::option::Option<transaction_kind::Data>,
7185}
7186pub mod transaction_kind {
7188 #[non_exhaustive]
7189 #[derive(
7190 Clone,
7191 Copy,
7192 Debug,
7193 PartialEq,
7194 Eq,
7195 Hash,
7196 PartialOrd,
7197 Ord,
7198 ::prost::Enumeration
7199 )]
7200 #[repr(i32)]
7201 pub enum Kind {
7202 Unknown = 0,
7203 ProgrammableTransaction = 1,
7205 ChangeEpoch = 2,
7210 Genesis = 3,
7215 ConsensusCommitPrologueV1 = 4,
7217 AuthenticatorStateUpdate = 5,
7219 EndOfEpoch = 6,
7222 RandomnessStateUpdate = 7,
7224 ConsensusCommitPrologueV2 = 8,
7226 ConsensusCommitPrologueV3 = 9,
7228 ConsensusCommitPrologueV4 = 10,
7230 ProgrammableSystemTransaction = 11,
7232 }
7233 impl Kind {
7234 pub fn as_str_name(&self) -> &'static str {
7239 match self {
7240 Self::Unknown => "KIND_UNKNOWN",
7241 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
7242 Self::ChangeEpoch => "CHANGE_EPOCH",
7243 Self::Genesis => "GENESIS",
7244 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
7245 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
7246 Self::EndOfEpoch => "END_OF_EPOCH",
7247 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
7248 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
7249 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
7250 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
7251 Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
7252 }
7253 }
7254 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7256 match value {
7257 "KIND_UNKNOWN" => Some(Self::Unknown),
7258 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
7259 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7260 "GENESIS" => Some(Self::Genesis),
7261 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
7262 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
7263 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
7264 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
7265 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
7266 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
7267 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
7268 "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
7269 Some(Self::ProgrammableSystemTransaction)
7270 }
7271 _ => None,
7272 }
7273 }
7274 }
7275 #[non_exhaustive]
7276 #[derive(Clone, PartialEq, ::prost::Oneof)]
7277 pub enum Data {
7278 #[prost(message, tag = "2")]
7280 ProgrammableTransaction(super::ProgrammableTransaction),
7281 #[prost(message, tag = "3")]
7286 ChangeEpoch(super::ChangeEpoch),
7287 #[prost(message, tag = "4")]
7292 Genesis(super::GenesisTransaction),
7293 #[prost(message, tag = "5")]
7295 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
7296 #[prost(message, tag = "6")]
7298 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
7299 #[prost(message, tag = "7")]
7302 EndOfEpoch(super::EndOfEpochTransaction),
7303 #[prost(message, tag = "8")]
7305 RandomnessStateUpdate(super::RandomnessStateUpdate),
7306 }
7307}
7308#[non_exhaustive]
7313#[derive(Clone, PartialEq, ::prost::Message)]
7314pub struct ProgrammableTransaction {
7315 #[prost(message, repeated, tag = "1")]
7317 pub inputs: ::prost::alloc::vec::Vec<Input>,
7318 #[prost(message, repeated, tag = "2")]
7321 pub commands: ::prost::alloc::vec::Vec<Command>,
7322}
7323#[non_exhaustive]
7325#[derive(Clone, PartialEq, ::prost::Message)]
7326pub struct Command {
7327 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
7328 pub command: ::core::option::Option<command::Command>,
7329}
7330pub mod command {
7332 #[non_exhaustive]
7333 #[derive(Clone, PartialEq, ::prost::Oneof)]
7334 pub enum Command {
7335 #[prost(message, tag = "1")]
7337 MoveCall(super::MoveCall),
7338 #[prost(message, tag = "2")]
7343 TransferObjects(super::TransferObjects),
7344 #[prost(message, tag = "3")]
7347 SplitCoins(super::SplitCoins),
7348 #[prost(message, tag = "4")]
7351 MergeCoins(super::MergeCoins),
7352 #[prost(message, tag = "5")]
7355 Publish(super::Publish),
7356 #[prost(message, tag = "6")]
7360 MakeMoveVector(super::MakeMoveVector),
7361 #[prost(message, tag = "7")]
7370 Upgrade(super::Upgrade),
7371 }
7372}
7373#[non_exhaustive]
7378#[derive(Clone, PartialEq, ::prost::Message)]
7379pub struct MoveCall {
7380 #[prost(string, optional, tag = "1")]
7382 pub package: ::core::option::Option<::prost::alloc::string::String>,
7383 #[prost(string, optional, tag = "2")]
7385 pub module: ::core::option::Option<::prost::alloc::string::String>,
7386 #[prost(string, optional, tag = "3")]
7388 pub function: ::core::option::Option<::prost::alloc::string::String>,
7389 #[prost(string, repeated, tag = "4")]
7391 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7392 #[prost(message, repeated, tag = "5")]
7394 pub arguments: ::prost::alloc::vec::Vec<Argument>,
7395}
7396#[non_exhaustive]
7398#[derive(Clone, PartialEq, ::prost::Message)]
7399pub struct TransferObjects {
7400 #[prost(message, repeated, tag = "1")]
7402 pub objects: ::prost::alloc::vec::Vec<Argument>,
7403 #[prost(message, optional, tag = "2")]
7405 pub address: ::core::option::Option<Argument>,
7406}
7407#[non_exhaustive]
7409#[derive(Clone, PartialEq, ::prost::Message)]
7410pub struct SplitCoins {
7411 #[prost(message, optional, tag = "1")]
7413 pub coin: ::core::option::Option<Argument>,
7414 #[prost(message, repeated, tag = "2")]
7416 pub amounts: ::prost::alloc::vec::Vec<Argument>,
7417}
7418#[non_exhaustive]
7420#[derive(Clone, PartialEq, ::prost::Message)]
7421pub struct MergeCoins {
7422 #[prost(message, optional, tag = "1")]
7424 pub coin: ::core::option::Option<Argument>,
7425 #[prost(message, repeated, tag = "2")]
7429 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
7430}
7431#[non_exhaustive]
7433#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7434pub struct Publish {
7435 #[prost(bytes = "bytes", repeated, tag = "1")]
7437 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7438 #[prost(string, repeated, tag = "2")]
7440 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7441}
7442#[non_exhaustive]
7444#[derive(Clone, PartialEq, ::prost::Message)]
7445pub struct MakeMoveVector {
7446 #[prost(string, optional, tag = "1")]
7451 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
7452 #[prost(message, repeated, tag = "2")]
7454 pub elements: ::prost::alloc::vec::Vec<Argument>,
7455}
7456#[non_exhaustive]
7458#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7459pub struct Upgrade {
7460 #[prost(bytes = "bytes", repeated, tag = "1")]
7462 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7463 #[prost(string, repeated, tag = "2")]
7465 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7466 #[prost(string, optional, tag = "3")]
7468 pub package: ::core::option::Option<::prost::alloc::string::String>,
7469 #[prost(message, optional, tag = "4")]
7471 pub ticket: ::core::option::Option<Argument>,
7472}
7473#[non_exhaustive]
7475#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7476pub struct RandomnessStateUpdate {
7477 #[prost(uint64, optional, tag = "1")]
7479 pub epoch: ::core::option::Option<u64>,
7480 #[prost(uint64, optional, tag = "2")]
7482 pub randomness_round: ::core::option::Option<u64>,
7483 #[prost(bytes = "bytes", optional, tag = "3")]
7485 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
7486 #[prost(uint64, optional, tag = "4")]
7488 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
7489}
7490#[non_exhaustive]
7492#[derive(Clone, PartialEq, ::prost::Message)]
7493pub struct ChangeEpoch {
7494 #[prost(uint64, optional, tag = "1")]
7496 pub epoch: ::core::option::Option<u64>,
7497 #[prost(uint64, optional, tag = "2")]
7499 pub protocol_version: ::core::option::Option<u64>,
7500 #[prost(uint64, optional, tag = "3")]
7502 pub storage_charge: ::core::option::Option<u64>,
7503 #[prost(uint64, optional, tag = "4")]
7505 pub computation_charge: ::core::option::Option<u64>,
7506 #[prost(uint64, optional, tag = "5")]
7508 pub storage_rebate: ::core::option::Option<u64>,
7509 #[prost(uint64, optional, tag = "6")]
7511 pub non_refundable_storage_fee: ::core::option::Option<u64>,
7512 #[prost(message, optional, tag = "7")]
7514 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7515 #[prost(message, repeated, tag = "8")]
7521 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
7522}
7523#[non_exhaustive]
7525#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7526pub struct SystemPackage {
7527 #[prost(uint64, optional, tag = "1")]
7529 pub version: ::core::option::Option<u64>,
7530 #[prost(bytes = "bytes", repeated, tag = "2")]
7532 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7533 #[prost(string, repeated, tag = "3")]
7535 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7536}
7537#[non_exhaustive]
7539#[derive(Clone, PartialEq, ::prost::Message)]
7540pub struct GenesisTransaction {
7541 #[prost(message, repeated, tag = "1")]
7543 pub objects: ::prost::alloc::vec::Vec<Object>,
7544}
7545#[non_exhaustive]
7549#[derive(Clone, PartialEq, ::prost::Message)]
7550pub struct ConsensusCommitPrologue {
7551 #[prost(uint64, optional, tag = "1")]
7555 pub epoch: ::core::option::Option<u64>,
7556 #[prost(uint64, optional, tag = "2")]
7560 pub round: ::core::option::Option<u64>,
7561 #[prost(message, optional, tag = "3")]
7565 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7566 #[prost(string, optional, tag = "4")]
7570 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
7571 #[prost(uint64, optional, tag = "5")]
7576 pub sub_dag_index: ::core::option::Option<u64>,
7577 #[prost(message, optional, tag = "6")]
7581 pub consensus_determined_version_assignments: ::core::option::Option<
7582 ConsensusDeterminedVersionAssignments,
7583 >,
7584 #[prost(string, optional, tag = "7")]
7589 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
7590}
7591#[non_exhaustive]
7593#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7594pub struct VersionAssignment {
7595 #[prost(string, optional, tag = "1")]
7597 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
7598 #[prost(uint64, optional, tag = "2")]
7600 pub start_version: ::core::option::Option<u64>,
7601 #[prost(uint64, optional, tag = "3")]
7603 pub version: ::core::option::Option<u64>,
7604}
7605#[non_exhaustive]
7607#[derive(Clone, PartialEq, ::prost::Message)]
7608pub struct CanceledTransaction {
7609 #[prost(string, optional, tag = "1")]
7611 pub digest: ::core::option::Option<::prost::alloc::string::String>,
7612 #[prost(message, repeated, tag = "2")]
7614 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
7615}
7616#[non_exhaustive]
7618#[derive(Clone, PartialEq, ::prost::Message)]
7619pub struct ConsensusDeterminedVersionAssignments {
7620 #[prost(int32, optional, tag = "1")]
7622 pub version: ::core::option::Option<i32>,
7623 #[prost(message, repeated, tag = "3")]
7625 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
7626}
7627#[non_exhaustive]
7629#[derive(Clone, PartialEq, ::prost::Message)]
7630pub struct AuthenticatorStateUpdate {
7631 #[prost(uint64, optional, tag = "1")]
7633 pub epoch: ::core::option::Option<u64>,
7634 #[prost(uint64, optional, tag = "2")]
7636 pub round: ::core::option::Option<u64>,
7637 #[prost(message, repeated, tag = "3")]
7639 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
7640 #[prost(uint64, optional, tag = "4")]
7642 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7643}
7644#[non_exhaustive]
7646#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7647pub struct ActiveJwk {
7648 #[prost(message, optional, tag = "1")]
7650 pub id: ::core::option::Option<JwkId>,
7651 #[prost(message, optional, tag = "2")]
7653 pub jwk: ::core::option::Option<Jwk>,
7654 #[prost(uint64, optional, tag = "3")]
7656 pub epoch: ::core::option::Option<u64>,
7657}
7658#[non_exhaustive]
7661#[derive(Clone, PartialEq, ::prost::Message)]
7662pub struct EndOfEpochTransaction {
7663 #[prost(message, repeated, tag = "1")]
7664 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
7665}
7666#[non_exhaustive]
7668#[derive(Clone, PartialEq, ::prost::Message)]
7669pub struct EndOfEpochTransactionKind {
7670 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
7671 pub kind: ::core::option::Option<i32>,
7672 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
7673 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
7674}
7675pub mod end_of_epoch_transaction_kind {
7677 #[non_exhaustive]
7678 #[derive(
7679 Clone,
7680 Copy,
7681 Debug,
7682 PartialEq,
7683 Eq,
7684 Hash,
7685 PartialOrd,
7686 Ord,
7687 ::prost::Enumeration
7688 )]
7689 #[repr(i32)]
7690 pub enum Kind {
7691 Unknown = 0,
7692 ChangeEpoch = 1,
7694 AuthenticatorStateCreate = 2,
7696 AuthenticatorStateExpire = 3,
7698 RandomnessStateCreate = 4,
7700 DenyListStateCreate = 5,
7702 BridgeStateCreate = 6,
7704 BridgeCommitteeInit = 7,
7706 StoreExecutionTimeObservations = 8,
7708 AccumulatorRootCreate = 9,
7710 CoinRegistryCreate = 10,
7712 DisplayRegistryCreate = 11,
7714 AddressAliasStateCreate = 12,
7716 WriteAccumulatorStorageCost = 13,
7718 }
7719 impl Kind {
7720 pub fn as_str_name(&self) -> &'static str {
7725 match self {
7726 Self::Unknown => "KIND_UNKNOWN",
7727 Self::ChangeEpoch => "CHANGE_EPOCH",
7728 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
7729 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
7730 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
7731 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
7732 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
7733 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
7734 Self::StoreExecutionTimeObservations => {
7735 "STORE_EXECUTION_TIME_OBSERVATIONS"
7736 }
7737 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
7738 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
7739 Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
7740 Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
7741 Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
7742 }
7743 }
7744 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7746 match value {
7747 "KIND_UNKNOWN" => Some(Self::Unknown),
7748 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7749 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
7750 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
7751 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
7752 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
7753 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
7754 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
7755 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
7756 Some(Self::StoreExecutionTimeObservations)
7757 }
7758 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
7759 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
7760 "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
7761 "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
7762 "WRITE_ACCUMULATOR_STORAGE_COST" => {
7763 Some(Self::WriteAccumulatorStorageCost)
7764 }
7765 _ => None,
7766 }
7767 }
7768 }
7769 #[non_exhaustive]
7770 #[derive(Clone, PartialEq, ::prost::Oneof)]
7771 pub enum Data {
7772 #[prost(message, tag = "2")]
7774 ChangeEpoch(super::ChangeEpoch),
7775 #[prost(message, tag = "3")]
7777 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
7778 #[prost(message, tag = "4")]
7780 ExecutionTimeObservations(super::ExecutionTimeObservations),
7781 #[prost(string, tag = "5")]
7783 BridgeChainId(::prost::alloc::string::String),
7784 #[prost(uint64, tag = "6")]
7786 BridgeObjectVersion(u64),
7787 #[prost(uint64, tag = "7")]
7789 StorageCost(u64),
7790 }
7791}
7792#[non_exhaustive]
7794#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7795pub struct AuthenticatorStateExpire {
7796 #[prost(uint64, optional, tag = "1")]
7798 pub min_epoch: ::core::option::Option<u64>,
7799 #[prost(uint64, optional, tag = "2")]
7801 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7802}
7803#[non_exhaustive]
7804#[derive(Clone, PartialEq, ::prost::Message)]
7805pub struct ExecutionTimeObservations {
7806 #[prost(int32, optional, tag = "1")]
7808 pub version: ::core::option::Option<i32>,
7809 #[prost(message, repeated, tag = "2")]
7810 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
7811}
7812#[non_exhaustive]
7813#[derive(Clone, PartialEq, ::prost::Message)]
7814pub struct ExecutionTimeObservation {
7815 #[prost(
7816 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
7817 optional,
7818 tag = "1"
7819 )]
7820 pub kind: ::core::option::Option<i32>,
7821 #[prost(message, optional, tag = "2")]
7822 pub move_entry_point: ::core::option::Option<MoveCall>,
7823 #[prost(message, repeated, tag = "3")]
7824 pub validator_observations: ::prost::alloc::vec::Vec<
7825 ValidatorExecutionTimeObservation,
7826 >,
7827}
7828pub mod execution_time_observation {
7830 #[non_exhaustive]
7831 #[derive(
7832 Clone,
7833 Copy,
7834 Debug,
7835 PartialEq,
7836 Eq,
7837 Hash,
7838 PartialOrd,
7839 Ord,
7840 ::prost::Enumeration
7841 )]
7842 #[repr(i32)]
7843 pub enum ExecutionTimeObservationKind {
7844 Unknown = 0,
7845 MoveEntryPoint = 1,
7846 TransferObjects = 2,
7847 SplitCoins = 3,
7848 MergeCoins = 4,
7849 Publish = 5,
7850 MakeMoveVector = 6,
7851 Upgrade = 7,
7852 }
7853 impl ExecutionTimeObservationKind {
7854 pub fn as_str_name(&self) -> &'static str {
7859 match self {
7860 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
7861 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
7862 Self::TransferObjects => "TRANSFER_OBJECTS",
7863 Self::SplitCoins => "SPLIT_COINS",
7864 Self::MergeCoins => "MERGE_COINS",
7865 Self::Publish => "PUBLISH",
7866 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
7867 Self::Upgrade => "UPGRADE",
7868 }
7869 }
7870 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7872 match value {
7873 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
7874 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
7875 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
7876 "SPLIT_COINS" => Some(Self::SplitCoins),
7877 "MERGE_COINS" => Some(Self::MergeCoins),
7878 "PUBLISH" => Some(Self::Publish),
7879 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
7880 "UPGRADE" => Some(Self::Upgrade),
7881 _ => None,
7882 }
7883 }
7884 }
7885}
7886#[non_exhaustive]
7887#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7888pub struct ValidatorExecutionTimeObservation {
7889 #[prost(bytes = "bytes", optional, tag = "1")]
7891 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
7892 #[prost(message, optional, tag = "2")]
7894 pub duration: ::core::option::Option<::prost_types::Duration>,
7895}
7896#[non_exhaustive]
7897#[derive(Clone, PartialEq, ::prost::Message)]
7898pub struct ExecuteTransactionRequest {
7899 #[prost(message, optional, tag = "1")]
7901 pub transaction: ::core::option::Option<Transaction>,
7902 #[prost(message, repeated, tag = "2")]
7905 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
7906 #[prost(message, optional, tag = "3")]
7909 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7910}
7911#[non_exhaustive]
7913#[derive(Clone, PartialEq, ::prost::Message)]
7914pub struct ExecuteTransactionResponse {
7915 #[prost(message, optional, tag = "1")]
7916 pub transaction: ::core::option::Option<ExecutedTransaction>,
7917}
7918#[non_exhaustive]
7919#[derive(Clone, PartialEq, ::prost::Message)]
7920pub struct SimulateTransactionRequest {
7921 #[prost(message, optional, tag = "1")]
7922 pub transaction: ::core::option::Option<Transaction>,
7923 #[prost(message, optional, tag = "2")]
7925 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7926 #[prost(
7928 enumeration = "simulate_transaction_request::TransactionChecks",
7929 optional,
7930 tag = "3"
7931 )]
7932 pub checks: ::core::option::Option<i32>,
7933 #[prost(bool, optional, tag = "4")]
7938 pub do_gas_selection: ::core::option::Option<bool>,
7939}
7940pub mod simulate_transaction_request {
7942 #[non_exhaustive]
7944 #[derive(
7945 Clone,
7946 Copy,
7947 Debug,
7948 PartialEq,
7949 Eq,
7950 Hash,
7951 PartialOrd,
7952 Ord,
7953 ::prost::Enumeration
7954 )]
7955 #[repr(i32)]
7956 pub enum TransactionChecks {
7957 Enabled = 0,
7958 Disabled = 1,
7959 }
7960 impl TransactionChecks {
7961 pub fn as_str_name(&self) -> &'static str {
7966 match self {
7967 Self::Enabled => "ENABLED",
7968 Self::Disabled => "DISABLED",
7969 }
7970 }
7971 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7973 match value {
7974 "ENABLED" => Some(Self::Enabled),
7975 "DISABLED" => Some(Self::Disabled),
7976 _ => None,
7977 }
7978 }
7979 }
7980}
7981#[non_exhaustive]
7982#[derive(Clone, PartialEq, ::prost::Message)]
7983pub struct SimulateTransactionResponse {
7984 #[prost(message, optional, tag = "1")]
7985 pub transaction: ::core::option::Option<ExecutedTransaction>,
7986 #[prost(message, repeated, tag = "2")]
7987 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
7988 #[prost(uint64, optional, tag = "3")]
7992 pub suggested_gas_price: ::core::option::Option<u64>,
7993}
7994#[non_exhaustive]
7996#[derive(Clone, PartialEq, ::prost::Message)]
7997pub struct CommandResult {
7998 #[prost(message, repeated, tag = "1")]
7999 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
8000 #[prost(message, repeated, tag = "2")]
8001 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
8002}
8003#[non_exhaustive]
8004#[derive(Clone, PartialEq, ::prost::Message)]
8005pub struct CommandOutput {
8006 #[prost(message, optional, tag = "1")]
8007 pub argument: ::core::option::Option<Argument>,
8008 #[prost(message, optional, tag = "2")]
8009 pub value: ::core::option::Option<Bcs>,
8010 #[prost(message, optional, boxed, tag = "3")]
8012 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
8013}
8014pub mod transaction_execution_service_client {
8016 #![allow(
8017 unused_variables,
8018 dead_code,
8019 missing_docs,
8020 clippy::wildcard_imports,
8021 clippy::let_unit_value,
8022 )]
8023 use tonic::codegen::*;
8024 use tonic::codegen::http::Uri;
8025 #[derive(Debug, Clone)]
8026 pub struct TransactionExecutionServiceClient<T> {
8027 inner: tonic::client::Grpc<T>,
8028 }
8029 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
8030 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8032 where
8033 D: TryInto<tonic::transport::Endpoint>,
8034 D::Error: Into<StdError>,
8035 {
8036 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8037 Ok(Self::new(conn))
8038 }
8039 }
8040 impl<T> TransactionExecutionServiceClient<T>
8041 where
8042 T: tonic::client::GrpcService<tonic::body::Body>,
8043 T::Error: Into<StdError>,
8044 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8045 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8046 {
8047 pub fn new(inner: T) -> Self {
8048 let inner = tonic::client::Grpc::new(inner);
8049 Self { inner }
8050 }
8051 pub fn with_origin(inner: T, origin: Uri) -> Self {
8052 let inner = tonic::client::Grpc::with_origin(inner, origin);
8053 Self { inner }
8054 }
8055 pub fn with_interceptor<F>(
8056 inner: T,
8057 interceptor: F,
8058 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
8059 where
8060 F: tonic::service::Interceptor,
8061 T::ResponseBody: Default,
8062 T: tonic::codegen::Service<
8063 http::Request<tonic::body::Body>,
8064 Response = http::Response<
8065 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8066 >,
8067 >,
8068 <T as tonic::codegen::Service<
8069 http::Request<tonic::body::Body>,
8070 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8071 {
8072 TransactionExecutionServiceClient::new(
8073 InterceptedService::new(inner, interceptor),
8074 )
8075 }
8076 #[must_use]
8081 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8082 self.inner = self.inner.send_compressed(encoding);
8083 self
8084 }
8085 #[must_use]
8087 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8088 self.inner = self.inner.accept_compressed(encoding);
8089 self
8090 }
8091 #[must_use]
8095 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8096 self.inner = self.inner.max_decoding_message_size(limit);
8097 self
8098 }
8099 #[must_use]
8103 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8104 self.inner = self.inner.max_encoding_message_size(limit);
8105 self
8106 }
8107 pub async fn execute_transaction(
8108 &mut self,
8109 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
8110 ) -> std::result::Result<
8111 tonic::Response<super::ExecuteTransactionResponse>,
8112 tonic::Status,
8113 > {
8114 self.inner
8115 .ready()
8116 .await
8117 .map_err(|e| {
8118 tonic::Status::unknown(
8119 format!("Service was not ready: {}", e.into()),
8120 )
8121 })?;
8122 let codec = tonic_prost::ProstCodec::default();
8123 let path = http::uri::PathAndQuery::from_static(
8124 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
8125 );
8126 let mut req = request.into_request();
8127 req.extensions_mut()
8128 .insert(
8129 GrpcMethod::new(
8130 "sui.rpc.v2.TransactionExecutionService",
8131 "ExecuteTransaction",
8132 ),
8133 );
8134 self.inner.unary(req, path, codec).await
8135 }
8136 pub async fn simulate_transaction(
8137 &mut self,
8138 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
8139 ) -> std::result::Result<
8140 tonic::Response<super::SimulateTransactionResponse>,
8141 tonic::Status,
8142 > {
8143 self.inner
8144 .ready()
8145 .await
8146 .map_err(|e| {
8147 tonic::Status::unknown(
8148 format!("Service was not ready: {}", e.into()),
8149 )
8150 })?;
8151 let codec = tonic_prost::ProstCodec::default();
8152 let path = http::uri::PathAndQuery::from_static(
8153 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
8154 );
8155 let mut req = request.into_request();
8156 req.extensions_mut()
8157 .insert(
8158 GrpcMethod::new(
8159 "sui.rpc.v2.TransactionExecutionService",
8160 "SimulateTransaction",
8161 ),
8162 );
8163 self.inner.unary(req, path, codec).await
8164 }
8165 }
8166}
8167pub mod transaction_execution_service_server {
8169 #![allow(
8170 unused_variables,
8171 dead_code,
8172 missing_docs,
8173 clippy::wildcard_imports,
8174 clippy::let_unit_value,
8175 )]
8176 use tonic::codegen::*;
8177 #[async_trait]
8179 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
8180 async fn execute_transaction(
8181 &self,
8182 request: tonic::Request<super::ExecuteTransactionRequest>,
8183 ) -> std::result::Result<
8184 tonic::Response<super::ExecuteTransactionResponse>,
8185 tonic::Status,
8186 > {
8187 Err(tonic::Status::unimplemented("Not yet implemented"))
8188 }
8189 async fn simulate_transaction(
8190 &self,
8191 request: tonic::Request<super::SimulateTransactionRequest>,
8192 ) -> std::result::Result<
8193 tonic::Response<super::SimulateTransactionResponse>,
8194 tonic::Status,
8195 > {
8196 Err(tonic::Status::unimplemented("Not yet implemented"))
8197 }
8198 }
8199 #[derive(Debug)]
8200 pub struct TransactionExecutionServiceServer<T> {
8201 inner: Arc<T>,
8202 accept_compression_encodings: EnabledCompressionEncodings,
8203 send_compression_encodings: EnabledCompressionEncodings,
8204 max_decoding_message_size: Option<usize>,
8205 max_encoding_message_size: Option<usize>,
8206 }
8207 impl<T> TransactionExecutionServiceServer<T> {
8208 pub fn new(inner: T) -> Self {
8209 Self::from_arc(Arc::new(inner))
8210 }
8211 pub fn from_arc(inner: Arc<T>) -> Self {
8212 Self {
8213 inner,
8214 accept_compression_encodings: Default::default(),
8215 send_compression_encodings: Default::default(),
8216 max_decoding_message_size: None,
8217 max_encoding_message_size: None,
8218 }
8219 }
8220 pub fn with_interceptor<F>(
8221 inner: T,
8222 interceptor: F,
8223 ) -> InterceptedService<Self, F>
8224 where
8225 F: tonic::service::Interceptor,
8226 {
8227 InterceptedService::new(Self::new(inner), interceptor)
8228 }
8229 #[must_use]
8231 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8232 self.accept_compression_encodings.enable(encoding);
8233 self
8234 }
8235 #[must_use]
8237 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8238 self.send_compression_encodings.enable(encoding);
8239 self
8240 }
8241 #[must_use]
8245 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8246 self.max_decoding_message_size = Some(limit);
8247 self
8248 }
8249 #[must_use]
8253 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8254 self.max_encoding_message_size = Some(limit);
8255 self
8256 }
8257 }
8258 impl<T, B> tonic::codegen::Service<http::Request<B>>
8259 for TransactionExecutionServiceServer<T>
8260 where
8261 T: TransactionExecutionService,
8262 B: Body + std::marker::Send + 'static,
8263 B::Error: Into<StdError> + std::marker::Send + 'static,
8264 {
8265 type Response = http::Response<tonic::body::Body>;
8266 type Error = std::convert::Infallible;
8267 type Future = BoxFuture<Self::Response, Self::Error>;
8268 fn poll_ready(
8269 &mut self,
8270 _cx: &mut Context<'_>,
8271 ) -> Poll<std::result::Result<(), Self::Error>> {
8272 Poll::Ready(Ok(()))
8273 }
8274 fn call(&mut self, req: http::Request<B>) -> Self::Future {
8275 match req.uri().path() {
8276 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
8277 #[allow(non_camel_case_types)]
8278 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
8279 pub Arc<T>,
8280 );
8281 impl<
8282 T: TransactionExecutionService,
8283 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
8284 for ExecuteTransactionSvc<T> {
8285 type Response = super::ExecuteTransactionResponse;
8286 type Future = BoxFuture<
8287 tonic::Response<Self::Response>,
8288 tonic::Status,
8289 >;
8290 fn call(
8291 &mut self,
8292 request: tonic::Request<super::ExecuteTransactionRequest>,
8293 ) -> Self::Future {
8294 let inner = Arc::clone(&self.0);
8295 let fut = async move {
8296 <T as TransactionExecutionService>::execute_transaction(
8297 &inner,
8298 request,
8299 )
8300 .await
8301 };
8302 Box::pin(fut)
8303 }
8304 }
8305 let accept_compression_encodings = self.accept_compression_encodings;
8306 let send_compression_encodings = self.send_compression_encodings;
8307 let max_decoding_message_size = self.max_decoding_message_size;
8308 let max_encoding_message_size = self.max_encoding_message_size;
8309 let inner = self.inner.clone();
8310 let fut = async move {
8311 let method = ExecuteTransactionSvc(inner);
8312 let codec = tonic_prost::ProstCodec::default();
8313 let mut grpc = tonic::server::Grpc::new(codec)
8314 .apply_compression_config(
8315 accept_compression_encodings,
8316 send_compression_encodings,
8317 )
8318 .apply_max_message_size_config(
8319 max_decoding_message_size,
8320 max_encoding_message_size,
8321 );
8322 let res = grpc.unary(method, req).await;
8323 Ok(res)
8324 };
8325 Box::pin(fut)
8326 }
8327 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
8328 #[allow(non_camel_case_types)]
8329 struct SimulateTransactionSvc<T: TransactionExecutionService>(
8330 pub Arc<T>,
8331 );
8332 impl<
8333 T: TransactionExecutionService,
8334 > tonic::server::UnaryService<super::SimulateTransactionRequest>
8335 for SimulateTransactionSvc<T> {
8336 type Response = super::SimulateTransactionResponse;
8337 type Future = BoxFuture<
8338 tonic::Response<Self::Response>,
8339 tonic::Status,
8340 >;
8341 fn call(
8342 &mut self,
8343 request: tonic::Request<super::SimulateTransactionRequest>,
8344 ) -> Self::Future {
8345 let inner = Arc::clone(&self.0);
8346 let fut = async move {
8347 <T as TransactionExecutionService>::simulate_transaction(
8348 &inner,
8349 request,
8350 )
8351 .await
8352 };
8353 Box::pin(fut)
8354 }
8355 }
8356 let accept_compression_encodings = self.accept_compression_encodings;
8357 let send_compression_encodings = self.send_compression_encodings;
8358 let max_decoding_message_size = self.max_decoding_message_size;
8359 let max_encoding_message_size = self.max_encoding_message_size;
8360 let inner = self.inner.clone();
8361 let fut = async move {
8362 let method = SimulateTransactionSvc(inner);
8363 let codec = tonic_prost::ProstCodec::default();
8364 let mut grpc = tonic::server::Grpc::new(codec)
8365 .apply_compression_config(
8366 accept_compression_encodings,
8367 send_compression_encodings,
8368 )
8369 .apply_max_message_size_config(
8370 max_decoding_message_size,
8371 max_encoding_message_size,
8372 );
8373 let res = grpc.unary(method, req).await;
8374 Ok(res)
8375 };
8376 Box::pin(fut)
8377 }
8378 _ => {
8379 Box::pin(async move {
8380 let mut response = http::Response::new(
8381 tonic::body::Body::default(),
8382 );
8383 let headers = response.headers_mut();
8384 headers
8385 .insert(
8386 tonic::Status::GRPC_STATUS,
8387 (tonic::Code::Unimplemented as i32).into(),
8388 );
8389 headers
8390 .insert(
8391 http::header::CONTENT_TYPE,
8392 tonic::metadata::GRPC_CONTENT_TYPE,
8393 );
8394 Ok(response)
8395 })
8396 }
8397 }
8398 }
8399 }
8400 impl<T> Clone for TransactionExecutionServiceServer<T> {
8401 fn clone(&self) -> Self {
8402 let inner = self.inner.clone();
8403 Self {
8404 inner,
8405 accept_compression_encodings: self.accept_compression_encodings,
8406 send_compression_encodings: self.send_compression_encodings,
8407 max_decoding_message_size: self.max_decoding_message_size,
8408 max_encoding_message_size: self.max_encoding_message_size,
8409 }
8410 }
8411 }
8412 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
8414 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
8415 const NAME: &'static str = SERVICE_NAME;
8416 }
8417}