1#[non_exhaustive]
4#[derive(Clone, Copy, PartialEq, ::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, ::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, ::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}
158#[non_exhaustive]
178#[derive(Clone, PartialEq, ::prost::Message)]
179pub struct CheckpointSummary {
180 #[prost(message, optional, tag = "1")]
182 pub bcs: ::core::option::Option<Bcs>,
183 #[prost(string, optional, tag = "2")]
185 pub digest: ::core::option::Option<::prost::alloc::string::String>,
186 #[prost(uint64, optional, tag = "3")]
188 pub epoch: ::core::option::Option<u64>,
189 #[prost(uint64, optional, tag = "4")]
191 pub sequence_number: ::core::option::Option<u64>,
192 #[prost(uint64, optional, tag = "5")]
195 pub total_network_transactions: ::core::option::Option<u64>,
196 #[prost(string, optional, tag = "6")]
198 pub content_digest: ::core::option::Option<::prost::alloc::string::String>,
199 #[prost(string, optional, tag = "7")]
203 pub previous_digest: ::core::option::Option<::prost::alloc::string::String>,
204 #[prost(message, optional, tag = "8")]
207 pub epoch_rolling_gas_cost_summary: ::core::option::Option<GasCostSummary>,
208 #[prost(message, optional, tag = "9")]
212 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
213 #[prost(message, repeated, tag = "10")]
215 pub commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
216 #[prost(message, optional, tag = "11")]
218 pub end_of_epoch_data: ::core::option::Option<EndOfEpochData>,
219 #[prost(bytes = "bytes", optional, tag = "12")]
224 pub version_specific_data: ::core::option::Option<::prost::bytes::Bytes>,
225}
226#[non_exhaustive]
228#[derive(Clone, PartialEq, ::prost::Message)]
229pub struct EndOfEpochData {
230 #[prost(message, repeated, tag = "1")]
232 pub next_epoch_committee: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
233 #[prost(uint64, optional, tag = "2")]
235 pub next_epoch_protocol_version: ::core::option::Option<u64>,
236 #[prost(message, repeated, tag = "3")]
238 pub epoch_commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
239}
240#[non_exhaustive]
242#[derive(Clone, PartialEq, ::prost::Message)]
243pub struct CheckpointCommitment {
244 #[prost(
245 enumeration = "checkpoint_commitment::CheckpointCommitmentKind",
246 optional,
247 tag = "1"
248 )]
249 pub kind: ::core::option::Option<i32>,
250 #[prost(string, optional, tag = "2")]
251 pub digest: ::core::option::Option<::prost::alloc::string::String>,
252}
253pub mod checkpoint_commitment {
255 #[non_exhaustive]
256 #[derive(
257 Clone,
258 Copy,
259 Debug,
260 PartialEq,
261 Eq,
262 Hash,
263 PartialOrd,
264 Ord,
265 ::prost::Enumeration
266 )]
267 #[repr(i32)]
268 pub enum CheckpointCommitmentKind {
269 Unknown = 0,
270 EcmhLiveObjectSet = 1,
273 CheckpointArtifacts = 2,
275 }
276 impl CheckpointCommitmentKind {
277 pub fn as_str_name(&self) -> &'static str {
282 match self {
283 Self::Unknown => "CHECKPOINT_COMMITMENT_KIND_UNKNOWN",
284 Self::EcmhLiveObjectSet => "ECMH_LIVE_OBJECT_SET",
285 Self::CheckpointArtifacts => "CHECKPOINT_ARTIFACTS",
286 }
287 }
288 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
290 match value {
291 "CHECKPOINT_COMMITMENT_KIND_UNKNOWN" => Some(Self::Unknown),
292 "ECMH_LIVE_OBJECT_SET" => Some(Self::EcmhLiveObjectSet),
293 "CHECKPOINT_ARTIFACTS" => Some(Self::CheckpointArtifacts),
294 _ => None,
295 }
296 }
297 }
298}
299#[non_exhaustive]
301#[derive(Clone, PartialEq, ::prost::Message)]
302pub struct TransactionEffects {
303 #[prost(message, optional, tag = "1")]
305 pub bcs: ::core::option::Option<Bcs>,
306 #[prost(string, optional, tag = "2")]
308 pub digest: ::core::option::Option<::prost::alloc::string::String>,
309 #[prost(int32, optional, tag = "3")]
311 pub version: ::core::option::Option<i32>,
312 #[prost(message, optional, tag = "4")]
314 pub status: ::core::option::Option<ExecutionStatus>,
315 #[prost(uint64, optional, tag = "5")]
317 pub epoch: ::core::option::Option<u64>,
318 #[prost(message, optional, tag = "6")]
320 pub gas_used: ::core::option::Option<GasCostSummary>,
321 #[prost(string, optional, tag = "7")]
323 pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
324 #[prost(message, optional, tag = "8")]
328 pub gas_object: ::core::option::Option<ChangedObject>,
329 #[prost(string, optional, tag = "9")]
332 pub events_digest: ::core::option::Option<::prost::alloc::string::String>,
333 #[prost(string, repeated, tag = "10")]
335 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
336 #[prost(uint64, optional, tag = "11")]
338 pub lamport_version: ::core::option::Option<u64>,
339 #[prost(message, repeated, tag = "12")]
341 pub changed_objects: ::prost::alloc::vec::Vec<ChangedObject>,
342 #[prost(message, repeated, tag = "13")]
347 pub unchanged_consensus_objects: ::prost::alloc::vec::Vec<UnchangedConsensusObject>,
348 #[prost(string, optional, tag = "14")]
352 pub auxiliary_data_digest: ::core::option::Option<::prost::alloc::string::String>,
353 #[prost(message, repeated, tag = "15")]
354 pub unchanged_loaded_runtime_objects: ::prost::alloc::vec::Vec<ObjectReference>,
355}
356#[non_exhaustive]
358#[derive(Clone, PartialEq, ::prost::Message)]
359pub struct ChangedObject {
360 #[prost(string, optional, tag = "1")]
362 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
363 #[prost(enumeration = "changed_object::InputObjectState", optional, tag = "2")]
364 pub input_state: ::core::option::Option<i32>,
365 #[prost(uint64, optional, tag = "3")]
367 pub input_version: ::core::option::Option<u64>,
368 #[prost(string, optional, tag = "4")]
370 pub input_digest: ::core::option::Option<::prost::alloc::string::String>,
371 #[prost(message, optional, tag = "5")]
373 pub input_owner: ::core::option::Option<Owner>,
374 #[prost(enumeration = "changed_object::OutputObjectState", optional, tag = "6")]
375 pub output_state: ::core::option::Option<i32>,
376 #[prost(uint64, optional, tag = "7")]
378 pub output_version: ::core::option::Option<u64>,
379 #[prost(string, optional, tag = "8")]
381 pub output_digest: ::core::option::Option<::prost::alloc::string::String>,
382 #[prost(message, optional, tag = "9")]
384 pub output_owner: ::core::option::Option<Owner>,
385 #[prost(enumeration = "changed_object::IdOperation", optional, tag = "10")]
387 pub id_operation: ::core::option::Option<i32>,
388 #[prost(string, optional, tag = "11")]
391 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
392}
393pub mod changed_object {
395 #[non_exhaustive]
396 #[derive(
397 Clone,
398 Copy,
399 Debug,
400 PartialEq,
401 Eq,
402 Hash,
403 PartialOrd,
404 Ord,
405 ::prost::Enumeration
406 )]
407 #[repr(i32)]
408 pub enum InputObjectState {
409 Unknown = 0,
410 DoesNotExist = 1,
411 Exists = 2,
412 }
413 impl InputObjectState {
414 pub fn as_str_name(&self) -> &'static str {
419 match self {
420 Self::Unknown => "INPUT_OBJECT_STATE_UNKNOWN",
421 Self::DoesNotExist => "INPUT_OBJECT_STATE_DOES_NOT_EXIST",
422 Self::Exists => "INPUT_OBJECT_STATE_EXISTS",
423 }
424 }
425 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
427 match value {
428 "INPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
429 "INPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
430 "INPUT_OBJECT_STATE_EXISTS" => Some(Self::Exists),
431 _ => None,
432 }
433 }
434 }
435 #[non_exhaustive]
436 #[derive(
437 Clone,
438 Copy,
439 Debug,
440 PartialEq,
441 Eq,
442 Hash,
443 PartialOrd,
444 Ord,
445 ::prost::Enumeration
446 )]
447 #[repr(i32)]
448 pub enum OutputObjectState {
449 Unknown = 0,
450 DoesNotExist = 1,
451 ObjectWrite = 2,
452 PackageWrite = 3,
453 }
454 impl OutputObjectState {
455 pub fn as_str_name(&self) -> &'static str {
460 match self {
461 Self::Unknown => "OUTPUT_OBJECT_STATE_UNKNOWN",
462 Self::DoesNotExist => "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST",
463 Self::ObjectWrite => "OUTPUT_OBJECT_STATE_OBJECT_WRITE",
464 Self::PackageWrite => "OUTPUT_OBJECT_STATE_PACKAGE_WRITE",
465 }
466 }
467 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
469 match value {
470 "OUTPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
471 "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
472 "OUTPUT_OBJECT_STATE_OBJECT_WRITE" => Some(Self::ObjectWrite),
473 "OUTPUT_OBJECT_STATE_PACKAGE_WRITE" => Some(Self::PackageWrite),
474 _ => None,
475 }
476 }
477 }
478 #[non_exhaustive]
479 #[derive(
480 Clone,
481 Copy,
482 Debug,
483 PartialEq,
484 Eq,
485 Hash,
486 PartialOrd,
487 Ord,
488 ::prost::Enumeration
489 )]
490 #[repr(i32)]
491 pub enum IdOperation {
492 Unknown = 0,
493 None = 1,
494 Created = 2,
495 Deleted = 3,
496 }
497 impl IdOperation {
498 pub fn as_str_name(&self) -> &'static str {
503 match self {
504 Self::Unknown => "ID_OPERATION_UNKNOWN",
505 Self::None => "NONE",
506 Self::Created => "CREATED",
507 Self::Deleted => "DELETED",
508 }
509 }
510 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
512 match value {
513 "ID_OPERATION_UNKNOWN" => Some(Self::Unknown),
514 "NONE" => Some(Self::None),
515 "CREATED" => Some(Self::Created),
516 "DELETED" => Some(Self::Deleted),
517 _ => None,
518 }
519 }
520 }
521}
522#[non_exhaustive]
524#[derive(Clone, PartialEq, ::prost::Message)]
525pub struct UnchangedConsensusObject {
526 #[prost(
527 enumeration = "unchanged_consensus_object::UnchangedConsensusObjectKind",
528 optional,
529 tag = "1"
530 )]
531 pub kind: ::core::option::Option<i32>,
532 #[prost(string, optional, tag = "2")]
534 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
535 #[prost(uint64, optional, tag = "3")]
537 pub version: ::core::option::Option<u64>,
538 #[prost(string, optional, tag = "4")]
540 pub digest: ::core::option::Option<::prost::alloc::string::String>,
541 #[prost(string, optional, tag = "5")]
544 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
545}
546pub mod unchanged_consensus_object {
548 #[non_exhaustive]
549 #[derive(
550 Clone,
551 Copy,
552 Debug,
553 PartialEq,
554 Eq,
555 Hash,
556 PartialOrd,
557 Ord,
558 ::prost::Enumeration
559 )]
560 #[repr(i32)]
561 pub enum UnchangedConsensusObjectKind {
562 Unknown = 0,
563 ReadOnlyRoot = 1,
565 MutateConsensusStreamEnded = 2,
567 ReadConsensusStreamEnded = 3,
569 Canceled = 4,
572 PerEpochConfig = 5,
576 }
577 impl UnchangedConsensusObjectKind {
578 pub fn as_str_name(&self) -> &'static str {
583 match self {
584 Self::Unknown => "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN",
585 Self::ReadOnlyRoot => "READ_ONLY_ROOT",
586 Self::MutateConsensusStreamEnded => "MUTATE_CONSENSUS_STREAM_ENDED",
587 Self::ReadConsensusStreamEnded => "READ_CONSENSUS_STREAM_ENDED",
588 Self::Canceled => "CANCELED",
589 Self::PerEpochConfig => "PER_EPOCH_CONFIG",
590 }
591 }
592 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
594 match value {
595 "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN" => Some(Self::Unknown),
596 "READ_ONLY_ROOT" => Some(Self::ReadOnlyRoot),
597 "MUTATE_CONSENSUS_STREAM_ENDED" => Some(Self::MutateConsensusStreamEnded),
598 "READ_CONSENSUS_STREAM_ENDED" => Some(Self::ReadConsensusStreamEnded),
599 "CANCELED" => Some(Self::Canceled),
600 "PER_EPOCH_CONFIG" => Some(Self::PerEpochConfig),
601 _ => None,
602 }
603 }
604 }
605}
606#[non_exhaustive]
607#[derive(Clone, PartialEq, ::prost::Message)]
608pub struct Epoch {
609 #[prost(uint64, optional, tag = "1")]
610 pub epoch: ::core::option::Option<u64>,
611 #[prost(message, optional, tag = "2")]
613 pub committee: ::core::option::Option<ValidatorCommittee>,
614 #[prost(message, optional, boxed, tag = "3")]
618 pub system_state: ::core::option::Option<::prost::alloc::boxed::Box<SystemState>>,
619 #[prost(uint64, optional, tag = "4")]
620 pub first_checkpoint: ::core::option::Option<u64>,
621 #[prost(uint64, optional, tag = "5")]
622 pub last_checkpoint: ::core::option::Option<u64>,
623 #[prost(message, optional, tag = "6")]
624 pub start: ::core::option::Option<::prost_types::Timestamp>,
625 #[prost(message, optional, tag = "7")]
626 pub end: ::core::option::Option<::prost_types::Timestamp>,
627 #[prost(uint64, optional, tag = "8")]
629 pub reference_gas_price: ::core::option::Option<u64>,
630 #[prost(message, optional, tag = "9")]
631 pub protocol_config: ::core::option::Option<ProtocolConfig>,
632}
633#[non_exhaustive]
634#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
635#[repr(i32)]
636pub enum ErrorReason {
637 Unknown = 0,
638 FieldInvalid = 1,
639 FieldMissing = 2,
640}
641impl ErrorReason {
642 pub fn as_str_name(&self) -> &'static str {
647 match self {
648 Self::Unknown => "ERROR_REASON_UNKNOWN",
649 Self::FieldInvalid => "FIELD_INVALID",
650 Self::FieldMissing => "FIELD_MISSING",
651 }
652 }
653 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
655 match value {
656 "ERROR_REASON_UNKNOWN" => Some(Self::Unknown),
657 "FIELD_INVALID" => Some(Self::FieldInvalid),
658 "FIELD_MISSING" => Some(Self::FieldMissing),
659 _ => None,
660 }
661 }
662}
663#[non_exhaustive]
665#[derive(Clone, PartialEq, ::prost::Message)]
666pub struct TransactionEvents {
667 #[prost(message, optional, tag = "1")]
669 pub bcs: ::core::option::Option<Bcs>,
670 #[prost(string, optional, tag = "2")]
672 pub digest: ::core::option::Option<::prost::alloc::string::String>,
673 #[prost(message, repeated, tag = "3")]
675 pub events: ::prost::alloc::vec::Vec<Event>,
676}
677#[non_exhaustive]
679#[derive(Clone, PartialEq, ::prost::Message)]
680pub struct Event {
681 #[prost(string, optional, tag = "1")]
684 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
685 #[prost(string, optional, tag = "2")]
688 pub module: ::core::option::Option<::prost::alloc::string::String>,
689 #[prost(string, optional, tag = "3")]
691 pub sender: ::core::option::Option<::prost::alloc::string::String>,
692 #[prost(string, optional, tag = "4")]
694 pub event_type: ::core::option::Option<::prost::alloc::string::String>,
695 #[prost(message, optional, tag = "5")]
697 pub contents: ::core::option::Option<Bcs>,
698 #[prost(message, optional, boxed, tag = "6")]
700 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
701}
702#[non_exhaustive]
703#[derive(Clone, PartialEq, ::prost::Message)]
704pub struct ExecutedTransaction {
705 #[prost(string, optional, tag = "1")]
707 pub digest: ::core::option::Option<::prost::alloc::string::String>,
708 #[prost(message, optional, tag = "2")]
710 pub transaction: ::core::option::Option<Transaction>,
711 #[prost(message, repeated, tag = "3")]
714 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
715 #[prost(message, optional, tag = "4")]
717 pub effects: ::core::option::Option<TransactionEffects>,
718 #[prost(message, optional, tag = "5")]
725 pub events: ::core::option::Option<TransactionEvents>,
726 #[prost(uint64, optional, tag = "6")]
728 pub checkpoint: ::core::option::Option<u64>,
729 #[prost(message, optional, tag = "7")]
731 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
732 #[prost(message, repeated, tag = "8")]
733 pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
734 #[prost(message, optional, tag = "9")]
737 pub objects: ::core::option::Option<ObjectSet>,
738}
739#[non_exhaustive]
741#[derive(Clone, PartialEq, ::prost::Message)]
742pub struct ExecutionStatus {
743 #[prost(bool, optional, tag = "1")]
745 pub success: ::core::option::Option<bool>,
746 #[prost(message, optional, tag = "2")]
748 pub error: ::core::option::Option<ExecutionError>,
749}
750#[non_exhaustive]
752#[derive(Clone, PartialEq, ::prost::Message)]
753pub struct ExecutionError {
754 #[prost(string, optional, tag = "1")]
756 pub description: ::core::option::Option<::prost::alloc::string::String>,
757 #[prost(uint64, optional, tag = "2")]
759 pub command: ::core::option::Option<u64>,
760 #[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
761 pub kind: ::core::option::Option<i32>,
762 #[prost(
763 oneof = "execution_error::ErrorDetails",
764 tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
765 )]
766 pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
767}
768pub mod execution_error {
770 #[non_exhaustive]
771 #[derive(
772 Clone,
773 Copy,
774 Debug,
775 PartialEq,
776 Eq,
777 Hash,
778 PartialOrd,
779 Ord,
780 ::prost::Enumeration
781 )]
782 #[repr(i32)]
783 pub enum ExecutionErrorKind {
784 Unknown = 0,
785 InsufficientGas = 1,
787 InvalidGasObject = 2,
789 InvariantViolation = 3,
791 FeatureNotYetSupported = 4,
793 ObjectTooBig = 5,
795 PackageTooBig = 6,
797 CircularObjectOwnership = 7,
799 InsufficientCoinBalance = 8,
801 CoinBalanceOverflow = 9,
803 PublishErrorNonZeroAddress = 10,
806 SuiMoveVerificationError = 11,
808 MovePrimitiveRuntimeError = 12,
812 MoveAbort = 13,
814 VmVerificationOrDeserializationError = 14,
816 VmInvariantViolation = 15,
818 FunctionNotFound = 16,
820 ArityMismatch = 17,
823 TypeArityMismatch = 18,
826 NonEntryFunctionInvoked = 19,
828 CommandArgumentError = 20,
830 TypeArgumentError = 21,
832 UnusedValueWithoutDrop = 22,
834 InvalidPublicFunctionReturnType = 23,
837 InvalidTransferObject = 24,
839 EffectsTooLarge = 25,
841 PublishUpgradeMissingDependency = 26,
843 PublishUpgradeDependencyDowngrade = 27,
849 PackageUpgradeError = 28,
851 WrittenObjectsTooLarge = 29,
853 CertificateDenied = 30,
855 SuiMoveVerificationTimedout = 31,
857 ConsensusObjectOperationNotAllowed = 32,
859 InputObjectDeleted = 33,
861 ExecutionCanceledDueToConsensusObjectCongestion = 34,
863 AddressDeniedForCoin = 35,
865 CoinTypeGlobalPause = 36,
867 ExecutionCanceledDueToRandomnessUnavailable = 37,
869 MoveVectorElemTooBig = 38,
870 MoveRawValueTooBig = 39,
871 InvalidLinkage = 40,
872 }
873 impl ExecutionErrorKind {
874 pub fn as_str_name(&self) -> &'static str {
879 match self {
880 Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
881 Self::InsufficientGas => "INSUFFICIENT_GAS",
882 Self::InvalidGasObject => "INVALID_GAS_OBJECT",
883 Self::InvariantViolation => "INVARIANT_VIOLATION",
884 Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
885 Self::ObjectTooBig => "OBJECT_TOO_BIG",
886 Self::PackageTooBig => "PACKAGE_TOO_BIG",
887 Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
888 Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
889 Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
890 Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
891 Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
892 Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
893 Self::MoveAbort => "MOVE_ABORT",
894 Self::VmVerificationOrDeserializationError => {
895 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
896 }
897 Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
898 Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
899 Self::ArityMismatch => "ARITY_MISMATCH",
900 Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
901 Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
902 Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
903 Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
904 Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
905 Self::InvalidPublicFunctionReturnType => {
906 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
907 }
908 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
909 Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
910 Self::PublishUpgradeMissingDependency => {
911 "PUBLISH_UPGRADE_MISSING_DEPENDENCY"
912 }
913 Self::PublishUpgradeDependencyDowngrade => {
914 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
915 }
916 Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
917 Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
918 Self::CertificateDenied => "CERTIFICATE_DENIED",
919 Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
920 Self::ConsensusObjectOperationNotAllowed => {
921 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
922 }
923 Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
924 Self::ExecutionCanceledDueToConsensusObjectCongestion => {
925 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION"
926 }
927 Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
928 Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
929 Self::ExecutionCanceledDueToRandomnessUnavailable => {
930 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
931 }
932 Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
933 Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
934 Self::InvalidLinkage => "INVALID_LINKAGE",
935 }
936 }
937 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
939 match value {
940 "EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
941 "INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
942 "INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
943 "INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
944 "FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
945 "OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
946 "PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
947 "CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
948 "INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
949 "COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
950 "PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
951 Some(Self::PublishErrorNonZeroAddress)
952 }
953 "SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
954 "MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
955 "MOVE_ABORT" => Some(Self::MoveAbort),
956 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
957 Some(Self::VmVerificationOrDeserializationError)
958 }
959 "VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
960 "FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
961 "ARITY_MISMATCH" => Some(Self::ArityMismatch),
962 "TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
963 "NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
964 "COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
965 "TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
966 "UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
967 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
968 Some(Self::InvalidPublicFunctionReturnType)
969 }
970 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
971 "EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
972 "PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
973 Some(Self::PublishUpgradeMissingDependency)
974 }
975 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
976 Some(Self::PublishUpgradeDependencyDowngrade)
977 }
978 "PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
979 "WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
980 "CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
981 "SUI_MOVE_VERIFICATION_TIMEDOUT" => {
982 Some(Self::SuiMoveVerificationTimedout)
983 }
984 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
985 Some(Self::ConsensusObjectOperationNotAllowed)
986 }
987 "INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
988 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION" => {
989 Some(Self::ExecutionCanceledDueToConsensusObjectCongestion)
990 }
991 "ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
992 "COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
993 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
994 Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
995 }
996 "MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
997 "MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
998 "INVALID_LINKAGE" => Some(Self::InvalidLinkage),
999 _ => None,
1000 }
1001 }
1002 }
1003 #[non_exhaustive]
1004 #[derive(Clone, PartialEq, ::prost::Oneof)]
1005 pub enum ErrorDetails {
1006 #[prost(message, tag = "4")]
1007 Abort(super::MoveAbort),
1008 #[prost(message, tag = "5")]
1009 SizeError(super::SizeError),
1010 #[prost(message, tag = "6")]
1011 CommandArgumentError(super::CommandArgumentError),
1012 #[prost(message, tag = "7")]
1013 TypeArgumentError(super::TypeArgumentError),
1014 #[prost(message, tag = "8")]
1015 PackageUpgradeError(super::PackageUpgradeError),
1016 #[prost(message, tag = "9")]
1017 IndexError(super::IndexError),
1018 #[prost(string, tag = "10")]
1019 ObjectId(::prost::alloc::string::String),
1020 #[prost(message, tag = "11")]
1021 CoinDenyListError(super::CoinDenyListError),
1022 #[prost(message, tag = "12")]
1024 CongestedObjects(super::CongestedObjects),
1025 }
1026}
1027#[non_exhaustive]
1028#[derive(Clone, PartialEq, ::prost::Message)]
1029pub struct MoveAbort {
1030 #[prost(uint64, optional, tag = "1")]
1031 pub abort_code: ::core::option::Option<u64>,
1032 #[prost(message, optional, tag = "2")]
1034 pub location: ::core::option::Option<MoveLocation>,
1035 #[prost(message, optional, tag = "3")]
1037 pub clever_error: ::core::option::Option<CleverError>,
1038}
1039#[non_exhaustive]
1041#[derive(Clone, PartialEq, ::prost::Message)]
1042pub struct MoveLocation {
1043 #[prost(string, optional, tag = "1")]
1045 pub package: ::core::option::Option<::prost::alloc::string::String>,
1046 #[prost(string, optional, tag = "2")]
1048 pub module: ::core::option::Option<::prost::alloc::string::String>,
1049 #[prost(uint32, optional, tag = "3")]
1051 pub function: ::core::option::Option<u32>,
1052 #[prost(uint32, optional, tag = "4")]
1054 pub instruction: ::core::option::Option<u32>,
1055 #[prost(string, optional, tag = "5")]
1057 pub function_name: ::core::option::Option<::prost::alloc::string::String>,
1058}
1059#[non_exhaustive]
1060#[derive(Clone, PartialEq, ::prost::Message)]
1061pub struct CleverError {
1062 #[prost(uint64, optional, tag = "1")]
1063 pub error_code: ::core::option::Option<u64>,
1064 #[prost(uint64, optional, tag = "2")]
1065 pub line_number: ::core::option::Option<u64>,
1066 #[prost(string, optional, tag = "3")]
1067 pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
1068 #[prost(string, optional, tag = "4")]
1069 pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
1070 #[prost(oneof = "clever_error::Value", tags = "5, 6")]
1071 pub value: ::core::option::Option<clever_error::Value>,
1072}
1073pub mod clever_error {
1075 #[non_exhaustive]
1076 #[derive(Clone, PartialEq, ::prost::Oneof)]
1077 pub enum Value {
1078 #[prost(string, tag = "5")]
1079 Rendered(::prost::alloc::string::String),
1080 #[prost(bytes, tag = "6")]
1081 Raw(::prost::bytes::Bytes),
1082 }
1083}
1084#[non_exhaustive]
1086#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1087pub struct SizeError {
1088 #[prost(uint64, optional, tag = "1")]
1090 pub size: ::core::option::Option<u64>,
1091 #[prost(uint64, optional, tag = "2")]
1093 pub max_size: ::core::option::Option<u64>,
1094}
1095#[non_exhaustive]
1096#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1097pub struct IndexError {
1098 #[prost(uint32, optional, tag = "1")]
1100 pub index: ::core::option::Option<u32>,
1101 #[prost(uint32, optional, tag = "2")]
1103 pub subresult: ::core::option::Option<u32>,
1104}
1105#[non_exhaustive]
1106#[derive(Clone, PartialEq, ::prost::Message)]
1107pub struct CoinDenyListError {
1108 #[prost(string, optional, tag = "1")]
1110 pub address: ::core::option::Option<::prost::alloc::string::String>,
1111 #[prost(string, optional, tag = "2")]
1113 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1114}
1115#[non_exhaustive]
1117#[derive(Clone, PartialEq, ::prost::Message)]
1118pub struct CongestedObjects {
1119 #[prost(string, repeated, tag = "1")]
1120 pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1121}
1122#[non_exhaustive]
1124#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1125pub struct CommandArgumentError {
1126 #[prost(uint32, optional, tag = "1")]
1128 pub argument: ::core::option::Option<u32>,
1129 #[prost(
1130 enumeration = "command_argument_error::CommandArgumentErrorKind",
1131 optional,
1132 tag = "2"
1133 )]
1134 pub kind: ::core::option::Option<i32>,
1135 #[prost(message, optional, tag = "3")]
1136 pub index_error: ::core::option::Option<IndexError>,
1137}
1138pub mod command_argument_error {
1140 #[non_exhaustive]
1141 #[derive(
1142 Clone,
1143 Copy,
1144 Debug,
1145 PartialEq,
1146 Eq,
1147 Hash,
1148 PartialOrd,
1149 Ord,
1150 ::prost::Enumeration
1151 )]
1152 #[repr(i32)]
1153 pub enum CommandArgumentErrorKind {
1154 Unknown = 0,
1155 TypeMismatch = 1,
1157 InvalidBcsBytes = 2,
1159 InvalidUsageOfPureArgument = 3,
1161 InvalidArgumentToPrivateEntryFunction = 4,
1164 IndexOutOfBounds = 5,
1168 SecondaryIndexOutOfBounds = 6,
1172 InvalidResultArity = 7,
1176 InvalidGasCoinUsage = 8,
1179 InvalidValueUsage = 9,
1184 InvalidObjectByValue = 10,
1186 InvalidObjectByMutRef = 11,
1188 ConsensusObjectOperationNotAllowed = 12,
1191 InvalidArgumentArity = 13,
1194 }
1195 impl CommandArgumentErrorKind {
1196 pub fn as_str_name(&self) -> &'static str {
1201 match self {
1202 Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1203 Self::TypeMismatch => "TYPE_MISMATCH",
1204 Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1205 Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1206 Self::InvalidArgumentToPrivateEntryFunction => {
1207 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1208 }
1209 Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1210 Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1211 Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1212 Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1213 Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1214 Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1215 Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1216 Self::ConsensusObjectOperationNotAllowed => {
1217 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1218 }
1219 Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1220 }
1221 }
1222 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1224 match value {
1225 "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1226 "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1227 "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1228 "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1229 Some(Self::InvalidUsageOfPureArgument)
1230 }
1231 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1232 Some(Self::InvalidArgumentToPrivateEntryFunction)
1233 }
1234 "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1235 "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1236 "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1237 "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1238 "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1239 "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1240 "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1241 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1242 Some(Self::ConsensusObjectOperationNotAllowed)
1243 }
1244 "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1245 _ => None,
1246 }
1247 }
1248 }
1249}
1250#[non_exhaustive]
1252#[derive(Clone, PartialEq, ::prost::Message)]
1253pub struct PackageUpgradeError {
1254 #[prost(
1255 enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1256 optional,
1257 tag = "1"
1258 )]
1259 pub kind: ::core::option::Option<i32>,
1260 #[prost(string, optional, tag = "2")]
1262 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1263 #[prost(string, optional, tag = "3")]
1265 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1266 #[prost(uint32, optional, tag = "4")]
1268 pub policy: ::core::option::Option<u32>,
1269 #[prost(string, optional, tag = "5")]
1271 pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1272}
1273pub mod package_upgrade_error {
1275 #[non_exhaustive]
1276 #[derive(
1277 Clone,
1278 Copy,
1279 Debug,
1280 PartialEq,
1281 Eq,
1282 Hash,
1283 PartialOrd,
1284 Ord,
1285 ::prost::Enumeration
1286 )]
1287 #[repr(i32)]
1288 pub enum PackageUpgradeErrorKind {
1289 Unknown = 0,
1290 UnableToFetchPackage = 1,
1292 NotAPackage = 2,
1294 IncompatibleUpgrade = 3,
1296 DigestDoesNotMatch = 4,
1298 UnknownUpgradePolicy = 5,
1300 PackageIdDoesNotMatch = 6,
1302 }
1303 impl PackageUpgradeErrorKind {
1304 pub fn as_str_name(&self) -> &'static str {
1309 match self {
1310 Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1311 Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1312 Self::NotAPackage => "NOT_A_PACKAGE",
1313 Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1314 Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1315 Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1316 Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1317 }
1318 }
1319 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1321 match value {
1322 "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1323 "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1324 "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1325 "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1326 "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1327 "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1328 "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1329 _ => None,
1330 }
1331 }
1332 }
1333}
1334#[non_exhaustive]
1336#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1337pub struct TypeArgumentError {
1338 #[prost(uint32, optional, tag = "1")]
1340 pub type_argument: ::core::option::Option<u32>,
1341 #[prost(
1342 enumeration = "type_argument_error::TypeArgumentErrorKind",
1343 optional,
1344 tag = "2"
1345 )]
1346 pub kind: ::core::option::Option<i32>,
1347}
1348pub mod type_argument_error {
1350 #[non_exhaustive]
1351 #[derive(
1352 Clone,
1353 Copy,
1354 Debug,
1355 PartialEq,
1356 Eq,
1357 Hash,
1358 PartialOrd,
1359 Ord,
1360 ::prost::Enumeration
1361 )]
1362 #[repr(i32)]
1363 pub enum TypeArgumentErrorKind {
1364 Unknown = 0,
1365 TypeNotFound = 1,
1367 ConstraintNotSatisfied = 2,
1369 }
1370 impl TypeArgumentErrorKind {
1371 pub fn as_str_name(&self) -> &'static str {
1376 match self {
1377 Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1378 Self::TypeNotFound => "TYPE_NOT_FOUND",
1379 Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1380 }
1381 }
1382 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1384 match value {
1385 "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1386 "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1387 "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1388 _ => None,
1389 }
1390 }
1391 }
1392}
1393#[non_exhaustive]
1395#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1396pub struct GasCostSummary {
1397 #[prost(uint64, optional, tag = "1")]
1399 pub computation_cost: ::core::option::Option<u64>,
1400 #[prost(uint64, optional, tag = "2")]
1402 pub storage_cost: ::core::option::Option<u64>,
1403 #[prost(uint64, optional, tag = "3")]
1406 pub storage_rebate: ::core::option::Option<u64>,
1407 #[prost(uint64, optional, tag = "4")]
1409 pub non_refundable_storage_fee: ::core::option::Option<u64>,
1410}
1411#[non_exhaustive]
1413#[derive(Clone, PartialEq, ::prost::Message)]
1414pub struct Input {
1415 #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1416 pub kind: ::core::option::Option<i32>,
1417 #[prost(bytes = "bytes", optional, tag = "2")]
1422 pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1423 #[prost(string, optional, tag = "3")]
1425 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1426 #[prost(uint64, optional, tag = "4")]
1430 pub version: ::core::option::Option<u64>,
1431 #[prost(string, optional, tag = "5")]
1433 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1434 #[prost(bool, optional, tag = "6")]
1437 pub mutable: ::core::option::Option<bool>,
1438 #[prost(message, optional, boxed, tag = "1000")]
1442 pub literal: ::core::option::Option<
1443 ::prost::alloc::boxed::Box<::prost_types::Value>,
1444 >,
1445}
1446pub mod input {
1448 #[non_exhaustive]
1449 #[derive(
1450 Clone,
1451 Copy,
1452 Debug,
1453 PartialEq,
1454 Eq,
1455 Hash,
1456 PartialOrd,
1457 Ord,
1458 ::prost::Enumeration
1459 )]
1460 #[repr(i32)]
1461 pub enum InputKind {
1462 Unknown = 0,
1463 Pure = 1,
1465 ImmutableOrOwned = 2,
1467 Shared = 3,
1469 Receiving = 4,
1471 }
1472 impl InputKind {
1473 pub fn as_str_name(&self) -> &'static str {
1478 match self {
1479 Self::Unknown => "INPUT_KIND_UNKNOWN",
1480 Self::Pure => "PURE",
1481 Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
1482 Self::Shared => "SHARED",
1483 Self::Receiving => "RECEIVING",
1484 }
1485 }
1486 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1488 match value {
1489 "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
1490 "PURE" => Some(Self::Pure),
1491 "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
1492 "SHARED" => Some(Self::Shared),
1493 "RECEIVING" => Some(Self::Receiving),
1494 _ => None,
1495 }
1496 }
1497 }
1498}
1499#[non_exhaustive]
1501#[derive(Clone, PartialEq, ::prost::Message)]
1502pub struct JwkId {
1503 #[prost(string, optional, tag = "1")]
1505 pub iss: ::core::option::Option<::prost::alloc::string::String>,
1506 #[prost(string, optional, tag = "2")]
1508 pub kid: ::core::option::Option<::prost::alloc::string::String>,
1509}
1510#[non_exhaustive]
1516#[derive(Clone, PartialEq, ::prost::Message)]
1517pub struct Jwk {
1518 #[prost(string, optional, tag = "1")]
1520 pub kty: ::core::option::Option<::prost::alloc::string::String>,
1521 #[prost(string, optional, tag = "2")]
1523 pub e: ::core::option::Option<::prost::alloc::string::String>,
1524 #[prost(string, optional, tag = "3")]
1526 pub n: ::core::option::Option<::prost::alloc::string::String>,
1527 #[prost(string, optional, tag = "4")]
1529 pub alg: ::core::option::Option<::prost::alloc::string::String>,
1530}
1531#[non_exhaustive]
1532#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1533pub struct GetServiceInfoRequest {}
1534#[non_exhaustive]
1535#[derive(Clone, PartialEq, ::prost::Message)]
1536pub struct GetServiceInfoResponse {
1537 #[prost(string, optional, tag = "1")]
1542 pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
1543 #[prost(string, optional, tag = "2")]
1547 pub chain: ::core::option::Option<::prost::alloc::string::String>,
1548 #[prost(uint64, optional, tag = "3")]
1550 pub epoch: ::core::option::Option<u64>,
1551 #[prost(uint64, optional, tag = "4")]
1553 pub checkpoint_height: ::core::option::Option<u64>,
1554 #[prost(message, optional, tag = "5")]
1556 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
1557 #[prost(uint64, optional, tag = "6")]
1559 pub lowest_available_checkpoint: ::core::option::Option<u64>,
1560 #[prost(uint64, optional, tag = "7")]
1562 pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
1563 #[prost(string, optional, tag = "8")]
1565 pub server: ::core::option::Option<::prost::alloc::string::String>,
1566}
1567#[non_exhaustive]
1568#[derive(Clone, PartialEq, ::prost::Message)]
1569pub struct GetObjectRequest {
1570 #[prost(string, optional, tag = "1")]
1572 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1573 #[prost(uint64, optional, tag = "2")]
1577 pub version: ::core::option::Option<u64>,
1578 #[prost(message, optional, tag = "3")]
1581 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1582}
1583#[non_exhaustive]
1584#[derive(Clone, PartialEq, ::prost::Message)]
1585pub struct GetObjectResponse {
1586 #[prost(message, optional, tag = "1")]
1587 pub object: ::core::option::Option<Object>,
1588}
1589#[non_exhaustive]
1590#[derive(Clone, PartialEq, ::prost::Message)]
1591pub struct BatchGetObjectsRequest {
1592 #[prost(message, repeated, tag = "1")]
1593 pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
1594 #[prost(message, optional, tag = "2")]
1597 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1598}
1599#[non_exhaustive]
1600#[derive(Clone, PartialEq, ::prost::Message)]
1601pub struct BatchGetObjectsResponse {
1602 #[prost(message, repeated, tag = "1")]
1603 pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
1604}
1605#[non_exhaustive]
1606#[derive(Clone, PartialEq, ::prost::Message)]
1607pub struct GetObjectResult {
1608 #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
1609 pub result: ::core::option::Option<get_object_result::Result>,
1610}
1611pub mod get_object_result {
1613 #[non_exhaustive]
1614 #[derive(Clone, PartialEq, ::prost::Oneof)]
1615 pub enum Result {
1616 #[prost(message, tag = "1")]
1617 Object(super::Object),
1618 #[prost(message, tag = "2")]
1619 Error(super::super::super::super::google::rpc::Status),
1620 }
1621}
1622#[non_exhaustive]
1623#[derive(Clone, PartialEq, ::prost::Message)]
1624pub struct GetTransactionRequest {
1625 #[prost(string, optional, tag = "1")]
1627 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1628 #[prost(message, optional, tag = "2")]
1631 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1632}
1633#[non_exhaustive]
1634#[derive(Clone, PartialEq, ::prost::Message)]
1635pub struct GetTransactionResponse {
1636 #[prost(message, optional, tag = "1")]
1637 pub transaction: ::core::option::Option<ExecutedTransaction>,
1638}
1639#[non_exhaustive]
1640#[derive(Clone, PartialEq, ::prost::Message)]
1641pub struct BatchGetTransactionsRequest {
1642 #[prost(string, repeated, tag = "1")]
1644 pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1645 #[prost(message, optional, tag = "2")]
1648 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1649}
1650#[non_exhaustive]
1651#[derive(Clone, PartialEq, ::prost::Message)]
1652pub struct BatchGetTransactionsResponse {
1653 #[prost(message, repeated, tag = "1")]
1654 pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
1655}
1656#[non_exhaustive]
1657#[derive(Clone, PartialEq, ::prost::Message)]
1658pub struct GetTransactionResult {
1659 #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
1660 pub result: ::core::option::Option<get_transaction_result::Result>,
1661}
1662pub mod get_transaction_result {
1664 #[non_exhaustive]
1665 #[derive(Clone, PartialEq, ::prost::Oneof)]
1666 pub enum Result {
1667 #[prost(message, tag = "1")]
1668 Transaction(super::ExecutedTransaction),
1669 #[prost(message, tag = "2")]
1670 Error(super::super::super::super::google::rpc::Status),
1671 }
1672}
1673#[non_exhaustive]
1674#[derive(Clone, PartialEq, ::prost::Message)]
1675pub struct GetCheckpointRequest {
1676 #[prost(message, optional, tag = "3")]
1679 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1680 #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
1682 pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
1683}
1684pub mod get_checkpoint_request {
1686 #[non_exhaustive]
1688 #[derive(Clone, PartialEq, ::prost::Oneof)]
1689 pub enum CheckpointId {
1690 #[prost(uint64, tag = "1")]
1692 SequenceNumber(u64),
1693 #[prost(string, tag = "2")]
1695 Digest(::prost::alloc::string::String),
1696 }
1697}
1698#[non_exhaustive]
1699#[derive(Clone, PartialEq, ::prost::Message)]
1700pub struct GetCheckpointResponse {
1701 #[prost(message, optional, tag = "1")]
1702 pub checkpoint: ::core::option::Option<Checkpoint>,
1703}
1704#[non_exhaustive]
1705#[derive(Clone, PartialEq, ::prost::Message)]
1706pub struct GetEpochRequest {
1707 #[prost(uint64, optional, tag = "1")]
1710 pub epoch: ::core::option::Option<u64>,
1711 #[prost(message, optional, tag = "2")]
1714 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1715}
1716#[non_exhaustive]
1717#[derive(Clone, PartialEq, ::prost::Message)]
1718pub struct GetEpochResponse {
1719 #[prost(message, optional, tag = "1")]
1720 pub epoch: ::core::option::Option<Epoch>,
1721}
1722pub mod ledger_service_client {
1724 #![allow(
1725 unused_variables,
1726 dead_code,
1727 missing_docs,
1728 clippy::wildcard_imports,
1729 clippy::let_unit_value,
1730 )]
1731 use tonic::codegen::*;
1732 use tonic::codegen::http::Uri;
1733 #[derive(Debug, Clone)]
1734 pub struct LedgerServiceClient<T> {
1735 inner: tonic::client::Grpc<T>,
1736 }
1737 impl LedgerServiceClient<tonic::transport::Channel> {
1738 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1740 where
1741 D: TryInto<tonic::transport::Endpoint>,
1742 D::Error: Into<StdError>,
1743 {
1744 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1745 Ok(Self::new(conn))
1746 }
1747 }
1748 impl<T> LedgerServiceClient<T>
1749 where
1750 T: tonic::client::GrpcService<tonic::body::Body>,
1751 T::Error: Into<StdError>,
1752 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1753 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1754 {
1755 pub fn new(inner: T) -> Self {
1756 let inner = tonic::client::Grpc::new(inner);
1757 Self { inner }
1758 }
1759 pub fn with_origin(inner: T, origin: Uri) -> Self {
1760 let inner = tonic::client::Grpc::with_origin(inner, origin);
1761 Self { inner }
1762 }
1763 pub fn with_interceptor<F>(
1764 inner: T,
1765 interceptor: F,
1766 ) -> LedgerServiceClient<InterceptedService<T, F>>
1767 where
1768 F: tonic::service::Interceptor,
1769 T::ResponseBody: Default,
1770 T: tonic::codegen::Service<
1771 http::Request<tonic::body::Body>,
1772 Response = http::Response<
1773 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1774 >,
1775 >,
1776 <T as tonic::codegen::Service<
1777 http::Request<tonic::body::Body>,
1778 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1779 {
1780 LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
1781 }
1782 #[must_use]
1787 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1788 self.inner = self.inner.send_compressed(encoding);
1789 self
1790 }
1791 #[must_use]
1793 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1794 self.inner = self.inner.accept_compressed(encoding);
1795 self
1796 }
1797 #[must_use]
1801 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1802 self.inner = self.inner.max_decoding_message_size(limit);
1803 self
1804 }
1805 #[must_use]
1809 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1810 self.inner = self.inner.max_encoding_message_size(limit);
1811 self
1812 }
1813 pub async fn get_service_info(
1815 &mut self,
1816 request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
1817 ) -> std::result::Result<
1818 tonic::Response<super::GetServiceInfoResponse>,
1819 tonic::Status,
1820 > {
1821 self.inner
1822 .ready()
1823 .await
1824 .map_err(|e| {
1825 tonic::Status::unknown(
1826 format!("Service was not ready: {}", e.into()),
1827 )
1828 })?;
1829 let codec = tonic::codec::ProstCodec::default();
1830 let path = http::uri::PathAndQuery::from_static(
1831 "/sui.rpc.v2.LedgerService/GetServiceInfo",
1832 );
1833 let mut req = request.into_request();
1834 req.extensions_mut()
1835 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
1836 self.inner.unary(req, path, codec).await
1837 }
1838 pub async fn get_object(
1839 &mut self,
1840 request: impl tonic::IntoRequest<super::GetObjectRequest>,
1841 ) -> std::result::Result<
1842 tonic::Response<super::GetObjectResponse>,
1843 tonic::Status,
1844 > {
1845 self.inner
1846 .ready()
1847 .await
1848 .map_err(|e| {
1849 tonic::Status::unknown(
1850 format!("Service was not ready: {}", e.into()),
1851 )
1852 })?;
1853 let codec = tonic::codec::ProstCodec::default();
1854 let path = http::uri::PathAndQuery::from_static(
1855 "/sui.rpc.v2.LedgerService/GetObject",
1856 );
1857 let mut req = request.into_request();
1858 req.extensions_mut()
1859 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
1860 self.inner.unary(req, path, codec).await
1861 }
1862 pub async fn batch_get_objects(
1863 &mut self,
1864 request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
1865 ) -> std::result::Result<
1866 tonic::Response<super::BatchGetObjectsResponse>,
1867 tonic::Status,
1868 > {
1869 self.inner
1870 .ready()
1871 .await
1872 .map_err(|e| {
1873 tonic::Status::unknown(
1874 format!("Service was not ready: {}", e.into()),
1875 )
1876 })?;
1877 let codec = tonic::codec::ProstCodec::default();
1878 let path = http::uri::PathAndQuery::from_static(
1879 "/sui.rpc.v2.LedgerService/BatchGetObjects",
1880 );
1881 let mut req = request.into_request();
1882 req.extensions_mut()
1883 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
1884 self.inner.unary(req, path, codec).await
1885 }
1886 pub async fn get_transaction(
1887 &mut self,
1888 request: impl tonic::IntoRequest<super::GetTransactionRequest>,
1889 ) -> std::result::Result<
1890 tonic::Response<super::GetTransactionResponse>,
1891 tonic::Status,
1892 > {
1893 self.inner
1894 .ready()
1895 .await
1896 .map_err(|e| {
1897 tonic::Status::unknown(
1898 format!("Service was not ready: {}", e.into()),
1899 )
1900 })?;
1901 let codec = tonic::codec::ProstCodec::default();
1902 let path = http::uri::PathAndQuery::from_static(
1903 "/sui.rpc.v2.LedgerService/GetTransaction",
1904 );
1905 let mut req = request.into_request();
1906 req.extensions_mut()
1907 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
1908 self.inner.unary(req, path, codec).await
1909 }
1910 pub async fn batch_get_transactions(
1911 &mut self,
1912 request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
1913 ) -> std::result::Result<
1914 tonic::Response<super::BatchGetTransactionsResponse>,
1915 tonic::Status,
1916 > {
1917 self.inner
1918 .ready()
1919 .await
1920 .map_err(|e| {
1921 tonic::Status::unknown(
1922 format!("Service was not ready: {}", e.into()),
1923 )
1924 })?;
1925 let codec = tonic::codec::ProstCodec::default();
1926 let path = http::uri::PathAndQuery::from_static(
1927 "/sui.rpc.v2.LedgerService/BatchGetTransactions",
1928 );
1929 let mut req = request.into_request();
1930 req.extensions_mut()
1931 .insert(
1932 GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
1933 );
1934 self.inner.unary(req, path, codec).await
1935 }
1936 pub async fn get_checkpoint(
1937 &mut self,
1938 request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
1939 ) -> std::result::Result<
1940 tonic::Response<super::GetCheckpointResponse>,
1941 tonic::Status,
1942 > {
1943 self.inner
1944 .ready()
1945 .await
1946 .map_err(|e| {
1947 tonic::Status::unknown(
1948 format!("Service was not ready: {}", e.into()),
1949 )
1950 })?;
1951 let codec = tonic::codec::ProstCodec::default();
1952 let path = http::uri::PathAndQuery::from_static(
1953 "/sui.rpc.v2.LedgerService/GetCheckpoint",
1954 );
1955 let mut req = request.into_request();
1956 req.extensions_mut()
1957 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
1958 self.inner.unary(req, path, codec).await
1959 }
1960 pub async fn get_epoch(
1961 &mut self,
1962 request: impl tonic::IntoRequest<super::GetEpochRequest>,
1963 ) -> std::result::Result<
1964 tonic::Response<super::GetEpochResponse>,
1965 tonic::Status,
1966 > {
1967 self.inner
1968 .ready()
1969 .await
1970 .map_err(|e| {
1971 tonic::Status::unknown(
1972 format!("Service was not ready: {}", e.into()),
1973 )
1974 })?;
1975 let codec = tonic::codec::ProstCodec::default();
1976 let path = http::uri::PathAndQuery::from_static(
1977 "/sui.rpc.v2.LedgerService/GetEpoch",
1978 );
1979 let mut req = request.into_request();
1980 req.extensions_mut()
1981 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
1982 self.inner.unary(req, path, codec).await
1983 }
1984 }
1985}
1986pub mod ledger_service_server {
1988 #![allow(
1989 unused_variables,
1990 dead_code,
1991 missing_docs,
1992 clippy::wildcard_imports,
1993 clippy::let_unit_value,
1994 )]
1995 use tonic::codegen::*;
1996 #[async_trait]
1998 pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
1999 async fn get_service_info(
2001 &self,
2002 request: tonic::Request<super::GetServiceInfoRequest>,
2003 ) -> std::result::Result<
2004 tonic::Response<super::GetServiceInfoResponse>,
2005 tonic::Status,
2006 >;
2007 async fn get_object(
2008 &self,
2009 request: tonic::Request<super::GetObjectRequest>,
2010 ) -> std::result::Result<
2011 tonic::Response<super::GetObjectResponse>,
2012 tonic::Status,
2013 >;
2014 async fn batch_get_objects(
2015 &self,
2016 request: tonic::Request<super::BatchGetObjectsRequest>,
2017 ) -> std::result::Result<
2018 tonic::Response<super::BatchGetObjectsResponse>,
2019 tonic::Status,
2020 >;
2021 async fn get_transaction(
2022 &self,
2023 request: tonic::Request<super::GetTransactionRequest>,
2024 ) -> std::result::Result<
2025 tonic::Response<super::GetTransactionResponse>,
2026 tonic::Status,
2027 >;
2028 async fn batch_get_transactions(
2029 &self,
2030 request: tonic::Request<super::BatchGetTransactionsRequest>,
2031 ) -> std::result::Result<
2032 tonic::Response<super::BatchGetTransactionsResponse>,
2033 tonic::Status,
2034 >;
2035 async fn get_checkpoint(
2036 &self,
2037 request: tonic::Request<super::GetCheckpointRequest>,
2038 ) -> std::result::Result<
2039 tonic::Response<super::GetCheckpointResponse>,
2040 tonic::Status,
2041 >;
2042 async fn get_epoch(
2043 &self,
2044 request: tonic::Request<super::GetEpochRequest>,
2045 ) -> std::result::Result<
2046 tonic::Response<super::GetEpochResponse>,
2047 tonic::Status,
2048 >;
2049 }
2050 #[derive(Debug)]
2051 pub struct LedgerServiceServer<T> {
2052 inner: Arc<T>,
2053 accept_compression_encodings: EnabledCompressionEncodings,
2054 send_compression_encodings: EnabledCompressionEncodings,
2055 max_decoding_message_size: Option<usize>,
2056 max_encoding_message_size: Option<usize>,
2057 }
2058 impl<T> LedgerServiceServer<T> {
2059 pub fn new(inner: T) -> Self {
2060 Self::from_arc(Arc::new(inner))
2061 }
2062 pub fn from_arc(inner: Arc<T>) -> Self {
2063 Self {
2064 inner,
2065 accept_compression_encodings: Default::default(),
2066 send_compression_encodings: Default::default(),
2067 max_decoding_message_size: None,
2068 max_encoding_message_size: None,
2069 }
2070 }
2071 pub fn with_interceptor<F>(
2072 inner: T,
2073 interceptor: F,
2074 ) -> InterceptedService<Self, F>
2075 where
2076 F: tonic::service::Interceptor,
2077 {
2078 InterceptedService::new(Self::new(inner), interceptor)
2079 }
2080 #[must_use]
2082 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2083 self.accept_compression_encodings.enable(encoding);
2084 self
2085 }
2086 #[must_use]
2088 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2089 self.send_compression_encodings.enable(encoding);
2090 self
2091 }
2092 #[must_use]
2096 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2097 self.max_decoding_message_size = Some(limit);
2098 self
2099 }
2100 #[must_use]
2104 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2105 self.max_encoding_message_size = Some(limit);
2106 self
2107 }
2108 }
2109 impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
2110 where
2111 T: LedgerService,
2112 B: Body + std::marker::Send + 'static,
2113 B::Error: Into<StdError> + std::marker::Send + 'static,
2114 {
2115 type Response = http::Response<tonic::body::Body>;
2116 type Error = std::convert::Infallible;
2117 type Future = BoxFuture<Self::Response, Self::Error>;
2118 fn poll_ready(
2119 &mut self,
2120 _cx: &mut Context<'_>,
2121 ) -> Poll<std::result::Result<(), Self::Error>> {
2122 Poll::Ready(Ok(()))
2123 }
2124 fn call(&mut self, req: http::Request<B>) -> Self::Future {
2125 match req.uri().path() {
2126 "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
2127 #[allow(non_camel_case_types)]
2128 struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
2129 impl<
2130 T: LedgerService,
2131 > tonic::server::UnaryService<super::GetServiceInfoRequest>
2132 for GetServiceInfoSvc<T> {
2133 type Response = super::GetServiceInfoResponse;
2134 type Future = BoxFuture<
2135 tonic::Response<Self::Response>,
2136 tonic::Status,
2137 >;
2138 fn call(
2139 &mut self,
2140 request: tonic::Request<super::GetServiceInfoRequest>,
2141 ) -> Self::Future {
2142 let inner = Arc::clone(&self.0);
2143 let fut = async move {
2144 <T as LedgerService>::get_service_info(&inner, request)
2145 .await
2146 };
2147 Box::pin(fut)
2148 }
2149 }
2150 let accept_compression_encodings = self.accept_compression_encodings;
2151 let send_compression_encodings = self.send_compression_encodings;
2152 let max_decoding_message_size = self.max_decoding_message_size;
2153 let max_encoding_message_size = self.max_encoding_message_size;
2154 let inner = self.inner.clone();
2155 let fut = async move {
2156 let method = GetServiceInfoSvc(inner);
2157 let codec = tonic::codec::ProstCodec::default();
2158 let mut grpc = tonic::server::Grpc::new(codec)
2159 .apply_compression_config(
2160 accept_compression_encodings,
2161 send_compression_encodings,
2162 )
2163 .apply_max_message_size_config(
2164 max_decoding_message_size,
2165 max_encoding_message_size,
2166 );
2167 let res = grpc.unary(method, req).await;
2168 Ok(res)
2169 };
2170 Box::pin(fut)
2171 }
2172 "/sui.rpc.v2.LedgerService/GetObject" => {
2173 #[allow(non_camel_case_types)]
2174 struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
2175 impl<
2176 T: LedgerService,
2177 > tonic::server::UnaryService<super::GetObjectRequest>
2178 for GetObjectSvc<T> {
2179 type Response = super::GetObjectResponse;
2180 type Future = BoxFuture<
2181 tonic::Response<Self::Response>,
2182 tonic::Status,
2183 >;
2184 fn call(
2185 &mut self,
2186 request: tonic::Request<super::GetObjectRequest>,
2187 ) -> Self::Future {
2188 let inner = Arc::clone(&self.0);
2189 let fut = async move {
2190 <T as LedgerService>::get_object(&inner, request).await
2191 };
2192 Box::pin(fut)
2193 }
2194 }
2195 let accept_compression_encodings = self.accept_compression_encodings;
2196 let send_compression_encodings = self.send_compression_encodings;
2197 let max_decoding_message_size = self.max_decoding_message_size;
2198 let max_encoding_message_size = self.max_encoding_message_size;
2199 let inner = self.inner.clone();
2200 let fut = async move {
2201 let method = GetObjectSvc(inner);
2202 let codec = tonic::codec::ProstCodec::default();
2203 let mut grpc = tonic::server::Grpc::new(codec)
2204 .apply_compression_config(
2205 accept_compression_encodings,
2206 send_compression_encodings,
2207 )
2208 .apply_max_message_size_config(
2209 max_decoding_message_size,
2210 max_encoding_message_size,
2211 );
2212 let res = grpc.unary(method, req).await;
2213 Ok(res)
2214 };
2215 Box::pin(fut)
2216 }
2217 "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
2218 #[allow(non_camel_case_types)]
2219 struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
2220 impl<
2221 T: LedgerService,
2222 > tonic::server::UnaryService<super::BatchGetObjectsRequest>
2223 for BatchGetObjectsSvc<T> {
2224 type Response = super::BatchGetObjectsResponse;
2225 type Future = BoxFuture<
2226 tonic::Response<Self::Response>,
2227 tonic::Status,
2228 >;
2229 fn call(
2230 &mut self,
2231 request: tonic::Request<super::BatchGetObjectsRequest>,
2232 ) -> Self::Future {
2233 let inner = Arc::clone(&self.0);
2234 let fut = async move {
2235 <T as LedgerService>::batch_get_objects(&inner, request)
2236 .await
2237 };
2238 Box::pin(fut)
2239 }
2240 }
2241 let accept_compression_encodings = self.accept_compression_encodings;
2242 let send_compression_encodings = self.send_compression_encodings;
2243 let max_decoding_message_size = self.max_decoding_message_size;
2244 let max_encoding_message_size = self.max_encoding_message_size;
2245 let inner = self.inner.clone();
2246 let fut = async move {
2247 let method = BatchGetObjectsSvc(inner);
2248 let codec = tonic::codec::ProstCodec::default();
2249 let mut grpc = tonic::server::Grpc::new(codec)
2250 .apply_compression_config(
2251 accept_compression_encodings,
2252 send_compression_encodings,
2253 )
2254 .apply_max_message_size_config(
2255 max_decoding_message_size,
2256 max_encoding_message_size,
2257 );
2258 let res = grpc.unary(method, req).await;
2259 Ok(res)
2260 };
2261 Box::pin(fut)
2262 }
2263 "/sui.rpc.v2.LedgerService/GetTransaction" => {
2264 #[allow(non_camel_case_types)]
2265 struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
2266 impl<
2267 T: LedgerService,
2268 > tonic::server::UnaryService<super::GetTransactionRequest>
2269 for GetTransactionSvc<T> {
2270 type Response = super::GetTransactionResponse;
2271 type Future = BoxFuture<
2272 tonic::Response<Self::Response>,
2273 tonic::Status,
2274 >;
2275 fn call(
2276 &mut self,
2277 request: tonic::Request<super::GetTransactionRequest>,
2278 ) -> Self::Future {
2279 let inner = Arc::clone(&self.0);
2280 let fut = async move {
2281 <T as LedgerService>::get_transaction(&inner, request).await
2282 };
2283 Box::pin(fut)
2284 }
2285 }
2286 let accept_compression_encodings = self.accept_compression_encodings;
2287 let send_compression_encodings = self.send_compression_encodings;
2288 let max_decoding_message_size = self.max_decoding_message_size;
2289 let max_encoding_message_size = self.max_encoding_message_size;
2290 let inner = self.inner.clone();
2291 let fut = async move {
2292 let method = GetTransactionSvc(inner);
2293 let codec = tonic::codec::ProstCodec::default();
2294 let mut grpc = tonic::server::Grpc::new(codec)
2295 .apply_compression_config(
2296 accept_compression_encodings,
2297 send_compression_encodings,
2298 )
2299 .apply_max_message_size_config(
2300 max_decoding_message_size,
2301 max_encoding_message_size,
2302 );
2303 let res = grpc.unary(method, req).await;
2304 Ok(res)
2305 };
2306 Box::pin(fut)
2307 }
2308 "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
2309 #[allow(non_camel_case_types)]
2310 struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
2311 impl<
2312 T: LedgerService,
2313 > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
2314 for BatchGetTransactionsSvc<T> {
2315 type Response = super::BatchGetTransactionsResponse;
2316 type Future = BoxFuture<
2317 tonic::Response<Self::Response>,
2318 tonic::Status,
2319 >;
2320 fn call(
2321 &mut self,
2322 request: tonic::Request<super::BatchGetTransactionsRequest>,
2323 ) -> Self::Future {
2324 let inner = Arc::clone(&self.0);
2325 let fut = async move {
2326 <T as LedgerService>::batch_get_transactions(
2327 &inner,
2328 request,
2329 )
2330 .await
2331 };
2332 Box::pin(fut)
2333 }
2334 }
2335 let accept_compression_encodings = self.accept_compression_encodings;
2336 let send_compression_encodings = self.send_compression_encodings;
2337 let max_decoding_message_size = self.max_decoding_message_size;
2338 let max_encoding_message_size = self.max_encoding_message_size;
2339 let inner = self.inner.clone();
2340 let fut = async move {
2341 let method = BatchGetTransactionsSvc(inner);
2342 let codec = tonic::codec::ProstCodec::default();
2343 let mut grpc = tonic::server::Grpc::new(codec)
2344 .apply_compression_config(
2345 accept_compression_encodings,
2346 send_compression_encodings,
2347 )
2348 .apply_max_message_size_config(
2349 max_decoding_message_size,
2350 max_encoding_message_size,
2351 );
2352 let res = grpc.unary(method, req).await;
2353 Ok(res)
2354 };
2355 Box::pin(fut)
2356 }
2357 "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
2358 #[allow(non_camel_case_types)]
2359 struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
2360 impl<
2361 T: LedgerService,
2362 > tonic::server::UnaryService<super::GetCheckpointRequest>
2363 for GetCheckpointSvc<T> {
2364 type Response = super::GetCheckpointResponse;
2365 type Future = BoxFuture<
2366 tonic::Response<Self::Response>,
2367 tonic::Status,
2368 >;
2369 fn call(
2370 &mut self,
2371 request: tonic::Request<super::GetCheckpointRequest>,
2372 ) -> Self::Future {
2373 let inner = Arc::clone(&self.0);
2374 let fut = async move {
2375 <T as LedgerService>::get_checkpoint(&inner, request).await
2376 };
2377 Box::pin(fut)
2378 }
2379 }
2380 let accept_compression_encodings = self.accept_compression_encodings;
2381 let send_compression_encodings = self.send_compression_encodings;
2382 let max_decoding_message_size = self.max_decoding_message_size;
2383 let max_encoding_message_size = self.max_encoding_message_size;
2384 let inner = self.inner.clone();
2385 let fut = async move {
2386 let method = GetCheckpointSvc(inner);
2387 let codec = tonic::codec::ProstCodec::default();
2388 let mut grpc = tonic::server::Grpc::new(codec)
2389 .apply_compression_config(
2390 accept_compression_encodings,
2391 send_compression_encodings,
2392 )
2393 .apply_max_message_size_config(
2394 max_decoding_message_size,
2395 max_encoding_message_size,
2396 );
2397 let res = grpc.unary(method, req).await;
2398 Ok(res)
2399 };
2400 Box::pin(fut)
2401 }
2402 "/sui.rpc.v2.LedgerService/GetEpoch" => {
2403 #[allow(non_camel_case_types)]
2404 struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
2405 impl<
2406 T: LedgerService,
2407 > tonic::server::UnaryService<super::GetEpochRequest>
2408 for GetEpochSvc<T> {
2409 type Response = super::GetEpochResponse;
2410 type Future = BoxFuture<
2411 tonic::Response<Self::Response>,
2412 tonic::Status,
2413 >;
2414 fn call(
2415 &mut self,
2416 request: tonic::Request<super::GetEpochRequest>,
2417 ) -> Self::Future {
2418 let inner = Arc::clone(&self.0);
2419 let fut = async move {
2420 <T as LedgerService>::get_epoch(&inner, request).await
2421 };
2422 Box::pin(fut)
2423 }
2424 }
2425 let accept_compression_encodings = self.accept_compression_encodings;
2426 let send_compression_encodings = self.send_compression_encodings;
2427 let max_decoding_message_size = self.max_decoding_message_size;
2428 let max_encoding_message_size = self.max_encoding_message_size;
2429 let inner = self.inner.clone();
2430 let fut = async move {
2431 let method = GetEpochSvc(inner);
2432 let codec = tonic::codec::ProstCodec::default();
2433 let mut grpc = tonic::server::Grpc::new(codec)
2434 .apply_compression_config(
2435 accept_compression_encodings,
2436 send_compression_encodings,
2437 )
2438 .apply_max_message_size_config(
2439 max_decoding_message_size,
2440 max_encoding_message_size,
2441 );
2442 let res = grpc.unary(method, req).await;
2443 Ok(res)
2444 };
2445 Box::pin(fut)
2446 }
2447 _ => {
2448 Box::pin(async move {
2449 let mut response = http::Response::new(
2450 tonic::body::Body::default(),
2451 );
2452 let headers = response.headers_mut();
2453 headers
2454 .insert(
2455 tonic::Status::GRPC_STATUS,
2456 (tonic::Code::Unimplemented as i32).into(),
2457 );
2458 headers
2459 .insert(
2460 http::header::CONTENT_TYPE,
2461 tonic::metadata::GRPC_CONTENT_TYPE,
2462 );
2463 Ok(response)
2464 })
2465 }
2466 }
2467 }
2468 }
2469 impl<T> Clone for LedgerServiceServer<T> {
2470 fn clone(&self) -> Self {
2471 let inner = self.inner.clone();
2472 Self {
2473 inner,
2474 accept_compression_encodings: self.accept_compression_encodings,
2475 send_compression_encodings: self.send_compression_encodings,
2476 max_decoding_message_size: self.max_decoding_message_size,
2477 max_encoding_message_size: self.max_encoding_message_size,
2478 }
2479 }
2480 }
2481 pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
2483 impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
2484 const NAME: &'static str = SERVICE_NAME;
2485 }
2486}
2487#[non_exhaustive]
2489#[derive(Clone, PartialEq, ::prost::Message)]
2490pub struct Package {
2491 #[prost(string, optional, tag = "1")]
2497 pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
2498 #[prost(string, optional, tag = "2")]
2505 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
2506 #[prost(uint64, optional, tag = "3")]
2508 pub version: ::core::option::Option<u64>,
2509 #[prost(message, repeated, tag = "4")]
2511 pub modules: ::prost::alloc::vec::Vec<Module>,
2512 #[prost(message, repeated, tag = "5")]
2515 pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
2516 #[prost(message, repeated, tag = "6")]
2520 pub linkage: ::prost::alloc::vec::Vec<Linkage>,
2521}
2522#[non_exhaustive]
2524#[derive(Clone, PartialEq, ::prost::Message)]
2525pub struct Module {
2526 #[prost(string, optional, tag = "1")]
2528 pub name: ::core::option::Option<::prost::alloc::string::String>,
2529 #[prost(bytes = "bytes", optional, tag = "2")]
2531 pub contents: ::core::option::Option<::prost::bytes::Bytes>,
2532 #[prost(message, repeated, tag = "3")]
2534 pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
2535 #[prost(message, repeated, tag = "4")]
2537 pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
2538}
2539#[non_exhaustive]
2541#[derive(Clone, PartialEq, ::prost::Message)]
2542pub struct DatatypeDescriptor {
2543 #[prost(string, optional, tag = "1")]
2547 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
2548 #[prost(string, optional, tag = "2")]
2552 pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
2553 #[prost(string, optional, tag = "3")]
2555 pub module: ::core::option::Option<::prost::alloc::string::String>,
2556 #[prost(string, optional, tag = "4")]
2558 pub name: ::core::option::Option<::prost::alloc::string::String>,
2559 #[prost(enumeration = "Ability", repeated, tag = "5")]
2561 pub abilities: ::prost::alloc::vec::Vec<i32>,
2562 #[prost(message, repeated, tag = "6")]
2564 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
2565 #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
2567 pub kind: ::core::option::Option<i32>,
2568 #[prost(message, repeated, tag = "8")]
2572 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
2573 #[prost(message, repeated, tag = "9")]
2577 pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
2578}
2579pub mod datatype_descriptor {
2581 #[non_exhaustive]
2582 #[derive(
2583 Clone,
2584 Copy,
2585 Debug,
2586 PartialEq,
2587 Eq,
2588 Hash,
2589 PartialOrd,
2590 Ord,
2591 ::prost::Enumeration
2592 )]
2593 #[repr(i32)]
2594 pub enum DatatypeKind {
2595 Unknown = 0,
2596 Struct = 1,
2597 Enum = 2,
2598 }
2599 impl DatatypeKind {
2600 pub fn as_str_name(&self) -> &'static str {
2605 match self {
2606 Self::Unknown => "DATATYPE_KIND_UNKNOWN",
2607 Self::Struct => "STRUCT",
2608 Self::Enum => "ENUM",
2609 }
2610 }
2611 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2613 match value {
2614 "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
2615 "STRUCT" => Some(Self::Struct),
2616 "ENUM" => Some(Self::Enum),
2617 _ => None,
2618 }
2619 }
2620 }
2621}
2622#[non_exhaustive]
2624#[derive(Clone, PartialEq, ::prost::Message)]
2625pub struct TypeParameter {
2626 #[prost(enumeration = "Ability", repeated, tag = "1")]
2628 pub constraints: ::prost::alloc::vec::Vec<i32>,
2629 #[prost(bool, optional, tag = "2")]
2631 pub is_phantom: ::core::option::Option<bool>,
2632}
2633#[non_exhaustive]
2635#[derive(Clone, PartialEq, ::prost::Message)]
2636pub struct FieldDescriptor {
2637 #[prost(string, optional, tag = "1")]
2639 pub name: ::core::option::Option<::prost::alloc::string::String>,
2640 #[prost(uint32, optional, tag = "2")]
2642 pub position: ::core::option::Option<u32>,
2643 #[prost(message, optional, tag = "3")]
2645 pub r#type: ::core::option::Option<OpenSignatureBody>,
2646}
2647#[non_exhaustive]
2649#[derive(Clone, PartialEq, ::prost::Message)]
2650pub struct VariantDescriptor {
2651 #[prost(string, optional, tag = "1")]
2653 pub name: ::core::option::Option<::prost::alloc::string::String>,
2654 #[prost(uint32, optional, tag = "2")]
2656 pub position: ::core::option::Option<u32>,
2657 #[prost(message, repeated, tag = "3")]
2659 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
2660}
2661#[non_exhaustive]
2663#[derive(Clone, PartialEq, ::prost::Message)]
2664pub struct OpenSignatureBody {
2665 #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
2667 pub r#type: ::core::option::Option<i32>,
2668 #[prost(string, optional, tag = "2")]
2670 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
2671 #[prost(message, repeated, tag = "3")]
2673 pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
2674 #[prost(uint32, optional, tag = "4")]
2676 pub type_parameter: ::core::option::Option<u32>,
2677}
2678pub mod open_signature_body {
2680 #[non_exhaustive]
2681 #[derive(
2682 Clone,
2683 Copy,
2684 Debug,
2685 PartialEq,
2686 Eq,
2687 Hash,
2688 PartialOrd,
2689 Ord,
2690 ::prost::Enumeration
2691 )]
2692 #[repr(i32)]
2693 pub enum Type {
2694 Unknown = 0,
2695 Address = 1,
2696 Bool = 2,
2697 U8 = 3,
2698 U16 = 4,
2699 U32 = 5,
2700 U64 = 6,
2701 U128 = 7,
2702 U256 = 8,
2703 Vector = 9,
2704 Datatype = 10,
2705 Parameter = 11,
2706 }
2707 impl Type {
2708 pub fn as_str_name(&self) -> &'static str {
2713 match self {
2714 Self::Unknown => "TYPE_UNKNOWN",
2715 Self::Address => "ADDRESS",
2716 Self::Bool => "BOOL",
2717 Self::U8 => "U8",
2718 Self::U16 => "U16",
2719 Self::U32 => "U32",
2720 Self::U64 => "U64",
2721 Self::U128 => "U128",
2722 Self::U256 => "U256",
2723 Self::Vector => "VECTOR",
2724 Self::Datatype => "DATATYPE",
2725 Self::Parameter => "TYPE_PARAMETER",
2726 }
2727 }
2728 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2730 match value {
2731 "TYPE_UNKNOWN" => Some(Self::Unknown),
2732 "ADDRESS" => Some(Self::Address),
2733 "BOOL" => Some(Self::Bool),
2734 "U8" => Some(Self::U8),
2735 "U16" => Some(Self::U16),
2736 "U32" => Some(Self::U32),
2737 "U64" => Some(Self::U64),
2738 "U128" => Some(Self::U128),
2739 "U256" => Some(Self::U256),
2740 "VECTOR" => Some(Self::Vector),
2741 "DATATYPE" => Some(Self::Datatype),
2742 "TYPE_PARAMETER" => Some(Self::Parameter),
2743 _ => None,
2744 }
2745 }
2746 }
2747}
2748#[non_exhaustive]
2750#[derive(Clone, PartialEq, ::prost::Message)]
2751pub struct FunctionDescriptor {
2752 #[prost(string, optional, tag = "1")]
2754 pub name: ::core::option::Option<::prost::alloc::string::String>,
2755 #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
2757 pub visibility: ::core::option::Option<i32>,
2758 #[prost(bool, optional, tag = "6")]
2760 pub is_entry: ::core::option::Option<bool>,
2761 #[prost(message, repeated, tag = "7")]
2763 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
2764 #[prost(message, repeated, tag = "8")]
2766 pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
2767 #[prost(message, repeated, tag = "9")]
2769 pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
2770}
2771pub mod function_descriptor {
2773 #[non_exhaustive]
2774 #[derive(
2775 Clone,
2776 Copy,
2777 Debug,
2778 PartialEq,
2779 Eq,
2780 Hash,
2781 PartialOrd,
2782 Ord,
2783 ::prost::Enumeration
2784 )]
2785 #[repr(i32)]
2786 pub enum Visibility {
2787 Unknown = 0,
2788 Private = 1,
2789 Public = 2,
2790 Friend = 3,
2791 }
2792 impl Visibility {
2793 pub fn as_str_name(&self) -> &'static str {
2798 match self {
2799 Self::Unknown => "VISIBILITY_UNKNOWN",
2800 Self::Private => "PRIVATE",
2801 Self::Public => "PUBLIC",
2802 Self::Friend => "FRIEND",
2803 }
2804 }
2805 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2807 match value {
2808 "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
2809 "PRIVATE" => Some(Self::Private),
2810 "PUBLIC" => Some(Self::Public),
2811 "FRIEND" => Some(Self::Friend),
2812 _ => None,
2813 }
2814 }
2815 }
2816}
2817#[non_exhaustive]
2819#[derive(Clone, PartialEq, ::prost::Message)]
2820pub struct OpenSignature {
2821 #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
2822 pub reference: ::core::option::Option<i32>,
2823 #[prost(message, optional, tag = "2")]
2824 pub body: ::core::option::Option<OpenSignatureBody>,
2825}
2826pub mod open_signature {
2828 #[non_exhaustive]
2829 #[derive(
2830 Clone,
2831 Copy,
2832 Debug,
2833 PartialEq,
2834 Eq,
2835 Hash,
2836 PartialOrd,
2837 Ord,
2838 ::prost::Enumeration
2839 )]
2840 #[repr(i32)]
2841 pub enum Reference {
2842 Unknown = 0,
2843 Immutable = 1,
2844 Mutable = 2,
2845 }
2846 impl Reference {
2847 pub fn as_str_name(&self) -> &'static str {
2852 match self {
2853 Self::Unknown => "REFERENCE_UNKNOWN",
2854 Self::Immutable => "IMMUTABLE",
2855 Self::Mutable => "MUTABLE",
2856 }
2857 }
2858 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2860 match value {
2861 "REFERENCE_UNKNOWN" => Some(Self::Unknown),
2862 "IMMUTABLE" => Some(Self::Immutable),
2863 "MUTABLE" => Some(Self::Mutable),
2864 _ => None,
2865 }
2866 }
2867 }
2868}
2869#[non_exhaustive]
2871#[derive(Clone, PartialEq, ::prost::Message)]
2872pub struct TypeOrigin {
2873 #[prost(string, optional, tag = "1")]
2874 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
2875 #[prost(string, optional, tag = "2")]
2876 pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
2877 #[prost(string, optional, tag = "3")]
2878 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
2879}
2880#[non_exhaustive]
2882#[derive(Clone, PartialEq, ::prost::Message)]
2883pub struct Linkage {
2884 #[prost(string, optional, tag = "1")]
2886 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
2887 #[prost(string, optional, tag = "2")]
2889 pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
2890 #[prost(uint64, optional, tag = "3")]
2892 pub upgraded_version: ::core::option::Option<u64>,
2893}
2894#[non_exhaustive]
2896#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2897#[repr(i32)]
2898pub enum Ability {
2899 Unknown = 0,
2900 Copy = 1,
2902 Drop = 2,
2904 Store = 3,
2906 Key = 4,
2908}
2909impl Ability {
2910 pub fn as_str_name(&self) -> &'static str {
2915 match self {
2916 Self::Unknown => "ABILITY_UNKNOWN",
2917 Self::Copy => "COPY",
2918 Self::Drop => "DROP",
2919 Self::Store => "STORE",
2920 Self::Key => "KEY",
2921 }
2922 }
2923 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2925 match value {
2926 "ABILITY_UNKNOWN" => Some(Self::Unknown),
2927 "COPY" => Some(Self::Copy),
2928 "DROP" => Some(Self::Drop),
2929 "STORE" => Some(Self::Store),
2930 "KEY" => Some(Self::Key),
2931 _ => None,
2932 }
2933 }
2934}
2935#[non_exhaustive]
2936#[derive(Clone, PartialEq, ::prost::Message)]
2937pub struct GetPackageRequest {
2938 #[prost(string, optional, tag = "1")]
2940 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
2941}
2942#[non_exhaustive]
2943#[derive(Clone, PartialEq, ::prost::Message)]
2944pub struct GetPackageResponse {
2945 #[prost(message, optional, tag = "1")]
2947 pub package: ::core::option::Option<Package>,
2948}
2949#[non_exhaustive]
2950#[derive(Clone, PartialEq, ::prost::Message)]
2951pub struct GetDatatypeRequest {
2952 #[prost(string, optional, tag = "1")]
2954 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
2955 #[prost(string, optional, tag = "2")]
2957 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
2958 #[prost(string, optional, tag = "3")]
2960 pub name: ::core::option::Option<::prost::alloc::string::String>,
2961}
2962#[non_exhaustive]
2963#[derive(Clone, PartialEq, ::prost::Message)]
2964pub struct GetDatatypeResponse {
2965 #[prost(message, optional, tag = "1")]
2967 pub datatype: ::core::option::Option<DatatypeDescriptor>,
2968}
2969#[non_exhaustive]
2970#[derive(Clone, PartialEq, ::prost::Message)]
2971pub struct GetFunctionRequest {
2972 #[prost(string, optional, tag = "1")]
2974 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
2975 #[prost(string, optional, tag = "2")]
2977 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
2978 #[prost(string, optional, tag = "3")]
2980 pub name: ::core::option::Option<::prost::alloc::string::String>,
2981}
2982#[non_exhaustive]
2983#[derive(Clone, PartialEq, ::prost::Message)]
2984pub struct GetFunctionResponse {
2985 #[prost(message, optional, tag = "1")]
2987 pub function: ::core::option::Option<FunctionDescriptor>,
2988}
2989#[non_exhaustive]
2990#[derive(Clone, PartialEq, ::prost::Message)]
2991pub struct ListPackageVersionsRequest {
2992 #[prost(string, optional, tag = "1")]
2994 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
2995 #[prost(uint32, optional, tag = "2")]
2999 pub page_size: ::core::option::Option<u32>,
3000 #[prost(bytes = "bytes", optional, tag = "3")]
3006 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
3007}
3008#[non_exhaustive]
3009#[derive(Clone, PartialEq, ::prost::Message)]
3010pub struct ListPackageVersionsResponse {
3011 #[prost(message, repeated, tag = "1")]
3013 pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
3014 #[prost(bytes = "bytes", optional, tag = "2")]
3017 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
3018}
3019#[non_exhaustive]
3021#[derive(Clone, PartialEq, ::prost::Message)]
3022pub struct PackageVersion {
3023 #[prost(string, optional, tag = "1")]
3025 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3026 #[prost(uint64, optional, tag = "2")]
3028 pub version: ::core::option::Option<u64>,
3029}
3030pub mod move_package_service_client {
3032 #![allow(
3033 unused_variables,
3034 dead_code,
3035 missing_docs,
3036 clippy::wildcard_imports,
3037 clippy::let_unit_value,
3038 )]
3039 use tonic::codegen::*;
3040 use tonic::codegen::http::Uri;
3041 #[derive(Debug, Clone)]
3042 pub struct MovePackageServiceClient<T> {
3043 inner: tonic::client::Grpc<T>,
3044 }
3045 impl MovePackageServiceClient<tonic::transport::Channel> {
3046 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3048 where
3049 D: TryInto<tonic::transport::Endpoint>,
3050 D::Error: Into<StdError>,
3051 {
3052 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3053 Ok(Self::new(conn))
3054 }
3055 }
3056 impl<T> MovePackageServiceClient<T>
3057 where
3058 T: tonic::client::GrpcService<tonic::body::Body>,
3059 T::Error: Into<StdError>,
3060 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3061 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3062 {
3063 pub fn new(inner: T) -> Self {
3064 let inner = tonic::client::Grpc::new(inner);
3065 Self { inner }
3066 }
3067 pub fn with_origin(inner: T, origin: Uri) -> Self {
3068 let inner = tonic::client::Grpc::with_origin(inner, origin);
3069 Self { inner }
3070 }
3071 pub fn with_interceptor<F>(
3072 inner: T,
3073 interceptor: F,
3074 ) -> MovePackageServiceClient<InterceptedService<T, F>>
3075 where
3076 F: tonic::service::Interceptor,
3077 T::ResponseBody: Default,
3078 T: tonic::codegen::Service<
3079 http::Request<tonic::body::Body>,
3080 Response = http::Response<
3081 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3082 >,
3083 >,
3084 <T as tonic::codegen::Service<
3085 http::Request<tonic::body::Body>,
3086 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3087 {
3088 MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
3089 }
3090 #[must_use]
3095 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3096 self.inner = self.inner.send_compressed(encoding);
3097 self
3098 }
3099 #[must_use]
3101 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3102 self.inner = self.inner.accept_compressed(encoding);
3103 self
3104 }
3105 #[must_use]
3109 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3110 self.inner = self.inner.max_decoding_message_size(limit);
3111 self
3112 }
3113 #[must_use]
3117 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3118 self.inner = self.inner.max_encoding_message_size(limit);
3119 self
3120 }
3121 pub async fn get_package(
3122 &mut self,
3123 request: impl tonic::IntoRequest<super::GetPackageRequest>,
3124 ) -> std::result::Result<
3125 tonic::Response<super::GetPackageResponse>,
3126 tonic::Status,
3127 > {
3128 self.inner
3129 .ready()
3130 .await
3131 .map_err(|e| {
3132 tonic::Status::unknown(
3133 format!("Service was not ready: {}", e.into()),
3134 )
3135 })?;
3136 let codec = tonic::codec::ProstCodec::default();
3137 let path = http::uri::PathAndQuery::from_static(
3138 "/sui.rpc.v2.MovePackageService/GetPackage",
3139 );
3140 let mut req = request.into_request();
3141 req.extensions_mut()
3142 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
3143 self.inner.unary(req, path, codec).await
3144 }
3145 pub async fn get_datatype(
3146 &mut self,
3147 request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
3148 ) -> std::result::Result<
3149 tonic::Response<super::GetDatatypeResponse>,
3150 tonic::Status,
3151 > {
3152 self.inner
3153 .ready()
3154 .await
3155 .map_err(|e| {
3156 tonic::Status::unknown(
3157 format!("Service was not ready: {}", e.into()),
3158 )
3159 })?;
3160 let codec = tonic::codec::ProstCodec::default();
3161 let path = http::uri::PathAndQuery::from_static(
3162 "/sui.rpc.v2.MovePackageService/GetDatatype",
3163 );
3164 let mut req = request.into_request();
3165 req.extensions_mut()
3166 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
3167 self.inner.unary(req, path, codec).await
3168 }
3169 pub async fn get_function(
3170 &mut self,
3171 request: impl tonic::IntoRequest<super::GetFunctionRequest>,
3172 ) -> std::result::Result<
3173 tonic::Response<super::GetFunctionResponse>,
3174 tonic::Status,
3175 > {
3176 self.inner
3177 .ready()
3178 .await
3179 .map_err(|e| {
3180 tonic::Status::unknown(
3181 format!("Service was not ready: {}", e.into()),
3182 )
3183 })?;
3184 let codec = tonic::codec::ProstCodec::default();
3185 let path = http::uri::PathAndQuery::from_static(
3186 "/sui.rpc.v2.MovePackageService/GetFunction",
3187 );
3188 let mut req = request.into_request();
3189 req.extensions_mut()
3190 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
3191 self.inner.unary(req, path, codec).await
3192 }
3193 pub async fn list_package_versions(
3194 &mut self,
3195 request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
3196 ) -> std::result::Result<
3197 tonic::Response<super::ListPackageVersionsResponse>,
3198 tonic::Status,
3199 > {
3200 self.inner
3201 .ready()
3202 .await
3203 .map_err(|e| {
3204 tonic::Status::unknown(
3205 format!("Service was not ready: {}", e.into()),
3206 )
3207 })?;
3208 let codec = tonic::codec::ProstCodec::default();
3209 let path = http::uri::PathAndQuery::from_static(
3210 "/sui.rpc.v2.MovePackageService/ListPackageVersions",
3211 );
3212 let mut req = request.into_request();
3213 req.extensions_mut()
3214 .insert(
3215 GrpcMethod::new(
3216 "sui.rpc.v2.MovePackageService",
3217 "ListPackageVersions",
3218 ),
3219 );
3220 self.inner.unary(req, path, codec).await
3221 }
3222 }
3223}
3224pub mod move_package_service_server {
3226 #![allow(
3227 unused_variables,
3228 dead_code,
3229 missing_docs,
3230 clippy::wildcard_imports,
3231 clippy::let_unit_value,
3232 )]
3233 use tonic::codegen::*;
3234 #[async_trait]
3236 pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
3237 async fn get_package(
3238 &self,
3239 request: tonic::Request<super::GetPackageRequest>,
3240 ) -> std::result::Result<
3241 tonic::Response<super::GetPackageResponse>,
3242 tonic::Status,
3243 >;
3244 async fn get_datatype(
3245 &self,
3246 request: tonic::Request<super::GetDatatypeRequest>,
3247 ) -> std::result::Result<
3248 tonic::Response<super::GetDatatypeResponse>,
3249 tonic::Status,
3250 >;
3251 async fn get_function(
3252 &self,
3253 request: tonic::Request<super::GetFunctionRequest>,
3254 ) -> std::result::Result<
3255 tonic::Response<super::GetFunctionResponse>,
3256 tonic::Status,
3257 >;
3258 async fn list_package_versions(
3259 &self,
3260 request: tonic::Request<super::ListPackageVersionsRequest>,
3261 ) -> std::result::Result<
3262 tonic::Response<super::ListPackageVersionsResponse>,
3263 tonic::Status,
3264 >;
3265 }
3266 #[derive(Debug)]
3267 pub struct MovePackageServiceServer<T> {
3268 inner: Arc<T>,
3269 accept_compression_encodings: EnabledCompressionEncodings,
3270 send_compression_encodings: EnabledCompressionEncodings,
3271 max_decoding_message_size: Option<usize>,
3272 max_encoding_message_size: Option<usize>,
3273 }
3274 impl<T> MovePackageServiceServer<T> {
3275 pub fn new(inner: T) -> Self {
3276 Self::from_arc(Arc::new(inner))
3277 }
3278 pub fn from_arc(inner: Arc<T>) -> Self {
3279 Self {
3280 inner,
3281 accept_compression_encodings: Default::default(),
3282 send_compression_encodings: Default::default(),
3283 max_decoding_message_size: None,
3284 max_encoding_message_size: None,
3285 }
3286 }
3287 pub fn with_interceptor<F>(
3288 inner: T,
3289 interceptor: F,
3290 ) -> InterceptedService<Self, F>
3291 where
3292 F: tonic::service::Interceptor,
3293 {
3294 InterceptedService::new(Self::new(inner), interceptor)
3295 }
3296 #[must_use]
3298 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3299 self.accept_compression_encodings.enable(encoding);
3300 self
3301 }
3302 #[must_use]
3304 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3305 self.send_compression_encodings.enable(encoding);
3306 self
3307 }
3308 #[must_use]
3312 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3313 self.max_decoding_message_size = Some(limit);
3314 self
3315 }
3316 #[must_use]
3320 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3321 self.max_encoding_message_size = Some(limit);
3322 self
3323 }
3324 }
3325 impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
3326 where
3327 T: MovePackageService,
3328 B: Body + std::marker::Send + 'static,
3329 B::Error: Into<StdError> + std::marker::Send + 'static,
3330 {
3331 type Response = http::Response<tonic::body::Body>;
3332 type Error = std::convert::Infallible;
3333 type Future = BoxFuture<Self::Response, Self::Error>;
3334 fn poll_ready(
3335 &mut self,
3336 _cx: &mut Context<'_>,
3337 ) -> Poll<std::result::Result<(), Self::Error>> {
3338 Poll::Ready(Ok(()))
3339 }
3340 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3341 match req.uri().path() {
3342 "/sui.rpc.v2.MovePackageService/GetPackage" => {
3343 #[allow(non_camel_case_types)]
3344 struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
3345 impl<
3346 T: MovePackageService,
3347 > tonic::server::UnaryService<super::GetPackageRequest>
3348 for GetPackageSvc<T> {
3349 type Response = super::GetPackageResponse;
3350 type Future = BoxFuture<
3351 tonic::Response<Self::Response>,
3352 tonic::Status,
3353 >;
3354 fn call(
3355 &mut self,
3356 request: tonic::Request<super::GetPackageRequest>,
3357 ) -> Self::Future {
3358 let inner = Arc::clone(&self.0);
3359 let fut = async move {
3360 <T as MovePackageService>::get_package(&inner, request)
3361 .await
3362 };
3363 Box::pin(fut)
3364 }
3365 }
3366 let accept_compression_encodings = self.accept_compression_encodings;
3367 let send_compression_encodings = self.send_compression_encodings;
3368 let max_decoding_message_size = self.max_decoding_message_size;
3369 let max_encoding_message_size = self.max_encoding_message_size;
3370 let inner = self.inner.clone();
3371 let fut = async move {
3372 let method = GetPackageSvc(inner);
3373 let codec = tonic::codec::ProstCodec::default();
3374 let mut grpc = tonic::server::Grpc::new(codec)
3375 .apply_compression_config(
3376 accept_compression_encodings,
3377 send_compression_encodings,
3378 )
3379 .apply_max_message_size_config(
3380 max_decoding_message_size,
3381 max_encoding_message_size,
3382 );
3383 let res = grpc.unary(method, req).await;
3384 Ok(res)
3385 };
3386 Box::pin(fut)
3387 }
3388 "/sui.rpc.v2.MovePackageService/GetDatatype" => {
3389 #[allow(non_camel_case_types)]
3390 struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
3391 impl<
3392 T: MovePackageService,
3393 > tonic::server::UnaryService<super::GetDatatypeRequest>
3394 for GetDatatypeSvc<T> {
3395 type Response = super::GetDatatypeResponse;
3396 type Future = BoxFuture<
3397 tonic::Response<Self::Response>,
3398 tonic::Status,
3399 >;
3400 fn call(
3401 &mut self,
3402 request: tonic::Request<super::GetDatatypeRequest>,
3403 ) -> Self::Future {
3404 let inner = Arc::clone(&self.0);
3405 let fut = async move {
3406 <T as MovePackageService>::get_datatype(&inner, request)
3407 .await
3408 };
3409 Box::pin(fut)
3410 }
3411 }
3412 let accept_compression_encodings = self.accept_compression_encodings;
3413 let send_compression_encodings = self.send_compression_encodings;
3414 let max_decoding_message_size = self.max_decoding_message_size;
3415 let max_encoding_message_size = self.max_encoding_message_size;
3416 let inner = self.inner.clone();
3417 let fut = async move {
3418 let method = GetDatatypeSvc(inner);
3419 let codec = tonic::codec::ProstCodec::default();
3420 let mut grpc = tonic::server::Grpc::new(codec)
3421 .apply_compression_config(
3422 accept_compression_encodings,
3423 send_compression_encodings,
3424 )
3425 .apply_max_message_size_config(
3426 max_decoding_message_size,
3427 max_encoding_message_size,
3428 );
3429 let res = grpc.unary(method, req).await;
3430 Ok(res)
3431 };
3432 Box::pin(fut)
3433 }
3434 "/sui.rpc.v2.MovePackageService/GetFunction" => {
3435 #[allow(non_camel_case_types)]
3436 struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
3437 impl<
3438 T: MovePackageService,
3439 > tonic::server::UnaryService<super::GetFunctionRequest>
3440 for GetFunctionSvc<T> {
3441 type Response = super::GetFunctionResponse;
3442 type Future = BoxFuture<
3443 tonic::Response<Self::Response>,
3444 tonic::Status,
3445 >;
3446 fn call(
3447 &mut self,
3448 request: tonic::Request<super::GetFunctionRequest>,
3449 ) -> Self::Future {
3450 let inner = Arc::clone(&self.0);
3451 let fut = async move {
3452 <T as MovePackageService>::get_function(&inner, request)
3453 .await
3454 };
3455 Box::pin(fut)
3456 }
3457 }
3458 let accept_compression_encodings = self.accept_compression_encodings;
3459 let send_compression_encodings = self.send_compression_encodings;
3460 let max_decoding_message_size = self.max_decoding_message_size;
3461 let max_encoding_message_size = self.max_encoding_message_size;
3462 let inner = self.inner.clone();
3463 let fut = async move {
3464 let method = GetFunctionSvc(inner);
3465 let codec = tonic::codec::ProstCodec::default();
3466 let mut grpc = tonic::server::Grpc::new(codec)
3467 .apply_compression_config(
3468 accept_compression_encodings,
3469 send_compression_encodings,
3470 )
3471 .apply_max_message_size_config(
3472 max_decoding_message_size,
3473 max_encoding_message_size,
3474 );
3475 let res = grpc.unary(method, req).await;
3476 Ok(res)
3477 };
3478 Box::pin(fut)
3479 }
3480 "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
3481 #[allow(non_camel_case_types)]
3482 struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
3483 impl<
3484 T: MovePackageService,
3485 > tonic::server::UnaryService<super::ListPackageVersionsRequest>
3486 for ListPackageVersionsSvc<T> {
3487 type Response = super::ListPackageVersionsResponse;
3488 type Future = BoxFuture<
3489 tonic::Response<Self::Response>,
3490 tonic::Status,
3491 >;
3492 fn call(
3493 &mut self,
3494 request: tonic::Request<super::ListPackageVersionsRequest>,
3495 ) -> Self::Future {
3496 let inner = Arc::clone(&self.0);
3497 let fut = async move {
3498 <T as MovePackageService>::list_package_versions(
3499 &inner,
3500 request,
3501 )
3502 .await
3503 };
3504 Box::pin(fut)
3505 }
3506 }
3507 let accept_compression_encodings = self.accept_compression_encodings;
3508 let send_compression_encodings = self.send_compression_encodings;
3509 let max_decoding_message_size = self.max_decoding_message_size;
3510 let max_encoding_message_size = self.max_encoding_message_size;
3511 let inner = self.inner.clone();
3512 let fut = async move {
3513 let method = ListPackageVersionsSvc(inner);
3514 let codec = tonic::codec::ProstCodec::default();
3515 let mut grpc = tonic::server::Grpc::new(codec)
3516 .apply_compression_config(
3517 accept_compression_encodings,
3518 send_compression_encodings,
3519 )
3520 .apply_max_message_size_config(
3521 max_decoding_message_size,
3522 max_encoding_message_size,
3523 );
3524 let res = grpc.unary(method, req).await;
3525 Ok(res)
3526 };
3527 Box::pin(fut)
3528 }
3529 _ => {
3530 Box::pin(async move {
3531 let mut response = http::Response::new(
3532 tonic::body::Body::default(),
3533 );
3534 let headers = response.headers_mut();
3535 headers
3536 .insert(
3537 tonic::Status::GRPC_STATUS,
3538 (tonic::Code::Unimplemented as i32).into(),
3539 );
3540 headers
3541 .insert(
3542 http::header::CONTENT_TYPE,
3543 tonic::metadata::GRPC_CONTENT_TYPE,
3544 );
3545 Ok(response)
3546 })
3547 }
3548 }
3549 }
3550 }
3551 impl<T> Clone for MovePackageServiceServer<T> {
3552 fn clone(&self) -> Self {
3553 let inner = self.inner.clone();
3554 Self {
3555 inner,
3556 accept_compression_encodings: self.accept_compression_encodings,
3557 send_compression_encodings: self.send_compression_encodings,
3558 max_decoding_message_size: self.max_decoding_message_size,
3559 max_encoding_message_size: self.max_encoding_message_size,
3560 }
3561 }
3562 }
3563 pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
3565 impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
3566 const NAME: &'static str = SERVICE_NAME;
3567 }
3568}
3569#[non_exhaustive]
3570#[derive(Clone, PartialEq, ::prost::Message)]
3571pub struct LookupNameRequest {
3572 #[prost(string, optional, tag = "1")]
3576 pub name: ::core::option::Option<::prost::alloc::string::String>,
3577}
3578#[non_exhaustive]
3579#[derive(Clone, PartialEq, ::prost::Message)]
3580pub struct LookupNameResponse {
3581 #[prost(message, optional, tag = "1")]
3583 pub record: ::core::option::Option<NameRecord>,
3584}
3585#[non_exhaustive]
3586#[derive(Clone, PartialEq, ::prost::Message)]
3587pub struct ReverseLookupNameRequest {
3588 #[prost(string, optional, tag = "1")]
3590 pub address: ::core::option::Option<::prost::alloc::string::String>,
3591}
3592#[non_exhaustive]
3593#[derive(Clone, PartialEq, ::prost::Message)]
3594pub struct ReverseLookupNameResponse {
3595 #[prost(message, optional, tag = "1")]
3597 pub record: ::core::option::Option<NameRecord>,
3598}
3599#[non_exhaustive]
3600#[derive(Clone, PartialEq, ::prost::Message)]
3601pub struct NameRecord {
3602 #[prost(string, optional, tag = "1")]
3607 pub id: ::core::option::Option<::prost::alloc::string::String>,
3608 #[prost(string, optional, tag = "2")]
3610 pub name: ::core::option::Option<::prost::alloc::string::String>,
3611 #[prost(string, optional, tag = "3")]
3619 pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
3620 #[prost(message, optional, tag = "4")]
3625 pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
3626 #[prost(string, optional, tag = "5")]
3628 pub target_address: ::core::option::Option<::prost::alloc::string::String>,
3629 #[prost(btree_map = "string, string", tag = "6")]
3631 pub data: ::prost::alloc::collections::BTreeMap<
3632 ::prost::alloc::string::String,
3633 ::prost::alloc::string::String,
3634 >,
3635}
3636pub mod name_service_client {
3638 #![allow(
3639 unused_variables,
3640 dead_code,
3641 missing_docs,
3642 clippy::wildcard_imports,
3643 clippy::let_unit_value,
3644 )]
3645 use tonic::codegen::*;
3646 use tonic::codegen::http::Uri;
3647 #[derive(Debug, Clone)]
3648 pub struct NameServiceClient<T> {
3649 inner: tonic::client::Grpc<T>,
3650 }
3651 impl NameServiceClient<tonic::transport::Channel> {
3652 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3654 where
3655 D: TryInto<tonic::transport::Endpoint>,
3656 D::Error: Into<StdError>,
3657 {
3658 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3659 Ok(Self::new(conn))
3660 }
3661 }
3662 impl<T> NameServiceClient<T>
3663 where
3664 T: tonic::client::GrpcService<tonic::body::Body>,
3665 T::Error: Into<StdError>,
3666 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3667 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3668 {
3669 pub fn new(inner: T) -> Self {
3670 let inner = tonic::client::Grpc::new(inner);
3671 Self { inner }
3672 }
3673 pub fn with_origin(inner: T, origin: Uri) -> Self {
3674 let inner = tonic::client::Grpc::with_origin(inner, origin);
3675 Self { inner }
3676 }
3677 pub fn with_interceptor<F>(
3678 inner: T,
3679 interceptor: F,
3680 ) -> NameServiceClient<InterceptedService<T, F>>
3681 where
3682 F: tonic::service::Interceptor,
3683 T::ResponseBody: Default,
3684 T: tonic::codegen::Service<
3685 http::Request<tonic::body::Body>,
3686 Response = http::Response<
3687 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3688 >,
3689 >,
3690 <T as tonic::codegen::Service<
3691 http::Request<tonic::body::Body>,
3692 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3693 {
3694 NameServiceClient::new(InterceptedService::new(inner, interceptor))
3695 }
3696 #[must_use]
3701 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3702 self.inner = self.inner.send_compressed(encoding);
3703 self
3704 }
3705 #[must_use]
3707 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3708 self.inner = self.inner.accept_compressed(encoding);
3709 self
3710 }
3711 #[must_use]
3715 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3716 self.inner = self.inner.max_decoding_message_size(limit);
3717 self
3718 }
3719 #[must_use]
3723 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3724 self.inner = self.inner.max_encoding_message_size(limit);
3725 self
3726 }
3727 pub async fn lookup_name(
3728 &mut self,
3729 request: impl tonic::IntoRequest<super::LookupNameRequest>,
3730 ) -> std::result::Result<
3731 tonic::Response<super::LookupNameResponse>,
3732 tonic::Status,
3733 > {
3734 self.inner
3735 .ready()
3736 .await
3737 .map_err(|e| {
3738 tonic::Status::unknown(
3739 format!("Service was not ready: {}", e.into()),
3740 )
3741 })?;
3742 let codec = tonic::codec::ProstCodec::default();
3743 let path = http::uri::PathAndQuery::from_static(
3744 "/sui.rpc.v2.NameService/LookupName",
3745 );
3746 let mut req = request.into_request();
3747 req.extensions_mut()
3748 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
3749 self.inner.unary(req, path, codec).await
3750 }
3751 pub async fn reverse_lookup_name(
3752 &mut self,
3753 request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
3754 ) -> std::result::Result<
3755 tonic::Response<super::ReverseLookupNameResponse>,
3756 tonic::Status,
3757 > {
3758 self.inner
3759 .ready()
3760 .await
3761 .map_err(|e| {
3762 tonic::Status::unknown(
3763 format!("Service was not ready: {}", e.into()),
3764 )
3765 })?;
3766 let codec = tonic::codec::ProstCodec::default();
3767 let path = http::uri::PathAndQuery::from_static(
3768 "/sui.rpc.v2.NameService/ReverseLookupName",
3769 );
3770 let mut req = request.into_request();
3771 req.extensions_mut()
3772 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
3773 self.inner.unary(req, path, codec).await
3774 }
3775 }
3776}
3777pub mod name_service_server {
3779 #![allow(
3780 unused_variables,
3781 dead_code,
3782 missing_docs,
3783 clippy::wildcard_imports,
3784 clippy::let_unit_value,
3785 )]
3786 use tonic::codegen::*;
3787 #[async_trait]
3789 pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
3790 async fn lookup_name(
3791 &self,
3792 request: tonic::Request<super::LookupNameRequest>,
3793 ) -> std::result::Result<
3794 tonic::Response<super::LookupNameResponse>,
3795 tonic::Status,
3796 >;
3797 async fn reverse_lookup_name(
3798 &self,
3799 request: tonic::Request<super::ReverseLookupNameRequest>,
3800 ) -> std::result::Result<
3801 tonic::Response<super::ReverseLookupNameResponse>,
3802 tonic::Status,
3803 >;
3804 }
3805 #[derive(Debug)]
3806 pub struct NameServiceServer<T> {
3807 inner: Arc<T>,
3808 accept_compression_encodings: EnabledCompressionEncodings,
3809 send_compression_encodings: EnabledCompressionEncodings,
3810 max_decoding_message_size: Option<usize>,
3811 max_encoding_message_size: Option<usize>,
3812 }
3813 impl<T> NameServiceServer<T> {
3814 pub fn new(inner: T) -> Self {
3815 Self::from_arc(Arc::new(inner))
3816 }
3817 pub fn from_arc(inner: Arc<T>) -> Self {
3818 Self {
3819 inner,
3820 accept_compression_encodings: Default::default(),
3821 send_compression_encodings: Default::default(),
3822 max_decoding_message_size: None,
3823 max_encoding_message_size: None,
3824 }
3825 }
3826 pub fn with_interceptor<F>(
3827 inner: T,
3828 interceptor: F,
3829 ) -> InterceptedService<Self, F>
3830 where
3831 F: tonic::service::Interceptor,
3832 {
3833 InterceptedService::new(Self::new(inner), interceptor)
3834 }
3835 #[must_use]
3837 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3838 self.accept_compression_encodings.enable(encoding);
3839 self
3840 }
3841 #[must_use]
3843 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3844 self.send_compression_encodings.enable(encoding);
3845 self
3846 }
3847 #[must_use]
3851 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3852 self.max_decoding_message_size = Some(limit);
3853 self
3854 }
3855 #[must_use]
3859 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3860 self.max_encoding_message_size = Some(limit);
3861 self
3862 }
3863 }
3864 impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
3865 where
3866 T: NameService,
3867 B: Body + std::marker::Send + 'static,
3868 B::Error: Into<StdError> + std::marker::Send + 'static,
3869 {
3870 type Response = http::Response<tonic::body::Body>;
3871 type Error = std::convert::Infallible;
3872 type Future = BoxFuture<Self::Response, Self::Error>;
3873 fn poll_ready(
3874 &mut self,
3875 _cx: &mut Context<'_>,
3876 ) -> Poll<std::result::Result<(), Self::Error>> {
3877 Poll::Ready(Ok(()))
3878 }
3879 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3880 match req.uri().path() {
3881 "/sui.rpc.v2.NameService/LookupName" => {
3882 #[allow(non_camel_case_types)]
3883 struct LookupNameSvc<T: NameService>(pub Arc<T>);
3884 impl<
3885 T: NameService,
3886 > tonic::server::UnaryService<super::LookupNameRequest>
3887 for LookupNameSvc<T> {
3888 type Response = super::LookupNameResponse;
3889 type Future = BoxFuture<
3890 tonic::Response<Self::Response>,
3891 tonic::Status,
3892 >;
3893 fn call(
3894 &mut self,
3895 request: tonic::Request<super::LookupNameRequest>,
3896 ) -> Self::Future {
3897 let inner = Arc::clone(&self.0);
3898 let fut = async move {
3899 <T as NameService>::lookup_name(&inner, request).await
3900 };
3901 Box::pin(fut)
3902 }
3903 }
3904 let accept_compression_encodings = self.accept_compression_encodings;
3905 let send_compression_encodings = self.send_compression_encodings;
3906 let max_decoding_message_size = self.max_decoding_message_size;
3907 let max_encoding_message_size = self.max_encoding_message_size;
3908 let inner = self.inner.clone();
3909 let fut = async move {
3910 let method = LookupNameSvc(inner);
3911 let codec = tonic::codec::ProstCodec::default();
3912 let mut grpc = tonic::server::Grpc::new(codec)
3913 .apply_compression_config(
3914 accept_compression_encodings,
3915 send_compression_encodings,
3916 )
3917 .apply_max_message_size_config(
3918 max_decoding_message_size,
3919 max_encoding_message_size,
3920 );
3921 let res = grpc.unary(method, req).await;
3922 Ok(res)
3923 };
3924 Box::pin(fut)
3925 }
3926 "/sui.rpc.v2.NameService/ReverseLookupName" => {
3927 #[allow(non_camel_case_types)]
3928 struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
3929 impl<
3930 T: NameService,
3931 > tonic::server::UnaryService<super::ReverseLookupNameRequest>
3932 for ReverseLookupNameSvc<T> {
3933 type Response = super::ReverseLookupNameResponse;
3934 type Future = BoxFuture<
3935 tonic::Response<Self::Response>,
3936 tonic::Status,
3937 >;
3938 fn call(
3939 &mut self,
3940 request: tonic::Request<super::ReverseLookupNameRequest>,
3941 ) -> Self::Future {
3942 let inner = Arc::clone(&self.0);
3943 let fut = async move {
3944 <T as NameService>::reverse_lookup_name(&inner, request)
3945 .await
3946 };
3947 Box::pin(fut)
3948 }
3949 }
3950 let accept_compression_encodings = self.accept_compression_encodings;
3951 let send_compression_encodings = self.send_compression_encodings;
3952 let max_decoding_message_size = self.max_decoding_message_size;
3953 let max_encoding_message_size = self.max_encoding_message_size;
3954 let inner = self.inner.clone();
3955 let fut = async move {
3956 let method = ReverseLookupNameSvc(inner);
3957 let codec = tonic::codec::ProstCodec::default();
3958 let mut grpc = tonic::server::Grpc::new(codec)
3959 .apply_compression_config(
3960 accept_compression_encodings,
3961 send_compression_encodings,
3962 )
3963 .apply_max_message_size_config(
3964 max_decoding_message_size,
3965 max_encoding_message_size,
3966 );
3967 let res = grpc.unary(method, req).await;
3968 Ok(res)
3969 };
3970 Box::pin(fut)
3971 }
3972 _ => {
3973 Box::pin(async move {
3974 let mut response = http::Response::new(
3975 tonic::body::Body::default(),
3976 );
3977 let headers = response.headers_mut();
3978 headers
3979 .insert(
3980 tonic::Status::GRPC_STATUS,
3981 (tonic::Code::Unimplemented as i32).into(),
3982 );
3983 headers
3984 .insert(
3985 http::header::CONTENT_TYPE,
3986 tonic::metadata::GRPC_CONTENT_TYPE,
3987 );
3988 Ok(response)
3989 })
3990 }
3991 }
3992 }
3993 }
3994 impl<T> Clone for NameServiceServer<T> {
3995 fn clone(&self) -> Self {
3996 let inner = self.inner.clone();
3997 Self {
3998 inner,
3999 accept_compression_encodings: self.accept_compression_encodings,
4000 send_compression_encodings: self.send_compression_encodings,
4001 max_decoding_message_size: self.max_decoding_message_size,
4002 max_encoding_message_size: self.max_encoding_message_size,
4003 }
4004 }
4005 }
4006 pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
4008 impl<T> tonic::server::NamedService for NameServiceServer<T> {
4009 const NAME: &'static str = SERVICE_NAME;
4010 }
4011}
4012#[non_exhaustive]
4014#[derive(Clone, PartialEq, ::prost::Message)]
4015pub struct Object {
4016 #[prost(message, optional, tag = "1")]
4018 pub bcs: ::core::option::Option<Bcs>,
4019 #[prost(string, optional, tag = "2")]
4021 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4022 #[prost(uint64, optional, tag = "3")]
4024 pub version: ::core::option::Option<u64>,
4025 #[prost(string, optional, tag = "4")]
4027 pub digest: ::core::option::Option<::prost::alloc::string::String>,
4028 #[prost(message, optional, tag = "5")]
4030 pub owner: ::core::option::Option<Owner>,
4031 #[prost(string, optional, tag = "6")]
4035 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
4036 #[prost(bool, optional, tag = "7")]
4041 pub has_public_transfer: ::core::option::Option<bool>,
4042 #[prost(message, optional, tag = "8")]
4046 pub contents: ::core::option::Option<Bcs>,
4047 #[prost(message, optional, tag = "9")]
4049 pub package: ::core::option::Option<Package>,
4050 #[prost(string, optional, tag = "10")]
4052 pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
4053 #[prost(uint64, optional, tag = "11")]
4057 pub storage_rebate: ::core::option::Option<u64>,
4058 #[prost(message, optional, boxed, tag = "100")]
4060 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
4061 #[prost(uint64, optional, tag = "101")]
4063 pub balance: ::core::option::Option<u64>,
4064}
4065#[non_exhaustive]
4067#[derive(Clone, PartialEq, ::prost::Message)]
4068pub struct ObjectSet {
4069 #[prost(message, repeated, tag = "1")]
4071 pub objects: ::prost::alloc::vec::Vec<Object>,
4072}
4073#[non_exhaustive]
4075#[derive(Clone, PartialEq, ::prost::Message)]
4076pub struct ObjectReference {
4077 #[prost(string, optional, tag = "1")]
4079 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4080 #[prost(uint64, optional, tag = "2")]
4082 pub version: ::core::option::Option<u64>,
4083 #[prost(string, optional, tag = "3")]
4085 pub digest: ::core::option::Option<::prost::alloc::string::String>,
4086}
4087#[non_exhaustive]
4089#[derive(Clone, PartialEq, ::prost::Message)]
4090pub struct Owner {
4091 #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
4092 pub kind: ::core::option::Option<i32>,
4093 #[prost(string, optional, tag = "2")]
4095 pub address: ::core::option::Option<::prost::alloc::string::String>,
4096 #[prost(uint64, optional, tag = "3")]
4098 pub version: ::core::option::Option<u64>,
4099}
4100pub mod owner {
4102 #[non_exhaustive]
4103 #[derive(
4104 Clone,
4105 Copy,
4106 Debug,
4107 PartialEq,
4108 Eq,
4109 Hash,
4110 PartialOrd,
4111 Ord,
4112 ::prost::Enumeration
4113 )]
4114 #[repr(i32)]
4115 pub enum OwnerKind {
4116 Unknown = 0,
4117 Address = 1,
4118 Object = 2,
4119 Shared = 3,
4120 Immutable = 4,
4121 ConsensusAddress = 5,
4122 }
4123 impl OwnerKind {
4124 pub fn as_str_name(&self) -> &'static str {
4129 match self {
4130 Self::Unknown => "OWNER_KIND_UNKNOWN",
4131 Self::Address => "ADDRESS",
4132 Self::Object => "OBJECT",
4133 Self::Shared => "SHARED",
4134 Self::Immutable => "IMMUTABLE",
4135 Self::ConsensusAddress => "CONSENSUS_ADDRESS",
4136 }
4137 }
4138 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4140 match value {
4141 "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
4142 "ADDRESS" => Some(Self::Address),
4143 "OBJECT" => Some(Self::Object),
4144 "SHARED" => Some(Self::Shared),
4145 "IMMUTABLE" => Some(Self::Immutable),
4146 "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
4147 _ => None,
4148 }
4149 }
4150 }
4151}
4152#[non_exhaustive]
4153#[derive(Clone, PartialEq, ::prost::Message)]
4154pub struct ProtocolConfig {
4155 #[prost(uint64, optional, tag = "1")]
4156 pub protocol_version: ::core::option::Option<u64>,
4157 #[prost(btree_map = "string, bool", tag = "2")]
4158 pub feature_flags: ::prost::alloc::collections::BTreeMap<
4159 ::prost::alloc::string::String,
4160 bool,
4161 >,
4162 #[prost(btree_map = "string, string", tag = "3")]
4163 pub attributes: ::prost::alloc::collections::BTreeMap<
4164 ::prost::alloc::string::String,
4165 ::prost::alloc::string::String,
4166 >,
4167}
4168#[non_exhaustive]
4170#[derive(Clone, PartialEq, ::prost::Message)]
4171pub struct UserSignature {
4172 #[prost(message, optional, tag = "1")]
4177 pub bcs: ::core::option::Option<Bcs>,
4178 #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
4180 pub scheme: ::core::option::Option<i32>,
4181 #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
4182 pub signature: ::core::option::Option<user_signature::Signature>,
4183}
4184pub mod user_signature {
4186 #[non_exhaustive]
4187 #[derive(Clone, PartialEq, ::prost::Oneof)]
4188 pub enum Signature {
4189 #[prost(message, tag = "3")]
4191 Simple(super::SimpleSignature),
4192 #[prost(message, tag = "4")]
4194 Multisig(super::MultisigAggregatedSignature),
4195 #[prost(message, tag = "5")]
4197 Zklogin(super::ZkLoginAuthenticator),
4198 #[prost(message, tag = "6")]
4200 Passkey(super::PasskeyAuthenticator),
4201 }
4202}
4203#[non_exhaustive]
4205#[derive(Clone, PartialEq, ::prost::Message)]
4206pub struct SimpleSignature {
4207 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4209 pub scheme: ::core::option::Option<i32>,
4210 #[prost(bytes = "bytes", optional, tag = "2")]
4212 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4213 #[prost(bytes = "bytes", optional, tag = "3")]
4215 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4216}
4217#[non_exhaustive]
4219#[derive(Clone, PartialEq, ::prost::Message)]
4220pub struct ZkLoginPublicIdentifier {
4221 #[prost(string, optional, tag = "1")]
4222 pub iss: ::core::option::Option<::prost::alloc::string::String>,
4223 #[prost(string, optional, tag = "2")]
4225 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4226}
4227#[non_exhaustive]
4229#[derive(Clone, PartialEq, ::prost::Message)]
4230pub struct MultisigMemberPublicKey {
4231 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4233 pub scheme: ::core::option::Option<i32>,
4234 #[prost(bytes = "bytes", optional, tag = "2")]
4236 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4237 #[prost(message, optional, tag = "3")]
4239 pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
4240}
4241#[non_exhaustive]
4243#[derive(Clone, PartialEq, ::prost::Message)]
4244pub struct MultisigMember {
4245 #[prost(message, optional, tag = "1")]
4247 pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
4248 #[prost(uint32, optional, tag = "2")]
4250 pub weight: ::core::option::Option<u32>,
4251}
4252#[non_exhaustive]
4254#[derive(Clone, PartialEq, ::prost::Message)]
4255pub struct MultisigCommittee {
4256 #[prost(message, repeated, tag = "1")]
4258 pub members: ::prost::alloc::vec::Vec<MultisigMember>,
4259 #[prost(uint32, optional, tag = "2")]
4262 pub threshold: ::core::option::Option<u32>,
4263}
4264#[non_exhaustive]
4266#[derive(Clone, PartialEq, ::prost::Message)]
4267pub struct MultisigAggregatedSignature {
4268 #[prost(message, repeated, tag = "1")]
4272 pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
4273 #[prost(uint32, optional, tag = "2")]
4276 pub bitmap: ::core::option::Option<u32>,
4277 #[prost(bytes = "bytes", optional, tag = "3")]
4280 pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4281 #[prost(message, optional, tag = "4")]
4283 pub committee: ::core::option::Option<MultisigCommittee>,
4284}
4285#[non_exhaustive]
4287#[derive(Clone, PartialEq, ::prost::Message)]
4288pub struct MultisigMemberSignature {
4289 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4291 pub scheme: ::core::option::Option<i32>,
4292 #[prost(bytes = "bytes", optional, tag = "2")]
4294 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4295 #[prost(message, optional, tag = "3")]
4297 pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
4298 #[prost(message, optional, tag = "4")]
4300 pub passkey: ::core::option::Option<PasskeyAuthenticator>,
4301}
4302#[non_exhaustive]
4304#[derive(Clone, PartialEq, ::prost::Message)]
4305pub struct ZkLoginAuthenticator {
4306 #[prost(message, optional, tag = "1")]
4308 pub inputs: ::core::option::Option<ZkLoginInputs>,
4309 #[prost(uint64, optional, tag = "2")]
4311 pub max_epoch: ::core::option::Option<u64>,
4312 #[prost(message, optional, tag = "3")]
4314 pub signature: ::core::option::Option<SimpleSignature>,
4315 #[prost(message, optional, tag = "4")]
4317 pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
4318 #[prost(message, optional, tag = "5")]
4320 pub jwk_id: ::core::option::Option<JwkId>,
4321}
4322#[non_exhaustive]
4324#[derive(Clone, PartialEq, ::prost::Message)]
4325pub struct ZkLoginInputs {
4326 #[prost(message, optional, tag = "1")]
4327 pub proof_points: ::core::option::Option<ZkLoginProof>,
4328 #[prost(message, optional, tag = "2")]
4329 pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
4330 #[prost(string, optional, tag = "3")]
4331 pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
4332 #[prost(string, optional, tag = "4")]
4334 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4335}
4336#[non_exhaustive]
4338#[derive(Clone, PartialEq, ::prost::Message)]
4339pub struct ZkLoginProof {
4340 #[prost(message, optional, tag = "1")]
4341 pub a: ::core::option::Option<CircomG1>,
4342 #[prost(message, optional, tag = "2")]
4343 pub b: ::core::option::Option<CircomG2>,
4344 #[prost(message, optional, tag = "3")]
4345 pub c: ::core::option::Option<CircomG1>,
4346}
4347#[non_exhaustive]
4349#[derive(Clone, PartialEq, ::prost::Message)]
4350pub struct ZkLoginClaim {
4351 #[prost(string, optional, tag = "1")]
4352 pub value: ::core::option::Option<::prost::alloc::string::String>,
4353 #[prost(uint32, optional, tag = "2")]
4354 pub index_mod_4: ::core::option::Option<u32>,
4355}
4356#[non_exhaustive]
4358#[derive(Clone, PartialEq, ::prost::Message)]
4359pub struct CircomG1 {
4360 #[prost(string, optional, tag = "1")]
4362 pub e0: ::core::option::Option<::prost::alloc::string::String>,
4363 #[prost(string, optional, tag = "2")]
4365 pub e1: ::core::option::Option<::prost::alloc::string::String>,
4366 #[prost(string, optional, tag = "3")]
4368 pub e2: ::core::option::Option<::prost::alloc::string::String>,
4369}
4370#[non_exhaustive]
4372#[derive(Clone, PartialEq, ::prost::Message)]
4373pub struct CircomG2 {
4374 #[prost(string, optional, tag = "1")]
4376 pub e00: ::core::option::Option<::prost::alloc::string::String>,
4377 #[prost(string, optional, tag = "2")]
4379 pub e01: ::core::option::Option<::prost::alloc::string::String>,
4380 #[prost(string, optional, tag = "3")]
4382 pub e10: ::core::option::Option<::prost::alloc::string::String>,
4383 #[prost(string, optional, tag = "4")]
4385 pub e11: ::core::option::Option<::prost::alloc::string::String>,
4386 #[prost(string, optional, tag = "5")]
4388 pub e20: ::core::option::Option<::prost::alloc::string::String>,
4389 #[prost(string, optional, tag = "6")]
4391 pub e21: ::core::option::Option<::prost::alloc::string::String>,
4392}
4393#[non_exhaustive]
4400#[derive(Clone, PartialEq, ::prost::Message)]
4401pub struct PasskeyAuthenticator {
4402 #[prost(bytes = "bytes", optional, tag = "1")]
4407 pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
4408 #[prost(string, optional, tag = "2")]
4413 pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
4414 #[prost(message, optional, tag = "3")]
4416 pub signature: ::core::option::Option<SimpleSignature>,
4417}
4418#[non_exhaustive]
4420#[derive(Clone, PartialEq, ::prost::Message)]
4421pub struct ValidatorCommittee {
4422 #[prost(uint64, optional, tag = "1")]
4424 pub epoch: ::core::option::Option<u64>,
4425 #[prost(message, repeated, tag = "2")]
4427 pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
4428}
4429#[non_exhaustive]
4431#[derive(Clone, PartialEq, ::prost::Message)]
4432pub struct ValidatorCommitteeMember {
4433 #[prost(bytes = "bytes", optional, tag = "1")]
4435 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4436 #[prost(uint64, optional, tag = "2")]
4438 pub weight: ::core::option::Option<u64>,
4439}
4440#[non_exhaustive]
4442#[derive(Clone, PartialEq, ::prost::Message)]
4443pub struct ValidatorAggregatedSignature {
4444 #[prost(uint64, optional, tag = "1")]
4449 pub epoch: ::core::option::Option<u64>,
4450 #[prost(bytes = "bytes", optional, tag = "2")]
4452 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4453 #[prost(bytes = "bytes", optional, tag = "3")]
4456 pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4457}
4458#[non_exhaustive]
4465#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4466#[repr(i32)]
4467pub enum SignatureScheme {
4468 Ed25519 = 0,
4469 Secp256k1 = 1,
4470 Secp256r1 = 2,
4471 Multisig = 3,
4472 Bls12381 = 4,
4473 Zklogin = 5,
4474 Passkey = 6,
4475}
4476impl SignatureScheme {
4477 pub fn as_str_name(&self) -> &'static str {
4482 match self {
4483 Self::Ed25519 => "ED25519",
4484 Self::Secp256k1 => "SECP256K1",
4485 Self::Secp256r1 => "SECP256R1",
4486 Self::Multisig => "MULTISIG",
4487 Self::Bls12381 => "BLS12381",
4488 Self::Zklogin => "ZKLOGIN",
4489 Self::Passkey => "PASSKEY",
4490 }
4491 }
4492 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4494 match value {
4495 "ED25519" => Some(Self::Ed25519),
4496 "SECP256K1" => Some(Self::Secp256k1),
4497 "SECP256R1" => Some(Self::Secp256r1),
4498 "MULTISIG" => Some(Self::Multisig),
4499 "BLS12381" => Some(Self::Bls12381),
4500 "ZKLOGIN" => Some(Self::Zklogin),
4501 "PASSKEY" => Some(Self::Passkey),
4502 _ => None,
4503 }
4504 }
4505}
4506#[non_exhaustive]
4507#[derive(Clone, PartialEq, ::prost::Message)]
4508pub struct VerifySignatureRequest {
4509 #[prost(message, optional, tag = "1")]
4515 pub message: ::core::option::Option<Bcs>,
4516 #[prost(message, optional, tag = "2")]
4518 pub signature: ::core::option::Option<UserSignature>,
4519 #[prost(string, optional, tag = "3")]
4525 pub address: ::core::option::Option<::prost::alloc::string::String>,
4526 #[prost(message, repeated, tag = "4")]
4529 pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
4530}
4531#[non_exhaustive]
4532#[derive(Clone, PartialEq, ::prost::Message)]
4533pub struct VerifySignatureResponse {
4534 #[prost(bool, optional, tag = "1")]
4536 pub is_valid: ::core::option::Option<bool>,
4537 #[prost(string, optional, tag = "2")]
4539 pub reason: ::core::option::Option<::prost::alloc::string::String>,
4540}
4541pub mod signature_verification_service_client {
4543 #![allow(
4544 unused_variables,
4545 dead_code,
4546 missing_docs,
4547 clippy::wildcard_imports,
4548 clippy::let_unit_value,
4549 )]
4550 use tonic::codegen::*;
4551 use tonic::codegen::http::Uri;
4552 #[derive(Debug, Clone)]
4553 pub struct SignatureVerificationServiceClient<T> {
4554 inner: tonic::client::Grpc<T>,
4555 }
4556 impl SignatureVerificationServiceClient<tonic::transport::Channel> {
4557 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4559 where
4560 D: TryInto<tonic::transport::Endpoint>,
4561 D::Error: Into<StdError>,
4562 {
4563 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4564 Ok(Self::new(conn))
4565 }
4566 }
4567 impl<T> SignatureVerificationServiceClient<T>
4568 where
4569 T: tonic::client::GrpcService<tonic::body::Body>,
4570 T::Error: Into<StdError>,
4571 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4572 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4573 {
4574 pub fn new(inner: T) -> Self {
4575 let inner = tonic::client::Grpc::new(inner);
4576 Self { inner }
4577 }
4578 pub fn with_origin(inner: T, origin: Uri) -> Self {
4579 let inner = tonic::client::Grpc::with_origin(inner, origin);
4580 Self { inner }
4581 }
4582 pub fn with_interceptor<F>(
4583 inner: T,
4584 interceptor: F,
4585 ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
4586 where
4587 F: tonic::service::Interceptor,
4588 T::ResponseBody: Default,
4589 T: tonic::codegen::Service<
4590 http::Request<tonic::body::Body>,
4591 Response = http::Response<
4592 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4593 >,
4594 >,
4595 <T as tonic::codegen::Service<
4596 http::Request<tonic::body::Body>,
4597 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4598 {
4599 SignatureVerificationServiceClient::new(
4600 InterceptedService::new(inner, interceptor),
4601 )
4602 }
4603 #[must_use]
4608 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4609 self.inner = self.inner.send_compressed(encoding);
4610 self
4611 }
4612 #[must_use]
4614 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4615 self.inner = self.inner.accept_compressed(encoding);
4616 self
4617 }
4618 #[must_use]
4622 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4623 self.inner = self.inner.max_decoding_message_size(limit);
4624 self
4625 }
4626 #[must_use]
4630 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4631 self.inner = self.inner.max_encoding_message_size(limit);
4632 self
4633 }
4634 pub async fn verify_signature(
4636 &mut self,
4637 request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
4638 ) -> std::result::Result<
4639 tonic::Response<super::VerifySignatureResponse>,
4640 tonic::Status,
4641 > {
4642 self.inner
4643 .ready()
4644 .await
4645 .map_err(|e| {
4646 tonic::Status::unknown(
4647 format!("Service was not ready: {}", e.into()),
4648 )
4649 })?;
4650 let codec = tonic::codec::ProstCodec::default();
4651 let path = http::uri::PathAndQuery::from_static(
4652 "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
4653 );
4654 let mut req = request.into_request();
4655 req.extensions_mut()
4656 .insert(
4657 GrpcMethod::new(
4658 "sui.rpc.v2.SignatureVerificationService",
4659 "VerifySignature",
4660 ),
4661 );
4662 self.inner.unary(req, path, codec).await
4663 }
4664 }
4665}
4666pub mod signature_verification_service_server {
4668 #![allow(
4669 unused_variables,
4670 dead_code,
4671 missing_docs,
4672 clippy::wildcard_imports,
4673 clippy::let_unit_value,
4674 )]
4675 use tonic::codegen::*;
4676 #[async_trait]
4678 pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
4679 async fn verify_signature(
4681 &self,
4682 request: tonic::Request<super::VerifySignatureRequest>,
4683 ) -> std::result::Result<
4684 tonic::Response<super::VerifySignatureResponse>,
4685 tonic::Status,
4686 >;
4687 }
4688 #[derive(Debug)]
4689 pub struct SignatureVerificationServiceServer<T> {
4690 inner: Arc<T>,
4691 accept_compression_encodings: EnabledCompressionEncodings,
4692 send_compression_encodings: EnabledCompressionEncodings,
4693 max_decoding_message_size: Option<usize>,
4694 max_encoding_message_size: Option<usize>,
4695 }
4696 impl<T> SignatureVerificationServiceServer<T> {
4697 pub fn new(inner: T) -> Self {
4698 Self::from_arc(Arc::new(inner))
4699 }
4700 pub fn from_arc(inner: Arc<T>) -> Self {
4701 Self {
4702 inner,
4703 accept_compression_encodings: Default::default(),
4704 send_compression_encodings: Default::default(),
4705 max_decoding_message_size: None,
4706 max_encoding_message_size: None,
4707 }
4708 }
4709 pub fn with_interceptor<F>(
4710 inner: T,
4711 interceptor: F,
4712 ) -> InterceptedService<Self, F>
4713 where
4714 F: tonic::service::Interceptor,
4715 {
4716 InterceptedService::new(Self::new(inner), interceptor)
4717 }
4718 #[must_use]
4720 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4721 self.accept_compression_encodings.enable(encoding);
4722 self
4723 }
4724 #[must_use]
4726 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4727 self.send_compression_encodings.enable(encoding);
4728 self
4729 }
4730 #[must_use]
4734 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4735 self.max_decoding_message_size = Some(limit);
4736 self
4737 }
4738 #[must_use]
4742 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4743 self.max_encoding_message_size = Some(limit);
4744 self
4745 }
4746 }
4747 impl<T, B> tonic::codegen::Service<http::Request<B>>
4748 for SignatureVerificationServiceServer<T>
4749 where
4750 T: SignatureVerificationService,
4751 B: Body + std::marker::Send + 'static,
4752 B::Error: Into<StdError> + std::marker::Send + 'static,
4753 {
4754 type Response = http::Response<tonic::body::Body>;
4755 type Error = std::convert::Infallible;
4756 type Future = BoxFuture<Self::Response, Self::Error>;
4757 fn poll_ready(
4758 &mut self,
4759 _cx: &mut Context<'_>,
4760 ) -> Poll<std::result::Result<(), Self::Error>> {
4761 Poll::Ready(Ok(()))
4762 }
4763 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4764 match req.uri().path() {
4765 "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
4766 #[allow(non_camel_case_types)]
4767 struct VerifySignatureSvc<T: SignatureVerificationService>(
4768 pub Arc<T>,
4769 );
4770 impl<
4771 T: SignatureVerificationService,
4772 > tonic::server::UnaryService<super::VerifySignatureRequest>
4773 for VerifySignatureSvc<T> {
4774 type Response = super::VerifySignatureResponse;
4775 type Future = BoxFuture<
4776 tonic::Response<Self::Response>,
4777 tonic::Status,
4778 >;
4779 fn call(
4780 &mut self,
4781 request: tonic::Request<super::VerifySignatureRequest>,
4782 ) -> Self::Future {
4783 let inner = Arc::clone(&self.0);
4784 let fut = async move {
4785 <T as SignatureVerificationService>::verify_signature(
4786 &inner,
4787 request,
4788 )
4789 .await
4790 };
4791 Box::pin(fut)
4792 }
4793 }
4794 let accept_compression_encodings = self.accept_compression_encodings;
4795 let send_compression_encodings = self.send_compression_encodings;
4796 let max_decoding_message_size = self.max_decoding_message_size;
4797 let max_encoding_message_size = self.max_encoding_message_size;
4798 let inner = self.inner.clone();
4799 let fut = async move {
4800 let method = VerifySignatureSvc(inner);
4801 let codec = tonic::codec::ProstCodec::default();
4802 let mut grpc = tonic::server::Grpc::new(codec)
4803 .apply_compression_config(
4804 accept_compression_encodings,
4805 send_compression_encodings,
4806 )
4807 .apply_max_message_size_config(
4808 max_decoding_message_size,
4809 max_encoding_message_size,
4810 );
4811 let res = grpc.unary(method, req).await;
4812 Ok(res)
4813 };
4814 Box::pin(fut)
4815 }
4816 _ => {
4817 Box::pin(async move {
4818 let mut response = http::Response::new(
4819 tonic::body::Body::default(),
4820 );
4821 let headers = response.headers_mut();
4822 headers
4823 .insert(
4824 tonic::Status::GRPC_STATUS,
4825 (tonic::Code::Unimplemented as i32).into(),
4826 );
4827 headers
4828 .insert(
4829 http::header::CONTENT_TYPE,
4830 tonic::metadata::GRPC_CONTENT_TYPE,
4831 );
4832 Ok(response)
4833 })
4834 }
4835 }
4836 }
4837 }
4838 impl<T> Clone for SignatureVerificationServiceServer<T> {
4839 fn clone(&self) -> Self {
4840 let inner = self.inner.clone();
4841 Self {
4842 inner,
4843 accept_compression_encodings: self.accept_compression_encodings,
4844 send_compression_encodings: self.send_compression_encodings,
4845 max_decoding_message_size: self.max_decoding_message_size,
4846 max_encoding_message_size: self.max_encoding_message_size,
4847 }
4848 }
4849 }
4850 pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
4852 impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
4853 const NAME: &'static str = SERVICE_NAME;
4854 }
4855}
4856#[non_exhaustive]
4858#[derive(Clone, PartialEq, ::prost::Message)]
4859pub struct GetCoinInfoRequest {
4860 #[prost(string, optional, tag = "1")]
4862 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
4863}
4864#[non_exhaustive]
4866#[derive(Clone, PartialEq, ::prost::Message)]
4867pub struct GetCoinInfoResponse {
4868 #[prost(string, optional, tag = "1")]
4870 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
4871 #[prost(message, optional, tag = "2")]
4874 pub metadata: ::core::option::Option<CoinMetadata>,
4875 #[prost(message, optional, tag = "3")]
4878 pub treasury: ::core::option::Option<CoinTreasury>,
4879 #[prost(message, optional, tag = "4")]
4887 pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
4888}
4889#[non_exhaustive]
4891#[derive(Clone, PartialEq, ::prost::Message)]
4892pub struct CoinMetadata {
4893 #[prost(string, optional, tag = "1")]
4896 pub id: ::core::option::Option<::prost::alloc::string::String>,
4897 #[prost(uint32, optional, tag = "2")]
4899 pub decimals: ::core::option::Option<u32>,
4900 #[prost(string, optional, tag = "3")]
4902 pub name: ::core::option::Option<::prost::alloc::string::String>,
4903 #[prost(string, optional, tag = "4")]
4905 pub symbol: ::core::option::Option<::prost::alloc::string::String>,
4906 #[prost(string, optional, tag = "5")]
4908 pub description: ::core::option::Option<::prost::alloc::string::String>,
4909 #[prost(string, optional, tag = "6")]
4911 pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
4912 #[prost(string, optional, tag = "7")]
4916 pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
4917 #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
4919 pub metadata_cap_state: ::core::option::Option<i32>,
4920}
4921pub mod coin_metadata {
4923 #[non_exhaustive]
4925 #[derive(
4926 Clone,
4927 Copy,
4928 Debug,
4929 PartialEq,
4930 Eq,
4931 Hash,
4932 PartialOrd,
4933 Ord,
4934 ::prost::Enumeration
4935 )]
4936 #[repr(i32)]
4937 pub enum MetadataCapState {
4938 Unknown = 0,
4941 Claimed = 1,
4943 Unclaimed = 2,
4945 Deleted = 3,
4947 }
4948 impl MetadataCapState {
4949 pub fn as_str_name(&self) -> &'static str {
4954 match self {
4955 Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
4956 Self::Claimed => "CLAIMED",
4957 Self::Unclaimed => "UNCLAIMED",
4958 Self::Deleted => "DELETED",
4959 }
4960 }
4961 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4963 match value {
4964 "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
4965 "CLAIMED" => Some(Self::Claimed),
4966 "UNCLAIMED" => Some(Self::Unclaimed),
4967 "DELETED" => Some(Self::Deleted),
4968 _ => None,
4969 }
4970 }
4971 }
4972}
4973#[non_exhaustive]
4975#[derive(Clone, PartialEq, ::prost::Message)]
4976pub struct CoinTreasury {
4977 #[prost(string, optional, tag = "1")]
4979 pub id: ::core::option::Option<::prost::alloc::string::String>,
4980 #[prost(uint64, optional, tag = "2")]
4982 pub total_supply: ::core::option::Option<u64>,
4983 #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
4985 pub supply_state: ::core::option::Option<i32>,
4986}
4987pub mod coin_treasury {
4989 #[non_exhaustive]
4991 #[derive(
4992 Clone,
4993 Copy,
4994 Debug,
4995 PartialEq,
4996 Eq,
4997 Hash,
4998 PartialOrd,
4999 Ord,
5000 ::prost::Enumeration
5001 )]
5002 #[repr(i32)]
5003 pub enum SupplyState {
5004 Unknown = 0,
5006 Fixed = 1,
5008 BurnOnly = 2,
5010 }
5011 impl SupplyState {
5012 pub fn as_str_name(&self) -> &'static str {
5017 match self {
5018 Self::Unknown => "SUPPLY_STATE_UNKNOWN",
5019 Self::Fixed => "FIXED",
5020 Self::BurnOnly => "BURN_ONLY",
5021 }
5022 }
5023 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5025 match value {
5026 "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
5027 "FIXED" => Some(Self::Fixed),
5028 "BURN_ONLY" => Some(Self::BurnOnly),
5029 _ => None,
5030 }
5031 }
5032 }
5033}
5034#[non_exhaustive]
5036#[derive(Clone, PartialEq, ::prost::Message)]
5037pub struct RegulatedCoinMetadata {
5038 #[prost(string, optional, tag = "1")]
5041 pub id: ::core::option::Option<::prost::alloc::string::String>,
5042 #[prost(string, optional, tag = "2")]
5044 pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
5045 #[prost(string, optional, tag = "3")]
5047 pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
5048 #[prost(bool, optional, tag = "4")]
5050 pub allow_global_pause: ::core::option::Option<bool>,
5051 #[prost(uint32, optional, tag = "5")]
5053 pub variant: ::core::option::Option<u32>,
5054 #[prost(
5056 enumeration = "regulated_coin_metadata::CoinRegulatedState",
5057 optional,
5058 tag = "6"
5059 )]
5060 pub coin_regulated_state: ::core::option::Option<i32>,
5061}
5062pub mod regulated_coin_metadata {
5064 #[non_exhaustive]
5066 #[derive(
5067 Clone,
5068 Copy,
5069 Debug,
5070 PartialEq,
5071 Eq,
5072 Hash,
5073 PartialOrd,
5074 Ord,
5075 ::prost::Enumeration
5076 )]
5077 #[repr(i32)]
5078 pub enum CoinRegulatedState {
5079 Unknown = 0,
5084 Regulated = 1,
5086 Unregulated = 2,
5088 }
5089 impl CoinRegulatedState {
5090 pub fn as_str_name(&self) -> &'static str {
5095 match self {
5096 Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
5097 Self::Regulated => "REGULATED",
5098 Self::Unregulated => "UNREGULATED",
5099 }
5100 }
5101 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5103 match value {
5104 "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
5105 "REGULATED" => Some(Self::Regulated),
5106 "UNREGULATED" => Some(Self::Unregulated),
5107 _ => None,
5108 }
5109 }
5110 }
5111}
5112#[non_exhaustive]
5114#[derive(Clone, PartialEq, ::prost::Message)]
5115pub struct GetBalanceRequest {
5116 #[prost(string, optional, tag = "1")]
5118 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5119 #[prost(string, optional, tag = "2")]
5121 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5122}
5123#[non_exhaustive]
5126#[derive(Clone, PartialEq, ::prost::Message)]
5127pub struct GetBalanceResponse {
5128 #[prost(message, optional, tag = "1")]
5130 pub balance: ::core::option::Option<Balance>,
5131}
5132#[non_exhaustive]
5134#[derive(Clone, PartialEq, ::prost::Message)]
5135pub struct ListBalancesRequest {
5136 #[prost(string, optional, tag = "1")]
5138 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5139 #[prost(uint32, optional, tag = "2")]
5143 pub page_size: ::core::option::Option<u32>,
5144 #[prost(bytes = "bytes", optional, tag = "3")]
5150 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5151}
5152#[non_exhaustive]
5155#[derive(Clone, PartialEq, ::prost::Message)]
5156pub struct ListBalancesResponse {
5157 #[prost(message, repeated, tag = "1")]
5159 pub balances: ::prost::alloc::vec::Vec<Balance>,
5160 #[prost(bytes = "bytes", optional, tag = "2")]
5163 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5164}
5165#[non_exhaustive]
5167#[derive(Clone, PartialEq, ::prost::Message)]
5168pub struct Balance {
5169 #[prost(string, optional, tag = "1")]
5171 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5172 #[prost(uint64, optional, tag = "3")]
5174 pub balance: ::core::option::Option<u64>,
5175}
5176#[non_exhaustive]
5178#[derive(Clone, PartialEq, ::prost::Message)]
5179pub struct ListDynamicFieldsRequest {
5180 #[prost(string, optional, tag = "1")]
5182 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5183 #[prost(uint32, optional, tag = "2")]
5187 pub page_size: ::core::option::Option<u32>,
5188 #[prost(bytes = "bytes", optional, tag = "3")]
5194 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5195 #[prost(message, optional, tag = "4")]
5198 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5199}
5200#[non_exhaustive]
5202#[derive(Clone, PartialEq, ::prost::Message)]
5203pub struct ListDynamicFieldsResponse {
5204 #[prost(message, repeated, tag = "1")]
5206 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
5207 #[prost(bytes = "bytes", optional, tag = "2")]
5210 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5211}
5212#[non_exhaustive]
5213#[derive(Clone, PartialEq, ::prost::Message)]
5214pub struct DynamicField {
5215 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
5216 pub kind: ::core::option::Option<i32>,
5217 #[prost(string, optional, tag = "2")]
5219 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5220 #[prost(string, optional, tag = "3")]
5222 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
5223 #[prost(message, optional, tag = "4")]
5225 pub field_object: ::core::option::Option<Object>,
5226 #[prost(message, optional, tag = "5")]
5228 pub name: ::core::option::Option<Bcs>,
5229 #[prost(message, optional, tag = "6")]
5231 pub value: ::core::option::Option<Bcs>,
5232 #[prost(string, optional, tag = "7")]
5238 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
5239 #[prost(string, optional, tag = "8")]
5245 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
5246 #[prost(message, optional, tag = "9")]
5248 pub child_object: ::core::option::Option<Object>,
5249}
5250pub mod dynamic_field {
5252 #[non_exhaustive]
5253 #[derive(
5254 Clone,
5255 Copy,
5256 Debug,
5257 PartialEq,
5258 Eq,
5259 Hash,
5260 PartialOrd,
5261 Ord,
5262 ::prost::Enumeration
5263 )]
5264 #[repr(i32)]
5265 pub enum DynamicFieldKind {
5266 Unknown = 0,
5267 Field = 1,
5268 Object = 2,
5269 }
5270 impl DynamicFieldKind {
5271 pub fn as_str_name(&self) -> &'static str {
5276 match self {
5277 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
5278 Self::Field => "FIELD",
5279 Self::Object => "OBJECT",
5280 }
5281 }
5282 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5284 match value {
5285 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
5286 "FIELD" => Some(Self::Field),
5287 "OBJECT" => Some(Self::Object),
5288 _ => None,
5289 }
5290 }
5291 }
5292}
5293#[non_exhaustive]
5294#[derive(Clone, PartialEq, ::prost::Message)]
5295pub struct ListOwnedObjectsRequest {
5296 #[prost(string, optional, tag = "1")]
5298 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5299 #[prost(uint32, optional, tag = "2")]
5303 pub page_size: ::core::option::Option<u32>,
5304 #[prost(bytes = "bytes", optional, tag = "3")]
5310 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5311 #[prost(message, optional, tag = "4")]
5314 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5315 #[prost(string, optional, tag = "5")]
5324 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5325}
5326#[non_exhaustive]
5327#[derive(Clone, PartialEq, ::prost::Message)]
5328pub struct ListOwnedObjectsResponse {
5329 #[prost(message, repeated, tag = "1")]
5331 pub objects: ::prost::alloc::vec::Vec<Object>,
5332 #[prost(bytes = "bytes", optional, tag = "2")]
5335 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5336}
5337pub mod state_service_client {
5339 #![allow(
5340 unused_variables,
5341 dead_code,
5342 missing_docs,
5343 clippy::wildcard_imports,
5344 clippy::let_unit_value,
5345 )]
5346 use tonic::codegen::*;
5347 use tonic::codegen::http::Uri;
5348 #[derive(Debug, Clone)]
5349 pub struct StateServiceClient<T> {
5350 inner: tonic::client::Grpc<T>,
5351 }
5352 impl StateServiceClient<tonic::transport::Channel> {
5353 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5355 where
5356 D: TryInto<tonic::transport::Endpoint>,
5357 D::Error: Into<StdError>,
5358 {
5359 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5360 Ok(Self::new(conn))
5361 }
5362 }
5363 impl<T> StateServiceClient<T>
5364 where
5365 T: tonic::client::GrpcService<tonic::body::Body>,
5366 T::Error: Into<StdError>,
5367 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5368 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5369 {
5370 pub fn new(inner: T) -> Self {
5371 let inner = tonic::client::Grpc::new(inner);
5372 Self { inner }
5373 }
5374 pub fn with_origin(inner: T, origin: Uri) -> Self {
5375 let inner = tonic::client::Grpc::with_origin(inner, origin);
5376 Self { inner }
5377 }
5378 pub fn with_interceptor<F>(
5379 inner: T,
5380 interceptor: F,
5381 ) -> StateServiceClient<InterceptedService<T, F>>
5382 where
5383 F: tonic::service::Interceptor,
5384 T::ResponseBody: Default,
5385 T: tonic::codegen::Service<
5386 http::Request<tonic::body::Body>,
5387 Response = http::Response<
5388 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5389 >,
5390 >,
5391 <T as tonic::codegen::Service<
5392 http::Request<tonic::body::Body>,
5393 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5394 {
5395 StateServiceClient::new(InterceptedService::new(inner, interceptor))
5396 }
5397 #[must_use]
5402 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5403 self.inner = self.inner.send_compressed(encoding);
5404 self
5405 }
5406 #[must_use]
5408 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5409 self.inner = self.inner.accept_compressed(encoding);
5410 self
5411 }
5412 #[must_use]
5416 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5417 self.inner = self.inner.max_decoding_message_size(limit);
5418 self
5419 }
5420 #[must_use]
5424 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5425 self.inner = self.inner.max_encoding_message_size(limit);
5426 self
5427 }
5428 pub async fn list_dynamic_fields(
5429 &mut self,
5430 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
5431 ) -> std::result::Result<
5432 tonic::Response<super::ListDynamicFieldsResponse>,
5433 tonic::Status,
5434 > {
5435 self.inner
5436 .ready()
5437 .await
5438 .map_err(|e| {
5439 tonic::Status::unknown(
5440 format!("Service was not ready: {}", e.into()),
5441 )
5442 })?;
5443 let codec = tonic::codec::ProstCodec::default();
5444 let path = http::uri::PathAndQuery::from_static(
5445 "/sui.rpc.v2.StateService/ListDynamicFields",
5446 );
5447 let mut req = request.into_request();
5448 req.extensions_mut()
5449 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
5450 self.inner.unary(req, path, codec).await
5451 }
5452 pub async fn list_owned_objects(
5453 &mut self,
5454 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
5455 ) -> std::result::Result<
5456 tonic::Response<super::ListOwnedObjectsResponse>,
5457 tonic::Status,
5458 > {
5459 self.inner
5460 .ready()
5461 .await
5462 .map_err(|e| {
5463 tonic::Status::unknown(
5464 format!("Service was not ready: {}", e.into()),
5465 )
5466 })?;
5467 let codec = tonic::codec::ProstCodec::default();
5468 let path = http::uri::PathAndQuery::from_static(
5469 "/sui.rpc.v2.StateService/ListOwnedObjects",
5470 );
5471 let mut req = request.into_request();
5472 req.extensions_mut()
5473 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
5474 self.inner.unary(req, path, codec).await
5475 }
5476 pub async fn get_coin_info(
5477 &mut self,
5478 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
5479 ) -> std::result::Result<
5480 tonic::Response<super::GetCoinInfoResponse>,
5481 tonic::Status,
5482 > {
5483 self.inner
5484 .ready()
5485 .await
5486 .map_err(|e| {
5487 tonic::Status::unknown(
5488 format!("Service was not ready: {}", e.into()),
5489 )
5490 })?;
5491 let codec = tonic::codec::ProstCodec::default();
5492 let path = http::uri::PathAndQuery::from_static(
5493 "/sui.rpc.v2.StateService/GetCoinInfo",
5494 );
5495 let mut req = request.into_request();
5496 req.extensions_mut()
5497 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
5498 self.inner.unary(req, path, codec).await
5499 }
5500 pub async fn get_balance(
5501 &mut self,
5502 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
5503 ) -> std::result::Result<
5504 tonic::Response<super::GetBalanceResponse>,
5505 tonic::Status,
5506 > {
5507 self.inner
5508 .ready()
5509 .await
5510 .map_err(|e| {
5511 tonic::Status::unknown(
5512 format!("Service was not ready: {}", e.into()),
5513 )
5514 })?;
5515 let codec = tonic::codec::ProstCodec::default();
5516 let path = http::uri::PathAndQuery::from_static(
5517 "/sui.rpc.v2.StateService/GetBalance",
5518 );
5519 let mut req = request.into_request();
5520 req.extensions_mut()
5521 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
5522 self.inner.unary(req, path, codec).await
5523 }
5524 pub async fn list_balances(
5525 &mut self,
5526 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
5527 ) -> std::result::Result<
5528 tonic::Response<super::ListBalancesResponse>,
5529 tonic::Status,
5530 > {
5531 self.inner
5532 .ready()
5533 .await
5534 .map_err(|e| {
5535 tonic::Status::unknown(
5536 format!("Service was not ready: {}", e.into()),
5537 )
5538 })?;
5539 let codec = tonic::codec::ProstCodec::default();
5540 let path = http::uri::PathAndQuery::from_static(
5541 "/sui.rpc.v2.StateService/ListBalances",
5542 );
5543 let mut req = request.into_request();
5544 req.extensions_mut()
5545 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
5546 self.inner.unary(req, path, codec).await
5547 }
5548 }
5549}
5550pub mod state_service_server {
5552 #![allow(
5553 unused_variables,
5554 dead_code,
5555 missing_docs,
5556 clippy::wildcard_imports,
5557 clippy::let_unit_value,
5558 )]
5559 use tonic::codegen::*;
5560 #[async_trait]
5562 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
5563 async fn list_dynamic_fields(
5564 &self,
5565 request: tonic::Request<super::ListDynamicFieldsRequest>,
5566 ) -> std::result::Result<
5567 tonic::Response<super::ListDynamicFieldsResponse>,
5568 tonic::Status,
5569 >;
5570 async fn list_owned_objects(
5571 &self,
5572 request: tonic::Request<super::ListOwnedObjectsRequest>,
5573 ) -> std::result::Result<
5574 tonic::Response<super::ListOwnedObjectsResponse>,
5575 tonic::Status,
5576 >;
5577 async fn get_coin_info(
5578 &self,
5579 request: tonic::Request<super::GetCoinInfoRequest>,
5580 ) -> std::result::Result<
5581 tonic::Response<super::GetCoinInfoResponse>,
5582 tonic::Status,
5583 >;
5584 async fn get_balance(
5585 &self,
5586 request: tonic::Request<super::GetBalanceRequest>,
5587 ) -> std::result::Result<
5588 tonic::Response<super::GetBalanceResponse>,
5589 tonic::Status,
5590 >;
5591 async fn list_balances(
5592 &self,
5593 request: tonic::Request<super::ListBalancesRequest>,
5594 ) -> std::result::Result<
5595 tonic::Response<super::ListBalancesResponse>,
5596 tonic::Status,
5597 >;
5598 }
5599 #[derive(Debug)]
5600 pub struct StateServiceServer<T> {
5601 inner: Arc<T>,
5602 accept_compression_encodings: EnabledCompressionEncodings,
5603 send_compression_encodings: EnabledCompressionEncodings,
5604 max_decoding_message_size: Option<usize>,
5605 max_encoding_message_size: Option<usize>,
5606 }
5607 impl<T> StateServiceServer<T> {
5608 pub fn new(inner: T) -> Self {
5609 Self::from_arc(Arc::new(inner))
5610 }
5611 pub fn from_arc(inner: Arc<T>) -> Self {
5612 Self {
5613 inner,
5614 accept_compression_encodings: Default::default(),
5615 send_compression_encodings: Default::default(),
5616 max_decoding_message_size: None,
5617 max_encoding_message_size: None,
5618 }
5619 }
5620 pub fn with_interceptor<F>(
5621 inner: T,
5622 interceptor: F,
5623 ) -> InterceptedService<Self, F>
5624 where
5625 F: tonic::service::Interceptor,
5626 {
5627 InterceptedService::new(Self::new(inner), interceptor)
5628 }
5629 #[must_use]
5631 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5632 self.accept_compression_encodings.enable(encoding);
5633 self
5634 }
5635 #[must_use]
5637 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5638 self.send_compression_encodings.enable(encoding);
5639 self
5640 }
5641 #[must_use]
5645 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5646 self.max_decoding_message_size = Some(limit);
5647 self
5648 }
5649 #[must_use]
5653 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5654 self.max_encoding_message_size = Some(limit);
5655 self
5656 }
5657 }
5658 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
5659 where
5660 T: StateService,
5661 B: Body + std::marker::Send + 'static,
5662 B::Error: Into<StdError> + std::marker::Send + 'static,
5663 {
5664 type Response = http::Response<tonic::body::Body>;
5665 type Error = std::convert::Infallible;
5666 type Future = BoxFuture<Self::Response, Self::Error>;
5667 fn poll_ready(
5668 &mut self,
5669 _cx: &mut Context<'_>,
5670 ) -> Poll<std::result::Result<(), Self::Error>> {
5671 Poll::Ready(Ok(()))
5672 }
5673 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5674 match req.uri().path() {
5675 "/sui.rpc.v2.StateService/ListDynamicFields" => {
5676 #[allow(non_camel_case_types)]
5677 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
5678 impl<
5679 T: StateService,
5680 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
5681 for ListDynamicFieldsSvc<T> {
5682 type Response = super::ListDynamicFieldsResponse;
5683 type Future = BoxFuture<
5684 tonic::Response<Self::Response>,
5685 tonic::Status,
5686 >;
5687 fn call(
5688 &mut self,
5689 request: tonic::Request<super::ListDynamicFieldsRequest>,
5690 ) -> Self::Future {
5691 let inner = Arc::clone(&self.0);
5692 let fut = async move {
5693 <T as StateService>::list_dynamic_fields(&inner, request)
5694 .await
5695 };
5696 Box::pin(fut)
5697 }
5698 }
5699 let accept_compression_encodings = self.accept_compression_encodings;
5700 let send_compression_encodings = self.send_compression_encodings;
5701 let max_decoding_message_size = self.max_decoding_message_size;
5702 let max_encoding_message_size = self.max_encoding_message_size;
5703 let inner = self.inner.clone();
5704 let fut = async move {
5705 let method = ListDynamicFieldsSvc(inner);
5706 let codec = tonic::codec::ProstCodec::default();
5707 let mut grpc = tonic::server::Grpc::new(codec)
5708 .apply_compression_config(
5709 accept_compression_encodings,
5710 send_compression_encodings,
5711 )
5712 .apply_max_message_size_config(
5713 max_decoding_message_size,
5714 max_encoding_message_size,
5715 );
5716 let res = grpc.unary(method, req).await;
5717 Ok(res)
5718 };
5719 Box::pin(fut)
5720 }
5721 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
5722 #[allow(non_camel_case_types)]
5723 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
5724 impl<
5725 T: StateService,
5726 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
5727 for ListOwnedObjectsSvc<T> {
5728 type Response = super::ListOwnedObjectsResponse;
5729 type Future = BoxFuture<
5730 tonic::Response<Self::Response>,
5731 tonic::Status,
5732 >;
5733 fn call(
5734 &mut self,
5735 request: tonic::Request<super::ListOwnedObjectsRequest>,
5736 ) -> Self::Future {
5737 let inner = Arc::clone(&self.0);
5738 let fut = async move {
5739 <T as StateService>::list_owned_objects(&inner, request)
5740 .await
5741 };
5742 Box::pin(fut)
5743 }
5744 }
5745 let accept_compression_encodings = self.accept_compression_encodings;
5746 let send_compression_encodings = self.send_compression_encodings;
5747 let max_decoding_message_size = self.max_decoding_message_size;
5748 let max_encoding_message_size = self.max_encoding_message_size;
5749 let inner = self.inner.clone();
5750 let fut = async move {
5751 let method = ListOwnedObjectsSvc(inner);
5752 let codec = tonic::codec::ProstCodec::default();
5753 let mut grpc = tonic::server::Grpc::new(codec)
5754 .apply_compression_config(
5755 accept_compression_encodings,
5756 send_compression_encodings,
5757 )
5758 .apply_max_message_size_config(
5759 max_decoding_message_size,
5760 max_encoding_message_size,
5761 );
5762 let res = grpc.unary(method, req).await;
5763 Ok(res)
5764 };
5765 Box::pin(fut)
5766 }
5767 "/sui.rpc.v2.StateService/GetCoinInfo" => {
5768 #[allow(non_camel_case_types)]
5769 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
5770 impl<
5771 T: StateService,
5772 > tonic::server::UnaryService<super::GetCoinInfoRequest>
5773 for GetCoinInfoSvc<T> {
5774 type Response = super::GetCoinInfoResponse;
5775 type Future = BoxFuture<
5776 tonic::Response<Self::Response>,
5777 tonic::Status,
5778 >;
5779 fn call(
5780 &mut self,
5781 request: tonic::Request<super::GetCoinInfoRequest>,
5782 ) -> Self::Future {
5783 let inner = Arc::clone(&self.0);
5784 let fut = async move {
5785 <T as StateService>::get_coin_info(&inner, request).await
5786 };
5787 Box::pin(fut)
5788 }
5789 }
5790 let accept_compression_encodings = self.accept_compression_encodings;
5791 let send_compression_encodings = self.send_compression_encodings;
5792 let max_decoding_message_size = self.max_decoding_message_size;
5793 let max_encoding_message_size = self.max_encoding_message_size;
5794 let inner = self.inner.clone();
5795 let fut = async move {
5796 let method = GetCoinInfoSvc(inner);
5797 let codec = tonic::codec::ProstCodec::default();
5798 let mut grpc = tonic::server::Grpc::new(codec)
5799 .apply_compression_config(
5800 accept_compression_encodings,
5801 send_compression_encodings,
5802 )
5803 .apply_max_message_size_config(
5804 max_decoding_message_size,
5805 max_encoding_message_size,
5806 );
5807 let res = grpc.unary(method, req).await;
5808 Ok(res)
5809 };
5810 Box::pin(fut)
5811 }
5812 "/sui.rpc.v2.StateService/GetBalance" => {
5813 #[allow(non_camel_case_types)]
5814 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
5815 impl<
5816 T: StateService,
5817 > tonic::server::UnaryService<super::GetBalanceRequest>
5818 for GetBalanceSvc<T> {
5819 type Response = super::GetBalanceResponse;
5820 type Future = BoxFuture<
5821 tonic::Response<Self::Response>,
5822 tonic::Status,
5823 >;
5824 fn call(
5825 &mut self,
5826 request: tonic::Request<super::GetBalanceRequest>,
5827 ) -> Self::Future {
5828 let inner = Arc::clone(&self.0);
5829 let fut = async move {
5830 <T as StateService>::get_balance(&inner, request).await
5831 };
5832 Box::pin(fut)
5833 }
5834 }
5835 let accept_compression_encodings = self.accept_compression_encodings;
5836 let send_compression_encodings = self.send_compression_encodings;
5837 let max_decoding_message_size = self.max_decoding_message_size;
5838 let max_encoding_message_size = self.max_encoding_message_size;
5839 let inner = self.inner.clone();
5840 let fut = async move {
5841 let method = GetBalanceSvc(inner);
5842 let codec = tonic::codec::ProstCodec::default();
5843 let mut grpc = tonic::server::Grpc::new(codec)
5844 .apply_compression_config(
5845 accept_compression_encodings,
5846 send_compression_encodings,
5847 )
5848 .apply_max_message_size_config(
5849 max_decoding_message_size,
5850 max_encoding_message_size,
5851 );
5852 let res = grpc.unary(method, req).await;
5853 Ok(res)
5854 };
5855 Box::pin(fut)
5856 }
5857 "/sui.rpc.v2.StateService/ListBalances" => {
5858 #[allow(non_camel_case_types)]
5859 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
5860 impl<
5861 T: StateService,
5862 > tonic::server::UnaryService<super::ListBalancesRequest>
5863 for ListBalancesSvc<T> {
5864 type Response = super::ListBalancesResponse;
5865 type Future = BoxFuture<
5866 tonic::Response<Self::Response>,
5867 tonic::Status,
5868 >;
5869 fn call(
5870 &mut self,
5871 request: tonic::Request<super::ListBalancesRequest>,
5872 ) -> Self::Future {
5873 let inner = Arc::clone(&self.0);
5874 let fut = async move {
5875 <T as StateService>::list_balances(&inner, request).await
5876 };
5877 Box::pin(fut)
5878 }
5879 }
5880 let accept_compression_encodings = self.accept_compression_encodings;
5881 let send_compression_encodings = self.send_compression_encodings;
5882 let max_decoding_message_size = self.max_decoding_message_size;
5883 let max_encoding_message_size = self.max_encoding_message_size;
5884 let inner = self.inner.clone();
5885 let fut = async move {
5886 let method = ListBalancesSvc(inner);
5887 let codec = tonic::codec::ProstCodec::default();
5888 let mut grpc = tonic::server::Grpc::new(codec)
5889 .apply_compression_config(
5890 accept_compression_encodings,
5891 send_compression_encodings,
5892 )
5893 .apply_max_message_size_config(
5894 max_decoding_message_size,
5895 max_encoding_message_size,
5896 );
5897 let res = grpc.unary(method, req).await;
5898 Ok(res)
5899 };
5900 Box::pin(fut)
5901 }
5902 _ => {
5903 Box::pin(async move {
5904 let mut response = http::Response::new(
5905 tonic::body::Body::default(),
5906 );
5907 let headers = response.headers_mut();
5908 headers
5909 .insert(
5910 tonic::Status::GRPC_STATUS,
5911 (tonic::Code::Unimplemented as i32).into(),
5912 );
5913 headers
5914 .insert(
5915 http::header::CONTENT_TYPE,
5916 tonic::metadata::GRPC_CONTENT_TYPE,
5917 );
5918 Ok(response)
5919 })
5920 }
5921 }
5922 }
5923 }
5924 impl<T> Clone for StateServiceServer<T> {
5925 fn clone(&self) -> Self {
5926 let inner = self.inner.clone();
5927 Self {
5928 inner,
5929 accept_compression_encodings: self.accept_compression_encodings,
5930 send_compression_encodings: self.send_compression_encodings,
5931 max_decoding_message_size: self.max_decoding_message_size,
5932 max_encoding_message_size: self.max_encoding_message_size,
5933 }
5934 }
5935 }
5936 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
5938 impl<T> tonic::server::NamedService for StateServiceServer<T> {
5939 const NAME: &'static str = SERVICE_NAME;
5940 }
5941}
5942#[non_exhaustive]
5944#[derive(Clone, PartialEq, ::prost::Message)]
5945pub struct SubscribeCheckpointsRequest {
5946 #[prost(message, optional, tag = "1")]
5949 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5950}
5951#[non_exhaustive]
5953#[derive(Clone, PartialEq, ::prost::Message)]
5954pub struct SubscribeCheckpointsResponse {
5955 #[prost(uint64, optional, tag = "1")]
5958 pub cursor: ::core::option::Option<u64>,
5959 #[prost(message, optional, tag = "2")]
5961 pub checkpoint: ::core::option::Option<Checkpoint>,
5962}
5963pub mod subscription_service_client {
5965 #![allow(
5966 unused_variables,
5967 dead_code,
5968 missing_docs,
5969 clippy::wildcard_imports,
5970 clippy::let_unit_value,
5971 )]
5972 use tonic::codegen::*;
5973 use tonic::codegen::http::Uri;
5974 #[derive(Debug, Clone)]
5975 pub struct SubscriptionServiceClient<T> {
5976 inner: tonic::client::Grpc<T>,
5977 }
5978 impl SubscriptionServiceClient<tonic::transport::Channel> {
5979 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5981 where
5982 D: TryInto<tonic::transport::Endpoint>,
5983 D::Error: Into<StdError>,
5984 {
5985 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5986 Ok(Self::new(conn))
5987 }
5988 }
5989 impl<T> SubscriptionServiceClient<T>
5990 where
5991 T: tonic::client::GrpcService<tonic::body::Body>,
5992 T::Error: Into<StdError>,
5993 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5994 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5995 {
5996 pub fn new(inner: T) -> Self {
5997 let inner = tonic::client::Grpc::new(inner);
5998 Self { inner }
5999 }
6000 pub fn with_origin(inner: T, origin: Uri) -> Self {
6001 let inner = tonic::client::Grpc::with_origin(inner, origin);
6002 Self { inner }
6003 }
6004 pub fn with_interceptor<F>(
6005 inner: T,
6006 interceptor: F,
6007 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
6008 where
6009 F: tonic::service::Interceptor,
6010 T::ResponseBody: Default,
6011 T: tonic::codegen::Service<
6012 http::Request<tonic::body::Body>,
6013 Response = http::Response<
6014 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6015 >,
6016 >,
6017 <T as tonic::codegen::Service<
6018 http::Request<tonic::body::Body>,
6019 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6020 {
6021 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
6022 }
6023 #[must_use]
6028 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6029 self.inner = self.inner.send_compressed(encoding);
6030 self
6031 }
6032 #[must_use]
6034 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6035 self.inner = self.inner.accept_compressed(encoding);
6036 self
6037 }
6038 #[must_use]
6042 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6043 self.inner = self.inner.max_decoding_message_size(limit);
6044 self
6045 }
6046 #[must_use]
6050 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6051 self.inner = self.inner.max_encoding_message_size(limit);
6052 self
6053 }
6054 pub async fn subscribe_checkpoints(
6066 &mut self,
6067 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
6068 ) -> std::result::Result<
6069 tonic::Response<
6070 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
6071 >,
6072 tonic::Status,
6073 > {
6074 self.inner
6075 .ready()
6076 .await
6077 .map_err(|e| {
6078 tonic::Status::unknown(
6079 format!("Service was not ready: {}", e.into()),
6080 )
6081 })?;
6082 let codec = tonic::codec::ProstCodec::default();
6083 let path = http::uri::PathAndQuery::from_static(
6084 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
6085 );
6086 let mut req = request.into_request();
6087 req.extensions_mut()
6088 .insert(
6089 GrpcMethod::new(
6090 "sui.rpc.v2.SubscriptionService",
6091 "SubscribeCheckpoints",
6092 ),
6093 );
6094 self.inner.server_streaming(req, path, codec).await
6095 }
6096 }
6097}
6098pub mod subscription_service_server {
6100 #![allow(
6101 unused_variables,
6102 dead_code,
6103 missing_docs,
6104 clippy::wildcard_imports,
6105 clippy::let_unit_value,
6106 )]
6107 use tonic::codegen::*;
6108 #[async_trait]
6110 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
6111 type SubscribeCheckpointsStream: tonic::codegen::tokio_stream::Stream<
6113 Item = std::result::Result<
6114 super::SubscribeCheckpointsResponse,
6115 tonic::Status,
6116 >,
6117 >
6118 + std::marker::Send
6119 + 'static;
6120 async fn subscribe_checkpoints(
6132 &self,
6133 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6134 ) -> std::result::Result<
6135 tonic::Response<Self::SubscribeCheckpointsStream>,
6136 tonic::Status,
6137 >;
6138 }
6139 #[derive(Debug)]
6140 pub struct SubscriptionServiceServer<T> {
6141 inner: Arc<T>,
6142 accept_compression_encodings: EnabledCompressionEncodings,
6143 send_compression_encodings: EnabledCompressionEncodings,
6144 max_decoding_message_size: Option<usize>,
6145 max_encoding_message_size: Option<usize>,
6146 }
6147 impl<T> SubscriptionServiceServer<T> {
6148 pub fn new(inner: T) -> Self {
6149 Self::from_arc(Arc::new(inner))
6150 }
6151 pub fn from_arc(inner: Arc<T>) -> Self {
6152 Self {
6153 inner,
6154 accept_compression_encodings: Default::default(),
6155 send_compression_encodings: Default::default(),
6156 max_decoding_message_size: None,
6157 max_encoding_message_size: None,
6158 }
6159 }
6160 pub fn with_interceptor<F>(
6161 inner: T,
6162 interceptor: F,
6163 ) -> InterceptedService<Self, F>
6164 where
6165 F: tonic::service::Interceptor,
6166 {
6167 InterceptedService::new(Self::new(inner), interceptor)
6168 }
6169 #[must_use]
6171 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6172 self.accept_compression_encodings.enable(encoding);
6173 self
6174 }
6175 #[must_use]
6177 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6178 self.send_compression_encodings.enable(encoding);
6179 self
6180 }
6181 #[must_use]
6185 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6186 self.max_decoding_message_size = Some(limit);
6187 self
6188 }
6189 #[must_use]
6193 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6194 self.max_encoding_message_size = Some(limit);
6195 self
6196 }
6197 }
6198 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
6199 where
6200 T: SubscriptionService,
6201 B: Body + std::marker::Send + 'static,
6202 B::Error: Into<StdError> + std::marker::Send + 'static,
6203 {
6204 type Response = http::Response<tonic::body::Body>;
6205 type Error = std::convert::Infallible;
6206 type Future = BoxFuture<Self::Response, Self::Error>;
6207 fn poll_ready(
6208 &mut self,
6209 _cx: &mut Context<'_>,
6210 ) -> Poll<std::result::Result<(), Self::Error>> {
6211 Poll::Ready(Ok(()))
6212 }
6213 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6214 match req.uri().path() {
6215 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
6216 #[allow(non_camel_case_types)]
6217 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
6218 impl<
6219 T: SubscriptionService,
6220 > tonic::server::ServerStreamingService<
6221 super::SubscribeCheckpointsRequest,
6222 > for SubscribeCheckpointsSvc<T> {
6223 type Response = super::SubscribeCheckpointsResponse;
6224 type ResponseStream = T::SubscribeCheckpointsStream;
6225 type Future = BoxFuture<
6226 tonic::Response<Self::ResponseStream>,
6227 tonic::Status,
6228 >;
6229 fn call(
6230 &mut self,
6231 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6232 ) -> Self::Future {
6233 let inner = Arc::clone(&self.0);
6234 let fut = async move {
6235 <T as SubscriptionService>::subscribe_checkpoints(
6236 &inner,
6237 request,
6238 )
6239 .await
6240 };
6241 Box::pin(fut)
6242 }
6243 }
6244 let accept_compression_encodings = self.accept_compression_encodings;
6245 let send_compression_encodings = self.send_compression_encodings;
6246 let max_decoding_message_size = self.max_decoding_message_size;
6247 let max_encoding_message_size = self.max_encoding_message_size;
6248 let inner = self.inner.clone();
6249 let fut = async move {
6250 let method = SubscribeCheckpointsSvc(inner);
6251 let codec = tonic::codec::ProstCodec::default();
6252 let mut grpc = tonic::server::Grpc::new(codec)
6253 .apply_compression_config(
6254 accept_compression_encodings,
6255 send_compression_encodings,
6256 )
6257 .apply_max_message_size_config(
6258 max_decoding_message_size,
6259 max_encoding_message_size,
6260 );
6261 let res = grpc.server_streaming(method, req).await;
6262 Ok(res)
6263 };
6264 Box::pin(fut)
6265 }
6266 _ => {
6267 Box::pin(async move {
6268 let mut response = http::Response::new(
6269 tonic::body::Body::default(),
6270 );
6271 let headers = response.headers_mut();
6272 headers
6273 .insert(
6274 tonic::Status::GRPC_STATUS,
6275 (tonic::Code::Unimplemented as i32).into(),
6276 );
6277 headers
6278 .insert(
6279 http::header::CONTENT_TYPE,
6280 tonic::metadata::GRPC_CONTENT_TYPE,
6281 );
6282 Ok(response)
6283 })
6284 }
6285 }
6286 }
6287 }
6288 impl<T> Clone for SubscriptionServiceServer<T> {
6289 fn clone(&self) -> Self {
6290 let inner = self.inner.clone();
6291 Self {
6292 inner,
6293 accept_compression_encodings: self.accept_compression_encodings,
6294 send_compression_encodings: self.send_compression_encodings,
6295 max_decoding_message_size: self.max_decoding_message_size,
6296 max_encoding_message_size: self.max_encoding_message_size,
6297 }
6298 }
6299 }
6300 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
6302 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
6303 const NAME: &'static str = SERVICE_NAME;
6304 }
6305}
6306#[non_exhaustive]
6307#[derive(Clone, PartialEq, ::prost::Message)]
6308pub struct SystemState {
6309 #[prost(uint64, optional, tag = "1")]
6311 pub version: ::core::option::Option<u64>,
6312 #[prost(uint64, optional, tag = "2")]
6314 pub epoch: ::core::option::Option<u64>,
6315 #[prost(uint64, optional, tag = "3")]
6317 pub protocol_version: ::core::option::Option<u64>,
6318 #[prost(message, optional, tag = "4")]
6320 pub validators: ::core::option::Option<ValidatorSet>,
6321 #[prost(message, optional, tag = "5")]
6323 pub storage_fund: ::core::option::Option<StorageFund>,
6324 #[prost(message, optional, tag = "6")]
6326 pub parameters: ::core::option::Option<SystemParameters>,
6327 #[prost(uint64, optional, tag = "7")]
6329 pub reference_gas_price: ::core::option::Option<u64>,
6330 #[prost(message, repeated, tag = "8")]
6338 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
6339 #[prost(message, optional, tag = "9")]
6341 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
6342 #[prost(bool, optional, tag = "10")]
6349 pub safe_mode: ::core::option::Option<bool>,
6350 #[prost(uint64, optional, tag = "11")]
6352 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
6353 #[prost(uint64, optional, tag = "12")]
6355 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
6356 #[prost(uint64, optional, tag = "13")]
6358 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
6359 #[prost(uint64, optional, tag = "14")]
6361 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
6362 #[prost(uint64, optional, tag = "15")]
6364 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
6365 #[prost(message, optional, tag = "16")]
6367 pub extra_fields: ::core::option::Option<MoveTable>,
6368}
6369#[non_exhaustive]
6370#[derive(Clone, PartialEq, ::prost::Message)]
6371pub struct ValidatorReportRecord {
6372 #[prost(string, optional, tag = "1")]
6374 pub reported: ::core::option::Option<::prost::alloc::string::String>,
6375 #[prost(string, repeated, tag = "2")]
6377 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6378}
6379#[non_exhaustive]
6380#[derive(Clone, PartialEq, ::prost::Message)]
6381pub struct SystemParameters {
6382 #[prost(uint64, optional, tag = "1")]
6384 pub epoch_duration_ms: ::core::option::Option<u64>,
6385 #[prost(uint64, optional, tag = "2")]
6387 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
6388 #[prost(uint64, optional, tag = "3")]
6390 pub min_validator_count: ::core::option::Option<u64>,
6391 #[prost(uint64, optional, tag = "4")]
6394 pub max_validator_count: ::core::option::Option<u64>,
6395 #[prost(uint64, optional, tag = "5")]
6398 pub min_validator_joining_stake: ::core::option::Option<u64>,
6399 #[prost(uint64, optional, tag = "6")]
6404 pub validator_low_stake_threshold: ::core::option::Option<u64>,
6405 #[prost(uint64, optional, tag = "7")]
6409 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
6410 #[prost(uint64, optional, tag = "8")]
6413 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
6414 #[prost(message, optional, tag = "9")]
6416 pub extra_fields: ::core::option::Option<MoveTable>,
6417}
6418#[non_exhaustive]
6420#[derive(Clone, PartialEq, ::prost::Message)]
6421pub struct MoveTable {
6422 #[prost(string, optional, tag = "1")]
6424 pub id: ::core::option::Option<::prost::alloc::string::String>,
6425 #[prost(uint64, optional, tag = "2")]
6427 pub size: ::core::option::Option<u64>,
6428}
6429#[non_exhaustive]
6430#[derive(Clone, PartialEq, ::prost::Message)]
6431pub struct StakeSubsidy {
6432 #[prost(uint64, optional, tag = "1")]
6434 pub balance: ::core::option::Option<u64>,
6435 #[prost(uint64, optional, tag = "2")]
6437 pub distribution_counter: ::core::option::Option<u64>,
6438 #[prost(uint64, optional, tag = "3")]
6441 pub current_distribution_amount: ::core::option::Option<u64>,
6442 #[prost(uint64, optional, tag = "4")]
6444 pub stake_subsidy_period_length: ::core::option::Option<u64>,
6445 #[prost(uint32, optional, tag = "5")]
6448 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
6449 #[prost(message, optional, tag = "6")]
6451 pub extra_fields: ::core::option::Option<MoveTable>,
6452}
6453#[non_exhaustive]
6455#[derive(Clone, Copy, PartialEq, ::prost::Message)]
6456pub struct StorageFund {
6457 #[prost(uint64, optional, tag = "1")]
6463 pub total_object_storage_rebates: ::core::option::Option<u64>,
6464 #[prost(uint64, optional, tag = "2")]
6467 pub non_refundable_balance: ::core::option::Option<u64>,
6468}
6469#[non_exhaustive]
6470#[derive(Clone, PartialEq, ::prost::Message)]
6471pub struct ValidatorSet {
6472 #[prost(uint64, optional, tag = "1")]
6475 pub total_stake: ::core::option::Option<u64>,
6476 #[prost(message, repeated, tag = "2")]
6478 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
6479 #[prost(message, optional, tag = "3")]
6484 pub pending_active_validators: ::core::option::Option<MoveTable>,
6485 #[prost(uint64, repeated, tag = "4")]
6488 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
6489 #[prost(message, optional, tag = "5")]
6493 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
6494 #[prost(message, optional, tag = "6")]
6500 pub inactive_validators: ::core::option::Option<MoveTable>,
6501 #[prost(message, optional, tag = "7")]
6509 pub validator_candidates: ::core::option::Option<MoveTable>,
6510 #[prost(btree_map = "string, uint64", tag = "8")]
6512 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
6513 ::prost::alloc::string::String,
6514 u64,
6515 >,
6516 #[prost(message, optional, tag = "9")]
6518 pub extra_fields: ::core::option::Option<MoveTable>,
6519}
6520#[non_exhaustive]
6524#[derive(Clone, PartialEq, ::prost::Message)]
6525pub struct Validator {
6526 #[prost(string, optional, tag = "1")]
6528 pub name: ::core::option::Option<::prost::alloc::string::String>,
6529 #[prost(string, optional, tag = "2")]
6532 pub address: ::core::option::Option<::prost::alloc::string::String>,
6533 #[prost(string, optional, tag = "3")]
6534 pub description: ::core::option::Option<::prost::alloc::string::String>,
6535 #[prost(string, optional, tag = "4")]
6536 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
6537 #[prost(string, optional, tag = "5")]
6538 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
6539 #[prost(bytes = "bytes", optional, tag = "7")]
6542 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6543 #[prost(bytes = "bytes", optional, tag = "8")]
6545 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6546 #[prost(bytes = "bytes", optional, tag = "10")]
6549 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6550 #[prost(bytes = "bytes", optional, tag = "12")]
6552 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6553 #[prost(string, optional, tag = "13")]
6555 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
6556 #[prost(string, optional, tag = "14")]
6558 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6559 #[prost(string, optional, tag = "15")]
6561 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
6562 #[prost(string, optional, tag = "16")]
6564 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
6565 #[prost(bytes = "bytes", optional, tag = "18")]
6566 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6567 #[prost(bytes = "bytes", optional, tag = "19")]
6568 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6569 #[prost(bytes = "bytes", optional, tag = "21")]
6570 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6571 #[prost(bytes = "bytes", optional, tag = "23")]
6572 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6573 #[prost(string, optional, tag = "24")]
6574 pub next_epoch_network_address: ::core::option::Option<
6575 ::prost::alloc::string::String,
6576 >,
6577 #[prost(string, optional, tag = "25")]
6578 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6579 #[prost(string, optional, tag = "26")]
6580 pub next_epoch_primary_address: ::core::option::Option<
6581 ::prost::alloc::string::String,
6582 >,
6583 #[prost(string, optional, tag = "27")]
6584 pub next_epoch_worker_address: ::core::option::Option<
6585 ::prost::alloc::string::String,
6586 >,
6587 #[prost(message, optional, tag = "28")]
6589 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
6590 #[prost(uint64, optional, tag = "29")]
6593 pub voting_power: ::core::option::Option<u64>,
6594 #[prost(string, optional, tag = "30")]
6596 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6597 #[prost(uint64, optional, tag = "31")]
6599 pub gas_price: ::core::option::Option<u64>,
6600 #[prost(message, optional, tag = "32")]
6602 pub staking_pool: ::core::option::Option<StakingPool>,
6603 #[prost(uint64, optional, tag = "33")]
6605 pub commission_rate: ::core::option::Option<u64>,
6606 #[prost(uint64, optional, tag = "34")]
6608 pub next_epoch_stake: ::core::option::Option<u64>,
6609 #[prost(uint64, optional, tag = "35")]
6611 pub next_epoch_gas_price: ::core::option::Option<u64>,
6612 #[prost(uint64, optional, tag = "36")]
6614 pub next_epoch_commission_rate: ::core::option::Option<u64>,
6615 #[prost(message, optional, tag = "37")]
6617 pub extra_fields: ::core::option::Option<MoveTable>,
6618}
6619#[non_exhaustive]
6621#[derive(Clone, PartialEq, ::prost::Message)]
6622pub struct StakingPool {
6623 #[prost(string, optional, tag = "1")]
6625 pub id: ::core::option::Option<::prost::alloc::string::String>,
6626 #[prost(uint64, optional, tag = "2")]
6629 pub activation_epoch: ::core::option::Option<u64>,
6630 #[prost(uint64, optional, tag = "3")]
6633 pub deactivation_epoch: ::core::option::Option<u64>,
6634 #[prost(uint64, optional, tag = "4")]
6637 pub sui_balance: ::core::option::Option<u64>,
6638 #[prost(uint64, optional, tag = "5")]
6640 pub rewards_pool: ::core::option::Option<u64>,
6641 #[prost(uint64, optional, tag = "6")]
6643 pub pool_token_balance: ::core::option::Option<u64>,
6644 #[prost(message, optional, tag = "7")]
6651 pub exchange_rates: ::core::option::Option<MoveTable>,
6652 #[prost(uint64, optional, tag = "8")]
6654 pub pending_stake: ::core::option::Option<u64>,
6655 #[prost(uint64, optional, tag = "9")]
6658 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
6659 #[prost(uint64, optional, tag = "10")]
6661 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
6662 #[prost(message, optional, tag = "11")]
6664 pub extra_fields: ::core::option::Option<MoveTable>,
6665}
6666#[non_exhaustive]
6668#[derive(Clone, PartialEq, ::prost::Message)]
6669pub struct Transaction {
6670 #[prost(message, optional, tag = "1")]
6672 pub bcs: ::core::option::Option<Bcs>,
6673 #[prost(string, optional, tag = "2")]
6675 pub digest: ::core::option::Option<::prost::alloc::string::String>,
6676 #[prost(int32, optional, tag = "3")]
6678 pub version: ::core::option::Option<i32>,
6679 #[prost(message, optional, tag = "4")]
6680 pub kind: ::core::option::Option<TransactionKind>,
6681 #[prost(string, optional, tag = "5")]
6682 pub sender: ::core::option::Option<::prost::alloc::string::String>,
6683 #[prost(message, optional, tag = "6")]
6684 pub gas_payment: ::core::option::Option<GasPayment>,
6685 #[prost(message, optional, tag = "7")]
6686 pub expiration: ::core::option::Option<TransactionExpiration>,
6687}
6688#[non_exhaustive]
6690#[derive(Clone, PartialEq, ::prost::Message)]
6691pub struct GasPayment {
6692 #[prost(message, repeated, tag = "1")]
6694 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
6695 #[prost(string, optional, tag = "2")]
6697 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6698 #[prost(uint64, optional, tag = "3")]
6702 pub price: ::core::option::Option<u64>,
6703 #[prost(uint64, optional, tag = "4")]
6705 pub budget: ::core::option::Option<u64>,
6706}
6707#[non_exhaustive]
6709#[derive(Clone, Copy, PartialEq, ::prost::Message)]
6710pub struct TransactionExpiration {
6711 #[prost(
6712 enumeration = "transaction_expiration::TransactionExpirationKind",
6713 optional,
6714 tag = "1"
6715 )]
6716 pub kind: ::core::option::Option<i32>,
6717 #[prost(uint64, optional, tag = "2")]
6718 pub epoch: ::core::option::Option<u64>,
6719}
6720pub mod transaction_expiration {
6722 #[non_exhaustive]
6723 #[derive(
6724 Clone,
6725 Copy,
6726 Debug,
6727 PartialEq,
6728 Eq,
6729 Hash,
6730 PartialOrd,
6731 Ord,
6732 ::prost::Enumeration
6733 )]
6734 #[repr(i32)]
6735 pub enum TransactionExpirationKind {
6736 Unknown = 0,
6737 None = 1,
6739 Epoch = 2,
6742 }
6743 impl TransactionExpirationKind {
6744 pub fn as_str_name(&self) -> &'static str {
6749 match self {
6750 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
6751 Self::None => "NONE",
6752 Self::Epoch => "EPOCH",
6753 }
6754 }
6755 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6757 match value {
6758 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
6759 "NONE" => Some(Self::None),
6760 "EPOCH" => Some(Self::Epoch),
6761 _ => None,
6762 }
6763 }
6764 }
6765}
6766#[non_exhaustive]
6768#[derive(Clone, PartialEq, ::prost::Message)]
6769pub struct TransactionKind {
6770 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
6771 pub kind: ::core::option::Option<i32>,
6772 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
6773 pub data: ::core::option::Option<transaction_kind::Data>,
6774}
6775pub mod transaction_kind {
6777 #[non_exhaustive]
6778 #[derive(
6779 Clone,
6780 Copy,
6781 Debug,
6782 PartialEq,
6783 Eq,
6784 Hash,
6785 PartialOrd,
6786 Ord,
6787 ::prost::Enumeration
6788 )]
6789 #[repr(i32)]
6790 pub enum Kind {
6791 Unknown = 0,
6792 ProgrammableTransaction = 1,
6794 ChangeEpoch = 2,
6799 Genesis = 3,
6804 ConsensusCommitPrologueV1 = 4,
6806 AuthenticatorStateUpdate = 5,
6808 EndOfEpoch = 6,
6811 RandomnessStateUpdate = 7,
6813 ConsensusCommitPrologueV2 = 8,
6815 ConsensusCommitPrologueV3 = 9,
6817 ConsensusCommitPrologueV4 = 10,
6819 }
6820 impl Kind {
6821 pub fn as_str_name(&self) -> &'static str {
6826 match self {
6827 Self::Unknown => "KIND_UNKNOWN",
6828 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
6829 Self::ChangeEpoch => "CHANGE_EPOCH",
6830 Self::Genesis => "GENESIS",
6831 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
6832 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
6833 Self::EndOfEpoch => "END_OF_EPOCH",
6834 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
6835 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
6836 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
6837 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
6838 }
6839 }
6840 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6842 match value {
6843 "KIND_UNKNOWN" => Some(Self::Unknown),
6844 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
6845 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
6846 "GENESIS" => Some(Self::Genesis),
6847 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
6848 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
6849 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
6850 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
6851 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
6852 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
6853 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
6854 _ => None,
6855 }
6856 }
6857 }
6858 #[non_exhaustive]
6859 #[derive(Clone, PartialEq, ::prost::Oneof)]
6860 pub enum Data {
6861 #[prost(message, tag = "2")]
6863 ProgrammableTransaction(super::ProgrammableTransaction),
6864 #[prost(message, tag = "3")]
6869 ChangeEpoch(super::ChangeEpoch),
6870 #[prost(message, tag = "4")]
6875 Genesis(super::GenesisTransaction),
6876 #[prost(message, tag = "5")]
6878 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
6879 #[prost(message, tag = "6")]
6881 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
6882 #[prost(message, tag = "7")]
6885 EndOfEpoch(super::EndOfEpochTransaction),
6886 #[prost(message, tag = "8")]
6888 RandomnessStateUpdate(super::RandomnessStateUpdate),
6889 }
6890}
6891#[non_exhaustive]
6896#[derive(Clone, PartialEq, ::prost::Message)]
6897pub struct ProgrammableTransaction {
6898 #[prost(message, repeated, tag = "1")]
6900 pub inputs: ::prost::alloc::vec::Vec<Input>,
6901 #[prost(message, repeated, tag = "2")]
6904 pub commands: ::prost::alloc::vec::Vec<Command>,
6905}
6906#[non_exhaustive]
6908#[derive(Clone, PartialEq, ::prost::Message)]
6909pub struct Command {
6910 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
6911 pub command: ::core::option::Option<command::Command>,
6912}
6913pub mod command {
6915 #[non_exhaustive]
6916 #[derive(Clone, PartialEq, ::prost::Oneof)]
6917 pub enum Command {
6918 #[prost(message, tag = "1")]
6920 MoveCall(super::MoveCall),
6921 #[prost(message, tag = "2")]
6926 TransferObjects(super::TransferObjects),
6927 #[prost(message, tag = "3")]
6930 SplitCoins(super::SplitCoins),
6931 #[prost(message, tag = "4")]
6934 MergeCoins(super::MergeCoins),
6935 #[prost(message, tag = "5")]
6938 Publish(super::Publish),
6939 #[prost(message, tag = "6")]
6943 MakeMoveVector(super::MakeMoveVector),
6944 #[prost(message, tag = "7")]
6952 Upgrade(super::Upgrade),
6953 }
6954}
6955#[non_exhaustive]
6960#[derive(Clone, PartialEq, ::prost::Message)]
6961pub struct MoveCall {
6962 #[prost(string, optional, tag = "1")]
6964 pub package: ::core::option::Option<::prost::alloc::string::String>,
6965 #[prost(string, optional, tag = "2")]
6967 pub module: ::core::option::Option<::prost::alloc::string::String>,
6968 #[prost(string, optional, tag = "3")]
6970 pub function: ::core::option::Option<::prost::alloc::string::String>,
6971 #[prost(string, repeated, tag = "4")]
6973 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6974 #[prost(message, repeated, tag = "5")]
6976 pub arguments: ::prost::alloc::vec::Vec<Argument>,
6977}
6978#[non_exhaustive]
6980#[derive(Clone, PartialEq, ::prost::Message)]
6981pub struct TransferObjects {
6982 #[prost(message, repeated, tag = "1")]
6984 pub objects: ::prost::alloc::vec::Vec<Argument>,
6985 #[prost(message, optional, tag = "2")]
6987 pub address: ::core::option::Option<Argument>,
6988}
6989#[non_exhaustive]
6991#[derive(Clone, PartialEq, ::prost::Message)]
6992pub struct SplitCoins {
6993 #[prost(message, optional, tag = "1")]
6995 pub coin: ::core::option::Option<Argument>,
6996 #[prost(message, repeated, tag = "2")]
6998 pub amounts: ::prost::alloc::vec::Vec<Argument>,
6999}
7000#[non_exhaustive]
7002#[derive(Clone, PartialEq, ::prost::Message)]
7003pub struct MergeCoins {
7004 #[prost(message, optional, tag = "1")]
7006 pub coin: ::core::option::Option<Argument>,
7007 #[prost(message, repeated, tag = "2")]
7011 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
7012}
7013#[non_exhaustive]
7015#[derive(Clone, PartialEq, ::prost::Message)]
7016pub struct Publish {
7017 #[prost(bytes = "bytes", repeated, tag = "1")]
7019 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7020 #[prost(string, repeated, tag = "2")]
7022 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7023}
7024#[non_exhaustive]
7026#[derive(Clone, PartialEq, ::prost::Message)]
7027pub struct MakeMoveVector {
7028 #[prost(string, optional, tag = "1")]
7033 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
7034 #[prost(message, repeated, tag = "2")]
7036 pub elements: ::prost::alloc::vec::Vec<Argument>,
7037}
7038#[non_exhaustive]
7040#[derive(Clone, PartialEq, ::prost::Message)]
7041pub struct Upgrade {
7042 #[prost(bytes = "bytes", repeated, tag = "1")]
7044 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7045 #[prost(string, repeated, tag = "2")]
7047 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7048 #[prost(string, optional, tag = "3")]
7050 pub package: ::core::option::Option<::prost::alloc::string::String>,
7051 #[prost(message, optional, tag = "4")]
7053 pub ticket: ::core::option::Option<Argument>,
7054}
7055#[non_exhaustive]
7057#[derive(Clone, PartialEq, ::prost::Message)]
7058pub struct RandomnessStateUpdate {
7059 #[prost(uint64, optional, tag = "1")]
7061 pub epoch: ::core::option::Option<u64>,
7062 #[prost(uint64, optional, tag = "2")]
7064 pub randomness_round: ::core::option::Option<u64>,
7065 #[prost(bytes = "bytes", optional, tag = "3")]
7067 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
7068 #[prost(uint64, optional, tag = "4")]
7070 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
7071}
7072#[non_exhaustive]
7074#[derive(Clone, PartialEq, ::prost::Message)]
7075pub struct ChangeEpoch {
7076 #[prost(uint64, optional, tag = "1")]
7078 pub epoch: ::core::option::Option<u64>,
7079 #[prost(uint64, optional, tag = "2")]
7081 pub protocol_version: ::core::option::Option<u64>,
7082 #[prost(uint64, optional, tag = "3")]
7084 pub storage_charge: ::core::option::Option<u64>,
7085 #[prost(uint64, optional, tag = "4")]
7087 pub computation_charge: ::core::option::Option<u64>,
7088 #[prost(uint64, optional, tag = "5")]
7090 pub storage_rebate: ::core::option::Option<u64>,
7091 #[prost(uint64, optional, tag = "6")]
7093 pub non_refundable_storage_fee: ::core::option::Option<u64>,
7094 #[prost(message, optional, tag = "7")]
7096 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7097 #[prost(message, repeated, tag = "8")]
7103 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
7104}
7105#[non_exhaustive]
7107#[derive(Clone, PartialEq, ::prost::Message)]
7108pub struct SystemPackage {
7109 #[prost(uint64, optional, tag = "1")]
7111 pub version: ::core::option::Option<u64>,
7112 #[prost(bytes = "bytes", repeated, tag = "2")]
7114 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7115 #[prost(string, repeated, tag = "3")]
7117 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7118}
7119#[non_exhaustive]
7121#[derive(Clone, PartialEq, ::prost::Message)]
7122pub struct GenesisTransaction {
7123 #[prost(message, repeated, tag = "1")]
7125 pub objects: ::prost::alloc::vec::Vec<Object>,
7126}
7127#[non_exhaustive]
7131#[derive(Clone, PartialEq, ::prost::Message)]
7132pub struct ConsensusCommitPrologue {
7133 #[prost(uint64, optional, tag = "1")]
7137 pub epoch: ::core::option::Option<u64>,
7138 #[prost(uint64, optional, tag = "2")]
7142 pub round: ::core::option::Option<u64>,
7143 #[prost(message, optional, tag = "3")]
7147 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7148 #[prost(string, optional, tag = "4")]
7152 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
7153 #[prost(uint64, optional, tag = "5")]
7158 pub sub_dag_index: ::core::option::Option<u64>,
7159 #[prost(message, optional, tag = "6")]
7163 pub consensus_determined_version_assignments: ::core::option::Option<
7164 ConsensusDeterminedVersionAssignments,
7165 >,
7166 #[prost(string, optional, tag = "7")]
7171 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
7172}
7173#[non_exhaustive]
7175#[derive(Clone, PartialEq, ::prost::Message)]
7176pub struct VersionAssignment {
7177 #[prost(string, optional, tag = "1")]
7179 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
7180 #[prost(uint64, optional, tag = "2")]
7182 pub start_version: ::core::option::Option<u64>,
7183 #[prost(uint64, optional, tag = "3")]
7185 pub version: ::core::option::Option<u64>,
7186}
7187#[non_exhaustive]
7189#[derive(Clone, PartialEq, ::prost::Message)]
7190pub struct CanceledTransaction {
7191 #[prost(string, optional, tag = "1")]
7193 pub digest: ::core::option::Option<::prost::alloc::string::String>,
7194 #[prost(message, repeated, tag = "2")]
7196 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
7197}
7198#[non_exhaustive]
7200#[derive(Clone, PartialEq, ::prost::Message)]
7201pub struct ConsensusDeterminedVersionAssignments {
7202 #[prost(int32, optional, tag = "1")]
7204 pub version: ::core::option::Option<i32>,
7205 #[prost(message, repeated, tag = "3")]
7207 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
7208}
7209#[non_exhaustive]
7211#[derive(Clone, PartialEq, ::prost::Message)]
7212pub struct AuthenticatorStateUpdate {
7213 #[prost(uint64, optional, tag = "1")]
7215 pub epoch: ::core::option::Option<u64>,
7216 #[prost(uint64, optional, tag = "2")]
7218 pub round: ::core::option::Option<u64>,
7219 #[prost(message, repeated, tag = "3")]
7221 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
7222 #[prost(uint64, optional, tag = "4")]
7224 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7225}
7226#[non_exhaustive]
7228#[derive(Clone, PartialEq, ::prost::Message)]
7229pub struct ActiveJwk {
7230 #[prost(message, optional, tag = "1")]
7232 pub id: ::core::option::Option<JwkId>,
7233 #[prost(message, optional, tag = "2")]
7235 pub jwk: ::core::option::Option<Jwk>,
7236 #[prost(uint64, optional, tag = "3")]
7238 pub epoch: ::core::option::Option<u64>,
7239}
7240#[non_exhaustive]
7243#[derive(Clone, PartialEq, ::prost::Message)]
7244pub struct EndOfEpochTransaction {
7245 #[prost(message, repeated, tag = "1")]
7246 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
7247}
7248#[non_exhaustive]
7250#[derive(Clone, PartialEq, ::prost::Message)]
7251pub struct EndOfEpochTransactionKind {
7252 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
7253 pub kind: ::core::option::Option<i32>,
7254 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6")]
7255 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
7256}
7257pub mod end_of_epoch_transaction_kind {
7259 #[non_exhaustive]
7260 #[derive(
7261 Clone,
7262 Copy,
7263 Debug,
7264 PartialEq,
7265 Eq,
7266 Hash,
7267 PartialOrd,
7268 Ord,
7269 ::prost::Enumeration
7270 )]
7271 #[repr(i32)]
7272 pub enum Kind {
7273 Unknown = 0,
7274 ChangeEpoch = 1,
7276 AuthenticatorStateCreate = 2,
7278 AuthenticatorStateExpire = 3,
7280 RandomnessStateCreate = 4,
7282 DenyListStateCreate = 5,
7284 BridgeStateCreate = 6,
7286 BridgeCommitteeInit = 7,
7288 StoreExecutionTimeObservations = 8,
7290 AccumulatorRootCreate = 9,
7292 CoinRegistryCreate = 10,
7294 }
7295 impl Kind {
7296 pub fn as_str_name(&self) -> &'static str {
7301 match self {
7302 Self::Unknown => "KIND_UNKNOWN",
7303 Self::ChangeEpoch => "CHANGE_EPOCH",
7304 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
7305 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
7306 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
7307 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
7308 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
7309 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
7310 Self::StoreExecutionTimeObservations => {
7311 "STORE_EXECUTION_TIME_OBSERVATIONS"
7312 }
7313 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
7314 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
7315 }
7316 }
7317 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7319 match value {
7320 "KIND_UNKNOWN" => Some(Self::Unknown),
7321 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7322 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
7323 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
7324 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
7325 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
7326 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
7327 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
7328 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
7329 Some(Self::StoreExecutionTimeObservations)
7330 }
7331 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
7332 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
7333 _ => None,
7334 }
7335 }
7336 }
7337 #[non_exhaustive]
7338 #[derive(Clone, PartialEq, ::prost::Oneof)]
7339 pub enum Data {
7340 #[prost(message, tag = "2")]
7342 ChangeEpoch(super::ChangeEpoch),
7343 #[prost(message, tag = "3")]
7345 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
7346 #[prost(message, tag = "4")]
7348 ExecutionTimeObservations(super::ExecutionTimeObservations),
7349 #[prost(string, tag = "5")]
7351 BridgeChainId(::prost::alloc::string::String),
7352 #[prost(uint64, tag = "6")]
7354 BridgeObjectVersion(u64),
7355 }
7356}
7357#[non_exhaustive]
7359#[derive(Clone, Copy, PartialEq, ::prost::Message)]
7360pub struct AuthenticatorStateExpire {
7361 #[prost(uint64, optional, tag = "1")]
7363 pub min_epoch: ::core::option::Option<u64>,
7364 #[prost(uint64, optional, tag = "2")]
7366 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7367}
7368#[non_exhaustive]
7369#[derive(Clone, PartialEq, ::prost::Message)]
7370pub struct ExecutionTimeObservations {
7371 #[prost(int32, optional, tag = "1")]
7373 pub version: ::core::option::Option<i32>,
7374 #[prost(message, repeated, tag = "2")]
7375 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
7376}
7377#[non_exhaustive]
7378#[derive(Clone, PartialEq, ::prost::Message)]
7379pub struct ExecutionTimeObservation {
7380 #[prost(
7381 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
7382 optional,
7383 tag = "1"
7384 )]
7385 pub kind: ::core::option::Option<i32>,
7386 #[prost(message, optional, tag = "2")]
7387 pub move_entry_point: ::core::option::Option<MoveCall>,
7388 #[prost(message, repeated, tag = "3")]
7389 pub validator_observations: ::prost::alloc::vec::Vec<
7390 ValidatorExecutionTimeObservation,
7391 >,
7392}
7393pub mod execution_time_observation {
7395 #[non_exhaustive]
7396 #[derive(
7397 Clone,
7398 Copy,
7399 Debug,
7400 PartialEq,
7401 Eq,
7402 Hash,
7403 PartialOrd,
7404 Ord,
7405 ::prost::Enumeration
7406 )]
7407 #[repr(i32)]
7408 pub enum ExecutionTimeObservationKind {
7409 Unknown = 0,
7410 MoveEntryPoint = 1,
7411 TransferObjects = 2,
7412 SplitCoins = 3,
7413 MergeCoins = 4,
7414 Publish = 5,
7415 MakeMoveVector = 6,
7416 Upgrade = 7,
7417 }
7418 impl ExecutionTimeObservationKind {
7419 pub fn as_str_name(&self) -> &'static str {
7424 match self {
7425 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
7426 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
7427 Self::TransferObjects => "TRANSFER_OBJECTS",
7428 Self::SplitCoins => "SPLIT_COINS",
7429 Self::MergeCoins => "MERGE_COINS",
7430 Self::Publish => "PUBLISH",
7431 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
7432 Self::Upgrade => "UPGRADE",
7433 }
7434 }
7435 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7437 match value {
7438 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
7439 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
7440 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
7441 "SPLIT_COINS" => Some(Self::SplitCoins),
7442 "MERGE_COINS" => Some(Self::MergeCoins),
7443 "PUBLISH" => Some(Self::Publish),
7444 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
7445 "UPGRADE" => Some(Self::Upgrade),
7446 _ => None,
7447 }
7448 }
7449 }
7450}
7451#[non_exhaustive]
7452#[derive(Clone, PartialEq, ::prost::Message)]
7453pub struct ValidatorExecutionTimeObservation {
7454 #[prost(bytes = "bytes", optional, tag = "1")]
7456 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
7457 #[prost(message, optional, tag = "2")]
7459 pub duration: ::core::option::Option<::prost_types::Duration>,
7460}
7461#[non_exhaustive]
7462#[derive(Clone, PartialEq, ::prost::Message)]
7463pub struct ExecuteTransactionRequest {
7464 #[prost(message, optional, tag = "1")]
7466 pub transaction: ::core::option::Option<Transaction>,
7467 #[prost(message, repeated, tag = "2")]
7470 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
7471 #[prost(message, optional, tag = "3")]
7474 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7475}
7476#[non_exhaustive]
7478#[derive(Clone, PartialEq, ::prost::Message)]
7479pub struct ExecuteTransactionResponse {
7480 #[prost(message, optional, tag = "1")]
7481 pub transaction: ::core::option::Option<ExecutedTransaction>,
7482}
7483#[non_exhaustive]
7484#[derive(Clone, PartialEq, ::prost::Message)]
7485pub struct SimulateTransactionRequest {
7486 #[prost(message, optional, tag = "1")]
7487 pub transaction: ::core::option::Option<Transaction>,
7488 #[prost(message, optional, tag = "2")]
7490 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7491 #[prost(
7493 enumeration = "simulate_transaction_request::TransactionChecks",
7494 optional,
7495 tag = "3"
7496 )]
7497 pub checks: ::core::option::Option<i32>,
7498 #[prost(bool, optional, tag = "4")]
7503 pub do_gas_selection: ::core::option::Option<bool>,
7504}
7505pub mod simulate_transaction_request {
7507 #[non_exhaustive]
7509 #[derive(
7510 Clone,
7511 Copy,
7512 Debug,
7513 PartialEq,
7514 Eq,
7515 Hash,
7516 PartialOrd,
7517 Ord,
7518 ::prost::Enumeration
7519 )]
7520 #[repr(i32)]
7521 pub enum TransactionChecks {
7522 Enabled = 0,
7523 Disabled = 1,
7524 }
7525 impl TransactionChecks {
7526 pub fn as_str_name(&self) -> &'static str {
7531 match self {
7532 Self::Enabled => "ENABLED",
7533 Self::Disabled => "DISABLED",
7534 }
7535 }
7536 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7538 match value {
7539 "ENABLED" => Some(Self::Enabled),
7540 "DISABLED" => Some(Self::Disabled),
7541 _ => None,
7542 }
7543 }
7544 }
7545}
7546#[non_exhaustive]
7547#[derive(Clone, PartialEq, ::prost::Message)]
7548pub struct SimulateTransactionResponse {
7549 #[prost(message, optional, tag = "1")]
7550 pub transaction: ::core::option::Option<ExecutedTransaction>,
7551 #[prost(message, repeated, tag = "2")]
7552 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
7553}
7554#[non_exhaustive]
7556#[derive(Clone, PartialEq, ::prost::Message)]
7557pub struct CommandResult {
7558 #[prost(message, repeated, tag = "1")]
7559 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
7560 #[prost(message, repeated, tag = "2")]
7561 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
7562}
7563#[non_exhaustive]
7564#[derive(Clone, PartialEq, ::prost::Message)]
7565pub struct CommandOutput {
7566 #[prost(message, optional, tag = "1")]
7567 pub argument: ::core::option::Option<Argument>,
7568 #[prost(message, optional, tag = "2")]
7569 pub value: ::core::option::Option<Bcs>,
7570 #[prost(message, optional, boxed, tag = "3")]
7572 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
7573}
7574pub mod transaction_execution_service_client {
7576 #![allow(
7577 unused_variables,
7578 dead_code,
7579 missing_docs,
7580 clippy::wildcard_imports,
7581 clippy::let_unit_value,
7582 )]
7583 use tonic::codegen::*;
7584 use tonic::codegen::http::Uri;
7585 #[derive(Debug, Clone)]
7586 pub struct TransactionExecutionServiceClient<T> {
7587 inner: tonic::client::Grpc<T>,
7588 }
7589 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
7590 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7592 where
7593 D: TryInto<tonic::transport::Endpoint>,
7594 D::Error: Into<StdError>,
7595 {
7596 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7597 Ok(Self::new(conn))
7598 }
7599 }
7600 impl<T> TransactionExecutionServiceClient<T>
7601 where
7602 T: tonic::client::GrpcService<tonic::body::Body>,
7603 T::Error: Into<StdError>,
7604 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7605 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7606 {
7607 pub fn new(inner: T) -> Self {
7608 let inner = tonic::client::Grpc::new(inner);
7609 Self { inner }
7610 }
7611 pub fn with_origin(inner: T, origin: Uri) -> Self {
7612 let inner = tonic::client::Grpc::with_origin(inner, origin);
7613 Self { inner }
7614 }
7615 pub fn with_interceptor<F>(
7616 inner: T,
7617 interceptor: F,
7618 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
7619 where
7620 F: tonic::service::Interceptor,
7621 T::ResponseBody: Default,
7622 T: tonic::codegen::Service<
7623 http::Request<tonic::body::Body>,
7624 Response = http::Response<
7625 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7626 >,
7627 >,
7628 <T as tonic::codegen::Service<
7629 http::Request<tonic::body::Body>,
7630 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7631 {
7632 TransactionExecutionServiceClient::new(
7633 InterceptedService::new(inner, interceptor),
7634 )
7635 }
7636 #[must_use]
7641 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7642 self.inner = self.inner.send_compressed(encoding);
7643 self
7644 }
7645 #[must_use]
7647 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7648 self.inner = self.inner.accept_compressed(encoding);
7649 self
7650 }
7651 #[must_use]
7655 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7656 self.inner = self.inner.max_decoding_message_size(limit);
7657 self
7658 }
7659 #[must_use]
7663 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7664 self.inner = self.inner.max_encoding_message_size(limit);
7665 self
7666 }
7667 pub async fn execute_transaction(
7668 &mut self,
7669 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
7670 ) -> std::result::Result<
7671 tonic::Response<super::ExecuteTransactionResponse>,
7672 tonic::Status,
7673 > {
7674 self.inner
7675 .ready()
7676 .await
7677 .map_err(|e| {
7678 tonic::Status::unknown(
7679 format!("Service was not ready: {}", e.into()),
7680 )
7681 })?;
7682 let codec = tonic::codec::ProstCodec::default();
7683 let path = http::uri::PathAndQuery::from_static(
7684 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
7685 );
7686 let mut req = request.into_request();
7687 req.extensions_mut()
7688 .insert(
7689 GrpcMethod::new(
7690 "sui.rpc.v2.TransactionExecutionService",
7691 "ExecuteTransaction",
7692 ),
7693 );
7694 self.inner.unary(req, path, codec).await
7695 }
7696 pub async fn simulate_transaction(
7697 &mut self,
7698 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
7699 ) -> std::result::Result<
7700 tonic::Response<super::SimulateTransactionResponse>,
7701 tonic::Status,
7702 > {
7703 self.inner
7704 .ready()
7705 .await
7706 .map_err(|e| {
7707 tonic::Status::unknown(
7708 format!("Service was not ready: {}", e.into()),
7709 )
7710 })?;
7711 let codec = tonic::codec::ProstCodec::default();
7712 let path = http::uri::PathAndQuery::from_static(
7713 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
7714 );
7715 let mut req = request.into_request();
7716 req.extensions_mut()
7717 .insert(
7718 GrpcMethod::new(
7719 "sui.rpc.v2.TransactionExecutionService",
7720 "SimulateTransaction",
7721 ),
7722 );
7723 self.inner.unary(req, path, codec).await
7724 }
7725 }
7726}
7727pub mod transaction_execution_service_server {
7729 #![allow(
7730 unused_variables,
7731 dead_code,
7732 missing_docs,
7733 clippy::wildcard_imports,
7734 clippy::let_unit_value,
7735 )]
7736 use tonic::codegen::*;
7737 #[async_trait]
7739 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
7740 async fn execute_transaction(
7741 &self,
7742 request: tonic::Request<super::ExecuteTransactionRequest>,
7743 ) -> std::result::Result<
7744 tonic::Response<super::ExecuteTransactionResponse>,
7745 tonic::Status,
7746 >;
7747 async fn simulate_transaction(
7748 &self,
7749 request: tonic::Request<super::SimulateTransactionRequest>,
7750 ) -> std::result::Result<
7751 tonic::Response<super::SimulateTransactionResponse>,
7752 tonic::Status,
7753 >;
7754 }
7755 #[derive(Debug)]
7756 pub struct TransactionExecutionServiceServer<T> {
7757 inner: Arc<T>,
7758 accept_compression_encodings: EnabledCompressionEncodings,
7759 send_compression_encodings: EnabledCompressionEncodings,
7760 max_decoding_message_size: Option<usize>,
7761 max_encoding_message_size: Option<usize>,
7762 }
7763 impl<T> TransactionExecutionServiceServer<T> {
7764 pub fn new(inner: T) -> Self {
7765 Self::from_arc(Arc::new(inner))
7766 }
7767 pub fn from_arc(inner: Arc<T>) -> Self {
7768 Self {
7769 inner,
7770 accept_compression_encodings: Default::default(),
7771 send_compression_encodings: Default::default(),
7772 max_decoding_message_size: None,
7773 max_encoding_message_size: None,
7774 }
7775 }
7776 pub fn with_interceptor<F>(
7777 inner: T,
7778 interceptor: F,
7779 ) -> InterceptedService<Self, F>
7780 where
7781 F: tonic::service::Interceptor,
7782 {
7783 InterceptedService::new(Self::new(inner), interceptor)
7784 }
7785 #[must_use]
7787 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7788 self.accept_compression_encodings.enable(encoding);
7789 self
7790 }
7791 #[must_use]
7793 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7794 self.send_compression_encodings.enable(encoding);
7795 self
7796 }
7797 #[must_use]
7801 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7802 self.max_decoding_message_size = Some(limit);
7803 self
7804 }
7805 #[must_use]
7809 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7810 self.max_encoding_message_size = Some(limit);
7811 self
7812 }
7813 }
7814 impl<T, B> tonic::codegen::Service<http::Request<B>>
7815 for TransactionExecutionServiceServer<T>
7816 where
7817 T: TransactionExecutionService,
7818 B: Body + std::marker::Send + 'static,
7819 B::Error: Into<StdError> + std::marker::Send + 'static,
7820 {
7821 type Response = http::Response<tonic::body::Body>;
7822 type Error = std::convert::Infallible;
7823 type Future = BoxFuture<Self::Response, Self::Error>;
7824 fn poll_ready(
7825 &mut self,
7826 _cx: &mut Context<'_>,
7827 ) -> Poll<std::result::Result<(), Self::Error>> {
7828 Poll::Ready(Ok(()))
7829 }
7830 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7831 match req.uri().path() {
7832 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
7833 #[allow(non_camel_case_types)]
7834 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
7835 pub Arc<T>,
7836 );
7837 impl<
7838 T: TransactionExecutionService,
7839 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
7840 for ExecuteTransactionSvc<T> {
7841 type Response = super::ExecuteTransactionResponse;
7842 type Future = BoxFuture<
7843 tonic::Response<Self::Response>,
7844 tonic::Status,
7845 >;
7846 fn call(
7847 &mut self,
7848 request: tonic::Request<super::ExecuteTransactionRequest>,
7849 ) -> Self::Future {
7850 let inner = Arc::clone(&self.0);
7851 let fut = async move {
7852 <T as TransactionExecutionService>::execute_transaction(
7853 &inner,
7854 request,
7855 )
7856 .await
7857 };
7858 Box::pin(fut)
7859 }
7860 }
7861 let accept_compression_encodings = self.accept_compression_encodings;
7862 let send_compression_encodings = self.send_compression_encodings;
7863 let max_decoding_message_size = self.max_decoding_message_size;
7864 let max_encoding_message_size = self.max_encoding_message_size;
7865 let inner = self.inner.clone();
7866 let fut = async move {
7867 let method = ExecuteTransactionSvc(inner);
7868 let codec = tonic::codec::ProstCodec::default();
7869 let mut grpc = tonic::server::Grpc::new(codec)
7870 .apply_compression_config(
7871 accept_compression_encodings,
7872 send_compression_encodings,
7873 )
7874 .apply_max_message_size_config(
7875 max_decoding_message_size,
7876 max_encoding_message_size,
7877 );
7878 let res = grpc.unary(method, req).await;
7879 Ok(res)
7880 };
7881 Box::pin(fut)
7882 }
7883 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
7884 #[allow(non_camel_case_types)]
7885 struct SimulateTransactionSvc<T: TransactionExecutionService>(
7886 pub Arc<T>,
7887 );
7888 impl<
7889 T: TransactionExecutionService,
7890 > tonic::server::UnaryService<super::SimulateTransactionRequest>
7891 for SimulateTransactionSvc<T> {
7892 type Response = super::SimulateTransactionResponse;
7893 type Future = BoxFuture<
7894 tonic::Response<Self::Response>,
7895 tonic::Status,
7896 >;
7897 fn call(
7898 &mut self,
7899 request: tonic::Request<super::SimulateTransactionRequest>,
7900 ) -> Self::Future {
7901 let inner = Arc::clone(&self.0);
7902 let fut = async move {
7903 <T as TransactionExecutionService>::simulate_transaction(
7904 &inner,
7905 request,
7906 )
7907 .await
7908 };
7909 Box::pin(fut)
7910 }
7911 }
7912 let accept_compression_encodings = self.accept_compression_encodings;
7913 let send_compression_encodings = self.send_compression_encodings;
7914 let max_decoding_message_size = self.max_decoding_message_size;
7915 let max_encoding_message_size = self.max_encoding_message_size;
7916 let inner = self.inner.clone();
7917 let fut = async move {
7918 let method = SimulateTransactionSvc(inner);
7919 let codec = tonic::codec::ProstCodec::default();
7920 let mut grpc = tonic::server::Grpc::new(codec)
7921 .apply_compression_config(
7922 accept_compression_encodings,
7923 send_compression_encodings,
7924 )
7925 .apply_max_message_size_config(
7926 max_decoding_message_size,
7927 max_encoding_message_size,
7928 );
7929 let res = grpc.unary(method, req).await;
7930 Ok(res)
7931 };
7932 Box::pin(fut)
7933 }
7934 _ => {
7935 Box::pin(async move {
7936 let mut response = http::Response::new(
7937 tonic::body::Body::default(),
7938 );
7939 let headers = response.headers_mut();
7940 headers
7941 .insert(
7942 tonic::Status::GRPC_STATUS,
7943 (tonic::Code::Unimplemented as i32).into(),
7944 );
7945 headers
7946 .insert(
7947 http::header::CONTENT_TYPE,
7948 tonic::metadata::GRPC_CONTENT_TYPE,
7949 );
7950 Ok(response)
7951 })
7952 }
7953 }
7954 }
7955 }
7956 impl<T> Clone for TransactionExecutionServiceServer<T> {
7957 fn clone(&self) -> Self {
7958 let inner = self.inner.clone();
7959 Self {
7960 inner,
7961 accept_compression_encodings: self.accept_compression_encodings,
7962 send_compression_encodings: self.send_compression_encodings,
7963 max_decoding_message_size: self.max_decoding_message_size,
7964 max_encoding_message_size: self.max_encoding_message_size,
7965 }
7966 }
7967 }
7968 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
7970 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
7971 const NAME: &'static str = SERVICE_NAME;
7972 }
7973}