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")]
4521 pub feature_flags: ::prost::alloc::collections::BTreeMap<
4522 ::prost::alloc::string::String,
4523 bool,
4524 >,
4525 #[prost(btree_map = "string, string", tag = "3")]
4527 pub attributes: ::prost::alloc::collections::BTreeMap<
4528 ::prost::alloc::string::String,
4529 ::prost::alloc::string::String,
4530 >,
4531 #[prost(btree_map = "string, message", tag = "4")]
4532 pub configs: ::prost::alloc::collections::BTreeMap<
4533 ::prost::alloc::string::String,
4534 ::prost_types::Value,
4535 >,
4536}
4537#[non_exhaustive]
4539#[derive(Clone, PartialEq, ::prost::Message)]
4540pub struct UserSignature {
4541 #[prost(message, optional, tag = "1")]
4546 pub bcs: ::core::option::Option<Bcs>,
4547 #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
4549 pub scheme: ::core::option::Option<i32>,
4550 #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
4551 pub signature: ::core::option::Option<user_signature::Signature>,
4552}
4553pub mod user_signature {
4555 #[non_exhaustive]
4556 #[derive(Clone, PartialEq, ::prost::Oneof)]
4557 pub enum Signature {
4558 #[prost(message, tag = "3")]
4560 Simple(super::SimpleSignature),
4561 #[prost(message, tag = "4")]
4563 Multisig(super::MultisigAggregatedSignature),
4564 #[prost(message, tag = "5")]
4566 Zklogin(super::ZkLoginAuthenticator),
4567 #[prost(message, tag = "6")]
4569 Passkey(super::PasskeyAuthenticator),
4570 }
4571}
4572#[non_exhaustive]
4574#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4575pub struct SimpleSignature {
4576 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4578 pub scheme: ::core::option::Option<i32>,
4579 #[prost(bytes = "bytes", optional, tag = "2")]
4581 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4582 #[prost(bytes = "bytes", optional, tag = "3")]
4584 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4585}
4586#[non_exhaustive]
4588#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4589pub struct ZkLoginPublicIdentifier {
4590 #[prost(string, optional, tag = "1")]
4591 pub iss: ::core::option::Option<::prost::alloc::string::String>,
4592 #[prost(string, optional, tag = "2")]
4594 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4595}
4596#[non_exhaustive]
4598#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4599pub struct MultisigMemberPublicKey {
4600 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4602 pub scheme: ::core::option::Option<i32>,
4603 #[prost(bytes = "bytes", optional, tag = "2")]
4605 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4606 #[prost(message, optional, tag = "3")]
4608 pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
4609}
4610#[non_exhaustive]
4612#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4613pub struct MultisigMember {
4614 #[prost(message, optional, tag = "1")]
4616 pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
4617 #[prost(uint32, optional, tag = "2")]
4619 pub weight: ::core::option::Option<u32>,
4620}
4621#[non_exhaustive]
4623#[derive(Clone, PartialEq, ::prost::Message)]
4624pub struct MultisigCommittee {
4625 #[prost(message, repeated, tag = "1")]
4627 pub members: ::prost::alloc::vec::Vec<MultisigMember>,
4628 #[prost(uint32, optional, tag = "2")]
4631 pub threshold: ::core::option::Option<u32>,
4632}
4633#[non_exhaustive]
4635#[derive(Clone, PartialEq, ::prost::Message)]
4636pub struct MultisigAggregatedSignature {
4637 #[prost(message, repeated, tag = "1")]
4641 pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
4642 #[prost(uint32, optional, tag = "2")]
4645 pub bitmap: ::core::option::Option<u32>,
4646 #[prost(bytes = "bytes", optional, tag = "3")]
4649 pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4650 #[prost(message, optional, tag = "4")]
4652 pub committee: ::core::option::Option<MultisigCommittee>,
4653}
4654#[non_exhaustive]
4656#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4657pub struct MultisigMemberSignature {
4658 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4660 pub scheme: ::core::option::Option<i32>,
4661 #[prost(bytes = "bytes", optional, tag = "2")]
4663 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4664 #[prost(message, optional, tag = "3")]
4666 pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
4667 #[prost(message, optional, tag = "4")]
4669 pub passkey: ::core::option::Option<PasskeyAuthenticator>,
4670}
4671#[non_exhaustive]
4673#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4674pub struct ZkLoginAuthenticator {
4675 #[prost(message, optional, tag = "1")]
4677 pub inputs: ::core::option::Option<ZkLoginInputs>,
4678 #[prost(uint64, optional, tag = "2")]
4680 pub max_epoch: ::core::option::Option<u64>,
4681 #[prost(message, optional, tag = "3")]
4683 pub signature: ::core::option::Option<SimpleSignature>,
4684 #[prost(message, optional, tag = "4")]
4686 pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
4687 #[prost(message, optional, tag = "5")]
4689 pub jwk_id: ::core::option::Option<JwkId>,
4690}
4691#[non_exhaustive]
4693#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4694pub struct ZkLoginInputs {
4695 #[prost(message, optional, tag = "1")]
4696 pub proof_points: ::core::option::Option<ZkLoginProof>,
4697 #[prost(message, optional, tag = "2")]
4698 pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
4699 #[prost(string, optional, tag = "3")]
4700 pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
4701 #[prost(string, optional, tag = "4")]
4703 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4704}
4705#[non_exhaustive]
4707#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4708pub struct ZkLoginProof {
4709 #[prost(message, optional, tag = "1")]
4710 pub a: ::core::option::Option<CircomG1>,
4711 #[prost(message, optional, tag = "2")]
4712 pub b: ::core::option::Option<CircomG2>,
4713 #[prost(message, optional, tag = "3")]
4714 pub c: ::core::option::Option<CircomG1>,
4715}
4716#[non_exhaustive]
4718#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4719pub struct ZkLoginClaim {
4720 #[prost(string, optional, tag = "1")]
4721 pub value: ::core::option::Option<::prost::alloc::string::String>,
4722 #[prost(uint32, optional, tag = "2")]
4723 pub index_mod_4: ::core::option::Option<u32>,
4724}
4725#[non_exhaustive]
4727#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4728pub struct CircomG1 {
4729 #[prost(string, optional, tag = "1")]
4731 pub e0: ::core::option::Option<::prost::alloc::string::String>,
4732 #[prost(string, optional, tag = "2")]
4734 pub e1: ::core::option::Option<::prost::alloc::string::String>,
4735 #[prost(string, optional, tag = "3")]
4737 pub e2: ::core::option::Option<::prost::alloc::string::String>,
4738}
4739#[non_exhaustive]
4741#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4742pub struct CircomG2 {
4743 #[prost(string, optional, tag = "1")]
4745 pub e00: ::core::option::Option<::prost::alloc::string::String>,
4746 #[prost(string, optional, tag = "2")]
4748 pub e01: ::core::option::Option<::prost::alloc::string::String>,
4749 #[prost(string, optional, tag = "3")]
4751 pub e10: ::core::option::Option<::prost::alloc::string::String>,
4752 #[prost(string, optional, tag = "4")]
4754 pub e11: ::core::option::Option<::prost::alloc::string::String>,
4755 #[prost(string, optional, tag = "5")]
4757 pub e20: ::core::option::Option<::prost::alloc::string::String>,
4758 #[prost(string, optional, tag = "6")]
4760 pub e21: ::core::option::Option<::prost::alloc::string::String>,
4761}
4762#[non_exhaustive]
4769#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4770pub struct PasskeyAuthenticator {
4771 #[prost(bytes = "bytes", optional, tag = "1")]
4776 pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
4777 #[prost(string, optional, tag = "2")]
4782 pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
4783 #[prost(message, optional, tag = "3")]
4785 pub signature: ::core::option::Option<SimpleSignature>,
4786}
4787#[non_exhaustive]
4789#[derive(Clone, PartialEq, ::prost::Message)]
4790pub struct ValidatorCommittee {
4791 #[prost(uint64, optional, tag = "1")]
4793 pub epoch: ::core::option::Option<u64>,
4794 #[prost(message, repeated, tag = "2")]
4796 pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
4797}
4798#[non_exhaustive]
4800#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4801pub struct ValidatorCommitteeMember {
4802 #[prost(bytes = "bytes", optional, tag = "1")]
4804 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4805 #[prost(uint64, optional, tag = "2")]
4807 pub weight: ::core::option::Option<u64>,
4808}
4809#[non_exhaustive]
4811#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4812pub struct ValidatorAggregatedSignature {
4813 #[prost(uint64, optional, tag = "1")]
4818 pub epoch: ::core::option::Option<u64>,
4819 #[prost(bytes = "bytes", optional, tag = "2")]
4821 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4822 #[prost(bytes = "bytes", optional, tag = "3")]
4825 pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4826}
4827#[non_exhaustive]
4834#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4835#[repr(i32)]
4836pub enum SignatureScheme {
4837 Ed25519 = 0,
4838 Secp256k1 = 1,
4839 Secp256r1 = 2,
4840 Multisig = 3,
4841 Bls12381 = 4,
4842 Zklogin = 5,
4843 Passkey = 6,
4844}
4845impl SignatureScheme {
4846 pub fn as_str_name(&self) -> &'static str {
4851 match self {
4852 Self::Ed25519 => "ED25519",
4853 Self::Secp256k1 => "SECP256K1",
4854 Self::Secp256r1 => "SECP256R1",
4855 Self::Multisig => "MULTISIG",
4856 Self::Bls12381 => "BLS12381",
4857 Self::Zklogin => "ZKLOGIN",
4858 Self::Passkey => "PASSKEY",
4859 }
4860 }
4861 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4863 match value {
4864 "ED25519" => Some(Self::Ed25519),
4865 "SECP256K1" => Some(Self::Secp256k1),
4866 "SECP256R1" => Some(Self::Secp256r1),
4867 "MULTISIG" => Some(Self::Multisig),
4868 "BLS12381" => Some(Self::Bls12381),
4869 "ZKLOGIN" => Some(Self::Zklogin),
4870 "PASSKEY" => Some(Self::Passkey),
4871 _ => None,
4872 }
4873 }
4874}
4875#[non_exhaustive]
4876#[derive(Clone, PartialEq, ::prost::Message)]
4877pub struct VerifySignatureRequest {
4878 #[prost(message, optional, tag = "1")]
4884 pub message: ::core::option::Option<Bcs>,
4885 #[prost(message, optional, tag = "2")]
4887 pub signature: ::core::option::Option<UserSignature>,
4888 #[prost(string, optional, tag = "3")]
4894 pub address: ::core::option::Option<::prost::alloc::string::String>,
4895 #[prost(message, repeated, tag = "4")]
4898 pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
4899}
4900#[non_exhaustive]
4901#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4902pub struct VerifySignatureResponse {
4903 #[prost(bool, optional, tag = "1")]
4905 pub is_valid: ::core::option::Option<bool>,
4906 #[prost(string, optional, tag = "2")]
4908 pub reason: ::core::option::Option<::prost::alloc::string::String>,
4909}
4910pub mod signature_verification_service_client {
4912 #![allow(
4913 unused_variables,
4914 dead_code,
4915 missing_docs,
4916 clippy::wildcard_imports,
4917 clippy::let_unit_value,
4918 )]
4919 use tonic::codegen::*;
4920 use tonic::codegen::http::Uri;
4921 #[derive(Debug, Clone)]
4922 pub struct SignatureVerificationServiceClient<T> {
4923 inner: tonic::client::Grpc<T>,
4924 }
4925 impl SignatureVerificationServiceClient<tonic::transport::Channel> {
4926 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4928 where
4929 D: TryInto<tonic::transport::Endpoint>,
4930 D::Error: Into<StdError>,
4931 {
4932 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4933 Ok(Self::new(conn))
4934 }
4935 }
4936 impl<T> SignatureVerificationServiceClient<T>
4937 where
4938 T: tonic::client::GrpcService<tonic::body::Body>,
4939 T::Error: Into<StdError>,
4940 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4941 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4942 {
4943 pub fn new(inner: T) -> Self {
4944 let inner = tonic::client::Grpc::new(inner);
4945 Self { inner }
4946 }
4947 pub fn with_origin(inner: T, origin: Uri) -> Self {
4948 let inner = tonic::client::Grpc::with_origin(inner, origin);
4949 Self { inner }
4950 }
4951 pub fn with_interceptor<F>(
4952 inner: T,
4953 interceptor: F,
4954 ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
4955 where
4956 F: tonic::service::Interceptor,
4957 T::ResponseBody: Default,
4958 T: tonic::codegen::Service<
4959 http::Request<tonic::body::Body>,
4960 Response = http::Response<
4961 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4962 >,
4963 >,
4964 <T as tonic::codegen::Service<
4965 http::Request<tonic::body::Body>,
4966 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4967 {
4968 SignatureVerificationServiceClient::new(
4969 InterceptedService::new(inner, interceptor),
4970 )
4971 }
4972 #[must_use]
4977 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4978 self.inner = self.inner.send_compressed(encoding);
4979 self
4980 }
4981 #[must_use]
4983 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4984 self.inner = self.inner.accept_compressed(encoding);
4985 self
4986 }
4987 #[must_use]
4991 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4992 self.inner = self.inner.max_decoding_message_size(limit);
4993 self
4994 }
4995 #[must_use]
4999 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5000 self.inner = self.inner.max_encoding_message_size(limit);
5001 self
5002 }
5003 pub async fn verify_signature(
5005 &mut self,
5006 request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
5007 ) -> std::result::Result<
5008 tonic::Response<super::VerifySignatureResponse>,
5009 tonic::Status,
5010 > {
5011 self.inner
5012 .ready()
5013 .await
5014 .map_err(|e| {
5015 tonic::Status::unknown(
5016 format!("Service was not ready: {}", e.into()),
5017 )
5018 })?;
5019 let codec = tonic_prost::ProstCodec::default();
5020 let path = http::uri::PathAndQuery::from_static(
5021 "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
5022 );
5023 let mut req = request.into_request();
5024 req.extensions_mut()
5025 .insert(
5026 GrpcMethod::new(
5027 "sui.rpc.v2.SignatureVerificationService",
5028 "VerifySignature",
5029 ),
5030 );
5031 self.inner.unary(req, path, codec).await
5032 }
5033 }
5034}
5035pub mod signature_verification_service_server {
5037 #![allow(
5038 unused_variables,
5039 dead_code,
5040 missing_docs,
5041 clippy::wildcard_imports,
5042 clippy::let_unit_value,
5043 )]
5044 use tonic::codegen::*;
5045 #[async_trait]
5047 pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
5048 async fn verify_signature(
5050 &self,
5051 request: tonic::Request<super::VerifySignatureRequest>,
5052 ) -> std::result::Result<
5053 tonic::Response<super::VerifySignatureResponse>,
5054 tonic::Status,
5055 > {
5056 Err(tonic::Status::unimplemented("Not yet implemented"))
5057 }
5058 }
5059 #[derive(Debug)]
5060 pub struct SignatureVerificationServiceServer<T> {
5061 inner: Arc<T>,
5062 accept_compression_encodings: EnabledCompressionEncodings,
5063 send_compression_encodings: EnabledCompressionEncodings,
5064 max_decoding_message_size: Option<usize>,
5065 max_encoding_message_size: Option<usize>,
5066 }
5067 impl<T> SignatureVerificationServiceServer<T> {
5068 pub fn new(inner: T) -> Self {
5069 Self::from_arc(Arc::new(inner))
5070 }
5071 pub fn from_arc(inner: Arc<T>) -> Self {
5072 Self {
5073 inner,
5074 accept_compression_encodings: Default::default(),
5075 send_compression_encodings: Default::default(),
5076 max_decoding_message_size: None,
5077 max_encoding_message_size: None,
5078 }
5079 }
5080 pub fn with_interceptor<F>(
5081 inner: T,
5082 interceptor: F,
5083 ) -> InterceptedService<Self, F>
5084 where
5085 F: tonic::service::Interceptor,
5086 {
5087 InterceptedService::new(Self::new(inner), interceptor)
5088 }
5089 #[must_use]
5091 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5092 self.accept_compression_encodings.enable(encoding);
5093 self
5094 }
5095 #[must_use]
5097 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5098 self.send_compression_encodings.enable(encoding);
5099 self
5100 }
5101 #[must_use]
5105 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5106 self.max_decoding_message_size = Some(limit);
5107 self
5108 }
5109 #[must_use]
5113 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5114 self.max_encoding_message_size = Some(limit);
5115 self
5116 }
5117 }
5118 impl<T, B> tonic::codegen::Service<http::Request<B>>
5119 for SignatureVerificationServiceServer<T>
5120 where
5121 T: SignatureVerificationService,
5122 B: Body + std::marker::Send + 'static,
5123 B::Error: Into<StdError> + std::marker::Send + 'static,
5124 {
5125 type Response = http::Response<tonic::body::Body>;
5126 type Error = std::convert::Infallible;
5127 type Future = BoxFuture<Self::Response, Self::Error>;
5128 fn poll_ready(
5129 &mut self,
5130 _cx: &mut Context<'_>,
5131 ) -> Poll<std::result::Result<(), Self::Error>> {
5132 Poll::Ready(Ok(()))
5133 }
5134 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5135 match req.uri().path() {
5136 "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
5137 #[allow(non_camel_case_types)]
5138 struct VerifySignatureSvc<T: SignatureVerificationService>(
5139 pub Arc<T>,
5140 );
5141 impl<
5142 T: SignatureVerificationService,
5143 > tonic::server::UnaryService<super::VerifySignatureRequest>
5144 for VerifySignatureSvc<T> {
5145 type Response = super::VerifySignatureResponse;
5146 type Future = BoxFuture<
5147 tonic::Response<Self::Response>,
5148 tonic::Status,
5149 >;
5150 fn call(
5151 &mut self,
5152 request: tonic::Request<super::VerifySignatureRequest>,
5153 ) -> Self::Future {
5154 let inner = Arc::clone(&self.0);
5155 let fut = async move {
5156 <T as SignatureVerificationService>::verify_signature(
5157 &inner,
5158 request,
5159 )
5160 .await
5161 };
5162 Box::pin(fut)
5163 }
5164 }
5165 let accept_compression_encodings = self.accept_compression_encodings;
5166 let send_compression_encodings = self.send_compression_encodings;
5167 let max_decoding_message_size = self.max_decoding_message_size;
5168 let max_encoding_message_size = self.max_encoding_message_size;
5169 let inner = self.inner.clone();
5170 let fut = async move {
5171 let method = VerifySignatureSvc(inner);
5172 let codec = tonic_prost::ProstCodec::default();
5173 let mut grpc = tonic::server::Grpc::new(codec)
5174 .apply_compression_config(
5175 accept_compression_encodings,
5176 send_compression_encodings,
5177 )
5178 .apply_max_message_size_config(
5179 max_decoding_message_size,
5180 max_encoding_message_size,
5181 );
5182 let res = grpc.unary(method, req).await;
5183 Ok(res)
5184 };
5185 Box::pin(fut)
5186 }
5187 _ => {
5188 Box::pin(async move {
5189 let mut response = http::Response::new(
5190 tonic::body::Body::default(),
5191 );
5192 let headers = response.headers_mut();
5193 headers
5194 .insert(
5195 tonic::Status::GRPC_STATUS,
5196 (tonic::Code::Unimplemented as i32).into(),
5197 );
5198 headers
5199 .insert(
5200 http::header::CONTENT_TYPE,
5201 tonic::metadata::GRPC_CONTENT_TYPE,
5202 );
5203 Ok(response)
5204 })
5205 }
5206 }
5207 }
5208 }
5209 impl<T> Clone for SignatureVerificationServiceServer<T> {
5210 fn clone(&self) -> Self {
5211 let inner = self.inner.clone();
5212 Self {
5213 inner,
5214 accept_compression_encodings: self.accept_compression_encodings,
5215 send_compression_encodings: self.send_compression_encodings,
5216 max_decoding_message_size: self.max_decoding_message_size,
5217 max_encoding_message_size: self.max_encoding_message_size,
5218 }
5219 }
5220 }
5221 pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
5223 impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
5224 const NAME: &'static str = SERVICE_NAME;
5225 }
5226}
5227#[non_exhaustive]
5229#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5230pub struct GetCoinInfoRequest {
5231 #[prost(string, optional, tag = "1")]
5233 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5234}
5235#[non_exhaustive]
5237#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5238pub struct GetCoinInfoResponse {
5239 #[prost(string, optional, tag = "1")]
5241 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5242 #[prost(message, optional, tag = "2")]
5245 pub metadata: ::core::option::Option<CoinMetadata>,
5246 #[prost(message, optional, tag = "3")]
5249 pub treasury: ::core::option::Option<CoinTreasury>,
5250 #[prost(message, optional, tag = "4")]
5258 pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
5259}
5260#[non_exhaustive]
5262#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5263pub struct CoinMetadata {
5264 #[prost(string, optional, tag = "1")]
5267 pub id: ::core::option::Option<::prost::alloc::string::String>,
5268 #[prost(uint32, optional, tag = "2")]
5270 pub decimals: ::core::option::Option<u32>,
5271 #[prost(string, optional, tag = "3")]
5273 pub name: ::core::option::Option<::prost::alloc::string::String>,
5274 #[prost(string, optional, tag = "4")]
5276 pub symbol: ::core::option::Option<::prost::alloc::string::String>,
5277 #[prost(string, optional, tag = "5")]
5279 pub description: ::core::option::Option<::prost::alloc::string::String>,
5280 #[prost(string, optional, tag = "6")]
5282 pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
5283 #[prost(string, optional, tag = "7")]
5287 pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
5288 #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
5290 pub metadata_cap_state: ::core::option::Option<i32>,
5291}
5292pub mod coin_metadata {
5294 #[non_exhaustive]
5296 #[derive(
5297 Clone,
5298 Copy,
5299 Debug,
5300 PartialEq,
5301 Eq,
5302 Hash,
5303 PartialOrd,
5304 Ord,
5305 ::prost::Enumeration
5306 )]
5307 #[repr(i32)]
5308 pub enum MetadataCapState {
5309 Unknown = 0,
5312 Claimed = 1,
5314 Unclaimed = 2,
5316 Deleted = 3,
5318 }
5319 impl MetadataCapState {
5320 pub fn as_str_name(&self) -> &'static str {
5325 match self {
5326 Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
5327 Self::Claimed => "CLAIMED",
5328 Self::Unclaimed => "UNCLAIMED",
5329 Self::Deleted => "DELETED",
5330 }
5331 }
5332 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5334 match value {
5335 "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
5336 "CLAIMED" => Some(Self::Claimed),
5337 "UNCLAIMED" => Some(Self::Unclaimed),
5338 "DELETED" => Some(Self::Deleted),
5339 _ => None,
5340 }
5341 }
5342 }
5343}
5344#[non_exhaustive]
5346#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5347pub struct CoinTreasury {
5348 #[prost(string, optional, tag = "1")]
5350 pub id: ::core::option::Option<::prost::alloc::string::String>,
5351 #[prost(uint64, optional, tag = "2")]
5353 pub total_supply: ::core::option::Option<u64>,
5354 #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
5356 pub supply_state: ::core::option::Option<i32>,
5357}
5358pub mod coin_treasury {
5360 #[non_exhaustive]
5362 #[derive(
5363 Clone,
5364 Copy,
5365 Debug,
5366 PartialEq,
5367 Eq,
5368 Hash,
5369 PartialOrd,
5370 Ord,
5371 ::prost::Enumeration
5372 )]
5373 #[repr(i32)]
5374 pub enum SupplyState {
5375 Unknown = 0,
5377 Fixed = 1,
5379 BurnOnly = 2,
5381 }
5382 impl SupplyState {
5383 pub fn as_str_name(&self) -> &'static str {
5388 match self {
5389 Self::Unknown => "SUPPLY_STATE_UNKNOWN",
5390 Self::Fixed => "FIXED",
5391 Self::BurnOnly => "BURN_ONLY",
5392 }
5393 }
5394 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5396 match value {
5397 "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
5398 "FIXED" => Some(Self::Fixed),
5399 "BURN_ONLY" => Some(Self::BurnOnly),
5400 _ => None,
5401 }
5402 }
5403 }
5404}
5405#[non_exhaustive]
5407#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5408pub struct RegulatedCoinMetadata {
5409 #[prost(string, optional, tag = "1")]
5412 pub id: ::core::option::Option<::prost::alloc::string::String>,
5413 #[prost(string, optional, tag = "2")]
5415 pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
5416 #[prost(string, optional, tag = "3")]
5418 pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
5419 #[prost(bool, optional, tag = "4")]
5421 pub allow_global_pause: ::core::option::Option<bool>,
5422 #[prost(uint32, optional, tag = "5")]
5424 pub variant: ::core::option::Option<u32>,
5425 #[prost(
5427 enumeration = "regulated_coin_metadata::CoinRegulatedState",
5428 optional,
5429 tag = "6"
5430 )]
5431 pub coin_regulated_state: ::core::option::Option<i32>,
5432}
5433pub mod regulated_coin_metadata {
5435 #[non_exhaustive]
5437 #[derive(
5438 Clone,
5439 Copy,
5440 Debug,
5441 PartialEq,
5442 Eq,
5443 Hash,
5444 PartialOrd,
5445 Ord,
5446 ::prost::Enumeration
5447 )]
5448 #[repr(i32)]
5449 pub enum CoinRegulatedState {
5450 Unknown = 0,
5455 Regulated = 1,
5457 Unregulated = 2,
5459 }
5460 impl CoinRegulatedState {
5461 pub fn as_str_name(&self) -> &'static str {
5466 match self {
5467 Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
5468 Self::Regulated => "REGULATED",
5469 Self::Unregulated => "UNREGULATED",
5470 }
5471 }
5472 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5474 match value {
5475 "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
5476 "REGULATED" => Some(Self::Regulated),
5477 "UNREGULATED" => Some(Self::Unregulated),
5478 _ => None,
5479 }
5480 }
5481 }
5482}
5483#[non_exhaustive]
5485#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5486pub struct GetBalanceRequest {
5487 #[prost(string, optional, tag = "1")]
5489 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5490 #[prost(string, optional, tag = "2")]
5492 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5493}
5494#[non_exhaustive]
5497#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5498pub struct GetBalanceResponse {
5499 #[prost(message, optional, tag = "1")]
5501 pub balance: ::core::option::Option<Balance>,
5502}
5503#[non_exhaustive]
5505#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5506pub struct ListBalancesRequest {
5507 #[prost(string, optional, tag = "1")]
5509 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5510 #[prost(uint32, optional, tag = "2")]
5514 pub page_size: ::core::option::Option<u32>,
5515 #[prost(bytes = "bytes", optional, tag = "3")]
5521 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5522}
5523#[non_exhaustive]
5526#[derive(Clone, PartialEq, ::prost::Message)]
5527pub struct ListBalancesResponse {
5528 #[prost(message, repeated, tag = "1")]
5530 pub balances: ::prost::alloc::vec::Vec<Balance>,
5531 #[prost(bytes = "bytes", optional, tag = "2")]
5534 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5535}
5536#[non_exhaustive]
5538#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5539pub struct Balance {
5540 #[prost(string, optional, tag = "1")]
5542 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5543 #[prost(uint64, optional, tag = "3")]
5547 pub balance: ::core::option::Option<u64>,
5548 #[prost(uint64, optional, tag = "4")]
5550 pub address_balance: ::core::option::Option<u64>,
5551 #[prost(uint64, optional, tag = "5")]
5553 pub coin_balance: ::core::option::Option<u64>,
5554}
5555#[non_exhaustive]
5557#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5558pub struct ListDynamicFieldsRequest {
5559 #[prost(string, optional, tag = "1")]
5561 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5562 #[prost(uint32, optional, tag = "2")]
5566 pub page_size: ::core::option::Option<u32>,
5567 #[prost(bytes = "bytes", optional, tag = "3")]
5573 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5574 #[prost(message, optional, tag = "4")]
5577 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5578}
5579#[non_exhaustive]
5581#[derive(Clone, PartialEq, ::prost::Message)]
5582pub struct ListDynamicFieldsResponse {
5583 #[prost(message, repeated, tag = "1")]
5585 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
5586 #[prost(bytes = "bytes", optional, tag = "2")]
5589 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5590}
5591#[non_exhaustive]
5592#[derive(Clone, PartialEq, ::prost::Message)]
5593pub struct DynamicField {
5594 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
5595 pub kind: ::core::option::Option<i32>,
5596 #[prost(string, optional, tag = "2")]
5598 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5599 #[prost(string, optional, tag = "3")]
5601 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
5602 #[prost(message, optional, tag = "4")]
5604 pub field_object: ::core::option::Option<Object>,
5605 #[prost(message, optional, tag = "5")]
5607 pub name: ::core::option::Option<Bcs>,
5608 #[prost(message, optional, tag = "6")]
5610 pub value: ::core::option::Option<Bcs>,
5611 #[prost(string, optional, tag = "7")]
5617 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
5618 #[prost(string, optional, tag = "8")]
5624 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
5625 #[prost(message, optional, tag = "9")]
5627 pub child_object: ::core::option::Option<Object>,
5628}
5629pub mod dynamic_field {
5631 #[non_exhaustive]
5632 #[derive(
5633 Clone,
5634 Copy,
5635 Debug,
5636 PartialEq,
5637 Eq,
5638 Hash,
5639 PartialOrd,
5640 Ord,
5641 ::prost::Enumeration
5642 )]
5643 #[repr(i32)]
5644 pub enum DynamicFieldKind {
5645 Unknown = 0,
5646 Field = 1,
5647 Object = 2,
5648 }
5649 impl DynamicFieldKind {
5650 pub fn as_str_name(&self) -> &'static str {
5655 match self {
5656 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
5657 Self::Field => "FIELD",
5658 Self::Object => "OBJECT",
5659 }
5660 }
5661 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5663 match value {
5664 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
5665 "FIELD" => Some(Self::Field),
5666 "OBJECT" => Some(Self::Object),
5667 _ => None,
5668 }
5669 }
5670 }
5671}
5672#[non_exhaustive]
5673#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5674pub struct ListOwnedObjectsRequest {
5675 #[prost(string, optional, tag = "1")]
5677 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5678 #[prost(uint32, optional, tag = "2")]
5682 pub page_size: ::core::option::Option<u32>,
5683 #[prost(bytes = "bytes", optional, tag = "3")]
5689 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5690 #[prost(message, optional, tag = "4")]
5693 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5694 #[prost(string, optional, tag = "5")]
5703 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5704}
5705#[non_exhaustive]
5706#[derive(Clone, PartialEq, ::prost::Message)]
5707pub struct ListOwnedObjectsResponse {
5708 #[prost(message, repeated, tag = "1")]
5710 pub objects: ::prost::alloc::vec::Vec<Object>,
5711 #[prost(bytes = "bytes", optional, tag = "2")]
5714 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5715}
5716pub mod state_service_client {
5718 #![allow(
5719 unused_variables,
5720 dead_code,
5721 missing_docs,
5722 clippy::wildcard_imports,
5723 clippy::let_unit_value,
5724 )]
5725 use tonic::codegen::*;
5726 use tonic::codegen::http::Uri;
5727 #[derive(Debug, Clone)]
5728 pub struct StateServiceClient<T> {
5729 inner: tonic::client::Grpc<T>,
5730 }
5731 impl StateServiceClient<tonic::transport::Channel> {
5732 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5734 where
5735 D: TryInto<tonic::transport::Endpoint>,
5736 D::Error: Into<StdError>,
5737 {
5738 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5739 Ok(Self::new(conn))
5740 }
5741 }
5742 impl<T> StateServiceClient<T>
5743 where
5744 T: tonic::client::GrpcService<tonic::body::Body>,
5745 T::Error: Into<StdError>,
5746 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5747 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5748 {
5749 pub fn new(inner: T) -> Self {
5750 let inner = tonic::client::Grpc::new(inner);
5751 Self { inner }
5752 }
5753 pub fn with_origin(inner: T, origin: Uri) -> Self {
5754 let inner = tonic::client::Grpc::with_origin(inner, origin);
5755 Self { inner }
5756 }
5757 pub fn with_interceptor<F>(
5758 inner: T,
5759 interceptor: F,
5760 ) -> StateServiceClient<InterceptedService<T, F>>
5761 where
5762 F: tonic::service::Interceptor,
5763 T::ResponseBody: Default,
5764 T: tonic::codegen::Service<
5765 http::Request<tonic::body::Body>,
5766 Response = http::Response<
5767 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5768 >,
5769 >,
5770 <T as tonic::codegen::Service<
5771 http::Request<tonic::body::Body>,
5772 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5773 {
5774 StateServiceClient::new(InterceptedService::new(inner, interceptor))
5775 }
5776 #[must_use]
5781 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5782 self.inner = self.inner.send_compressed(encoding);
5783 self
5784 }
5785 #[must_use]
5787 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5788 self.inner = self.inner.accept_compressed(encoding);
5789 self
5790 }
5791 #[must_use]
5795 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5796 self.inner = self.inner.max_decoding_message_size(limit);
5797 self
5798 }
5799 #[must_use]
5803 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5804 self.inner = self.inner.max_encoding_message_size(limit);
5805 self
5806 }
5807 pub async fn list_dynamic_fields(
5808 &mut self,
5809 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
5810 ) -> std::result::Result<
5811 tonic::Response<super::ListDynamicFieldsResponse>,
5812 tonic::Status,
5813 > {
5814 self.inner
5815 .ready()
5816 .await
5817 .map_err(|e| {
5818 tonic::Status::unknown(
5819 format!("Service was not ready: {}", e.into()),
5820 )
5821 })?;
5822 let codec = tonic_prost::ProstCodec::default();
5823 let path = http::uri::PathAndQuery::from_static(
5824 "/sui.rpc.v2.StateService/ListDynamicFields",
5825 );
5826 let mut req = request.into_request();
5827 req.extensions_mut()
5828 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
5829 self.inner.unary(req, path, codec).await
5830 }
5831 pub async fn list_owned_objects(
5832 &mut self,
5833 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
5834 ) -> std::result::Result<
5835 tonic::Response<super::ListOwnedObjectsResponse>,
5836 tonic::Status,
5837 > {
5838 self.inner
5839 .ready()
5840 .await
5841 .map_err(|e| {
5842 tonic::Status::unknown(
5843 format!("Service was not ready: {}", e.into()),
5844 )
5845 })?;
5846 let codec = tonic_prost::ProstCodec::default();
5847 let path = http::uri::PathAndQuery::from_static(
5848 "/sui.rpc.v2.StateService/ListOwnedObjects",
5849 );
5850 let mut req = request.into_request();
5851 req.extensions_mut()
5852 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
5853 self.inner.unary(req, path, codec).await
5854 }
5855 pub async fn get_coin_info(
5856 &mut self,
5857 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
5858 ) -> std::result::Result<
5859 tonic::Response<super::GetCoinInfoResponse>,
5860 tonic::Status,
5861 > {
5862 self.inner
5863 .ready()
5864 .await
5865 .map_err(|e| {
5866 tonic::Status::unknown(
5867 format!("Service was not ready: {}", e.into()),
5868 )
5869 })?;
5870 let codec = tonic_prost::ProstCodec::default();
5871 let path = http::uri::PathAndQuery::from_static(
5872 "/sui.rpc.v2.StateService/GetCoinInfo",
5873 );
5874 let mut req = request.into_request();
5875 req.extensions_mut()
5876 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
5877 self.inner.unary(req, path, codec).await
5878 }
5879 pub async fn get_balance(
5880 &mut self,
5881 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
5882 ) -> std::result::Result<
5883 tonic::Response<super::GetBalanceResponse>,
5884 tonic::Status,
5885 > {
5886 self.inner
5887 .ready()
5888 .await
5889 .map_err(|e| {
5890 tonic::Status::unknown(
5891 format!("Service was not ready: {}", e.into()),
5892 )
5893 })?;
5894 let codec = tonic_prost::ProstCodec::default();
5895 let path = http::uri::PathAndQuery::from_static(
5896 "/sui.rpc.v2.StateService/GetBalance",
5897 );
5898 let mut req = request.into_request();
5899 req.extensions_mut()
5900 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
5901 self.inner.unary(req, path, codec).await
5902 }
5903 pub async fn list_balances(
5904 &mut self,
5905 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
5906 ) -> std::result::Result<
5907 tonic::Response<super::ListBalancesResponse>,
5908 tonic::Status,
5909 > {
5910 self.inner
5911 .ready()
5912 .await
5913 .map_err(|e| {
5914 tonic::Status::unknown(
5915 format!("Service was not ready: {}", e.into()),
5916 )
5917 })?;
5918 let codec = tonic_prost::ProstCodec::default();
5919 let path = http::uri::PathAndQuery::from_static(
5920 "/sui.rpc.v2.StateService/ListBalances",
5921 );
5922 let mut req = request.into_request();
5923 req.extensions_mut()
5924 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
5925 self.inner.unary(req, path, codec).await
5926 }
5927 }
5928}
5929pub mod state_service_server {
5931 #![allow(
5932 unused_variables,
5933 dead_code,
5934 missing_docs,
5935 clippy::wildcard_imports,
5936 clippy::let_unit_value,
5937 )]
5938 use tonic::codegen::*;
5939 #[async_trait]
5941 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
5942 async fn list_dynamic_fields(
5943 &self,
5944 request: tonic::Request<super::ListDynamicFieldsRequest>,
5945 ) -> std::result::Result<
5946 tonic::Response<super::ListDynamicFieldsResponse>,
5947 tonic::Status,
5948 > {
5949 Err(tonic::Status::unimplemented("Not yet implemented"))
5950 }
5951 async fn list_owned_objects(
5952 &self,
5953 request: tonic::Request<super::ListOwnedObjectsRequest>,
5954 ) -> std::result::Result<
5955 tonic::Response<super::ListOwnedObjectsResponse>,
5956 tonic::Status,
5957 > {
5958 Err(tonic::Status::unimplemented("Not yet implemented"))
5959 }
5960 async fn get_coin_info(
5961 &self,
5962 request: tonic::Request<super::GetCoinInfoRequest>,
5963 ) -> std::result::Result<
5964 tonic::Response<super::GetCoinInfoResponse>,
5965 tonic::Status,
5966 > {
5967 Err(tonic::Status::unimplemented("Not yet implemented"))
5968 }
5969 async fn get_balance(
5970 &self,
5971 request: tonic::Request<super::GetBalanceRequest>,
5972 ) -> std::result::Result<
5973 tonic::Response<super::GetBalanceResponse>,
5974 tonic::Status,
5975 > {
5976 Err(tonic::Status::unimplemented("Not yet implemented"))
5977 }
5978 async fn list_balances(
5979 &self,
5980 request: tonic::Request<super::ListBalancesRequest>,
5981 ) -> std::result::Result<
5982 tonic::Response<super::ListBalancesResponse>,
5983 tonic::Status,
5984 > {
5985 Err(tonic::Status::unimplemented("Not yet implemented"))
5986 }
5987 }
5988 #[derive(Debug)]
5989 pub struct StateServiceServer<T> {
5990 inner: Arc<T>,
5991 accept_compression_encodings: EnabledCompressionEncodings,
5992 send_compression_encodings: EnabledCompressionEncodings,
5993 max_decoding_message_size: Option<usize>,
5994 max_encoding_message_size: Option<usize>,
5995 }
5996 impl<T> StateServiceServer<T> {
5997 pub fn new(inner: T) -> Self {
5998 Self::from_arc(Arc::new(inner))
5999 }
6000 pub fn from_arc(inner: Arc<T>) -> Self {
6001 Self {
6002 inner,
6003 accept_compression_encodings: Default::default(),
6004 send_compression_encodings: Default::default(),
6005 max_decoding_message_size: None,
6006 max_encoding_message_size: None,
6007 }
6008 }
6009 pub fn with_interceptor<F>(
6010 inner: T,
6011 interceptor: F,
6012 ) -> InterceptedService<Self, F>
6013 where
6014 F: tonic::service::Interceptor,
6015 {
6016 InterceptedService::new(Self::new(inner), interceptor)
6017 }
6018 #[must_use]
6020 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6021 self.accept_compression_encodings.enable(encoding);
6022 self
6023 }
6024 #[must_use]
6026 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6027 self.send_compression_encodings.enable(encoding);
6028 self
6029 }
6030 #[must_use]
6034 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6035 self.max_decoding_message_size = Some(limit);
6036 self
6037 }
6038 #[must_use]
6042 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6043 self.max_encoding_message_size = Some(limit);
6044 self
6045 }
6046 }
6047 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
6048 where
6049 T: StateService,
6050 B: Body + std::marker::Send + 'static,
6051 B::Error: Into<StdError> + std::marker::Send + 'static,
6052 {
6053 type Response = http::Response<tonic::body::Body>;
6054 type Error = std::convert::Infallible;
6055 type Future = BoxFuture<Self::Response, Self::Error>;
6056 fn poll_ready(
6057 &mut self,
6058 _cx: &mut Context<'_>,
6059 ) -> Poll<std::result::Result<(), Self::Error>> {
6060 Poll::Ready(Ok(()))
6061 }
6062 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6063 match req.uri().path() {
6064 "/sui.rpc.v2.StateService/ListDynamicFields" => {
6065 #[allow(non_camel_case_types)]
6066 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
6067 impl<
6068 T: StateService,
6069 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
6070 for ListDynamicFieldsSvc<T> {
6071 type Response = super::ListDynamicFieldsResponse;
6072 type Future = BoxFuture<
6073 tonic::Response<Self::Response>,
6074 tonic::Status,
6075 >;
6076 fn call(
6077 &mut self,
6078 request: tonic::Request<super::ListDynamicFieldsRequest>,
6079 ) -> Self::Future {
6080 let inner = Arc::clone(&self.0);
6081 let fut = async move {
6082 <T as StateService>::list_dynamic_fields(&inner, request)
6083 .await
6084 };
6085 Box::pin(fut)
6086 }
6087 }
6088 let accept_compression_encodings = self.accept_compression_encodings;
6089 let send_compression_encodings = self.send_compression_encodings;
6090 let max_decoding_message_size = self.max_decoding_message_size;
6091 let max_encoding_message_size = self.max_encoding_message_size;
6092 let inner = self.inner.clone();
6093 let fut = async move {
6094 let method = ListDynamicFieldsSvc(inner);
6095 let codec = tonic_prost::ProstCodec::default();
6096 let mut grpc = tonic::server::Grpc::new(codec)
6097 .apply_compression_config(
6098 accept_compression_encodings,
6099 send_compression_encodings,
6100 )
6101 .apply_max_message_size_config(
6102 max_decoding_message_size,
6103 max_encoding_message_size,
6104 );
6105 let res = grpc.unary(method, req).await;
6106 Ok(res)
6107 };
6108 Box::pin(fut)
6109 }
6110 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
6111 #[allow(non_camel_case_types)]
6112 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
6113 impl<
6114 T: StateService,
6115 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
6116 for ListOwnedObjectsSvc<T> {
6117 type Response = super::ListOwnedObjectsResponse;
6118 type Future = BoxFuture<
6119 tonic::Response<Self::Response>,
6120 tonic::Status,
6121 >;
6122 fn call(
6123 &mut self,
6124 request: tonic::Request<super::ListOwnedObjectsRequest>,
6125 ) -> Self::Future {
6126 let inner = Arc::clone(&self.0);
6127 let fut = async move {
6128 <T as StateService>::list_owned_objects(&inner, request)
6129 .await
6130 };
6131 Box::pin(fut)
6132 }
6133 }
6134 let accept_compression_encodings = self.accept_compression_encodings;
6135 let send_compression_encodings = self.send_compression_encodings;
6136 let max_decoding_message_size = self.max_decoding_message_size;
6137 let max_encoding_message_size = self.max_encoding_message_size;
6138 let inner = self.inner.clone();
6139 let fut = async move {
6140 let method = ListOwnedObjectsSvc(inner);
6141 let codec = tonic_prost::ProstCodec::default();
6142 let mut grpc = tonic::server::Grpc::new(codec)
6143 .apply_compression_config(
6144 accept_compression_encodings,
6145 send_compression_encodings,
6146 )
6147 .apply_max_message_size_config(
6148 max_decoding_message_size,
6149 max_encoding_message_size,
6150 );
6151 let res = grpc.unary(method, req).await;
6152 Ok(res)
6153 };
6154 Box::pin(fut)
6155 }
6156 "/sui.rpc.v2.StateService/GetCoinInfo" => {
6157 #[allow(non_camel_case_types)]
6158 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
6159 impl<
6160 T: StateService,
6161 > tonic::server::UnaryService<super::GetCoinInfoRequest>
6162 for GetCoinInfoSvc<T> {
6163 type Response = super::GetCoinInfoResponse;
6164 type Future = BoxFuture<
6165 tonic::Response<Self::Response>,
6166 tonic::Status,
6167 >;
6168 fn call(
6169 &mut self,
6170 request: tonic::Request<super::GetCoinInfoRequest>,
6171 ) -> Self::Future {
6172 let inner = Arc::clone(&self.0);
6173 let fut = async move {
6174 <T as StateService>::get_coin_info(&inner, request).await
6175 };
6176 Box::pin(fut)
6177 }
6178 }
6179 let accept_compression_encodings = self.accept_compression_encodings;
6180 let send_compression_encodings = self.send_compression_encodings;
6181 let max_decoding_message_size = self.max_decoding_message_size;
6182 let max_encoding_message_size = self.max_encoding_message_size;
6183 let inner = self.inner.clone();
6184 let fut = async move {
6185 let method = GetCoinInfoSvc(inner);
6186 let codec = tonic_prost::ProstCodec::default();
6187 let mut grpc = tonic::server::Grpc::new(codec)
6188 .apply_compression_config(
6189 accept_compression_encodings,
6190 send_compression_encodings,
6191 )
6192 .apply_max_message_size_config(
6193 max_decoding_message_size,
6194 max_encoding_message_size,
6195 );
6196 let res = grpc.unary(method, req).await;
6197 Ok(res)
6198 };
6199 Box::pin(fut)
6200 }
6201 "/sui.rpc.v2.StateService/GetBalance" => {
6202 #[allow(non_camel_case_types)]
6203 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
6204 impl<
6205 T: StateService,
6206 > tonic::server::UnaryService<super::GetBalanceRequest>
6207 for GetBalanceSvc<T> {
6208 type Response = super::GetBalanceResponse;
6209 type Future = BoxFuture<
6210 tonic::Response<Self::Response>,
6211 tonic::Status,
6212 >;
6213 fn call(
6214 &mut self,
6215 request: tonic::Request<super::GetBalanceRequest>,
6216 ) -> Self::Future {
6217 let inner = Arc::clone(&self.0);
6218 let fut = async move {
6219 <T as StateService>::get_balance(&inner, request).await
6220 };
6221 Box::pin(fut)
6222 }
6223 }
6224 let accept_compression_encodings = self.accept_compression_encodings;
6225 let send_compression_encodings = self.send_compression_encodings;
6226 let max_decoding_message_size = self.max_decoding_message_size;
6227 let max_encoding_message_size = self.max_encoding_message_size;
6228 let inner = self.inner.clone();
6229 let fut = async move {
6230 let method = GetBalanceSvc(inner);
6231 let codec = tonic_prost::ProstCodec::default();
6232 let mut grpc = tonic::server::Grpc::new(codec)
6233 .apply_compression_config(
6234 accept_compression_encodings,
6235 send_compression_encodings,
6236 )
6237 .apply_max_message_size_config(
6238 max_decoding_message_size,
6239 max_encoding_message_size,
6240 );
6241 let res = grpc.unary(method, req).await;
6242 Ok(res)
6243 };
6244 Box::pin(fut)
6245 }
6246 "/sui.rpc.v2.StateService/ListBalances" => {
6247 #[allow(non_camel_case_types)]
6248 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
6249 impl<
6250 T: StateService,
6251 > tonic::server::UnaryService<super::ListBalancesRequest>
6252 for ListBalancesSvc<T> {
6253 type Response = super::ListBalancesResponse;
6254 type Future = BoxFuture<
6255 tonic::Response<Self::Response>,
6256 tonic::Status,
6257 >;
6258 fn call(
6259 &mut self,
6260 request: tonic::Request<super::ListBalancesRequest>,
6261 ) -> Self::Future {
6262 let inner = Arc::clone(&self.0);
6263 let fut = async move {
6264 <T as StateService>::list_balances(&inner, request).await
6265 };
6266 Box::pin(fut)
6267 }
6268 }
6269 let accept_compression_encodings = self.accept_compression_encodings;
6270 let send_compression_encodings = self.send_compression_encodings;
6271 let max_decoding_message_size = self.max_decoding_message_size;
6272 let max_encoding_message_size = self.max_encoding_message_size;
6273 let inner = self.inner.clone();
6274 let fut = async move {
6275 let method = ListBalancesSvc(inner);
6276 let codec = tonic_prost::ProstCodec::default();
6277 let mut grpc = tonic::server::Grpc::new(codec)
6278 .apply_compression_config(
6279 accept_compression_encodings,
6280 send_compression_encodings,
6281 )
6282 .apply_max_message_size_config(
6283 max_decoding_message_size,
6284 max_encoding_message_size,
6285 );
6286 let res = grpc.unary(method, req).await;
6287 Ok(res)
6288 };
6289 Box::pin(fut)
6290 }
6291 _ => {
6292 Box::pin(async move {
6293 let mut response = http::Response::new(
6294 tonic::body::Body::default(),
6295 );
6296 let headers = response.headers_mut();
6297 headers
6298 .insert(
6299 tonic::Status::GRPC_STATUS,
6300 (tonic::Code::Unimplemented as i32).into(),
6301 );
6302 headers
6303 .insert(
6304 http::header::CONTENT_TYPE,
6305 tonic::metadata::GRPC_CONTENT_TYPE,
6306 );
6307 Ok(response)
6308 })
6309 }
6310 }
6311 }
6312 }
6313 impl<T> Clone for StateServiceServer<T> {
6314 fn clone(&self) -> Self {
6315 let inner = self.inner.clone();
6316 Self {
6317 inner,
6318 accept_compression_encodings: self.accept_compression_encodings,
6319 send_compression_encodings: self.send_compression_encodings,
6320 max_decoding_message_size: self.max_decoding_message_size,
6321 max_encoding_message_size: self.max_encoding_message_size,
6322 }
6323 }
6324 }
6325 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
6327 impl<T> tonic::server::NamedService for StateServiceServer<T> {
6328 const NAME: &'static str = SERVICE_NAME;
6329 }
6330}
6331#[non_exhaustive]
6333#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6334pub struct SubscribeCheckpointsRequest {
6335 #[prost(message, optional, tag = "1")]
6338 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6339}
6340#[non_exhaustive]
6342#[derive(Clone, PartialEq, ::prost::Message)]
6343pub struct SubscribeCheckpointsResponse {
6344 #[prost(uint64, optional, tag = "1")]
6347 pub cursor: ::core::option::Option<u64>,
6348 #[prost(message, optional, tag = "2")]
6350 pub checkpoint: ::core::option::Option<Checkpoint>,
6351}
6352pub mod subscription_service_client {
6354 #![allow(
6355 unused_variables,
6356 dead_code,
6357 missing_docs,
6358 clippy::wildcard_imports,
6359 clippy::let_unit_value,
6360 )]
6361 use tonic::codegen::*;
6362 use tonic::codegen::http::Uri;
6363 #[derive(Debug, Clone)]
6364 pub struct SubscriptionServiceClient<T> {
6365 inner: tonic::client::Grpc<T>,
6366 }
6367 impl SubscriptionServiceClient<tonic::transport::Channel> {
6368 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6370 where
6371 D: TryInto<tonic::transport::Endpoint>,
6372 D::Error: Into<StdError>,
6373 {
6374 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6375 Ok(Self::new(conn))
6376 }
6377 }
6378 impl<T> SubscriptionServiceClient<T>
6379 where
6380 T: tonic::client::GrpcService<tonic::body::Body>,
6381 T::Error: Into<StdError>,
6382 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6383 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6384 {
6385 pub fn new(inner: T) -> Self {
6386 let inner = tonic::client::Grpc::new(inner);
6387 Self { inner }
6388 }
6389 pub fn with_origin(inner: T, origin: Uri) -> Self {
6390 let inner = tonic::client::Grpc::with_origin(inner, origin);
6391 Self { inner }
6392 }
6393 pub fn with_interceptor<F>(
6394 inner: T,
6395 interceptor: F,
6396 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
6397 where
6398 F: tonic::service::Interceptor,
6399 T::ResponseBody: Default,
6400 T: tonic::codegen::Service<
6401 http::Request<tonic::body::Body>,
6402 Response = http::Response<
6403 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6404 >,
6405 >,
6406 <T as tonic::codegen::Service<
6407 http::Request<tonic::body::Body>,
6408 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6409 {
6410 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
6411 }
6412 #[must_use]
6417 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6418 self.inner = self.inner.send_compressed(encoding);
6419 self
6420 }
6421 #[must_use]
6423 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6424 self.inner = self.inner.accept_compressed(encoding);
6425 self
6426 }
6427 #[must_use]
6431 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6432 self.inner = self.inner.max_decoding_message_size(limit);
6433 self
6434 }
6435 #[must_use]
6439 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6440 self.inner = self.inner.max_encoding_message_size(limit);
6441 self
6442 }
6443 pub async fn subscribe_checkpoints(
6455 &mut self,
6456 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
6457 ) -> std::result::Result<
6458 tonic::Response<
6459 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
6460 >,
6461 tonic::Status,
6462 > {
6463 self.inner
6464 .ready()
6465 .await
6466 .map_err(|e| {
6467 tonic::Status::unknown(
6468 format!("Service was not ready: {}", e.into()),
6469 )
6470 })?;
6471 let codec = tonic_prost::ProstCodec::default();
6472 let path = http::uri::PathAndQuery::from_static(
6473 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
6474 );
6475 let mut req = request.into_request();
6476 req.extensions_mut()
6477 .insert(
6478 GrpcMethod::new(
6479 "sui.rpc.v2.SubscriptionService",
6480 "SubscribeCheckpoints",
6481 ),
6482 );
6483 self.inner.server_streaming(req, path, codec).await
6484 }
6485 }
6486}
6487pub mod subscription_service_server {
6489 #![allow(
6490 unused_variables,
6491 dead_code,
6492 missing_docs,
6493 clippy::wildcard_imports,
6494 clippy::let_unit_value,
6495 )]
6496 use tonic::codegen::*;
6497 #[async_trait]
6499 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
6500 async fn subscribe_checkpoints(
6512 &self,
6513 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6514 ) -> std::result::Result<
6515 tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
6516 tonic::Status,
6517 > {
6518 Err(tonic::Status::unimplemented("Not yet implemented"))
6519 }
6520 }
6521 #[derive(Debug)]
6522 pub struct SubscriptionServiceServer<T> {
6523 inner: Arc<T>,
6524 accept_compression_encodings: EnabledCompressionEncodings,
6525 send_compression_encodings: EnabledCompressionEncodings,
6526 max_decoding_message_size: Option<usize>,
6527 max_encoding_message_size: Option<usize>,
6528 }
6529 impl<T> SubscriptionServiceServer<T> {
6530 pub fn new(inner: T) -> Self {
6531 Self::from_arc(Arc::new(inner))
6532 }
6533 pub fn from_arc(inner: Arc<T>) -> Self {
6534 Self {
6535 inner,
6536 accept_compression_encodings: Default::default(),
6537 send_compression_encodings: Default::default(),
6538 max_decoding_message_size: None,
6539 max_encoding_message_size: None,
6540 }
6541 }
6542 pub fn with_interceptor<F>(
6543 inner: T,
6544 interceptor: F,
6545 ) -> InterceptedService<Self, F>
6546 where
6547 F: tonic::service::Interceptor,
6548 {
6549 InterceptedService::new(Self::new(inner), interceptor)
6550 }
6551 #[must_use]
6553 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6554 self.accept_compression_encodings.enable(encoding);
6555 self
6556 }
6557 #[must_use]
6559 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6560 self.send_compression_encodings.enable(encoding);
6561 self
6562 }
6563 #[must_use]
6567 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6568 self.max_decoding_message_size = Some(limit);
6569 self
6570 }
6571 #[must_use]
6575 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6576 self.max_encoding_message_size = Some(limit);
6577 self
6578 }
6579 }
6580 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
6581 where
6582 T: SubscriptionService,
6583 B: Body + std::marker::Send + 'static,
6584 B::Error: Into<StdError> + std::marker::Send + 'static,
6585 {
6586 type Response = http::Response<tonic::body::Body>;
6587 type Error = std::convert::Infallible;
6588 type Future = BoxFuture<Self::Response, Self::Error>;
6589 fn poll_ready(
6590 &mut self,
6591 _cx: &mut Context<'_>,
6592 ) -> Poll<std::result::Result<(), Self::Error>> {
6593 Poll::Ready(Ok(()))
6594 }
6595 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6596 match req.uri().path() {
6597 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
6598 #[allow(non_camel_case_types)]
6599 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
6600 impl<
6601 T: SubscriptionService,
6602 > tonic::server::ServerStreamingService<
6603 super::SubscribeCheckpointsRequest,
6604 > for SubscribeCheckpointsSvc<T> {
6605 type Response = super::SubscribeCheckpointsResponse;
6606 type ResponseStream = BoxStream<
6607 super::SubscribeCheckpointsResponse,
6608 >;
6609 type Future = BoxFuture<
6610 tonic::Response<Self::ResponseStream>,
6611 tonic::Status,
6612 >;
6613 fn call(
6614 &mut self,
6615 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6616 ) -> Self::Future {
6617 let inner = Arc::clone(&self.0);
6618 let fut = async move {
6619 <T as SubscriptionService>::subscribe_checkpoints(
6620 &inner,
6621 request,
6622 )
6623 .await
6624 };
6625 Box::pin(fut)
6626 }
6627 }
6628 let accept_compression_encodings = self.accept_compression_encodings;
6629 let send_compression_encodings = self.send_compression_encodings;
6630 let max_decoding_message_size = self.max_decoding_message_size;
6631 let max_encoding_message_size = self.max_encoding_message_size;
6632 let inner = self.inner.clone();
6633 let fut = async move {
6634 let method = SubscribeCheckpointsSvc(inner);
6635 let codec = tonic_prost::ProstCodec::default();
6636 let mut grpc = tonic::server::Grpc::new(codec)
6637 .apply_compression_config(
6638 accept_compression_encodings,
6639 send_compression_encodings,
6640 )
6641 .apply_max_message_size_config(
6642 max_decoding_message_size,
6643 max_encoding_message_size,
6644 );
6645 let res = grpc.server_streaming(method, req).await;
6646 Ok(res)
6647 };
6648 Box::pin(fut)
6649 }
6650 _ => {
6651 Box::pin(async move {
6652 let mut response = http::Response::new(
6653 tonic::body::Body::default(),
6654 );
6655 let headers = response.headers_mut();
6656 headers
6657 .insert(
6658 tonic::Status::GRPC_STATUS,
6659 (tonic::Code::Unimplemented as i32).into(),
6660 );
6661 headers
6662 .insert(
6663 http::header::CONTENT_TYPE,
6664 tonic::metadata::GRPC_CONTENT_TYPE,
6665 );
6666 Ok(response)
6667 })
6668 }
6669 }
6670 }
6671 }
6672 impl<T> Clone for SubscriptionServiceServer<T> {
6673 fn clone(&self) -> Self {
6674 let inner = self.inner.clone();
6675 Self {
6676 inner,
6677 accept_compression_encodings: self.accept_compression_encodings,
6678 send_compression_encodings: self.send_compression_encodings,
6679 max_decoding_message_size: self.max_decoding_message_size,
6680 max_encoding_message_size: self.max_encoding_message_size,
6681 }
6682 }
6683 }
6684 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
6686 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
6687 const NAME: &'static str = SERVICE_NAME;
6688 }
6689}
6690#[non_exhaustive]
6691#[derive(Clone, PartialEq, ::prost::Message)]
6692pub struct SystemState {
6693 #[prost(uint64, optional, tag = "1")]
6695 pub version: ::core::option::Option<u64>,
6696 #[prost(uint64, optional, tag = "2")]
6698 pub epoch: ::core::option::Option<u64>,
6699 #[prost(uint64, optional, tag = "3")]
6701 pub protocol_version: ::core::option::Option<u64>,
6702 #[prost(message, optional, tag = "4")]
6704 pub validators: ::core::option::Option<ValidatorSet>,
6705 #[prost(message, optional, tag = "5")]
6707 pub storage_fund: ::core::option::Option<StorageFund>,
6708 #[prost(message, optional, tag = "6")]
6710 pub parameters: ::core::option::Option<SystemParameters>,
6711 #[prost(uint64, optional, tag = "7")]
6713 pub reference_gas_price: ::core::option::Option<u64>,
6714 #[prost(message, repeated, tag = "8")]
6722 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
6723 #[prost(message, optional, tag = "9")]
6725 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
6726 #[prost(bool, optional, tag = "10")]
6733 pub safe_mode: ::core::option::Option<bool>,
6734 #[prost(uint64, optional, tag = "11")]
6736 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
6737 #[prost(uint64, optional, tag = "12")]
6739 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
6740 #[prost(uint64, optional, tag = "13")]
6742 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
6743 #[prost(uint64, optional, tag = "14")]
6745 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
6746 #[prost(uint64, optional, tag = "15")]
6748 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
6749 #[prost(message, optional, tag = "16")]
6751 pub extra_fields: ::core::option::Option<MoveTable>,
6752}
6753#[non_exhaustive]
6754#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6755pub struct ValidatorReportRecord {
6756 #[prost(string, optional, tag = "1")]
6758 pub reported: ::core::option::Option<::prost::alloc::string::String>,
6759 #[prost(string, repeated, tag = "2")]
6761 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6762}
6763#[non_exhaustive]
6764#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6765pub struct SystemParameters {
6766 #[prost(uint64, optional, tag = "1")]
6768 pub epoch_duration_ms: ::core::option::Option<u64>,
6769 #[prost(uint64, optional, tag = "2")]
6771 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
6772 #[prost(uint64, optional, tag = "3")]
6774 pub min_validator_count: ::core::option::Option<u64>,
6775 #[prost(uint64, optional, tag = "4")]
6778 pub max_validator_count: ::core::option::Option<u64>,
6779 #[prost(uint64, optional, tag = "5")]
6782 pub min_validator_joining_stake: ::core::option::Option<u64>,
6783 #[prost(uint64, optional, tag = "6")]
6788 pub validator_low_stake_threshold: ::core::option::Option<u64>,
6789 #[prost(uint64, optional, tag = "7")]
6793 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
6794 #[prost(uint64, optional, tag = "8")]
6797 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
6798 #[prost(message, optional, tag = "9")]
6800 pub extra_fields: ::core::option::Option<MoveTable>,
6801}
6802#[non_exhaustive]
6804#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6805pub struct MoveTable {
6806 #[prost(string, optional, tag = "1")]
6808 pub id: ::core::option::Option<::prost::alloc::string::String>,
6809 #[prost(uint64, optional, tag = "2")]
6811 pub size: ::core::option::Option<u64>,
6812}
6813#[non_exhaustive]
6814#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6815pub struct StakeSubsidy {
6816 #[prost(uint64, optional, tag = "1")]
6818 pub balance: ::core::option::Option<u64>,
6819 #[prost(uint64, optional, tag = "2")]
6821 pub distribution_counter: ::core::option::Option<u64>,
6822 #[prost(uint64, optional, tag = "3")]
6825 pub current_distribution_amount: ::core::option::Option<u64>,
6826 #[prost(uint64, optional, tag = "4")]
6828 pub stake_subsidy_period_length: ::core::option::Option<u64>,
6829 #[prost(uint32, optional, tag = "5")]
6832 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
6833 #[prost(message, optional, tag = "6")]
6835 pub extra_fields: ::core::option::Option<MoveTable>,
6836}
6837#[non_exhaustive]
6839#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6840pub struct StorageFund {
6841 #[prost(uint64, optional, tag = "1")]
6847 pub total_object_storage_rebates: ::core::option::Option<u64>,
6848 #[prost(uint64, optional, tag = "2")]
6851 pub non_refundable_balance: ::core::option::Option<u64>,
6852}
6853#[non_exhaustive]
6854#[derive(Clone, PartialEq, ::prost::Message)]
6855pub struct ValidatorSet {
6856 #[prost(uint64, optional, tag = "1")]
6859 pub total_stake: ::core::option::Option<u64>,
6860 #[prost(message, repeated, tag = "2")]
6862 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
6863 #[prost(message, optional, tag = "3")]
6868 pub pending_active_validators: ::core::option::Option<MoveTable>,
6869 #[prost(uint64, repeated, tag = "4")]
6872 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
6873 #[prost(message, optional, tag = "5")]
6877 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
6878 #[prost(message, optional, tag = "6")]
6884 pub inactive_validators: ::core::option::Option<MoveTable>,
6885 #[prost(message, optional, tag = "7")]
6893 pub validator_candidates: ::core::option::Option<MoveTable>,
6894 #[prost(btree_map = "string, uint64", tag = "8")]
6896 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
6897 ::prost::alloc::string::String,
6898 u64,
6899 >,
6900 #[prost(message, optional, tag = "9")]
6902 pub extra_fields: ::core::option::Option<MoveTable>,
6903}
6904#[non_exhaustive]
6908#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6909pub struct Validator {
6910 #[prost(string, optional, tag = "1")]
6912 pub name: ::core::option::Option<::prost::alloc::string::String>,
6913 #[prost(string, optional, tag = "2")]
6916 pub address: ::core::option::Option<::prost::alloc::string::String>,
6917 #[prost(string, optional, tag = "3")]
6918 pub description: ::core::option::Option<::prost::alloc::string::String>,
6919 #[prost(string, optional, tag = "4")]
6920 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
6921 #[prost(string, optional, tag = "5")]
6922 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
6923 #[prost(bytes = "bytes", optional, tag = "7")]
6926 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6927 #[prost(bytes = "bytes", optional, tag = "8")]
6929 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6930 #[prost(bytes = "bytes", optional, tag = "10")]
6933 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6934 #[prost(bytes = "bytes", optional, tag = "12")]
6936 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6937 #[prost(string, optional, tag = "13")]
6939 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
6940 #[prost(string, optional, tag = "14")]
6942 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6943 #[prost(string, optional, tag = "15")]
6945 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
6946 #[prost(string, optional, tag = "16")]
6948 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
6949 #[prost(bytes = "bytes", optional, tag = "18")]
6950 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6951 #[prost(bytes = "bytes", optional, tag = "19")]
6952 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6953 #[prost(bytes = "bytes", optional, tag = "21")]
6954 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6955 #[prost(bytes = "bytes", optional, tag = "23")]
6956 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6957 #[prost(string, optional, tag = "24")]
6958 pub next_epoch_network_address: ::core::option::Option<
6959 ::prost::alloc::string::String,
6960 >,
6961 #[prost(string, optional, tag = "25")]
6962 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6963 #[prost(string, optional, tag = "26")]
6964 pub next_epoch_primary_address: ::core::option::Option<
6965 ::prost::alloc::string::String,
6966 >,
6967 #[prost(string, optional, tag = "27")]
6968 pub next_epoch_worker_address: ::core::option::Option<
6969 ::prost::alloc::string::String,
6970 >,
6971 #[prost(message, optional, tag = "28")]
6973 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
6974 #[prost(uint64, optional, tag = "29")]
6977 pub voting_power: ::core::option::Option<u64>,
6978 #[prost(string, optional, tag = "30")]
6980 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6981 #[prost(uint64, optional, tag = "31")]
6983 pub gas_price: ::core::option::Option<u64>,
6984 #[prost(message, optional, tag = "32")]
6986 pub staking_pool: ::core::option::Option<StakingPool>,
6987 #[prost(uint64, optional, tag = "33")]
6989 pub commission_rate: ::core::option::Option<u64>,
6990 #[prost(uint64, optional, tag = "34")]
6992 pub next_epoch_stake: ::core::option::Option<u64>,
6993 #[prost(uint64, optional, tag = "35")]
6995 pub next_epoch_gas_price: ::core::option::Option<u64>,
6996 #[prost(uint64, optional, tag = "36")]
6998 pub next_epoch_commission_rate: ::core::option::Option<u64>,
6999 #[prost(message, optional, tag = "37")]
7001 pub extra_fields: ::core::option::Option<MoveTable>,
7002}
7003#[non_exhaustive]
7005#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7006pub struct StakingPool {
7007 #[prost(string, optional, tag = "1")]
7009 pub id: ::core::option::Option<::prost::alloc::string::String>,
7010 #[prost(uint64, optional, tag = "2")]
7013 pub activation_epoch: ::core::option::Option<u64>,
7014 #[prost(uint64, optional, tag = "3")]
7017 pub deactivation_epoch: ::core::option::Option<u64>,
7018 #[prost(uint64, optional, tag = "4")]
7021 pub sui_balance: ::core::option::Option<u64>,
7022 #[prost(uint64, optional, tag = "5")]
7024 pub rewards_pool: ::core::option::Option<u64>,
7025 #[prost(uint64, optional, tag = "6")]
7027 pub pool_token_balance: ::core::option::Option<u64>,
7028 #[prost(message, optional, tag = "7")]
7035 pub exchange_rates: ::core::option::Option<MoveTable>,
7036 #[prost(uint64, optional, tag = "8")]
7038 pub pending_stake: ::core::option::Option<u64>,
7039 #[prost(uint64, optional, tag = "9")]
7042 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
7043 #[prost(uint64, optional, tag = "10")]
7045 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
7046 #[prost(message, optional, tag = "11")]
7048 pub extra_fields: ::core::option::Option<MoveTable>,
7049}
7050#[non_exhaustive]
7052#[derive(Clone, PartialEq, ::prost::Message)]
7053pub struct Transaction {
7054 #[prost(message, optional, tag = "1")]
7056 pub bcs: ::core::option::Option<Bcs>,
7057 #[prost(string, optional, tag = "2")]
7059 pub digest: ::core::option::Option<::prost::alloc::string::String>,
7060 #[prost(int32, optional, tag = "3")]
7062 pub version: ::core::option::Option<i32>,
7063 #[prost(message, optional, tag = "4")]
7064 pub kind: ::core::option::Option<TransactionKind>,
7065 #[prost(string, optional, tag = "5")]
7066 pub sender: ::core::option::Option<::prost::alloc::string::String>,
7067 #[prost(message, optional, tag = "6")]
7068 pub gas_payment: ::core::option::Option<GasPayment>,
7069 #[prost(message, optional, tag = "7")]
7070 pub expiration: ::core::option::Option<TransactionExpiration>,
7071}
7072#[non_exhaustive]
7074#[derive(Clone, PartialEq, ::prost::Message)]
7075pub struct GasPayment {
7076 #[prost(message, repeated, tag = "1")]
7078 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
7079 #[prost(string, optional, tag = "2")]
7081 pub owner: ::core::option::Option<::prost::alloc::string::String>,
7082 #[prost(uint64, optional, tag = "3")]
7086 pub price: ::core::option::Option<u64>,
7087 #[prost(uint64, optional, tag = "4")]
7089 pub budget: ::core::option::Option<u64>,
7090}
7091#[non_exhaustive]
7093#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7094pub struct TransactionExpiration {
7095 #[prost(
7096 enumeration = "transaction_expiration::TransactionExpirationKind",
7097 optional,
7098 tag = "1"
7099 )]
7100 pub kind: ::core::option::Option<i32>,
7101 #[prost(uint64, optional, tag = "2")]
7104 pub epoch: ::core::option::Option<u64>,
7105 #[prost(uint64, optional, tag = "3")]
7108 pub min_epoch: ::core::option::Option<u64>,
7109 #[prost(message, optional, tag = "4")]
7113 pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7114 #[prost(message, optional, tag = "5")]
7118 pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7119 #[prost(string, optional, tag = "6")]
7121 pub chain: ::core::option::Option<::prost::alloc::string::String>,
7122 #[prost(uint32, optional, tag = "7")]
7124 pub nonce: ::core::option::Option<u32>,
7125}
7126pub mod transaction_expiration {
7128 #[non_exhaustive]
7129 #[derive(
7130 Clone,
7131 Copy,
7132 Debug,
7133 PartialEq,
7134 Eq,
7135 Hash,
7136 PartialOrd,
7137 Ord,
7138 ::prost::Enumeration
7139 )]
7140 #[repr(i32)]
7141 pub enum TransactionExpirationKind {
7142 Unknown = 0,
7143 None = 1,
7145 Epoch = 2,
7148 ValidDuring = 3,
7158 }
7159 impl TransactionExpirationKind {
7160 pub fn as_str_name(&self) -> &'static str {
7165 match self {
7166 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
7167 Self::None => "NONE",
7168 Self::Epoch => "EPOCH",
7169 Self::ValidDuring => "VALID_DURING",
7170 }
7171 }
7172 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7174 match value {
7175 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
7176 "NONE" => Some(Self::None),
7177 "EPOCH" => Some(Self::Epoch),
7178 "VALID_DURING" => Some(Self::ValidDuring),
7179 _ => None,
7180 }
7181 }
7182 }
7183}
7184#[non_exhaustive]
7186#[derive(Clone, PartialEq, ::prost::Message)]
7187pub struct TransactionKind {
7188 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
7189 pub kind: ::core::option::Option<i32>,
7190 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
7191 pub data: ::core::option::Option<transaction_kind::Data>,
7192}
7193pub mod transaction_kind {
7195 #[non_exhaustive]
7196 #[derive(
7197 Clone,
7198 Copy,
7199 Debug,
7200 PartialEq,
7201 Eq,
7202 Hash,
7203 PartialOrd,
7204 Ord,
7205 ::prost::Enumeration
7206 )]
7207 #[repr(i32)]
7208 pub enum Kind {
7209 Unknown = 0,
7210 ProgrammableTransaction = 1,
7212 ChangeEpoch = 2,
7217 Genesis = 3,
7222 ConsensusCommitPrologueV1 = 4,
7224 AuthenticatorStateUpdate = 5,
7226 EndOfEpoch = 6,
7229 RandomnessStateUpdate = 7,
7231 ConsensusCommitPrologueV2 = 8,
7233 ConsensusCommitPrologueV3 = 9,
7235 ConsensusCommitPrologueV4 = 10,
7237 ProgrammableSystemTransaction = 11,
7239 }
7240 impl Kind {
7241 pub fn as_str_name(&self) -> &'static str {
7246 match self {
7247 Self::Unknown => "KIND_UNKNOWN",
7248 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
7249 Self::ChangeEpoch => "CHANGE_EPOCH",
7250 Self::Genesis => "GENESIS",
7251 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
7252 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
7253 Self::EndOfEpoch => "END_OF_EPOCH",
7254 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
7255 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
7256 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
7257 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
7258 Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
7259 }
7260 }
7261 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7263 match value {
7264 "KIND_UNKNOWN" => Some(Self::Unknown),
7265 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
7266 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7267 "GENESIS" => Some(Self::Genesis),
7268 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
7269 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
7270 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
7271 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
7272 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
7273 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
7274 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
7275 "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
7276 Some(Self::ProgrammableSystemTransaction)
7277 }
7278 _ => None,
7279 }
7280 }
7281 }
7282 #[non_exhaustive]
7283 #[derive(Clone, PartialEq, ::prost::Oneof)]
7284 pub enum Data {
7285 #[prost(message, tag = "2")]
7287 ProgrammableTransaction(super::ProgrammableTransaction),
7288 #[prost(message, tag = "3")]
7293 ChangeEpoch(super::ChangeEpoch),
7294 #[prost(message, tag = "4")]
7299 Genesis(super::GenesisTransaction),
7300 #[prost(message, tag = "5")]
7302 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
7303 #[prost(message, tag = "6")]
7305 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
7306 #[prost(message, tag = "7")]
7309 EndOfEpoch(super::EndOfEpochTransaction),
7310 #[prost(message, tag = "8")]
7312 RandomnessStateUpdate(super::RandomnessStateUpdate),
7313 }
7314}
7315#[non_exhaustive]
7320#[derive(Clone, PartialEq, ::prost::Message)]
7321pub struct ProgrammableTransaction {
7322 #[prost(message, repeated, tag = "1")]
7324 pub inputs: ::prost::alloc::vec::Vec<Input>,
7325 #[prost(message, repeated, tag = "2")]
7328 pub commands: ::prost::alloc::vec::Vec<Command>,
7329}
7330#[non_exhaustive]
7332#[derive(Clone, PartialEq, ::prost::Message)]
7333pub struct Command {
7334 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
7335 pub command: ::core::option::Option<command::Command>,
7336}
7337pub mod command {
7339 #[non_exhaustive]
7340 #[derive(Clone, PartialEq, ::prost::Oneof)]
7341 pub enum Command {
7342 #[prost(message, tag = "1")]
7344 MoveCall(super::MoveCall),
7345 #[prost(message, tag = "2")]
7350 TransferObjects(super::TransferObjects),
7351 #[prost(message, tag = "3")]
7354 SplitCoins(super::SplitCoins),
7355 #[prost(message, tag = "4")]
7358 MergeCoins(super::MergeCoins),
7359 #[prost(message, tag = "5")]
7362 Publish(super::Publish),
7363 #[prost(message, tag = "6")]
7367 MakeMoveVector(super::MakeMoveVector),
7368 #[prost(message, tag = "7")]
7377 Upgrade(super::Upgrade),
7378 }
7379}
7380#[non_exhaustive]
7385#[derive(Clone, PartialEq, ::prost::Message)]
7386pub struct MoveCall {
7387 #[prost(string, optional, tag = "1")]
7389 pub package: ::core::option::Option<::prost::alloc::string::String>,
7390 #[prost(string, optional, tag = "2")]
7392 pub module: ::core::option::Option<::prost::alloc::string::String>,
7393 #[prost(string, optional, tag = "3")]
7395 pub function: ::core::option::Option<::prost::alloc::string::String>,
7396 #[prost(string, repeated, tag = "4")]
7398 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7399 #[prost(message, repeated, tag = "5")]
7401 pub arguments: ::prost::alloc::vec::Vec<Argument>,
7402}
7403#[non_exhaustive]
7405#[derive(Clone, PartialEq, ::prost::Message)]
7406pub struct TransferObjects {
7407 #[prost(message, repeated, tag = "1")]
7409 pub objects: ::prost::alloc::vec::Vec<Argument>,
7410 #[prost(message, optional, tag = "2")]
7412 pub address: ::core::option::Option<Argument>,
7413}
7414#[non_exhaustive]
7416#[derive(Clone, PartialEq, ::prost::Message)]
7417pub struct SplitCoins {
7418 #[prost(message, optional, tag = "1")]
7420 pub coin: ::core::option::Option<Argument>,
7421 #[prost(message, repeated, tag = "2")]
7423 pub amounts: ::prost::alloc::vec::Vec<Argument>,
7424}
7425#[non_exhaustive]
7427#[derive(Clone, PartialEq, ::prost::Message)]
7428pub struct MergeCoins {
7429 #[prost(message, optional, tag = "1")]
7431 pub coin: ::core::option::Option<Argument>,
7432 #[prost(message, repeated, tag = "2")]
7436 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
7437}
7438#[non_exhaustive]
7440#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7441pub struct Publish {
7442 #[prost(bytes = "bytes", repeated, tag = "1")]
7444 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7445 #[prost(string, repeated, tag = "2")]
7447 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7448}
7449#[non_exhaustive]
7451#[derive(Clone, PartialEq, ::prost::Message)]
7452pub struct MakeMoveVector {
7453 #[prost(string, optional, tag = "1")]
7458 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
7459 #[prost(message, repeated, tag = "2")]
7461 pub elements: ::prost::alloc::vec::Vec<Argument>,
7462}
7463#[non_exhaustive]
7465#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7466pub struct Upgrade {
7467 #[prost(bytes = "bytes", repeated, tag = "1")]
7469 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7470 #[prost(string, repeated, tag = "2")]
7472 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7473 #[prost(string, optional, tag = "3")]
7475 pub package: ::core::option::Option<::prost::alloc::string::String>,
7476 #[prost(message, optional, tag = "4")]
7478 pub ticket: ::core::option::Option<Argument>,
7479}
7480#[non_exhaustive]
7482#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7483pub struct RandomnessStateUpdate {
7484 #[prost(uint64, optional, tag = "1")]
7486 pub epoch: ::core::option::Option<u64>,
7487 #[prost(uint64, optional, tag = "2")]
7489 pub randomness_round: ::core::option::Option<u64>,
7490 #[prost(bytes = "bytes", optional, tag = "3")]
7492 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
7493 #[prost(uint64, optional, tag = "4")]
7495 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
7496}
7497#[non_exhaustive]
7499#[derive(Clone, PartialEq, ::prost::Message)]
7500pub struct ChangeEpoch {
7501 #[prost(uint64, optional, tag = "1")]
7503 pub epoch: ::core::option::Option<u64>,
7504 #[prost(uint64, optional, tag = "2")]
7506 pub protocol_version: ::core::option::Option<u64>,
7507 #[prost(uint64, optional, tag = "3")]
7509 pub storage_charge: ::core::option::Option<u64>,
7510 #[prost(uint64, optional, tag = "4")]
7512 pub computation_charge: ::core::option::Option<u64>,
7513 #[prost(uint64, optional, tag = "5")]
7515 pub storage_rebate: ::core::option::Option<u64>,
7516 #[prost(uint64, optional, tag = "6")]
7518 pub non_refundable_storage_fee: ::core::option::Option<u64>,
7519 #[prost(message, optional, tag = "7")]
7521 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7522 #[prost(message, repeated, tag = "8")]
7528 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
7529}
7530#[non_exhaustive]
7532#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7533pub struct SystemPackage {
7534 #[prost(uint64, optional, tag = "1")]
7536 pub version: ::core::option::Option<u64>,
7537 #[prost(bytes = "bytes", repeated, tag = "2")]
7539 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7540 #[prost(string, repeated, tag = "3")]
7542 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7543}
7544#[non_exhaustive]
7546#[derive(Clone, PartialEq, ::prost::Message)]
7547pub struct GenesisTransaction {
7548 #[prost(message, repeated, tag = "1")]
7550 pub objects: ::prost::alloc::vec::Vec<Object>,
7551}
7552#[non_exhaustive]
7556#[derive(Clone, PartialEq, ::prost::Message)]
7557pub struct ConsensusCommitPrologue {
7558 #[prost(uint64, optional, tag = "1")]
7562 pub epoch: ::core::option::Option<u64>,
7563 #[prost(uint64, optional, tag = "2")]
7567 pub round: ::core::option::Option<u64>,
7568 #[prost(message, optional, tag = "3")]
7572 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7573 #[prost(string, optional, tag = "4")]
7577 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
7578 #[prost(uint64, optional, tag = "5")]
7583 pub sub_dag_index: ::core::option::Option<u64>,
7584 #[prost(message, optional, tag = "6")]
7588 pub consensus_determined_version_assignments: ::core::option::Option<
7589 ConsensusDeterminedVersionAssignments,
7590 >,
7591 #[prost(string, optional, tag = "7")]
7596 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
7597}
7598#[non_exhaustive]
7600#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7601pub struct VersionAssignment {
7602 #[prost(string, optional, tag = "1")]
7604 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
7605 #[prost(uint64, optional, tag = "2")]
7607 pub start_version: ::core::option::Option<u64>,
7608 #[prost(uint64, optional, tag = "3")]
7610 pub version: ::core::option::Option<u64>,
7611}
7612#[non_exhaustive]
7614#[derive(Clone, PartialEq, ::prost::Message)]
7615pub struct CanceledTransaction {
7616 #[prost(string, optional, tag = "1")]
7618 pub digest: ::core::option::Option<::prost::alloc::string::String>,
7619 #[prost(message, repeated, tag = "2")]
7621 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
7622}
7623#[non_exhaustive]
7625#[derive(Clone, PartialEq, ::prost::Message)]
7626pub struct ConsensusDeterminedVersionAssignments {
7627 #[prost(int32, optional, tag = "1")]
7629 pub version: ::core::option::Option<i32>,
7630 #[prost(message, repeated, tag = "3")]
7632 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
7633}
7634#[non_exhaustive]
7636#[derive(Clone, PartialEq, ::prost::Message)]
7637pub struct AuthenticatorStateUpdate {
7638 #[prost(uint64, optional, tag = "1")]
7640 pub epoch: ::core::option::Option<u64>,
7641 #[prost(uint64, optional, tag = "2")]
7643 pub round: ::core::option::Option<u64>,
7644 #[prost(message, repeated, tag = "3")]
7646 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
7647 #[prost(uint64, optional, tag = "4")]
7649 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7650}
7651#[non_exhaustive]
7653#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7654pub struct ActiveJwk {
7655 #[prost(message, optional, tag = "1")]
7657 pub id: ::core::option::Option<JwkId>,
7658 #[prost(message, optional, tag = "2")]
7660 pub jwk: ::core::option::Option<Jwk>,
7661 #[prost(uint64, optional, tag = "3")]
7663 pub epoch: ::core::option::Option<u64>,
7664}
7665#[non_exhaustive]
7668#[derive(Clone, PartialEq, ::prost::Message)]
7669pub struct EndOfEpochTransaction {
7670 #[prost(message, repeated, tag = "1")]
7671 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
7672}
7673#[non_exhaustive]
7675#[derive(Clone, PartialEq, ::prost::Message)]
7676pub struct EndOfEpochTransactionKind {
7677 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
7678 pub kind: ::core::option::Option<i32>,
7679 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
7680 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
7681}
7682pub mod end_of_epoch_transaction_kind {
7684 #[non_exhaustive]
7685 #[derive(
7686 Clone,
7687 Copy,
7688 Debug,
7689 PartialEq,
7690 Eq,
7691 Hash,
7692 PartialOrd,
7693 Ord,
7694 ::prost::Enumeration
7695 )]
7696 #[repr(i32)]
7697 pub enum Kind {
7698 Unknown = 0,
7699 ChangeEpoch = 1,
7701 AuthenticatorStateCreate = 2,
7703 AuthenticatorStateExpire = 3,
7705 RandomnessStateCreate = 4,
7707 DenyListStateCreate = 5,
7709 BridgeStateCreate = 6,
7711 BridgeCommitteeInit = 7,
7713 StoreExecutionTimeObservations = 8,
7715 AccumulatorRootCreate = 9,
7717 CoinRegistryCreate = 10,
7719 DisplayRegistryCreate = 11,
7721 AddressAliasStateCreate = 12,
7723 WriteAccumulatorStorageCost = 13,
7725 }
7726 impl Kind {
7727 pub fn as_str_name(&self) -> &'static str {
7732 match self {
7733 Self::Unknown => "KIND_UNKNOWN",
7734 Self::ChangeEpoch => "CHANGE_EPOCH",
7735 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
7736 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
7737 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
7738 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
7739 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
7740 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
7741 Self::StoreExecutionTimeObservations => {
7742 "STORE_EXECUTION_TIME_OBSERVATIONS"
7743 }
7744 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
7745 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
7746 Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
7747 Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
7748 Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
7749 }
7750 }
7751 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7753 match value {
7754 "KIND_UNKNOWN" => Some(Self::Unknown),
7755 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7756 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
7757 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
7758 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
7759 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
7760 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
7761 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
7762 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
7763 Some(Self::StoreExecutionTimeObservations)
7764 }
7765 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
7766 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
7767 "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
7768 "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
7769 "WRITE_ACCUMULATOR_STORAGE_COST" => {
7770 Some(Self::WriteAccumulatorStorageCost)
7771 }
7772 _ => None,
7773 }
7774 }
7775 }
7776 #[non_exhaustive]
7777 #[derive(Clone, PartialEq, ::prost::Oneof)]
7778 pub enum Data {
7779 #[prost(message, tag = "2")]
7781 ChangeEpoch(super::ChangeEpoch),
7782 #[prost(message, tag = "3")]
7784 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
7785 #[prost(message, tag = "4")]
7787 ExecutionTimeObservations(super::ExecutionTimeObservations),
7788 #[prost(string, tag = "5")]
7790 BridgeChainId(::prost::alloc::string::String),
7791 #[prost(uint64, tag = "6")]
7793 BridgeObjectVersion(u64),
7794 #[prost(uint64, tag = "7")]
7796 StorageCost(u64),
7797 }
7798}
7799#[non_exhaustive]
7801#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7802pub struct AuthenticatorStateExpire {
7803 #[prost(uint64, optional, tag = "1")]
7805 pub min_epoch: ::core::option::Option<u64>,
7806 #[prost(uint64, optional, tag = "2")]
7808 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7809}
7810#[non_exhaustive]
7811#[derive(Clone, PartialEq, ::prost::Message)]
7812pub struct ExecutionTimeObservations {
7813 #[prost(int32, optional, tag = "1")]
7815 pub version: ::core::option::Option<i32>,
7816 #[prost(message, repeated, tag = "2")]
7817 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
7818}
7819#[non_exhaustive]
7820#[derive(Clone, PartialEq, ::prost::Message)]
7821pub struct ExecutionTimeObservation {
7822 #[prost(
7823 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
7824 optional,
7825 tag = "1"
7826 )]
7827 pub kind: ::core::option::Option<i32>,
7828 #[prost(message, optional, tag = "2")]
7829 pub move_entry_point: ::core::option::Option<MoveCall>,
7830 #[prost(message, repeated, tag = "3")]
7831 pub validator_observations: ::prost::alloc::vec::Vec<
7832 ValidatorExecutionTimeObservation,
7833 >,
7834}
7835pub mod execution_time_observation {
7837 #[non_exhaustive]
7838 #[derive(
7839 Clone,
7840 Copy,
7841 Debug,
7842 PartialEq,
7843 Eq,
7844 Hash,
7845 PartialOrd,
7846 Ord,
7847 ::prost::Enumeration
7848 )]
7849 #[repr(i32)]
7850 pub enum ExecutionTimeObservationKind {
7851 Unknown = 0,
7852 MoveEntryPoint = 1,
7853 TransferObjects = 2,
7854 SplitCoins = 3,
7855 MergeCoins = 4,
7856 Publish = 5,
7857 MakeMoveVector = 6,
7858 Upgrade = 7,
7859 }
7860 impl ExecutionTimeObservationKind {
7861 pub fn as_str_name(&self) -> &'static str {
7866 match self {
7867 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
7868 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
7869 Self::TransferObjects => "TRANSFER_OBJECTS",
7870 Self::SplitCoins => "SPLIT_COINS",
7871 Self::MergeCoins => "MERGE_COINS",
7872 Self::Publish => "PUBLISH",
7873 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
7874 Self::Upgrade => "UPGRADE",
7875 }
7876 }
7877 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7879 match value {
7880 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
7881 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
7882 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
7883 "SPLIT_COINS" => Some(Self::SplitCoins),
7884 "MERGE_COINS" => Some(Self::MergeCoins),
7885 "PUBLISH" => Some(Self::Publish),
7886 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
7887 "UPGRADE" => Some(Self::Upgrade),
7888 _ => None,
7889 }
7890 }
7891 }
7892}
7893#[non_exhaustive]
7894#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7895pub struct ValidatorExecutionTimeObservation {
7896 #[prost(bytes = "bytes", optional, tag = "1")]
7898 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
7899 #[prost(message, optional, tag = "2")]
7901 pub duration: ::core::option::Option<::prost_types::Duration>,
7902}
7903#[non_exhaustive]
7904#[derive(Clone, PartialEq, ::prost::Message)]
7905pub struct ExecuteTransactionRequest {
7906 #[prost(message, optional, tag = "1")]
7908 pub transaction: ::core::option::Option<Transaction>,
7909 #[prost(message, repeated, tag = "2")]
7912 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
7913 #[prost(message, optional, tag = "3")]
7916 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7917}
7918#[non_exhaustive]
7920#[derive(Clone, PartialEq, ::prost::Message)]
7921pub struct ExecuteTransactionResponse {
7922 #[prost(message, optional, tag = "1")]
7923 pub transaction: ::core::option::Option<ExecutedTransaction>,
7924}
7925#[non_exhaustive]
7926#[derive(Clone, PartialEq, ::prost::Message)]
7927pub struct SimulateTransactionRequest {
7928 #[prost(message, optional, tag = "1")]
7929 pub transaction: ::core::option::Option<Transaction>,
7930 #[prost(message, optional, tag = "2")]
7932 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7933 #[prost(
7935 enumeration = "simulate_transaction_request::TransactionChecks",
7936 optional,
7937 tag = "3"
7938 )]
7939 pub checks: ::core::option::Option<i32>,
7940 #[prost(bool, optional, tag = "4")]
7945 pub do_gas_selection: ::core::option::Option<bool>,
7946}
7947pub mod simulate_transaction_request {
7949 #[non_exhaustive]
7951 #[derive(
7952 Clone,
7953 Copy,
7954 Debug,
7955 PartialEq,
7956 Eq,
7957 Hash,
7958 PartialOrd,
7959 Ord,
7960 ::prost::Enumeration
7961 )]
7962 #[repr(i32)]
7963 pub enum TransactionChecks {
7964 Enabled = 0,
7965 Disabled = 1,
7966 }
7967 impl TransactionChecks {
7968 pub fn as_str_name(&self) -> &'static str {
7973 match self {
7974 Self::Enabled => "ENABLED",
7975 Self::Disabled => "DISABLED",
7976 }
7977 }
7978 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7980 match value {
7981 "ENABLED" => Some(Self::Enabled),
7982 "DISABLED" => Some(Self::Disabled),
7983 _ => None,
7984 }
7985 }
7986 }
7987}
7988#[non_exhaustive]
7989#[derive(Clone, PartialEq, ::prost::Message)]
7990pub struct SimulateTransactionResponse {
7991 #[prost(message, optional, tag = "1")]
7992 pub transaction: ::core::option::Option<ExecutedTransaction>,
7993 #[prost(message, repeated, tag = "2")]
7994 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
7995 #[prost(uint64, optional, tag = "3")]
7999 pub suggested_gas_price: ::core::option::Option<u64>,
8000}
8001#[non_exhaustive]
8003#[derive(Clone, PartialEq, ::prost::Message)]
8004pub struct CommandResult {
8005 #[prost(message, repeated, tag = "1")]
8006 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
8007 #[prost(message, repeated, tag = "2")]
8008 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
8009}
8010#[non_exhaustive]
8011#[derive(Clone, PartialEq, ::prost::Message)]
8012pub struct CommandOutput {
8013 #[prost(message, optional, tag = "1")]
8014 pub argument: ::core::option::Option<Argument>,
8015 #[prost(message, optional, tag = "2")]
8016 pub value: ::core::option::Option<Bcs>,
8017 #[prost(message, optional, boxed, tag = "3")]
8019 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
8020}
8021pub mod transaction_execution_service_client {
8023 #![allow(
8024 unused_variables,
8025 dead_code,
8026 missing_docs,
8027 clippy::wildcard_imports,
8028 clippy::let_unit_value,
8029 )]
8030 use tonic::codegen::*;
8031 use tonic::codegen::http::Uri;
8032 #[derive(Debug, Clone)]
8033 pub struct TransactionExecutionServiceClient<T> {
8034 inner: tonic::client::Grpc<T>,
8035 }
8036 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
8037 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8039 where
8040 D: TryInto<tonic::transport::Endpoint>,
8041 D::Error: Into<StdError>,
8042 {
8043 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8044 Ok(Self::new(conn))
8045 }
8046 }
8047 impl<T> TransactionExecutionServiceClient<T>
8048 where
8049 T: tonic::client::GrpcService<tonic::body::Body>,
8050 T::Error: Into<StdError>,
8051 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8052 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8053 {
8054 pub fn new(inner: T) -> Self {
8055 let inner = tonic::client::Grpc::new(inner);
8056 Self { inner }
8057 }
8058 pub fn with_origin(inner: T, origin: Uri) -> Self {
8059 let inner = tonic::client::Grpc::with_origin(inner, origin);
8060 Self { inner }
8061 }
8062 pub fn with_interceptor<F>(
8063 inner: T,
8064 interceptor: F,
8065 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
8066 where
8067 F: tonic::service::Interceptor,
8068 T::ResponseBody: Default,
8069 T: tonic::codegen::Service<
8070 http::Request<tonic::body::Body>,
8071 Response = http::Response<
8072 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8073 >,
8074 >,
8075 <T as tonic::codegen::Service<
8076 http::Request<tonic::body::Body>,
8077 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8078 {
8079 TransactionExecutionServiceClient::new(
8080 InterceptedService::new(inner, interceptor),
8081 )
8082 }
8083 #[must_use]
8088 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8089 self.inner = self.inner.send_compressed(encoding);
8090 self
8091 }
8092 #[must_use]
8094 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8095 self.inner = self.inner.accept_compressed(encoding);
8096 self
8097 }
8098 #[must_use]
8102 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8103 self.inner = self.inner.max_decoding_message_size(limit);
8104 self
8105 }
8106 #[must_use]
8110 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8111 self.inner = self.inner.max_encoding_message_size(limit);
8112 self
8113 }
8114 pub async fn execute_transaction(
8115 &mut self,
8116 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
8117 ) -> std::result::Result<
8118 tonic::Response<super::ExecuteTransactionResponse>,
8119 tonic::Status,
8120 > {
8121 self.inner
8122 .ready()
8123 .await
8124 .map_err(|e| {
8125 tonic::Status::unknown(
8126 format!("Service was not ready: {}", e.into()),
8127 )
8128 })?;
8129 let codec = tonic_prost::ProstCodec::default();
8130 let path = http::uri::PathAndQuery::from_static(
8131 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
8132 );
8133 let mut req = request.into_request();
8134 req.extensions_mut()
8135 .insert(
8136 GrpcMethod::new(
8137 "sui.rpc.v2.TransactionExecutionService",
8138 "ExecuteTransaction",
8139 ),
8140 );
8141 self.inner.unary(req, path, codec).await
8142 }
8143 pub async fn simulate_transaction(
8144 &mut self,
8145 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
8146 ) -> std::result::Result<
8147 tonic::Response<super::SimulateTransactionResponse>,
8148 tonic::Status,
8149 > {
8150 self.inner
8151 .ready()
8152 .await
8153 .map_err(|e| {
8154 tonic::Status::unknown(
8155 format!("Service was not ready: {}", e.into()),
8156 )
8157 })?;
8158 let codec = tonic_prost::ProstCodec::default();
8159 let path = http::uri::PathAndQuery::from_static(
8160 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
8161 );
8162 let mut req = request.into_request();
8163 req.extensions_mut()
8164 .insert(
8165 GrpcMethod::new(
8166 "sui.rpc.v2.TransactionExecutionService",
8167 "SimulateTransaction",
8168 ),
8169 );
8170 self.inner.unary(req, path, codec).await
8171 }
8172 }
8173}
8174pub mod transaction_execution_service_server {
8176 #![allow(
8177 unused_variables,
8178 dead_code,
8179 missing_docs,
8180 clippy::wildcard_imports,
8181 clippy::let_unit_value,
8182 )]
8183 use tonic::codegen::*;
8184 #[async_trait]
8186 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
8187 async fn execute_transaction(
8188 &self,
8189 request: tonic::Request<super::ExecuteTransactionRequest>,
8190 ) -> std::result::Result<
8191 tonic::Response<super::ExecuteTransactionResponse>,
8192 tonic::Status,
8193 > {
8194 Err(tonic::Status::unimplemented("Not yet implemented"))
8195 }
8196 async fn simulate_transaction(
8197 &self,
8198 request: tonic::Request<super::SimulateTransactionRequest>,
8199 ) -> std::result::Result<
8200 tonic::Response<super::SimulateTransactionResponse>,
8201 tonic::Status,
8202 > {
8203 Err(tonic::Status::unimplemented("Not yet implemented"))
8204 }
8205 }
8206 #[derive(Debug)]
8207 pub struct TransactionExecutionServiceServer<T> {
8208 inner: Arc<T>,
8209 accept_compression_encodings: EnabledCompressionEncodings,
8210 send_compression_encodings: EnabledCompressionEncodings,
8211 max_decoding_message_size: Option<usize>,
8212 max_encoding_message_size: Option<usize>,
8213 }
8214 impl<T> TransactionExecutionServiceServer<T> {
8215 pub fn new(inner: T) -> Self {
8216 Self::from_arc(Arc::new(inner))
8217 }
8218 pub fn from_arc(inner: Arc<T>) -> Self {
8219 Self {
8220 inner,
8221 accept_compression_encodings: Default::default(),
8222 send_compression_encodings: Default::default(),
8223 max_decoding_message_size: None,
8224 max_encoding_message_size: None,
8225 }
8226 }
8227 pub fn with_interceptor<F>(
8228 inner: T,
8229 interceptor: F,
8230 ) -> InterceptedService<Self, F>
8231 where
8232 F: tonic::service::Interceptor,
8233 {
8234 InterceptedService::new(Self::new(inner), interceptor)
8235 }
8236 #[must_use]
8238 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8239 self.accept_compression_encodings.enable(encoding);
8240 self
8241 }
8242 #[must_use]
8244 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8245 self.send_compression_encodings.enable(encoding);
8246 self
8247 }
8248 #[must_use]
8252 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8253 self.max_decoding_message_size = Some(limit);
8254 self
8255 }
8256 #[must_use]
8260 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8261 self.max_encoding_message_size = Some(limit);
8262 self
8263 }
8264 }
8265 impl<T, B> tonic::codegen::Service<http::Request<B>>
8266 for TransactionExecutionServiceServer<T>
8267 where
8268 T: TransactionExecutionService,
8269 B: Body + std::marker::Send + 'static,
8270 B::Error: Into<StdError> + std::marker::Send + 'static,
8271 {
8272 type Response = http::Response<tonic::body::Body>;
8273 type Error = std::convert::Infallible;
8274 type Future = BoxFuture<Self::Response, Self::Error>;
8275 fn poll_ready(
8276 &mut self,
8277 _cx: &mut Context<'_>,
8278 ) -> Poll<std::result::Result<(), Self::Error>> {
8279 Poll::Ready(Ok(()))
8280 }
8281 fn call(&mut self, req: http::Request<B>) -> Self::Future {
8282 match req.uri().path() {
8283 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
8284 #[allow(non_camel_case_types)]
8285 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
8286 pub Arc<T>,
8287 );
8288 impl<
8289 T: TransactionExecutionService,
8290 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
8291 for ExecuteTransactionSvc<T> {
8292 type Response = super::ExecuteTransactionResponse;
8293 type Future = BoxFuture<
8294 tonic::Response<Self::Response>,
8295 tonic::Status,
8296 >;
8297 fn call(
8298 &mut self,
8299 request: tonic::Request<super::ExecuteTransactionRequest>,
8300 ) -> Self::Future {
8301 let inner = Arc::clone(&self.0);
8302 let fut = async move {
8303 <T as TransactionExecutionService>::execute_transaction(
8304 &inner,
8305 request,
8306 )
8307 .await
8308 };
8309 Box::pin(fut)
8310 }
8311 }
8312 let accept_compression_encodings = self.accept_compression_encodings;
8313 let send_compression_encodings = self.send_compression_encodings;
8314 let max_decoding_message_size = self.max_decoding_message_size;
8315 let max_encoding_message_size = self.max_encoding_message_size;
8316 let inner = self.inner.clone();
8317 let fut = async move {
8318 let method = ExecuteTransactionSvc(inner);
8319 let codec = tonic_prost::ProstCodec::default();
8320 let mut grpc = tonic::server::Grpc::new(codec)
8321 .apply_compression_config(
8322 accept_compression_encodings,
8323 send_compression_encodings,
8324 )
8325 .apply_max_message_size_config(
8326 max_decoding_message_size,
8327 max_encoding_message_size,
8328 );
8329 let res = grpc.unary(method, req).await;
8330 Ok(res)
8331 };
8332 Box::pin(fut)
8333 }
8334 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
8335 #[allow(non_camel_case_types)]
8336 struct SimulateTransactionSvc<T: TransactionExecutionService>(
8337 pub Arc<T>,
8338 );
8339 impl<
8340 T: TransactionExecutionService,
8341 > tonic::server::UnaryService<super::SimulateTransactionRequest>
8342 for SimulateTransactionSvc<T> {
8343 type Response = super::SimulateTransactionResponse;
8344 type Future = BoxFuture<
8345 tonic::Response<Self::Response>,
8346 tonic::Status,
8347 >;
8348 fn call(
8349 &mut self,
8350 request: tonic::Request<super::SimulateTransactionRequest>,
8351 ) -> Self::Future {
8352 let inner = Arc::clone(&self.0);
8353 let fut = async move {
8354 <T as TransactionExecutionService>::simulate_transaction(
8355 &inner,
8356 request,
8357 )
8358 .await
8359 };
8360 Box::pin(fut)
8361 }
8362 }
8363 let accept_compression_encodings = self.accept_compression_encodings;
8364 let send_compression_encodings = self.send_compression_encodings;
8365 let max_decoding_message_size = self.max_decoding_message_size;
8366 let max_encoding_message_size = self.max_encoding_message_size;
8367 let inner = self.inner.clone();
8368 let fut = async move {
8369 let method = SimulateTransactionSvc(inner);
8370 let codec = tonic_prost::ProstCodec::default();
8371 let mut grpc = tonic::server::Grpc::new(codec)
8372 .apply_compression_config(
8373 accept_compression_encodings,
8374 send_compression_encodings,
8375 )
8376 .apply_max_message_size_config(
8377 max_decoding_message_size,
8378 max_encoding_message_size,
8379 );
8380 let res = grpc.unary(method, req).await;
8381 Ok(res)
8382 };
8383 Box::pin(fut)
8384 }
8385 _ => {
8386 Box::pin(async move {
8387 let mut response = http::Response::new(
8388 tonic::body::Body::default(),
8389 );
8390 let headers = response.headers_mut();
8391 headers
8392 .insert(
8393 tonic::Status::GRPC_STATUS,
8394 (tonic::Code::Unimplemented as i32).into(),
8395 );
8396 headers
8397 .insert(
8398 http::header::CONTENT_TYPE,
8399 tonic::metadata::GRPC_CONTENT_TYPE,
8400 );
8401 Ok(response)
8402 })
8403 }
8404 }
8405 }
8406 }
8407 impl<T> Clone for TransactionExecutionServiceServer<T> {
8408 fn clone(&self) -> Self {
8409 let inner = self.inner.clone();
8410 Self {
8411 inner,
8412 accept_compression_encodings: self.accept_compression_encodings,
8413 send_compression_encodings: self.send_compression_encodings,
8414 max_decoding_message_size: self.max_decoding_message_size,
8415 max_encoding_message_size: self.max_encoding_message_size,
8416 }
8417 }
8418 }
8419 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
8421 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
8422 const NAME: &'static str = SERVICE_NAME;
8423 }
8424}