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]
780#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
781#[repr(i32)]
782pub enum ErrorReason {
783 Unknown = 0,
784 FieldInvalid = 1,
785 FieldMissing = 2,
786 InsufficientGasBalance = 3,
840 TransactionExecutionFailed = 4,
875}
876impl ErrorReason {
877 pub fn as_str_name(&self) -> &'static str {
882 match self {
883 Self::Unknown => "ERROR_REASON_UNKNOWN",
884 Self::FieldInvalid => "FIELD_INVALID",
885 Self::FieldMissing => "FIELD_MISSING",
886 Self::InsufficientGasBalance => "INSUFFICIENT_GAS_BALANCE",
887 Self::TransactionExecutionFailed => "TRANSACTION_EXECUTION_FAILED",
888 }
889 }
890 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
892 match value {
893 "ERROR_REASON_UNKNOWN" => Some(Self::Unknown),
894 "FIELD_INVALID" => Some(Self::FieldInvalid),
895 "FIELD_MISSING" => Some(Self::FieldMissing),
896 "INSUFFICIENT_GAS_BALANCE" => Some(Self::InsufficientGasBalance),
897 "TRANSACTION_EXECUTION_FAILED" => Some(Self::TransactionExecutionFailed),
898 _ => None,
899 }
900 }
901}
902#[non_exhaustive]
904#[derive(Clone, PartialEq, ::prost::Message)]
905pub struct TransactionEvents {
906 #[prost(message, optional, tag = "1")]
908 pub bcs: ::core::option::Option<Bcs>,
909 #[prost(string, optional, tag = "2")]
911 pub digest: ::core::option::Option<::prost::alloc::string::String>,
912 #[prost(message, repeated, tag = "3")]
914 pub events: ::prost::alloc::vec::Vec<Event>,
915}
916#[non_exhaustive]
918#[derive(Clone, PartialEq, ::prost::Message)]
919pub struct Event {
920 #[prost(string, optional, tag = "1")]
923 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
924 #[prost(string, optional, tag = "2")]
927 pub module: ::core::option::Option<::prost::alloc::string::String>,
928 #[prost(string, optional, tag = "3")]
930 pub sender: ::core::option::Option<::prost::alloc::string::String>,
931 #[prost(string, optional, tag = "4")]
933 pub event_type: ::core::option::Option<::prost::alloc::string::String>,
934 #[prost(message, optional, tag = "5")]
936 pub contents: ::core::option::Option<Bcs>,
937 #[prost(message, optional, boxed, tag = "6")]
939 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
940 #[prost(uint64, optional, tag = "7")]
946 pub checkpoint: ::core::option::Option<u64>,
947 #[prost(string, optional, tag = "8")]
949 pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
950 #[prost(uint64, optional, tag = "9")]
955 pub transaction_index: ::core::option::Option<u64>,
956 #[prost(uint32, optional, tag = "10")]
958 pub event_index: ::core::option::Option<u32>,
959}
960#[non_exhaustive]
961#[derive(Clone, PartialEq, ::prost::Message)]
962pub struct ExecutedTransaction {
963 #[prost(string, optional, tag = "1")]
965 pub digest: ::core::option::Option<::prost::alloc::string::String>,
966 #[prost(message, optional, tag = "2")]
968 pub transaction: ::core::option::Option<Transaction>,
969 #[prost(message, repeated, tag = "3")]
972 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
973 #[prost(message, optional, tag = "4")]
975 pub effects: ::core::option::Option<TransactionEffects>,
976 #[prost(message, optional, tag = "5")]
983 pub events: ::core::option::Option<TransactionEvents>,
984 #[prost(uint64, optional, tag = "6")]
986 pub checkpoint: ::core::option::Option<u64>,
987 #[prost(message, optional, tag = "7")]
989 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
990 #[prost(message, repeated, tag = "8")]
991 pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
992 #[prost(message, optional, tag = "9")]
995 pub objects: ::core::option::Option<ObjectSet>,
996 #[prost(uint64, optional, tag = "10")]
999 pub transaction_index: ::core::option::Option<u64>,
1000}
1001#[non_exhaustive]
1003#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1004pub struct ExecutionStatus {
1005 #[prost(bool, optional, tag = "1")]
1007 pub success: ::core::option::Option<bool>,
1008 #[prost(message, optional, tag = "2")]
1010 pub error: ::core::option::Option<ExecutionError>,
1011}
1012#[non_exhaustive]
1014#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1015pub struct ExecutionError {
1016 #[prost(string, optional, tag = "1")]
1018 pub description: ::core::option::Option<::prost::alloc::string::String>,
1019 #[prost(uint64, optional, tag = "2")]
1021 pub command: ::core::option::Option<u64>,
1022 #[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
1023 pub kind: ::core::option::Option<i32>,
1024 #[prost(
1025 oneof = "execution_error::ErrorDetails",
1026 tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
1027 )]
1028 pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
1029}
1030pub mod execution_error {
1032 #[non_exhaustive]
1033 #[derive(
1034 Clone,
1035 Copy,
1036 Debug,
1037 PartialEq,
1038 Eq,
1039 Hash,
1040 PartialOrd,
1041 Ord,
1042 ::prost::Enumeration
1043 )]
1044 #[repr(i32)]
1045 pub enum ExecutionErrorKind {
1046 Unknown = 0,
1047 InsufficientGas = 1,
1049 InvalidGasObject = 2,
1051 InvariantViolation = 3,
1053 FeatureNotYetSupported = 4,
1055 ObjectTooBig = 5,
1057 PackageTooBig = 6,
1059 CircularObjectOwnership = 7,
1061 InsufficientCoinBalance = 8,
1063 CoinBalanceOverflow = 9,
1065 PublishErrorNonZeroAddress = 10,
1068 SuiMoveVerificationError = 11,
1070 MovePrimitiveRuntimeError = 12,
1074 MoveAbort = 13,
1076 VmVerificationOrDeserializationError = 14,
1078 VmInvariantViolation = 15,
1080 FunctionNotFound = 16,
1082 ArityMismatch = 17,
1085 TypeArityMismatch = 18,
1088 NonEntryFunctionInvoked = 19,
1090 CommandArgumentError = 20,
1092 TypeArgumentError = 21,
1094 UnusedValueWithoutDrop = 22,
1096 InvalidPublicFunctionReturnType = 23,
1099 InvalidTransferObject = 24,
1101 EffectsTooLarge = 25,
1103 PublishUpgradeMissingDependency = 26,
1105 PublishUpgradeDependencyDowngrade = 27,
1111 PackageUpgradeError = 28,
1113 WrittenObjectsTooLarge = 29,
1115 CertificateDenied = 30,
1117 SuiMoveVerificationTimedout = 31,
1119 ConsensusObjectOperationNotAllowed = 32,
1121 InputObjectDeleted = 33,
1123 ExecutionCanceledDueToConsensusObjectCongestion = 34,
1125 AddressDeniedForCoin = 35,
1127 CoinTypeGlobalPause = 36,
1129 ExecutionCanceledDueToRandomnessUnavailable = 37,
1131 MoveVectorElemTooBig = 38,
1135 MoveRawValueTooBig = 39,
1139 InvalidLinkage = 40,
1141 InsufficientFundsForWithdraw = 41,
1143 NonExclusiveWriteInputObjectModified = 42,
1145 }
1146 impl ExecutionErrorKind {
1147 pub fn as_str_name(&self) -> &'static str {
1152 match self {
1153 Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
1154 Self::InsufficientGas => "INSUFFICIENT_GAS",
1155 Self::InvalidGasObject => "INVALID_GAS_OBJECT",
1156 Self::InvariantViolation => "INVARIANT_VIOLATION",
1157 Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
1158 Self::ObjectTooBig => "OBJECT_TOO_BIG",
1159 Self::PackageTooBig => "PACKAGE_TOO_BIG",
1160 Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
1161 Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
1162 Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
1163 Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
1164 Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
1165 Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
1166 Self::MoveAbort => "MOVE_ABORT",
1167 Self::VmVerificationOrDeserializationError => {
1168 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
1169 }
1170 Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
1171 Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
1172 Self::ArityMismatch => "ARITY_MISMATCH",
1173 Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
1174 Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
1175 Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
1176 Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
1177 Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
1178 Self::InvalidPublicFunctionReturnType => {
1179 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
1180 }
1181 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1182 Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
1183 Self::PublishUpgradeMissingDependency => {
1184 "PUBLISH_UPGRADE_MISSING_DEPENDENCY"
1185 }
1186 Self::PublishUpgradeDependencyDowngrade => {
1187 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
1188 }
1189 Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
1190 Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
1191 Self::CertificateDenied => "CERTIFICATE_DENIED",
1192 Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
1193 Self::ConsensusObjectOperationNotAllowed => {
1194 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1195 }
1196 Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
1197 Self::ExecutionCanceledDueToConsensusObjectCongestion => {
1198 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION"
1199 }
1200 Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
1201 Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
1202 Self::ExecutionCanceledDueToRandomnessUnavailable => {
1203 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
1204 }
1205 Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
1206 Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
1207 Self::InvalidLinkage => "INVALID_LINKAGE",
1208 Self::InsufficientFundsForWithdraw => "INSUFFICIENT_FUNDS_FOR_WITHDRAW",
1209 Self::NonExclusiveWriteInputObjectModified => {
1210 "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED"
1211 }
1212 }
1213 }
1214 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1216 match value {
1217 "EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1218 "INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
1219 "INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
1220 "INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
1221 "FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
1222 "OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
1223 "PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
1224 "CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
1225 "INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
1226 "COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
1227 "PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
1228 Some(Self::PublishErrorNonZeroAddress)
1229 }
1230 "SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
1231 "MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
1232 "MOVE_ABORT" => Some(Self::MoveAbort),
1233 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
1234 Some(Self::VmVerificationOrDeserializationError)
1235 }
1236 "VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
1237 "FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
1238 "ARITY_MISMATCH" => Some(Self::ArityMismatch),
1239 "TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
1240 "NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
1241 "COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
1242 "TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
1243 "UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
1244 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
1245 Some(Self::InvalidPublicFunctionReturnType)
1246 }
1247 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1248 "EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
1249 "PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
1250 Some(Self::PublishUpgradeMissingDependency)
1251 }
1252 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
1253 Some(Self::PublishUpgradeDependencyDowngrade)
1254 }
1255 "PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
1256 "WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
1257 "CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
1258 "SUI_MOVE_VERIFICATION_TIMEDOUT" => {
1259 Some(Self::SuiMoveVerificationTimedout)
1260 }
1261 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1262 Some(Self::ConsensusObjectOperationNotAllowed)
1263 }
1264 "INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
1265 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION" => {
1266 Some(Self::ExecutionCanceledDueToConsensusObjectCongestion)
1267 }
1268 "ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
1269 "COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
1270 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
1271 Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
1272 }
1273 "MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
1274 "MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
1275 "INVALID_LINKAGE" => Some(Self::InvalidLinkage),
1276 "INSUFFICIENT_FUNDS_FOR_WITHDRAW" => {
1277 Some(Self::InsufficientFundsForWithdraw)
1278 }
1279 "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED" => {
1280 Some(Self::NonExclusiveWriteInputObjectModified)
1281 }
1282 _ => None,
1283 }
1284 }
1285 }
1286 #[non_exhaustive]
1287 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1288 pub enum ErrorDetails {
1289 #[prost(message, tag = "4")]
1290 Abort(super::MoveAbort),
1291 #[prost(message, tag = "5")]
1292 SizeError(super::SizeError),
1293 #[prost(message, tag = "6")]
1294 CommandArgumentError(super::CommandArgumentError),
1295 #[prost(message, tag = "7")]
1296 TypeArgumentError(super::TypeArgumentError),
1297 #[prost(message, tag = "8")]
1298 PackageUpgradeError(super::PackageUpgradeError),
1299 #[prost(message, tag = "9")]
1300 IndexError(super::IndexError),
1301 #[prost(string, tag = "10")]
1302 ObjectId(::prost::alloc::string::String),
1303 #[prost(message, tag = "11")]
1304 CoinDenyListError(super::CoinDenyListError),
1305 #[prost(message, tag = "12")]
1307 CongestedObjects(super::CongestedObjects),
1308 }
1309}
1310#[non_exhaustive]
1311#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1312pub struct MoveAbort {
1313 #[prost(uint64, optional, tag = "1")]
1314 pub abort_code: ::core::option::Option<u64>,
1315 #[prost(message, optional, tag = "2")]
1317 pub location: ::core::option::Option<MoveLocation>,
1318 #[prost(message, optional, tag = "3")]
1320 pub clever_error: ::core::option::Option<CleverError>,
1321}
1322#[non_exhaustive]
1324#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1325pub struct MoveLocation {
1326 #[prost(string, optional, tag = "1")]
1328 pub package: ::core::option::Option<::prost::alloc::string::String>,
1329 #[prost(string, optional, tag = "2")]
1331 pub module: ::core::option::Option<::prost::alloc::string::String>,
1332 #[prost(uint32, optional, tag = "3")]
1334 pub function: ::core::option::Option<u32>,
1335 #[prost(uint32, optional, tag = "4")]
1337 pub instruction: ::core::option::Option<u32>,
1338 #[prost(string, optional, tag = "5")]
1340 pub function_name: ::core::option::Option<::prost::alloc::string::String>,
1341}
1342#[non_exhaustive]
1343#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1344pub struct CleverError {
1345 #[prost(uint64, optional, tag = "1")]
1346 pub error_code: ::core::option::Option<u64>,
1347 #[prost(uint64, optional, tag = "2")]
1348 pub line_number: ::core::option::Option<u64>,
1349 #[prost(string, optional, tag = "3")]
1350 pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
1351 #[prost(string, optional, tag = "4")]
1352 pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
1353 #[prost(oneof = "clever_error::Value", tags = "5, 6")]
1354 pub value: ::core::option::Option<clever_error::Value>,
1355}
1356pub mod clever_error {
1358 #[non_exhaustive]
1359 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1360 pub enum Value {
1361 #[prost(string, tag = "5")]
1362 Rendered(::prost::alloc::string::String),
1363 #[prost(bytes, tag = "6")]
1364 Raw(::prost::bytes::Bytes),
1365 }
1366}
1367#[non_exhaustive]
1369#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1370pub struct SizeError {
1371 #[prost(uint64, optional, tag = "1")]
1373 pub size: ::core::option::Option<u64>,
1374 #[prost(uint64, optional, tag = "2")]
1376 pub max_size: ::core::option::Option<u64>,
1377}
1378#[non_exhaustive]
1379#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1380pub struct IndexError {
1381 #[prost(uint32, optional, tag = "1")]
1383 pub index: ::core::option::Option<u32>,
1384 #[prost(uint32, optional, tag = "2")]
1386 pub subresult: ::core::option::Option<u32>,
1387}
1388#[non_exhaustive]
1389#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1390pub struct CoinDenyListError {
1391 #[prost(string, optional, tag = "1")]
1393 pub address: ::core::option::Option<::prost::alloc::string::String>,
1394 #[prost(string, optional, tag = "2")]
1396 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1397}
1398#[non_exhaustive]
1400#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1401pub struct CongestedObjects {
1402 #[prost(string, repeated, tag = "1")]
1403 pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1404}
1405#[non_exhaustive]
1407#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1408pub struct CommandArgumentError {
1409 #[prost(uint32, optional, tag = "1")]
1411 pub argument: ::core::option::Option<u32>,
1412 #[prost(
1413 enumeration = "command_argument_error::CommandArgumentErrorKind",
1414 optional,
1415 tag = "2"
1416 )]
1417 pub kind: ::core::option::Option<i32>,
1418 #[prost(message, optional, tag = "3")]
1419 pub index_error: ::core::option::Option<IndexError>,
1420}
1421pub mod command_argument_error {
1423 #[non_exhaustive]
1424 #[derive(
1425 Clone,
1426 Copy,
1427 Debug,
1428 PartialEq,
1429 Eq,
1430 Hash,
1431 PartialOrd,
1432 Ord,
1433 ::prost::Enumeration
1434 )]
1435 #[repr(i32)]
1436 pub enum CommandArgumentErrorKind {
1437 Unknown = 0,
1438 TypeMismatch = 1,
1440 InvalidBcsBytes = 2,
1442 InvalidUsageOfPureArgument = 3,
1444 InvalidArgumentToPrivateEntryFunction = 4,
1447 IndexOutOfBounds = 5,
1451 SecondaryIndexOutOfBounds = 6,
1455 InvalidResultArity = 7,
1459 InvalidGasCoinUsage = 8,
1462 InvalidValueUsage = 9,
1467 InvalidObjectByValue = 10,
1469 InvalidObjectByMutRef = 11,
1471 ConsensusObjectOperationNotAllowed = 12,
1474 InvalidArgumentArity = 13,
1477 InvalidTransferObject = 14,
1479 InvalidMakeMoveVecNonObjectArgument = 15,
1482 ArgumentWithoutValue = 16,
1484 CannotMoveBorrowedValue = 17,
1489 CannotWriteToExtendedReference = 18,
1493 InvalidReferenceArgument = 19,
1497 InvalidTxContext = 20,
1501 }
1502 impl CommandArgumentErrorKind {
1503 pub fn as_str_name(&self) -> &'static str {
1508 match self {
1509 Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1510 Self::TypeMismatch => "TYPE_MISMATCH",
1511 Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1512 Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1513 Self::InvalidArgumentToPrivateEntryFunction => {
1514 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1515 }
1516 Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1517 Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1518 Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1519 Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1520 Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1521 Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1522 Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1523 Self::ConsensusObjectOperationNotAllowed => {
1524 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1525 }
1526 Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1527 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1528 Self::InvalidMakeMoveVecNonObjectArgument => {
1529 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1530 }
1531 Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1532 Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1533 Self::CannotWriteToExtendedReference => {
1534 "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1535 }
1536 Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1537 Self::InvalidTxContext => "INVALID_TX_CONTEXT",
1538 }
1539 }
1540 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1542 match value {
1543 "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1544 "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1545 "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1546 "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1547 Some(Self::InvalidUsageOfPureArgument)
1548 }
1549 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1550 Some(Self::InvalidArgumentToPrivateEntryFunction)
1551 }
1552 "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1553 "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1554 "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1555 "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1556 "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1557 "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1558 "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1559 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1560 Some(Self::ConsensusObjectOperationNotAllowed)
1561 }
1562 "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1563 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1564 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1565 Some(Self::InvalidMakeMoveVecNonObjectArgument)
1566 }
1567 "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1568 "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1569 "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1570 Some(Self::CannotWriteToExtendedReference)
1571 }
1572 "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1573 "INVALID_TX_CONTEXT" => Some(Self::InvalidTxContext),
1574 _ => None,
1575 }
1576 }
1577 }
1578}
1579#[non_exhaustive]
1581#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1582pub struct PackageUpgradeError {
1583 #[prost(
1584 enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1585 optional,
1586 tag = "1"
1587 )]
1588 pub kind: ::core::option::Option<i32>,
1589 #[prost(string, optional, tag = "2")]
1591 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1592 #[prost(string, optional, tag = "3")]
1594 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1595 #[prost(uint32, optional, tag = "4")]
1597 pub policy: ::core::option::Option<u32>,
1598 #[prost(string, optional, tag = "5")]
1600 pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1601}
1602pub mod package_upgrade_error {
1604 #[non_exhaustive]
1605 #[derive(
1606 Clone,
1607 Copy,
1608 Debug,
1609 PartialEq,
1610 Eq,
1611 Hash,
1612 PartialOrd,
1613 Ord,
1614 ::prost::Enumeration
1615 )]
1616 #[repr(i32)]
1617 pub enum PackageUpgradeErrorKind {
1618 Unknown = 0,
1619 UnableToFetchPackage = 1,
1621 NotAPackage = 2,
1623 IncompatibleUpgrade = 3,
1625 DigestDoesNotMatch = 4,
1627 UnknownUpgradePolicy = 5,
1629 PackageIdDoesNotMatch = 6,
1631 }
1632 impl PackageUpgradeErrorKind {
1633 pub fn as_str_name(&self) -> &'static str {
1638 match self {
1639 Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1640 Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1641 Self::NotAPackage => "NOT_A_PACKAGE",
1642 Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1643 Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1644 Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1645 Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1646 }
1647 }
1648 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1650 match value {
1651 "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1652 "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1653 "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1654 "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1655 "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1656 "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1657 "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1658 _ => None,
1659 }
1660 }
1661 }
1662}
1663#[non_exhaustive]
1665#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1666pub struct TypeArgumentError {
1667 #[prost(uint32, optional, tag = "1")]
1669 pub type_argument: ::core::option::Option<u32>,
1670 #[prost(
1671 enumeration = "type_argument_error::TypeArgumentErrorKind",
1672 optional,
1673 tag = "2"
1674 )]
1675 pub kind: ::core::option::Option<i32>,
1676}
1677pub mod type_argument_error {
1679 #[non_exhaustive]
1680 #[derive(
1681 Clone,
1682 Copy,
1683 Debug,
1684 PartialEq,
1685 Eq,
1686 Hash,
1687 PartialOrd,
1688 Ord,
1689 ::prost::Enumeration
1690 )]
1691 #[repr(i32)]
1692 pub enum TypeArgumentErrorKind {
1693 Unknown = 0,
1694 TypeNotFound = 1,
1696 ConstraintNotSatisfied = 2,
1698 }
1699 impl TypeArgumentErrorKind {
1700 pub fn as_str_name(&self) -> &'static str {
1705 match self {
1706 Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1707 Self::TypeNotFound => "TYPE_NOT_FOUND",
1708 Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1709 }
1710 }
1711 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1713 match value {
1714 "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1715 "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1716 "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1717 _ => None,
1718 }
1719 }
1720 }
1721}
1722#[derive(Eq, Hash)]
1727#[non_exhaustive]
1728#[derive(Clone, PartialEq, ::prost::Message)]
1729pub struct TransactionFilter {
1730 #[prost(message, repeated, tag = "1")]
1732 pub terms: ::prost::alloc::vec::Vec<TransactionTerm>,
1733}
1734#[derive(Eq, Hash)]
1736#[non_exhaustive]
1737#[derive(Clone, PartialEq, ::prost::Message)]
1738pub struct TransactionTerm {
1739 #[prost(message, repeated, tag = "1")]
1741 pub literals: ::prost::alloc::vec::Vec<TransactionLiteral>,
1742}
1743#[non_exhaustive]
1745#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1746pub struct TransactionLiteral {
1747 #[prost(bool, tag = "1")]
1750 pub negated: bool,
1751 #[prost(oneof = "transaction_literal::Predicate", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
1753 pub predicate: ::core::option::Option<transaction_literal::Predicate>,
1754}
1755pub mod transaction_literal {
1757 #[non_exhaustive]
1759 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1760 pub enum Predicate {
1761 #[prost(message, tag = "2")]
1763 Sender(super::SenderFilter),
1764 #[prost(message, tag = "3")]
1769 AffectedAddress(super::AffectedAddressFilter),
1770 #[prost(message, tag = "4")]
1773 AffectedObject(super::AffectedObjectFilter),
1774 #[prost(message, tag = "5")]
1776 MoveCall(super::MoveCallFilter),
1777 #[prost(message, tag = "6")]
1780 EmitModule(super::EmitModuleFilter),
1781 #[prost(message, tag = "7")]
1784 EventType(super::EventTypeFilter),
1785 #[prost(message, tag = "8")]
1788 EventStreamHead(super::EventStreamHeadFilter),
1789 #[prost(message, tag = "9")]
1792 PackageWrite(super::PackageWriteFilter),
1793 }
1794}
1795#[non_exhaustive]
1801#[derive(Clone, PartialEq, ::prost::Message)]
1802pub struct EventFilter {
1803 #[prost(message, repeated, tag = "1")]
1805 pub terms: ::prost::alloc::vec::Vec<EventTerm>,
1806}
1807#[non_exhaustive]
1809#[derive(Clone, PartialEq, ::prost::Message)]
1810pub struct EventTerm {
1811 #[prost(message, repeated, tag = "1")]
1813 pub literals: ::prost::alloc::vec::Vec<EventLiteral>,
1814}
1815#[non_exhaustive]
1817#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1818pub struct EventLiteral {
1819 #[prost(bool, tag = "1")]
1821 pub negated: bool,
1822 #[prost(oneof = "event_literal::Predicate", tags = "2, 3, 4, 5")]
1824 pub predicate: ::core::option::Option<event_literal::Predicate>,
1825}
1826pub mod event_literal {
1828 #[non_exhaustive]
1830 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1831 pub enum Predicate {
1832 #[prost(message, tag = "2")]
1834 Sender(super::SenderFilter),
1835 #[prost(message, tag = "3")]
1837 EmitModule(super::EmitModuleFilter),
1838 #[prost(message, tag = "4")]
1840 EventType(super::EventTypeFilter),
1841 #[prost(message, tag = "5")]
1843 EventStreamHead(super::EventStreamHeadFilter),
1844 }
1845}
1846#[non_exhaustive]
1848#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1849pub struct SenderFilter {
1850 #[prost(string, optional, tag = "1")]
1852 pub address: ::core::option::Option<::prost::alloc::string::String>,
1853}
1854#[non_exhaustive]
1859#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1860pub struct AffectedAddressFilter {
1861 #[prost(string, optional, tag = "1")]
1863 pub address: ::core::option::Option<::prost::alloc::string::String>,
1864}
1865#[non_exhaustive]
1867#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1868pub struct AffectedObjectFilter {
1869 #[prost(string, optional, tag = "1")]
1871 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1872}
1873#[non_exhaustive]
1880#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1881pub struct MoveCallFilter {
1882 #[prost(string, optional, tag = "1")]
1884 pub function: ::core::option::Option<::prost::alloc::string::String>,
1885}
1886#[non_exhaustive]
1893#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1894pub struct EmitModuleFilter {
1895 #[prost(string, optional, tag = "1")]
1897 pub module: ::core::option::Option<::prost::alloc::string::String>,
1898}
1899#[non_exhaustive]
1907#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1908pub struct EventTypeFilter {
1909 #[prost(string, optional, tag = "1")]
1912 pub event_type: ::core::option::Option<::prost::alloc::string::String>,
1913}
1914#[non_exhaustive]
1916#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1917pub struct EventStreamHeadFilter {
1918 #[prost(string, optional, tag = "1")]
1920 pub stream_id: ::core::option::Option<::prost::alloc::string::String>,
1921}
1922#[non_exhaustive]
1924#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1925pub struct PackageWriteFilter {}
1926#[non_exhaustive]
1928#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1929pub struct GasCostSummary {
1930 #[prost(uint64, optional, tag = "1")]
1932 pub computation_cost: ::core::option::Option<u64>,
1933 #[prost(uint64, optional, tag = "2")]
1935 pub storage_cost: ::core::option::Option<u64>,
1936 #[prost(uint64, optional, tag = "3")]
1939 pub storage_rebate: ::core::option::Option<u64>,
1940 #[prost(uint64, optional, tag = "4")]
1942 pub non_refundable_storage_fee: ::core::option::Option<u64>,
1943}
1944#[non_exhaustive]
1946#[derive(Clone, PartialEq, ::prost::Message)]
1947pub struct Input {
1948 #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1949 pub kind: ::core::option::Option<i32>,
1950 #[prost(bytes = "bytes", optional, tag = "2")]
1955 pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1956 #[prost(string, optional, tag = "3")]
1958 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1959 #[prost(uint64, optional, tag = "4")]
1963 pub version: ::core::option::Option<u64>,
1964 #[prost(string, optional, tag = "5")]
1966 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1967 #[prost(bool, optional, tag = "6")]
1970 pub mutable: ::core::option::Option<bool>,
1971 #[prost(enumeration = "input::Mutability", optional, tag = "7")]
1976 pub mutability: ::core::option::Option<i32>,
1977 #[prost(message, optional, tag = "8")]
1979 pub funds_withdrawal: ::core::option::Option<FundsWithdrawal>,
1980 #[prost(message, optional, boxed, tag = "1000")]
1984 pub literal: ::core::option::Option<
1985 ::prost::alloc::boxed::Box<::prost_types::Value>,
1986 >,
1987}
1988pub mod input {
1990 #[non_exhaustive]
1991 #[derive(
1992 Clone,
1993 Copy,
1994 Debug,
1995 PartialEq,
1996 Eq,
1997 Hash,
1998 PartialOrd,
1999 Ord,
2000 ::prost::Enumeration
2001 )]
2002 #[repr(i32)]
2003 pub enum InputKind {
2004 Unknown = 0,
2005 Pure = 1,
2007 ImmutableOrOwned = 2,
2009 Shared = 3,
2011 Receiving = 4,
2013 FundsWithdrawal = 5,
2015 }
2016 impl InputKind {
2017 pub fn as_str_name(&self) -> &'static str {
2022 match self {
2023 Self::Unknown => "INPUT_KIND_UNKNOWN",
2024 Self::Pure => "PURE",
2025 Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
2026 Self::Shared => "SHARED",
2027 Self::Receiving => "RECEIVING",
2028 Self::FundsWithdrawal => "FUNDS_WITHDRAWAL",
2029 }
2030 }
2031 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2033 match value {
2034 "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
2035 "PURE" => Some(Self::Pure),
2036 "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
2037 "SHARED" => Some(Self::Shared),
2038 "RECEIVING" => Some(Self::Receiving),
2039 "FUNDS_WITHDRAWAL" => Some(Self::FundsWithdrawal),
2040 _ => None,
2041 }
2042 }
2043 }
2044 #[non_exhaustive]
2045 #[derive(
2046 Clone,
2047 Copy,
2048 Debug,
2049 PartialEq,
2050 Eq,
2051 Hash,
2052 PartialOrd,
2053 Ord,
2054 ::prost::Enumeration
2055 )]
2056 #[repr(i32)]
2057 pub enum Mutability {
2058 Unknown = 0,
2059 Immutable = 1,
2060 Mutable = 2,
2061 NonExclusiveWrite = 3,
2065 }
2066 impl Mutability {
2067 pub fn as_str_name(&self) -> &'static str {
2072 match self {
2073 Self::Unknown => "MUTABILITY_UNKNOWN",
2074 Self::Immutable => "IMMUTABLE",
2075 Self::Mutable => "MUTABLE",
2076 Self::NonExclusiveWrite => "NON_EXCLUSIVE_WRITE",
2077 }
2078 }
2079 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2081 match value {
2082 "MUTABILITY_UNKNOWN" => Some(Self::Unknown),
2083 "IMMUTABLE" => Some(Self::Immutable),
2084 "MUTABLE" => Some(Self::Mutable),
2085 "NON_EXCLUSIVE_WRITE" => Some(Self::NonExclusiveWrite),
2086 _ => None,
2087 }
2088 }
2089 }
2090}
2091#[non_exhaustive]
2092#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2093pub struct FundsWithdrawal {
2094 #[prost(uint64, optional, tag = "1")]
2095 pub amount: ::core::option::Option<u64>,
2096 #[prost(string, optional, tag = "2")]
2097 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
2098 #[prost(enumeration = "funds_withdrawal::Source", optional, tag = "3")]
2099 pub source: ::core::option::Option<i32>,
2100 #[prost(string, optional, tag = "4")]
2102 pub funder: ::core::option::Option<::prost::alloc::string::String>,
2103 #[prost(string, optional, tag = "5")]
2106 pub allowance: ::core::option::Option<::prost::alloc::string::String>,
2107}
2108pub mod funds_withdrawal {
2110 #[non_exhaustive]
2111 #[derive(
2112 Clone,
2113 Copy,
2114 Debug,
2115 PartialEq,
2116 Eq,
2117 Hash,
2118 PartialOrd,
2119 Ord,
2120 ::prost::Enumeration
2121 )]
2122 #[repr(i32)]
2123 pub enum Source {
2124 Unknown = 0,
2125 Sender = 1,
2126 Sponsor = 2,
2127 SenderAllowance = 3,
2130 }
2131 impl Source {
2132 pub fn as_str_name(&self) -> &'static str {
2137 match self {
2138 Self::Unknown => "SOURCE_UNKNOWN",
2139 Self::Sender => "SENDER",
2140 Self::Sponsor => "SPONSOR",
2141 Self::SenderAllowance => "SENDER_ALLOWANCE",
2142 }
2143 }
2144 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2146 match value {
2147 "SOURCE_UNKNOWN" => Some(Self::Unknown),
2148 "SENDER" => Some(Self::Sender),
2149 "SPONSOR" => Some(Self::Sponsor),
2150 "SENDER_ALLOWANCE" => Some(Self::SenderAllowance),
2151 _ => None,
2152 }
2153 }
2154 }
2155}
2156#[non_exhaustive]
2158#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2159pub struct JwkId {
2160 #[prost(string, optional, tag = "1")]
2162 pub iss: ::core::option::Option<::prost::alloc::string::String>,
2163 #[prost(string, optional, tag = "2")]
2165 pub kid: ::core::option::Option<::prost::alloc::string::String>,
2166}
2167#[non_exhaustive]
2173#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2174pub struct Jwk {
2175 #[prost(string, optional, tag = "1")]
2177 pub kty: ::core::option::Option<::prost::alloc::string::String>,
2178 #[prost(string, optional, tag = "2")]
2180 pub e: ::core::option::Option<::prost::alloc::string::String>,
2181 #[prost(string, optional, tag = "3")]
2183 pub n: ::core::option::Option<::prost::alloc::string::String>,
2184 #[prost(string, optional, tag = "4")]
2186 pub alg: ::core::option::Option<::prost::alloc::string::String>,
2187}
2188#[non_exhaustive]
2189#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2190pub struct GetServiceInfoRequest {}
2191#[non_exhaustive]
2192#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2193pub struct GetServiceInfoResponse {
2194 #[prost(string, optional, tag = "1")]
2199 pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
2200 #[prost(string, optional, tag = "2")]
2204 pub chain: ::core::option::Option<::prost::alloc::string::String>,
2205 #[prost(uint64, optional, tag = "3")]
2207 pub epoch: ::core::option::Option<u64>,
2208 #[prost(uint64, optional, tag = "4")]
2210 pub checkpoint_height: ::core::option::Option<u64>,
2211 #[prost(message, optional, tag = "5")]
2213 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
2214 #[prost(uint64, optional, tag = "6")]
2216 pub lowest_available_checkpoint: ::core::option::Option<u64>,
2217 #[prost(uint64, optional, tag = "7")]
2219 pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
2220 #[prost(string, optional, tag = "8")]
2222 pub server: ::core::option::Option<::prost::alloc::string::String>,
2223}
2224#[non_exhaustive]
2225#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2226pub struct GetObjectRequest {
2227 #[prost(string, optional, tag = "1")]
2229 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2230 #[prost(uint64, optional, tag = "2")]
2234 pub version: ::core::option::Option<u64>,
2235 #[prost(message, optional, tag = "3")]
2238 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2239}
2240#[non_exhaustive]
2241#[derive(Clone, PartialEq, ::prost::Message)]
2242pub struct GetObjectResponse {
2243 #[prost(message, optional, tag = "1")]
2244 pub object: ::core::option::Option<Object>,
2245}
2246#[non_exhaustive]
2247#[derive(Clone, PartialEq, ::prost::Message)]
2248pub struct BatchGetObjectsRequest {
2249 #[prost(message, repeated, tag = "1")]
2250 pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
2251 #[prost(message, optional, tag = "2")]
2254 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2255}
2256#[non_exhaustive]
2257#[derive(Clone, PartialEq, ::prost::Message)]
2258pub struct BatchGetObjectsResponse {
2259 #[prost(message, repeated, tag = "1")]
2260 pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
2261}
2262#[non_exhaustive]
2263#[derive(Clone, PartialEq, ::prost::Message)]
2264pub struct GetObjectResult {
2265 #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
2266 pub result: ::core::option::Option<get_object_result::Result>,
2267}
2268pub mod get_object_result {
2270 #[non_exhaustive]
2271 #[derive(Clone, PartialEq, ::prost::Oneof)]
2272 pub enum Result {
2273 #[prost(message, tag = "1")]
2274 Object(super::Object),
2275 #[prost(message, tag = "2")]
2276 Error(super::super::super::super::google::rpc::Status),
2277 }
2278}
2279#[non_exhaustive]
2280#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2281pub struct GetTransactionRequest {
2282 #[prost(string, optional, tag = "1")]
2284 pub digest: ::core::option::Option<::prost::alloc::string::String>,
2285 #[prost(message, optional, tag = "2")]
2288 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2289}
2290#[non_exhaustive]
2291#[derive(Clone, PartialEq, ::prost::Message)]
2292pub struct GetTransactionResponse {
2293 #[prost(message, optional, tag = "1")]
2294 pub transaction: ::core::option::Option<ExecutedTransaction>,
2295}
2296#[non_exhaustive]
2297#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2298pub struct BatchGetTransactionsRequest {
2299 #[prost(string, repeated, tag = "1")]
2301 pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2302 #[prost(message, optional, tag = "2")]
2305 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2306}
2307#[non_exhaustive]
2308#[derive(Clone, PartialEq, ::prost::Message)]
2309pub struct BatchGetTransactionsResponse {
2310 #[prost(message, repeated, tag = "1")]
2311 pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
2312}
2313#[non_exhaustive]
2314#[derive(Clone, PartialEq, ::prost::Message)]
2315pub struct GetTransactionResult {
2316 #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
2317 pub result: ::core::option::Option<get_transaction_result::Result>,
2318}
2319pub mod get_transaction_result {
2321 #[non_exhaustive]
2322 #[derive(Clone, PartialEq, ::prost::Oneof)]
2323 pub enum Result {
2324 #[prost(message, tag = "1")]
2325 Transaction(super::ExecutedTransaction),
2326 #[prost(message, tag = "2")]
2327 Error(super::super::super::super::google::rpc::Status),
2328 }
2329}
2330#[non_exhaustive]
2331#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2332pub struct GetCheckpointRequest {
2333 #[prost(message, optional, tag = "3")]
2336 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2337 #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
2339 pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
2340}
2341pub mod get_checkpoint_request {
2343 #[non_exhaustive]
2345 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2346 pub enum CheckpointId {
2347 #[prost(uint64, tag = "1")]
2349 SequenceNumber(u64),
2350 #[prost(string, tag = "2")]
2352 Digest(::prost::alloc::string::String),
2353 }
2354}
2355#[non_exhaustive]
2356#[derive(Clone, PartialEq, ::prost::Message)]
2357pub struct GetCheckpointResponse {
2358 #[prost(message, optional, tag = "1")]
2359 pub checkpoint: ::core::option::Option<Checkpoint>,
2360}
2361#[non_exhaustive]
2362#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2363pub struct GetEpochRequest {
2364 #[prost(uint64, optional, tag = "1")]
2367 pub epoch: ::core::option::Option<u64>,
2368 #[prost(message, optional, tag = "2")]
2371 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2372}
2373#[non_exhaustive]
2374#[derive(Clone, PartialEq, ::prost::Message)]
2375pub struct GetEpochResponse {
2376 #[prost(message, optional, tag = "1")]
2377 pub epoch: ::core::option::Option<Epoch>,
2378}
2379#[non_exhaustive]
2381#[derive(Clone, PartialEq, ::prost::Message)]
2382pub struct ListCheckpointsRequest {
2383 #[prost(message, optional, tag = "1")]
2386 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2387 #[prost(uint64, optional, tag = "2")]
2390 pub start_checkpoint: ::core::option::Option<u64>,
2391 #[prost(uint64, optional, tag = "3")]
2394 pub end_checkpoint: ::core::option::Option<u64>,
2395 #[prost(message, optional, tag = "4")]
2399 pub filter: ::core::option::Option<TransactionFilter>,
2400 #[prost(message, optional, tag = "5")]
2406 pub options: ::core::option::Option<QueryOptions>,
2407}
2408#[non_exhaustive]
2419#[derive(Clone, PartialEq, ::prost::Message)]
2420pub struct ListCheckpointsResponse {
2421 #[prost(message, optional, tag = "1")]
2423 pub checkpoint: ::core::option::Option<Checkpoint>,
2424 #[prost(message, optional, tag = "2")]
2428 pub watermark: ::core::option::Option<Watermark>,
2429 #[prost(message, optional, tag = "3")]
2431 pub end: ::core::option::Option<QueryEnd>,
2432}
2433#[non_exhaustive]
2435#[derive(Clone, PartialEq, ::prost::Message)]
2436pub struct ListTransactionsRequest {
2437 #[prost(message, optional, tag = "1")]
2440 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2441 #[prost(uint64, optional, tag = "2")]
2444 pub start_checkpoint: ::core::option::Option<u64>,
2445 #[prost(uint64, optional, tag = "3")]
2448 pub end_checkpoint: ::core::option::Option<u64>,
2449 #[prost(message, optional, tag = "4")]
2452 pub filter: ::core::option::Option<TransactionFilter>,
2453 #[prost(message, optional, tag = "5")]
2459 pub options: ::core::option::Option<QueryOptions>,
2460}
2461#[non_exhaustive]
2472#[derive(Clone, PartialEq, ::prost::Message)]
2473pub struct ListTransactionsResponse {
2474 #[prost(message, optional, tag = "1")]
2477 pub transaction: ::core::option::Option<ExecutedTransaction>,
2478 #[prost(message, optional, tag = "2")]
2482 pub watermark: ::core::option::Option<Watermark>,
2483 #[prost(message, optional, tag = "3")]
2485 pub end: ::core::option::Option<QueryEnd>,
2486}
2487#[non_exhaustive]
2489#[derive(Clone, PartialEq, ::prost::Message)]
2490pub struct ListEventsRequest {
2491 #[prost(message, optional, tag = "1")]
2493 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2494 #[prost(uint64, optional, tag = "2")]
2497 pub start_checkpoint: ::core::option::Option<u64>,
2498 #[prost(uint64, optional, tag = "3")]
2501 pub end_checkpoint: ::core::option::Option<u64>,
2502 #[prost(message, optional, tag = "4")]
2505 pub filter: ::core::option::Option<EventFilter>,
2506 #[prost(message, optional, tag = "5")]
2512 pub options: ::core::option::Option<QueryOptions>,
2513}
2514#[non_exhaustive]
2525#[derive(Clone, PartialEq, ::prost::Message)]
2526pub struct ListEventsResponse {
2527 #[prost(message, optional, tag = "1")]
2532 pub event: ::core::option::Option<Event>,
2533 #[prost(message, optional, tag = "2")]
2537 pub watermark: ::core::option::Option<Watermark>,
2538 #[prost(message, optional, tag = "3")]
2540 pub end: ::core::option::Option<QueryEnd>,
2541}
2542pub mod ledger_service_client {
2544 #![allow(
2545 unused_variables,
2546 dead_code,
2547 missing_docs,
2548 clippy::wildcard_imports,
2549 clippy::let_unit_value,
2550 )]
2551 use tonic::codegen::*;
2552 use tonic::codegen::http::Uri;
2553 #[derive(Debug, Clone)]
2554 pub struct LedgerServiceClient<T> {
2555 inner: tonic::client::Grpc<T>,
2556 }
2557 impl LedgerServiceClient<tonic::transport::Channel> {
2558 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2560 where
2561 D: TryInto<tonic::transport::Endpoint>,
2562 D::Error: Into<StdError>,
2563 {
2564 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2565 Ok(Self::new(conn))
2566 }
2567 }
2568 impl<T> LedgerServiceClient<T>
2569 where
2570 T: tonic::client::GrpcService<tonic::body::Body>,
2571 T::Error: Into<StdError>,
2572 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2573 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2574 {
2575 pub fn new(inner: T) -> Self {
2576 let inner = tonic::client::Grpc::new(inner);
2577 Self { inner }
2578 }
2579 pub fn with_origin(inner: T, origin: Uri) -> Self {
2580 let inner = tonic::client::Grpc::with_origin(inner, origin);
2581 Self { inner }
2582 }
2583 pub fn with_interceptor<F>(
2584 inner: T,
2585 interceptor: F,
2586 ) -> LedgerServiceClient<InterceptedService<T, F>>
2587 where
2588 F: tonic::service::Interceptor,
2589 T::ResponseBody: Default,
2590 T: tonic::codegen::Service<
2591 http::Request<tonic::body::Body>,
2592 Response = http::Response<
2593 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2594 >,
2595 >,
2596 <T as tonic::codegen::Service<
2597 http::Request<tonic::body::Body>,
2598 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2599 {
2600 LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
2601 }
2602 #[must_use]
2607 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2608 self.inner = self.inner.send_compressed(encoding);
2609 self
2610 }
2611 #[must_use]
2613 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2614 self.inner = self.inner.accept_compressed(encoding);
2615 self
2616 }
2617 #[must_use]
2621 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2622 self.inner = self.inner.max_decoding_message_size(limit);
2623 self
2624 }
2625 #[must_use]
2629 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2630 self.inner = self.inner.max_encoding_message_size(limit);
2631 self
2632 }
2633 pub async fn get_service_info(
2635 &mut self,
2636 request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
2637 ) -> std::result::Result<
2638 tonic::Response<super::GetServiceInfoResponse>,
2639 tonic::Status,
2640 > {
2641 self.inner
2642 .ready()
2643 .await
2644 .map_err(|e| {
2645 tonic::Status::unknown(
2646 format!("Service was not ready: {}", e.into()),
2647 )
2648 })?;
2649 let codec = tonic_prost::ProstCodec::default();
2650 let path = http::uri::PathAndQuery::from_static(
2651 "/sui.rpc.v2.LedgerService/GetServiceInfo",
2652 );
2653 let mut req = request.into_request();
2654 req.extensions_mut()
2655 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
2656 self.inner.unary(req, path, codec).await
2657 }
2658 pub async fn get_object(
2659 &mut self,
2660 request: impl tonic::IntoRequest<super::GetObjectRequest>,
2661 ) -> std::result::Result<
2662 tonic::Response<super::GetObjectResponse>,
2663 tonic::Status,
2664 > {
2665 self.inner
2666 .ready()
2667 .await
2668 .map_err(|e| {
2669 tonic::Status::unknown(
2670 format!("Service was not ready: {}", e.into()),
2671 )
2672 })?;
2673 let codec = tonic_prost::ProstCodec::default();
2674 let path = http::uri::PathAndQuery::from_static(
2675 "/sui.rpc.v2.LedgerService/GetObject",
2676 );
2677 let mut req = request.into_request();
2678 req.extensions_mut()
2679 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
2680 self.inner.unary(req, path, codec).await
2681 }
2682 pub async fn batch_get_objects(
2683 &mut self,
2684 request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
2685 ) -> std::result::Result<
2686 tonic::Response<super::BatchGetObjectsResponse>,
2687 tonic::Status,
2688 > {
2689 self.inner
2690 .ready()
2691 .await
2692 .map_err(|e| {
2693 tonic::Status::unknown(
2694 format!("Service was not ready: {}", e.into()),
2695 )
2696 })?;
2697 let codec = tonic_prost::ProstCodec::default();
2698 let path = http::uri::PathAndQuery::from_static(
2699 "/sui.rpc.v2.LedgerService/BatchGetObjects",
2700 );
2701 let mut req = request.into_request();
2702 req.extensions_mut()
2703 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
2704 self.inner.unary(req, path, codec).await
2705 }
2706 pub async fn get_transaction(
2707 &mut self,
2708 request: impl tonic::IntoRequest<super::GetTransactionRequest>,
2709 ) -> std::result::Result<
2710 tonic::Response<super::GetTransactionResponse>,
2711 tonic::Status,
2712 > {
2713 self.inner
2714 .ready()
2715 .await
2716 .map_err(|e| {
2717 tonic::Status::unknown(
2718 format!("Service was not ready: {}", e.into()),
2719 )
2720 })?;
2721 let codec = tonic_prost::ProstCodec::default();
2722 let path = http::uri::PathAndQuery::from_static(
2723 "/sui.rpc.v2.LedgerService/GetTransaction",
2724 );
2725 let mut req = request.into_request();
2726 req.extensions_mut()
2727 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
2728 self.inner.unary(req, path, codec).await
2729 }
2730 pub async fn batch_get_transactions(
2731 &mut self,
2732 request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
2733 ) -> std::result::Result<
2734 tonic::Response<super::BatchGetTransactionsResponse>,
2735 tonic::Status,
2736 > {
2737 self.inner
2738 .ready()
2739 .await
2740 .map_err(|e| {
2741 tonic::Status::unknown(
2742 format!("Service was not ready: {}", e.into()),
2743 )
2744 })?;
2745 let codec = tonic_prost::ProstCodec::default();
2746 let path = http::uri::PathAndQuery::from_static(
2747 "/sui.rpc.v2.LedgerService/BatchGetTransactions",
2748 );
2749 let mut req = request.into_request();
2750 req.extensions_mut()
2751 .insert(
2752 GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
2753 );
2754 self.inner.unary(req, path, codec).await
2755 }
2756 pub async fn get_checkpoint(
2757 &mut self,
2758 request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
2759 ) -> std::result::Result<
2760 tonic::Response<super::GetCheckpointResponse>,
2761 tonic::Status,
2762 > {
2763 self.inner
2764 .ready()
2765 .await
2766 .map_err(|e| {
2767 tonic::Status::unknown(
2768 format!("Service was not ready: {}", e.into()),
2769 )
2770 })?;
2771 let codec = tonic_prost::ProstCodec::default();
2772 let path = http::uri::PathAndQuery::from_static(
2773 "/sui.rpc.v2.LedgerService/GetCheckpoint",
2774 );
2775 let mut req = request.into_request();
2776 req.extensions_mut()
2777 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
2778 self.inner.unary(req, path, codec).await
2779 }
2780 pub async fn get_epoch(
2781 &mut self,
2782 request: impl tonic::IntoRequest<super::GetEpochRequest>,
2783 ) -> std::result::Result<
2784 tonic::Response<super::GetEpochResponse>,
2785 tonic::Status,
2786 > {
2787 self.inner
2788 .ready()
2789 .await
2790 .map_err(|e| {
2791 tonic::Status::unknown(
2792 format!("Service was not ready: {}", e.into()),
2793 )
2794 })?;
2795 let codec = tonic_prost::ProstCodec::default();
2796 let path = http::uri::PathAndQuery::from_static(
2797 "/sui.rpc.v2.LedgerService/GetEpoch",
2798 );
2799 let mut req = request.into_request();
2800 req.extensions_mut()
2801 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
2802 self.inner.unary(req, path, codec).await
2803 }
2804 pub async fn list_checkpoints(
2810 &mut self,
2811 request: impl tonic::IntoRequest<super::ListCheckpointsRequest>,
2812 ) -> std::result::Result<
2813 tonic::Response<tonic::codec::Streaming<super::ListCheckpointsResponse>>,
2814 tonic::Status,
2815 > {
2816 self.inner
2817 .ready()
2818 .await
2819 .map_err(|e| {
2820 tonic::Status::unknown(
2821 format!("Service was not ready: {}", e.into()),
2822 )
2823 })?;
2824 let codec = tonic_prost::ProstCodec::default();
2825 let path = http::uri::PathAndQuery::from_static(
2826 "/sui.rpc.v2.LedgerService/ListCheckpoints",
2827 );
2828 let mut req = request.into_request();
2829 req.extensions_mut()
2830 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListCheckpoints"));
2831 self.inner.server_streaming(req, path, codec).await
2832 }
2833 pub async fn list_transactions(
2838 &mut self,
2839 request: impl tonic::IntoRequest<super::ListTransactionsRequest>,
2840 ) -> std::result::Result<
2841 tonic::Response<tonic::codec::Streaming<super::ListTransactionsResponse>>,
2842 tonic::Status,
2843 > {
2844 self.inner
2845 .ready()
2846 .await
2847 .map_err(|e| {
2848 tonic::Status::unknown(
2849 format!("Service was not ready: {}", e.into()),
2850 )
2851 })?;
2852 let codec = tonic_prost::ProstCodec::default();
2853 let path = http::uri::PathAndQuery::from_static(
2854 "/sui.rpc.v2.LedgerService/ListTransactions",
2855 );
2856 let mut req = request.into_request();
2857 req.extensions_mut()
2858 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListTransactions"));
2859 self.inner.server_streaming(req, path, codec).await
2860 }
2861 pub async fn list_events(
2866 &mut self,
2867 request: impl tonic::IntoRequest<super::ListEventsRequest>,
2868 ) -> std::result::Result<
2869 tonic::Response<tonic::codec::Streaming<super::ListEventsResponse>>,
2870 tonic::Status,
2871 > {
2872 self.inner
2873 .ready()
2874 .await
2875 .map_err(|e| {
2876 tonic::Status::unknown(
2877 format!("Service was not ready: {}", e.into()),
2878 )
2879 })?;
2880 let codec = tonic_prost::ProstCodec::default();
2881 let path = http::uri::PathAndQuery::from_static(
2882 "/sui.rpc.v2.LedgerService/ListEvents",
2883 );
2884 let mut req = request.into_request();
2885 req.extensions_mut()
2886 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListEvents"));
2887 self.inner.server_streaming(req, path, codec).await
2888 }
2889 }
2890}
2891pub mod ledger_service_server {
2893 #![allow(
2894 unused_variables,
2895 dead_code,
2896 missing_docs,
2897 clippy::wildcard_imports,
2898 clippy::let_unit_value,
2899 )]
2900 use tonic::codegen::*;
2901 #[async_trait]
2903 pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2904 async fn get_service_info(
2906 &self,
2907 request: tonic::Request<super::GetServiceInfoRequest>,
2908 ) -> std::result::Result<
2909 tonic::Response<super::GetServiceInfoResponse>,
2910 tonic::Status,
2911 > {
2912 Err(tonic::Status::unimplemented("Not yet implemented"))
2913 }
2914 async fn get_object(
2915 &self,
2916 request: tonic::Request<super::GetObjectRequest>,
2917 ) -> std::result::Result<
2918 tonic::Response<super::GetObjectResponse>,
2919 tonic::Status,
2920 > {
2921 Err(tonic::Status::unimplemented("Not yet implemented"))
2922 }
2923 async fn batch_get_objects(
2924 &self,
2925 request: tonic::Request<super::BatchGetObjectsRequest>,
2926 ) -> std::result::Result<
2927 tonic::Response<super::BatchGetObjectsResponse>,
2928 tonic::Status,
2929 > {
2930 Err(tonic::Status::unimplemented("Not yet implemented"))
2931 }
2932 async fn get_transaction(
2933 &self,
2934 request: tonic::Request<super::GetTransactionRequest>,
2935 ) -> std::result::Result<
2936 tonic::Response<super::GetTransactionResponse>,
2937 tonic::Status,
2938 > {
2939 Err(tonic::Status::unimplemented("Not yet implemented"))
2940 }
2941 async fn batch_get_transactions(
2942 &self,
2943 request: tonic::Request<super::BatchGetTransactionsRequest>,
2944 ) -> std::result::Result<
2945 tonic::Response<super::BatchGetTransactionsResponse>,
2946 tonic::Status,
2947 > {
2948 Err(tonic::Status::unimplemented("Not yet implemented"))
2949 }
2950 async fn get_checkpoint(
2951 &self,
2952 request: tonic::Request<super::GetCheckpointRequest>,
2953 ) -> std::result::Result<
2954 tonic::Response<super::GetCheckpointResponse>,
2955 tonic::Status,
2956 > {
2957 Err(tonic::Status::unimplemented("Not yet implemented"))
2958 }
2959 async fn get_epoch(
2960 &self,
2961 request: tonic::Request<super::GetEpochRequest>,
2962 ) -> std::result::Result<
2963 tonic::Response<super::GetEpochResponse>,
2964 tonic::Status,
2965 > {
2966 Err(tonic::Status::unimplemented("Not yet implemented"))
2967 }
2968 async fn list_checkpoints(
2974 &self,
2975 request: tonic::Request<super::ListCheckpointsRequest>,
2976 ) -> std::result::Result<
2977 tonic::Response<BoxStream<super::ListCheckpointsResponse>>,
2978 tonic::Status,
2979 > {
2980 Err(tonic::Status::unimplemented("Not yet implemented"))
2981 }
2982 async fn list_transactions(
2987 &self,
2988 request: tonic::Request<super::ListTransactionsRequest>,
2989 ) -> std::result::Result<
2990 tonic::Response<BoxStream<super::ListTransactionsResponse>>,
2991 tonic::Status,
2992 > {
2993 Err(tonic::Status::unimplemented("Not yet implemented"))
2994 }
2995 async fn list_events(
3000 &self,
3001 request: tonic::Request<super::ListEventsRequest>,
3002 ) -> std::result::Result<
3003 tonic::Response<BoxStream<super::ListEventsResponse>>,
3004 tonic::Status,
3005 > {
3006 Err(tonic::Status::unimplemented("Not yet implemented"))
3007 }
3008 }
3009 #[derive(Debug)]
3010 pub struct LedgerServiceServer<T> {
3011 inner: Arc<T>,
3012 accept_compression_encodings: EnabledCompressionEncodings,
3013 send_compression_encodings: EnabledCompressionEncodings,
3014 max_decoding_message_size: Option<usize>,
3015 max_encoding_message_size: Option<usize>,
3016 }
3017 impl<T> LedgerServiceServer<T> {
3018 pub fn new(inner: T) -> Self {
3019 Self::from_arc(Arc::new(inner))
3020 }
3021 pub fn from_arc(inner: Arc<T>) -> Self {
3022 Self {
3023 inner,
3024 accept_compression_encodings: Default::default(),
3025 send_compression_encodings: Default::default(),
3026 max_decoding_message_size: None,
3027 max_encoding_message_size: None,
3028 }
3029 }
3030 pub fn with_interceptor<F>(
3031 inner: T,
3032 interceptor: F,
3033 ) -> InterceptedService<Self, F>
3034 where
3035 F: tonic::service::Interceptor,
3036 {
3037 InterceptedService::new(Self::new(inner), interceptor)
3038 }
3039 #[must_use]
3041 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3042 self.accept_compression_encodings.enable(encoding);
3043 self
3044 }
3045 #[must_use]
3047 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3048 self.send_compression_encodings.enable(encoding);
3049 self
3050 }
3051 #[must_use]
3055 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3056 self.max_decoding_message_size = Some(limit);
3057 self
3058 }
3059 #[must_use]
3063 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3064 self.max_encoding_message_size = Some(limit);
3065 self
3066 }
3067 }
3068 impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
3069 where
3070 T: LedgerService,
3071 B: Body + std::marker::Send + 'static,
3072 B::Error: Into<StdError> + std::marker::Send + 'static,
3073 {
3074 type Response = http::Response<tonic::body::Body>;
3075 type Error = std::convert::Infallible;
3076 type Future = BoxFuture<Self::Response, Self::Error>;
3077 fn poll_ready(
3078 &mut self,
3079 _cx: &mut Context<'_>,
3080 ) -> Poll<std::result::Result<(), Self::Error>> {
3081 Poll::Ready(Ok(()))
3082 }
3083 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3084 match req.uri().path() {
3085 "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
3086 #[allow(non_camel_case_types)]
3087 struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
3088 impl<
3089 T: LedgerService,
3090 > tonic::server::UnaryService<super::GetServiceInfoRequest>
3091 for GetServiceInfoSvc<T> {
3092 type Response = super::GetServiceInfoResponse;
3093 type Future = BoxFuture<
3094 tonic::Response<Self::Response>,
3095 tonic::Status,
3096 >;
3097 fn call(
3098 &mut self,
3099 request: tonic::Request<super::GetServiceInfoRequest>,
3100 ) -> Self::Future {
3101 let inner = Arc::clone(&self.0);
3102 let fut = async move {
3103 <T as LedgerService>::get_service_info(&inner, request)
3104 .await
3105 };
3106 Box::pin(fut)
3107 }
3108 }
3109 let accept_compression_encodings = self.accept_compression_encodings;
3110 let send_compression_encodings = self.send_compression_encodings;
3111 let max_decoding_message_size = self.max_decoding_message_size;
3112 let max_encoding_message_size = self.max_encoding_message_size;
3113 let inner = self.inner.clone();
3114 let fut = async move {
3115 let method = GetServiceInfoSvc(inner);
3116 let codec = tonic_prost::ProstCodec::default();
3117 let mut grpc = tonic::server::Grpc::new(codec)
3118 .apply_compression_config(
3119 accept_compression_encodings,
3120 send_compression_encodings,
3121 )
3122 .apply_max_message_size_config(
3123 max_decoding_message_size,
3124 max_encoding_message_size,
3125 );
3126 let res = grpc.unary(method, req).await;
3127 Ok(res)
3128 };
3129 Box::pin(fut)
3130 }
3131 "/sui.rpc.v2.LedgerService/GetObject" => {
3132 #[allow(non_camel_case_types)]
3133 struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
3134 impl<
3135 T: LedgerService,
3136 > tonic::server::UnaryService<super::GetObjectRequest>
3137 for GetObjectSvc<T> {
3138 type Response = super::GetObjectResponse;
3139 type Future = BoxFuture<
3140 tonic::Response<Self::Response>,
3141 tonic::Status,
3142 >;
3143 fn call(
3144 &mut self,
3145 request: tonic::Request<super::GetObjectRequest>,
3146 ) -> Self::Future {
3147 let inner = Arc::clone(&self.0);
3148 let fut = async move {
3149 <T as LedgerService>::get_object(&inner, request).await
3150 };
3151 Box::pin(fut)
3152 }
3153 }
3154 let accept_compression_encodings = self.accept_compression_encodings;
3155 let send_compression_encodings = self.send_compression_encodings;
3156 let max_decoding_message_size = self.max_decoding_message_size;
3157 let max_encoding_message_size = self.max_encoding_message_size;
3158 let inner = self.inner.clone();
3159 let fut = async move {
3160 let method = GetObjectSvc(inner);
3161 let codec = tonic_prost::ProstCodec::default();
3162 let mut grpc = tonic::server::Grpc::new(codec)
3163 .apply_compression_config(
3164 accept_compression_encodings,
3165 send_compression_encodings,
3166 )
3167 .apply_max_message_size_config(
3168 max_decoding_message_size,
3169 max_encoding_message_size,
3170 );
3171 let res = grpc.unary(method, req).await;
3172 Ok(res)
3173 };
3174 Box::pin(fut)
3175 }
3176 "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
3177 #[allow(non_camel_case_types)]
3178 struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
3179 impl<
3180 T: LedgerService,
3181 > tonic::server::UnaryService<super::BatchGetObjectsRequest>
3182 for BatchGetObjectsSvc<T> {
3183 type Response = super::BatchGetObjectsResponse;
3184 type Future = BoxFuture<
3185 tonic::Response<Self::Response>,
3186 tonic::Status,
3187 >;
3188 fn call(
3189 &mut self,
3190 request: tonic::Request<super::BatchGetObjectsRequest>,
3191 ) -> Self::Future {
3192 let inner = Arc::clone(&self.0);
3193 let fut = async move {
3194 <T as LedgerService>::batch_get_objects(&inner, request)
3195 .await
3196 };
3197 Box::pin(fut)
3198 }
3199 }
3200 let accept_compression_encodings = self.accept_compression_encodings;
3201 let send_compression_encodings = self.send_compression_encodings;
3202 let max_decoding_message_size = self.max_decoding_message_size;
3203 let max_encoding_message_size = self.max_encoding_message_size;
3204 let inner = self.inner.clone();
3205 let fut = async move {
3206 let method = BatchGetObjectsSvc(inner);
3207 let codec = tonic_prost::ProstCodec::default();
3208 let mut grpc = tonic::server::Grpc::new(codec)
3209 .apply_compression_config(
3210 accept_compression_encodings,
3211 send_compression_encodings,
3212 )
3213 .apply_max_message_size_config(
3214 max_decoding_message_size,
3215 max_encoding_message_size,
3216 );
3217 let res = grpc.unary(method, req).await;
3218 Ok(res)
3219 };
3220 Box::pin(fut)
3221 }
3222 "/sui.rpc.v2.LedgerService/GetTransaction" => {
3223 #[allow(non_camel_case_types)]
3224 struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
3225 impl<
3226 T: LedgerService,
3227 > tonic::server::UnaryService<super::GetTransactionRequest>
3228 for GetTransactionSvc<T> {
3229 type Response = super::GetTransactionResponse;
3230 type Future = BoxFuture<
3231 tonic::Response<Self::Response>,
3232 tonic::Status,
3233 >;
3234 fn call(
3235 &mut self,
3236 request: tonic::Request<super::GetTransactionRequest>,
3237 ) -> Self::Future {
3238 let inner = Arc::clone(&self.0);
3239 let fut = async move {
3240 <T as LedgerService>::get_transaction(&inner, request).await
3241 };
3242 Box::pin(fut)
3243 }
3244 }
3245 let accept_compression_encodings = self.accept_compression_encodings;
3246 let send_compression_encodings = self.send_compression_encodings;
3247 let max_decoding_message_size = self.max_decoding_message_size;
3248 let max_encoding_message_size = self.max_encoding_message_size;
3249 let inner = self.inner.clone();
3250 let fut = async move {
3251 let method = GetTransactionSvc(inner);
3252 let codec = tonic_prost::ProstCodec::default();
3253 let mut grpc = tonic::server::Grpc::new(codec)
3254 .apply_compression_config(
3255 accept_compression_encodings,
3256 send_compression_encodings,
3257 )
3258 .apply_max_message_size_config(
3259 max_decoding_message_size,
3260 max_encoding_message_size,
3261 );
3262 let res = grpc.unary(method, req).await;
3263 Ok(res)
3264 };
3265 Box::pin(fut)
3266 }
3267 "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
3268 #[allow(non_camel_case_types)]
3269 struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
3270 impl<
3271 T: LedgerService,
3272 > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
3273 for BatchGetTransactionsSvc<T> {
3274 type Response = super::BatchGetTransactionsResponse;
3275 type Future = BoxFuture<
3276 tonic::Response<Self::Response>,
3277 tonic::Status,
3278 >;
3279 fn call(
3280 &mut self,
3281 request: tonic::Request<super::BatchGetTransactionsRequest>,
3282 ) -> Self::Future {
3283 let inner = Arc::clone(&self.0);
3284 let fut = async move {
3285 <T as LedgerService>::batch_get_transactions(
3286 &inner,
3287 request,
3288 )
3289 .await
3290 };
3291 Box::pin(fut)
3292 }
3293 }
3294 let accept_compression_encodings = self.accept_compression_encodings;
3295 let send_compression_encodings = self.send_compression_encodings;
3296 let max_decoding_message_size = self.max_decoding_message_size;
3297 let max_encoding_message_size = self.max_encoding_message_size;
3298 let inner = self.inner.clone();
3299 let fut = async move {
3300 let method = BatchGetTransactionsSvc(inner);
3301 let codec = tonic_prost::ProstCodec::default();
3302 let mut grpc = tonic::server::Grpc::new(codec)
3303 .apply_compression_config(
3304 accept_compression_encodings,
3305 send_compression_encodings,
3306 )
3307 .apply_max_message_size_config(
3308 max_decoding_message_size,
3309 max_encoding_message_size,
3310 );
3311 let res = grpc.unary(method, req).await;
3312 Ok(res)
3313 };
3314 Box::pin(fut)
3315 }
3316 "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
3317 #[allow(non_camel_case_types)]
3318 struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
3319 impl<
3320 T: LedgerService,
3321 > tonic::server::UnaryService<super::GetCheckpointRequest>
3322 for GetCheckpointSvc<T> {
3323 type Response = super::GetCheckpointResponse;
3324 type Future = BoxFuture<
3325 tonic::Response<Self::Response>,
3326 tonic::Status,
3327 >;
3328 fn call(
3329 &mut self,
3330 request: tonic::Request<super::GetCheckpointRequest>,
3331 ) -> Self::Future {
3332 let inner = Arc::clone(&self.0);
3333 let fut = async move {
3334 <T as LedgerService>::get_checkpoint(&inner, request).await
3335 };
3336 Box::pin(fut)
3337 }
3338 }
3339 let accept_compression_encodings = self.accept_compression_encodings;
3340 let send_compression_encodings = self.send_compression_encodings;
3341 let max_decoding_message_size = self.max_decoding_message_size;
3342 let max_encoding_message_size = self.max_encoding_message_size;
3343 let inner = self.inner.clone();
3344 let fut = async move {
3345 let method = GetCheckpointSvc(inner);
3346 let codec = tonic_prost::ProstCodec::default();
3347 let mut grpc = tonic::server::Grpc::new(codec)
3348 .apply_compression_config(
3349 accept_compression_encodings,
3350 send_compression_encodings,
3351 )
3352 .apply_max_message_size_config(
3353 max_decoding_message_size,
3354 max_encoding_message_size,
3355 );
3356 let res = grpc.unary(method, req).await;
3357 Ok(res)
3358 };
3359 Box::pin(fut)
3360 }
3361 "/sui.rpc.v2.LedgerService/GetEpoch" => {
3362 #[allow(non_camel_case_types)]
3363 struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
3364 impl<
3365 T: LedgerService,
3366 > tonic::server::UnaryService<super::GetEpochRequest>
3367 for GetEpochSvc<T> {
3368 type Response = super::GetEpochResponse;
3369 type Future = BoxFuture<
3370 tonic::Response<Self::Response>,
3371 tonic::Status,
3372 >;
3373 fn call(
3374 &mut self,
3375 request: tonic::Request<super::GetEpochRequest>,
3376 ) -> Self::Future {
3377 let inner = Arc::clone(&self.0);
3378 let fut = async move {
3379 <T as LedgerService>::get_epoch(&inner, request).await
3380 };
3381 Box::pin(fut)
3382 }
3383 }
3384 let accept_compression_encodings = self.accept_compression_encodings;
3385 let send_compression_encodings = self.send_compression_encodings;
3386 let max_decoding_message_size = self.max_decoding_message_size;
3387 let max_encoding_message_size = self.max_encoding_message_size;
3388 let inner = self.inner.clone();
3389 let fut = async move {
3390 let method = GetEpochSvc(inner);
3391 let codec = tonic_prost::ProstCodec::default();
3392 let mut grpc = tonic::server::Grpc::new(codec)
3393 .apply_compression_config(
3394 accept_compression_encodings,
3395 send_compression_encodings,
3396 )
3397 .apply_max_message_size_config(
3398 max_decoding_message_size,
3399 max_encoding_message_size,
3400 );
3401 let res = grpc.unary(method, req).await;
3402 Ok(res)
3403 };
3404 Box::pin(fut)
3405 }
3406 "/sui.rpc.v2.LedgerService/ListCheckpoints" => {
3407 #[allow(non_camel_case_types)]
3408 struct ListCheckpointsSvc<T: LedgerService>(pub Arc<T>);
3409 impl<
3410 T: LedgerService,
3411 > tonic::server::ServerStreamingService<
3412 super::ListCheckpointsRequest,
3413 > for ListCheckpointsSvc<T> {
3414 type Response = super::ListCheckpointsResponse;
3415 type ResponseStream = BoxStream<super::ListCheckpointsResponse>;
3416 type Future = BoxFuture<
3417 tonic::Response<Self::ResponseStream>,
3418 tonic::Status,
3419 >;
3420 fn call(
3421 &mut self,
3422 request: tonic::Request<super::ListCheckpointsRequest>,
3423 ) -> Self::Future {
3424 let inner = Arc::clone(&self.0);
3425 let fut = async move {
3426 <T as LedgerService>::list_checkpoints(&inner, request)
3427 .await
3428 };
3429 Box::pin(fut)
3430 }
3431 }
3432 let accept_compression_encodings = self.accept_compression_encodings;
3433 let send_compression_encodings = self.send_compression_encodings;
3434 let max_decoding_message_size = self.max_decoding_message_size;
3435 let max_encoding_message_size = self.max_encoding_message_size;
3436 let inner = self.inner.clone();
3437 let fut = async move {
3438 let method = ListCheckpointsSvc(inner);
3439 let codec = tonic_prost::ProstCodec::default();
3440 let mut grpc = tonic::server::Grpc::new(codec)
3441 .apply_compression_config(
3442 accept_compression_encodings,
3443 send_compression_encodings,
3444 )
3445 .apply_max_message_size_config(
3446 max_decoding_message_size,
3447 max_encoding_message_size,
3448 );
3449 let res = grpc.server_streaming(method, req).await;
3450 Ok(res)
3451 };
3452 Box::pin(fut)
3453 }
3454 "/sui.rpc.v2.LedgerService/ListTransactions" => {
3455 #[allow(non_camel_case_types)]
3456 struct ListTransactionsSvc<T: LedgerService>(pub Arc<T>);
3457 impl<
3458 T: LedgerService,
3459 > tonic::server::ServerStreamingService<
3460 super::ListTransactionsRequest,
3461 > for ListTransactionsSvc<T> {
3462 type Response = super::ListTransactionsResponse;
3463 type ResponseStream = BoxStream<super::ListTransactionsResponse>;
3464 type Future = BoxFuture<
3465 tonic::Response<Self::ResponseStream>,
3466 tonic::Status,
3467 >;
3468 fn call(
3469 &mut self,
3470 request: tonic::Request<super::ListTransactionsRequest>,
3471 ) -> Self::Future {
3472 let inner = Arc::clone(&self.0);
3473 let fut = async move {
3474 <T as LedgerService>::list_transactions(&inner, request)
3475 .await
3476 };
3477 Box::pin(fut)
3478 }
3479 }
3480 let accept_compression_encodings = self.accept_compression_encodings;
3481 let send_compression_encodings = self.send_compression_encodings;
3482 let max_decoding_message_size = self.max_decoding_message_size;
3483 let max_encoding_message_size = self.max_encoding_message_size;
3484 let inner = self.inner.clone();
3485 let fut = async move {
3486 let method = ListTransactionsSvc(inner);
3487 let codec = tonic_prost::ProstCodec::default();
3488 let mut grpc = tonic::server::Grpc::new(codec)
3489 .apply_compression_config(
3490 accept_compression_encodings,
3491 send_compression_encodings,
3492 )
3493 .apply_max_message_size_config(
3494 max_decoding_message_size,
3495 max_encoding_message_size,
3496 );
3497 let res = grpc.server_streaming(method, req).await;
3498 Ok(res)
3499 };
3500 Box::pin(fut)
3501 }
3502 "/sui.rpc.v2.LedgerService/ListEvents" => {
3503 #[allow(non_camel_case_types)]
3504 struct ListEventsSvc<T: LedgerService>(pub Arc<T>);
3505 impl<
3506 T: LedgerService,
3507 > tonic::server::ServerStreamingService<super::ListEventsRequest>
3508 for ListEventsSvc<T> {
3509 type Response = super::ListEventsResponse;
3510 type ResponseStream = BoxStream<super::ListEventsResponse>;
3511 type Future = BoxFuture<
3512 tonic::Response<Self::ResponseStream>,
3513 tonic::Status,
3514 >;
3515 fn call(
3516 &mut self,
3517 request: tonic::Request<super::ListEventsRequest>,
3518 ) -> Self::Future {
3519 let inner = Arc::clone(&self.0);
3520 let fut = async move {
3521 <T as LedgerService>::list_events(&inner, request).await
3522 };
3523 Box::pin(fut)
3524 }
3525 }
3526 let accept_compression_encodings = self.accept_compression_encodings;
3527 let send_compression_encodings = self.send_compression_encodings;
3528 let max_decoding_message_size = self.max_decoding_message_size;
3529 let max_encoding_message_size = self.max_encoding_message_size;
3530 let inner = self.inner.clone();
3531 let fut = async move {
3532 let method = ListEventsSvc(inner);
3533 let codec = tonic_prost::ProstCodec::default();
3534 let mut grpc = tonic::server::Grpc::new(codec)
3535 .apply_compression_config(
3536 accept_compression_encodings,
3537 send_compression_encodings,
3538 )
3539 .apply_max_message_size_config(
3540 max_decoding_message_size,
3541 max_encoding_message_size,
3542 );
3543 let res = grpc.server_streaming(method, req).await;
3544 Ok(res)
3545 };
3546 Box::pin(fut)
3547 }
3548 _ => {
3549 Box::pin(async move {
3550 let mut response = http::Response::new(
3551 tonic::body::Body::default(),
3552 );
3553 let headers = response.headers_mut();
3554 headers
3555 .insert(
3556 tonic::Status::GRPC_STATUS,
3557 (tonic::Code::Unimplemented as i32).into(),
3558 );
3559 headers
3560 .insert(
3561 http::header::CONTENT_TYPE,
3562 tonic::metadata::GRPC_CONTENT_TYPE,
3563 );
3564 Ok(response)
3565 })
3566 }
3567 }
3568 }
3569 }
3570 impl<T> Clone for LedgerServiceServer<T> {
3571 fn clone(&self) -> Self {
3572 let inner = self.inner.clone();
3573 Self {
3574 inner,
3575 accept_compression_encodings: self.accept_compression_encodings,
3576 send_compression_encodings: self.send_compression_encodings,
3577 max_decoding_message_size: self.max_decoding_message_size,
3578 max_encoding_message_size: self.max_encoding_message_size,
3579 }
3580 }
3581 }
3582 pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
3584 impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
3585 const NAME: &'static str = SERVICE_NAME;
3586 }
3587}
3588#[non_exhaustive]
3590#[derive(Clone, PartialEq, ::prost::Message)]
3591pub struct Package {
3592 #[prost(string, optional, tag = "1")]
3598 pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
3599 #[prost(string, optional, tag = "2")]
3606 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3607 #[prost(uint64, optional, tag = "3")]
3609 pub version: ::core::option::Option<u64>,
3610 #[prost(message, repeated, tag = "4")]
3612 pub modules: ::prost::alloc::vec::Vec<Module>,
3613 #[prost(message, repeated, tag = "5")]
3616 pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
3617 #[prost(message, repeated, tag = "6")]
3621 pub linkage: ::prost::alloc::vec::Vec<Linkage>,
3622}
3623#[non_exhaustive]
3625#[derive(Clone, PartialEq, ::prost::Message)]
3626pub struct Module {
3627 #[prost(string, optional, tag = "1")]
3629 pub name: ::core::option::Option<::prost::alloc::string::String>,
3630 #[prost(bytes = "bytes", optional, tag = "2")]
3632 pub contents: ::core::option::Option<::prost::bytes::Bytes>,
3633 #[prost(message, repeated, tag = "3")]
3635 pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
3636 #[prost(message, repeated, tag = "4")]
3638 pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
3639}
3640#[non_exhaustive]
3642#[derive(Clone, PartialEq, ::prost::Message)]
3643pub struct DatatypeDescriptor {
3644 #[prost(string, optional, tag = "1")]
3648 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3649 #[prost(string, optional, tag = "2")]
3653 pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
3654 #[prost(string, optional, tag = "3")]
3656 pub module: ::core::option::Option<::prost::alloc::string::String>,
3657 #[prost(string, optional, tag = "4")]
3659 pub name: ::core::option::Option<::prost::alloc::string::String>,
3660 #[prost(enumeration = "Ability", repeated, tag = "5")]
3662 pub abilities: ::prost::alloc::vec::Vec<i32>,
3663 #[prost(message, repeated, tag = "6")]
3665 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3666 #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
3668 pub kind: ::core::option::Option<i32>,
3669 #[prost(message, repeated, tag = "8")]
3673 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3674 #[prost(message, repeated, tag = "9")]
3678 pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
3679}
3680pub mod datatype_descriptor {
3682 #[non_exhaustive]
3683 #[derive(
3684 Clone,
3685 Copy,
3686 Debug,
3687 PartialEq,
3688 Eq,
3689 Hash,
3690 PartialOrd,
3691 Ord,
3692 ::prost::Enumeration
3693 )]
3694 #[repr(i32)]
3695 pub enum DatatypeKind {
3696 Unknown = 0,
3697 Struct = 1,
3698 Enum = 2,
3699 }
3700 impl DatatypeKind {
3701 pub fn as_str_name(&self) -> &'static str {
3706 match self {
3707 Self::Unknown => "DATATYPE_KIND_UNKNOWN",
3708 Self::Struct => "STRUCT",
3709 Self::Enum => "ENUM",
3710 }
3711 }
3712 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3714 match value {
3715 "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
3716 "STRUCT" => Some(Self::Struct),
3717 "ENUM" => Some(Self::Enum),
3718 _ => None,
3719 }
3720 }
3721 }
3722}
3723#[non_exhaustive]
3725#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3726pub struct TypeParameter {
3727 #[prost(enumeration = "Ability", repeated, tag = "1")]
3729 pub constraints: ::prost::alloc::vec::Vec<i32>,
3730 #[prost(bool, optional, tag = "2")]
3732 pub is_phantom: ::core::option::Option<bool>,
3733}
3734#[non_exhaustive]
3736#[derive(Clone, PartialEq, ::prost::Message)]
3737pub struct FieldDescriptor {
3738 #[prost(string, optional, tag = "1")]
3740 pub name: ::core::option::Option<::prost::alloc::string::String>,
3741 #[prost(uint32, optional, tag = "2")]
3743 pub position: ::core::option::Option<u32>,
3744 #[prost(message, optional, tag = "3")]
3746 pub r#type: ::core::option::Option<OpenSignatureBody>,
3747}
3748#[non_exhaustive]
3750#[derive(Clone, PartialEq, ::prost::Message)]
3751pub struct VariantDescriptor {
3752 #[prost(string, optional, tag = "1")]
3754 pub name: ::core::option::Option<::prost::alloc::string::String>,
3755 #[prost(uint32, optional, tag = "2")]
3757 pub position: ::core::option::Option<u32>,
3758 #[prost(message, repeated, tag = "3")]
3760 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3761}
3762#[non_exhaustive]
3764#[derive(Clone, PartialEq, ::prost::Message)]
3765pub struct OpenSignatureBody {
3766 #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
3768 pub r#type: ::core::option::Option<i32>,
3769 #[prost(string, optional, tag = "2")]
3771 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3772 #[prost(message, repeated, tag = "3")]
3774 pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
3775 #[prost(uint32, optional, tag = "4")]
3777 pub type_parameter: ::core::option::Option<u32>,
3778}
3779pub mod open_signature_body {
3781 #[non_exhaustive]
3782 #[derive(
3783 Clone,
3784 Copy,
3785 Debug,
3786 PartialEq,
3787 Eq,
3788 Hash,
3789 PartialOrd,
3790 Ord,
3791 ::prost::Enumeration
3792 )]
3793 #[repr(i32)]
3794 pub enum Type {
3795 Unknown = 0,
3796 Address = 1,
3797 Bool = 2,
3798 U8 = 3,
3799 U16 = 4,
3800 U32 = 5,
3801 U64 = 6,
3802 U128 = 7,
3803 U256 = 8,
3804 Vector = 9,
3805 Datatype = 10,
3806 Parameter = 11,
3807 }
3808 impl Type {
3809 pub fn as_str_name(&self) -> &'static str {
3814 match self {
3815 Self::Unknown => "TYPE_UNKNOWN",
3816 Self::Address => "ADDRESS",
3817 Self::Bool => "BOOL",
3818 Self::U8 => "U8",
3819 Self::U16 => "U16",
3820 Self::U32 => "U32",
3821 Self::U64 => "U64",
3822 Self::U128 => "U128",
3823 Self::U256 => "U256",
3824 Self::Vector => "VECTOR",
3825 Self::Datatype => "DATATYPE",
3826 Self::Parameter => "TYPE_PARAMETER",
3827 }
3828 }
3829 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3831 match value {
3832 "TYPE_UNKNOWN" => Some(Self::Unknown),
3833 "ADDRESS" => Some(Self::Address),
3834 "BOOL" => Some(Self::Bool),
3835 "U8" => Some(Self::U8),
3836 "U16" => Some(Self::U16),
3837 "U32" => Some(Self::U32),
3838 "U64" => Some(Self::U64),
3839 "U128" => Some(Self::U128),
3840 "U256" => Some(Self::U256),
3841 "VECTOR" => Some(Self::Vector),
3842 "DATATYPE" => Some(Self::Datatype),
3843 "TYPE_PARAMETER" => Some(Self::Parameter),
3844 _ => None,
3845 }
3846 }
3847 }
3848}
3849#[non_exhaustive]
3851#[derive(Clone, PartialEq, ::prost::Message)]
3852pub struct FunctionDescriptor {
3853 #[prost(string, optional, tag = "1")]
3855 pub name: ::core::option::Option<::prost::alloc::string::String>,
3856 #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
3858 pub visibility: ::core::option::Option<i32>,
3859 #[prost(bool, optional, tag = "6")]
3861 pub is_entry: ::core::option::Option<bool>,
3862 #[prost(message, repeated, tag = "7")]
3864 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3865 #[prost(message, repeated, tag = "8")]
3867 pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
3868 #[prost(message, repeated, tag = "9")]
3870 pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
3871}
3872pub mod function_descriptor {
3874 #[non_exhaustive]
3875 #[derive(
3876 Clone,
3877 Copy,
3878 Debug,
3879 PartialEq,
3880 Eq,
3881 Hash,
3882 PartialOrd,
3883 Ord,
3884 ::prost::Enumeration
3885 )]
3886 #[repr(i32)]
3887 pub enum Visibility {
3888 Unknown = 0,
3889 Private = 1,
3890 Public = 2,
3891 Friend = 3,
3892 }
3893 impl Visibility {
3894 pub fn as_str_name(&self) -> &'static str {
3899 match self {
3900 Self::Unknown => "VISIBILITY_UNKNOWN",
3901 Self::Private => "PRIVATE",
3902 Self::Public => "PUBLIC",
3903 Self::Friend => "FRIEND",
3904 }
3905 }
3906 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3908 match value {
3909 "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
3910 "PRIVATE" => Some(Self::Private),
3911 "PUBLIC" => Some(Self::Public),
3912 "FRIEND" => Some(Self::Friend),
3913 _ => None,
3914 }
3915 }
3916 }
3917}
3918#[non_exhaustive]
3920#[derive(Clone, PartialEq, ::prost::Message)]
3921pub struct OpenSignature {
3922 #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
3923 pub reference: ::core::option::Option<i32>,
3924 #[prost(message, optional, tag = "2")]
3925 pub body: ::core::option::Option<OpenSignatureBody>,
3926}
3927pub mod open_signature {
3929 #[non_exhaustive]
3930 #[derive(
3931 Clone,
3932 Copy,
3933 Debug,
3934 PartialEq,
3935 Eq,
3936 Hash,
3937 PartialOrd,
3938 Ord,
3939 ::prost::Enumeration
3940 )]
3941 #[repr(i32)]
3942 pub enum Reference {
3943 Unknown = 0,
3944 Immutable = 1,
3945 Mutable = 2,
3946 }
3947 impl Reference {
3948 pub fn as_str_name(&self) -> &'static str {
3953 match self {
3954 Self::Unknown => "REFERENCE_UNKNOWN",
3955 Self::Immutable => "IMMUTABLE",
3956 Self::Mutable => "MUTABLE",
3957 }
3958 }
3959 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3961 match value {
3962 "REFERENCE_UNKNOWN" => Some(Self::Unknown),
3963 "IMMUTABLE" => Some(Self::Immutable),
3964 "MUTABLE" => Some(Self::Mutable),
3965 _ => None,
3966 }
3967 }
3968 }
3969}
3970#[non_exhaustive]
3972#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3973pub struct TypeOrigin {
3974 #[prost(string, optional, tag = "1")]
3975 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3976 #[prost(string, optional, tag = "2")]
3977 pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
3978 #[prost(string, optional, tag = "3")]
3979 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3980}
3981#[non_exhaustive]
3983#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3984pub struct Linkage {
3985 #[prost(string, optional, tag = "1")]
3987 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3988 #[prost(string, optional, tag = "2")]
3990 pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
3991 #[prost(uint64, optional, tag = "3")]
3993 pub upgraded_version: ::core::option::Option<u64>,
3994}
3995#[non_exhaustive]
3997#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3998#[repr(i32)]
3999pub enum Ability {
4000 Unknown = 0,
4001 Copy = 1,
4003 Drop = 2,
4005 Store = 3,
4007 Key = 4,
4009}
4010impl Ability {
4011 pub fn as_str_name(&self) -> &'static str {
4016 match self {
4017 Self::Unknown => "ABILITY_UNKNOWN",
4018 Self::Copy => "COPY",
4019 Self::Drop => "DROP",
4020 Self::Store => "STORE",
4021 Self::Key => "KEY",
4022 }
4023 }
4024 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4026 match value {
4027 "ABILITY_UNKNOWN" => Some(Self::Unknown),
4028 "COPY" => Some(Self::Copy),
4029 "DROP" => Some(Self::Drop),
4030 "STORE" => Some(Self::Store),
4031 "KEY" => Some(Self::Key),
4032 _ => None,
4033 }
4034 }
4035}
4036#[non_exhaustive]
4037#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4038pub struct GetPackageRequest {
4039 #[prost(string, optional, tag = "1")]
4046 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4047 #[prost(oneof = "get_package_request::Selector", tags = "2, 3")]
4060 pub selector: ::core::option::Option<get_package_request::Selector>,
4061}
4062pub mod get_package_request {
4064 #[non_exhaustive]
4077 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
4078 pub enum Selector {
4079 #[prost(uint64, tag = "2")]
4080 Version(u64),
4081 #[prost(uint64, tag = "3")]
4082 AtCheckpoint(u64),
4083 }
4084}
4085#[non_exhaustive]
4086#[derive(Clone, PartialEq, ::prost::Message)]
4087pub struct GetPackageResponse {
4088 #[prost(message, optional, tag = "1")]
4090 pub package: ::core::option::Option<Package>,
4091}
4092#[non_exhaustive]
4093#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4094pub struct GetDatatypeRequest {
4095 #[prost(string, optional, tag = "1")]
4097 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4098 #[prost(string, optional, tag = "2")]
4100 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4101 #[prost(string, optional, tag = "3")]
4103 pub name: ::core::option::Option<::prost::alloc::string::String>,
4104}
4105#[non_exhaustive]
4106#[derive(Clone, PartialEq, ::prost::Message)]
4107pub struct GetDatatypeResponse {
4108 #[prost(message, optional, tag = "1")]
4110 pub datatype: ::core::option::Option<DatatypeDescriptor>,
4111}
4112#[non_exhaustive]
4113#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4114pub struct GetFunctionRequest {
4115 #[prost(string, optional, tag = "1")]
4117 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4118 #[prost(string, optional, tag = "2")]
4120 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4121 #[prost(string, optional, tag = "3")]
4123 pub name: ::core::option::Option<::prost::alloc::string::String>,
4124}
4125#[non_exhaustive]
4126#[derive(Clone, PartialEq, ::prost::Message)]
4127pub struct GetFunctionResponse {
4128 #[prost(message, optional, tag = "1")]
4130 pub function: ::core::option::Option<FunctionDescriptor>,
4131}
4132#[non_exhaustive]
4133#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4134pub struct ListPackageVersionsRequest {
4135 #[prost(string, optional, tag = "1")]
4137 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4138 #[prost(uint32, optional, tag = "2")]
4142 pub page_size: ::core::option::Option<u32>,
4143 #[prost(bytes = "bytes", optional, tag = "3")]
4149 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
4150}
4151#[non_exhaustive]
4152#[derive(Clone, PartialEq, ::prost::Message)]
4153pub struct ListPackageVersionsResponse {
4154 #[prost(message, repeated, tag = "1")]
4156 pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
4157 #[prost(bytes = "bytes", optional, tag = "2")]
4160 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
4161}
4162#[non_exhaustive]
4164#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4165pub struct PackageVersion {
4166 #[prost(string, optional, tag = "1")]
4168 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4169 #[prost(uint64, optional, tag = "2")]
4171 pub version: ::core::option::Option<u64>,
4172}
4173pub mod move_package_service_client {
4175 #![allow(
4176 unused_variables,
4177 dead_code,
4178 missing_docs,
4179 clippy::wildcard_imports,
4180 clippy::let_unit_value,
4181 )]
4182 use tonic::codegen::*;
4183 use tonic::codegen::http::Uri;
4184 #[derive(Debug, Clone)]
4185 pub struct MovePackageServiceClient<T> {
4186 inner: tonic::client::Grpc<T>,
4187 }
4188 impl MovePackageServiceClient<tonic::transport::Channel> {
4189 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4191 where
4192 D: TryInto<tonic::transport::Endpoint>,
4193 D::Error: Into<StdError>,
4194 {
4195 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4196 Ok(Self::new(conn))
4197 }
4198 }
4199 impl<T> MovePackageServiceClient<T>
4200 where
4201 T: tonic::client::GrpcService<tonic::body::Body>,
4202 T::Error: Into<StdError>,
4203 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4204 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4205 {
4206 pub fn new(inner: T) -> Self {
4207 let inner = tonic::client::Grpc::new(inner);
4208 Self { inner }
4209 }
4210 pub fn with_origin(inner: T, origin: Uri) -> Self {
4211 let inner = tonic::client::Grpc::with_origin(inner, origin);
4212 Self { inner }
4213 }
4214 pub fn with_interceptor<F>(
4215 inner: T,
4216 interceptor: F,
4217 ) -> MovePackageServiceClient<InterceptedService<T, F>>
4218 where
4219 F: tonic::service::Interceptor,
4220 T::ResponseBody: Default,
4221 T: tonic::codegen::Service<
4222 http::Request<tonic::body::Body>,
4223 Response = http::Response<
4224 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4225 >,
4226 >,
4227 <T as tonic::codegen::Service<
4228 http::Request<tonic::body::Body>,
4229 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4230 {
4231 MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
4232 }
4233 #[must_use]
4238 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4239 self.inner = self.inner.send_compressed(encoding);
4240 self
4241 }
4242 #[must_use]
4244 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4245 self.inner = self.inner.accept_compressed(encoding);
4246 self
4247 }
4248 #[must_use]
4252 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4253 self.inner = self.inner.max_decoding_message_size(limit);
4254 self
4255 }
4256 #[must_use]
4260 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4261 self.inner = self.inner.max_encoding_message_size(limit);
4262 self
4263 }
4264 pub async fn get_package(
4265 &mut self,
4266 request: impl tonic::IntoRequest<super::GetPackageRequest>,
4267 ) -> std::result::Result<
4268 tonic::Response<super::GetPackageResponse>,
4269 tonic::Status,
4270 > {
4271 self.inner
4272 .ready()
4273 .await
4274 .map_err(|e| {
4275 tonic::Status::unknown(
4276 format!("Service was not ready: {}", e.into()),
4277 )
4278 })?;
4279 let codec = tonic_prost::ProstCodec::default();
4280 let path = http::uri::PathAndQuery::from_static(
4281 "/sui.rpc.v2.MovePackageService/GetPackage",
4282 );
4283 let mut req = request.into_request();
4284 req.extensions_mut()
4285 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
4286 self.inner.unary(req, path, codec).await
4287 }
4288 pub async fn get_datatype(
4289 &mut self,
4290 request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
4291 ) -> std::result::Result<
4292 tonic::Response<super::GetDatatypeResponse>,
4293 tonic::Status,
4294 > {
4295 self.inner
4296 .ready()
4297 .await
4298 .map_err(|e| {
4299 tonic::Status::unknown(
4300 format!("Service was not ready: {}", e.into()),
4301 )
4302 })?;
4303 let codec = tonic_prost::ProstCodec::default();
4304 let path = http::uri::PathAndQuery::from_static(
4305 "/sui.rpc.v2.MovePackageService/GetDatatype",
4306 );
4307 let mut req = request.into_request();
4308 req.extensions_mut()
4309 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
4310 self.inner.unary(req, path, codec).await
4311 }
4312 pub async fn get_function(
4313 &mut self,
4314 request: impl tonic::IntoRequest<super::GetFunctionRequest>,
4315 ) -> std::result::Result<
4316 tonic::Response<super::GetFunctionResponse>,
4317 tonic::Status,
4318 > {
4319 self.inner
4320 .ready()
4321 .await
4322 .map_err(|e| {
4323 tonic::Status::unknown(
4324 format!("Service was not ready: {}", e.into()),
4325 )
4326 })?;
4327 let codec = tonic_prost::ProstCodec::default();
4328 let path = http::uri::PathAndQuery::from_static(
4329 "/sui.rpc.v2.MovePackageService/GetFunction",
4330 );
4331 let mut req = request.into_request();
4332 req.extensions_mut()
4333 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
4334 self.inner.unary(req, path, codec).await
4335 }
4336 pub async fn list_package_versions(
4337 &mut self,
4338 request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
4339 ) -> std::result::Result<
4340 tonic::Response<super::ListPackageVersionsResponse>,
4341 tonic::Status,
4342 > {
4343 self.inner
4344 .ready()
4345 .await
4346 .map_err(|e| {
4347 tonic::Status::unknown(
4348 format!("Service was not ready: {}", e.into()),
4349 )
4350 })?;
4351 let codec = tonic_prost::ProstCodec::default();
4352 let path = http::uri::PathAndQuery::from_static(
4353 "/sui.rpc.v2.MovePackageService/ListPackageVersions",
4354 );
4355 let mut req = request.into_request();
4356 req.extensions_mut()
4357 .insert(
4358 GrpcMethod::new(
4359 "sui.rpc.v2.MovePackageService",
4360 "ListPackageVersions",
4361 ),
4362 );
4363 self.inner.unary(req, path, codec).await
4364 }
4365 }
4366}
4367pub mod move_package_service_server {
4369 #![allow(
4370 unused_variables,
4371 dead_code,
4372 missing_docs,
4373 clippy::wildcard_imports,
4374 clippy::let_unit_value,
4375 )]
4376 use tonic::codegen::*;
4377 #[async_trait]
4379 pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
4380 async fn get_package(
4381 &self,
4382 request: tonic::Request<super::GetPackageRequest>,
4383 ) -> std::result::Result<
4384 tonic::Response<super::GetPackageResponse>,
4385 tonic::Status,
4386 > {
4387 Err(tonic::Status::unimplemented("Not yet implemented"))
4388 }
4389 async fn get_datatype(
4390 &self,
4391 request: tonic::Request<super::GetDatatypeRequest>,
4392 ) -> std::result::Result<
4393 tonic::Response<super::GetDatatypeResponse>,
4394 tonic::Status,
4395 > {
4396 Err(tonic::Status::unimplemented("Not yet implemented"))
4397 }
4398 async fn get_function(
4399 &self,
4400 request: tonic::Request<super::GetFunctionRequest>,
4401 ) -> std::result::Result<
4402 tonic::Response<super::GetFunctionResponse>,
4403 tonic::Status,
4404 > {
4405 Err(tonic::Status::unimplemented("Not yet implemented"))
4406 }
4407 async fn list_package_versions(
4408 &self,
4409 request: tonic::Request<super::ListPackageVersionsRequest>,
4410 ) -> std::result::Result<
4411 tonic::Response<super::ListPackageVersionsResponse>,
4412 tonic::Status,
4413 > {
4414 Err(tonic::Status::unimplemented("Not yet implemented"))
4415 }
4416 }
4417 #[derive(Debug)]
4418 pub struct MovePackageServiceServer<T> {
4419 inner: Arc<T>,
4420 accept_compression_encodings: EnabledCompressionEncodings,
4421 send_compression_encodings: EnabledCompressionEncodings,
4422 max_decoding_message_size: Option<usize>,
4423 max_encoding_message_size: Option<usize>,
4424 }
4425 impl<T> MovePackageServiceServer<T> {
4426 pub fn new(inner: T) -> Self {
4427 Self::from_arc(Arc::new(inner))
4428 }
4429 pub fn from_arc(inner: Arc<T>) -> Self {
4430 Self {
4431 inner,
4432 accept_compression_encodings: Default::default(),
4433 send_compression_encodings: Default::default(),
4434 max_decoding_message_size: None,
4435 max_encoding_message_size: None,
4436 }
4437 }
4438 pub fn with_interceptor<F>(
4439 inner: T,
4440 interceptor: F,
4441 ) -> InterceptedService<Self, F>
4442 where
4443 F: tonic::service::Interceptor,
4444 {
4445 InterceptedService::new(Self::new(inner), interceptor)
4446 }
4447 #[must_use]
4449 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4450 self.accept_compression_encodings.enable(encoding);
4451 self
4452 }
4453 #[must_use]
4455 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4456 self.send_compression_encodings.enable(encoding);
4457 self
4458 }
4459 #[must_use]
4463 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4464 self.max_decoding_message_size = Some(limit);
4465 self
4466 }
4467 #[must_use]
4471 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4472 self.max_encoding_message_size = Some(limit);
4473 self
4474 }
4475 }
4476 impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
4477 where
4478 T: MovePackageService,
4479 B: Body + std::marker::Send + 'static,
4480 B::Error: Into<StdError> + std::marker::Send + 'static,
4481 {
4482 type Response = http::Response<tonic::body::Body>;
4483 type Error = std::convert::Infallible;
4484 type Future = BoxFuture<Self::Response, Self::Error>;
4485 fn poll_ready(
4486 &mut self,
4487 _cx: &mut Context<'_>,
4488 ) -> Poll<std::result::Result<(), Self::Error>> {
4489 Poll::Ready(Ok(()))
4490 }
4491 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4492 match req.uri().path() {
4493 "/sui.rpc.v2.MovePackageService/GetPackage" => {
4494 #[allow(non_camel_case_types)]
4495 struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
4496 impl<
4497 T: MovePackageService,
4498 > tonic::server::UnaryService<super::GetPackageRequest>
4499 for GetPackageSvc<T> {
4500 type Response = super::GetPackageResponse;
4501 type Future = BoxFuture<
4502 tonic::Response<Self::Response>,
4503 tonic::Status,
4504 >;
4505 fn call(
4506 &mut self,
4507 request: tonic::Request<super::GetPackageRequest>,
4508 ) -> Self::Future {
4509 let inner = Arc::clone(&self.0);
4510 let fut = async move {
4511 <T as MovePackageService>::get_package(&inner, request)
4512 .await
4513 };
4514 Box::pin(fut)
4515 }
4516 }
4517 let accept_compression_encodings = self.accept_compression_encodings;
4518 let send_compression_encodings = self.send_compression_encodings;
4519 let max_decoding_message_size = self.max_decoding_message_size;
4520 let max_encoding_message_size = self.max_encoding_message_size;
4521 let inner = self.inner.clone();
4522 let fut = async move {
4523 let method = GetPackageSvc(inner);
4524 let codec = tonic_prost::ProstCodec::default();
4525 let mut grpc = tonic::server::Grpc::new(codec)
4526 .apply_compression_config(
4527 accept_compression_encodings,
4528 send_compression_encodings,
4529 )
4530 .apply_max_message_size_config(
4531 max_decoding_message_size,
4532 max_encoding_message_size,
4533 );
4534 let res = grpc.unary(method, req).await;
4535 Ok(res)
4536 };
4537 Box::pin(fut)
4538 }
4539 "/sui.rpc.v2.MovePackageService/GetDatatype" => {
4540 #[allow(non_camel_case_types)]
4541 struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
4542 impl<
4543 T: MovePackageService,
4544 > tonic::server::UnaryService<super::GetDatatypeRequest>
4545 for GetDatatypeSvc<T> {
4546 type Response = super::GetDatatypeResponse;
4547 type Future = BoxFuture<
4548 tonic::Response<Self::Response>,
4549 tonic::Status,
4550 >;
4551 fn call(
4552 &mut self,
4553 request: tonic::Request<super::GetDatatypeRequest>,
4554 ) -> Self::Future {
4555 let inner = Arc::clone(&self.0);
4556 let fut = async move {
4557 <T as MovePackageService>::get_datatype(&inner, request)
4558 .await
4559 };
4560 Box::pin(fut)
4561 }
4562 }
4563 let accept_compression_encodings = self.accept_compression_encodings;
4564 let send_compression_encodings = self.send_compression_encodings;
4565 let max_decoding_message_size = self.max_decoding_message_size;
4566 let max_encoding_message_size = self.max_encoding_message_size;
4567 let inner = self.inner.clone();
4568 let fut = async move {
4569 let method = GetDatatypeSvc(inner);
4570 let codec = tonic_prost::ProstCodec::default();
4571 let mut grpc = tonic::server::Grpc::new(codec)
4572 .apply_compression_config(
4573 accept_compression_encodings,
4574 send_compression_encodings,
4575 )
4576 .apply_max_message_size_config(
4577 max_decoding_message_size,
4578 max_encoding_message_size,
4579 );
4580 let res = grpc.unary(method, req).await;
4581 Ok(res)
4582 };
4583 Box::pin(fut)
4584 }
4585 "/sui.rpc.v2.MovePackageService/GetFunction" => {
4586 #[allow(non_camel_case_types)]
4587 struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
4588 impl<
4589 T: MovePackageService,
4590 > tonic::server::UnaryService<super::GetFunctionRequest>
4591 for GetFunctionSvc<T> {
4592 type Response = super::GetFunctionResponse;
4593 type Future = BoxFuture<
4594 tonic::Response<Self::Response>,
4595 tonic::Status,
4596 >;
4597 fn call(
4598 &mut self,
4599 request: tonic::Request<super::GetFunctionRequest>,
4600 ) -> Self::Future {
4601 let inner = Arc::clone(&self.0);
4602 let fut = async move {
4603 <T as MovePackageService>::get_function(&inner, request)
4604 .await
4605 };
4606 Box::pin(fut)
4607 }
4608 }
4609 let accept_compression_encodings = self.accept_compression_encodings;
4610 let send_compression_encodings = self.send_compression_encodings;
4611 let max_decoding_message_size = self.max_decoding_message_size;
4612 let max_encoding_message_size = self.max_encoding_message_size;
4613 let inner = self.inner.clone();
4614 let fut = async move {
4615 let method = GetFunctionSvc(inner);
4616 let codec = tonic_prost::ProstCodec::default();
4617 let mut grpc = tonic::server::Grpc::new(codec)
4618 .apply_compression_config(
4619 accept_compression_encodings,
4620 send_compression_encodings,
4621 )
4622 .apply_max_message_size_config(
4623 max_decoding_message_size,
4624 max_encoding_message_size,
4625 );
4626 let res = grpc.unary(method, req).await;
4627 Ok(res)
4628 };
4629 Box::pin(fut)
4630 }
4631 "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
4632 #[allow(non_camel_case_types)]
4633 struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
4634 impl<
4635 T: MovePackageService,
4636 > tonic::server::UnaryService<super::ListPackageVersionsRequest>
4637 for ListPackageVersionsSvc<T> {
4638 type Response = super::ListPackageVersionsResponse;
4639 type Future = BoxFuture<
4640 tonic::Response<Self::Response>,
4641 tonic::Status,
4642 >;
4643 fn call(
4644 &mut self,
4645 request: tonic::Request<super::ListPackageVersionsRequest>,
4646 ) -> Self::Future {
4647 let inner = Arc::clone(&self.0);
4648 let fut = async move {
4649 <T as MovePackageService>::list_package_versions(
4650 &inner,
4651 request,
4652 )
4653 .await
4654 };
4655 Box::pin(fut)
4656 }
4657 }
4658 let accept_compression_encodings = self.accept_compression_encodings;
4659 let send_compression_encodings = self.send_compression_encodings;
4660 let max_decoding_message_size = self.max_decoding_message_size;
4661 let max_encoding_message_size = self.max_encoding_message_size;
4662 let inner = self.inner.clone();
4663 let fut = async move {
4664 let method = ListPackageVersionsSvc(inner);
4665 let codec = tonic_prost::ProstCodec::default();
4666 let mut grpc = tonic::server::Grpc::new(codec)
4667 .apply_compression_config(
4668 accept_compression_encodings,
4669 send_compression_encodings,
4670 )
4671 .apply_max_message_size_config(
4672 max_decoding_message_size,
4673 max_encoding_message_size,
4674 );
4675 let res = grpc.unary(method, req).await;
4676 Ok(res)
4677 };
4678 Box::pin(fut)
4679 }
4680 _ => {
4681 Box::pin(async move {
4682 let mut response = http::Response::new(
4683 tonic::body::Body::default(),
4684 );
4685 let headers = response.headers_mut();
4686 headers
4687 .insert(
4688 tonic::Status::GRPC_STATUS,
4689 (tonic::Code::Unimplemented as i32).into(),
4690 );
4691 headers
4692 .insert(
4693 http::header::CONTENT_TYPE,
4694 tonic::metadata::GRPC_CONTENT_TYPE,
4695 );
4696 Ok(response)
4697 })
4698 }
4699 }
4700 }
4701 }
4702 impl<T> Clone for MovePackageServiceServer<T> {
4703 fn clone(&self) -> Self {
4704 let inner = self.inner.clone();
4705 Self {
4706 inner,
4707 accept_compression_encodings: self.accept_compression_encodings,
4708 send_compression_encodings: self.send_compression_encodings,
4709 max_decoding_message_size: self.max_decoding_message_size,
4710 max_encoding_message_size: self.max_encoding_message_size,
4711 }
4712 }
4713 }
4714 pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
4716 impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
4717 const NAME: &'static str = SERVICE_NAME;
4718 }
4719}
4720#[non_exhaustive]
4721#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4722pub struct LookupNameRequest {
4723 #[prost(string, optional, tag = "1")]
4727 pub name: ::core::option::Option<::prost::alloc::string::String>,
4728}
4729#[non_exhaustive]
4730#[derive(Clone, PartialEq, ::prost::Message)]
4731pub struct LookupNameResponse {
4732 #[prost(message, optional, tag = "1")]
4734 pub record: ::core::option::Option<NameRecord>,
4735}
4736#[non_exhaustive]
4737#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4738pub struct ReverseLookupNameRequest {
4739 #[prost(string, optional, tag = "1")]
4741 pub address: ::core::option::Option<::prost::alloc::string::String>,
4742}
4743#[non_exhaustive]
4744#[derive(Clone, PartialEq, ::prost::Message)]
4745pub struct ReverseLookupNameResponse {
4746 #[prost(message, optional, tag = "1")]
4748 pub record: ::core::option::Option<NameRecord>,
4749}
4750#[non_exhaustive]
4751#[derive(Clone, PartialEq, ::prost::Message)]
4752pub struct NameRecord {
4753 #[prost(string, optional, tag = "1")]
4758 pub id: ::core::option::Option<::prost::alloc::string::String>,
4759 #[prost(string, optional, tag = "2")]
4761 pub name: ::core::option::Option<::prost::alloc::string::String>,
4762 #[prost(string, optional, tag = "3")]
4770 pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
4771 #[prost(message, optional, tag = "4")]
4776 pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
4777 #[prost(string, optional, tag = "5")]
4779 pub target_address: ::core::option::Option<::prost::alloc::string::String>,
4780 #[prost(btree_map = "string, string", tag = "6")]
4782 pub data: ::prost::alloc::collections::BTreeMap<
4783 ::prost::alloc::string::String,
4784 ::prost::alloc::string::String,
4785 >,
4786}
4787pub mod name_service_client {
4789 #![allow(
4790 unused_variables,
4791 dead_code,
4792 missing_docs,
4793 clippy::wildcard_imports,
4794 clippy::let_unit_value,
4795 )]
4796 use tonic::codegen::*;
4797 use tonic::codegen::http::Uri;
4798 #[derive(Debug, Clone)]
4799 pub struct NameServiceClient<T> {
4800 inner: tonic::client::Grpc<T>,
4801 }
4802 impl NameServiceClient<tonic::transport::Channel> {
4803 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4805 where
4806 D: TryInto<tonic::transport::Endpoint>,
4807 D::Error: Into<StdError>,
4808 {
4809 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4810 Ok(Self::new(conn))
4811 }
4812 }
4813 impl<T> NameServiceClient<T>
4814 where
4815 T: tonic::client::GrpcService<tonic::body::Body>,
4816 T::Error: Into<StdError>,
4817 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4818 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4819 {
4820 pub fn new(inner: T) -> Self {
4821 let inner = tonic::client::Grpc::new(inner);
4822 Self { inner }
4823 }
4824 pub fn with_origin(inner: T, origin: Uri) -> Self {
4825 let inner = tonic::client::Grpc::with_origin(inner, origin);
4826 Self { inner }
4827 }
4828 pub fn with_interceptor<F>(
4829 inner: T,
4830 interceptor: F,
4831 ) -> NameServiceClient<InterceptedService<T, F>>
4832 where
4833 F: tonic::service::Interceptor,
4834 T::ResponseBody: Default,
4835 T: tonic::codegen::Service<
4836 http::Request<tonic::body::Body>,
4837 Response = http::Response<
4838 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4839 >,
4840 >,
4841 <T as tonic::codegen::Service<
4842 http::Request<tonic::body::Body>,
4843 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4844 {
4845 NameServiceClient::new(InterceptedService::new(inner, interceptor))
4846 }
4847 #[must_use]
4852 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4853 self.inner = self.inner.send_compressed(encoding);
4854 self
4855 }
4856 #[must_use]
4858 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4859 self.inner = self.inner.accept_compressed(encoding);
4860 self
4861 }
4862 #[must_use]
4866 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4867 self.inner = self.inner.max_decoding_message_size(limit);
4868 self
4869 }
4870 #[must_use]
4874 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4875 self.inner = self.inner.max_encoding_message_size(limit);
4876 self
4877 }
4878 pub async fn lookup_name(
4879 &mut self,
4880 request: impl tonic::IntoRequest<super::LookupNameRequest>,
4881 ) -> std::result::Result<
4882 tonic::Response<super::LookupNameResponse>,
4883 tonic::Status,
4884 > {
4885 self.inner
4886 .ready()
4887 .await
4888 .map_err(|e| {
4889 tonic::Status::unknown(
4890 format!("Service was not ready: {}", e.into()),
4891 )
4892 })?;
4893 let codec = tonic_prost::ProstCodec::default();
4894 let path = http::uri::PathAndQuery::from_static(
4895 "/sui.rpc.v2.NameService/LookupName",
4896 );
4897 let mut req = request.into_request();
4898 req.extensions_mut()
4899 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
4900 self.inner.unary(req, path, codec).await
4901 }
4902 pub async fn reverse_lookup_name(
4903 &mut self,
4904 request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
4905 ) -> std::result::Result<
4906 tonic::Response<super::ReverseLookupNameResponse>,
4907 tonic::Status,
4908 > {
4909 self.inner
4910 .ready()
4911 .await
4912 .map_err(|e| {
4913 tonic::Status::unknown(
4914 format!("Service was not ready: {}", e.into()),
4915 )
4916 })?;
4917 let codec = tonic_prost::ProstCodec::default();
4918 let path = http::uri::PathAndQuery::from_static(
4919 "/sui.rpc.v2.NameService/ReverseLookupName",
4920 );
4921 let mut req = request.into_request();
4922 req.extensions_mut()
4923 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
4924 self.inner.unary(req, path, codec).await
4925 }
4926 }
4927}
4928pub mod name_service_server {
4930 #![allow(
4931 unused_variables,
4932 dead_code,
4933 missing_docs,
4934 clippy::wildcard_imports,
4935 clippy::let_unit_value,
4936 )]
4937 use tonic::codegen::*;
4938 #[async_trait]
4940 pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
4941 async fn lookup_name(
4942 &self,
4943 request: tonic::Request<super::LookupNameRequest>,
4944 ) -> std::result::Result<
4945 tonic::Response<super::LookupNameResponse>,
4946 tonic::Status,
4947 > {
4948 Err(tonic::Status::unimplemented("Not yet implemented"))
4949 }
4950 async fn reverse_lookup_name(
4951 &self,
4952 request: tonic::Request<super::ReverseLookupNameRequest>,
4953 ) -> std::result::Result<
4954 tonic::Response<super::ReverseLookupNameResponse>,
4955 tonic::Status,
4956 > {
4957 Err(tonic::Status::unimplemented("Not yet implemented"))
4958 }
4959 }
4960 #[derive(Debug)]
4961 pub struct NameServiceServer<T> {
4962 inner: Arc<T>,
4963 accept_compression_encodings: EnabledCompressionEncodings,
4964 send_compression_encodings: EnabledCompressionEncodings,
4965 max_decoding_message_size: Option<usize>,
4966 max_encoding_message_size: Option<usize>,
4967 }
4968 impl<T> NameServiceServer<T> {
4969 pub fn new(inner: T) -> Self {
4970 Self::from_arc(Arc::new(inner))
4971 }
4972 pub fn from_arc(inner: Arc<T>) -> Self {
4973 Self {
4974 inner,
4975 accept_compression_encodings: Default::default(),
4976 send_compression_encodings: Default::default(),
4977 max_decoding_message_size: None,
4978 max_encoding_message_size: None,
4979 }
4980 }
4981 pub fn with_interceptor<F>(
4982 inner: T,
4983 interceptor: F,
4984 ) -> InterceptedService<Self, F>
4985 where
4986 F: tonic::service::Interceptor,
4987 {
4988 InterceptedService::new(Self::new(inner), interceptor)
4989 }
4990 #[must_use]
4992 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4993 self.accept_compression_encodings.enable(encoding);
4994 self
4995 }
4996 #[must_use]
4998 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4999 self.send_compression_encodings.enable(encoding);
5000 self
5001 }
5002 #[must_use]
5006 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5007 self.max_decoding_message_size = Some(limit);
5008 self
5009 }
5010 #[must_use]
5014 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5015 self.max_encoding_message_size = Some(limit);
5016 self
5017 }
5018 }
5019 impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
5020 where
5021 T: NameService,
5022 B: Body + std::marker::Send + 'static,
5023 B::Error: Into<StdError> + std::marker::Send + 'static,
5024 {
5025 type Response = http::Response<tonic::body::Body>;
5026 type Error = std::convert::Infallible;
5027 type Future = BoxFuture<Self::Response, Self::Error>;
5028 fn poll_ready(
5029 &mut self,
5030 _cx: &mut Context<'_>,
5031 ) -> Poll<std::result::Result<(), Self::Error>> {
5032 Poll::Ready(Ok(()))
5033 }
5034 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5035 match req.uri().path() {
5036 "/sui.rpc.v2.NameService/LookupName" => {
5037 #[allow(non_camel_case_types)]
5038 struct LookupNameSvc<T: NameService>(pub Arc<T>);
5039 impl<
5040 T: NameService,
5041 > tonic::server::UnaryService<super::LookupNameRequest>
5042 for LookupNameSvc<T> {
5043 type Response = super::LookupNameResponse;
5044 type Future = BoxFuture<
5045 tonic::Response<Self::Response>,
5046 tonic::Status,
5047 >;
5048 fn call(
5049 &mut self,
5050 request: tonic::Request<super::LookupNameRequest>,
5051 ) -> Self::Future {
5052 let inner = Arc::clone(&self.0);
5053 let fut = async move {
5054 <T as NameService>::lookup_name(&inner, request).await
5055 };
5056 Box::pin(fut)
5057 }
5058 }
5059 let accept_compression_encodings = self.accept_compression_encodings;
5060 let send_compression_encodings = self.send_compression_encodings;
5061 let max_decoding_message_size = self.max_decoding_message_size;
5062 let max_encoding_message_size = self.max_encoding_message_size;
5063 let inner = self.inner.clone();
5064 let fut = async move {
5065 let method = LookupNameSvc(inner);
5066 let codec = tonic_prost::ProstCodec::default();
5067 let mut grpc = tonic::server::Grpc::new(codec)
5068 .apply_compression_config(
5069 accept_compression_encodings,
5070 send_compression_encodings,
5071 )
5072 .apply_max_message_size_config(
5073 max_decoding_message_size,
5074 max_encoding_message_size,
5075 );
5076 let res = grpc.unary(method, req).await;
5077 Ok(res)
5078 };
5079 Box::pin(fut)
5080 }
5081 "/sui.rpc.v2.NameService/ReverseLookupName" => {
5082 #[allow(non_camel_case_types)]
5083 struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
5084 impl<
5085 T: NameService,
5086 > tonic::server::UnaryService<super::ReverseLookupNameRequest>
5087 for ReverseLookupNameSvc<T> {
5088 type Response = super::ReverseLookupNameResponse;
5089 type Future = BoxFuture<
5090 tonic::Response<Self::Response>,
5091 tonic::Status,
5092 >;
5093 fn call(
5094 &mut self,
5095 request: tonic::Request<super::ReverseLookupNameRequest>,
5096 ) -> Self::Future {
5097 let inner = Arc::clone(&self.0);
5098 let fut = async move {
5099 <T as NameService>::reverse_lookup_name(&inner, request)
5100 .await
5101 };
5102 Box::pin(fut)
5103 }
5104 }
5105 let accept_compression_encodings = self.accept_compression_encodings;
5106 let send_compression_encodings = self.send_compression_encodings;
5107 let max_decoding_message_size = self.max_decoding_message_size;
5108 let max_encoding_message_size = self.max_encoding_message_size;
5109 let inner = self.inner.clone();
5110 let fut = async move {
5111 let method = ReverseLookupNameSvc(inner);
5112 let codec = tonic_prost::ProstCodec::default();
5113 let mut grpc = tonic::server::Grpc::new(codec)
5114 .apply_compression_config(
5115 accept_compression_encodings,
5116 send_compression_encodings,
5117 )
5118 .apply_max_message_size_config(
5119 max_decoding_message_size,
5120 max_encoding_message_size,
5121 );
5122 let res = grpc.unary(method, req).await;
5123 Ok(res)
5124 };
5125 Box::pin(fut)
5126 }
5127 _ => {
5128 Box::pin(async move {
5129 let mut response = http::Response::new(
5130 tonic::body::Body::default(),
5131 );
5132 let headers = response.headers_mut();
5133 headers
5134 .insert(
5135 tonic::Status::GRPC_STATUS,
5136 (tonic::Code::Unimplemented as i32).into(),
5137 );
5138 headers
5139 .insert(
5140 http::header::CONTENT_TYPE,
5141 tonic::metadata::GRPC_CONTENT_TYPE,
5142 );
5143 Ok(response)
5144 })
5145 }
5146 }
5147 }
5148 }
5149 impl<T> Clone for NameServiceServer<T> {
5150 fn clone(&self) -> Self {
5151 let inner = self.inner.clone();
5152 Self {
5153 inner,
5154 accept_compression_encodings: self.accept_compression_encodings,
5155 send_compression_encodings: self.send_compression_encodings,
5156 max_decoding_message_size: self.max_decoding_message_size,
5157 max_encoding_message_size: self.max_encoding_message_size,
5158 }
5159 }
5160 }
5161 pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
5163 impl<T> tonic::server::NamedService for NameServiceServer<T> {
5164 const NAME: &'static str = SERVICE_NAME;
5165 }
5166}
5167#[non_exhaustive]
5169#[derive(Clone, PartialEq, ::prost::Message)]
5170pub struct Object {
5171 #[prost(message, optional, tag = "1")]
5173 pub bcs: ::core::option::Option<Bcs>,
5174 #[prost(string, optional, tag = "2")]
5176 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5177 #[prost(uint64, optional, tag = "3")]
5179 pub version: ::core::option::Option<u64>,
5180 #[prost(string, optional, tag = "4")]
5182 pub digest: ::core::option::Option<::prost::alloc::string::String>,
5183 #[prost(message, optional, tag = "5")]
5185 pub owner: ::core::option::Option<Owner>,
5186 #[prost(string, optional, tag = "6")]
5190 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5191 #[prost(bool, optional, tag = "7")]
5196 pub has_public_transfer: ::core::option::Option<bool>,
5197 #[prost(message, optional, tag = "8")]
5201 pub contents: ::core::option::Option<Bcs>,
5202 #[prost(message, optional, tag = "9")]
5204 pub package: ::core::option::Option<Package>,
5205 #[prost(string, optional, tag = "10")]
5207 pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
5208 #[prost(uint64, optional, tag = "11")]
5212 pub storage_rebate: ::core::option::Option<u64>,
5213 #[prost(message, optional, boxed, tag = "100")]
5215 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
5216 #[prost(uint64, optional, tag = "101")]
5218 pub balance: ::core::option::Option<u64>,
5219 #[prost(message, optional, boxed, tag = "102")]
5222 pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
5223}
5224#[non_exhaustive]
5226#[derive(Clone, PartialEq, ::prost::Message)]
5227pub struct ObjectSet {
5228 #[prost(message, repeated, tag = "1")]
5230 pub objects: ::prost::alloc::vec::Vec<Object>,
5231}
5232#[non_exhaustive]
5234#[derive(Clone, PartialEq, ::prost::Message)]
5235pub struct Display {
5236 #[prost(message, optional, tag = "1")]
5240 pub output: ::core::option::Option<::prost_types::Value>,
5241 #[prost(message, optional, tag = "2")]
5245 pub errors: ::core::option::Option<::prost_types::Value>,
5246}
5247#[non_exhaustive]
5249#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5250pub struct ObjectReference {
5251 #[prost(string, optional, tag = "1")]
5253 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5254 #[prost(uint64, optional, tag = "2")]
5256 pub version: ::core::option::Option<u64>,
5257 #[prost(string, optional, tag = "3")]
5259 pub digest: ::core::option::Option<::prost::alloc::string::String>,
5260}
5261#[non_exhaustive]
5263#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5264pub struct Owner {
5265 #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
5266 pub kind: ::core::option::Option<i32>,
5267 #[prost(string, optional, tag = "2")]
5269 pub address: ::core::option::Option<::prost::alloc::string::String>,
5270 #[prost(uint64, optional, tag = "3")]
5272 pub version: ::core::option::Option<u64>,
5273}
5274pub mod owner {
5276 #[non_exhaustive]
5277 #[derive(
5278 Clone,
5279 Copy,
5280 Debug,
5281 PartialEq,
5282 Eq,
5283 Hash,
5284 PartialOrd,
5285 Ord,
5286 ::prost::Enumeration
5287 )]
5288 #[repr(i32)]
5289 pub enum OwnerKind {
5290 Unknown = 0,
5291 Address = 1,
5292 Object = 2,
5293 Shared = 3,
5294 Immutable = 4,
5295 ConsensusAddress = 5,
5296 }
5297 impl OwnerKind {
5298 pub fn as_str_name(&self) -> &'static str {
5303 match self {
5304 Self::Unknown => "OWNER_KIND_UNKNOWN",
5305 Self::Address => "ADDRESS",
5306 Self::Object => "OBJECT",
5307 Self::Shared => "SHARED",
5308 Self::Immutable => "IMMUTABLE",
5309 Self::ConsensusAddress => "CONSENSUS_ADDRESS",
5310 }
5311 }
5312 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5314 match value {
5315 "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
5316 "ADDRESS" => Some(Self::Address),
5317 "OBJECT" => Some(Self::Object),
5318 "SHARED" => Some(Self::Shared),
5319 "IMMUTABLE" => Some(Self::Immutable),
5320 "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
5321 _ => None,
5322 }
5323 }
5324 }
5325}
5326#[non_exhaustive]
5327#[derive(Clone, PartialEq, ::prost::Message)]
5328pub struct ProtocolConfig {
5329 #[prost(uint64, optional, tag = "1")]
5330 pub protocol_version: ::core::option::Option<u64>,
5331 #[prost(btree_map = "string, bool", tag = "2")]
5333 pub feature_flags: ::prost::alloc::collections::BTreeMap<
5334 ::prost::alloc::string::String,
5335 bool,
5336 >,
5337 #[prost(btree_map = "string, string", tag = "3")]
5339 pub attributes: ::prost::alloc::collections::BTreeMap<
5340 ::prost::alloc::string::String,
5341 ::prost::alloc::string::String,
5342 >,
5343 #[prost(btree_map = "string, message", tag = "4")]
5344 pub configs: ::prost::alloc::collections::BTreeMap<
5345 ::prost::alloc::string::String,
5346 ::prost_types::Value,
5347 >,
5348}
5349#[non_exhaustive]
5369#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5370pub struct QueryOptions {
5371 #[prost(uint32, optional, tag = "1")]
5374 pub limit: ::core::option::Option<u32>,
5375 #[prost(bytes = "bytes", optional, tag = "2")]
5378 pub after: ::core::option::Option<::prost::bytes::Bytes>,
5379 #[prost(bytes = "bytes", optional, tag = "3")]
5382 pub before: ::core::option::Option<::prost::bytes::Bytes>,
5383 #[prost(enumeration = "Ordering", optional, tag = "4")]
5388 pub ordering: ::core::option::Option<i32>,
5389}
5390#[non_exhaustive]
5395#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5396pub struct Watermark {
5397 #[prost(bytes = "bytes", optional, tag = "1")]
5402 pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
5403 #[prost(uint64, optional, tag = "2")]
5416 pub checkpoint: ::core::option::Option<u64>,
5417}
5418#[non_exhaustive]
5429#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5430pub struct QueryEnd {
5431 #[prost(enumeration = "QueryEndReason", optional, tag = "1")]
5433 pub reason: ::core::option::Option<i32>,
5434}
5435#[non_exhaustive]
5437#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5438#[repr(i32)]
5439pub enum Ordering {
5440 Ascending = 0,
5442 Descending = 1,
5444}
5445impl Ordering {
5446 pub fn as_str_name(&self) -> &'static str {
5451 match self {
5452 Self::Ascending => "ORDERING_ASCENDING",
5453 Self::Descending => "ORDERING_DESCENDING",
5454 }
5455 }
5456 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5458 match value {
5459 "ORDERING_ASCENDING" => Some(Self::Ascending),
5460 "ORDERING_DESCENDING" => Some(Self::Descending),
5461 _ => None,
5462 }
5463 }
5464}
5465#[non_exhaustive]
5467#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5468#[repr(i32)]
5469pub enum QueryEndReason {
5470 Unknown = 0,
5472 ItemLimit = 1,
5476 ScanLimit = 2,
5481 CheckpointBound = 3,
5484 CursorBound = 4,
5488 LedgerTip = 5,
5491}
5492impl QueryEndReason {
5493 pub fn as_str_name(&self) -> &'static str {
5498 match self {
5499 Self::Unknown => "QUERY_END_REASON_UNKNOWN",
5500 Self::ItemLimit => "QUERY_END_REASON_ITEM_LIMIT",
5501 Self::ScanLimit => "QUERY_END_REASON_SCAN_LIMIT",
5502 Self::CheckpointBound => "QUERY_END_REASON_CHECKPOINT_BOUND",
5503 Self::CursorBound => "QUERY_END_REASON_CURSOR_BOUND",
5504 Self::LedgerTip => "QUERY_END_REASON_LEDGER_TIP",
5505 }
5506 }
5507 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5509 match value {
5510 "QUERY_END_REASON_UNKNOWN" => Some(Self::Unknown),
5511 "QUERY_END_REASON_ITEM_LIMIT" => Some(Self::ItemLimit),
5512 "QUERY_END_REASON_SCAN_LIMIT" => Some(Self::ScanLimit),
5513 "QUERY_END_REASON_CHECKPOINT_BOUND" => Some(Self::CheckpointBound),
5514 "QUERY_END_REASON_CURSOR_BOUND" => Some(Self::CursorBound),
5515 "QUERY_END_REASON_LEDGER_TIP" => Some(Self::LedgerTip),
5516 _ => None,
5517 }
5518 }
5519}
5520#[non_exhaustive]
5522#[derive(Clone, PartialEq, ::prost::Message)]
5523pub struct UserSignature {
5524 #[prost(message, optional, tag = "1")]
5529 pub bcs: ::core::option::Option<Bcs>,
5530 #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
5532 pub scheme: ::core::option::Option<i32>,
5533 #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
5534 pub signature: ::core::option::Option<user_signature::Signature>,
5535}
5536pub mod user_signature {
5538 #[non_exhaustive]
5539 #[derive(Clone, PartialEq, ::prost::Oneof)]
5540 pub enum Signature {
5541 #[prost(message, tag = "3")]
5543 Simple(super::SimpleSignature),
5544 #[prost(message, tag = "4")]
5546 Multisig(super::MultisigAggregatedSignature),
5547 #[prost(message, tag = "5")]
5549 Zklogin(super::ZkLoginAuthenticator),
5550 #[prost(message, tag = "6")]
5552 Passkey(super::PasskeyAuthenticator),
5553 }
5554}
5555#[non_exhaustive]
5557#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5558pub struct SimpleSignature {
5559 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5561 pub scheme: ::core::option::Option<i32>,
5562 #[prost(bytes = "bytes", optional, tag = "2")]
5564 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5565 #[prost(bytes = "bytes", optional, tag = "3")]
5567 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5568}
5569#[non_exhaustive]
5571#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5572pub struct ZkLoginPublicIdentifier {
5573 #[prost(string, optional, tag = "1")]
5574 pub iss: ::core::option::Option<::prost::alloc::string::String>,
5575 #[prost(string, optional, tag = "2")]
5577 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5578}
5579#[non_exhaustive]
5581#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5582pub struct MultisigMemberPublicKey {
5583 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5585 pub scheme: ::core::option::Option<i32>,
5586 #[prost(bytes = "bytes", optional, tag = "2")]
5588 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5589 #[prost(message, optional, tag = "3")]
5591 pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
5592}
5593#[non_exhaustive]
5595#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5596pub struct MultisigMember {
5597 #[prost(message, optional, tag = "1")]
5599 pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
5600 #[prost(uint32, optional, tag = "2")]
5602 pub weight: ::core::option::Option<u32>,
5603}
5604#[non_exhaustive]
5606#[derive(Clone, PartialEq, ::prost::Message)]
5607pub struct MultisigCommittee {
5608 #[prost(message, repeated, tag = "1")]
5610 pub members: ::prost::alloc::vec::Vec<MultisigMember>,
5611 #[prost(uint32, optional, tag = "2")]
5614 pub threshold: ::core::option::Option<u32>,
5615}
5616#[non_exhaustive]
5618#[derive(Clone, PartialEq, ::prost::Message)]
5619pub struct MultisigAggregatedSignature {
5620 #[prost(message, repeated, tag = "1")]
5624 pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
5625 #[prost(uint32, optional, tag = "2")]
5628 pub bitmap: ::core::option::Option<u32>,
5629 #[prost(bytes = "bytes", optional, tag = "3")]
5632 pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5633 #[prost(message, optional, tag = "4")]
5635 pub committee: ::core::option::Option<MultisigCommittee>,
5636}
5637#[non_exhaustive]
5639#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5640pub struct MultisigMemberSignature {
5641 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5643 pub scheme: ::core::option::Option<i32>,
5644 #[prost(bytes = "bytes", optional, tag = "2")]
5646 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5647 #[prost(message, optional, tag = "3")]
5649 pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
5650 #[prost(message, optional, tag = "4")]
5652 pub passkey: ::core::option::Option<PasskeyAuthenticator>,
5653}
5654#[non_exhaustive]
5656#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5657pub struct ZkLoginAuthenticator {
5658 #[prost(message, optional, tag = "1")]
5660 pub inputs: ::core::option::Option<ZkLoginInputs>,
5661 #[prost(uint64, optional, tag = "2")]
5663 pub max_epoch: ::core::option::Option<u64>,
5664 #[prost(message, optional, tag = "3")]
5666 pub signature: ::core::option::Option<SimpleSignature>,
5667 #[prost(message, optional, tag = "4")]
5669 pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
5670 #[prost(message, optional, tag = "5")]
5672 pub jwk_id: ::core::option::Option<JwkId>,
5673}
5674#[non_exhaustive]
5676#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5677pub struct ZkLoginInputs {
5678 #[prost(message, optional, tag = "1")]
5679 pub proof_points: ::core::option::Option<ZkLoginProof>,
5680 #[prost(message, optional, tag = "2")]
5681 pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
5682 #[prost(string, optional, tag = "3")]
5683 pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
5684 #[prost(string, optional, tag = "4")]
5686 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5687}
5688#[non_exhaustive]
5690#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5691pub struct ZkLoginProof {
5692 #[prost(message, optional, tag = "1")]
5693 pub a: ::core::option::Option<CircomG1>,
5694 #[prost(message, optional, tag = "2")]
5695 pub b: ::core::option::Option<CircomG2>,
5696 #[prost(message, optional, tag = "3")]
5697 pub c: ::core::option::Option<CircomG1>,
5698}
5699#[non_exhaustive]
5701#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5702pub struct ZkLoginClaim {
5703 #[prost(string, optional, tag = "1")]
5704 pub value: ::core::option::Option<::prost::alloc::string::String>,
5705 #[prost(uint32, optional, tag = "2")]
5706 pub index_mod_4: ::core::option::Option<u32>,
5707}
5708#[non_exhaustive]
5710#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5711pub struct CircomG1 {
5712 #[prost(string, optional, tag = "1")]
5714 pub e0: ::core::option::Option<::prost::alloc::string::String>,
5715 #[prost(string, optional, tag = "2")]
5717 pub e1: ::core::option::Option<::prost::alloc::string::String>,
5718 #[prost(string, optional, tag = "3")]
5720 pub e2: ::core::option::Option<::prost::alloc::string::String>,
5721}
5722#[non_exhaustive]
5724#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5725pub struct CircomG2 {
5726 #[prost(string, optional, tag = "1")]
5728 pub e00: ::core::option::Option<::prost::alloc::string::String>,
5729 #[prost(string, optional, tag = "2")]
5731 pub e01: ::core::option::Option<::prost::alloc::string::String>,
5732 #[prost(string, optional, tag = "3")]
5734 pub e10: ::core::option::Option<::prost::alloc::string::String>,
5735 #[prost(string, optional, tag = "4")]
5737 pub e11: ::core::option::Option<::prost::alloc::string::String>,
5738 #[prost(string, optional, tag = "5")]
5740 pub e20: ::core::option::Option<::prost::alloc::string::String>,
5741 #[prost(string, optional, tag = "6")]
5743 pub e21: ::core::option::Option<::prost::alloc::string::String>,
5744}
5745#[non_exhaustive]
5752#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5753pub struct PasskeyAuthenticator {
5754 #[prost(bytes = "bytes", optional, tag = "1")]
5759 pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
5760 #[prost(string, optional, tag = "2")]
5765 pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
5766 #[prost(message, optional, tag = "3")]
5768 pub signature: ::core::option::Option<SimpleSignature>,
5769}
5770#[non_exhaustive]
5772#[derive(Clone, PartialEq, ::prost::Message)]
5773pub struct ValidatorCommittee {
5774 #[prost(uint64, optional, tag = "1")]
5776 pub epoch: ::core::option::Option<u64>,
5777 #[prost(message, repeated, tag = "2")]
5779 pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
5780}
5781#[non_exhaustive]
5783#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5784pub struct ValidatorCommitteeMember {
5785 #[prost(bytes = "bytes", optional, tag = "1")]
5787 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5788 #[prost(uint64, optional, tag = "2")]
5790 pub weight: ::core::option::Option<u64>,
5791}
5792#[non_exhaustive]
5794#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5795pub struct ValidatorAggregatedSignature {
5796 #[prost(uint64, optional, tag = "1")]
5801 pub epoch: ::core::option::Option<u64>,
5802 #[prost(bytes = "bytes", optional, tag = "2")]
5804 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5805 #[prost(bytes = "bytes", optional, tag = "3")]
5808 pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5809}
5810#[non_exhaustive]
5817#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5818#[repr(i32)]
5819pub enum SignatureScheme {
5820 Ed25519 = 0,
5821 Secp256k1 = 1,
5822 Secp256r1 = 2,
5823 Multisig = 3,
5824 Bls12381 = 4,
5825 Zklogin = 5,
5826 Passkey = 6,
5827 Mldsa65 = 7,
5828}
5829impl SignatureScheme {
5830 pub fn as_str_name(&self) -> &'static str {
5835 match self {
5836 Self::Ed25519 => "ED25519",
5837 Self::Secp256k1 => "SECP256K1",
5838 Self::Secp256r1 => "SECP256R1",
5839 Self::Multisig => "MULTISIG",
5840 Self::Bls12381 => "BLS12381",
5841 Self::Zklogin => "ZKLOGIN",
5842 Self::Passkey => "PASSKEY",
5843 Self::Mldsa65 => "MLDSA65",
5844 }
5845 }
5846 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5848 match value {
5849 "ED25519" => Some(Self::Ed25519),
5850 "SECP256K1" => Some(Self::Secp256k1),
5851 "SECP256R1" => Some(Self::Secp256r1),
5852 "MULTISIG" => Some(Self::Multisig),
5853 "BLS12381" => Some(Self::Bls12381),
5854 "ZKLOGIN" => Some(Self::Zklogin),
5855 "PASSKEY" => Some(Self::Passkey),
5856 "MLDSA65" => Some(Self::Mldsa65),
5857 _ => None,
5858 }
5859 }
5860}
5861#[non_exhaustive]
5862#[derive(Clone, PartialEq, ::prost::Message)]
5863pub struct VerifySignatureRequest {
5864 #[prost(message, optional, tag = "1")]
5870 pub message: ::core::option::Option<Bcs>,
5871 #[prost(message, optional, tag = "2")]
5873 pub signature: ::core::option::Option<UserSignature>,
5874 #[prost(string, optional, tag = "3")]
5880 pub address: ::core::option::Option<::prost::alloc::string::String>,
5881 #[prost(message, repeated, tag = "4")]
5884 pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
5885}
5886#[non_exhaustive]
5887#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5888pub struct VerifySignatureResponse {
5889 #[prost(bool, optional, tag = "1")]
5891 pub is_valid: ::core::option::Option<bool>,
5892 #[prost(string, optional, tag = "2")]
5894 pub reason: ::core::option::Option<::prost::alloc::string::String>,
5895}
5896pub mod signature_verification_service_client {
5898 #![allow(
5899 unused_variables,
5900 dead_code,
5901 missing_docs,
5902 clippy::wildcard_imports,
5903 clippy::let_unit_value,
5904 )]
5905 use tonic::codegen::*;
5906 use tonic::codegen::http::Uri;
5907 #[derive(Debug, Clone)]
5908 pub struct SignatureVerificationServiceClient<T> {
5909 inner: tonic::client::Grpc<T>,
5910 }
5911 impl SignatureVerificationServiceClient<tonic::transport::Channel> {
5912 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5914 where
5915 D: TryInto<tonic::transport::Endpoint>,
5916 D::Error: Into<StdError>,
5917 {
5918 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5919 Ok(Self::new(conn))
5920 }
5921 }
5922 impl<T> SignatureVerificationServiceClient<T>
5923 where
5924 T: tonic::client::GrpcService<tonic::body::Body>,
5925 T::Error: Into<StdError>,
5926 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5927 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5928 {
5929 pub fn new(inner: T) -> Self {
5930 let inner = tonic::client::Grpc::new(inner);
5931 Self { inner }
5932 }
5933 pub fn with_origin(inner: T, origin: Uri) -> Self {
5934 let inner = tonic::client::Grpc::with_origin(inner, origin);
5935 Self { inner }
5936 }
5937 pub fn with_interceptor<F>(
5938 inner: T,
5939 interceptor: F,
5940 ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
5941 where
5942 F: tonic::service::Interceptor,
5943 T::ResponseBody: Default,
5944 T: tonic::codegen::Service<
5945 http::Request<tonic::body::Body>,
5946 Response = http::Response<
5947 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5948 >,
5949 >,
5950 <T as tonic::codegen::Service<
5951 http::Request<tonic::body::Body>,
5952 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5953 {
5954 SignatureVerificationServiceClient::new(
5955 InterceptedService::new(inner, interceptor),
5956 )
5957 }
5958 #[must_use]
5963 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5964 self.inner = self.inner.send_compressed(encoding);
5965 self
5966 }
5967 #[must_use]
5969 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5970 self.inner = self.inner.accept_compressed(encoding);
5971 self
5972 }
5973 #[must_use]
5977 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5978 self.inner = self.inner.max_decoding_message_size(limit);
5979 self
5980 }
5981 #[must_use]
5985 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5986 self.inner = self.inner.max_encoding_message_size(limit);
5987 self
5988 }
5989 pub async fn verify_signature(
5991 &mut self,
5992 request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
5993 ) -> std::result::Result<
5994 tonic::Response<super::VerifySignatureResponse>,
5995 tonic::Status,
5996 > {
5997 self.inner
5998 .ready()
5999 .await
6000 .map_err(|e| {
6001 tonic::Status::unknown(
6002 format!("Service was not ready: {}", e.into()),
6003 )
6004 })?;
6005 let codec = tonic_prost::ProstCodec::default();
6006 let path = http::uri::PathAndQuery::from_static(
6007 "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
6008 );
6009 let mut req = request.into_request();
6010 req.extensions_mut()
6011 .insert(
6012 GrpcMethod::new(
6013 "sui.rpc.v2.SignatureVerificationService",
6014 "VerifySignature",
6015 ),
6016 );
6017 self.inner.unary(req, path, codec).await
6018 }
6019 }
6020}
6021pub mod signature_verification_service_server {
6023 #![allow(
6024 unused_variables,
6025 dead_code,
6026 missing_docs,
6027 clippy::wildcard_imports,
6028 clippy::let_unit_value,
6029 )]
6030 use tonic::codegen::*;
6031 #[async_trait]
6033 pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
6034 async fn verify_signature(
6036 &self,
6037 request: tonic::Request<super::VerifySignatureRequest>,
6038 ) -> std::result::Result<
6039 tonic::Response<super::VerifySignatureResponse>,
6040 tonic::Status,
6041 > {
6042 Err(tonic::Status::unimplemented("Not yet implemented"))
6043 }
6044 }
6045 #[derive(Debug)]
6046 pub struct SignatureVerificationServiceServer<T> {
6047 inner: Arc<T>,
6048 accept_compression_encodings: EnabledCompressionEncodings,
6049 send_compression_encodings: EnabledCompressionEncodings,
6050 max_decoding_message_size: Option<usize>,
6051 max_encoding_message_size: Option<usize>,
6052 }
6053 impl<T> SignatureVerificationServiceServer<T> {
6054 pub fn new(inner: T) -> Self {
6055 Self::from_arc(Arc::new(inner))
6056 }
6057 pub fn from_arc(inner: Arc<T>) -> Self {
6058 Self {
6059 inner,
6060 accept_compression_encodings: Default::default(),
6061 send_compression_encodings: Default::default(),
6062 max_decoding_message_size: None,
6063 max_encoding_message_size: None,
6064 }
6065 }
6066 pub fn with_interceptor<F>(
6067 inner: T,
6068 interceptor: F,
6069 ) -> InterceptedService<Self, F>
6070 where
6071 F: tonic::service::Interceptor,
6072 {
6073 InterceptedService::new(Self::new(inner), interceptor)
6074 }
6075 #[must_use]
6077 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6078 self.accept_compression_encodings.enable(encoding);
6079 self
6080 }
6081 #[must_use]
6083 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6084 self.send_compression_encodings.enable(encoding);
6085 self
6086 }
6087 #[must_use]
6091 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6092 self.max_decoding_message_size = Some(limit);
6093 self
6094 }
6095 #[must_use]
6099 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6100 self.max_encoding_message_size = Some(limit);
6101 self
6102 }
6103 }
6104 impl<T, B> tonic::codegen::Service<http::Request<B>>
6105 for SignatureVerificationServiceServer<T>
6106 where
6107 T: SignatureVerificationService,
6108 B: Body + std::marker::Send + 'static,
6109 B::Error: Into<StdError> + std::marker::Send + 'static,
6110 {
6111 type Response = http::Response<tonic::body::Body>;
6112 type Error = std::convert::Infallible;
6113 type Future = BoxFuture<Self::Response, Self::Error>;
6114 fn poll_ready(
6115 &mut self,
6116 _cx: &mut Context<'_>,
6117 ) -> Poll<std::result::Result<(), Self::Error>> {
6118 Poll::Ready(Ok(()))
6119 }
6120 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6121 match req.uri().path() {
6122 "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
6123 #[allow(non_camel_case_types)]
6124 struct VerifySignatureSvc<T: SignatureVerificationService>(
6125 pub Arc<T>,
6126 );
6127 impl<
6128 T: SignatureVerificationService,
6129 > tonic::server::UnaryService<super::VerifySignatureRequest>
6130 for VerifySignatureSvc<T> {
6131 type Response = super::VerifySignatureResponse;
6132 type Future = BoxFuture<
6133 tonic::Response<Self::Response>,
6134 tonic::Status,
6135 >;
6136 fn call(
6137 &mut self,
6138 request: tonic::Request<super::VerifySignatureRequest>,
6139 ) -> Self::Future {
6140 let inner = Arc::clone(&self.0);
6141 let fut = async move {
6142 <T as SignatureVerificationService>::verify_signature(
6143 &inner,
6144 request,
6145 )
6146 .await
6147 };
6148 Box::pin(fut)
6149 }
6150 }
6151 let accept_compression_encodings = self.accept_compression_encodings;
6152 let send_compression_encodings = self.send_compression_encodings;
6153 let max_decoding_message_size = self.max_decoding_message_size;
6154 let max_encoding_message_size = self.max_encoding_message_size;
6155 let inner = self.inner.clone();
6156 let fut = async move {
6157 let method = VerifySignatureSvc(inner);
6158 let codec = tonic_prost::ProstCodec::default();
6159 let mut grpc = tonic::server::Grpc::new(codec)
6160 .apply_compression_config(
6161 accept_compression_encodings,
6162 send_compression_encodings,
6163 )
6164 .apply_max_message_size_config(
6165 max_decoding_message_size,
6166 max_encoding_message_size,
6167 );
6168 let res = grpc.unary(method, req).await;
6169 Ok(res)
6170 };
6171 Box::pin(fut)
6172 }
6173 _ => {
6174 Box::pin(async move {
6175 let mut response = http::Response::new(
6176 tonic::body::Body::default(),
6177 );
6178 let headers = response.headers_mut();
6179 headers
6180 .insert(
6181 tonic::Status::GRPC_STATUS,
6182 (tonic::Code::Unimplemented as i32).into(),
6183 );
6184 headers
6185 .insert(
6186 http::header::CONTENT_TYPE,
6187 tonic::metadata::GRPC_CONTENT_TYPE,
6188 );
6189 Ok(response)
6190 })
6191 }
6192 }
6193 }
6194 }
6195 impl<T> Clone for SignatureVerificationServiceServer<T> {
6196 fn clone(&self) -> Self {
6197 let inner = self.inner.clone();
6198 Self {
6199 inner,
6200 accept_compression_encodings: self.accept_compression_encodings,
6201 send_compression_encodings: self.send_compression_encodings,
6202 max_decoding_message_size: self.max_decoding_message_size,
6203 max_encoding_message_size: self.max_encoding_message_size,
6204 }
6205 }
6206 }
6207 pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
6209 impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
6210 const NAME: &'static str = SERVICE_NAME;
6211 }
6212}
6213#[non_exhaustive]
6215#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6216pub struct GetCoinInfoRequest {
6217 #[prost(string, optional, tag = "1")]
6219 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6220}
6221#[non_exhaustive]
6223#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6224pub struct GetCoinInfoResponse {
6225 #[prost(string, optional, tag = "1")]
6227 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6228 #[prost(message, optional, tag = "2")]
6231 pub metadata: ::core::option::Option<CoinMetadata>,
6232 #[prost(message, optional, tag = "3")]
6235 pub treasury: ::core::option::Option<CoinTreasury>,
6236 #[prost(message, optional, tag = "4")]
6244 pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
6245}
6246#[non_exhaustive]
6248#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6249pub struct CoinMetadata {
6250 #[prost(string, optional, tag = "1")]
6253 pub id: ::core::option::Option<::prost::alloc::string::String>,
6254 #[prost(uint32, optional, tag = "2")]
6256 pub decimals: ::core::option::Option<u32>,
6257 #[prost(string, optional, tag = "3")]
6259 pub name: ::core::option::Option<::prost::alloc::string::String>,
6260 #[prost(string, optional, tag = "4")]
6262 pub symbol: ::core::option::Option<::prost::alloc::string::String>,
6263 #[prost(string, optional, tag = "5")]
6265 pub description: ::core::option::Option<::prost::alloc::string::String>,
6266 #[prost(string, optional, tag = "6")]
6268 pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
6269 #[prost(string, optional, tag = "7")]
6273 pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6274 #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
6276 pub metadata_cap_state: ::core::option::Option<i32>,
6277}
6278pub mod coin_metadata {
6280 #[non_exhaustive]
6282 #[derive(
6283 Clone,
6284 Copy,
6285 Debug,
6286 PartialEq,
6287 Eq,
6288 Hash,
6289 PartialOrd,
6290 Ord,
6291 ::prost::Enumeration
6292 )]
6293 #[repr(i32)]
6294 pub enum MetadataCapState {
6295 Unknown = 0,
6298 Claimed = 1,
6300 Unclaimed = 2,
6302 Deleted = 3,
6304 }
6305 impl MetadataCapState {
6306 pub fn as_str_name(&self) -> &'static str {
6311 match self {
6312 Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
6313 Self::Claimed => "CLAIMED",
6314 Self::Unclaimed => "UNCLAIMED",
6315 Self::Deleted => "DELETED",
6316 }
6317 }
6318 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6320 match value {
6321 "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
6322 "CLAIMED" => Some(Self::Claimed),
6323 "UNCLAIMED" => Some(Self::Unclaimed),
6324 "DELETED" => Some(Self::Deleted),
6325 _ => None,
6326 }
6327 }
6328 }
6329}
6330#[non_exhaustive]
6332#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6333pub struct CoinTreasury {
6334 #[prost(string, optional, tag = "1")]
6336 pub id: ::core::option::Option<::prost::alloc::string::String>,
6337 #[prost(uint64, optional, tag = "2")]
6339 pub total_supply: ::core::option::Option<u64>,
6340 #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
6342 pub supply_state: ::core::option::Option<i32>,
6343}
6344pub mod coin_treasury {
6346 #[non_exhaustive]
6348 #[derive(
6349 Clone,
6350 Copy,
6351 Debug,
6352 PartialEq,
6353 Eq,
6354 Hash,
6355 PartialOrd,
6356 Ord,
6357 ::prost::Enumeration
6358 )]
6359 #[repr(i32)]
6360 pub enum SupplyState {
6361 Unknown = 0,
6363 Fixed = 1,
6365 BurnOnly = 2,
6367 }
6368 impl SupplyState {
6369 pub fn as_str_name(&self) -> &'static str {
6374 match self {
6375 Self::Unknown => "SUPPLY_STATE_UNKNOWN",
6376 Self::Fixed => "FIXED",
6377 Self::BurnOnly => "BURN_ONLY",
6378 }
6379 }
6380 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6382 match value {
6383 "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
6384 "FIXED" => Some(Self::Fixed),
6385 "BURN_ONLY" => Some(Self::BurnOnly),
6386 _ => None,
6387 }
6388 }
6389 }
6390}
6391#[non_exhaustive]
6393#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6394pub struct RegulatedCoinMetadata {
6395 #[prost(string, optional, tag = "1")]
6398 pub id: ::core::option::Option<::prost::alloc::string::String>,
6399 #[prost(string, optional, tag = "2")]
6401 pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
6402 #[prost(string, optional, tag = "3")]
6404 pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
6405 #[prost(bool, optional, tag = "4")]
6407 pub allow_global_pause: ::core::option::Option<bool>,
6408 #[prost(uint32, optional, tag = "5")]
6410 pub variant: ::core::option::Option<u32>,
6411 #[prost(
6413 enumeration = "regulated_coin_metadata::CoinRegulatedState",
6414 optional,
6415 tag = "6"
6416 )]
6417 pub coin_regulated_state: ::core::option::Option<i32>,
6418}
6419pub mod regulated_coin_metadata {
6421 #[non_exhaustive]
6423 #[derive(
6424 Clone,
6425 Copy,
6426 Debug,
6427 PartialEq,
6428 Eq,
6429 Hash,
6430 PartialOrd,
6431 Ord,
6432 ::prost::Enumeration
6433 )]
6434 #[repr(i32)]
6435 pub enum CoinRegulatedState {
6436 Unknown = 0,
6441 Regulated = 1,
6443 Unregulated = 2,
6445 }
6446 impl CoinRegulatedState {
6447 pub fn as_str_name(&self) -> &'static str {
6452 match self {
6453 Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
6454 Self::Regulated => "REGULATED",
6455 Self::Unregulated => "UNREGULATED",
6456 }
6457 }
6458 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6460 match value {
6461 "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
6462 "REGULATED" => Some(Self::Regulated),
6463 "UNREGULATED" => Some(Self::Unregulated),
6464 _ => None,
6465 }
6466 }
6467 }
6468}
6469#[non_exhaustive]
6471#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6472pub struct GetBalanceRequest {
6473 #[prost(string, optional, tag = "1")]
6475 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6476 #[prost(string, optional, tag = "2")]
6478 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6479}
6480#[non_exhaustive]
6483#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6484pub struct GetBalanceResponse {
6485 #[prost(message, optional, tag = "1")]
6487 pub balance: ::core::option::Option<Balance>,
6488}
6489#[non_exhaustive]
6491#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6492pub struct ListBalancesRequest {
6493 #[prost(string, optional, tag = "1")]
6495 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6496 #[prost(uint32, optional, tag = "2")]
6500 pub page_size: ::core::option::Option<u32>,
6501 #[prost(bytes = "bytes", optional, tag = "3")]
6507 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6508}
6509#[non_exhaustive]
6512#[derive(Clone, PartialEq, ::prost::Message)]
6513pub struct ListBalancesResponse {
6514 #[prost(message, repeated, tag = "1")]
6516 pub balances: ::prost::alloc::vec::Vec<Balance>,
6517 #[prost(bytes = "bytes", optional, tag = "2")]
6520 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6521}
6522#[non_exhaustive]
6524#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6525pub struct Balance {
6526 #[prost(string, optional, tag = "1")]
6528 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6529 #[prost(uint64, optional, tag = "3")]
6533 pub balance: ::core::option::Option<u64>,
6534 #[prost(uint64, optional, tag = "4")]
6536 pub address_balance: ::core::option::Option<u64>,
6537 #[prost(uint64, optional, tag = "5")]
6539 pub coin_balance: ::core::option::Option<u64>,
6540}
6541#[non_exhaustive]
6543#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6544pub struct ListDynamicFieldsRequest {
6545 #[prost(string, optional, tag = "1")]
6547 pub parent: ::core::option::Option<::prost::alloc::string::String>,
6548 #[prost(uint32, optional, tag = "2")]
6552 pub page_size: ::core::option::Option<u32>,
6553 #[prost(bytes = "bytes", optional, tag = "3")]
6559 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6560 #[prost(message, optional, tag = "4")]
6563 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6564}
6565#[non_exhaustive]
6567#[derive(Clone, PartialEq, ::prost::Message)]
6568pub struct ListDynamicFieldsResponse {
6569 #[prost(message, repeated, tag = "1")]
6571 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
6572 #[prost(bytes = "bytes", optional, tag = "2")]
6575 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6576}
6577#[non_exhaustive]
6578#[derive(Clone, PartialEq, ::prost::Message)]
6579pub struct DynamicField {
6580 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
6581 pub kind: ::core::option::Option<i32>,
6582 #[prost(string, optional, tag = "2")]
6584 pub parent: ::core::option::Option<::prost::alloc::string::String>,
6585 #[prost(string, optional, tag = "3")]
6587 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
6588 #[prost(message, optional, tag = "4")]
6590 pub field_object: ::core::option::Option<Object>,
6591 #[prost(message, optional, tag = "5")]
6593 pub name: ::core::option::Option<Bcs>,
6594 #[prost(message, optional, tag = "6")]
6596 pub value: ::core::option::Option<Bcs>,
6597 #[prost(string, optional, tag = "7")]
6603 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
6604 #[prost(string, optional, tag = "8")]
6610 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
6611 #[prost(message, optional, tag = "9")]
6613 pub child_object: ::core::option::Option<Object>,
6614}
6615pub mod dynamic_field {
6617 #[non_exhaustive]
6618 #[derive(
6619 Clone,
6620 Copy,
6621 Debug,
6622 PartialEq,
6623 Eq,
6624 Hash,
6625 PartialOrd,
6626 Ord,
6627 ::prost::Enumeration
6628 )]
6629 #[repr(i32)]
6630 pub enum DynamicFieldKind {
6631 Unknown = 0,
6632 Field = 1,
6633 Object = 2,
6634 }
6635 impl DynamicFieldKind {
6636 pub fn as_str_name(&self) -> &'static str {
6641 match self {
6642 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
6643 Self::Field => "FIELD",
6644 Self::Object => "OBJECT",
6645 }
6646 }
6647 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6649 match value {
6650 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
6651 "FIELD" => Some(Self::Field),
6652 "OBJECT" => Some(Self::Object),
6653 _ => None,
6654 }
6655 }
6656 }
6657}
6658#[non_exhaustive]
6659#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6660pub struct ListOwnedObjectsRequest {
6661 #[prost(string, optional, tag = "1")]
6663 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6664 #[prost(uint32, optional, tag = "2")]
6668 pub page_size: ::core::option::Option<u32>,
6669 #[prost(bytes = "bytes", optional, tag = "3")]
6675 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6676 #[prost(message, optional, tag = "4")]
6679 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6680 #[prost(string, optional, tag = "5")]
6689 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
6690}
6691#[non_exhaustive]
6692#[derive(Clone, PartialEq, ::prost::Message)]
6693pub struct ListOwnedObjectsResponse {
6694 #[prost(message, repeated, tag = "1")]
6696 pub objects: ::prost::alloc::vec::Vec<Object>,
6697 #[prost(bytes = "bytes", optional, tag = "2")]
6700 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6701}
6702pub mod state_service_client {
6704 #![allow(
6705 unused_variables,
6706 dead_code,
6707 missing_docs,
6708 clippy::wildcard_imports,
6709 clippy::let_unit_value,
6710 )]
6711 use tonic::codegen::*;
6712 use tonic::codegen::http::Uri;
6713 #[derive(Debug, Clone)]
6714 pub struct StateServiceClient<T> {
6715 inner: tonic::client::Grpc<T>,
6716 }
6717 impl StateServiceClient<tonic::transport::Channel> {
6718 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6720 where
6721 D: TryInto<tonic::transport::Endpoint>,
6722 D::Error: Into<StdError>,
6723 {
6724 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6725 Ok(Self::new(conn))
6726 }
6727 }
6728 impl<T> StateServiceClient<T>
6729 where
6730 T: tonic::client::GrpcService<tonic::body::Body>,
6731 T::Error: Into<StdError>,
6732 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6733 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6734 {
6735 pub fn new(inner: T) -> Self {
6736 let inner = tonic::client::Grpc::new(inner);
6737 Self { inner }
6738 }
6739 pub fn with_origin(inner: T, origin: Uri) -> Self {
6740 let inner = tonic::client::Grpc::with_origin(inner, origin);
6741 Self { inner }
6742 }
6743 pub fn with_interceptor<F>(
6744 inner: T,
6745 interceptor: F,
6746 ) -> StateServiceClient<InterceptedService<T, F>>
6747 where
6748 F: tonic::service::Interceptor,
6749 T::ResponseBody: Default,
6750 T: tonic::codegen::Service<
6751 http::Request<tonic::body::Body>,
6752 Response = http::Response<
6753 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6754 >,
6755 >,
6756 <T as tonic::codegen::Service<
6757 http::Request<tonic::body::Body>,
6758 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6759 {
6760 StateServiceClient::new(InterceptedService::new(inner, interceptor))
6761 }
6762 #[must_use]
6767 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6768 self.inner = self.inner.send_compressed(encoding);
6769 self
6770 }
6771 #[must_use]
6773 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6774 self.inner = self.inner.accept_compressed(encoding);
6775 self
6776 }
6777 #[must_use]
6781 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6782 self.inner = self.inner.max_decoding_message_size(limit);
6783 self
6784 }
6785 #[must_use]
6789 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6790 self.inner = self.inner.max_encoding_message_size(limit);
6791 self
6792 }
6793 pub async fn list_dynamic_fields(
6794 &mut self,
6795 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
6796 ) -> std::result::Result<
6797 tonic::Response<super::ListDynamicFieldsResponse>,
6798 tonic::Status,
6799 > {
6800 self.inner
6801 .ready()
6802 .await
6803 .map_err(|e| {
6804 tonic::Status::unknown(
6805 format!("Service was not ready: {}", e.into()),
6806 )
6807 })?;
6808 let codec = tonic_prost::ProstCodec::default();
6809 let path = http::uri::PathAndQuery::from_static(
6810 "/sui.rpc.v2.StateService/ListDynamicFields",
6811 );
6812 let mut req = request.into_request();
6813 req.extensions_mut()
6814 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
6815 self.inner.unary(req, path, codec).await
6816 }
6817 pub async fn list_owned_objects(
6818 &mut self,
6819 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
6820 ) -> std::result::Result<
6821 tonic::Response<super::ListOwnedObjectsResponse>,
6822 tonic::Status,
6823 > {
6824 self.inner
6825 .ready()
6826 .await
6827 .map_err(|e| {
6828 tonic::Status::unknown(
6829 format!("Service was not ready: {}", e.into()),
6830 )
6831 })?;
6832 let codec = tonic_prost::ProstCodec::default();
6833 let path = http::uri::PathAndQuery::from_static(
6834 "/sui.rpc.v2.StateService/ListOwnedObjects",
6835 );
6836 let mut req = request.into_request();
6837 req.extensions_mut()
6838 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
6839 self.inner.unary(req, path, codec).await
6840 }
6841 pub async fn get_coin_info(
6842 &mut self,
6843 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
6844 ) -> std::result::Result<
6845 tonic::Response<super::GetCoinInfoResponse>,
6846 tonic::Status,
6847 > {
6848 self.inner
6849 .ready()
6850 .await
6851 .map_err(|e| {
6852 tonic::Status::unknown(
6853 format!("Service was not ready: {}", e.into()),
6854 )
6855 })?;
6856 let codec = tonic_prost::ProstCodec::default();
6857 let path = http::uri::PathAndQuery::from_static(
6858 "/sui.rpc.v2.StateService/GetCoinInfo",
6859 );
6860 let mut req = request.into_request();
6861 req.extensions_mut()
6862 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
6863 self.inner.unary(req, path, codec).await
6864 }
6865 pub async fn get_balance(
6866 &mut self,
6867 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
6868 ) -> std::result::Result<
6869 tonic::Response<super::GetBalanceResponse>,
6870 tonic::Status,
6871 > {
6872 self.inner
6873 .ready()
6874 .await
6875 .map_err(|e| {
6876 tonic::Status::unknown(
6877 format!("Service was not ready: {}", e.into()),
6878 )
6879 })?;
6880 let codec = tonic_prost::ProstCodec::default();
6881 let path = http::uri::PathAndQuery::from_static(
6882 "/sui.rpc.v2.StateService/GetBalance",
6883 );
6884 let mut req = request.into_request();
6885 req.extensions_mut()
6886 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
6887 self.inner.unary(req, path, codec).await
6888 }
6889 pub async fn list_balances(
6890 &mut self,
6891 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
6892 ) -> std::result::Result<
6893 tonic::Response<super::ListBalancesResponse>,
6894 tonic::Status,
6895 > {
6896 self.inner
6897 .ready()
6898 .await
6899 .map_err(|e| {
6900 tonic::Status::unknown(
6901 format!("Service was not ready: {}", e.into()),
6902 )
6903 })?;
6904 let codec = tonic_prost::ProstCodec::default();
6905 let path = http::uri::PathAndQuery::from_static(
6906 "/sui.rpc.v2.StateService/ListBalances",
6907 );
6908 let mut req = request.into_request();
6909 req.extensions_mut()
6910 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
6911 self.inner.unary(req, path, codec).await
6912 }
6913 }
6914}
6915pub mod state_service_server {
6917 #![allow(
6918 unused_variables,
6919 dead_code,
6920 missing_docs,
6921 clippy::wildcard_imports,
6922 clippy::let_unit_value,
6923 )]
6924 use tonic::codegen::*;
6925 #[async_trait]
6927 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
6928 async fn list_dynamic_fields(
6929 &self,
6930 request: tonic::Request<super::ListDynamicFieldsRequest>,
6931 ) -> std::result::Result<
6932 tonic::Response<super::ListDynamicFieldsResponse>,
6933 tonic::Status,
6934 > {
6935 Err(tonic::Status::unimplemented("Not yet implemented"))
6936 }
6937 async fn list_owned_objects(
6938 &self,
6939 request: tonic::Request<super::ListOwnedObjectsRequest>,
6940 ) -> std::result::Result<
6941 tonic::Response<super::ListOwnedObjectsResponse>,
6942 tonic::Status,
6943 > {
6944 Err(tonic::Status::unimplemented("Not yet implemented"))
6945 }
6946 async fn get_coin_info(
6947 &self,
6948 request: tonic::Request<super::GetCoinInfoRequest>,
6949 ) -> std::result::Result<
6950 tonic::Response<super::GetCoinInfoResponse>,
6951 tonic::Status,
6952 > {
6953 Err(tonic::Status::unimplemented("Not yet implemented"))
6954 }
6955 async fn get_balance(
6956 &self,
6957 request: tonic::Request<super::GetBalanceRequest>,
6958 ) -> std::result::Result<
6959 tonic::Response<super::GetBalanceResponse>,
6960 tonic::Status,
6961 > {
6962 Err(tonic::Status::unimplemented("Not yet implemented"))
6963 }
6964 async fn list_balances(
6965 &self,
6966 request: tonic::Request<super::ListBalancesRequest>,
6967 ) -> std::result::Result<
6968 tonic::Response<super::ListBalancesResponse>,
6969 tonic::Status,
6970 > {
6971 Err(tonic::Status::unimplemented("Not yet implemented"))
6972 }
6973 }
6974 #[derive(Debug)]
6975 pub struct StateServiceServer<T> {
6976 inner: Arc<T>,
6977 accept_compression_encodings: EnabledCompressionEncodings,
6978 send_compression_encodings: EnabledCompressionEncodings,
6979 max_decoding_message_size: Option<usize>,
6980 max_encoding_message_size: Option<usize>,
6981 }
6982 impl<T> StateServiceServer<T> {
6983 pub fn new(inner: T) -> Self {
6984 Self::from_arc(Arc::new(inner))
6985 }
6986 pub fn from_arc(inner: Arc<T>) -> Self {
6987 Self {
6988 inner,
6989 accept_compression_encodings: Default::default(),
6990 send_compression_encodings: Default::default(),
6991 max_decoding_message_size: None,
6992 max_encoding_message_size: None,
6993 }
6994 }
6995 pub fn with_interceptor<F>(
6996 inner: T,
6997 interceptor: F,
6998 ) -> InterceptedService<Self, F>
6999 where
7000 F: tonic::service::Interceptor,
7001 {
7002 InterceptedService::new(Self::new(inner), interceptor)
7003 }
7004 #[must_use]
7006 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7007 self.accept_compression_encodings.enable(encoding);
7008 self
7009 }
7010 #[must_use]
7012 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7013 self.send_compression_encodings.enable(encoding);
7014 self
7015 }
7016 #[must_use]
7020 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7021 self.max_decoding_message_size = Some(limit);
7022 self
7023 }
7024 #[must_use]
7028 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7029 self.max_encoding_message_size = Some(limit);
7030 self
7031 }
7032 }
7033 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
7034 where
7035 T: StateService,
7036 B: Body + std::marker::Send + 'static,
7037 B::Error: Into<StdError> + std::marker::Send + 'static,
7038 {
7039 type Response = http::Response<tonic::body::Body>;
7040 type Error = std::convert::Infallible;
7041 type Future = BoxFuture<Self::Response, Self::Error>;
7042 fn poll_ready(
7043 &mut self,
7044 _cx: &mut Context<'_>,
7045 ) -> Poll<std::result::Result<(), Self::Error>> {
7046 Poll::Ready(Ok(()))
7047 }
7048 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7049 match req.uri().path() {
7050 "/sui.rpc.v2.StateService/ListDynamicFields" => {
7051 #[allow(non_camel_case_types)]
7052 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
7053 impl<
7054 T: StateService,
7055 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
7056 for ListDynamicFieldsSvc<T> {
7057 type Response = super::ListDynamicFieldsResponse;
7058 type Future = BoxFuture<
7059 tonic::Response<Self::Response>,
7060 tonic::Status,
7061 >;
7062 fn call(
7063 &mut self,
7064 request: tonic::Request<super::ListDynamicFieldsRequest>,
7065 ) -> Self::Future {
7066 let inner = Arc::clone(&self.0);
7067 let fut = async move {
7068 <T as StateService>::list_dynamic_fields(&inner, request)
7069 .await
7070 };
7071 Box::pin(fut)
7072 }
7073 }
7074 let accept_compression_encodings = self.accept_compression_encodings;
7075 let send_compression_encodings = self.send_compression_encodings;
7076 let max_decoding_message_size = self.max_decoding_message_size;
7077 let max_encoding_message_size = self.max_encoding_message_size;
7078 let inner = self.inner.clone();
7079 let fut = async move {
7080 let method = ListDynamicFieldsSvc(inner);
7081 let codec = tonic_prost::ProstCodec::default();
7082 let mut grpc = tonic::server::Grpc::new(codec)
7083 .apply_compression_config(
7084 accept_compression_encodings,
7085 send_compression_encodings,
7086 )
7087 .apply_max_message_size_config(
7088 max_decoding_message_size,
7089 max_encoding_message_size,
7090 );
7091 let res = grpc.unary(method, req).await;
7092 Ok(res)
7093 };
7094 Box::pin(fut)
7095 }
7096 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
7097 #[allow(non_camel_case_types)]
7098 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
7099 impl<
7100 T: StateService,
7101 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
7102 for ListOwnedObjectsSvc<T> {
7103 type Response = super::ListOwnedObjectsResponse;
7104 type Future = BoxFuture<
7105 tonic::Response<Self::Response>,
7106 tonic::Status,
7107 >;
7108 fn call(
7109 &mut self,
7110 request: tonic::Request<super::ListOwnedObjectsRequest>,
7111 ) -> Self::Future {
7112 let inner = Arc::clone(&self.0);
7113 let fut = async move {
7114 <T as StateService>::list_owned_objects(&inner, request)
7115 .await
7116 };
7117 Box::pin(fut)
7118 }
7119 }
7120 let accept_compression_encodings = self.accept_compression_encodings;
7121 let send_compression_encodings = self.send_compression_encodings;
7122 let max_decoding_message_size = self.max_decoding_message_size;
7123 let max_encoding_message_size = self.max_encoding_message_size;
7124 let inner = self.inner.clone();
7125 let fut = async move {
7126 let method = ListOwnedObjectsSvc(inner);
7127 let codec = tonic_prost::ProstCodec::default();
7128 let mut grpc = tonic::server::Grpc::new(codec)
7129 .apply_compression_config(
7130 accept_compression_encodings,
7131 send_compression_encodings,
7132 )
7133 .apply_max_message_size_config(
7134 max_decoding_message_size,
7135 max_encoding_message_size,
7136 );
7137 let res = grpc.unary(method, req).await;
7138 Ok(res)
7139 };
7140 Box::pin(fut)
7141 }
7142 "/sui.rpc.v2.StateService/GetCoinInfo" => {
7143 #[allow(non_camel_case_types)]
7144 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
7145 impl<
7146 T: StateService,
7147 > tonic::server::UnaryService<super::GetCoinInfoRequest>
7148 for GetCoinInfoSvc<T> {
7149 type Response = super::GetCoinInfoResponse;
7150 type Future = BoxFuture<
7151 tonic::Response<Self::Response>,
7152 tonic::Status,
7153 >;
7154 fn call(
7155 &mut self,
7156 request: tonic::Request<super::GetCoinInfoRequest>,
7157 ) -> Self::Future {
7158 let inner = Arc::clone(&self.0);
7159 let fut = async move {
7160 <T as StateService>::get_coin_info(&inner, request).await
7161 };
7162 Box::pin(fut)
7163 }
7164 }
7165 let accept_compression_encodings = self.accept_compression_encodings;
7166 let send_compression_encodings = self.send_compression_encodings;
7167 let max_decoding_message_size = self.max_decoding_message_size;
7168 let max_encoding_message_size = self.max_encoding_message_size;
7169 let inner = self.inner.clone();
7170 let fut = async move {
7171 let method = GetCoinInfoSvc(inner);
7172 let codec = tonic_prost::ProstCodec::default();
7173 let mut grpc = tonic::server::Grpc::new(codec)
7174 .apply_compression_config(
7175 accept_compression_encodings,
7176 send_compression_encodings,
7177 )
7178 .apply_max_message_size_config(
7179 max_decoding_message_size,
7180 max_encoding_message_size,
7181 );
7182 let res = grpc.unary(method, req).await;
7183 Ok(res)
7184 };
7185 Box::pin(fut)
7186 }
7187 "/sui.rpc.v2.StateService/GetBalance" => {
7188 #[allow(non_camel_case_types)]
7189 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
7190 impl<
7191 T: StateService,
7192 > tonic::server::UnaryService<super::GetBalanceRequest>
7193 for GetBalanceSvc<T> {
7194 type Response = super::GetBalanceResponse;
7195 type Future = BoxFuture<
7196 tonic::Response<Self::Response>,
7197 tonic::Status,
7198 >;
7199 fn call(
7200 &mut self,
7201 request: tonic::Request<super::GetBalanceRequest>,
7202 ) -> Self::Future {
7203 let inner = Arc::clone(&self.0);
7204 let fut = async move {
7205 <T as StateService>::get_balance(&inner, request).await
7206 };
7207 Box::pin(fut)
7208 }
7209 }
7210 let accept_compression_encodings = self.accept_compression_encodings;
7211 let send_compression_encodings = self.send_compression_encodings;
7212 let max_decoding_message_size = self.max_decoding_message_size;
7213 let max_encoding_message_size = self.max_encoding_message_size;
7214 let inner = self.inner.clone();
7215 let fut = async move {
7216 let method = GetBalanceSvc(inner);
7217 let codec = tonic_prost::ProstCodec::default();
7218 let mut grpc = tonic::server::Grpc::new(codec)
7219 .apply_compression_config(
7220 accept_compression_encodings,
7221 send_compression_encodings,
7222 )
7223 .apply_max_message_size_config(
7224 max_decoding_message_size,
7225 max_encoding_message_size,
7226 );
7227 let res = grpc.unary(method, req).await;
7228 Ok(res)
7229 };
7230 Box::pin(fut)
7231 }
7232 "/sui.rpc.v2.StateService/ListBalances" => {
7233 #[allow(non_camel_case_types)]
7234 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
7235 impl<
7236 T: StateService,
7237 > tonic::server::UnaryService<super::ListBalancesRequest>
7238 for ListBalancesSvc<T> {
7239 type Response = super::ListBalancesResponse;
7240 type Future = BoxFuture<
7241 tonic::Response<Self::Response>,
7242 tonic::Status,
7243 >;
7244 fn call(
7245 &mut self,
7246 request: tonic::Request<super::ListBalancesRequest>,
7247 ) -> Self::Future {
7248 let inner = Arc::clone(&self.0);
7249 let fut = async move {
7250 <T as StateService>::list_balances(&inner, request).await
7251 };
7252 Box::pin(fut)
7253 }
7254 }
7255 let accept_compression_encodings = self.accept_compression_encodings;
7256 let send_compression_encodings = self.send_compression_encodings;
7257 let max_decoding_message_size = self.max_decoding_message_size;
7258 let max_encoding_message_size = self.max_encoding_message_size;
7259 let inner = self.inner.clone();
7260 let fut = async move {
7261 let method = ListBalancesSvc(inner);
7262 let codec = tonic_prost::ProstCodec::default();
7263 let mut grpc = tonic::server::Grpc::new(codec)
7264 .apply_compression_config(
7265 accept_compression_encodings,
7266 send_compression_encodings,
7267 )
7268 .apply_max_message_size_config(
7269 max_decoding_message_size,
7270 max_encoding_message_size,
7271 );
7272 let res = grpc.unary(method, req).await;
7273 Ok(res)
7274 };
7275 Box::pin(fut)
7276 }
7277 _ => {
7278 Box::pin(async move {
7279 let mut response = http::Response::new(
7280 tonic::body::Body::default(),
7281 );
7282 let headers = response.headers_mut();
7283 headers
7284 .insert(
7285 tonic::Status::GRPC_STATUS,
7286 (tonic::Code::Unimplemented as i32).into(),
7287 );
7288 headers
7289 .insert(
7290 http::header::CONTENT_TYPE,
7291 tonic::metadata::GRPC_CONTENT_TYPE,
7292 );
7293 Ok(response)
7294 })
7295 }
7296 }
7297 }
7298 }
7299 impl<T> Clone for StateServiceServer<T> {
7300 fn clone(&self) -> Self {
7301 let inner = self.inner.clone();
7302 Self {
7303 inner,
7304 accept_compression_encodings: self.accept_compression_encodings,
7305 send_compression_encodings: self.send_compression_encodings,
7306 max_decoding_message_size: self.max_decoding_message_size,
7307 max_encoding_message_size: self.max_encoding_message_size,
7308 }
7309 }
7310 }
7311 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
7313 impl<T> tonic::server::NamedService for StateServiceServer<T> {
7314 const NAME: &'static str = SERVICE_NAME;
7315 }
7316}
7317#[derive(Eq, Hash)]
7319#[non_exhaustive]
7320#[derive(Clone, PartialEq, ::prost::Message)]
7321pub struct SubscribeCheckpointsRequest {
7322 #[prost(message, optional, tag = "1")]
7326 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7327 #[prost(message, optional, tag = "2")]
7331 pub filter: ::core::option::Option<TransactionFilter>,
7332}
7333#[non_exhaustive]
7341#[derive(Clone, PartialEq, ::prost::Message)]
7342pub struct SubscribeCheckpointsResponse {
7343 #[prost(uint64, optional, tag = "1")]
7348 pub cursor: ::core::option::Option<u64>,
7349 #[prost(message, optional, tag = "2")]
7352 pub checkpoint: ::core::option::Option<Checkpoint>,
7353}
7354#[non_exhaustive]
7356#[derive(Clone, PartialEq, ::prost::Message)]
7357pub struct SubscribeTransactionsRequest {
7358 #[prost(message, optional, tag = "1")]
7361 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7362 #[prost(message, optional, tag = "2")]
7365 pub filter: ::core::option::Option<TransactionFilter>,
7366}
7367#[non_exhaustive]
7372#[derive(Clone, PartialEq, ::prost::Message)]
7373pub struct SubscribeTransactionsResponse {
7374 #[prost(message, optional, tag = "1")]
7377 pub transaction: ::core::option::Option<ExecutedTransaction>,
7378 #[prost(message, optional, tag = "2")]
7380 pub watermark: ::core::option::Option<Watermark>,
7381}
7382#[non_exhaustive]
7384#[derive(Clone, PartialEq, ::prost::Message)]
7385pub struct SubscribeEventsRequest {
7386 #[prost(message, optional, tag = "1")]
7389 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7390 #[prost(message, optional, tag = "2")]
7393 pub filter: ::core::option::Option<EventFilter>,
7394}
7395#[non_exhaustive]
7400#[derive(Clone, PartialEq, ::prost::Message)]
7401pub struct SubscribeEventsResponse {
7402 #[prost(message, optional, tag = "1")]
7407 pub event: ::core::option::Option<Event>,
7408 #[prost(message, optional, tag = "2")]
7410 pub watermark: ::core::option::Option<Watermark>,
7411}
7412pub mod subscription_service_client {
7414 #![allow(
7415 unused_variables,
7416 dead_code,
7417 missing_docs,
7418 clippy::wildcard_imports,
7419 clippy::let_unit_value,
7420 )]
7421 use tonic::codegen::*;
7422 use tonic::codegen::http::Uri;
7423 #[derive(Debug, Clone)]
7451 pub struct SubscriptionServiceClient<T> {
7452 inner: tonic::client::Grpc<T>,
7453 }
7454 impl SubscriptionServiceClient<tonic::transport::Channel> {
7455 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7457 where
7458 D: TryInto<tonic::transport::Endpoint>,
7459 D::Error: Into<StdError>,
7460 {
7461 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7462 Ok(Self::new(conn))
7463 }
7464 }
7465 impl<T> SubscriptionServiceClient<T>
7466 where
7467 T: tonic::client::GrpcService<tonic::body::Body>,
7468 T::Error: Into<StdError>,
7469 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7470 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7471 {
7472 pub fn new(inner: T) -> Self {
7473 let inner = tonic::client::Grpc::new(inner);
7474 Self { inner }
7475 }
7476 pub fn with_origin(inner: T, origin: Uri) -> Self {
7477 let inner = tonic::client::Grpc::with_origin(inner, origin);
7478 Self { inner }
7479 }
7480 pub fn with_interceptor<F>(
7481 inner: T,
7482 interceptor: F,
7483 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
7484 where
7485 F: tonic::service::Interceptor,
7486 T::ResponseBody: Default,
7487 T: tonic::codegen::Service<
7488 http::Request<tonic::body::Body>,
7489 Response = http::Response<
7490 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7491 >,
7492 >,
7493 <T as tonic::codegen::Service<
7494 http::Request<tonic::body::Body>,
7495 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7496 {
7497 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
7498 }
7499 #[must_use]
7504 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7505 self.inner = self.inner.send_compressed(encoding);
7506 self
7507 }
7508 #[must_use]
7510 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7511 self.inner = self.inner.accept_compressed(encoding);
7512 self
7513 }
7514 #[must_use]
7518 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7519 self.inner = self.inner.max_decoding_message_size(limit);
7520 self
7521 }
7522 #[must_use]
7526 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7527 self.inner = self.inner.max_encoding_message_size(limit);
7528 self
7529 }
7530 pub async fn subscribe_checkpoints(
7537 &mut self,
7538 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
7539 ) -> std::result::Result<
7540 tonic::Response<
7541 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
7542 >,
7543 tonic::Status,
7544 > {
7545 self.inner
7546 .ready()
7547 .await
7548 .map_err(|e| {
7549 tonic::Status::unknown(
7550 format!("Service was not ready: {}", e.into()),
7551 )
7552 })?;
7553 let codec = tonic_prost::ProstCodec::default();
7554 let path = http::uri::PathAndQuery::from_static(
7555 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
7556 );
7557 let mut req = request.into_request();
7558 req.extensions_mut()
7559 .insert(
7560 GrpcMethod::new(
7561 "sui.rpc.v2.SubscriptionService",
7562 "SubscribeCheckpoints",
7563 ),
7564 );
7565 self.inner.server_streaming(req, path, codec).await
7566 }
7567 pub async fn subscribe_transactions(
7572 &mut self,
7573 request: impl tonic::IntoRequest<super::SubscribeTransactionsRequest>,
7574 ) -> std::result::Result<
7575 tonic::Response<
7576 tonic::codec::Streaming<super::SubscribeTransactionsResponse>,
7577 >,
7578 tonic::Status,
7579 > {
7580 self.inner
7581 .ready()
7582 .await
7583 .map_err(|e| {
7584 tonic::Status::unknown(
7585 format!("Service was not ready: {}", e.into()),
7586 )
7587 })?;
7588 let codec = tonic_prost::ProstCodec::default();
7589 let path = http::uri::PathAndQuery::from_static(
7590 "/sui.rpc.v2.SubscriptionService/SubscribeTransactions",
7591 );
7592 let mut req = request.into_request();
7593 req.extensions_mut()
7594 .insert(
7595 GrpcMethod::new(
7596 "sui.rpc.v2.SubscriptionService",
7597 "SubscribeTransactions",
7598 ),
7599 );
7600 self.inner.server_streaming(req, path, codec).await
7601 }
7602 pub async fn subscribe_events(
7607 &mut self,
7608 request: impl tonic::IntoRequest<super::SubscribeEventsRequest>,
7609 ) -> std::result::Result<
7610 tonic::Response<tonic::codec::Streaming<super::SubscribeEventsResponse>>,
7611 tonic::Status,
7612 > {
7613 self.inner
7614 .ready()
7615 .await
7616 .map_err(|e| {
7617 tonic::Status::unknown(
7618 format!("Service was not ready: {}", e.into()),
7619 )
7620 })?;
7621 let codec = tonic_prost::ProstCodec::default();
7622 let path = http::uri::PathAndQuery::from_static(
7623 "/sui.rpc.v2.SubscriptionService/SubscribeEvents",
7624 );
7625 let mut req = request.into_request();
7626 req.extensions_mut()
7627 .insert(
7628 GrpcMethod::new("sui.rpc.v2.SubscriptionService", "SubscribeEvents"),
7629 );
7630 self.inner.server_streaming(req, path, codec).await
7631 }
7632 }
7633}
7634pub mod subscription_service_server {
7636 #![allow(
7637 unused_variables,
7638 dead_code,
7639 missing_docs,
7640 clippy::wildcard_imports,
7641 clippy::let_unit_value,
7642 )]
7643 use tonic::codegen::*;
7644 #[async_trait]
7646 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
7647 async fn subscribe_checkpoints(
7654 &self,
7655 request: tonic::Request<super::SubscribeCheckpointsRequest>,
7656 ) -> std::result::Result<
7657 tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
7658 tonic::Status,
7659 > {
7660 Err(tonic::Status::unimplemented("Not yet implemented"))
7661 }
7662 async fn subscribe_transactions(
7667 &self,
7668 request: tonic::Request<super::SubscribeTransactionsRequest>,
7669 ) -> std::result::Result<
7670 tonic::Response<BoxStream<super::SubscribeTransactionsResponse>>,
7671 tonic::Status,
7672 > {
7673 Err(tonic::Status::unimplemented("Not yet implemented"))
7674 }
7675 async fn subscribe_events(
7680 &self,
7681 request: tonic::Request<super::SubscribeEventsRequest>,
7682 ) -> std::result::Result<
7683 tonic::Response<BoxStream<super::SubscribeEventsResponse>>,
7684 tonic::Status,
7685 > {
7686 Err(tonic::Status::unimplemented("Not yet implemented"))
7687 }
7688 }
7689 #[derive(Debug)]
7717 pub struct SubscriptionServiceServer<T> {
7718 inner: Arc<T>,
7719 accept_compression_encodings: EnabledCompressionEncodings,
7720 send_compression_encodings: EnabledCompressionEncodings,
7721 max_decoding_message_size: Option<usize>,
7722 max_encoding_message_size: Option<usize>,
7723 }
7724 impl<T> SubscriptionServiceServer<T> {
7725 pub fn new(inner: T) -> Self {
7726 Self::from_arc(Arc::new(inner))
7727 }
7728 pub fn from_arc(inner: Arc<T>) -> Self {
7729 Self {
7730 inner,
7731 accept_compression_encodings: Default::default(),
7732 send_compression_encodings: Default::default(),
7733 max_decoding_message_size: None,
7734 max_encoding_message_size: None,
7735 }
7736 }
7737 pub fn with_interceptor<F>(
7738 inner: T,
7739 interceptor: F,
7740 ) -> InterceptedService<Self, F>
7741 where
7742 F: tonic::service::Interceptor,
7743 {
7744 InterceptedService::new(Self::new(inner), interceptor)
7745 }
7746 #[must_use]
7748 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7749 self.accept_compression_encodings.enable(encoding);
7750 self
7751 }
7752 #[must_use]
7754 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7755 self.send_compression_encodings.enable(encoding);
7756 self
7757 }
7758 #[must_use]
7762 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7763 self.max_decoding_message_size = Some(limit);
7764 self
7765 }
7766 #[must_use]
7770 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7771 self.max_encoding_message_size = Some(limit);
7772 self
7773 }
7774 }
7775 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
7776 where
7777 T: SubscriptionService,
7778 B: Body + std::marker::Send + 'static,
7779 B::Error: Into<StdError> + std::marker::Send + 'static,
7780 {
7781 type Response = http::Response<tonic::body::Body>;
7782 type Error = std::convert::Infallible;
7783 type Future = BoxFuture<Self::Response, Self::Error>;
7784 fn poll_ready(
7785 &mut self,
7786 _cx: &mut Context<'_>,
7787 ) -> Poll<std::result::Result<(), Self::Error>> {
7788 Poll::Ready(Ok(()))
7789 }
7790 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7791 match req.uri().path() {
7792 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
7793 #[allow(non_camel_case_types)]
7794 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
7795 impl<
7796 T: SubscriptionService,
7797 > tonic::server::ServerStreamingService<
7798 super::SubscribeCheckpointsRequest,
7799 > for SubscribeCheckpointsSvc<T> {
7800 type Response = super::SubscribeCheckpointsResponse;
7801 type ResponseStream = BoxStream<
7802 super::SubscribeCheckpointsResponse,
7803 >;
7804 type Future = BoxFuture<
7805 tonic::Response<Self::ResponseStream>,
7806 tonic::Status,
7807 >;
7808 fn call(
7809 &mut self,
7810 request: tonic::Request<super::SubscribeCheckpointsRequest>,
7811 ) -> Self::Future {
7812 let inner = Arc::clone(&self.0);
7813 let fut = async move {
7814 <T as SubscriptionService>::subscribe_checkpoints(
7815 &inner,
7816 request,
7817 )
7818 .await
7819 };
7820 Box::pin(fut)
7821 }
7822 }
7823 let accept_compression_encodings = self.accept_compression_encodings;
7824 let send_compression_encodings = self.send_compression_encodings;
7825 let max_decoding_message_size = self.max_decoding_message_size;
7826 let max_encoding_message_size = self.max_encoding_message_size;
7827 let inner = self.inner.clone();
7828 let fut = async move {
7829 let method = SubscribeCheckpointsSvc(inner);
7830 let codec = tonic_prost::ProstCodec::default();
7831 let mut grpc = tonic::server::Grpc::new(codec)
7832 .apply_compression_config(
7833 accept_compression_encodings,
7834 send_compression_encodings,
7835 )
7836 .apply_max_message_size_config(
7837 max_decoding_message_size,
7838 max_encoding_message_size,
7839 );
7840 let res = grpc.server_streaming(method, req).await;
7841 Ok(res)
7842 };
7843 Box::pin(fut)
7844 }
7845 "/sui.rpc.v2.SubscriptionService/SubscribeTransactions" => {
7846 #[allow(non_camel_case_types)]
7847 struct SubscribeTransactionsSvc<T: SubscriptionService>(pub Arc<T>);
7848 impl<
7849 T: SubscriptionService,
7850 > tonic::server::ServerStreamingService<
7851 super::SubscribeTransactionsRequest,
7852 > for SubscribeTransactionsSvc<T> {
7853 type Response = super::SubscribeTransactionsResponse;
7854 type ResponseStream = BoxStream<
7855 super::SubscribeTransactionsResponse,
7856 >;
7857 type Future = BoxFuture<
7858 tonic::Response<Self::ResponseStream>,
7859 tonic::Status,
7860 >;
7861 fn call(
7862 &mut self,
7863 request: tonic::Request<super::SubscribeTransactionsRequest>,
7864 ) -> Self::Future {
7865 let inner = Arc::clone(&self.0);
7866 let fut = async move {
7867 <T as SubscriptionService>::subscribe_transactions(
7868 &inner,
7869 request,
7870 )
7871 .await
7872 };
7873 Box::pin(fut)
7874 }
7875 }
7876 let accept_compression_encodings = self.accept_compression_encodings;
7877 let send_compression_encodings = self.send_compression_encodings;
7878 let max_decoding_message_size = self.max_decoding_message_size;
7879 let max_encoding_message_size = self.max_encoding_message_size;
7880 let inner = self.inner.clone();
7881 let fut = async move {
7882 let method = SubscribeTransactionsSvc(inner);
7883 let codec = tonic_prost::ProstCodec::default();
7884 let mut grpc = tonic::server::Grpc::new(codec)
7885 .apply_compression_config(
7886 accept_compression_encodings,
7887 send_compression_encodings,
7888 )
7889 .apply_max_message_size_config(
7890 max_decoding_message_size,
7891 max_encoding_message_size,
7892 );
7893 let res = grpc.server_streaming(method, req).await;
7894 Ok(res)
7895 };
7896 Box::pin(fut)
7897 }
7898 "/sui.rpc.v2.SubscriptionService/SubscribeEvents" => {
7899 #[allow(non_camel_case_types)]
7900 struct SubscribeEventsSvc<T: SubscriptionService>(pub Arc<T>);
7901 impl<
7902 T: SubscriptionService,
7903 > tonic::server::ServerStreamingService<
7904 super::SubscribeEventsRequest,
7905 > for SubscribeEventsSvc<T> {
7906 type Response = super::SubscribeEventsResponse;
7907 type ResponseStream = BoxStream<super::SubscribeEventsResponse>;
7908 type Future = BoxFuture<
7909 tonic::Response<Self::ResponseStream>,
7910 tonic::Status,
7911 >;
7912 fn call(
7913 &mut self,
7914 request: tonic::Request<super::SubscribeEventsRequest>,
7915 ) -> Self::Future {
7916 let inner = Arc::clone(&self.0);
7917 let fut = async move {
7918 <T as SubscriptionService>::subscribe_events(
7919 &inner,
7920 request,
7921 )
7922 .await
7923 };
7924 Box::pin(fut)
7925 }
7926 }
7927 let accept_compression_encodings = self.accept_compression_encodings;
7928 let send_compression_encodings = self.send_compression_encodings;
7929 let max_decoding_message_size = self.max_decoding_message_size;
7930 let max_encoding_message_size = self.max_encoding_message_size;
7931 let inner = self.inner.clone();
7932 let fut = async move {
7933 let method = SubscribeEventsSvc(inner);
7934 let codec = tonic_prost::ProstCodec::default();
7935 let mut grpc = tonic::server::Grpc::new(codec)
7936 .apply_compression_config(
7937 accept_compression_encodings,
7938 send_compression_encodings,
7939 )
7940 .apply_max_message_size_config(
7941 max_decoding_message_size,
7942 max_encoding_message_size,
7943 );
7944 let res = grpc.server_streaming(method, req).await;
7945 Ok(res)
7946 };
7947 Box::pin(fut)
7948 }
7949 _ => {
7950 Box::pin(async move {
7951 let mut response = http::Response::new(
7952 tonic::body::Body::default(),
7953 );
7954 let headers = response.headers_mut();
7955 headers
7956 .insert(
7957 tonic::Status::GRPC_STATUS,
7958 (tonic::Code::Unimplemented as i32).into(),
7959 );
7960 headers
7961 .insert(
7962 http::header::CONTENT_TYPE,
7963 tonic::metadata::GRPC_CONTENT_TYPE,
7964 );
7965 Ok(response)
7966 })
7967 }
7968 }
7969 }
7970 }
7971 impl<T> Clone for SubscriptionServiceServer<T> {
7972 fn clone(&self) -> Self {
7973 let inner = self.inner.clone();
7974 Self {
7975 inner,
7976 accept_compression_encodings: self.accept_compression_encodings,
7977 send_compression_encodings: self.send_compression_encodings,
7978 max_decoding_message_size: self.max_decoding_message_size,
7979 max_encoding_message_size: self.max_encoding_message_size,
7980 }
7981 }
7982 }
7983 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
7985 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
7986 const NAME: &'static str = SERVICE_NAME;
7987 }
7988}
7989#[non_exhaustive]
7990#[derive(Clone, PartialEq, ::prost::Message)]
7991pub struct SystemState {
7992 #[prost(uint64, optional, tag = "1")]
7994 pub version: ::core::option::Option<u64>,
7995 #[prost(uint64, optional, tag = "2")]
7997 pub epoch: ::core::option::Option<u64>,
7998 #[prost(uint64, optional, tag = "3")]
8000 pub protocol_version: ::core::option::Option<u64>,
8001 #[prost(message, optional, tag = "4")]
8003 pub validators: ::core::option::Option<ValidatorSet>,
8004 #[prost(message, optional, tag = "5")]
8006 pub storage_fund: ::core::option::Option<StorageFund>,
8007 #[prost(message, optional, tag = "6")]
8009 pub parameters: ::core::option::Option<SystemParameters>,
8010 #[prost(uint64, optional, tag = "7")]
8012 pub reference_gas_price: ::core::option::Option<u64>,
8013 #[prost(message, repeated, tag = "8")]
8021 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
8022 #[prost(message, optional, tag = "9")]
8024 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
8025 #[prost(bool, optional, tag = "10")]
8032 pub safe_mode: ::core::option::Option<bool>,
8033 #[prost(uint64, optional, tag = "11")]
8035 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
8036 #[prost(uint64, optional, tag = "12")]
8038 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
8039 #[prost(uint64, optional, tag = "13")]
8041 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
8042 #[prost(uint64, optional, tag = "14")]
8044 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
8045 #[prost(uint64, optional, tag = "15")]
8047 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
8048 #[prost(message, optional, tag = "16")]
8050 pub extra_fields: ::core::option::Option<MoveTable>,
8051}
8052#[non_exhaustive]
8053#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8054pub struct ValidatorReportRecord {
8055 #[prost(string, optional, tag = "1")]
8057 pub reported: ::core::option::Option<::prost::alloc::string::String>,
8058 #[prost(string, repeated, tag = "2")]
8060 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8061}
8062#[non_exhaustive]
8063#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8064pub struct SystemParameters {
8065 #[prost(uint64, optional, tag = "1")]
8067 pub epoch_duration_ms: ::core::option::Option<u64>,
8068 #[prost(uint64, optional, tag = "2")]
8070 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
8071 #[prost(uint64, optional, tag = "3")]
8073 pub min_validator_count: ::core::option::Option<u64>,
8074 #[prost(uint64, optional, tag = "4")]
8077 pub max_validator_count: ::core::option::Option<u64>,
8078 #[prost(uint64, optional, tag = "5")]
8081 pub min_validator_joining_stake: ::core::option::Option<u64>,
8082 #[prost(uint64, optional, tag = "6")]
8087 pub validator_low_stake_threshold: ::core::option::Option<u64>,
8088 #[prost(uint64, optional, tag = "7")]
8092 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
8093 #[prost(uint64, optional, tag = "8")]
8096 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
8097 #[prost(message, optional, tag = "9")]
8099 pub extra_fields: ::core::option::Option<MoveTable>,
8100}
8101#[non_exhaustive]
8103#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8104pub struct MoveTable {
8105 #[prost(string, optional, tag = "1")]
8107 pub id: ::core::option::Option<::prost::alloc::string::String>,
8108 #[prost(uint64, optional, tag = "2")]
8110 pub size: ::core::option::Option<u64>,
8111}
8112#[non_exhaustive]
8113#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8114pub struct StakeSubsidy {
8115 #[prost(uint64, optional, tag = "1")]
8117 pub balance: ::core::option::Option<u64>,
8118 #[prost(uint64, optional, tag = "2")]
8120 pub distribution_counter: ::core::option::Option<u64>,
8121 #[prost(uint64, optional, tag = "3")]
8124 pub current_distribution_amount: ::core::option::Option<u64>,
8125 #[prost(uint64, optional, tag = "4")]
8127 pub stake_subsidy_period_length: ::core::option::Option<u64>,
8128 #[prost(uint32, optional, tag = "5")]
8131 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
8132 #[prost(message, optional, tag = "6")]
8134 pub extra_fields: ::core::option::Option<MoveTable>,
8135}
8136#[non_exhaustive]
8138#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8139pub struct StorageFund {
8140 #[prost(uint64, optional, tag = "1")]
8146 pub total_object_storage_rebates: ::core::option::Option<u64>,
8147 #[prost(uint64, optional, tag = "2")]
8150 pub non_refundable_balance: ::core::option::Option<u64>,
8151}
8152#[non_exhaustive]
8153#[derive(Clone, PartialEq, ::prost::Message)]
8154pub struct ValidatorSet {
8155 #[prost(uint64, optional, tag = "1")]
8158 pub total_stake: ::core::option::Option<u64>,
8159 #[prost(message, repeated, tag = "2")]
8161 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
8162 #[prost(message, optional, tag = "3")]
8167 pub pending_active_validators: ::core::option::Option<MoveTable>,
8168 #[prost(uint64, repeated, tag = "4")]
8171 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
8172 #[prost(message, optional, tag = "5")]
8176 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
8177 #[prost(message, optional, tag = "6")]
8183 pub inactive_validators: ::core::option::Option<MoveTable>,
8184 #[prost(message, optional, tag = "7")]
8192 pub validator_candidates: ::core::option::Option<MoveTable>,
8193 #[prost(btree_map = "string, uint64", tag = "8")]
8195 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
8196 ::prost::alloc::string::String,
8197 u64,
8198 >,
8199 #[prost(message, optional, tag = "9")]
8201 pub extra_fields: ::core::option::Option<MoveTable>,
8202}
8203#[non_exhaustive]
8207#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8208pub struct Validator {
8209 #[prost(string, optional, tag = "1")]
8211 pub name: ::core::option::Option<::prost::alloc::string::String>,
8212 #[prost(string, optional, tag = "2")]
8215 pub address: ::core::option::Option<::prost::alloc::string::String>,
8216 #[prost(string, optional, tag = "3")]
8217 pub description: ::core::option::Option<::prost::alloc::string::String>,
8218 #[prost(string, optional, tag = "4")]
8219 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
8220 #[prost(string, optional, tag = "5")]
8221 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
8222 #[prost(bytes = "bytes", optional, tag = "7")]
8225 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8226 #[prost(bytes = "bytes", optional, tag = "8")]
8228 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8229 #[prost(bytes = "bytes", optional, tag = "10")]
8232 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8233 #[prost(bytes = "bytes", optional, tag = "12")]
8235 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8236 #[prost(string, optional, tag = "13")]
8238 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
8239 #[prost(string, optional, tag = "14")]
8241 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8242 #[prost(string, optional, tag = "15")]
8244 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
8245 #[prost(string, optional, tag = "16")]
8247 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
8248 #[prost(bytes = "bytes", optional, tag = "18")]
8249 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8250 #[prost(bytes = "bytes", optional, tag = "19")]
8251 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8252 #[prost(bytes = "bytes", optional, tag = "21")]
8253 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8254 #[prost(bytes = "bytes", optional, tag = "23")]
8255 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8256 #[prost(string, optional, tag = "24")]
8257 pub next_epoch_network_address: ::core::option::Option<
8258 ::prost::alloc::string::String,
8259 >,
8260 #[prost(string, optional, tag = "25")]
8261 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8262 #[prost(string, optional, tag = "26")]
8263 pub next_epoch_primary_address: ::core::option::Option<
8264 ::prost::alloc::string::String,
8265 >,
8266 #[prost(string, optional, tag = "27")]
8267 pub next_epoch_worker_address: ::core::option::Option<
8268 ::prost::alloc::string::String,
8269 >,
8270 #[prost(message, optional, tag = "28")]
8272 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
8273 #[prost(uint64, optional, tag = "29")]
8276 pub voting_power: ::core::option::Option<u64>,
8277 #[prost(string, optional, tag = "30")]
8279 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
8280 #[prost(uint64, optional, tag = "31")]
8282 pub gas_price: ::core::option::Option<u64>,
8283 #[prost(message, optional, tag = "32")]
8285 pub staking_pool: ::core::option::Option<StakingPool>,
8286 #[prost(uint64, optional, tag = "33")]
8288 pub commission_rate: ::core::option::Option<u64>,
8289 #[prost(uint64, optional, tag = "34")]
8291 pub next_epoch_stake: ::core::option::Option<u64>,
8292 #[prost(uint64, optional, tag = "35")]
8294 pub next_epoch_gas_price: ::core::option::Option<u64>,
8295 #[prost(uint64, optional, tag = "36")]
8297 pub next_epoch_commission_rate: ::core::option::Option<u64>,
8298 #[prost(message, optional, tag = "37")]
8300 pub extra_fields: ::core::option::Option<MoveTable>,
8301}
8302#[non_exhaustive]
8304#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8305pub struct StakingPool {
8306 #[prost(string, optional, tag = "1")]
8308 pub id: ::core::option::Option<::prost::alloc::string::String>,
8309 #[prost(uint64, optional, tag = "2")]
8312 pub activation_epoch: ::core::option::Option<u64>,
8313 #[prost(uint64, optional, tag = "3")]
8316 pub deactivation_epoch: ::core::option::Option<u64>,
8317 #[prost(uint64, optional, tag = "4")]
8320 pub sui_balance: ::core::option::Option<u64>,
8321 #[prost(uint64, optional, tag = "5")]
8323 pub rewards_pool: ::core::option::Option<u64>,
8324 #[prost(uint64, optional, tag = "6")]
8326 pub pool_token_balance: ::core::option::Option<u64>,
8327 #[prost(message, optional, tag = "7")]
8334 pub exchange_rates: ::core::option::Option<MoveTable>,
8335 #[prost(uint64, optional, tag = "8")]
8337 pub pending_stake: ::core::option::Option<u64>,
8338 #[prost(uint64, optional, tag = "9")]
8341 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
8342 #[prost(uint64, optional, tag = "10")]
8344 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
8345 #[prost(message, optional, tag = "11")]
8347 pub extra_fields: ::core::option::Option<MoveTable>,
8348}
8349#[non_exhaustive]
8351#[derive(Clone, PartialEq, ::prost::Message)]
8352pub struct Transaction {
8353 #[prost(message, optional, tag = "1")]
8355 pub bcs: ::core::option::Option<Bcs>,
8356 #[prost(string, optional, tag = "2")]
8358 pub digest: ::core::option::Option<::prost::alloc::string::String>,
8359 #[prost(int32, optional, tag = "3")]
8361 pub version: ::core::option::Option<i32>,
8362 #[prost(message, optional, tag = "4")]
8363 pub kind: ::core::option::Option<TransactionKind>,
8364 #[prost(string, optional, tag = "5")]
8365 pub sender: ::core::option::Option<::prost::alloc::string::String>,
8366 #[prost(message, optional, tag = "6")]
8367 pub gas_payment: ::core::option::Option<GasPayment>,
8368 #[prost(message, optional, tag = "7")]
8369 pub expiration: ::core::option::Option<TransactionExpiration>,
8370}
8371#[non_exhaustive]
8373#[derive(Clone, PartialEq, ::prost::Message)]
8374pub struct GasPayment {
8375 #[prost(message, repeated, tag = "1")]
8377 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
8378 #[prost(string, optional, tag = "2")]
8380 pub owner: ::core::option::Option<::prost::alloc::string::String>,
8381 #[prost(uint64, optional, tag = "3")]
8385 pub price: ::core::option::Option<u64>,
8386 #[prost(uint64, optional, tag = "4")]
8388 pub budget: ::core::option::Option<u64>,
8389}
8390#[non_exhaustive]
8392#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8393pub struct TransactionExpiration {
8394 #[prost(
8395 enumeration = "transaction_expiration::TransactionExpirationKind",
8396 optional,
8397 tag = "1"
8398 )]
8399 pub kind: ::core::option::Option<i32>,
8400 #[prost(uint64, optional, tag = "2")]
8403 pub epoch: ::core::option::Option<u64>,
8404 #[prost(uint64, optional, tag = "3")]
8407 pub min_epoch: ::core::option::Option<u64>,
8408 #[prost(message, optional, tag = "4")]
8412 pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8413 #[prost(message, optional, tag = "5")]
8417 pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8418 #[prost(string, optional, tag = "6")]
8420 pub chain: ::core::option::Option<::prost::alloc::string::String>,
8421 #[prost(uint32, optional, tag = "7")]
8423 pub nonce: ::core::option::Option<u32>,
8424 #[prost(message, optional, tag = "8")]
8427 pub allowed_proposers: ::core::option::Option<AllowedProposers>,
8428}
8429pub mod transaction_expiration {
8431 #[non_exhaustive]
8432 #[derive(
8433 Clone,
8434 Copy,
8435 Debug,
8436 PartialEq,
8437 Eq,
8438 Hash,
8439 PartialOrd,
8440 Ord,
8441 ::prost::Enumeration
8442 )]
8443 #[repr(i32)]
8444 pub enum TransactionExpirationKind {
8445 Unknown = 0,
8446 None = 1,
8448 Epoch = 2,
8451 ValidDuring = 3,
8461 Validity = 4,
8464 }
8465 impl TransactionExpirationKind {
8466 pub fn as_str_name(&self) -> &'static str {
8471 match self {
8472 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
8473 Self::None => "NONE",
8474 Self::Epoch => "EPOCH",
8475 Self::ValidDuring => "VALID_DURING",
8476 Self::Validity => "VALIDITY",
8477 }
8478 }
8479 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8481 match value {
8482 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
8483 "NONE" => Some(Self::None),
8484 "EPOCH" => Some(Self::Epoch),
8485 "VALID_DURING" => Some(Self::ValidDuring),
8486 "VALIDITY" => Some(Self::Validity),
8487 _ => None,
8488 }
8489 }
8490 }
8491}
8492#[non_exhaustive]
8496#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8497pub struct AllowedProposers {
8498 #[prost(uint64, optional, tag = "1")]
8503 pub epoch: ::core::option::Option<u64>,
8504 #[prost(uint32, repeated, tag = "2")]
8509 pub proposers: ::prost::alloc::vec::Vec<u32>,
8510}
8511#[non_exhaustive]
8513#[derive(Clone, PartialEq, ::prost::Message)]
8514pub struct TransactionKind {
8515 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
8516 pub kind: ::core::option::Option<i32>,
8517 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
8518 pub data: ::core::option::Option<transaction_kind::Data>,
8519}
8520pub mod transaction_kind {
8522 #[non_exhaustive]
8523 #[derive(
8524 Clone,
8525 Copy,
8526 Debug,
8527 PartialEq,
8528 Eq,
8529 Hash,
8530 PartialOrd,
8531 Ord,
8532 ::prost::Enumeration
8533 )]
8534 #[repr(i32)]
8535 pub enum Kind {
8536 Unknown = 0,
8537 ProgrammableTransaction = 1,
8539 ChangeEpoch = 2,
8544 Genesis = 3,
8549 ConsensusCommitPrologueV1 = 4,
8551 AuthenticatorStateUpdate = 5,
8553 EndOfEpoch = 6,
8556 RandomnessStateUpdate = 7,
8558 ConsensusCommitPrologueV2 = 8,
8560 ConsensusCommitPrologueV3 = 9,
8562 ConsensusCommitPrologueV4 = 10,
8564 ProgrammableSystemTransaction = 11,
8566 }
8567 impl Kind {
8568 pub fn as_str_name(&self) -> &'static str {
8573 match self {
8574 Self::Unknown => "KIND_UNKNOWN",
8575 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
8576 Self::ChangeEpoch => "CHANGE_EPOCH",
8577 Self::Genesis => "GENESIS",
8578 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
8579 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
8580 Self::EndOfEpoch => "END_OF_EPOCH",
8581 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
8582 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
8583 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
8584 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
8585 Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
8586 }
8587 }
8588 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8590 match value {
8591 "KIND_UNKNOWN" => Some(Self::Unknown),
8592 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
8593 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8594 "GENESIS" => Some(Self::Genesis),
8595 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
8596 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
8597 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
8598 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
8599 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
8600 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
8601 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
8602 "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
8603 Some(Self::ProgrammableSystemTransaction)
8604 }
8605 _ => None,
8606 }
8607 }
8608 }
8609 #[non_exhaustive]
8610 #[derive(Clone, PartialEq, ::prost::Oneof)]
8611 pub enum Data {
8612 #[prost(message, tag = "2")]
8614 ProgrammableTransaction(super::ProgrammableTransaction),
8615 #[prost(message, tag = "3")]
8620 ChangeEpoch(super::ChangeEpoch),
8621 #[prost(message, tag = "4")]
8626 Genesis(super::GenesisTransaction),
8627 #[prost(message, tag = "5")]
8629 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
8630 #[prost(message, tag = "6")]
8632 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
8633 #[prost(message, tag = "7")]
8636 EndOfEpoch(super::EndOfEpochTransaction),
8637 #[prost(message, tag = "8")]
8639 RandomnessStateUpdate(super::RandomnessStateUpdate),
8640 }
8641}
8642#[non_exhaustive]
8647#[derive(Clone, PartialEq, ::prost::Message)]
8648pub struct ProgrammableTransaction {
8649 #[prost(message, repeated, tag = "1")]
8651 pub inputs: ::prost::alloc::vec::Vec<Input>,
8652 #[prost(message, repeated, tag = "2")]
8655 pub commands: ::prost::alloc::vec::Vec<Command>,
8656}
8657#[non_exhaustive]
8659#[derive(Clone, PartialEq, ::prost::Message)]
8660pub struct Command {
8661 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
8662 pub command: ::core::option::Option<command::Command>,
8663}
8664pub mod command {
8666 #[non_exhaustive]
8667 #[derive(Clone, PartialEq, ::prost::Oneof)]
8668 pub enum Command {
8669 #[prost(message, tag = "1")]
8671 MoveCall(super::MoveCall),
8672 #[prost(message, tag = "2")]
8677 TransferObjects(super::TransferObjects),
8678 #[prost(message, tag = "3")]
8681 SplitCoins(super::SplitCoins),
8682 #[prost(message, tag = "4")]
8685 MergeCoins(super::MergeCoins),
8686 #[prost(message, tag = "5")]
8689 Publish(super::Publish),
8690 #[prost(message, tag = "6")]
8694 MakeMoveVector(super::MakeMoveVector),
8695 #[prost(message, tag = "7")]
8704 Upgrade(super::Upgrade),
8705 }
8706}
8707#[non_exhaustive]
8712#[derive(Clone, PartialEq, ::prost::Message)]
8713pub struct MoveCall {
8714 #[prost(string, optional, tag = "1")]
8716 pub package: ::core::option::Option<::prost::alloc::string::String>,
8717 #[prost(string, optional, tag = "2")]
8719 pub module: ::core::option::Option<::prost::alloc::string::String>,
8720 #[prost(string, optional, tag = "3")]
8722 pub function: ::core::option::Option<::prost::alloc::string::String>,
8723 #[prost(string, repeated, tag = "4")]
8725 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8726 #[prost(message, repeated, tag = "5")]
8728 pub arguments: ::prost::alloc::vec::Vec<Argument>,
8729}
8730#[non_exhaustive]
8732#[derive(Clone, PartialEq, ::prost::Message)]
8733pub struct TransferObjects {
8734 #[prost(message, repeated, tag = "1")]
8736 pub objects: ::prost::alloc::vec::Vec<Argument>,
8737 #[prost(message, optional, tag = "2")]
8739 pub address: ::core::option::Option<Argument>,
8740}
8741#[non_exhaustive]
8743#[derive(Clone, PartialEq, ::prost::Message)]
8744pub struct SplitCoins {
8745 #[prost(message, optional, tag = "1")]
8747 pub coin: ::core::option::Option<Argument>,
8748 #[prost(message, repeated, tag = "2")]
8750 pub amounts: ::prost::alloc::vec::Vec<Argument>,
8751}
8752#[non_exhaustive]
8754#[derive(Clone, PartialEq, ::prost::Message)]
8755pub struct MergeCoins {
8756 #[prost(message, optional, tag = "1")]
8758 pub coin: ::core::option::Option<Argument>,
8759 #[prost(message, repeated, tag = "2")]
8763 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
8764}
8765#[non_exhaustive]
8767#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8768pub struct Publish {
8769 #[prost(bytes = "bytes", repeated, tag = "1")]
8771 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8772 #[prost(string, repeated, tag = "2")]
8774 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8775}
8776#[non_exhaustive]
8778#[derive(Clone, PartialEq, ::prost::Message)]
8779pub struct MakeMoveVector {
8780 #[prost(string, optional, tag = "1")]
8785 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
8786 #[prost(message, repeated, tag = "2")]
8788 pub elements: ::prost::alloc::vec::Vec<Argument>,
8789}
8790#[non_exhaustive]
8792#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8793pub struct Upgrade {
8794 #[prost(bytes = "bytes", repeated, tag = "1")]
8796 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8797 #[prost(string, repeated, tag = "2")]
8799 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8800 #[prost(string, optional, tag = "3")]
8802 pub package: ::core::option::Option<::prost::alloc::string::String>,
8803 #[prost(message, optional, tag = "4")]
8805 pub ticket: ::core::option::Option<Argument>,
8806}
8807#[non_exhaustive]
8809#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8810pub struct RandomnessStateUpdate {
8811 #[prost(uint64, optional, tag = "1")]
8813 pub epoch: ::core::option::Option<u64>,
8814 #[prost(uint64, optional, tag = "2")]
8816 pub randomness_round: ::core::option::Option<u64>,
8817 #[prost(bytes = "bytes", optional, tag = "3")]
8819 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
8820 #[prost(uint64, optional, tag = "4")]
8822 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
8823}
8824#[non_exhaustive]
8826#[derive(Clone, PartialEq, ::prost::Message)]
8827pub struct ChangeEpoch {
8828 #[prost(uint64, optional, tag = "1")]
8830 pub epoch: ::core::option::Option<u64>,
8831 #[prost(uint64, optional, tag = "2")]
8833 pub protocol_version: ::core::option::Option<u64>,
8834 #[prost(uint64, optional, tag = "3")]
8836 pub storage_charge: ::core::option::Option<u64>,
8837 #[prost(uint64, optional, tag = "4")]
8839 pub computation_charge: ::core::option::Option<u64>,
8840 #[prost(uint64, optional, tag = "5")]
8842 pub storage_rebate: ::core::option::Option<u64>,
8843 #[prost(uint64, optional, tag = "6")]
8845 pub non_refundable_storage_fee: ::core::option::Option<u64>,
8846 #[prost(message, optional, tag = "7")]
8848 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8849 #[prost(message, repeated, tag = "8")]
8855 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
8856}
8857#[non_exhaustive]
8859#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8860pub struct SystemPackage {
8861 #[prost(uint64, optional, tag = "1")]
8863 pub version: ::core::option::Option<u64>,
8864 #[prost(bytes = "bytes", repeated, tag = "2")]
8866 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8867 #[prost(string, repeated, tag = "3")]
8869 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8870}
8871#[non_exhaustive]
8873#[derive(Clone, PartialEq, ::prost::Message)]
8874pub struct GenesisTransaction {
8875 #[prost(message, repeated, tag = "1")]
8877 pub objects: ::prost::alloc::vec::Vec<Object>,
8878}
8879#[non_exhaustive]
8883#[derive(Clone, PartialEq, ::prost::Message)]
8884pub struct ConsensusCommitPrologue {
8885 #[prost(uint64, optional, tag = "1")]
8889 pub epoch: ::core::option::Option<u64>,
8890 #[prost(uint64, optional, tag = "2")]
8894 pub round: ::core::option::Option<u64>,
8895 #[prost(message, optional, tag = "3")]
8899 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8900 #[prost(string, optional, tag = "4")]
8904 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
8905 #[prost(uint64, optional, tag = "5")]
8910 pub sub_dag_index: ::core::option::Option<u64>,
8911 #[prost(message, optional, tag = "6")]
8915 pub consensus_determined_version_assignments: ::core::option::Option<
8916 ConsensusDeterminedVersionAssignments,
8917 >,
8918 #[prost(string, optional, tag = "7")]
8923 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
8924}
8925#[non_exhaustive]
8927#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8928pub struct VersionAssignment {
8929 #[prost(string, optional, tag = "1")]
8931 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
8932 #[prost(uint64, optional, tag = "2")]
8934 pub start_version: ::core::option::Option<u64>,
8935 #[prost(uint64, optional, tag = "3")]
8937 pub version: ::core::option::Option<u64>,
8938}
8939#[non_exhaustive]
8941#[derive(Clone, PartialEq, ::prost::Message)]
8942pub struct CanceledTransaction {
8943 #[prost(string, optional, tag = "1")]
8945 pub digest: ::core::option::Option<::prost::alloc::string::String>,
8946 #[prost(message, repeated, tag = "2")]
8948 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
8949}
8950#[non_exhaustive]
8952#[derive(Clone, PartialEq, ::prost::Message)]
8953pub struct ConsensusDeterminedVersionAssignments {
8954 #[prost(int32, optional, tag = "1")]
8956 pub version: ::core::option::Option<i32>,
8957 #[prost(message, repeated, tag = "3")]
8959 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
8960}
8961#[non_exhaustive]
8963#[derive(Clone, PartialEq, ::prost::Message)]
8964pub struct AuthenticatorStateUpdate {
8965 #[prost(uint64, optional, tag = "1")]
8967 pub epoch: ::core::option::Option<u64>,
8968 #[prost(uint64, optional, tag = "2")]
8970 pub round: ::core::option::Option<u64>,
8971 #[prost(message, repeated, tag = "3")]
8973 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
8974 #[prost(uint64, optional, tag = "4")]
8976 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
8977}
8978#[non_exhaustive]
8980#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8981pub struct ActiveJwk {
8982 #[prost(message, optional, tag = "1")]
8984 pub id: ::core::option::Option<JwkId>,
8985 #[prost(message, optional, tag = "2")]
8987 pub jwk: ::core::option::Option<Jwk>,
8988 #[prost(uint64, optional, tag = "3")]
8990 pub epoch: ::core::option::Option<u64>,
8991}
8992#[non_exhaustive]
8995#[derive(Clone, PartialEq, ::prost::Message)]
8996pub struct EndOfEpochTransaction {
8997 #[prost(message, repeated, tag = "1")]
8998 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
8999}
9000#[non_exhaustive]
9002#[derive(Clone, PartialEq, ::prost::Message)]
9003pub struct EndOfEpochTransactionKind {
9004 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
9005 pub kind: ::core::option::Option<i32>,
9006 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
9007 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
9008}
9009pub mod end_of_epoch_transaction_kind {
9011 #[non_exhaustive]
9012 #[derive(
9013 Clone,
9014 Copy,
9015 Debug,
9016 PartialEq,
9017 Eq,
9018 Hash,
9019 PartialOrd,
9020 Ord,
9021 ::prost::Enumeration
9022 )]
9023 #[repr(i32)]
9024 pub enum Kind {
9025 Unknown = 0,
9026 ChangeEpoch = 1,
9028 AuthenticatorStateCreate = 2,
9030 AuthenticatorStateExpire = 3,
9032 RandomnessStateCreate = 4,
9034 DenyListStateCreate = 5,
9036 BridgeStateCreate = 6,
9038 BridgeCommitteeInit = 7,
9040 StoreExecutionTimeObservations = 8,
9042 AccumulatorRootCreate = 9,
9044 CoinRegistryCreate = 10,
9046 DisplayRegistryCreate = 11,
9048 AddressAliasStateCreate = 12,
9050 WriteAccumulatorStorageCost = 13,
9052 ForwardingAddressRegistryCreate = 14,
9054 }
9055 impl Kind {
9056 pub fn as_str_name(&self) -> &'static str {
9061 match self {
9062 Self::Unknown => "KIND_UNKNOWN",
9063 Self::ChangeEpoch => "CHANGE_EPOCH",
9064 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
9065 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
9066 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
9067 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
9068 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
9069 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
9070 Self::StoreExecutionTimeObservations => {
9071 "STORE_EXECUTION_TIME_OBSERVATIONS"
9072 }
9073 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
9074 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
9075 Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
9076 Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
9077 Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
9078 Self::ForwardingAddressRegistryCreate => {
9079 "FORWARDING_ADDRESS_REGISTRY_CREATE"
9080 }
9081 }
9082 }
9083 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9085 match value {
9086 "KIND_UNKNOWN" => Some(Self::Unknown),
9087 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
9088 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
9089 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
9090 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
9091 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
9092 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
9093 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
9094 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
9095 Some(Self::StoreExecutionTimeObservations)
9096 }
9097 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
9098 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
9099 "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
9100 "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
9101 "WRITE_ACCUMULATOR_STORAGE_COST" => {
9102 Some(Self::WriteAccumulatorStorageCost)
9103 }
9104 "FORWARDING_ADDRESS_REGISTRY_CREATE" => {
9105 Some(Self::ForwardingAddressRegistryCreate)
9106 }
9107 _ => None,
9108 }
9109 }
9110 }
9111 #[non_exhaustive]
9112 #[derive(Clone, PartialEq, ::prost::Oneof)]
9113 pub enum Data {
9114 #[prost(message, tag = "2")]
9116 ChangeEpoch(super::ChangeEpoch),
9117 #[prost(message, tag = "3")]
9119 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
9120 #[prost(message, tag = "4")]
9122 ExecutionTimeObservations(super::ExecutionTimeObservations),
9123 #[prost(string, tag = "5")]
9125 BridgeChainId(::prost::alloc::string::String),
9126 #[prost(uint64, tag = "6")]
9128 BridgeObjectVersion(u64),
9129 #[prost(uint64, tag = "7")]
9131 StorageCost(u64),
9132 }
9133}
9134#[non_exhaustive]
9136#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
9137pub struct AuthenticatorStateExpire {
9138 #[prost(uint64, optional, tag = "1")]
9140 pub min_epoch: ::core::option::Option<u64>,
9141 #[prost(uint64, optional, tag = "2")]
9143 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
9144}
9145#[non_exhaustive]
9146#[derive(Clone, PartialEq, ::prost::Message)]
9147pub struct ExecutionTimeObservations {
9148 #[prost(int32, optional, tag = "1")]
9150 pub version: ::core::option::Option<i32>,
9151 #[prost(message, repeated, tag = "2")]
9152 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
9153}
9154#[non_exhaustive]
9155#[derive(Clone, PartialEq, ::prost::Message)]
9156pub struct ExecutionTimeObservation {
9157 #[prost(
9158 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
9159 optional,
9160 tag = "1"
9161 )]
9162 pub kind: ::core::option::Option<i32>,
9163 #[prost(message, optional, tag = "2")]
9164 pub move_entry_point: ::core::option::Option<MoveCall>,
9165 #[prost(message, repeated, tag = "3")]
9166 pub validator_observations: ::prost::alloc::vec::Vec<
9167 ValidatorExecutionTimeObservation,
9168 >,
9169}
9170pub mod execution_time_observation {
9172 #[non_exhaustive]
9173 #[derive(
9174 Clone,
9175 Copy,
9176 Debug,
9177 PartialEq,
9178 Eq,
9179 Hash,
9180 PartialOrd,
9181 Ord,
9182 ::prost::Enumeration
9183 )]
9184 #[repr(i32)]
9185 pub enum ExecutionTimeObservationKind {
9186 Unknown = 0,
9187 MoveEntryPoint = 1,
9188 TransferObjects = 2,
9189 SplitCoins = 3,
9190 MergeCoins = 4,
9191 Publish = 5,
9192 MakeMoveVector = 6,
9193 Upgrade = 7,
9194 }
9195 impl ExecutionTimeObservationKind {
9196 pub fn as_str_name(&self) -> &'static str {
9201 match self {
9202 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
9203 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
9204 Self::TransferObjects => "TRANSFER_OBJECTS",
9205 Self::SplitCoins => "SPLIT_COINS",
9206 Self::MergeCoins => "MERGE_COINS",
9207 Self::Publish => "PUBLISH",
9208 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
9209 Self::Upgrade => "UPGRADE",
9210 }
9211 }
9212 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9214 match value {
9215 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
9216 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
9217 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
9218 "SPLIT_COINS" => Some(Self::SplitCoins),
9219 "MERGE_COINS" => Some(Self::MergeCoins),
9220 "PUBLISH" => Some(Self::Publish),
9221 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
9222 "UPGRADE" => Some(Self::Upgrade),
9223 _ => None,
9224 }
9225 }
9226 }
9227}
9228#[non_exhaustive]
9229#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9230pub struct ValidatorExecutionTimeObservation {
9231 #[prost(bytes = "bytes", optional, tag = "1")]
9233 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
9234 #[prost(message, optional, tag = "2")]
9236 pub duration: ::core::option::Option<::prost_types::Duration>,
9237}
9238#[non_exhaustive]
9239#[derive(Clone, PartialEq, ::prost::Message)]
9240pub struct ExecuteTransactionRequest {
9241 #[prost(message, optional, tag = "1")]
9243 pub transaction: ::core::option::Option<Transaction>,
9244 #[prost(message, repeated, tag = "2")]
9247 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
9248 #[prost(message, optional, tag = "3")]
9251 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9252}
9253#[non_exhaustive]
9255#[derive(Clone, PartialEq, ::prost::Message)]
9256pub struct ExecuteTransactionResponse {
9257 #[prost(message, optional, tag = "1")]
9258 pub transaction: ::core::option::Option<ExecutedTransaction>,
9259}
9260#[non_exhaustive]
9261#[derive(Clone, PartialEq, ::prost::Message)]
9262pub struct SimulateTransactionRequest {
9263 #[prost(message, optional, tag = "1")]
9264 pub transaction: ::core::option::Option<Transaction>,
9265 #[prost(message, optional, tag = "2")]
9267 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9268 #[prost(
9270 enumeration = "simulate_transaction_request::TransactionChecks",
9271 optional,
9272 tag = "3"
9273 )]
9274 pub checks: ::core::option::Option<i32>,
9275 #[prost(bool, optional, tag = "4")]
9284 pub do_gas_selection: ::core::option::Option<bool>,
9285}
9286pub mod simulate_transaction_request {
9288 #[non_exhaustive]
9290 #[derive(
9291 Clone,
9292 Copy,
9293 Debug,
9294 PartialEq,
9295 Eq,
9296 Hash,
9297 PartialOrd,
9298 Ord,
9299 ::prost::Enumeration
9300 )]
9301 #[repr(i32)]
9302 pub enum TransactionChecks {
9303 Enabled = 0,
9304 Disabled = 1,
9305 }
9306 impl TransactionChecks {
9307 pub fn as_str_name(&self) -> &'static str {
9312 match self {
9313 Self::Enabled => "ENABLED",
9314 Self::Disabled => "DISABLED",
9315 }
9316 }
9317 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9319 match value {
9320 "ENABLED" => Some(Self::Enabled),
9321 "DISABLED" => Some(Self::Disabled),
9322 _ => None,
9323 }
9324 }
9325 }
9326}
9327#[non_exhaustive]
9328#[derive(Clone, PartialEq, ::prost::Message)]
9329pub struct SimulateTransactionResponse {
9330 #[prost(message, optional, tag = "1")]
9331 pub transaction: ::core::option::Option<ExecutedTransaction>,
9332 #[prost(message, repeated, tag = "2")]
9333 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
9334 #[prost(uint64, optional, tag = "3")]
9338 pub suggested_gas_price: ::core::option::Option<u64>,
9339}
9340#[non_exhaustive]
9342#[derive(Clone, PartialEq, ::prost::Message)]
9343pub struct CommandResult {
9344 #[prost(message, repeated, tag = "1")]
9345 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
9346 #[prost(message, repeated, tag = "2")]
9347 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
9348}
9349#[non_exhaustive]
9350#[derive(Clone, PartialEq, ::prost::Message)]
9351pub struct CommandOutput {
9352 #[prost(message, optional, tag = "1")]
9353 pub argument: ::core::option::Option<Argument>,
9354 #[prost(message, optional, tag = "2")]
9355 pub value: ::core::option::Option<Bcs>,
9356 #[prost(message, optional, boxed, tag = "3")]
9358 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
9359}
9360pub mod transaction_execution_service_client {
9362 #![allow(
9363 unused_variables,
9364 dead_code,
9365 missing_docs,
9366 clippy::wildcard_imports,
9367 clippy::let_unit_value,
9368 )]
9369 use tonic::codegen::*;
9370 use tonic::codegen::http::Uri;
9371 #[derive(Debug, Clone)]
9372 pub struct TransactionExecutionServiceClient<T> {
9373 inner: tonic::client::Grpc<T>,
9374 }
9375 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
9376 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9378 where
9379 D: TryInto<tonic::transport::Endpoint>,
9380 D::Error: Into<StdError>,
9381 {
9382 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9383 Ok(Self::new(conn))
9384 }
9385 }
9386 impl<T> TransactionExecutionServiceClient<T>
9387 where
9388 T: tonic::client::GrpcService<tonic::body::Body>,
9389 T::Error: Into<StdError>,
9390 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9391 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9392 {
9393 pub fn new(inner: T) -> Self {
9394 let inner = tonic::client::Grpc::new(inner);
9395 Self { inner }
9396 }
9397 pub fn with_origin(inner: T, origin: Uri) -> Self {
9398 let inner = tonic::client::Grpc::with_origin(inner, origin);
9399 Self { inner }
9400 }
9401 pub fn with_interceptor<F>(
9402 inner: T,
9403 interceptor: F,
9404 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
9405 where
9406 F: tonic::service::Interceptor,
9407 T::ResponseBody: Default,
9408 T: tonic::codegen::Service<
9409 http::Request<tonic::body::Body>,
9410 Response = http::Response<
9411 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9412 >,
9413 >,
9414 <T as tonic::codegen::Service<
9415 http::Request<tonic::body::Body>,
9416 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9417 {
9418 TransactionExecutionServiceClient::new(
9419 InterceptedService::new(inner, interceptor),
9420 )
9421 }
9422 #[must_use]
9427 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9428 self.inner = self.inner.send_compressed(encoding);
9429 self
9430 }
9431 #[must_use]
9433 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9434 self.inner = self.inner.accept_compressed(encoding);
9435 self
9436 }
9437 #[must_use]
9441 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9442 self.inner = self.inner.max_decoding_message_size(limit);
9443 self
9444 }
9445 #[must_use]
9449 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9450 self.inner = self.inner.max_encoding_message_size(limit);
9451 self
9452 }
9453 pub async fn execute_transaction(
9454 &mut self,
9455 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
9456 ) -> std::result::Result<
9457 tonic::Response<super::ExecuteTransactionResponse>,
9458 tonic::Status,
9459 > {
9460 self.inner
9461 .ready()
9462 .await
9463 .map_err(|e| {
9464 tonic::Status::unknown(
9465 format!("Service was not ready: {}", e.into()),
9466 )
9467 })?;
9468 let codec = tonic_prost::ProstCodec::default();
9469 let path = http::uri::PathAndQuery::from_static(
9470 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
9471 );
9472 let mut req = request.into_request();
9473 req.extensions_mut()
9474 .insert(
9475 GrpcMethod::new(
9476 "sui.rpc.v2.TransactionExecutionService",
9477 "ExecuteTransaction",
9478 ),
9479 );
9480 self.inner.unary(req, path, codec).await
9481 }
9482 pub async fn simulate_transaction(
9483 &mut self,
9484 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
9485 ) -> std::result::Result<
9486 tonic::Response<super::SimulateTransactionResponse>,
9487 tonic::Status,
9488 > {
9489 self.inner
9490 .ready()
9491 .await
9492 .map_err(|e| {
9493 tonic::Status::unknown(
9494 format!("Service was not ready: {}", e.into()),
9495 )
9496 })?;
9497 let codec = tonic_prost::ProstCodec::default();
9498 let path = http::uri::PathAndQuery::from_static(
9499 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
9500 );
9501 let mut req = request.into_request();
9502 req.extensions_mut()
9503 .insert(
9504 GrpcMethod::new(
9505 "sui.rpc.v2.TransactionExecutionService",
9506 "SimulateTransaction",
9507 ),
9508 );
9509 self.inner.unary(req, path, codec).await
9510 }
9511 }
9512}
9513pub mod transaction_execution_service_server {
9515 #![allow(
9516 unused_variables,
9517 dead_code,
9518 missing_docs,
9519 clippy::wildcard_imports,
9520 clippy::let_unit_value,
9521 )]
9522 use tonic::codegen::*;
9523 #[async_trait]
9525 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
9526 async fn execute_transaction(
9527 &self,
9528 request: tonic::Request<super::ExecuteTransactionRequest>,
9529 ) -> std::result::Result<
9530 tonic::Response<super::ExecuteTransactionResponse>,
9531 tonic::Status,
9532 > {
9533 Err(tonic::Status::unimplemented("Not yet implemented"))
9534 }
9535 async fn simulate_transaction(
9536 &self,
9537 request: tonic::Request<super::SimulateTransactionRequest>,
9538 ) -> std::result::Result<
9539 tonic::Response<super::SimulateTransactionResponse>,
9540 tonic::Status,
9541 > {
9542 Err(tonic::Status::unimplemented("Not yet implemented"))
9543 }
9544 }
9545 #[derive(Debug)]
9546 pub struct TransactionExecutionServiceServer<T> {
9547 inner: Arc<T>,
9548 accept_compression_encodings: EnabledCompressionEncodings,
9549 send_compression_encodings: EnabledCompressionEncodings,
9550 max_decoding_message_size: Option<usize>,
9551 max_encoding_message_size: Option<usize>,
9552 }
9553 impl<T> TransactionExecutionServiceServer<T> {
9554 pub fn new(inner: T) -> Self {
9555 Self::from_arc(Arc::new(inner))
9556 }
9557 pub fn from_arc(inner: Arc<T>) -> Self {
9558 Self {
9559 inner,
9560 accept_compression_encodings: Default::default(),
9561 send_compression_encodings: Default::default(),
9562 max_decoding_message_size: None,
9563 max_encoding_message_size: None,
9564 }
9565 }
9566 pub fn with_interceptor<F>(
9567 inner: T,
9568 interceptor: F,
9569 ) -> InterceptedService<Self, F>
9570 where
9571 F: tonic::service::Interceptor,
9572 {
9573 InterceptedService::new(Self::new(inner), interceptor)
9574 }
9575 #[must_use]
9577 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9578 self.accept_compression_encodings.enable(encoding);
9579 self
9580 }
9581 #[must_use]
9583 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9584 self.send_compression_encodings.enable(encoding);
9585 self
9586 }
9587 #[must_use]
9591 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9592 self.max_decoding_message_size = Some(limit);
9593 self
9594 }
9595 #[must_use]
9599 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9600 self.max_encoding_message_size = Some(limit);
9601 self
9602 }
9603 }
9604 impl<T, B> tonic::codegen::Service<http::Request<B>>
9605 for TransactionExecutionServiceServer<T>
9606 where
9607 T: TransactionExecutionService,
9608 B: Body + std::marker::Send + 'static,
9609 B::Error: Into<StdError> + std::marker::Send + 'static,
9610 {
9611 type Response = http::Response<tonic::body::Body>;
9612 type Error = std::convert::Infallible;
9613 type Future = BoxFuture<Self::Response, Self::Error>;
9614 fn poll_ready(
9615 &mut self,
9616 _cx: &mut Context<'_>,
9617 ) -> Poll<std::result::Result<(), Self::Error>> {
9618 Poll::Ready(Ok(()))
9619 }
9620 fn call(&mut self, req: http::Request<B>) -> Self::Future {
9621 match req.uri().path() {
9622 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
9623 #[allow(non_camel_case_types)]
9624 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
9625 pub Arc<T>,
9626 );
9627 impl<
9628 T: TransactionExecutionService,
9629 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
9630 for ExecuteTransactionSvc<T> {
9631 type Response = super::ExecuteTransactionResponse;
9632 type Future = BoxFuture<
9633 tonic::Response<Self::Response>,
9634 tonic::Status,
9635 >;
9636 fn call(
9637 &mut self,
9638 request: tonic::Request<super::ExecuteTransactionRequest>,
9639 ) -> Self::Future {
9640 let inner = Arc::clone(&self.0);
9641 let fut = async move {
9642 <T as TransactionExecutionService>::execute_transaction(
9643 &inner,
9644 request,
9645 )
9646 .await
9647 };
9648 Box::pin(fut)
9649 }
9650 }
9651 let accept_compression_encodings = self.accept_compression_encodings;
9652 let send_compression_encodings = self.send_compression_encodings;
9653 let max_decoding_message_size = self.max_decoding_message_size;
9654 let max_encoding_message_size = self.max_encoding_message_size;
9655 let inner = self.inner.clone();
9656 let fut = async move {
9657 let method = ExecuteTransactionSvc(inner);
9658 let codec = tonic_prost::ProstCodec::default();
9659 let mut grpc = tonic::server::Grpc::new(codec)
9660 .apply_compression_config(
9661 accept_compression_encodings,
9662 send_compression_encodings,
9663 )
9664 .apply_max_message_size_config(
9665 max_decoding_message_size,
9666 max_encoding_message_size,
9667 );
9668 let res = grpc.unary(method, req).await;
9669 Ok(res)
9670 };
9671 Box::pin(fut)
9672 }
9673 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
9674 #[allow(non_camel_case_types)]
9675 struct SimulateTransactionSvc<T: TransactionExecutionService>(
9676 pub Arc<T>,
9677 );
9678 impl<
9679 T: TransactionExecutionService,
9680 > tonic::server::UnaryService<super::SimulateTransactionRequest>
9681 for SimulateTransactionSvc<T> {
9682 type Response = super::SimulateTransactionResponse;
9683 type Future = BoxFuture<
9684 tonic::Response<Self::Response>,
9685 tonic::Status,
9686 >;
9687 fn call(
9688 &mut self,
9689 request: tonic::Request<super::SimulateTransactionRequest>,
9690 ) -> Self::Future {
9691 let inner = Arc::clone(&self.0);
9692 let fut = async move {
9693 <T as TransactionExecutionService>::simulate_transaction(
9694 &inner,
9695 request,
9696 )
9697 .await
9698 };
9699 Box::pin(fut)
9700 }
9701 }
9702 let accept_compression_encodings = self.accept_compression_encodings;
9703 let send_compression_encodings = self.send_compression_encodings;
9704 let max_decoding_message_size = self.max_decoding_message_size;
9705 let max_encoding_message_size = self.max_encoding_message_size;
9706 let inner = self.inner.clone();
9707 let fut = async move {
9708 let method = SimulateTransactionSvc(inner);
9709 let codec = tonic_prost::ProstCodec::default();
9710 let mut grpc = tonic::server::Grpc::new(codec)
9711 .apply_compression_config(
9712 accept_compression_encodings,
9713 send_compression_encodings,
9714 )
9715 .apply_max_message_size_config(
9716 max_decoding_message_size,
9717 max_encoding_message_size,
9718 );
9719 let res = grpc.unary(method, req).await;
9720 Ok(res)
9721 };
9722 Box::pin(fut)
9723 }
9724 _ => {
9725 Box::pin(async move {
9726 let mut response = http::Response::new(
9727 tonic::body::Body::default(),
9728 );
9729 let headers = response.headers_mut();
9730 headers
9731 .insert(
9732 tonic::Status::GRPC_STATUS,
9733 (tonic::Code::Unimplemented as i32).into(),
9734 );
9735 headers
9736 .insert(
9737 http::header::CONTENT_TYPE,
9738 tonic::metadata::GRPC_CONTENT_TYPE,
9739 );
9740 Ok(response)
9741 })
9742 }
9743 }
9744 }
9745 }
9746 impl<T> Clone for TransactionExecutionServiceServer<T> {
9747 fn clone(&self) -> Self {
9748 let inner = self.inner.clone();
9749 Self {
9750 inner,
9751 accept_compression_encodings: self.accept_compression_encodings,
9752 send_compression_encodings: self.send_compression_encodings,
9753 max_decoding_message_size: self.max_decoding_message_size,
9754 max_encoding_message_size: self.max_encoding_message_size,
9755 }
9756 }
9757 }
9758 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
9760 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
9761 const NAME: &'static str = SERVICE_NAME;
9762 }
9763}