1#[non_exhaustive]
4#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct Argument {
6 #[prost(enumeration = "argument::ArgumentKind", optional, tag = "1")]
7 pub kind: ::core::option::Option<i32>,
8 #[prost(uint32, optional, tag = "2")]
10 pub input: ::core::option::Option<u32>,
11 #[prost(uint32, optional, tag = "3")]
13 pub result: ::core::option::Option<u32>,
14 #[prost(uint32, optional, tag = "4")]
16 pub subresult: ::core::option::Option<u32>,
17}
18pub mod argument {
20 #[non_exhaustive]
21 #[derive(
22 Clone,
23 Copy,
24 Debug,
25 PartialEq,
26 Eq,
27 Hash,
28 PartialOrd,
29 Ord,
30 ::prost::Enumeration
31 )]
32 #[repr(i32)]
33 pub enum ArgumentKind {
34 Unknown = 0,
35 Gas = 1,
37 Input = 2,
40 Result = 3,
42 }
43 impl ArgumentKind {
44 pub fn as_str_name(&self) -> &'static str {
49 match self {
50 Self::Unknown => "ARGUMENT_KIND_UNKNOWN",
51 Self::Gas => "GAS",
52 Self::Input => "INPUT",
53 Self::Result => "RESULT",
54 }
55 }
56 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
58 match value {
59 "ARGUMENT_KIND_UNKNOWN" => Some(Self::Unknown),
60 "GAS" => Some(Self::Gas),
61 "INPUT" => Some(Self::Input),
62 "RESULT" => Some(Self::Result),
63 _ => None,
64 }
65 }
66 }
67}
68#[non_exhaustive]
70#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
71pub struct BalanceChange {
72 #[prost(string, optional, tag = "1")]
74 pub address: ::core::option::Option<::prost::alloc::string::String>,
75 #[prost(string, optional, tag = "2")]
77 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
78 #[prost(string, optional, tag = "3")]
80 pub amount: ::core::option::Option<::prost::alloc::string::String>,
81}
82#[non_exhaustive]
86#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
87pub struct Bcs {
88 #[prost(string, optional, tag = "1")]
90 pub name: ::core::option::Option<::prost::alloc::string::String>,
91 #[prost(bytes = "bytes", optional, tag = "2")]
93 pub value: ::core::option::Option<::prost::bytes::Bytes>,
94}
95#[non_exhaustive]
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct Checkpoint {
98 #[prost(uint64, optional, tag = "1")]
100 pub sequence_number: ::core::option::Option<u64>,
101 #[prost(string, optional, tag = "2")]
103 pub digest: ::core::option::Option<::prost::alloc::string::String>,
104 #[prost(message, optional, tag = "3")]
106 pub summary: ::core::option::Option<CheckpointSummary>,
107 #[prost(message, optional, tag = "4")]
110 pub signature: ::core::option::Option<ValidatorAggregatedSignature>,
111 #[prost(message, optional, tag = "5")]
113 pub contents: ::core::option::Option<CheckpointContents>,
114 #[prost(message, repeated, tag = "6")]
116 pub transactions: ::prost::alloc::vec::Vec<ExecutedTransaction>,
117 #[prost(message, optional, tag = "7")]
125 pub objects: ::core::option::Option<ObjectSet>,
126}
127#[non_exhaustive]
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct CheckpointContents {
131 #[prost(message, optional, tag = "1")]
133 pub bcs: ::core::option::Option<Bcs>,
134 #[prost(string, optional, tag = "2")]
136 pub digest: ::core::option::Option<::prost::alloc::string::String>,
137 #[prost(int32, optional, tag = "3")]
139 pub version: ::core::option::Option<i32>,
140 #[prost(message, repeated, tag = "4")]
142 pub transactions: ::prost::alloc::vec::Vec<CheckpointedTransactionInfo>,
143}
144#[non_exhaustive]
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct CheckpointedTransactionInfo {
148 #[prost(string, optional, tag = "1")]
150 pub transaction: ::core::option::Option<::prost::alloc::string::String>,
151 #[prost(string, optional, tag = "2")]
153 pub effects: ::core::option::Option<::prost::alloc::string::String>,
154 #[prost(message, repeated, tag = "3")]
156 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
157 #[prost(message, repeated, tag = "4")]
162 pub address_aliases_versions: ::prost::alloc::vec::Vec<AddressAliasesVersion>,
163}
164#[non_exhaustive]
165#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
166pub struct AddressAliasesVersion {
167 #[prost(uint64, optional, tag = "1")]
168 pub version: ::core::option::Option<u64>,
169}
170#[non_exhaustive]
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct CheckpointSummary {
193 #[prost(message, optional, tag = "1")]
195 pub bcs: ::core::option::Option<Bcs>,
196 #[prost(string, optional, tag = "2")]
198 pub digest: ::core::option::Option<::prost::alloc::string::String>,
199 #[prost(uint64, optional, tag = "3")]
201 pub epoch: ::core::option::Option<u64>,
202 #[prost(uint64, optional, tag = "4")]
204 pub sequence_number: ::core::option::Option<u64>,
205 #[prost(uint64, optional, tag = "5")]
208 pub total_network_transactions: ::core::option::Option<u64>,
209 #[prost(string, optional, tag = "6")]
211 pub content_digest: ::core::option::Option<::prost::alloc::string::String>,
212 #[prost(string, optional, tag = "7")]
216 pub previous_digest: ::core::option::Option<::prost::alloc::string::String>,
217 #[prost(message, optional, tag = "8")]
220 pub epoch_rolling_gas_cost_summary: ::core::option::Option<GasCostSummary>,
221 #[prost(message, optional, tag = "9")]
225 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
226 #[prost(message, repeated, tag = "10")]
228 pub commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
229 #[prost(message, optional, tag = "11")]
231 pub end_of_epoch_data: ::core::option::Option<EndOfEpochData>,
232 #[prost(bytes = "bytes", optional, tag = "12")]
237 pub version_specific_data: ::core::option::Option<::prost::bytes::Bytes>,
238}
239#[non_exhaustive]
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct EndOfEpochData {
243 #[prost(message, repeated, tag = "1")]
245 pub next_epoch_committee: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
246 #[prost(uint64, optional, tag = "2")]
248 pub next_epoch_protocol_version: ::core::option::Option<u64>,
249 #[prost(message, repeated, tag = "3")]
251 pub epoch_commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
252}
253#[non_exhaustive]
255#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
256pub struct CheckpointCommitment {
257 #[prost(
258 enumeration = "checkpoint_commitment::CheckpointCommitmentKind",
259 optional,
260 tag = "1"
261 )]
262 pub kind: ::core::option::Option<i32>,
263 #[prost(string, optional, tag = "2")]
264 pub digest: ::core::option::Option<::prost::alloc::string::String>,
265}
266pub mod checkpoint_commitment {
268 #[non_exhaustive]
269 #[derive(
270 Clone,
271 Copy,
272 Debug,
273 PartialEq,
274 Eq,
275 Hash,
276 PartialOrd,
277 Ord,
278 ::prost::Enumeration
279 )]
280 #[repr(i32)]
281 pub enum CheckpointCommitmentKind {
282 Unknown = 0,
283 EcmhLiveObjectSet = 1,
286 CheckpointArtifacts = 2,
288 }
289 impl CheckpointCommitmentKind {
290 pub fn as_str_name(&self) -> &'static str {
295 match self {
296 Self::Unknown => "CHECKPOINT_COMMITMENT_KIND_UNKNOWN",
297 Self::EcmhLiveObjectSet => "ECMH_LIVE_OBJECT_SET",
298 Self::CheckpointArtifacts => "CHECKPOINT_ARTIFACTS",
299 }
300 }
301 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
303 match value {
304 "CHECKPOINT_COMMITMENT_KIND_UNKNOWN" => Some(Self::Unknown),
305 "ECMH_LIVE_OBJECT_SET" => Some(Self::EcmhLiveObjectSet),
306 "CHECKPOINT_ARTIFACTS" => Some(Self::CheckpointArtifacts),
307 _ => None,
308 }
309 }
310 }
311}
312#[non_exhaustive]
314#[derive(Clone, PartialEq, ::prost::Message)]
315pub struct TransactionEffects {
316 #[prost(message, optional, tag = "1")]
318 pub bcs: ::core::option::Option<Bcs>,
319 #[prost(string, optional, tag = "2")]
321 pub digest: ::core::option::Option<::prost::alloc::string::String>,
322 #[prost(int32, optional, tag = "3")]
324 pub version: ::core::option::Option<i32>,
325 #[prost(message, optional, tag = "4")]
327 pub status: ::core::option::Option<ExecutionStatus>,
328 #[prost(uint64, optional, tag = "5")]
330 pub epoch: ::core::option::Option<u64>,
331 #[prost(message, optional, tag = "6")]
333 pub gas_used: ::core::option::Option<GasCostSummary>,
334 #[prost(string, optional, tag = "7")]
336 pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
337 #[prost(message, optional, tag = "8")]
341 pub gas_object: ::core::option::Option<ChangedObject>,
342 #[prost(string, optional, tag = "9")]
345 pub events_digest: ::core::option::Option<::prost::alloc::string::String>,
346 #[prost(string, repeated, tag = "10")]
348 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
349 #[prost(uint64, optional, tag = "11")]
351 pub lamport_version: ::core::option::Option<u64>,
352 #[prost(message, repeated, tag = "12")]
354 pub changed_objects: ::prost::alloc::vec::Vec<ChangedObject>,
355 #[prost(message, repeated, tag = "13")]
360 pub unchanged_consensus_objects: ::prost::alloc::vec::Vec<UnchangedConsensusObject>,
361 #[prost(string, optional, tag = "14")]
365 pub auxiliary_data_digest: ::core::option::Option<::prost::alloc::string::String>,
366 #[prost(message, repeated, tag = "15")]
367 pub unchanged_loaded_runtime_objects: ::prost::alloc::vec::Vec<ObjectReference>,
368}
369#[non_exhaustive]
371#[derive(Clone, PartialEq, ::prost::Message)]
372pub struct ChangedObject {
373 #[prost(string, optional, tag = "1")]
375 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
376 #[prost(enumeration = "changed_object::InputObjectState", optional, tag = "2")]
377 pub input_state: ::core::option::Option<i32>,
378 #[prost(uint64, optional, tag = "3")]
380 pub input_version: ::core::option::Option<u64>,
381 #[prost(string, optional, tag = "4")]
383 pub input_digest: ::core::option::Option<::prost::alloc::string::String>,
384 #[prost(message, optional, tag = "5")]
386 pub input_owner: ::core::option::Option<Owner>,
387 #[prost(enumeration = "changed_object::OutputObjectState", optional, tag = "6")]
388 pub output_state: ::core::option::Option<i32>,
389 #[prost(uint64, optional, tag = "7")]
391 pub output_version: ::core::option::Option<u64>,
392 #[prost(string, optional, tag = "8")]
394 pub output_digest: ::core::option::Option<::prost::alloc::string::String>,
395 #[prost(message, optional, tag = "9")]
397 pub output_owner: ::core::option::Option<Owner>,
398 #[prost(message, optional, tag = "12")]
400 pub accumulator_write: ::core::option::Option<AccumulatorWrite>,
401 #[prost(enumeration = "changed_object::IdOperation", optional, tag = "10")]
403 pub id_operation: ::core::option::Option<i32>,
404 #[prost(string, optional, tag = "11")]
407 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
408}
409pub mod changed_object {
411 #[non_exhaustive]
412 #[derive(
413 Clone,
414 Copy,
415 Debug,
416 PartialEq,
417 Eq,
418 Hash,
419 PartialOrd,
420 Ord,
421 ::prost::Enumeration
422 )]
423 #[repr(i32)]
424 pub enum InputObjectState {
425 Unknown = 0,
426 DoesNotExist = 1,
427 Exists = 2,
428 }
429 impl InputObjectState {
430 pub fn as_str_name(&self) -> &'static str {
435 match self {
436 Self::Unknown => "INPUT_OBJECT_STATE_UNKNOWN",
437 Self::DoesNotExist => "INPUT_OBJECT_STATE_DOES_NOT_EXIST",
438 Self::Exists => "INPUT_OBJECT_STATE_EXISTS",
439 }
440 }
441 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
443 match value {
444 "INPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
445 "INPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
446 "INPUT_OBJECT_STATE_EXISTS" => Some(Self::Exists),
447 _ => None,
448 }
449 }
450 }
451 #[non_exhaustive]
452 #[derive(
453 Clone,
454 Copy,
455 Debug,
456 PartialEq,
457 Eq,
458 Hash,
459 PartialOrd,
460 Ord,
461 ::prost::Enumeration
462 )]
463 #[repr(i32)]
464 pub enum OutputObjectState {
465 Unknown = 0,
466 DoesNotExist = 1,
467 ObjectWrite = 2,
468 PackageWrite = 3,
469 AccumulatorWrite = 4,
470 }
471 impl OutputObjectState {
472 pub fn as_str_name(&self) -> &'static str {
477 match self {
478 Self::Unknown => "OUTPUT_OBJECT_STATE_UNKNOWN",
479 Self::DoesNotExist => "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST",
480 Self::ObjectWrite => "OUTPUT_OBJECT_STATE_OBJECT_WRITE",
481 Self::PackageWrite => "OUTPUT_OBJECT_STATE_PACKAGE_WRITE",
482 Self::AccumulatorWrite => "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE",
483 }
484 }
485 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
487 match value {
488 "OUTPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
489 "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
490 "OUTPUT_OBJECT_STATE_OBJECT_WRITE" => Some(Self::ObjectWrite),
491 "OUTPUT_OBJECT_STATE_PACKAGE_WRITE" => Some(Self::PackageWrite),
492 "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE" => Some(Self::AccumulatorWrite),
493 _ => None,
494 }
495 }
496 }
497 #[non_exhaustive]
498 #[derive(
499 Clone,
500 Copy,
501 Debug,
502 PartialEq,
503 Eq,
504 Hash,
505 PartialOrd,
506 Ord,
507 ::prost::Enumeration
508 )]
509 #[repr(i32)]
510 pub enum IdOperation {
511 Unknown = 0,
512 None = 1,
513 Created = 2,
514 Deleted = 3,
515 }
516 impl IdOperation {
517 pub fn as_str_name(&self) -> &'static str {
522 match self {
523 Self::Unknown => "ID_OPERATION_UNKNOWN",
524 Self::None => "NONE",
525 Self::Created => "CREATED",
526 Self::Deleted => "DELETED",
527 }
528 }
529 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
531 match value {
532 "ID_OPERATION_UNKNOWN" => Some(Self::Unknown),
533 "NONE" => Some(Self::None),
534 "CREATED" => Some(Self::Created),
535 "DELETED" => Some(Self::Deleted),
536 _ => None,
537 }
538 }
539 }
540}
541#[non_exhaustive]
543#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
544pub struct EventDigestEntry {
545 #[prost(uint64, optional, tag = "1")]
547 pub event_index: ::core::option::Option<u64>,
548 #[prost(string, optional, tag = "2")]
550 pub digest: ::core::option::Option<::prost::alloc::string::String>,
551}
552#[non_exhaustive]
553#[derive(Clone, PartialEq, ::prost::Message)]
554pub struct AccumulatorWrite {
555 #[prost(string, optional, tag = "1")]
556 pub address: ::core::option::Option<::prost::alloc::string::String>,
557 #[prost(string, optional, tag = "2")]
558 pub accumulator_type: ::core::option::Option<::prost::alloc::string::String>,
559 #[prost(
560 enumeration = "accumulator_write::AccumulatorOperation",
561 optional,
562 tag = "3"
563 )]
564 pub operation: ::core::option::Option<i32>,
565 #[prost(enumeration = "accumulator_write::AccumulatorValue", optional, tag = "4")]
566 pub value_kind: ::core::option::Option<i32>,
567 #[prost(uint64, optional, tag = "5")]
569 pub integer_value: ::core::option::Option<u64>,
570 #[prost(uint64, repeated, tag = "6")]
573 pub integer_tuple: ::prost::alloc::vec::Vec<u64>,
574 #[prost(message, repeated, tag = "7")]
578 pub event_digest_value: ::prost::alloc::vec::Vec<EventDigestEntry>,
579}
580pub mod accumulator_write {
582 #[non_exhaustive]
583 #[derive(
584 Clone,
585 Copy,
586 Debug,
587 PartialEq,
588 Eq,
589 Hash,
590 PartialOrd,
591 Ord,
592 ::prost::Enumeration
593 )]
594 #[repr(i32)]
595 pub enum AccumulatorOperation {
596 Unknown = 0,
597 Merge = 1,
598 Split = 2,
599 }
600 impl AccumulatorOperation {
601 pub fn as_str_name(&self) -> &'static str {
606 match self {
607 Self::Unknown => "ACCUMULATOR_OPERATION_UNKNOWN",
608 Self::Merge => "MERGE",
609 Self::Split => "SPLIT",
610 }
611 }
612 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
614 match value {
615 "ACCUMULATOR_OPERATION_UNKNOWN" => Some(Self::Unknown),
616 "MERGE" => Some(Self::Merge),
617 "SPLIT" => Some(Self::Split),
618 _ => None,
619 }
620 }
621 }
622 #[non_exhaustive]
623 #[derive(
624 Clone,
625 Copy,
626 Debug,
627 PartialEq,
628 Eq,
629 Hash,
630 PartialOrd,
631 Ord,
632 ::prost::Enumeration
633 )]
634 #[repr(i32)]
635 pub enum AccumulatorValue {
636 Unknown = 0,
637 Integer = 1,
638 IntegerTuple = 2,
639 EventDigest = 3,
640 }
641 impl AccumulatorValue {
642 pub fn as_str_name(&self) -> &'static str {
647 match self {
648 Self::Unknown => "ACCUMULATOR_VALUE_UNKNOWN",
649 Self::Integer => "INTEGER",
650 Self::IntegerTuple => "INTEGER_TUPLE",
651 Self::EventDigest => "EVENT_DIGEST",
652 }
653 }
654 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
656 match value {
657 "ACCUMULATOR_VALUE_UNKNOWN" => Some(Self::Unknown),
658 "INTEGER" => Some(Self::Integer),
659 "INTEGER_TUPLE" => Some(Self::IntegerTuple),
660 "EVENT_DIGEST" => Some(Self::EventDigest),
661 _ => None,
662 }
663 }
664 }
665}
666#[non_exhaustive]
668#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
669pub struct UnchangedConsensusObject {
670 #[prost(
671 enumeration = "unchanged_consensus_object::UnchangedConsensusObjectKind",
672 optional,
673 tag = "1"
674 )]
675 pub kind: ::core::option::Option<i32>,
676 #[prost(string, optional, tag = "2")]
678 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
679 #[prost(uint64, optional, tag = "3")]
681 pub version: ::core::option::Option<u64>,
682 #[prost(string, optional, tag = "4")]
684 pub digest: ::core::option::Option<::prost::alloc::string::String>,
685 #[prost(string, optional, tag = "5")]
688 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
689}
690pub mod unchanged_consensus_object {
692 #[non_exhaustive]
693 #[derive(
694 Clone,
695 Copy,
696 Debug,
697 PartialEq,
698 Eq,
699 Hash,
700 PartialOrd,
701 Ord,
702 ::prost::Enumeration
703 )]
704 #[repr(i32)]
705 pub enum UnchangedConsensusObjectKind {
706 Unknown = 0,
707 ReadOnlyRoot = 1,
709 MutateConsensusStreamEnded = 2,
711 ReadConsensusStreamEnded = 3,
713 Canceled = 4,
716 PerEpochConfig = 5,
720 }
721 impl UnchangedConsensusObjectKind {
722 pub fn as_str_name(&self) -> &'static str {
727 match self {
728 Self::Unknown => "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN",
729 Self::ReadOnlyRoot => "READ_ONLY_ROOT",
730 Self::MutateConsensusStreamEnded => "MUTATE_CONSENSUS_STREAM_ENDED",
731 Self::ReadConsensusStreamEnded => "READ_CONSENSUS_STREAM_ENDED",
732 Self::Canceled => "CANCELED",
733 Self::PerEpochConfig => "PER_EPOCH_CONFIG",
734 }
735 }
736 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
738 match value {
739 "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN" => Some(Self::Unknown),
740 "READ_ONLY_ROOT" => Some(Self::ReadOnlyRoot),
741 "MUTATE_CONSENSUS_STREAM_ENDED" => Some(Self::MutateConsensusStreamEnded),
742 "READ_CONSENSUS_STREAM_ENDED" => Some(Self::ReadConsensusStreamEnded),
743 "CANCELED" => Some(Self::Canceled),
744 "PER_EPOCH_CONFIG" => Some(Self::PerEpochConfig),
745 _ => None,
746 }
747 }
748 }
749}
750#[non_exhaustive]
751#[derive(Clone, PartialEq, ::prost::Message)]
752pub struct Epoch {
753 #[prost(uint64, optional, tag = "1")]
754 pub epoch: ::core::option::Option<u64>,
755 #[prost(message, optional, tag = "2")]
757 pub committee: ::core::option::Option<ValidatorCommittee>,
758 #[prost(message, optional, boxed, tag = "3")]
773 pub system_state: ::core::option::Option<::prost::alloc::boxed::Box<SystemState>>,
774 #[prost(uint64, optional, tag = "4")]
778 pub first_checkpoint: ::core::option::Option<u64>,
779 #[prost(uint64, optional, tag = "5")]
784 pub last_checkpoint: ::core::option::Option<u64>,
785 #[prost(message, optional, tag = "6")]
786 pub start: ::core::option::Option<::prost_types::Timestamp>,
787 #[prost(message, optional, tag = "7")]
788 pub end: ::core::option::Option<::prost_types::Timestamp>,
789 #[prost(uint64, optional, tag = "8")]
791 pub reference_gas_price: ::core::option::Option<u64>,
792 #[prost(message, optional, tag = "9")]
793 pub protocol_config: ::core::option::Option<ProtocolConfig>,
794 #[prost(uint64, optional, tag = "10")]
797 pub transaction_start_inclusive: ::core::option::Option<u64>,
798 #[prost(uint64, optional, tag = "11")]
802 pub transaction_end_exclusive: ::core::option::Option<u64>,
803 #[prost(bool, optional, tag = "12")]
808 pub ended_in_safe_mode: ::core::option::Option<bool>,
809 #[prost(message, optional, tag = "13")]
813 pub system_epoch_info: ::core::option::Option<SystemEpochInfo>,
814 #[prost(message, repeated, tag = "14")]
819 pub epoch_commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
820}
821#[non_exhaustive]
824#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
825pub struct SystemEpochInfo {
826 #[prost(uint64, optional, tag = "1")]
828 pub total_stake: ::core::option::Option<u64>,
829 #[prost(uint64, optional, tag = "2")]
832 pub storage_fund_reinvestment: ::core::option::Option<u64>,
833 #[prost(uint64, optional, tag = "3")]
836 pub storage_charge: ::core::option::Option<u64>,
837 #[prost(uint64, optional, tag = "4")]
840 pub storage_rebate: ::core::option::Option<u64>,
841 #[prost(uint64, optional, tag = "5")]
843 pub storage_fund_balance: ::core::option::Option<u64>,
844 #[prost(uint64, optional, tag = "6")]
846 pub stake_subsidy_amount: ::core::option::Option<u64>,
847 #[prost(uint64, optional, tag = "7")]
850 pub total_gas_fees: ::core::option::Option<u64>,
851 #[prost(uint64, optional, tag = "8")]
853 pub total_stake_rewards_distributed: ::core::option::Option<u64>,
854 #[prost(uint64, optional, tag = "9")]
856 pub leftover_storage_fund_inflow: ::core::option::Option<u64>,
857}
858#[non_exhaustive]
861#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
862#[repr(i32)]
863pub enum ErrorReason {
864 Unknown = 0,
865 FieldInvalid = 1,
866 FieldMissing = 2,
867 InsufficientGasBalance = 3,
921 TransactionExecutionFailed = 4,
956 AboveLatestAvailable = 5,
1022 BelowEarliestAvailable = 6,
1078 ObjectRemoved = 7,
1108 NotServedHere = 8,
1138 NotReady = 9,
1161 VersionNotRetained = 10,
1183}
1184impl ErrorReason {
1185 pub fn as_str_name(&self) -> &'static str {
1190 match self {
1191 Self::Unknown => "ERROR_REASON_UNKNOWN",
1192 Self::FieldInvalid => "FIELD_INVALID",
1193 Self::FieldMissing => "FIELD_MISSING",
1194 Self::InsufficientGasBalance => "INSUFFICIENT_GAS_BALANCE",
1195 Self::TransactionExecutionFailed => "TRANSACTION_EXECUTION_FAILED",
1196 Self::AboveLatestAvailable => "ABOVE_LATEST_AVAILABLE",
1197 Self::BelowEarliestAvailable => "BELOW_EARLIEST_AVAILABLE",
1198 Self::ObjectRemoved => "OBJECT_REMOVED",
1199 Self::NotServedHere => "NOT_SERVED_HERE",
1200 Self::NotReady => "NOT_READY",
1201 Self::VersionNotRetained => "VERSION_NOT_RETAINED",
1202 }
1203 }
1204 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1206 match value {
1207 "ERROR_REASON_UNKNOWN" => Some(Self::Unknown),
1208 "FIELD_INVALID" => Some(Self::FieldInvalid),
1209 "FIELD_MISSING" => Some(Self::FieldMissing),
1210 "INSUFFICIENT_GAS_BALANCE" => Some(Self::InsufficientGasBalance),
1211 "TRANSACTION_EXECUTION_FAILED" => Some(Self::TransactionExecutionFailed),
1212 "ABOVE_LATEST_AVAILABLE" => Some(Self::AboveLatestAvailable),
1213 "BELOW_EARLIEST_AVAILABLE" => Some(Self::BelowEarliestAvailable),
1214 "OBJECT_REMOVED" => Some(Self::ObjectRemoved),
1215 "NOT_SERVED_HERE" => Some(Self::NotServedHere),
1216 "NOT_READY" => Some(Self::NotReady),
1217 "VERSION_NOT_RETAINED" => Some(Self::VersionNotRetained),
1218 _ => None,
1219 }
1220 }
1221}
1222#[non_exhaustive]
1224#[derive(Clone, PartialEq, ::prost::Message)]
1225pub struct TransactionEvents {
1226 #[prost(message, optional, tag = "1")]
1228 pub bcs: ::core::option::Option<Bcs>,
1229 #[prost(string, optional, tag = "2")]
1231 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1232 #[prost(message, repeated, tag = "3")]
1234 pub events: ::prost::alloc::vec::Vec<Event>,
1235}
1236#[non_exhaustive]
1238#[derive(Clone, PartialEq, ::prost::Message)]
1239pub struct Event {
1240 #[prost(string, optional, tag = "1")]
1243 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1244 #[prost(string, optional, tag = "2")]
1247 pub module: ::core::option::Option<::prost::alloc::string::String>,
1248 #[prost(string, optional, tag = "3")]
1250 pub sender: ::core::option::Option<::prost::alloc::string::String>,
1251 #[prost(string, optional, tag = "4")]
1253 pub event_type: ::core::option::Option<::prost::alloc::string::String>,
1254 #[prost(message, optional, tag = "5")]
1256 pub contents: ::core::option::Option<Bcs>,
1257 #[prost(message, optional, boxed, tag = "6")]
1259 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
1260 #[prost(uint64, optional, tag = "7")]
1266 pub checkpoint: ::core::option::Option<u64>,
1267 #[prost(string, optional, tag = "8")]
1269 pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
1270 #[prost(uint64, optional, tag = "9")]
1275 pub transaction_index: ::core::option::Option<u64>,
1276 #[prost(uint32, optional, tag = "10")]
1278 pub event_index: ::core::option::Option<u32>,
1279}
1280#[non_exhaustive]
1281#[derive(Clone, PartialEq, ::prost::Message)]
1282pub struct ExecutedTransaction {
1283 #[prost(string, optional, tag = "1")]
1285 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1286 #[prost(message, optional, tag = "2")]
1288 pub transaction: ::core::option::Option<Transaction>,
1289 #[prost(message, repeated, tag = "3")]
1292 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
1293 #[prost(message, optional, tag = "4")]
1295 pub effects: ::core::option::Option<TransactionEffects>,
1296 #[prost(message, optional, tag = "5")]
1303 pub events: ::core::option::Option<TransactionEvents>,
1304 #[prost(uint64, optional, tag = "6")]
1306 pub checkpoint: ::core::option::Option<u64>,
1307 #[prost(message, optional, tag = "7")]
1309 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
1310 #[prost(message, repeated, tag = "8")]
1311 pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
1312 #[prost(message, optional, tag = "9")]
1315 pub objects: ::core::option::Option<ObjectSet>,
1316 #[prost(uint64, optional, tag = "10")]
1319 pub transaction_index: ::core::option::Option<u64>,
1320}
1321#[non_exhaustive]
1323#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1324pub struct ExecutionStatus {
1325 #[prost(bool, optional, tag = "1")]
1327 pub success: ::core::option::Option<bool>,
1328 #[prost(message, optional, tag = "2")]
1330 pub error: ::core::option::Option<ExecutionError>,
1331}
1332#[non_exhaustive]
1334#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1335pub struct ExecutionError {
1336 #[prost(string, optional, tag = "1")]
1338 pub description: ::core::option::Option<::prost::alloc::string::String>,
1339 #[prost(uint64, optional, tag = "2")]
1341 pub command: ::core::option::Option<u64>,
1342 #[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
1343 pub kind: ::core::option::Option<i32>,
1344 #[prost(
1345 oneof = "execution_error::ErrorDetails",
1346 tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
1347 )]
1348 pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
1349}
1350pub mod execution_error {
1352 #[non_exhaustive]
1353 #[derive(
1354 Clone,
1355 Copy,
1356 Debug,
1357 PartialEq,
1358 Eq,
1359 Hash,
1360 PartialOrd,
1361 Ord,
1362 ::prost::Enumeration
1363 )]
1364 #[repr(i32)]
1365 pub enum ExecutionErrorKind {
1366 Unknown = 0,
1367 InsufficientGas = 1,
1369 InvalidGasObject = 2,
1371 InvariantViolation = 3,
1373 FeatureNotYetSupported = 4,
1375 ObjectTooBig = 5,
1377 PackageTooBig = 6,
1379 CircularObjectOwnership = 7,
1381 InsufficientCoinBalance = 8,
1383 CoinBalanceOverflow = 9,
1385 PublishErrorNonZeroAddress = 10,
1388 SuiMoveVerificationError = 11,
1390 MovePrimitiveRuntimeError = 12,
1394 MoveAbort = 13,
1396 VmVerificationOrDeserializationError = 14,
1398 VmInvariantViolation = 15,
1400 FunctionNotFound = 16,
1402 ArityMismatch = 17,
1405 TypeArityMismatch = 18,
1408 NonEntryFunctionInvoked = 19,
1410 CommandArgumentError = 20,
1412 TypeArgumentError = 21,
1414 UnusedValueWithoutDrop = 22,
1416 InvalidPublicFunctionReturnType = 23,
1419 InvalidTransferObject = 24,
1421 EffectsTooLarge = 25,
1423 PublishUpgradeMissingDependency = 26,
1425 PublishUpgradeDependencyDowngrade = 27,
1431 PackageUpgradeError = 28,
1433 WrittenObjectsTooLarge = 29,
1435 CertificateDenied = 30,
1437 SuiMoveVerificationTimedout = 31,
1439 ConsensusObjectOperationNotAllowed = 32,
1441 InputObjectDeleted = 33,
1443 ExecutionCanceledDueToConsensusObjectCongestion = 34,
1445 AddressDeniedForCoin = 35,
1447 CoinTypeGlobalPause = 36,
1449 ExecutionCanceledDueToRandomnessUnavailable = 37,
1451 MoveVectorElemTooBig = 38,
1455 MoveRawValueTooBig = 39,
1459 InvalidLinkage = 40,
1461 InsufficientFundsForWithdraw = 41,
1463 NonExclusiveWriteInputObjectModified = 42,
1465 TransactionExpired = 43,
1467 }
1468 impl ExecutionErrorKind {
1469 pub fn as_str_name(&self) -> &'static str {
1474 match self {
1475 Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
1476 Self::InsufficientGas => "INSUFFICIENT_GAS",
1477 Self::InvalidGasObject => "INVALID_GAS_OBJECT",
1478 Self::InvariantViolation => "INVARIANT_VIOLATION",
1479 Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
1480 Self::ObjectTooBig => "OBJECT_TOO_BIG",
1481 Self::PackageTooBig => "PACKAGE_TOO_BIG",
1482 Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
1483 Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
1484 Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
1485 Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
1486 Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
1487 Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
1488 Self::MoveAbort => "MOVE_ABORT",
1489 Self::VmVerificationOrDeserializationError => {
1490 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
1491 }
1492 Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
1493 Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
1494 Self::ArityMismatch => "ARITY_MISMATCH",
1495 Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
1496 Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
1497 Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
1498 Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
1499 Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
1500 Self::InvalidPublicFunctionReturnType => {
1501 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
1502 }
1503 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1504 Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
1505 Self::PublishUpgradeMissingDependency => {
1506 "PUBLISH_UPGRADE_MISSING_DEPENDENCY"
1507 }
1508 Self::PublishUpgradeDependencyDowngrade => {
1509 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
1510 }
1511 Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
1512 Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
1513 Self::CertificateDenied => "CERTIFICATE_DENIED",
1514 Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
1515 Self::ConsensusObjectOperationNotAllowed => {
1516 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1517 }
1518 Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
1519 Self::ExecutionCanceledDueToConsensusObjectCongestion => {
1520 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION"
1521 }
1522 Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
1523 Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
1524 Self::ExecutionCanceledDueToRandomnessUnavailable => {
1525 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
1526 }
1527 Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
1528 Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
1529 Self::InvalidLinkage => "INVALID_LINKAGE",
1530 Self::InsufficientFundsForWithdraw => "INSUFFICIENT_FUNDS_FOR_WITHDRAW",
1531 Self::NonExclusiveWriteInputObjectModified => {
1532 "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED"
1533 }
1534 Self::TransactionExpired => "TRANSACTION_EXPIRED",
1535 }
1536 }
1537 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1539 match value {
1540 "EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1541 "INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
1542 "INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
1543 "INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
1544 "FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
1545 "OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
1546 "PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
1547 "CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
1548 "INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
1549 "COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
1550 "PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
1551 Some(Self::PublishErrorNonZeroAddress)
1552 }
1553 "SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
1554 "MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
1555 "MOVE_ABORT" => Some(Self::MoveAbort),
1556 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
1557 Some(Self::VmVerificationOrDeserializationError)
1558 }
1559 "VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
1560 "FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
1561 "ARITY_MISMATCH" => Some(Self::ArityMismatch),
1562 "TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
1563 "NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
1564 "COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
1565 "TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
1566 "UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
1567 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
1568 Some(Self::InvalidPublicFunctionReturnType)
1569 }
1570 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1571 "EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
1572 "PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
1573 Some(Self::PublishUpgradeMissingDependency)
1574 }
1575 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
1576 Some(Self::PublishUpgradeDependencyDowngrade)
1577 }
1578 "PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
1579 "WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
1580 "CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
1581 "SUI_MOVE_VERIFICATION_TIMEDOUT" => {
1582 Some(Self::SuiMoveVerificationTimedout)
1583 }
1584 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1585 Some(Self::ConsensusObjectOperationNotAllowed)
1586 }
1587 "INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
1588 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION" => {
1589 Some(Self::ExecutionCanceledDueToConsensusObjectCongestion)
1590 }
1591 "ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
1592 "COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
1593 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
1594 Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
1595 }
1596 "MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
1597 "MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
1598 "INVALID_LINKAGE" => Some(Self::InvalidLinkage),
1599 "INSUFFICIENT_FUNDS_FOR_WITHDRAW" => {
1600 Some(Self::InsufficientFundsForWithdraw)
1601 }
1602 "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED" => {
1603 Some(Self::NonExclusiveWriteInputObjectModified)
1604 }
1605 "TRANSACTION_EXPIRED" => Some(Self::TransactionExpired),
1606 _ => None,
1607 }
1608 }
1609 }
1610 #[non_exhaustive]
1611 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1612 pub enum ErrorDetails {
1613 #[prost(message, tag = "4")]
1614 Abort(super::MoveAbort),
1615 #[prost(message, tag = "5")]
1616 SizeError(super::SizeError),
1617 #[prost(message, tag = "6")]
1618 CommandArgumentError(super::CommandArgumentError),
1619 #[prost(message, tag = "7")]
1620 TypeArgumentError(super::TypeArgumentError),
1621 #[prost(message, tag = "8")]
1622 PackageUpgradeError(super::PackageUpgradeError),
1623 #[prost(message, tag = "9")]
1624 IndexError(super::IndexError),
1625 #[prost(string, tag = "10")]
1626 ObjectId(::prost::alloc::string::String),
1627 #[prost(message, tag = "11")]
1628 CoinDenyListError(super::CoinDenyListError),
1629 #[prost(message, tag = "12")]
1631 CongestedObjects(super::CongestedObjects),
1632 }
1633}
1634#[non_exhaustive]
1635#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1636pub struct MoveAbort {
1637 #[prost(uint64, optional, tag = "1")]
1638 pub abort_code: ::core::option::Option<u64>,
1639 #[prost(message, optional, tag = "2")]
1641 pub location: ::core::option::Option<MoveLocation>,
1642 #[prost(message, optional, tag = "3")]
1644 pub clever_error: ::core::option::Option<CleverError>,
1645}
1646#[non_exhaustive]
1648#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1649pub struct MoveLocation {
1650 #[prost(string, optional, tag = "1")]
1652 pub package: ::core::option::Option<::prost::alloc::string::String>,
1653 #[prost(string, optional, tag = "2")]
1655 pub module: ::core::option::Option<::prost::alloc::string::String>,
1656 #[prost(uint32, optional, tag = "3")]
1658 pub function: ::core::option::Option<u32>,
1659 #[prost(uint32, optional, tag = "4")]
1661 pub instruction: ::core::option::Option<u32>,
1662 #[prost(string, optional, tag = "5")]
1664 pub function_name: ::core::option::Option<::prost::alloc::string::String>,
1665}
1666#[non_exhaustive]
1667#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1668pub struct CleverError {
1669 #[prost(uint64, optional, tag = "1")]
1670 pub error_code: ::core::option::Option<u64>,
1671 #[prost(uint64, optional, tag = "2")]
1672 pub line_number: ::core::option::Option<u64>,
1673 #[prost(string, optional, tag = "3")]
1674 pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
1675 #[prost(string, optional, tag = "4")]
1676 pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
1677 #[prost(oneof = "clever_error::Value", tags = "5, 6")]
1678 pub value: ::core::option::Option<clever_error::Value>,
1679}
1680pub mod clever_error {
1682 #[non_exhaustive]
1683 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1684 pub enum Value {
1685 #[prost(string, tag = "5")]
1686 Rendered(::prost::alloc::string::String),
1687 #[prost(bytes, tag = "6")]
1688 Raw(::prost::bytes::Bytes),
1689 }
1690}
1691#[non_exhaustive]
1693#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1694pub struct SizeError {
1695 #[prost(uint64, optional, tag = "1")]
1697 pub size: ::core::option::Option<u64>,
1698 #[prost(uint64, optional, tag = "2")]
1700 pub max_size: ::core::option::Option<u64>,
1701}
1702#[non_exhaustive]
1703#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1704pub struct IndexError {
1705 #[prost(uint32, optional, tag = "1")]
1707 pub index: ::core::option::Option<u32>,
1708 #[prost(uint32, optional, tag = "2")]
1710 pub subresult: ::core::option::Option<u32>,
1711}
1712#[non_exhaustive]
1713#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1714pub struct CoinDenyListError {
1715 #[prost(string, optional, tag = "1")]
1717 pub address: ::core::option::Option<::prost::alloc::string::String>,
1718 #[prost(string, optional, tag = "2")]
1720 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1721}
1722#[non_exhaustive]
1724#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1725pub struct CongestedObjects {
1726 #[prost(string, repeated, tag = "1")]
1727 pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1728}
1729#[non_exhaustive]
1731#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1732pub struct CommandArgumentError {
1733 #[prost(uint32, optional, tag = "1")]
1735 pub argument: ::core::option::Option<u32>,
1736 #[prost(
1737 enumeration = "command_argument_error::CommandArgumentErrorKind",
1738 optional,
1739 tag = "2"
1740 )]
1741 pub kind: ::core::option::Option<i32>,
1742 #[prost(message, optional, tag = "3")]
1743 pub index_error: ::core::option::Option<IndexError>,
1744}
1745pub mod command_argument_error {
1747 #[non_exhaustive]
1748 #[derive(
1749 Clone,
1750 Copy,
1751 Debug,
1752 PartialEq,
1753 Eq,
1754 Hash,
1755 PartialOrd,
1756 Ord,
1757 ::prost::Enumeration
1758 )]
1759 #[repr(i32)]
1760 pub enum CommandArgumentErrorKind {
1761 Unknown = 0,
1762 TypeMismatch = 1,
1764 InvalidBcsBytes = 2,
1766 InvalidUsageOfPureArgument = 3,
1768 InvalidArgumentToPrivateEntryFunction = 4,
1771 IndexOutOfBounds = 5,
1775 SecondaryIndexOutOfBounds = 6,
1779 InvalidResultArity = 7,
1783 InvalidGasCoinUsage = 8,
1786 InvalidValueUsage = 9,
1791 InvalidObjectByValue = 10,
1793 InvalidObjectByMutRef = 11,
1795 ConsensusObjectOperationNotAllowed = 12,
1798 InvalidArgumentArity = 13,
1801 InvalidTransferObject = 14,
1803 InvalidMakeMoveVecNonObjectArgument = 15,
1806 ArgumentWithoutValue = 16,
1808 CannotMoveBorrowedValue = 17,
1813 CannotWriteToExtendedReference = 18,
1817 InvalidReferenceArgument = 19,
1821 InvalidTxContext = 20,
1825 }
1826 impl CommandArgumentErrorKind {
1827 pub fn as_str_name(&self) -> &'static str {
1832 match self {
1833 Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1834 Self::TypeMismatch => "TYPE_MISMATCH",
1835 Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1836 Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1837 Self::InvalidArgumentToPrivateEntryFunction => {
1838 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1839 }
1840 Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1841 Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1842 Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1843 Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1844 Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1845 Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1846 Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1847 Self::ConsensusObjectOperationNotAllowed => {
1848 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1849 }
1850 Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1851 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1852 Self::InvalidMakeMoveVecNonObjectArgument => {
1853 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1854 }
1855 Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1856 Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1857 Self::CannotWriteToExtendedReference => {
1858 "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1859 }
1860 Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1861 Self::InvalidTxContext => "INVALID_TX_CONTEXT",
1862 }
1863 }
1864 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1866 match value {
1867 "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1868 "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1869 "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1870 "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1871 Some(Self::InvalidUsageOfPureArgument)
1872 }
1873 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1874 Some(Self::InvalidArgumentToPrivateEntryFunction)
1875 }
1876 "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1877 "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1878 "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1879 "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1880 "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1881 "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1882 "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1883 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1884 Some(Self::ConsensusObjectOperationNotAllowed)
1885 }
1886 "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1887 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1888 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1889 Some(Self::InvalidMakeMoveVecNonObjectArgument)
1890 }
1891 "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1892 "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1893 "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1894 Some(Self::CannotWriteToExtendedReference)
1895 }
1896 "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1897 "INVALID_TX_CONTEXT" => Some(Self::InvalidTxContext),
1898 _ => None,
1899 }
1900 }
1901 }
1902}
1903#[non_exhaustive]
1905#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1906pub struct PackageUpgradeError {
1907 #[prost(
1908 enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1909 optional,
1910 tag = "1"
1911 )]
1912 pub kind: ::core::option::Option<i32>,
1913 #[prost(string, optional, tag = "2")]
1915 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1916 #[prost(string, optional, tag = "3")]
1918 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1919 #[prost(uint32, optional, tag = "4")]
1921 pub policy: ::core::option::Option<u32>,
1922 #[prost(string, optional, tag = "5")]
1924 pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1925}
1926pub mod package_upgrade_error {
1928 #[non_exhaustive]
1929 #[derive(
1930 Clone,
1931 Copy,
1932 Debug,
1933 PartialEq,
1934 Eq,
1935 Hash,
1936 PartialOrd,
1937 Ord,
1938 ::prost::Enumeration
1939 )]
1940 #[repr(i32)]
1941 pub enum PackageUpgradeErrorKind {
1942 Unknown = 0,
1943 UnableToFetchPackage = 1,
1945 NotAPackage = 2,
1947 IncompatibleUpgrade = 3,
1949 DigestDoesNotMatch = 4,
1951 UnknownUpgradePolicy = 5,
1953 PackageIdDoesNotMatch = 6,
1955 }
1956 impl PackageUpgradeErrorKind {
1957 pub fn as_str_name(&self) -> &'static str {
1962 match self {
1963 Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1964 Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1965 Self::NotAPackage => "NOT_A_PACKAGE",
1966 Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1967 Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1968 Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1969 Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1970 }
1971 }
1972 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1974 match value {
1975 "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1976 "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1977 "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1978 "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1979 "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1980 "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1981 "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1982 _ => None,
1983 }
1984 }
1985 }
1986}
1987#[non_exhaustive]
1989#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1990pub struct TypeArgumentError {
1991 #[prost(uint32, optional, tag = "1")]
1993 pub type_argument: ::core::option::Option<u32>,
1994 #[prost(
1995 enumeration = "type_argument_error::TypeArgumentErrorKind",
1996 optional,
1997 tag = "2"
1998 )]
1999 pub kind: ::core::option::Option<i32>,
2000}
2001pub mod type_argument_error {
2003 #[non_exhaustive]
2004 #[derive(
2005 Clone,
2006 Copy,
2007 Debug,
2008 PartialEq,
2009 Eq,
2010 Hash,
2011 PartialOrd,
2012 Ord,
2013 ::prost::Enumeration
2014 )]
2015 #[repr(i32)]
2016 pub enum TypeArgumentErrorKind {
2017 Unknown = 0,
2018 TypeNotFound = 1,
2020 ConstraintNotSatisfied = 2,
2022 }
2023 impl TypeArgumentErrorKind {
2024 pub fn as_str_name(&self) -> &'static str {
2029 match self {
2030 Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
2031 Self::TypeNotFound => "TYPE_NOT_FOUND",
2032 Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
2033 }
2034 }
2035 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2037 match value {
2038 "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
2039 "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
2040 "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
2041 _ => None,
2042 }
2043 }
2044 }
2045}
2046#[derive(Eq, Hash)]
2051#[non_exhaustive]
2052#[derive(Clone, PartialEq, ::prost::Message)]
2053pub struct TransactionFilter {
2054 #[prost(message, repeated, tag = "1")]
2056 pub terms: ::prost::alloc::vec::Vec<TransactionTerm>,
2057}
2058#[derive(Eq, Hash)]
2060#[non_exhaustive]
2061#[derive(Clone, PartialEq, ::prost::Message)]
2062pub struct TransactionTerm {
2063 #[prost(message, repeated, tag = "1")]
2065 pub literals: ::prost::alloc::vec::Vec<TransactionLiteral>,
2066}
2067#[non_exhaustive]
2069#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2070pub struct TransactionLiteral {
2071 #[prost(bool, tag = "1")]
2074 pub negated: bool,
2075 #[prost(oneof = "transaction_literal::Predicate", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
2077 pub predicate: ::core::option::Option<transaction_literal::Predicate>,
2078}
2079pub mod transaction_literal {
2081 #[non_exhaustive]
2083 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2084 pub enum Predicate {
2085 #[prost(message, tag = "2")]
2087 Sender(super::SenderFilter),
2088 #[prost(message, tag = "3")]
2093 AffectedAddress(super::AffectedAddressFilter),
2094 #[prost(message, tag = "4")]
2097 AffectedObject(super::AffectedObjectFilter),
2098 #[prost(message, tag = "5")]
2100 MoveCall(super::MoveCallFilter),
2101 #[prost(message, tag = "6")]
2104 EmitModule(super::EmitModuleFilter),
2105 #[prost(message, tag = "7")]
2108 EventType(super::EventTypeFilter),
2109 #[prost(message, tag = "8")]
2112 EventStreamHead(super::EventStreamHeadFilter),
2113 #[prost(message, tag = "9")]
2116 PackageWrite(super::PackageWriteFilter),
2117 }
2118}
2119#[non_exhaustive]
2125#[derive(Clone, PartialEq, ::prost::Message)]
2126pub struct EventFilter {
2127 #[prost(message, repeated, tag = "1")]
2129 pub terms: ::prost::alloc::vec::Vec<EventTerm>,
2130}
2131#[non_exhaustive]
2133#[derive(Clone, PartialEq, ::prost::Message)]
2134pub struct EventTerm {
2135 #[prost(message, repeated, tag = "1")]
2137 pub literals: ::prost::alloc::vec::Vec<EventLiteral>,
2138}
2139#[non_exhaustive]
2141#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2142pub struct EventLiteral {
2143 #[prost(bool, tag = "1")]
2145 pub negated: bool,
2146 #[prost(oneof = "event_literal::Predicate", tags = "2, 3, 4, 5")]
2148 pub predicate: ::core::option::Option<event_literal::Predicate>,
2149}
2150pub mod event_literal {
2152 #[non_exhaustive]
2154 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2155 pub enum Predicate {
2156 #[prost(message, tag = "2")]
2158 Sender(super::SenderFilter),
2159 #[prost(message, tag = "3")]
2161 EmitModule(super::EmitModuleFilter),
2162 #[prost(message, tag = "4")]
2164 EventType(super::EventTypeFilter),
2165 #[prost(message, tag = "5")]
2167 EventStreamHead(super::EventStreamHeadFilter),
2168 }
2169}
2170#[non_exhaustive]
2172#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2173pub struct SenderFilter {
2174 #[prost(string, optional, tag = "1")]
2176 pub address: ::core::option::Option<::prost::alloc::string::String>,
2177}
2178#[non_exhaustive]
2183#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2184pub struct AffectedAddressFilter {
2185 #[prost(string, optional, tag = "1")]
2187 pub address: ::core::option::Option<::prost::alloc::string::String>,
2188}
2189#[non_exhaustive]
2191#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2192pub struct AffectedObjectFilter {
2193 #[prost(string, optional, tag = "1")]
2195 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2196}
2197#[non_exhaustive]
2204#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2205pub struct MoveCallFilter {
2206 #[prost(string, optional, tag = "1")]
2208 pub function: ::core::option::Option<::prost::alloc::string::String>,
2209}
2210#[non_exhaustive]
2217#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2218pub struct EmitModuleFilter {
2219 #[prost(string, optional, tag = "1")]
2221 pub module: ::core::option::Option<::prost::alloc::string::String>,
2222}
2223#[non_exhaustive]
2231#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2232pub struct EventTypeFilter {
2233 #[prost(string, optional, tag = "1")]
2236 pub event_type: ::core::option::Option<::prost::alloc::string::String>,
2237}
2238#[non_exhaustive]
2240#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2241pub struct EventStreamHeadFilter {
2242 #[prost(string, optional, tag = "1")]
2244 pub stream_id: ::core::option::Option<::prost::alloc::string::String>,
2245}
2246#[non_exhaustive]
2248#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2249pub struct PackageWriteFilter {}
2250#[non_exhaustive]
2252#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2253pub struct GasCostSummary {
2254 #[prost(uint64, optional, tag = "1")]
2256 pub computation_cost: ::core::option::Option<u64>,
2257 #[prost(uint64, optional, tag = "2")]
2259 pub storage_cost: ::core::option::Option<u64>,
2260 #[prost(uint64, optional, tag = "3")]
2263 pub storage_rebate: ::core::option::Option<u64>,
2264 #[prost(uint64, optional, tag = "4")]
2266 pub non_refundable_storage_fee: ::core::option::Option<u64>,
2267}
2268#[non_exhaustive]
2270#[derive(Clone, PartialEq, ::prost::Message)]
2271pub struct Input {
2272 #[prost(enumeration = "input::InputKind", optional, tag = "1")]
2273 pub kind: ::core::option::Option<i32>,
2274 #[prost(bytes = "bytes", optional, tag = "2")]
2279 pub pure: ::core::option::Option<::prost::bytes::Bytes>,
2280 #[prost(string, optional, tag = "3")]
2282 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2283 #[prost(uint64, optional, tag = "4")]
2287 pub version: ::core::option::Option<u64>,
2288 #[prost(string, optional, tag = "5")]
2290 pub digest: ::core::option::Option<::prost::alloc::string::String>,
2291 #[prost(bool, optional, tag = "6")]
2294 pub mutable: ::core::option::Option<bool>,
2295 #[prost(enumeration = "input::Mutability", optional, tag = "7")]
2300 pub mutability: ::core::option::Option<i32>,
2301 #[prost(message, optional, tag = "8")]
2303 pub funds_withdrawal: ::core::option::Option<FundsWithdrawal>,
2304 #[prost(message, optional, boxed, tag = "1000")]
2308 pub literal: ::core::option::Option<
2309 ::prost::alloc::boxed::Box<::prost_types::Value>,
2310 >,
2311}
2312pub mod input {
2314 #[non_exhaustive]
2315 #[derive(
2316 Clone,
2317 Copy,
2318 Debug,
2319 PartialEq,
2320 Eq,
2321 Hash,
2322 PartialOrd,
2323 Ord,
2324 ::prost::Enumeration
2325 )]
2326 #[repr(i32)]
2327 pub enum InputKind {
2328 Unknown = 0,
2329 Pure = 1,
2331 ImmutableOrOwned = 2,
2333 Shared = 3,
2335 Receiving = 4,
2337 FundsWithdrawal = 5,
2339 }
2340 impl InputKind {
2341 pub fn as_str_name(&self) -> &'static str {
2346 match self {
2347 Self::Unknown => "INPUT_KIND_UNKNOWN",
2348 Self::Pure => "PURE",
2349 Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
2350 Self::Shared => "SHARED",
2351 Self::Receiving => "RECEIVING",
2352 Self::FundsWithdrawal => "FUNDS_WITHDRAWAL",
2353 }
2354 }
2355 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2357 match value {
2358 "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
2359 "PURE" => Some(Self::Pure),
2360 "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
2361 "SHARED" => Some(Self::Shared),
2362 "RECEIVING" => Some(Self::Receiving),
2363 "FUNDS_WITHDRAWAL" => Some(Self::FundsWithdrawal),
2364 _ => None,
2365 }
2366 }
2367 }
2368 #[non_exhaustive]
2369 #[derive(
2370 Clone,
2371 Copy,
2372 Debug,
2373 PartialEq,
2374 Eq,
2375 Hash,
2376 PartialOrd,
2377 Ord,
2378 ::prost::Enumeration
2379 )]
2380 #[repr(i32)]
2381 pub enum Mutability {
2382 Unknown = 0,
2383 Immutable = 1,
2384 Mutable = 2,
2385 NonExclusiveWrite = 3,
2389 }
2390 impl Mutability {
2391 pub fn as_str_name(&self) -> &'static str {
2396 match self {
2397 Self::Unknown => "MUTABILITY_UNKNOWN",
2398 Self::Immutable => "IMMUTABLE",
2399 Self::Mutable => "MUTABLE",
2400 Self::NonExclusiveWrite => "NON_EXCLUSIVE_WRITE",
2401 }
2402 }
2403 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2405 match value {
2406 "MUTABILITY_UNKNOWN" => Some(Self::Unknown),
2407 "IMMUTABLE" => Some(Self::Immutable),
2408 "MUTABLE" => Some(Self::Mutable),
2409 "NON_EXCLUSIVE_WRITE" => Some(Self::NonExclusiveWrite),
2410 _ => None,
2411 }
2412 }
2413 }
2414}
2415#[non_exhaustive]
2416#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2417pub struct FundsWithdrawal {
2418 #[prost(uint64, optional, tag = "1")]
2419 pub amount: ::core::option::Option<u64>,
2420 #[prost(string, optional, tag = "2")]
2421 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
2422 #[prost(enumeration = "funds_withdrawal::Source", optional, tag = "3")]
2423 pub source: ::core::option::Option<i32>,
2424 #[prost(string, optional, tag = "4")]
2426 pub funder: ::core::option::Option<::prost::alloc::string::String>,
2427 #[prost(string, optional, tag = "5")]
2430 pub allowance: ::core::option::Option<::prost::alloc::string::String>,
2431 #[prost(string, optional, tag = "6")]
2434 pub seized_from: ::core::option::Option<::prost::alloc::string::String>,
2435 #[prost(string, optional, tag = "7")]
2438 pub seize_auth: ::core::option::Option<::prost::alloc::string::String>,
2439}
2440pub mod funds_withdrawal {
2442 #[non_exhaustive]
2443 #[derive(
2444 Clone,
2445 Copy,
2446 Debug,
2447 PartialEq,
2448 Eq,
2449 Hash,
2450 PartialOrd,
2451 Ord,
2452 ::prost::Enumeration
2453 )]
2454 #[repr(i32)]
2455 pub enum Source {
2456 Unknown = 0,
2457 Sender = 1,
2458 Sponsor = 2,
2459 SenderAllowance = 3,
2462 FrozenAddress = 4,
2465 }
2466 impl Source {
2467 pub fn as_str_name(&self) -> &'static str {
2472 match self {
2473 Self::Unknown => "SOURCE_UNKNOWN",
2474 Self::Sender => "SENDER",
2475 Self::Sponsor => "SPONSOR",
2476 Self::SenderAllowance => "SENDER_ALLOWANCE",
2477 Self::FrozenAddress => "FROZEN_ADDRESS",
2478 }
2479 }
2480 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2482 match value {
2483 "SOURCE_UNKNOWN" => Some(Self::Unknown),
2484 "SENDER" => Some(Self::Sender),
2485 "SPONSOR" => Some(Self::Sponsor),
2486 "SENDER_ALLOWANCE" => Some(Self::SenderAllowance),
2487 "FROZEN_ADDRESS" => Some(Self::FrozenAddress),
2488 _ => None,
2489 }
2490 }
2491 }
2492}
2493#[non_exhaustive]
2495#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2496pub struct JwkId {
2497 #[prost(string, optional, tag = "1")]
2499 pub iss: ::core::option::Option<::prost::alloc::string::String>,
2500 #[prost(string, optional, tag = "2")]
2502 pub kid: ::core::option::Option<::prost::alloc::string::String>,
2503}
2504#[non_exhaustive]
2510#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2511pub struct Jwk {
2512 #[prost(string, optional, tag = "1")]
2514 pub kty: ::core::option::Option<::prost::alloc::string::String>,
2515 #[prost(string, optional, tag = "2")]
2517 pub e: ::core::option::Option<::prost::alloc::string::String>,
2518 #[prost(string, optional, tag = "3")]
2520 pub n: ::core::option::Option<::prost::alloc::string::String>,
2521 #[prost(string, optional, tag = "4")]
2523 pub alg: ::core::option::Option<::prost::alloc::string::String>,
2524}
2525#[non_exhaustive]
2526#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2527pub struct GetServiceInfoRequest {}
2528#[non_exhaustive]
2529#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2530pub struct GetServiceInfoResponse {
2531 #[prost(string, optional, tag = "1")]
2536 pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
2537 #[prost(string, optional, tag = "2")]
2541 pub chain: ::core::option::Option<::prost::alloc::string::String>,
2542 #[prost(uint64, optional, tag = "3")]
2544 pub epoch: ::core::option::Option<u64>,
2545 #[prost(uint64, optional, tag = "4")]
2547 pub checkpoint_height: ::core::option::Option<u64>,
2548 #[prost(message, optional, tag = "5")]
2550 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
2551 #[prost(uint64, optional, tag = "6")]
2553 pub lowest_available_checkpoint: ::core::option::Option<u64>,
2554 #[prost(uint64, optional, tag = "7")]
2556 pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
2557 #[prost(string, optional, tag = "8")]
2559 pub server: ::core::option::Option<::prost::alloc::string::String>,
2560}
2561#[non_exhaustive]
2565#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2566pub struct GetObjectRequest {
2567 #[prost(string, optional, tag = "1")]
2569 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2570 #[prost(uint64, optional, tag = "2")]
2587 pub version: ::core::option::Option<u64>,
2588 #[prost(message, optional, tag = "3")]
2591 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2592 #[prost(uint64, optional, tag = "4")]
2617 pub at_checkpoint: ::core::option::Option<u64>,
2618 #[prost(uint64, optional, tag = "5")]
2635 pub max_version: ::core::option::Option<u64>,
2636}
2637#[non_exhaustive]
2638#[derive(Clone, PartialEq, ::prost::Message)]
2639pub struct GetObjectResponse {
2640 #[prost(message, optional, tag = "1")]
2641 pub object: ::core::option::Option<Object>,
2642}
2643#[non_exhaustive]
2644#[derive(Clone, PartialEq, ::prost::Message)]
2645pub struct BatchGetObjectsRequest {
2646 #[prost(message, repeated, tag = "1")]
2656 pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
2657 #[prost(message, optional, tag = "2")]
2660 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2661}
2662#[non_exhaustive]
2663#[derive(Clone, PartialEq, ::prost::Message)]
2664pub struct BatchGetObjectsResponse {
2665 #[prost(message, repeated, tag = "1")]
2666 pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
2667}
2668#[non_exhaustive]
2669#[derive(Clone, PartialEq, ::prost::Message)]
2670pub struct GetObjectResult {
2671 #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
2672 pub result: ::core::option::Option<get_object_result::Result>,
2673}
2674pub mod get_object_result {
2676 #[non_exhaustive]
2677 #[derive(Clone, PartialEq, ::prost::Oneof)]
2678 pub enum Result {
2679 #[prost(message, tag = "1")]
2680 Object(super::Object),
2681 #[prost(message, tag = "2")]
2682 Error(super::super::super::super::google::rpc::Status),
2683 }
2684}
2685#[non_exhaustive]
2772#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2773pub struct ListObjectVersionsRequest {
2774 #[prost(string, optional, tag = "1")]
2776 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2777 #[prost(message, optional, tag = "2")]
2780 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2781 #[prost(message, optional, tag = "3")]
2791 pub options: ::core::option::Option<QueryOptions>,
2792 #[prost(uint64, optional, tag = "4")]
2794 pub start_version: ::core::option::Option<u64>,
2795 #[prost(uint64, optional, tag = "5")]
2799 pub end_version: ::core::option::Option<u64>,
2800 #[prost(message, optional, tag = "7")]
2803 pub removal_read_mask: ::core::option::Option<::prost_types::FieldMask>,
2804 #[prost(uint64, optional, tag = "8")]
2810 pub start_checkpoint: ::core::option::Option<u64>,
2811 #[prost(uint64, optional, tag = "9")]
2820 pub end_checkpoint: ::core::option::Option<u64>,
2821}
2822#[non_exhaustive]
2839#[derive(Clone, PartialEq, ::prost::Message)]
2840pub struct ListObjectVersionsResponse {
2841 #[prost(bytes = "bytes", optional, tag = "2")]
2850 pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
2851 #[prost(message, optional, tag = "3")]
2853 pub end: ::core::option::Option<QueryEnd>,
2854 #[prost(oneof = "list_object_versions_response::Item", tags = "1, 4")]
2856 pub item: ::core::option::Option<list_object_versions_response::Item>,
2857}
2858pub mod list_object_versions_response {
2860 #[non_exhaustive]
2862 #[derive(Clone, PartialEq, ::prost::Oneof)]
2863 pub enum Item {
2864 #[prost(message, tag = "1")]
2866 Object(super::Object),
2867 #[prost(message, tag = "4")]
2870 Removal(super::ObjectRemoval),
2871 }
2872}
2873#[non_exhaustive]
2876#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2877pub struct ObjectRemoval {
2878 #[prost(uint64, optional, tag = "1")]
2880 pub version: ::core::option::Option<u64>,
2881 #[prost(enumeration = "object_removal::Kind", optional, tag = "2")]
2883 pub kind: ::core::option::Option<i32>,
2884 #[prost(string, optional, tag = "3")]
2888 pub transaction: ::core::option::Option<::prost::alloc::string::String>,
2889}
2890pub mod object_removal {
2892 #[non_exhaustive]
2894 #[derive(
2895 Clone,
2896 Copy,
2897 Debug,
2898 PartialEq,
2899 Eq,
2900 Hash,
2901 PartialOrd,
2902 Ord,
2903 ::prost::Enumeration
2904 )]
2905 #[repr(i32)]
2906 pub enum Kind {
2907 Unknown = 0,
2908 Deleted = 1,
2913 Wrapped = 2,
2916 }
2917 impl Kind {
2918 pub fn as_str_name(&self) -> &'static str {
2923 match self {
2924 Self::Unknown => "KIND_UNKNOWN",
2925 Self::Deleted => "DELETED",
2926 Self::Wrapped => "WRAPPED",
2927 }
2928 }
2929 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2931 match value {
2932 "KIND_UNKNOWN" => Some(Self::Unknown),
2933 "DELETED" => Some(Self::Deleted),
2934 "WRAPPED" => Some(Self::Wrapped),
2935 _ => None,
2936 }
2937 }
2938 }
2939}
2940#[non_exhaustive]
2945#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2946pub struct GetTransactionRequest {
2947 #[prost(string, optional, tag = "1")]
2949 pub digest: ::core::option::Option<::prost::alloc::string::String>,
2950 #[prost(message, optional, tag = "2")]
2953 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2954}
2955#[non_exhaustive]
2956#[derive(Clone, PartialEq, ::prost::Message)]
2957pub struct GetTransactionResponse {
2958 #[prost(message, optional, tag = "1")]
2959 pub transaction: ::core::option::Option<ExecutedTransaction>,
2960}
2961#[non_exhaustive]
2963#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2964pub struct BatchGetTransactionsRequest {
2965 #[prost(string, repeated, tag = "1")]
2967 pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2968 #[prost(message, optional, tag = "2")]
2971 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2972}
2973#[non_exhaustive]
2974#[derive(Clone, PartialEq, ::prost::Message)]
2975pub struct BatchGetTransactionsResponse {
2976 #[prost(message, repeated, tag = "1")]
2977 pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
2978}
2979#[non_exhaustive]
2980#[derive(Clone, PartialEq, ::prost::Message)]
2981pub struct GetTransactionResult {
2982 #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
2983 pub result: ::core::option::Option<get_transaction_result::Result>,
2984}
2985pub mod get_transaction_result {
2987 #[non_exhaustive]
2988 #[derive(Clone, PartialEq, ::prost::Oneof)]
2989 pub enum Result {
2990 #[prost(message, tag = "1")]
2991 Transaction(super::ExecutedTransaction),
2992 #[prost(message, tag = "2")]
2993 Error(super::super::super::super::google::rpc::Status),
2994 }
2995}
2996#[non_exhaustive]
3002#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3003pub struct GetCheckpointRequest {
3004 #[prost(message, optional, tag = "3")]
3007 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
3008 #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
3010 pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
3011}
3012pub mod get_checkpoint_request {
3014 #[non_exhaustive]
3016 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
3017 pub enum CheckpointId {
3018 #[prost(uint64, tag = "1")]
3020 SequenceNumber(u64),
3021 #[prost(string, tag = "2")]
3023 Digest(::prost::alloc::string::String),
3024 }
3025}
3026#[non_exhaustive]
3027#[derive(Clone, PartialEq, ::prost::Message)]
3028pub struct GetCheckpointResponse {
3029 #[prost(message, optional, tag = "1")]
3030 pub checkpoint: ::core::option::Option<Checkpoint>,
3031}
3032#[non_exhaustive]
3033#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3034pub struct GetEpochRequest {
3035 #[prost(uint64, optional, tag = "1")]
3043 pub epoch: ::core::option::Option<u64>,
3044 #[prost(message, optional, tag = "2")]
3048 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
3049}
3050#[non_exhaustive]
3051#[derive(Clone, PartialEq, ::prost::Message)]
3052pub struct GetEpochResponse {
3053 #[prost(message, optional, tag = "1")]
3054 pub epoch: ::core::option::Option<Epoch>,
3055}
3056#[non_exhaustive]
3057#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3058pub struct GetProtocolConfigRequest {
3059 #[prost(uint64, optional, tag = "1")]
3062 pub version: ::core::option::Option<u64>,
3063 #[prost(message, optional, tag = "2")]
3066 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
3067}
3068#[non_exhaustive]
3069#[derive(Clone, PartialEq, ::prost::Message)]
3070pub struct GetProtocolConfigResponse {
3071 #[prost(message, optional, tag = "1")]
3072 pub protocol_config: ::core::option::Option<ProtocolConfig>,
3073}
3074#[non_exhaustive]
3076#[derive(Clone, PartialEq, ::prost::Message)]
3077pub struct ListCheckpointsRequest {
3078 #[prost(message, optional, tag = "1")]
3081 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
3082 #[prost(uint64, optional, tag = "2")]
3085 pub start_checkpoint: ::core::option::Option<u64>,
3086 #[prost(uint64, optional, tag = "3")]
3089 pub end_checkpoint: ::core::option::Option<u64>,
3090 #[prost(message, optional, tag = "4")]
3094 pub filter: ::core::option::Option<TransactionFilter>,
3095 #[prost(message, optional, tag = "5")]
3101 pub options: ::core::option::Option<QueryOptions>,
3102}
3103#[non_exhaustive]
3114#[derive(Clone, PartialEq, ::prost::Message)]
3115pub struct ListCheckpointsResponse {
3116 #[prost(message, optional, tag = "1")]
3118 pub checkpoint: ::core::option::Option<Checkpoint>,
3119 #[prost(message, optional, tag = "2")]
3123 pub watermark: ::core::option::Option<Watermark>,
3124 #[prost(message, optional, tag = "3")]
3126 pub end: ::core::option::Option<QueryEnd>,
3127}
3128#[non_exhaustive]
3130#[derive(Clone, PartialEq, ::prost::Message)]
3131pub struct ListTransactionsRequest {
3132 #[prost(message, optional, tag = "1")]
3135 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
3136 #[prost(uint64, optional, tag = "2")]
3139 pub start_checkpoint: ::core::option::Option<u64>,
3140 #[prost(uint64, optional, tag = "3")]
3143 pub end_checkpoint: ::core::option::Option<u64>,
3144 #[prost(message, optional, tag = "4")]
3147 pub filter: ::core::option::Option<TransactionFilter>,
3148 #[prost(message, optional, tag = "5")]
3154 pub options: ::core::option::Option<QueryOptions>,
3155 #[prost(uint64, optional, tag = "6")]
3171 pub start_transaction_index: ::core::option::Option<u64>,
3172 #[prost(uint64, optional, tag = "7")]
3189 pub end_transaction_index: ::core::option::Option<u64>,
3190}
3191#[non_exhaustive]
3202#[derive(Clone, PartialEq, ::prost::Message)]
3203pub struct ListTransactionsResponse {
3204 #[prost(message, optional, tag = "1")]
3207 pub transaction: ::core::option::Option<ExecutedTransaction>,
3208 #[prost(message, optional, tag = "2")]
3212 pub watermark: ::core::option::Option<Watermark>,
3213 #[prost(message, optional, tag = "3")]
3215 pub end: ::core::option::Option<QueryEnd>,
3216}
3217#[non_exhaustive]
3219#[derive(Clone, PartialEq, ::prost::Message)]
3220pub struct ListEventsRequest {
3221 #[prost(message, optional, tag = "1")]
3223 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
3224 #[prost(uint64, optional, tag = "2")]
3227 pub start_checkpoint: ::core::option::Option<u64>,
3228 #[prost(uint64, optional, tag = "3")]
3231 pub end_checkpoint: ::core::option::Option<u64>,
3232 #[prost(message, optional, tag = "4")]
3235 pub filter: ::core::option::Option<EventFilter>,
3236 #[prost(message, optional, tag = "5")]
3242 pub options: ::core::option::Option<QueryOptions>,
3243 #[prost(uint64, optional, tag = "6")]
3259 pub start_transaction_index: ::core::option::Option<u64>,
3260 #[prost(uint32, optional, tag = "7")]
3270 pub start_event_index: ::core::option::Option<u32>,
3271 #[prost(uint64, optional, tag = "8")]
3289 pub end_transaction_index: ::core::option::Option<u64>,
3290 #[prost(uint32, optional, tag = "9")]
3300 pub end_event_index: ::core::option::Option<u32>,
3301}
3302#[non_exhaustive]
3313#[derive(Clone, PartialEq, ::prost::Message)]
3314pub struct ListEventsResponse {
3315 #[prost(message, optional, tag = "1")]
3320 pub event: ::core::option::Option<Event>,
3321 #[prost(message, optional, tag = "2")]
3325 pub watermark: ::core::option::Option<Watermark>,
3326 #[prost(message, optional, tag = "3")]
3328 pub end: ::core::option::Option<QueryEnd>,
3329}
3330pub mod ledger_service_client {
3332 #![allow(
3333 unused_variables,
3334 dead_code,
3335 missing_docs,
3336 clippy::wildcard_imports,
3337 clippy::let_unit_value,
3338 )]
3339 use tonic::codegen::*;
3340 use tonic::codegen::http::Uri;
3341 #[derive(Debug, Clone)]
3342 pub struct LedgerServiceClient<T> {
3343 inner: tonic::client::Grpc<T>,
3344 }
3345 impl LedgerServiceClient<tonic::transport::Channel> {
3346 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3348 where
3349 D: TryInto<tonic::transport::Endpoint>,
3350 D::Error: Into<StdError>,
3351 {
3352 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3353 Ok(Self::new(conn))
3354 }
3355 }
3356 impl<T> LedgerServiceClient<T>
3357 where
3358 T: tonic::client::GrpcService<tonic::body::Body>,
3359 T::Error: Into<StdError>,
3360 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3361 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3362 {
3363 pub fn new(inner: T) -> Self {
3364 let inner = tonic::client::Grpc::new(inner);
3365 Self { inner }
3366 }
3367 pub fn with_origin(inner: T, origin: Uri) -> Self {
3368 let inner = tonic::client::Grpc::with_origin(inner, origin);
3369 Self { inner }
3370 }
3371 pub fn with_interceptor<F>(
3372 inner: T,
3373 interceptor: F,
3374 ) -> LedgerServiceClient<InterceptedService<T, F>>
3375 where
3376 F: tonic::service::Interceptor,
3377 T::ResponseBody: Default,
3378 T: tonic::codegen::Service<
3379 http::Request<tonic::body::Body>,
3380 Response = http::Response<
3381 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3382 >,
3383 >,
3384 <T as tonic::codegen::Service<
3385 http::Request<tonic::body::Body>,
3386 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3387 {
3388 LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
3389 }
3390 #[must_use]
3395 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3396 self.inner = self.inner.send_compressed(encoding);
3397 self
3398 }
3399 #[must_use]
3401 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3402 self.inner = self.inner.accept_compressed(encoding);
3403 self
3404 }
3405 #[must_use]
3409 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3410 self.inner = self.inner.max_decoding_message_size(limit);
3411 self
3412 }
3413 #[must_use]
3417 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3418 self.inner = self.inner.max_encoding_message_size(limit);
3419 self
3420 }
3421 pub async fn get_service_info(
3423 &mut self,
3424 request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
3425 ) -> std::result::Result<
3426 tonic::Response<super::GetServiceInfoResponse>,
3427 tonic::Status,
3428 > {
3429 self.inner
3430 .ready()
3431 .await
3432 .map_err(|e| {
3433 tonic::Status::unknown(
3434 format!("Service was not ready: {}", e.into()),
3435 )
3436 })?;
3437 let codec = tonic_prost::ProstCodec::default();
3438 let path = http::uri::PathAndQuery::from_static(
3439 "/sui.rpc.v2.LedgerService/GetServiceInfo",
3440 );
3441 let mut req = request.into_request();
3442 req.extensions_mut()
3443 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
3444 self.inner.unary(req, path, codec).await
3445 }
3446 pub async fn get_object(
3447 &mut self,
3448 request: impl tonic::IntoRequest<super::GetObjectRequest>,
3449 ) -> std::result::Result<
3450 tonic::Response<super::GetObjectResponse>,
3451 tonic::Status,
3452 > {
3453 self.inner
3454 .ready()
3455 .await
3456 .map_err(|e| {
3457 tonic::Status::unknown(
3458 format!("Service was not ready: {}", e.into()),
3459 )
3460 })?;
3461 let codec = tonic_prost::ProstCodec::default();
3462 let path = http::uri::PathAndQuery::from_static(
3463 "/sui.rpc.v2.LedgerService/GetObject",
3464 );
3465 let mut req = request.into_request();
3466 req.extensions_mut()
3467 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
3468 self.inner.unary(req, path, codec).await
3469 }
3470 pub async fn batch_get_objects(
3471 &mut self,
3472 request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
3473 ) -> std::result::Result<
3474 tonic::Response<super::BatchGetObjectsResponse>,
3475 tonic::Status,
3476 > {
3477 self.inner
3478 .ready()
3479 .await
3480 .map_err(|e| {
3481 tonic::Status::unknown(
3482 format!("Service was not ready: {}", e.into()),
3483 )
3484 })?;
3485 let codec = tonic_prost::ProstCodec::default();
3486 let path = http::uri::PathAndQuery::from_static(
3487 "/sui.rpc.v2.LedgerService/BatchGetObjects",
3488 );
3489 let mut req = request.into_request();
3490 req.extensions_mut()
3491 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
3492 self.inner.unary(req, path, codec).await
3493 }
3494 pub async fn list_object_versions(
3501 &mut self,
3502 request: impl tonic::IntoRequest<super::ListObjectVersionsRequest>,
3503 ) -> std::result::Result<
3504 tonic::Response<tonic::codec::Streaming<super::ListObjectVersionsResponse>>,
3505 tonic::Status,
3506 > {
3507 self.inner
3508 .ready()
3509 .await
3510 .map_err(|e| {
3511 tonic::Status::unknown(
3512 format!("Service was not ready: {}", e.into()),
3513 )
3514 })?;
3515 let codec = tonic_prost::ProstCodec::default();
3516 let path = http::uri::PathAndQuery::from_static(
3517 "/sui.rpc.v2.LedgerService/ListObjectVersions",
3518 );
3519 let mut req = request.into_request();
3520 req.extensions_mut()
3521 .insert(
3522 GrpcMethod::new("sui.rpc.v2.LedgerService", "ListObjectVersions"),
3523 );
3524 self.inner.server_streaming(req, path, codec).await
3525 }
3526 pub async fn get_transaction(
3527 &mut self,
3528 request: impl tonic::IntoRequest<super::GetTransactionRequest>,
3529 ) -> std::result::Result<
3530 tonic::Response<super::GetTransactionResponse>,
3531 tonic::Status,
3532 > {
3533 self.inner
3534 .ready()
3535 .await
3536 .map_err(|e| {
3537 tonic::Status::unknown(
3538 format!("Service was not ready: {}", e.into()),
3539 )
3540 })?;
3541 let codec = tonic_prost::ProstCodec::default();
3542 let path = http::uri::PathAndQuery::from_static(
3543 "/sui.rpc.v2.LedgerService/GetTransaction",
3544 );
3545 let mut req = request.into_request();
3546 req.extensions_mut()
3547 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
3548 self.inner.unary(req, path, codec).await
3549 }
3550 pub async fn batch_get_transactions(
3551 &mut self,
3552 request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
3553 ) -> std::result::Result<
3554 tonic::Response<super::BatchGetTransactionsResponse>,
3555 tonic::Status,
3556 > {
3557 self.inner
3558 .ready()
3559 .await
3560 .map_err(|e| {
3561 tonic::Status::unknown(
3562 format!("Service was not ready: {}", e.into()),
3563 )
3564 })?;
3565 let codec = tonic_prost::ProstCodec::default();
3566 let path = http::uri::PathAndQuery::from_static(
3567 "/sui.rpc.v2.LedgerService/BatchGetTransactions",
3568 );
3569 let mut req = request.into_request();
3570 req.extensions_mut()
3571 .insert(
3572 GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
3573 );
3574 self.inner.unary(req, path, codec).await
3575 }
3576 pub async fn get_checkpoint(
3577 &mut self,
3578 request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
3579 ) -> std::result::Result<
3580 tonic::Response<super::GetCheckpointResponse>,
3581 tonic::Status,
3582 > {
3583 self.inner
3584 .ready()
3585 .await
3586 .map_err(|e| {
3587 tonic::Status::unknown(
3588 format!("Service was not ready: {}", e.into()),
3589 )
3590 })?;
3591 let codec = tonic_prost::ProstCodec::default();
3592 let path = http::uri::PathAndQuery::from_static(
3593 "/sui.rpc.v2.LedgerService/GetCheckpoint",
3594 );
3595 let mut req = request.into_request();
3596 req.extensions_mut()
3597 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
3598 self.inner.unary(req, path, codec).await
3599 }
3600 pub async fn get_epoch(
3601 &mut self,
3602 request: impl tonic::IntoRequest<super::GetEpochRequest>,
3603 ) -> std::result::Result<
3604 tonic::Response<super::GetEpochResponse>,
3605 tonic::Status,
3606 > {
3607 self.inner
3608 .ready()
3609 .await
3610 .map_err(|e| {
3611 tonic::Status::unknown(
3612 format!("Service was not ready: {}", e.into()),
3613 )
3614 })?;
3615 let codec = tonic_prost::ProstCodec::default();
3616 let path = http::uri::PathAndQuery::from_static(
3617 "/sui.rpc.v2.LedgerService/GetEpoch",
3618 );
3619 let mut req = request.into_request();
3620 req.extensions_mut()
3621 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
3622 self.inner.unary(req, path, codec).await
3623 }
3624 pub async fn get_protocol_config(
3638 &mut self,
3639 request: impl tonic::IntoRequest<super::GetProtocolConfigRequest>,
3640 ) -> std::result::Result<
3641 tonic::Response<super::GetProtocolConfigResponse>,
3642 tonic::Status,
3643 > {
3644 self.inner
3645 .ready()
3646 .await
3647 .map_err(|e| {
3648 tonic::Status::unknown(
3649 format!("Service was not ready: {}", e.into()),
3650 )
3651 })?;
3652 let codec = tonic_prost::ProstCodec::default();
3653 let path = http::uri::PathAndQuery::from_static(
3654 "/sui.rpc.v2.LedgerService/GetProtocolConfig",
3655 );
3656 let mut req = request.into_request();
3657 req.extensions_mut()
3658 .insert(
3659 GrpcMethod::new("sui.rpc.v2.LedgerService", "GetProtocolConfig"),
3660 );
3661 self.inner.unary(req, path, codec).await
3662 }
3663 pub async fn list_checkpoints(
3669 &mut self,
3670 request: impl tonic::IntoRequest<super::ListCheckpointsRequest>,
3671 ) -> std::result::Result<
3672 tonic::Response<tonic::codec::Streaming<super::ListCheckpointsResponse>>,
3673 tonic::Status,
3674 > {
3675 self.inner
3676 .ready()
3677 .await
3678 .map_err(|e| {
3679 tonic::Status::unknown(
3680 format!("Service was not ready: {}", e.into()),
3681 )
3682 })?;
3683 let codec = tonic_prost::ProstCodec::default();
3684 let path = http::uri::PathAndQuery::from_static(
3685 "/sui.rpc.v2.LedgerService/ListCheckpoints",
3686 );
3687 let mut req = request.into_request();
3688 req.extensions_mut()
3689 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListCheckpoints"));
3690 self.inner.server_streaming(req, path, codec).await
3691 }
3692 pub async fn list_transactions(
3697 &mut self,
3698 request: impl tonic::IntoRequest<super::ListTransactionsRequest>,
3699 ) -> std::result::Result<
3700 tonic::Response<tonic::codec::Streaming<super::ListTransactionsResponse>>,
3701 tonic::Status,
3702 > {
3703 self.inner
3704 .ready()
3705 .await
3706 .map_err(|e| {
3707 tonic::Status::unknown(
3708 format!("Service was not ready: {}", e.into()),
3709 )
3710 })?;
3711 let codec = tonic_prost::ProstCodec::default();
3712 let path = http::uri::PathAndQuery::from_static(
3713 "/sui.rpc.v2.LedgerService/ListTransactions",
3714 );
3715 let mut req = request.into_request();
3716 req.extensions_mut()
3717 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListTransactions"));
3718 self.inner.server_streaming(req, path, codec).await
3719 }
3720 pub async fn list_events(
3725 &mut self,
3726 request: impl tonic::IntoRequest<super::ListEventsRequest>,
3727 ) -> std::result::Result<
3728 tonic::Response<tonic::codec::Streaming<super::ListEventsResponse>>,
3729 tonic::Status,
3730 > {
3731 self.inner
3732 .ready()
3733 .await
3734 .map_err(|e| {
3735 tonic::Status::unknown(
3736 format!("Service was not ready: {}", e.into()),
3737 )
3738 })?;
3739 let codec = tonic_prost::ProstCodec::default();
3740 let path = http::uri::PathAndQuery::from_static(
3741 "/sui.rpc.v2.LedgerService/ListEvents",
3742 );
3743 let mut req = request.into_request();
3744 req.extensions_mut()
3745 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListEvents"));
3746 self.inner.server_streaming(req, path, codec).await
3747 }
3748 }
3749}
3750pub mod ledger_service_server {
3752 #![allow(
3753 unused_variables,
3754 dead_code,
3755 missing_docs,
3756 clippy::wildcard_imports,
3757 clippy::let_unit_value,
3758 )]
3759 use tonic::codegen::*;
3760 #[async_trait]
3762 pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
3763 async fn get_service_info(
3765 &self,
3766 request: tonic::Request<super::GetServiceInfoRequest>,
3767 ) -> std::result::Result<
3768 tonic::Response<super::GetServiceInfoResponse>,
3769 tonic::Status,
3770 > {
3771 Err(tonic::Status::unimplemented("Not yet implemented"))
3772 }
3773 async fn get_object(
3774 &self,
3775 request: tonic::Request<super::GetObjectRequest>,
3776 ) -> std::result::Result<
3777 tonic::Response<super::GetObjectResponse>,
3778 tonic::Status,
3779 > {
3780 Err(tonic::Status::unimplemented("Not yet implemented"))
3781 }
3782 async fn batch_get_objects(
3783 &self,
3784 request: tonic::Request<super::BatchGetObjectsRequest>,
3785 ) -> std::result::Result<
3786 tonic::Response<super::BatchGetObjectsResponse>,
3787 tonic::Status,
3788 > {
3789 Err(tonic::Status::unimplemented("Not yet implemented"))
3790 }
3791 async fn list_object_versions(
3798 &self,
3799 request: tonic::Request<super::ListObjectVersionsRequest>,
3800 ) -> std::result::Result<
3801 tonic::Response<BoxStream<super::ListObjectVersionsResponse>>,
3802 tonic::Status,
3803 > {
3804 Err(tonic::Status::unimplemented("Not yet implemented"))
3805 }
3806 async fn get_transaction(
3807 &self,
3808 request: tonic::Request<super::GetTransactionRequest>,
3809 ) -> std::result::Result<
3810 tonic::Response<super::GetTransactionResponse>,
3811 tonic::Status,
3812 > {
3813 Err(tonic::Status::unimplemented("Not yet implemented"))
3814 }
3815 async fn batch_get_transactions(
3816 &self,
3817 request: tonic::Request<super::BatchGetTransactionsRequest>,
3818 ) -> std::result::Result<
3819 tonic::Response<super::BatchGetTransactionsResponse>,
3820 tonic::Status,
3821 > {
3822 Err(tonic::Status::unimplemented("Not yet implemented"))
3823 }
3824 async fn get_checkpoint(
3825 &self,
3826 request: tonic::Request<super::GetCheckpointRequest>,
3827 ) -> std::result::Result<
3828 tonic::Response<super::GetCheckpointResponse>,
3829 tonic::Status,
3830 > {
3831 Err(tonic::Status::unimplemented("Not yet implemented"))
3832 }
3833 async fn get_epoch(
3834 &self,
3835 request: tonic::Request<super::GetEpochRequest>,
3836 ) -> std::result::Result<
3837 tonic::Response<super::GetEpochResponse>,
3838 tonic::Status,
3839 > {
3840 Err(tonic::Status::unimplemented("Not yet implemented"))
3841 }
3842 async fn get_protocol_config(
3856 &self,
3857 request: tonic::Request<super::GetProtocolConfigRequest>,
3858 ) -> std::result::Result<
3859 tonic::Response<super::GetProtocolConfigResponse>,
3860 tonic::Status,
3861 > {
3862 Err(tonic::Status::unimplemented("Not yet implemented"))
3863 }
3864 async fn list_checkpoints(
3870 &self,
3871 request: tonic::Request<super::ListCheckpointsRequest>,
3872 ) -> std::result::Result<
3873 tonic::Response<BoxStream<super::ListCheckpointsResponse>>,
3874 tonic::Status,
3875 > {
3876 Err(tonic::Status::unimplemented("Not yet implemented"))
3877 }
3878 async fn list_transactions(
3883 &self,
3884 request: tonic::Request<super::ListTransactionsRequest>,
3885 ) -> std::result::Result<
3886 tonic::Response<BoxStream<super::ListTransactionsResponse>>,
3887 tonic::Status,
3888 > {
3889 Err(tonic::Status::unimplemented("Not yet implemented"))
3890 }
3891 async fn list_events(
3896 &self,
3897 request: tonic::Request<super::ListEventsRequest>,
3898 ) -> std::result::Result<
3899 tonic::Response<BoxStream<super::ListEventsResponse>>,
3900 tonic::Status,
3901 > {
3902 Err(tonic::Status::unimplemented("Not yet implemented"))
3903 }
3904 }
3905 #[derive(Debug)]
3906 pub struct LedgerServiceServer<T> {
3907 inner: Arc<T>,
3908 accept_compression_encodings: EnabledCompressionEncodings,
3909 send_compression_encodings: EnabledCompressionEncodings,
3910 max_decoding_message_size: Option<usize>,
3911 max_encoding_message_size: Option<usize>,
3912 }
3913 impl<T> LedgerServiceServer<T> {
3914 pub fn new(inner: T) -> Self {
3915 Self::from_arc(Arc::new(inner))
3916 }
3917 pub fn from_arc(inner: Arc<T>) -> Self {
3918 Self {
3919 inner,
3920 accept_compression_encodings: Default::default(),
3921 send_compression_encodings: Default::default(),
3922 max_decoding_message_size: None,
3923 max_encoding_message_size: None,
3924 }
3925 }
3926 pub fn with_interceptor<F>(
3927 inner: T,
3928 interceptor: F,
3929 ) -> InterceptedService<Self, F>
3930 where
3931 F: tonic::service::Interceptor,
3932 {
3933 InterceptedService::new(Self::new(inner), interceptor)
3934 }
3935 #[must_use]
3937 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3938 self.accept_compression_encodings.enable(encoding);
3939 self
3940 }
3941 #[must_use]
3943 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3944 self.send_compression_encodings.enable(encoding);
3945 self
3946 }
3947 #[must_use]
3951 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3952 self.max_decoding_message_size = Some(limit);
3953 self
3954 }
3955 #[must_use]
3959 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3960 self.max_encoding_message_size = Some(limit);
3961 self
3962 }
3963 }
3964 impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
3965 where
3966 T: LedgerService,
3967 B: Body + std::marker::Send + 'static,
3968 B::Error: Into<StdError> + std::marker::Send + 'static,
3969 {
3970 type Response = http::Response<tonic::body::Body>;
3971 type Error = std::convert::Infallible;
3972 type Future = BoxFuture<Self::Response, Self::Error>;
3973 fn poll_ready(
3974 &mut self,
3975 _cx: &mut Context<'_>,
3976 ) -> Poll<std::result::Result<(), Self::Error>> {
3977 Poll::Ready(Ok(()))
3978 }
3979 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3980 match req.uri().path() {
3981 "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
3982 #[allow(non_camel_case_types)]
3983 struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
3984 impl<
3985 T: LedgerService,
3986 > tonic::server::UnaryService<super::GetServiceInfoRequest>
3987 for GetServiceInfoSvc<T> {
3988 type Response = super::GetServiceInfoResponse;
3989 type Future = BoxFuture<
3990 tonic::Response<Self::Response>,
3991 tonic::Status,
3992 >;
3993 fn call(
3994 &mut self,
3995 request: tonic::Request<super::GetServiceInfoRequest>,
3996 ) -> Self::Future {
3997 let inner = Arc::clone(&self.0);
3998 let fut = async move {
3999 <T as LedgerService>::get_service_info(&inner, request)
4000 .await
4001 };
4002 Box::pin(fut)
4003 }
4004 }
4005 let accept_compression_encodings = self.accept_compression_encodings;
4006 let send_compression_encodings = self.send_compression_encodings;
4007 let max_decoding_message_size = self.max_decoding_message_size;
4008 let max_encoding_message_size = self.max_encoding_message_size;
4009 let inner = self.inner.clone();
4010 let fut = async move {
4011 let method = GetServiceInfoSvc(inner);
4012 let codec = tonic_prost::ProstCodec::default();
4013 let mut grpc = tonic::server::Grpc::new(codec)
4014 .apply_compression_config(
4015 accept_compression_encodings,
4016 send_compression_encodings,
4017 )
4018 .apply_max_message_size_config(
4019 max_decoding_message_size,
4020 max_encoding_message_size,
4021 );
4022 let res = grpc.unary(method, req).await;
4023 Ok(res)
4024 };
4025 Box::pin(fut)
4026 }
4027 "/sui.rpc.v2.LedgerService/GetObject" => {
4028 #[allow(non_camel_case_types)]
4029 struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
4030 impl<
4031 T: LedgerService,
4032 > tonic::server::UnaryService<super::GetObjectRequest>
4033 for GetObjectSvc<T> {
4034 type Response = super::GetObjectResponse;
4035 type Future = BoxFuture<
4036 tonic::Response<Self::Response>,
4037 tonic::Status,
4038 >;
4039 fn call(
4040 &mut self,
4041 request: tonic::Request<super::GetObjectRequest>,
4042 ) -> Self::Future {
4043 let inner = Arc::clone(&self.0);
4044 let fut = async move {
4045 <T as LedgerService>::get_object(&inner, request).await
4046 };
4047 Box::pin(fut)
4048 }
4049 }
4050 let accept_compression_encodings = self.accept_compression_encodings;
4051 let send_compression_encodings = self.send_compression_encodings;
4052 let max_decoding_message_size = self.max_decoding_message_size;
4053 let max_encoding_message_size = self.max_encoding_message_size;
4054 let inner = self.inner.clone();
4055 let fut = async move {
4056 let method = GetObjectSvc(inner);
4057 let codec = tonic_prost::ProstCodec::default();
4058 let mut grpc = tonic::server::Grpc::new(codec)
4059 .apply_compression_config(
4060 accept_compression_encodings,
4061 send_compression_encodings,
4062 )
4063 .apply_max_message_size_config(
4064 max_decoding_message_size,
4065 max_encoding_message_size,
4066 );
4067 let res = grpc.unary(method, req).await;
4068 Ok(res)
4069 };
4070 Box::pin(fut)
4071 }
4072 "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
4073 #[allow(non_camel_case_types)]
4074 struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
4075 impl<
4076 T: LedgerService,
4077 > tonic::server::UnaryService<super::BatchGetObjectsRequest>
4078 for BatchGetObjectsSvc<T> {
4079 type Response = super::BatchGetObjectsResponse;
4080 type Future = BoxFuture<
4081 tonic::Response<Self::Response>,
4082 tonic::Status,
4083 >;
4084 fn call(
4085 &mut self,
4086 request: tonic::Request<super::BatchGetObjectsRequest>,
4087 ) -> Self::Future {
4088 let inner = Arc::clone(&self.0);
4089 let fut = async move {
4090 <T as LedgerService>::batch_get_objects(&inner, request)
4091 .await
4092 };
4093 Box::pin(fut)
4094 }
4095 }
4096 let accept_compression_encodings = self.accept_compression_encodings;
4097 let send_compression_encodings = self.send_compression_encodings;
4098 let max_decoding_message_size = self.max_decoding_message_size;
4099 let max_encoding_message_size = self.max_encoding_message_size;
4100 let inner = self.inner.clone();
4101 let fut = async move {
4102 let method = BatchGetObjectsSvc(inner);
4103 let codec = tonic_prost::ProstCodec::default();
4104 let mut grpc = tonic::server::Grpc::new(codec)
4105 .apply_compression_config(
4106 accept_compression_encodings,
4107 send_compression_encodings,
4108 )
4109 .apply_max_message_size_config(
4110 max_decoding_message_size,
4111 max_encoding_message_size,
4112 );
4113 let res = grpc.unary(method, req).await;
4114 Ok(res)
4115 };
4116 Box::pin(fut)
4117 }
4118 "/sui.rpc.v2.LedgerService/ListObjectVersions" => {
4119 #[allow(non_camel_case_types)]
4120 struct ListObjectVersionsSvc<T: LedgerService>(pub Arc<T>);
4121 impl<
4122 T: LedgerService,
4123 > tonic::server::ServerStreamingService<
4124 super::ListObjectVersionsRequest,
4125 > for ListObjectVersionsSvc<T> {
4126 type Response = super::ListObjectVersionsResponse;
4127 type ResponseStream = BoxStream<
4128 super::ListObjectVersionsResponse,
4129 >;
4130 type Future = BoxFuture<
4131 tonic::Response<Self::ResponseStream>,
4132 tonic::Status,
4133 >;
4134 fn call(
4135 &mut self,
4136 request: tonic::Request<super::ListObjectVersionsRequest>,
4137 ) -> Self::Future {
4138 let inner = Arc::clone(&self.0);
4139 let fut = async move {
4140 <T as LedgerService>::list_object_versions(&inner, request)
4141 .await
4142 };
4143 Box::pin(fut)
4144 }
4145 }
4146 let accept_compression_encodings = self.accept_compression_encodings;
4147 let send_compression_encodings = self.send_compression_encodings;
4148 let max_decoding_message_size = self.max_decoding_message_size;
4149 let max_encoding_message_size = self.max_encoding_message_size;
4150 let inner = self.inner.clone();
4151 let fut = async move {
4152 let method = ListObjectVersionsSvc(inner);
4153 let codec = tonic_prost::ProstCodec::default();
4154 let mut grpc = tonic::server::Grpc::new(codec)
4155 .apply_compression_config(
4156 accept_compression_encodings,
4157 send_compression_encodings,
4158 )
4159 .apply_max_message_size_config(
4160 max_decoding_message_size,
4161 max_encoding_message_size,
4162 );
4163 let res = grpc.server_streaming(method, req).await;
4164 Ok(res)
4165 };
4166 Box::pin(fut)
4167 }
4168 "/sui.rpc.v2.LedgerService/GetTransaction" => {
4169 #[allow(non_camel_case_types)]
4170 struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
4171 impl<
4172 T: LedgerService,
4173 > tonic::server::UnaryService<super::GetTransactionRequest>
4174 for GetTransactionSvc<T> {
4175 type Response = super::GetTransactionResponse;
4176 type Future = BoxFuture<
4177 tonic::Response<Self::Response>,
4178 tonic::Status,
4179 >;
4180 fn call(
4181 &mut self,
4182 request: tonic::Request<super::GetTransactionRequest>,
4183 ) -> Self::Future {
4184 let inner = Arc::clone(&self.0);
4185 let fut = async move {
4186 <T as LedgerService>::get_transaction(&inner, request).await
4187 };
4188 Box::pin(fut)
4189 }
4190 }
4191 let accept_compression_encodings = self.accept_compression_encodings;
4192 let send_compression_encodings = self.send_compression_encodings;
4193 let max_decoding_message_size = self.max_decoding_message_size;
4194 let max_encoding_message_size = self.max_encoding_message_size;
4195 let inner = self.inner.clone();
4196 let fut = async move {
4197 let method = GetTransactionSvc(inner);
4198 let codec = tonic_prost::ProstCodec::default();
4199 let mut grpc = tonic::server::Grpc::new(codec)
4200 .apply_compression_config(
4201 accept_compression_encodings,
4202 send_compression_encodings,
4203 )
4204 .apply_max_message_size_config(
4205 max_decoding_message_size,
4206 max_encoding_message_size,
4207 );
4208 let res = grpc.unary(method, req).await;
4209 Ok(res)
4210 };
4211 Box::pin(fut)
4212 }
4213 "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
4214 #[allow(non_camel_case_types)]
4215 struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
4216 impl<
4217 T: LedgerService,
4218 > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
4219 for BatchGetTransactionsSvc<T> {
4220 type Response = super::BatchGetTransactionsResponse;
4221 type Future = BoxFuture<
4222 tonic::Response<Self::Response>,
4223 tonic::Status,
4224 >;
4225 fn call(
4226 &mut self,
4227 request: tonic::Request<super::BatchGetTransactionsRequest>,
4228 ) -> Self::Future {
4229 let inner = Arc::clone(&self.0);
4230 let fut = async move {
4231 <T as LedgerService>::batch_get_transactions(
4232 &inner,
4233 request,
4234 )
4235 .await
4236 };
4237 Box::pin(fut)
4238 }
4239 }
4240 let accept_compression_encodings = self.accept_compression_encodings;
4241 let send_compression_encodings = self.send_compression_encodings;
4242 let max_decoding_message_size = self.max_decoding_message_size;
4243 let max_encoding_message_size = self.max_encoding_message_size;
4244 let inner = self.inner.clone();
4245 let fut = async move {
4246 let method = BatchGetTransactionsSvc(inner);
4247 let codec = tonic_prost::ProstCodec::default();
4248 let mut grpc = tonic::server::Grpc::new(codec)
4249 .apply_compression_config(
4250 accept_compression_encodings,
4251 send_compression_encodings,
4252 )
4253 .apply_max_message_size_config(
4254 max_decoding_message_size,
4255 max_encoding_message_size,
4256 );
4257 let res = grpc.unary(method, req).await;
4258 Ok(res)
4259 };
4260 Box::pin(fut)
4261 }
4262 "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
4263 #[allow(non_camel_case_types)]
4264 struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
4265 impl<
4266 T: LedgerService,
4267 > tonic::server::UnaryService<super::GetCheckpointRequest>
4268 for GetCheckpointSvc<T> {
4269 type Response = super::GetCheckpointResponse;
4270 type Future = BoxFuture<
4271 tonic::Response<Self::Response>,
4272 tonic::Status,
4273 >;
4274 fn call(
4275 &mut self,
4276 request: tonic::Request<super::GetCheckpointRequest>,
4277 ) -> Self::Future {
4278 let inner = Arc::clone(&self.0);
4279 let fut = async move {
4280 <T as LedgerService>::get_checkpoint(&inner, request).await
4281 };
4282 Box::pin(fut)
4283 }
4284 }
4285 let accept_compression_encodings = self.accept_compression_encodings;
4286 let send_compression_encodings = self.send_compression_encodings;
4287 let max_decoding_message_size = self.max_decoding_message_size;
4288 let max_encoding_message_size = self.max_encoding_message_size;
4289 let inner = self.inner.clone();
4290 let fut = async move {
4291 let method = GetCheckpointSvc(inner);
4292 let codec = tonic_prost::ProstCodec::default();
4293 let mut grpc = tonic::server::Grpc::new(codec)
4294 .apply_compression_config(
4295 accept_compression_encodings,
4296 send_compression_encodings,
4297 )
4298 .apply_max_message_size_config(
4299 max_decoding_message_size,
4300 max_encoding_message_size,
4301 );
4302 let res = grpc.unary(method, req).await;
4303 Ok(res)
4304 };
4305 Box::pin(fut)
4306 }
4307 "/sui.rpc.v2.LedgerService/GetEpoch" => {
4308 #[allow(non_camel_case_types)]
4309 struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
4310 impl<
4311 T: LedgerService,
4312 > tonic::server::UnaryService<super::GetEpochRequest>
4313 for GetEpochSvc<T> {
4314 type Response = super::GetEpochResponse;
4315 type Future = BoxFuture<
4316 tonic::Response<Self::Response>,
4317 tonic::Status,
4318 >;
4319 fn call(
4320 &mut self,
4321 request: tonic::Request<super::GetEpochRequest>,
4322 ) -> Self::Future {
4323 let inner = Arc::clone(&self.0);
4324 let fut = async move {
4325 <T as LedgerService>::get_epoch(&inner, request).await
4326 };
4327 Box::pin(fut)
4328 }
4329 }
4330 let accept_compression_encodings = self.accept_compression_encodings;
4331 let send_compression_encodings = self.send_compression_encodings;
4332 let max_decoding_message_size = self.max_decoding_message_size;
4333 let max_encoding_message_size = self.max_encoding_message_size;
4334 let inner = self.inner.clone();
4335 let fut = async move {
4336 let method = GetEpochSvc(inner);
4337 let codec = tonic_prost::ProstCodec::default();
4338 let mut grpc = tonic::server::Grpc::new(codec)
4339 .apply_compression_config(
4340 accept_compression_encodings,
4341 send_compression_encodings,
4342 )
4343 .apply_max_message_size_config(
4344 max_decoding_message_size,
4345 max_encoding_message_size,
4346 );
4347 let res = grpc.unary(method, req).await;
4348 Ok(res)
4349 };
4350 Box::pin(fut)
4351 }
4352 "/sui.rpc.v2.LedgerService/GetProtocolConfig" => {
4353 #[allow(non_camel_case_types)]
4354 struct GetProtocolConfigSvc<T: LedgerService>(pub Arc<T>);
4355 impl<
4356 T: LedgerService,
4357 > tonic::server::UnaryService<super::GetProtocolConfigRequest>
4358 for GetProtocolConfigSvc<T> {
4359 type Response = super::GetProtocolConfigResponse;
4360 type Future = BoxFuture<
4361 tonic::Response<Self::Response>,
4362 tonic::Status,
4363 >;
4364 fn call(
4365 &mut self,
4366 request: tonic::Request<super::GetProtocolConfigRequest>,
4367 ) -> Self::Future {
4368 let inner = Arc::clone(&self.0);
4369 let fut = async move {
4370 <T as LedgerService>::get_protocol_config(&inner, request)
4371 .await
4372 };
4373 Box::pin(fut)
4374 }
4375 }
4376 let accept_compression_encodings = self.accept_compression_encodings;
4377 let send_compression_encodings = self.send_compression_encodings;
4378 let max_decoding_message_size = self.max_decoding_message_size;
4379 let max_encoding_message_size = self.max_encoding_message_size;
4380 let inner = self.inner.clone();
4381 let fut = async move {
4382 let method = GetProtocolConfigSvc(inner);
4383 let codec = tonic_prost::ProstCodec::default();
4384 let mut grpc = tonic::server::Grpc::new(codec)
4385 .apply_compression_config(
4386 accept_compression_encodings,
4387 send_compression_encodings,
4388 )
4389 .apply_max_message_size_config(
4390 max_decoding_message_size,
4391 max_encoding_message_size,
4392 );
4393 let res = grpc.unary(method, req).await;
4394 Ok(res)
4395 };
4396 Box::pin(fut)
4397 }
4398 "/sui.rpc.v2.LedgerService/ListCheckpoints" => {
4399 #[allow(non_camel_case_types)]
4400 struct ListCheckpointsSvc<T: LedgerService>(pub Arc<T>);
4401 impl<
4402 T: LedgerService,
4403 > tonic::server::ServerStreamingService<
4404 super::ListCheckpointsRequest,
4405 > for ListCheckpointsSvc<T> {
4406 type Response = super::ListCheckpointsResponse;
4407 type ResponseStream = BoxStream<super::ListCheckpointsResponse>;
4408 type Future = BoxFuture<
4409 tonic::Response<Self::ResponseStream>,
4410 tonic::Status,
4411 >;
4412 fn call(
4413 &mut self,
4414 request: tonic::Request<super::ListCheckpointsRequest>,
4415 ) -> Self::Future {
4416 let inner = Arc::clone(&self.0);
4417 let fut = async move {
4418 <T as LedgerService>::list_checkpoints(&inner, request)
4419 .await
4420 };
4421 Box::pin(fut)
4422 }
4423 }
4424 let accept_compression_encodings = self.accept_compression_encodings;
4425 let send_compression_encodings = self.send_compression_encodings;
4426 let max_decoding_message_size = self.max_decoding_message_size;
4427 let max_encoding_message_size = self.max_encoding_message_size;
4428 let inner = self.inner.clone();
4429 let fut = async move {
4430 let method = ListCheckpointsSvc(inner);
4431 let codec = tonic_prost::ProstCodec::default();
4432 let mut grpc = tonic::server::Grpc::new(codec)
4433 .apply_compression_config(
4434 accept_compression_encodings,
4435 send_compression_encodings,
4436 )
4437 .apply_max_message_size_config(
4438 max_decoding_message_size,
4439 max_encoding_message_size,
4440 );
4441 let res = grpc.server_streaming(method, req).await;
4442 Ok(res)
4443 };
4444 Box::pin(fut)
4445 }
4446 "/sui.rpc.v2.LedgerService/ListTransactions" => {
4447 #[allow(non_camel_case_types)]
4448 struct ListTransactionsSvc<T: LedgerService>(pub Arc<T>);
4449 impl<
4450 T: LedgerService,
4451 > tonic::server::ServerStreamingService<
4452 super::ListTransactionsRequest,
4453 > for ListTransactionsSvc<T> {
4454 type Response = super::ListTransactionsResponse;
4455 type ResponseStream = BoxStream<super::ListTransactionsResponse>;
4456 type Future = BoxFuture<
4457 tonic::Response<Self::ResponseStream>,
4458 tonic::Status,
4459 >;
4460 fn call(
4461 &mut self,
4462 request: tonic::Request<super::ListTransactionsRequest>,
4463 ) -> Self::Future {
4464 let inner = Arc::clone(&self.0);
4465 let fut = async move {
4466 <T as LedgerService>::list_transactions(&inner, request)
4467 .await
4468 };
4469 Box::pin(fut)
4470 }
4471 }
4472 let accept_compression_encodings = self.accept_compression_encodings;
4473 let send_compression_encodings = self.send_compression_encodings;
4474 let max_decoding_message_size = self.max_decoding_message_size;
4475 let max_encoding_message_size = self.max_encoding_message_size;
4476 let inner = self.inner.clone();
4477 let fut = async move {
4478 let method = ListTransactionsSvc(inner);
4479 let codec = tonic_prost::ProstCodec::default();
4480 let mut grpc = tonic::server::Grpc::new(codec)
4481 .apply_compression_config(
4482 accept_compression_encodings,
4483 send_compression_encodings,
4484 )
4485 .apply_max_message_size_config(
4486 max_decoding_message_size,
4487 max_encoding_message_size,
4488 );
4489 let res = grpc.server_streaming(method, req).await;
4490 Ok(res)
4491 };
4492 Box::pin(fut)
4493 }
4494 "/sui.rpc.v2.LedgerService/ListEvents" => {
4495 #[allow(non_camel_case_types)]
4496 struct ListEventsSvc<T: LedgerService>(pub Arc<T>);
4497 impl<
4498 T: LedgerService,
4499 > tonic::server::ServerStreamingService<super::ListEventsRequest>
4500 for ListEventsSvc<T> {
4501 type Response = super::ListEventsResponse;
4502 type ResponseStream = BoxStream<super::ListEventsResponse>;
4503 type Future = BoxFuture<
4504 tonic::Response<Self::ResponseStream>,
4505 tonic::Status,
4506 >;
4507 fn call(
4508 &mut self,
4509 request: tonic::Request<super::ListEventsRequest>,
4510 ) -> Self::Future {
4511 let inner = Arc::clone(&self.0);
4512 let fut = async move {
4513 <T as LedgerService>::list_events(&inner, request).await
4514 };
4515 Box::pin(fut)
4516 }
4517 }
4518 let accept_compression_encodings = self.accept_compression_encodings;
4519 let send_compression_encodings = self.send_compression_encodings;
4520 let max_decoding_message_size = self.max_decoding_message_size;
4521 let max_encoding_message_size = self.max_encoding_message_size;
4522 let inner = self.inner.clone();
4523 let fut = async move {
4524 let method = ListEventsSvc(inner);
4525 let codec = tonic_prost::ProstCodec::default();
4526 let mut grpc = tonic::server::Grpc::new(codec)
4527 .apply_compression_config(
4528 accept_compression_encodings,
4529 send_compression_encodings,
4530 )
4531 .apply_max_message_size_config(
4532 max_decoding_message_size,
4533 max_encoding_message_size,
4534 );
4535 let res = grpc.server_streaming(method, req).await;
4536 Ok(res)
4537 };
4538 Box::pin(fut)
4539 }
4540 _ => {
4541 Box::pin(async move {
4542 let mut response = http::Response::new(
4543 tonic::body::Body::default(),
4544 );
4545 let headers = response.headers_mut();
4546 headers
4547 .insert(
4548 tonic::Status::GRPC_STATUS,
4549 (tonic::Code::Unimplemented as i32).into(),
4550 );
4551 headers
4552 .insert(
4553 http::header::CONTENT_TYPE,
4554 tonic::metadata::GRPC_CONTENT_TYPE,
4555 );
4556 Ok(response)
4557 })
4558 }
4559 }
4560 }
4561 }
4562 impl<T> Clone for LedgerServiceServer<T> {
4563 fn clone(&self) -> Self {
4564 let inner = self.inner.clone();
4565 Self {
4566 inner,
4567 accept_compression_encodings: self.accept_compression_encodings,
4568 send_compression_encodings: self.send_compression_encodings,
4569 max_decoding_message_size: self.max_decoding_message_size,
4570 max_encoding_message_size: self.max_encoding_message_size,
4571 }
4572 }
4573 }
4574 pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
4576 impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
4577 const NAME: &'static str = SERVICE_NAME;
4578 }
4579}
4580#[non_exhaustive]
4582#[derive(Clone, PartialEq, ::prost::Message)]
4583pub struct Package {
4584 #[prost(string, optional, tag = "1")]
4590 pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
4591 #[prost(string, optional, tag = "2")]
4598 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
4599 #[prost(uint64, optional, tag = "3")]
4601 pub version: ::core::option::Option<u64>,
4602 #[prost(message, repeated, tag = "4")]
4604 pub modules: ::prost::alloc::vec::Vec<Module>,
4605 #[prost(message, repeated, tag = "5")]
4608 pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
4609 #[prost(message, repeated, tag = "6")]
4613 pub linkage: ::prost::alloc::vec::Vec<Linkage>,
4614}
4615#[non_exhaustive]
4617#[derive(Clone, PartialEq, ::prost::Message)]
4618pub struct Module {
4619 #[prost(string, optional, tag = "1")]
4621 pub name: ::core::option::Option<::prost::alloc::string::String>,
4622 #[prost(bytes = "bytes", optional, tag = "2")]
4624 pub contents: ::core::option::Option<::prost::bytes::Bytes>,
4625 #[prost(message, repeated, tag = "3")]
4627 pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
4628 #[prost(message, repeated, tag = "4")]
4630 pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
4631}
4632#[non_exhaustive]
4634#[derive(Clone, PartialEq, ::prost::Message)]
4635pub struct DatatypeDescriptor {
4636 #[prost(string, optional, tag = "1")]
4640 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
4641 #[prost(string, optional, tag = "2")]
4645 pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
4646 #[prost(string, optional, tag = "3")]
4648 pub module: ::core::option::Option<::prost::alloc::string::String>,
4649 #[prost(string, optional, tag = "4")]
4651 pub name: ::core::option::Option<::prost::alloc::string::String>,
4652 #[prost(enumeration = "Ability", repeated, tag = "5")]
4654 pub abilities: ::prost::alloc::vec::Vec<i32>,
4655 #[prost(message, repeated, tag = "6")]
4657 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
4658 #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
4660 pub kind: ::core::option::Option<i32>,
4661 #[prost(message, repeated, tag = "8")]
4665 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
4666 #[prost(message, repeated, tag = "9")]
4670 pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
4671}
4672pub mod datatype_descriptor {
4674 #[non_exhaustive]
4675 #[derive(
4676 Clone,
4677 Copy,
4678 Debug,
4679 PartialEq,
4680 Eq,
4681 Hash,
4682 PartialOrd,
4683 Ord,
4684 ::prost::Enumeration
4685 )]
4686 #[repr(i32)]
4687 pub enum DatatypeKind {
4688 Unknown = 0,
4689 Struct = 1,
4690 Enum = 2,
4691 }
4692 impl DatatypeKind {
4693 pub fn as_str_name(&self) -> &'static str {
4698 match self {
4699 Self::Unknown => "DATATYPE_KIND_UNKNOWN",
4700 Self::Struct => "STRUCT",
4701 Self::Enum => "ENUM",
4702 }
4703 }
4704 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4706 match value {
4707 "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
4708 "STRUCT" => Some(Self::Struct),
4709 "ENUM" => Some(Self::Enum),
4710 _ => None,
4711 }
4712 }
4713 }
4714}
4715#[non_exhaustive]
4717#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4718pub struct TypeParameter {
4719 #[prost(enumeration = "Ability", repeated, tag = "1")]
4721 pub constraints: ::prost::alloc::vec::Vec<i32>,
4722 #[prost(bool, optional, tag = "2")]
4724 pub is_phantom: ::core::option::Option<bool>,
4725}
4726#[non_exhaustive]
4728#[derive(Clone, PartialEq, ::prost::Message)]
4729pub struct FieldDescriptor {
4730 #[prost(string, optional, tag = "1")]
4732 pub name: ::core::option::Option<::prost::alloc::string::String>,
4733 #[prost(uint32, optional, tag = "2")]
4735 pub position: ::core::option::Option<u32>,
4736 #[prost(message, optional, tag = "3")]
4738 pub r#type: ::core::option::Option<OpenSignatureBody>,
4739}
4740#[non_exhaustive]
4742#[derive(Clone, PartialEq, ::prost::Message)]
4743pub struct VariantDescriptor {
4744 #[prost(string, optional, tag = "1")]
4746 pub name: ::core::option::Option<::prost::alloc::string::String>,
4747 #[prost(uint32, optional, tag = "2")]
4749 pub position: ::core::option::Option<u32>,
4750 #[prost(message, repeated, tag = "3")]
4752 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
4753}
4754#[non_exhaustive]
4756#[derive(Clone, PartialEq, ::prost::Message)]
4757pub struct OpenSignatureBody {
4758 #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
4760 pub r#type: ::core::option::Option<i32>,
4761 #[prost(string, optional, tag = "2")]
4763 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
4764 #[prost(message, repeated, tag = "3")]
4766 pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
4767 #[prost(uint32, optional, tag = "4")]
4769 pub type_parameter: ::core::option::Option<u32>,
4770}
4771pub mod open_signature_body {
4773 #[non_exhaustive]
4774 #[derive(
4775 Clone,
4776 Copy,
4777 Debug,
4778 PartialEq,
4779 Eq,
4780 Hash,
4781 PartialOrd,
4782 Ord,
4783 ::prost::Enumeration
4784 )]
4785 #[repr(i32)]
4786 pub enum Type {
4787 Unknown = 0,
4788 Address = 1,
4789 Bool = 2,
4790 U8 = 3,
4791 U16 = 4,
4792 U32 = 5,
4793 U64 = 6,
4794 U128 = 7,
4795 U256 = 8,
4796 Vector = 9,
4797 Datatype = 10,
4798 Parameter = 11,
4799 }
4800 impl Type {
4801 pub fn as_str_name(&self) -> &'static str {
4806 match self {
4807 Self::Unknown => "TYPE_UNKNOWN",
4808 Self::Address => "ADDRESS",
4809 Self::Bool => "BOOL",
4810 Self::U8 => "U8",
4811 Self::U16 => "U16",
4812 Self::U32 => "U32",
4813 Self::U64 => "U64",
4814 Self::U128 => "U128",
4815 Self::U256 => "U256",
4816 Self::Vector => "VECTOR",
4817 Self::Datatype => "DATATYPE",
4818 Self::Parameter => "TYPE_PARAMETER",
4819 }
4820 }
4821 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4823 match value {
4824 "TYPE_UNKNOWN" => Some(Self::Unknown),
4825 "ADDRESS" => Some(Self::Address),
4826 "BOOL" => Some(Self::Bool),
4827 "U8" => Some(Self::U8),
4828 "U16" => Some(Self::U16),
4829 "U32" => Some(Self::U32),
4830 "U64" => Some(Self::U64),
4831 "U128" => Some(Self::U128),
4832 "U256" => Some(Self::U256),
4833 "VECTOR" => Some(Self::Vector),
4834 "DATATYPE" => Some(Self::Datatype),
4835 "TYPE_PARAMETER" => Some(Self::Parameter),
4836 _ => None,
4837 }
4838 }
4839 }
4840}
4841#[non_exhaustive]
4843#[derive(Clone, PartialEq, ::prost::Message)]
4844pub struct FunctionDescriptor {
4845 #[prost(string, optional, tag = "1")]
4847 pub name: ::core::option::Option<::prost::alloc::string::String>,
4848 #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
4850 pub visibility: ::core::option::Option<i32>,
4851 #[prost(bool, optional, tag = "6")]
4853 pub is_entry: ::core::option::Option<bool>,
4854 #[prost(message, repeated, tag = "7")]
4856 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
4857 #[prost(message, repeated, tag = "8")]
4859 pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
4860 #[prost(message, repeated, tag = "9")]
4862 pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
4863}
4864pub mod function_descriptor {
4866 #[non_exhaustive]
4867 #[derive(
4868 Clone,
4869 Copy,
4870 Debug,
4871 PartialEq,
4872 Eq,
4873 Hash,
4874 PartialOrd,
4875 Ord,
4876 ::prost::Enumeration
4877 )]
4878 #[repr(i32)]
4879 pub enum Visibility {
4880 Unknown = 0,
4881 Private = 1,
4882 Public = 2,
4883 Friend = 3,
4884 }
4885 impl Visibility {
4886 pub fn as_str_name(&self) -> &'static str {
4891 match self {
4892 Self::Unknown => "VISIBILITY_UNKNOWN",
4893 Self::Private => "PRIVATE",
4894 Self::Public => "PUBLIC",
4895 Self::Friend => "FRIEND",
4896 }
4897 }
4898 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4900 match value {
4901 "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
4902 "PRIVATE" => Some(Self::Private),
4903 "PUBLIC" => Some(Self::Public),
4904 "FRIEND" => Some(Self::Friend),
4905 _ => None,
4906 }
4907 }
4908 }
4909}
4910#[non_exhaustive]
4912#[derive(Clone, PartialEq, ::prost::Message)]
4913pub struct OpenSignature {
4914 #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
4915 pub reference: ::core::option::Option<i32>,
4916 #[prost(message, optional, tag = "2")]
4917 pub body: ::core::option::Option<OpenSignatureBody>,
4918}
4919pub mod open_signature {
4921 #[non_exhaustive]
4922 #[derive(
4923 Clone,
4924 Copy,
4925 Debug,
4926 PartialEq,
4927 Eq,
4928 Hash,
4929 PartialOrd,
4930 Ord,
4931 ::prost::Enumeration
4932 )]
4933 #[repr(i32)]
4934 pub enum Reference {
4935 Unknown = 0,
4936 Immutable = 1,
4937 Mutable = 2,
4938 }
4939 impl Reference {
4940 pub fn as_str_name(&self) -> &'static str {
4945 match self {
4946 Self::Unknown => "REFERENCE_UNKNOWN",
4947 Self::Immutable => "IMMUTABLE",
4948 Self::Mutable => "MUTABLE",
4949 }
4950 }
4951 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4953 match value {
4954 "REFERENCE_UNKNOWN" => Some(Self::Unknown),
4955 "IMMUTABLE" => Some(Self::Immutable),
4956 "MUTABLE" => Some(Self::Mutable),
4957 _ => None,
4958 }
4959 }
4960 }
4961}
4962#[non_exhaustive]
4964#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4965pub struct TypeOrigin {
4966 #[prost(string, optional, tag = "1")]
4967 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4968 #[prost(string, optional, tag = "2")]
4969 pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
4970 #[prost(string, optional, tag = "3")]
4971 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4972}
4973#[non_exhaustive]
4975#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4976pub struct Linkage {
4977 #[prost(string, optional, tag = "1")]
4979 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
4980 #[prost(string, optional, tag = "2")]
4982 pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
4983 #[prost(uint64, optional, tag = "3")]
4985 pub upgraded_version: ::core::option::Option<u64>,
4986}
4987#[non_exhaustive]
4989#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4990#[repr(i32)]
4991pub enum Ability {
4992 Unknown = 0,
4993 Copy = 1,
4995 Drop = 2,
4997 Store = 3,
4999 Key = 4,
5001}
5002impl Ability {
5003 pub fn as_str_name(&self) -> &'static str {
5008 match self {
5009 Self::Unknown => "ABILITY_UNKNOWN",
5010 Self::Copy => "COPY",
5011 Self::Drop => "DROP",
5012 Self::Store => "STORE",
5013 Self::Key => "KEY",
5014 }
5015 }
5016 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5018 match value {
5019 "ABILITY_UNKNOWN" => Some(Self::Unknown),
5020 "COPY" => Some(Self::Copy),
5021 "DROP" => Some(Self::Drop),
5022 "STORE" => Some(Self::Store),
5023 "KEY" => Some(Self::Key),
5024 _ => None,
5025 }
5026 }
5027}
5028#[non_exhaustive]
5029#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5030pub struct GetPackageRequest {
5031 #[prost(string, optional, tag = "1")]
5038 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
5039 #[prost(oneof = "get_package_request::Selector", tags = "2, 3")]
5064 pub selector: ::core::option::Option<get_package_request::Selector>,
5065}
5066pub mod get_package_request {
5068 #[non_exhaustive]
5093 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
5094 pub enum Selector {
5095 #[prost(uint64, tag = "2")]
5096 Version(u64),
5097 #[prost(uint64, tag = "3")]
5098 AtCheckpoint(u64),
5099 }
5100}
5101#[non_exhaustive]
5102#[derive(Clone, PartialEq, ::prost::Message)]
5103pub struct GetPackageResponse {
5104 #[prost(message, optional, tag = "1")]
5106 pub package: ::core::option::Option<Package>,
5107}
5108#[non_exhaustive]
5109#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5110pub struct GetDatatypeRequest {
5111 #[prost(string, optional, tag = "1")]
5113 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
5114 #[prost(string, optional, tag = "2")]
5116 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
5117 #[prost(string, optional, tag = "3")]
5119 pub name: ::core::option::Option<::prost::alloc::string::String>,
5120}
5121#[non_exhaustive]
5122#[derive(Clone, PartialEq, ::prost::Message)]
5123pub struct GetDatatypeResponse {
5124 #[prost(message, optional, tag = "1")]
5126 pub datatype: ::core::option::Option<DatatypeDescriptor>,
5127}
5128#[non_exhaustive]
5129#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5130pub struct GetFunctionRequest {
5131 #[prost(string, optional, tag = "1")]
5133 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
5134 #[prost(string, optional, tag = "2")]
5136 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
5137 #[prost(string, optional, tag = "3")]
5139 pub name: ::core::option::Option<::prost::alloc::string::String>,
5140}
5141#[non_exhaustive]
5142#[derive(Clone, PartialEq, ::prost::Message)]
5143pub struct GetFunctionResponse {
5144 #[prost(message, optional, tag = "1")]
5146 pub function: ::core::option::Option<FunctionDescriptor>,
5147}
5148#[non_exhaustive]
5153#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5154pub struct ListPackageVersionsRequest {
5155 #[prost(string, optional, tag = "1")]
5159 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
5160 #[prost(uint32, optional, tag = "2")]
5168 pub page_size: ::core::option::Option<u32>,
5169 #[prost(bytes = "bytes", optional, tag = "3")]
5185 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5186 #[prost(message, optional, tag = "5")]
5235 pub options: ::core::option::Option<QueryOptions>,
5236 #[prost(uint64, optional, tag = "6")]
5239 pub start_version: ::core::option::Option<u64>,
5240 #[prost(uint64, optional, tag = "7")]
5245 pub end_version: ::core::option::Option<u64>,
5246 #[prost(uint64, optional, tag = "8")]
5268 pub start_checkpoint: ::core::option::Option<u64>,
5269 #[prost(uint64, optional, tag = "9")]
5282 pub end_checkpoint: ::core::option::Option<u64>,
5283}
5284#[non_exhaustive]
5285#[derive(Clone, PartialEq, ::prost::Message)]
5286pub struct ListPackageVersionsResponse {
5287 #[prost(message, repeated, tag = "1")]
5291 pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
5292 #[prost(bytes = "bytes", optional, tag = "2")]
5296 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5297 #[prost(message, optional, tag = "3")]
5312 pub end: ::core::option::Option<QueryEnd>,
5313}
5314#[non_exhaustive]
5315#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5316pub struct ListSystemPackagesRequest {
5317 #[prost(uint64, optional, tag = "1")]
5330 pub at_checkpoint: ::core::option::Option<u64>,
5331}
5332#[non_exhaustive]
5333#[derive(Clone, PartialEq, ::prost::Message)]
5334pub struct ListSystemPackagesResponse {
5335 #[prost(message, repeated, tag = "1")]
5341 pub system_packages: ::prost::alloc::vec::Vec<PackageVersion>,
5342}
5343#[non_exhaustive]
5345#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5346pub struct PackageVersion {
5347 #[prost(string, optional, tag = "1")]
5349 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
5350 #[prost(uint64, optional, tag = "2")]
5352 pub version: ::core::option::Option<u64>,
5353 #[prost(uint64, optional, tag = "3")]
5357 pub checkpoint: ::core::option::Option<u64>,
5358 #[prost(bytes = "bytes", optional, tag = "4")]
5361 pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
5362 #[prost(string, optional, tag = "5")]
5365 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
5366}
5367pub mod move_package_service_client {
5369 #![allow(
5370 unused_variables,
5371 dead_code,
5372 missing_docs,
5373 clippy::wildcard_imports,
5374 clippy::let_unit_value,
5375 )]
5376 use tonic::codegen::*;
5377 use tonic::codegen::http::Uri;
5378 #[derive(Debug, Clone)]
5379 pub struct MovePackageServiceClient<T> {
5380 inner: tonic::client::Grpc<T>,
5381 }
5382 impl MovePackageServiceClient<tonic::transport::Channel> {
5383 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5385 where
5386 D: TryInto<tonic::transport::Endpoint>,
5387 D::Error: Into<StdError>,
5388 {
5389 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5390 Ok(Self::new(conn))
5391 }
5392 }
5393 impl<T> MovePackageServiceClient<T>
5394 where
5395 T: tonic::client::GrpcService<tonic::body::Body>,
5396 T::Error: Into<StdError>,
5397 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5398 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5399 {
5400 pub fn new(inner: T) -> Self {
5401 let inner = tonic::client::Grpc::new(inner);
5402 Self { inner }
5403 }
5404 pub fn with_origin(inner: T, origin: Uri) -> Self {
5405 let inner = tonic::client::Grpc::with_origin(inner, origin);
5406 Self { inner }
5407 }
5408 pub fn with_interceptor<F>(
5409 inner: T,
5410 interceptor: F,
5411 ) -> MovePackageServiceClient<InterceptedService<T, F>>
5412 where
5413 F: tonic::service::Interceptor,
5414 T::ResponseBody: Default,
5415 T: tonic::codegen::Service<
5416 http::Request<tonic::body::Body>,
5417 Response = http::Response<
5418 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5419 >,
5420 >,
5421 <T as tonic::codegen::Service<
5422 http::Request<tonic::body::Body>,
5423 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5424 {
5425 MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
5426 }
5427 #[must_use]
5432 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5433 self.inner = self.inner.send_compressed(encoding);
5434 self
5435 }
5436 #[must_use]
5438 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5439 self.inner = self.inner.accept_compressed(encoding);
5440 self
5441 }
5442 #[must_use]
5446 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5447 self.inner = self.inner.max_decoding_message_size(limit);
5448 self
5449 }
5450 #[must_use]
5454 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5455 self.inner = self.inner.max_encoding_message_size(limit);
5456 self
5457 }
5458 pub async fn get_package(
5459 &mut self,
5460 request: impl tonic::IntoRequest<super::GetPackageRequest>,
5461 ) -> std::result::Result<
5462 tonic::Response<super::GetPackageResponse>,
5463 tonic::Status,
5464 > {
5465 self.inner
5466 .ready()
5467 .await
5468 .map_err(|e| {
5469 tonic::Status::unknown(
5470 format!("Service was not ready: {}", e.into()),
5471 )
5472 })?;
5473 let codec = tonic_prost::ProstCodec::default();
5474 let path = http::uri::PathAndQuery::from_static(
5475 "/sui.rpc.v2.MovePackageService/GetPackage",
5476 );
5477 let mut req = request.into_request();
5478 req.extensions_mut()
5479 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
5480 self.inner.unary(req, path, codec).await
5481 }
5482 pub async fn get_datatype(
5483 &mut self,
5484 request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
5485 ) -> std::result::Result<
5486 tonic::Response<super::GetDatatypeResponse>,
5487 tonic::Status,
5488 > {
5489 self.inner
5490 .ready()
5491 .await
5492 .map_err(|e| {
5493 tonic::Status::unknown(
5494 format!("Service was not ready: {}", e.into()),
5495 )
5496 })?;
5497 let codec = tonic_prost::ProstCodec::default();
5498 let path = http::uri::PathAndQuery::from_static(
5499 "/sui.rpc.v2.MovePackageService/GetDatatype",
5500 );
5501 let mut req = request.into_request();
5502 req.extensions_mut()
5503 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
5504 self.inner.unary(req, path, codec).await
5505 }
5506 pub async fn get_function(
5507 &mut self,
5508 request: impl tonic::IntoRequest<super::GetFunctionRequest>,
5509 ) -> std::result::Result<
5510 tonic::Response<super::GetFunctionResponse>,
5511 tonic::Status,
5512 > {
5513 self.inner
5514 .ready()
5515 .await
5516 .map_err(|e| {
5517 tonic::Status::unknown(
5518 format!("Service was not ready: {}", e.into()),
5519 )
5520 })?;
5521 let codec = tonic_prost::ProstCodec::default();
5522 let path = http::uri::PathAndQuery::from_static(
5523 "/sui.rpc.v2.MovePackageService/GetFunction",
5524 );
5525 let mut req = request.into_request();
5526 req.extensions_mut()
5527 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
5528 self.inner.unary(req, path, codec).await
5529 }
5530 pub async fn list_package_versions(
5531 &mut self,
5532 request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
5533 ) -> std::result::Result<
5534 tonic::Response<super::ListPackageVersionsResponse>,
5535 tonic::Status,
5536 > {
5537 self.inner
5538 .ready()
5539 .await
5540 .map_err(|e| {
5541 tonic::Status::unknown(
5542 format!("Service was not ready: {}", e.into()),
5543 )
5544 })?;
5545 let codec = tonic_prost::ProstCodec::default();
5546 let path = http::uri::PathAndQuery::from_static(
5547 "/sui.rpc.v2.MovePackageService/ListPackageVersions",
5548 );
5549 let mut req = request.into_request();
5550 req.extensions_mut()
5551 .insert(
5552 GrpcMethod::new(
5553 "sui.rpc.v2.MovePackageService",
5554 "ListPackageVersions",
5555 ),
5556 );
5557 self.inner.unary(req, path, codec).await
5558 }
5559 pub async fn list_system_packages(
5562 &mut self,
5563 request: impl tonic::IntoRequest<super::ListSystemPackagesRequest>,
5564 ) -> std::result::Result<
5565 tonic::Response<super::ListSystemPackagesResponse>,
5566 tonic::Status,
5567 > {
5568 self.inner
5569 .ready()
5570 .await
5571 .map_err(|e| {
5572 tonic::Status::unknown(
5573 format!("Service was not ready: {}", e.into()),
5574 )
5575 })?;
5576 let codec = tonic_prost::ProstCodec::default();
5577 let path = http::uri::PathAndQuery::from_static(
5578 "/sui.rpc.v2.MovePackageService/ListSystemPackages",
5579 );
5580 let mut req = request.into_request();
5581 req.extensions_mut()
5582 .insert(
5583 GrpcMethod::new(
5584 "sui.rpc.v2.MovePackageService",
5585 "ListSystemPackages",
5586 ),
5587 );
5588 self.inner.unary(req, path, codec).await
5589 }
5590 }
5591}
5592pub mod move_package_service_server {
5594 #![allow(
5595 unused_variables,
5596 dead_code,
5597 missing_docs,
5598 clippy::wildcard_imports,
5599 clippy::let_unit_value,
5600 )]
5601 use tonic::codegen::*;
5602 #[async_trait]
5604 pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
5605 async fn get_package(
5606 &self,
5607 request: tonic::Request<super::GetPackageRequest>,
5608 ) -> std::result::Result<
5609 tonic::Response<super::GetPackageResponse>,
5610 tonic::Status,
5611 > {
5612 Err(tonic::Status::unimplemented("Not yet implemented"))
5613 }
5614 async fn get_datatype(
5615 &self,
5616 request: tonic::Request<super::GetDatatypeRequest>,
5617 ) -> std::result::Result<
5618 tonic::Response<super::GetDatatypeResponse>,
5619 tonic::Status,
5620 > {
5621 Err(tonic::Status::unimplemented("Not yet implemented"))
5622 }
5623 async fn get_function(
5624 &self,
5625 request: tonic::Request<super::GetFunctionRequest>,
5626 ) -> std::result::Result<
5627 tonic::Response<super::GetFunctionResponse>,
5628 tonic::Status,
5629 > {
5630 Err(tonic::Status::unimplemented("Not yet implemented"))
5631 }
5632 async fn list_package_versions(
5633 &self,
5634 request: tonic::Request<super::ListPackageVersionsRequest>,
5635 ) -> std::result::Result<
5636 tonic::Response<super::ListPackageVersionsResponse>,
5637 tonic::Status,
5638 > {
5639 Err(tonic::Status::unimplemented("Not yet implemented"))
5640 }
5641 async fn list_system_packages(
5644 &self,
5645 request: tonic::Request<super::ListSystemPackagesRequest>,
5646 ) -> std::result::Result<
5647 tonic::Response<super::ListSystemPackagesResponse>,
5648 tonic::Status,
5649 > {
5650 Err(tonic::Status::unimplemented("Not yet implemented"))
5651 }
5652 }
5653 #[derive(Debug)]
5654 pub struct MovePackageServiceServer<T> {
5655 inner: Arc<T>,
5656 accept_compression_encodings: EnabledCompressionEncodings,
5657 send_compression_encodings: EnabledCompressionEncodings,
5658 max_decoding_message_size: Option<usize>,
5659 max_encoding_message_size: Option<usize>,
5660 }
5661 impl<T> MovePackageServiceServer<T> {
5662 pub fn new(inner: T) -> Self {
5663 Self::from_arc(Arc::new(inner))
5664 }
5665 pub fn from_arc(inner: Arc<T>) -> Self {
5666 Self {
5667 inner,
5668 accept_compression_encodings: Default::default(),
5669 send_compression_encodings: Default::default(),
5670 max_decoding_message_size: None,
5671 max_encoding_message_size: None,
5672 }
5673 }
5674 pub fn with_interceptor<F>(
5675 inner: T,
5676 interceptor: F,
5677 ) -> InterceptedService<Self, F>
5678 where
5679 F: tonic::service::Interceptor,
5680 {
5681 InterceptedService::new(Self::new(inner), interceptor)
5682 }
5683 #[must_use]
5685 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5686 self.accept_compression_encodings.enable(encoding);
5687 self
5688 }
5689 #[must_use]
5691 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5692 self.send_compression_encodings.enable(encoding);
5693 self
5694 }
5695 #[must_use]
5699 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5700 self.max_decoding_message_size = Some(limit);
5701 self
5702 }
5703 #[must_use]
5707 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5708 self.max_encoding_message_size = Some(limit);
5709 self
5710 }
5711 }
5712 impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
5713 where
5714 T: MovePackageService,
5715 B: Body + std::marker::Send + 'static,
5716 B::Error: Into<StdError> + std::marker::Send + 'static,
5717 {
5718 type Response = http::Response<tonic::body::Body>;
5719 type Error = std::convert::Infallible;
5720 type Future = BoxFuture<Self::Response, Self::Error>;
5721 fn poll_ready(
5722 &mut self,
5723 _cx: &mut Context<'_>,
5724 ) -> Poll<std::result::Result<(), Self::Error>> {
5725 Poll::Ready(Ok(()))
5726 }
5727 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5728 match req.uri().path() {
5729 "/sui.rpc.v2.MovePackageService/GetPackage" => {
5730 #[allow(non_camel_case_types)]
5731 struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
5732 impl<
5733 T: MovePackageService,
5734 > tonic::server::UnaryService<super::GetPackageRequest>
5735 for GetPackageSvc<T> {
5736 type Response = super::GetPackageResponse;
5737 type Future = BoxFuture<
5738 tonic::Response<Self::Response>,
5739 tonic::Status,
5740 >;
5741 fn call(
5742 &mut self,
5743 request: tonic::Request<super::GetPackageRequest>,
5744 ) -> Self::Future {
5745 let inner = Arc::clone(&self.0);
5746 let fut = async move {
5747 <T as MovePackageService>::get_package(&inner, request)
5748 .await
5749 };
5750 Box::pin(fut)
5751 }
5752 }
5753 let accept_compression_encodings = self.accept_compression_encodings;
5754 let send_compression_encodings = self.send_compression_encodings;
5755 let max_decoding_message_size = self.max_decoding_message_size;
5756 let max_encoding_message_size = self.max_encoding_message_size;
5757 let inner = self.inner.clone();
5758 let fut = async move {
5759 let method = GetPackageSvc(inner);
5760 let codec = tonic_prost::ProstCodec::default();
5761 let mut grpc = tonic::server::Grpc::new(codec)
5762 .apply_compression_config(
5763 accept_compression_encodings,
5764 send_compression_encodings,
5765 )
5766 .apply_max_message_size_config(
5767 max_decoding_message_size,
5768 max_encoding_message_size,
5769 );
5770 let res = grpc.unary(method, req).await;
5771 Ok(res)
5772 };
5773 Box::pin(fut)
5774 }
5775 "/sui.rpc.v2.MovePackageService/GetDatatype" => {
5776 #[allow(non_camel_case_types)]
5777 struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
5778 impl<
5779 T: MovePackageService,
5780 > tonic::server::UnaryService<super::GetDatatypeRequest>
5781 for GetDatatypeSvc<T> {
5782 type Response = super::GetDatatypeResponse;
5783 type Future = BoxFuture<
5784 tonic::Response<Self::Response>,
5785 tonic::Status,
5786 >;
5787 fn call(
5788 &mut self,
5789 request: tonic::Request<super::GetDatatypeRequest>,
5790 ) -> Self::Future {
5791 let inner = Arc::clone(&self.0);
5792 let fut = async move {
5793 <T as MovePackageService>::get_datatype(&inner, request)
5794 .await
5795 };
5796 Box::pin(fut)
5797 }
5798 }
5799 let accept_compression_encodings = self.accept_compression_encodings;
5800 let send_compression_encodings = self.send_compression_encodings;
5801 let max_decoding_message_size = self.max_decoding_message_size;
5802 let max_encoding_message_size = self.max_encoding_message_size;
5803 let inner = self.inner.clone();
5804 let fut = async move {
5805 let method = GetDatatypeSvc(inner);
5806 let codec = tonic_prost::ProstCodec::default();
5807 let mut grpc = tonic::server::Grpc::new(codec)
5808 .apply_compression_config(
5809 accept_compression_encodings,
5810 send_compression_encodings,
5811 )
5812 .apply_max_message_size_config(
5813 max_decoding_message_size,
5814 max_encoding_message_size,
5815 );
5816 let res = grpc.unary(method, req).await;
5817 Ok(res)
5818 };
5819 Box::pin(fut)
5820 }
5821 "/sui.rpc.v2.MovePackageService/GetFunction" => {
5822 #[allow(non_camel_case_types)]
5823 struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
5824 impl<
5825 T: MovePackageService,
5826 > tonic::server::UnaryService<super::GetFunctionRequest>
5827 for GetFunctionSvc<T> {
5828 type Response = super::GetFunctionResponse;
5829 type Future = BoxFuture<
5830 tonic::Response<Self::Response>,
5831 tonic::Status,
5832 >;
5833 fn call(
5834 &mut self,
5835 request: tonic::Request<super::GetFunctionRequest>,
5836 ) -> Self::Future {
5837 let inner = Arc::clone(&self.0);
5838 let fut = async move {
5839 <T as MovePackageService>::get_function(&inner, request)
5840 .await
5841 };
5842 Box::pin(fut)
5843 }
5844 }
5845 let accept_compression_encodings = self.accept_compression_encodings;
5846 let send_compression_encodings = self.send_compression_encodings;
5847 let max_decoding_message_size = self.max_decoding_message_size;
5848 let max_encoding_message_size = self.max_encoding_message_size;
5849 let inner = self.inner.clone();
5850 let fut = async move {
5851 let method = GetFunctionSvc(inner);
5852 let codec = tonic_prost::ProstCodec::default();
5853 let mut grpc = tonic::server::Grpc::new(codec)
5854 .apply_compression_config(
5855 accept_compression_encodings,
5856 send_compression_encodings,
5857 )
5858 .apply_max_message_size_config(
5859 max_decoding_message_size,
5860 max_encoding_message_size,
5861 );
5862 let res = grpc.unary(method, req).await;
5863 Ok(res)
5864 };
5865 Box::pin(fut)
5866 }
5867 "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
5868 #[allow(non_camel_case_types)]
5869 struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
5870 impl<
5871 T: MovePackageService,
5872 > tonic::server::UnaryService<super::ListPackageVersionsRequest>
5873 for ListPackageVersionsSvc<T> {
5874 type Response = super::ListPackageVersionsResponse;
5875 type Future = BoxFuture<
5876 tonic::Response<Self::Response>,
5877 tonic::Status,
5878 >;
5879 fn call(
5880 &mut self,
5881 request: tonic::Request<super::ListPackageVersionsRequest>,
5882 ) -> Self::Future {
5883 let inner = Arc::clone(&self.0);
5884 let fut = async move {
5885 <T as MovePackageService>::list_package_versions(
5886 &inner,
5887 request,
5888 )
5889 .await
5890 };
5891 Box::pin(fut)
5892 }
5893 }
5894 let accept_compression_encodings = self.accept_compression_encodings;
5895 let send_compression_encodings = self.send_compression_encodings;
5896 let max_decoding_message_size = self.max_decoding_message_size;
5897 let max_encoding_message_size = self.max_encoding_message_size;
5898 let inner = self.inner.clone();
5899 let fut = async move {
5900 let method = ListPackageVersionsSvc(inner);
5901 let codec = tonic_prost::ProstCodec::default();
5902 let mut grpc = tonic::server::Grpc::new(codec)
5903 .apply_compression_config(
5904 accept_compression_encodings,
5905 send_compression_encodings,
5906 )
5907 .apply_max_message_size_config(
5908 max_decoding_message_size,
5909 max_encoding_message_size,
5910 );
5911 let res = grpc.unary(method, req).await;
5912 Ok(res)
5913 };
5914 Box::pin(fut)
5915 }
5916 "/sui.rpc.v2.MovePackageService/ListSystemPackages" => {
5917 #[allow(non_camel_case_types)]
5918 struct ListSystemPackagesSvc<T: MovePackageService>(pub Arc<T>);
5919 impl<
5920 T: MovePackageService,
5921 > tonic::server::UnaryService<super::ListSystemPackagesRequest>
5922 for ListSystemPackagesSvc<T> {
5923 type Response = super::ListSystemPackagesResponse;
5924 type Future = BoxFuture<
5925 tonic::Response<Self::Response>,
5926 tonic::Status,
5927 >;
5928 fn call(
5929 &mut self,
5930 request: tonic::Request<super::ListSystemPackagesRequest>,
5931 ) -> Self::Future {
5932 let inner = Arc::clone(&self.0);
5933 let fut = async move {
5934 <T as MovePackageService>::list_system_packages(
5935 &inner,
5936 request,
5937 )
5938 .await
5939 };
5940 Box::pin(fut)
5941 }
5942 }
5943 let accept_compression_encodings = self.accept_compression_encodings;
5944 let send_compression_encodings = self.send_compression_encodings;
5945 let max_decoding_message_size = self.max_decoding_message_size;
5946 let max_encoding_message_size = self.max_encoding_message_size;
5947 let inner = self.inner.clone();
5948 let fut = async move {
5949 let method = ListSystemPackagesSvc(inner);
5950 let codec = tonic_prost::ProstCodec::default();
5951 let mut grpc = tonic::server::Grpc::new(codec)
5952 .apply_compression_config(
5953 accept_compression_encodings,
5954 send_compression_encodings,
5955 )
5956 .apply_max_message_size_config(
5957 max_decoding_message_size,
5958 max_encoding_message_size,
5959 );
5960 let res = grpc.unary(method, req).await;
5961 Ok(res)
5962 };
5963 Box::pin(fut)
5964 }
5965 _ => {
5966 Box::pin(async move {
5967 let mut response = http::Response::new(
5968 tonic::body::Body::default(),
5969 );
5970 let headers = response.headers_mut();
5971 headers
5972 .insert(
5973 tonic::Status::GRPC_STATUS,
5974 (tonic::Code::Unimplemented as i32).into(),
5975 );
5976 headers
5977 .insert(
5978 http::header::CONTENT_TYPE,
5979 tonic::metadata::GRPC_CONTENT_TYPE,
5980 );
5981 Ok(response)
5982 })
5983 }
5984 }
5985 }
5986 }
5987 impl<T> Clone for MovePackageServiceServer<T> {
5988 fn clone(&self) -> Self {
5989 let inner = self.inner.clone();
5990 Self {
5991 inner,
5992 accept_compression_encodings: self.accept_compression_encodings,
5993 send_compression_encodings: self.send_compression_encodings,
5994 max_decoding_message_size: self.max_decoding_message_size,
5995 max_encoding_message_size: self.max_encoding_message_size,
5996 }
5997 }
5998 }
5999 pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
6001 impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
6002 const NAME: &'static str = SERVICE_NAME;
6003 }
6004}
6005#[non_exhaustive]
6006#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6007pub struct LookupNameRequest {
6008 #[prost(string, optional, tag = "1")]
6012 pub name: ::core::option::Option<::prost::alloc::string::String>,
6013}
6014#[non_exhaustive]
6015#[derive(Clone, PartialEq, ::prost::Message)]
6016pub struct LookupNameResponse {
6017 #[prost(message, optional, tag = "1")]
6019 pub record: ::core::option::Option<NameRecord>,
6020}
6021#[non_exhaustive]
6022#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6023pub struct ReverseLookupNameRequest {
6024 #[prost(string, optional, tag = "1")]
6026 pub address: ::core::option::Option<::prost::alloc::string::String>,
6027}
6028#[non_exhaustive]
6029#[derive(Clone, PartialEq, ::prost::Message)]
6030pub struct ReverseLookupNameResponse {
6031 #[prost(message, optional, tag = "1")]
6033 pub record: ::core::option::Option<NameRecord>,
6034}
6035#[non_exhaustive]
6036#[derive(Clone, PartialEq, ::prost::Message)]
6037pub struct NameRecord {
6038 #[prost(string, optional, tag = "1")]
6043 pub id: ::core::option::Option<::prost::alloc::string::String>,
6044 #[prost(string, optional, tag = "2")]
6046 pub name: ::core::option::Option<::prost::alloc::string::String>,
6047 #[prost(string, optional, tag = "3")]
6055 pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
6056 #[prost(message, optional, tag = "4")]
6061 pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
6062 #[prost(string, optional, tag = "5")]
6064 pub target_address: ::core::option::Option<::prost::alloc::string::String>,
6065 #[prost(btree_map = "string, string", tag = "6")]
6067 pub data: ::prost::alloc::collections::BTreeMap<
6068 ::prost::alloc::string::String,
6069 ::prost::alloc::string::String,
6070 >,
6071}
6072pub mod name_service_client {
6074 #![allow(
6075 unused_variables,
6076 dead_code,
6077 missing_docs,
6078 clippy::wildcard_imports,
6079 clippy::let_unit_value,
6080 )]
6081 use tonic::codegen::*;
6082 use tonic::codegen::http::Uri;
6083 #[derive(Debug, Clone)]
6084 pub struct NameServiceClient<T> {
6085 inner: tonic::client::Grpc<T>,
6086 }
6087 impl NameServiceClient<tonic::transport::Channel> {
6088 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6090 where
6091 D: TryInto<tonic::transport::Endpoint>,
6092 D::Error: Into<StdError>,
6093 {
6094 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6095 Ok(Self::new(conn))
6096 }
6097 }
6098 impl<T> NameServiceClient<T>
6099 where
6100 T: tonic::client::GrpcService<tonic::body::Body>,
6101 T::Error: Into<StdError>,
6102 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6103 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6104 {
6105 pub fn new(inner: T) -> Self {
6106 let inner = tonic::client::Grpc::new(inner);
6107 Self { inner }
6108 }
6109 pub fn with_origin(inner: T, origin: Uri) -> Self {
6110 let inner = tonic::client::Grpc::with_origin(inner, origin);
6111 Self { inner }
6112 }
6113 pub fn with_interceptor<F>(
6114 inner: T,
6115 interceptor: F,
6116 ) -> NameServiceClient<InterceptedService<T, F>>
6117 where
6118 F: tonic::service::Interceptor,
6119 T::ResponseBody: Default,
6120 T: tonic::codegen::Service<
6121 http::Request<tonic::body::Body>,
6122 Response = http::Response<
6123 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6124 >,
6125 >,
6126 <T as tonic::codegen::Service<
6127 http::Request<tonic::body::Body>,
6128 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6129 {
6130 NameServiceClient::new(InterceptedService::new(inner, interceptor))
6131 }
6132 #[must_use]
6137 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6138 self.inner = self.inner.send_compressed(encoding);
6139 self
6140 }
6141 #[must_use]
6143 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6144 self.inner = self.inner.accept_compressed(encoding);
6145 self
6146 }
6147 #[must_use]
6151 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6152 self.inner = self.inner.max_decoding_message_size(limit);
6153 self
6154 }
6155 #[must_use]
6159 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6160 self.inner = self.inner.max_encoding_message_size(limit);
6161 self
6162 }
6163 pub async fn lookup_name(
6164 &mut self,
6165 request: impl tonic::IntoRequest<super::LookupNameRequest>,
6166 ) -> std::result::Result<
6167 tonic::Response<super::LookupNameResponse>,
6168 tonic::Status,
6169 > {
6170 self.inner
6171 .ready()
6172 .await
6173 .map_err(|e| {
6174 tonic::Status::unknown(
6175 format!("Service was not ready: {}", e.into()),
6176 )
6177 })?;
6178 let codec = tonic_prost::ProstCodec::default();
6179 let path = http::uri::PathAndQuery::from_static(
6180 "/sui.rpc.v2.NameService/LookupName",
6181 );
6182 let mut req = request.into_request();
6183 req.extensions_mut()
6184 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
6185 self.inner.unary(req, path, codec).await
6186 }
6187 pub async fn reverse_lookup_name(
6188 &mut self,
6189 request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
6190 ) -> std::result::Result<
6191 tonic::Response<super::ReverseLookupNameResponse>,
6192 tonic::Status,
6193 > {
6194 self.inner
6195 .ready()
6196 .await
6197 .map_err(|e| {
6198 tonic::Status::unknown(
6199 format!("Service was not ready: {}", e.into()),
6200 )
6201 })?;
6202 let codec = tonic_prost::ProstCodec::default();
6203 let path = http::uri::PathAndQuery::from_static(
6204 "/sui.rpc.v2.NameService/ReverseLookupName",
6205 );
6206 let mut req = request.into_request();
6207 req.extensions_mut()
6208 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
6209 self.inner.unary(req, path, codec).await
6210 }
6211 }
6212}
6213pub mod name_service_server {
6215 #![allow(
6216 unused_variables,
6217 dead_code,
6218 missing_docs,
6219 clippy::wildcard_imports,
6220 clippy::let_unit_value,
6221 )]
6222 use tonic::codegen::*;
6223 #[async_trait]
6225 pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
6226 async fn lookup_name(
6227 &self,
6228 request: tonic::Request<super::LookupNameRequest>,
6229 ) -> std::result::Result<
6230 tonic::Response<super::LookupNameResponse>,
6231 tonic::Status,
6232 > {
6233 Err(tonic::Status::unimplemented("Not yet implemented"))
6234 }
6235 async fn reverse_lookup_name(
6236 &self,
6237 request: tonic::Request<super::ReverseLookupNameRequest>,
6238 ) -> std::result::Result<
6239 tonic::Response<super::ReverseLookupNameResponse>,
6240 tonic::Status,
6241 > {
6242 Err(tonic::Status::unimplemented("Not yet implemented"))
6243 }
6244 }
6245 #[derive(Debug)]
6246 pub struct NameServiceServer<T> {
6247 inner: Arc<T>,
6248 accept_compression_encodings: EnabledCompressionEncodings,
6249 send_compression_encodings: EnabledCompressionEncodings,
6250 max_decoding_message_size: Option<usize>,
6251 max_encoding_message_size: Option<usize>,
6252 }
6253 impl<T> NameServiceServer<T> {
6254 pub fn new(inner: T) -> Self {
6255 Self::from_arc(Arc::new(inner))
6256 }
6257 pub fn from_arc(inner: Arc<T>) -> Self {
6258 Self {
6259 inner,
6260 accept_compression_encodings: Default::default(),
6261 send_compression_encodings: Default::default(),
6262 max_decoding_message_size: None,
6263 max_encoding_message_size: None,
6264 }
6265 }
6266 pub fn with_interceptor<F>(
6267 inner: T,
6268 interceptor: F,
6269 ) -> InterceptedService<Self, F>
6270 where
6271 F: tonic::service::Interceptor,
6272 {
6273 InterceptedService::new(Self::new(inner), interceptor)
6274 }
6275 #[must_use]
6277 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6278 self.accept_compression_encodings.enable(encoding);
6279 self
6280 }
6281 #[must_use]
6283 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6284 self.send_compression_encodings.enable(encoding);
6285 self
6286 }
6287 #[must_use]
6291 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6292 self.max_decoding_message_size = Some(limit);
6293 self
6294 }
6295 #[must_use]
6299 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6300 self.max_encoding_message_size = Some(limit);
6301 self
6302 }
6303 }
6304 impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
6305 where
6306 T: NameService,
6307 B: Body + std::marker::Send + 'static,
6308 B::Error: Into<StdError> + std::marker::Send + 'static,
6309 {
6310 type Response = http::Response<tonic::body::Body>;
6311 type Error = std::convert::Infallible;
6312 type Future = BoxFuture<Self::Response, Self::Error>;
6313 fn poll_ready(
6314 &mut self,
6315 _cx: &mut Context<'_>,
6316 ) -> Poll<std::result::Result<(), Self::Error>> {
6317 Poll::Ready(Ok(()))
6318 }
6319 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6320 match req.uri().path() {
6321 "/sui.rpc.v2.NameService/LookupName" => {
6322 #[allow(non_camel_case_types)]
6323 struct LookupNameSvc<T: NameService>(pub Arc<T>);
6324 impl<
6325 T: NameService,
6326 > tonic::server::UnaryService<super::LookupNameRequest>
6327 for LookupNameSvc<T> {
6328 type Response = super::LookupNameResponse;
6329 type Future = BoxFuture<
6330 tonic::Response<Self::Response>,
6331 tonic::Status,
6332 >;
6333 fn call(
6334 &mut self,
6335 request: tonic::Request<super::LookupNameRequest>,
6336 ) -> Self::Future {
6337 let inner = Arc::clone(&self.0);
6338 let fut = async move {
6339 <T as NameService>::lookup_name(&inner, request).await
6340 };
6341 Box::pin(fut)
6342 }
6343 }
6344 let accept_compression_encodings = self.accept_compression_encodings;
6345 let send_compression_encodings = self.send_compression_encodings;
6346 let max_decoding_message_size = self.max_decoding_message_size;
6347 let max_encoding_message_size = self.max_encoding_message_size;
6348 let inner = self.inner.clone();
6349 let fut = async move {
6350 let method = LookupNameSvc(inner);
6351 let codec = tonic_prost::ProstCodec::default();
6352 let mut grpc = tonic::server::Grpc::new(codec)
6353 .apply_compression_config(
6354 accept_compression_encodings,
6355 send_compression_encodings,
6356 )
6357 .apply_max_message_size_config(
6358 max_decoding_message_size,
6359 max_encoding_message_size,
6360 );
6361 let res = grpc.unary(method, req).await;
6362 Ok(res)
6363 };
6364 Box::pin(fut)
6365 }
6366 "/sui.rpc.v2.NameService/ReverseLookupName" => {
6367 #[allow(non_camel_case_types)]
6368 struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
6369 impl<
6370 T: NameService,
6371 > tonic::server::UnaryService<super::ReverseLookupNameRequest>
6372 for ReverseLookupNameSvc<T> {
6373 type Response = super::ReverseLookupNameResponse;
6374 type Future = BoxFuture<
6375 tonic::Response<Self::Response>,
6376 tonic::Status,
6377 >;
6378 fn call(
6379 &mut self,
6380 request: tonic::Request<super::ReverseLookupNameRequest>,
6381 ) -> Self::Future {
6382 let inner = Arc::clone(&self.0);
6383 let fut = async move {
6384 <T as NameService>::reverse_lookup_name(&inner, request)
6385 .await
6386 };
6387 Box::pin(fut)
6388 }
6389 }
6390 let accept_compression_encodings = self.accept_compression_encodings;
6391 let send_compression_encodings = self.send_compression_encodings;
6392 let max_decoding_message_size = self.max_decoding_message_size;
6393 let max_encoding_message_size = self.max_encoding_message_size;
6394 let inner = self.inner.clone();
6395 let fut = async move {
6396 let method = ReverseLookupNameSvc(inner);
6397 let codec = tonic_prost::ProstCodec::default();
6398 let mut grpc = tonic::server::Grpc::new(codec)
6399 .apply_compression_config(
6400 accept_compression_encodings,
6401 send_compression_encodings,
6402 )
6403 .apply_max_message_size_config(
6404 max_decoding_message_size,
6405 max_encoding_message_size,
6406 );
6407 let res = grpc.unary(method, req).await;
6408 Ok(res)
6409 };
6410 Box::pin(fut)
6411 }
6412 _ => {
6413 Box::pin(async move {
6414 let mut response = http::Response::new(
6415 tonic::body::Body::default(),
6416 );
6417 let headers = response.headers_mut();
6418 headers
6419 .insert(
6420 tonic::Status::GRPC_STATUS,
6421 (tonic::Code::Unimplemented as i32).into(),
6422 );
6423 headers
6424 .insert(
6425 http::header::CONTENT_TYPE,
6426 tonic::metadata::GRPC_CONTENT_TYPE,
6427 );
6428 Ok(response)
6429 })
6430 }
6431 }
6432 }
6433 }
6434 impl<T> Clone for NameServiceServer<T> {
6435 fn clone(&self) -> Self {
6436 let inner = self.inner.clone();
6437 Self {
6438 inner,
6439 accept_compression_encodings: self.accept_compression_encodings,
6440 send_compression_encodings: self.send_compression_encodings,
6441 max_decoding_message_size: self.max_decoding_message_size,
6442 max_encoding_message_size: self.max_encoding_message_size,
6443 }
6444 }
6445 }
6446 pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
6448 impl<T> tonic::server::NamedService for NameServiceServer<T> {
6449 const NAME: &'static str = SERVICE_NAME;
6450 }
6451}
6452#[non_exhaustive]
6454#[derive(Clone, PartialEq, ::prost::Message)]
6455pub struct Object {
6456 #[prost(message, optional, tag = "1")]
6458 pub bcs: ::core::option::Option<Bcs>,
6459 #[prost(string, optional, tag = "2")]
6461 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
6462 #[prost(uint64, optional, tag = "3")]
6464 pub version: ::core::option::Option<u64>,
6465 #[prost(string, optional, tag = "4")]
6467 pub digest: ::core::option::Option<::prost::alloc::string::String>,
6468 #[prost(message, optional, tag = "5")]
6470 pub owner: ::core::option::Option<Owner>,
6471 #[prost(string, optional, tag = "6")]
6475 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
6476 #[prost(bool, optional, tag = "7")]
6481 pub has_public_transfer: ::core::option::Option<bool>,
6482 #[prost(message, optional, tag = "8")]
6486 pub contents: ::core::option::Option<Bcs>,
6487 #[prost(message, optional, tag = "9")]
6489 pub package: ::core::option::Option<Package>,
6490 #[prost(string, optional, tag = "10")]
6492 pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
6493 #[prost(uint64, optional, tag = "11")]
6497 pub storage_rebate: ::core::option::Option<u64>,
6498 #[prost(message, optional, boxed, tag = "100")]
6500 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
6501 #[prost(uint64, optional, tag = "101")]
6503 pub balance: ::core::option::Option<u64>,
6504 #[prost(message, optional, boxed, tag = "102")]
6507 pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
6508}
6509#[non_exhaustive]
6511#[derive(Clone, PartialEq, ::prost::Message)]
6512pub struct ObjectSet {
6513 #[prost(message, repeated, tag = "1")]
6515 pub objects: ::prost::alloc::vec::Vec<Object>,
6516}
6517#[non_exhaustive]
6519#[derive(Clone, PartialEq, ::prost::Message)]
6520pub struct Display {
6521 #[prost(message, optional, tag = "1")]
6525 pub output: ::core::option::Option<::prost_types::Value>,
6526 #[prost(message, optional, tag = "2")]
6530 pub errors: ::core::option::Option<::prost_types::Value>,
6531}
6532#[non_exhaustive]
6534#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6535pub struct ObjectReference {
6536 #[prost(string, optional, tag = "1")]
6538 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
6539 #[prost(uint64, optional, tag = "2")]
6541 pub version: ::core::option::Option<u64>,
6542 #[prost(string, optional, tag = "3")]
6544 pub digest: ::core::option::Option<::prost::alloc::string::String>,
6545}
6546#[non_exhaustive]
6548#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6549pub struct Owner {
6550 #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
6551 pub kind: ::core::option::Option<i32>,
6552 #[prost(string, optional, tag = "2")]
6554 pub address: ::core::option::Option<::prost::alloc::string::String>,
6555 #[prost(uint64, optional, tag = "3")]
6557 pub version: ::core::option::Option<u64>,
6558}
6559pub mod owner {
6561 #[non_exhaustive]
6562 #[derive(
6563 Clone,
6564 Copy,
6565 Debug,
6566 PartialEq,
6567 Eq,
6568 Hash,
6569 PartialOrd,
6570 Ord,
6571 ::prost::Enumeration
6572 )]
6573 #[repr(i32)]
6574 pub enum OwnerKind {
6575 Unknown = 0,
6576 Address = 1,
6577 Object = 2,
6578 Shared = 3,
6579 Immutable = 4,
6580 ConsensusAddress = 5,
6581 }
6582 impl OwnerKind {
6583 pub fn as_str_name(&self) -> &'static str {
6588 match self {
6589 Self::Unknown => "OWNER_KIND_UNKNOWN",
6590 Self::Address => "ADDRESS",
6591 Self::Object => "OBJECT",
6592 Self::Shared => "SHARED",
6593 Self::Immutable => "IMMUTABLE",
6594 Self::ConsensusAddress => "CONSENSUS_ADDRESS",
6595 }
6596 }
6597 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6599 match value {
6600 "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
6601 "ADDRESS" => Some(Self::Address),
6602 "OBJECT" => Some(Self::Object),
6603 "SHARED" => Some(Self::Shared),
6604 "IMMUTABLE" => Some(Self::Immutable),
6605 "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
6606 _ => None,
6607 }
6608 }
6609 }
6610}
6611#[non_exhaustive]
6612#[derive(Clone, PartialEq, ::prost::Message)]
6613pub struct ProtocolConfig {
6614 #[prost(uint64, optional, tag = "1")]
6615 pub protocol_version: ::core::option::Option<u64>,
6616 #[prost(btree_map = "string, bool", tag = "2")]
6618 pub feature_flags: ::prost::alloc::collections::BTreeMap<
6619 ::prost::alloc::string::String,
6620 bool,
6621 >,
6622 #[prost(btree_map = "string, string", tag = "3")]
6624 pub attributes: ::prost::alloc::collections::BTreeMap<
6625 ::prost::alloc::string::String,
6626 ::prost::alloc::string::String,
6627 >,
6628 #[prost(btree_map = "string, message", tag = "4")]
6629 pub configs: ::prost::alloc::collections::BTreeMap<
6630 ::prost::alloc::string::String,
6631 ::prost_types::Value,
6632 >,
6633}
6634#[non_exhaustive]
6649#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6650pub struct QueryOptions {
6651 #[prost(uint32, optional, tag = "1")]
6654 pub limit: ::core::option::Option<u32>,
6655 #[prost(bytes = "bytes", optional, tag = "2")]
6658 pub after: ::core::option::Option<::prost::bytes::Bytes>,
6659 #[prost(bytes = "bytes", optional, tag = "3")]
6662 pub before: ::core::option::Option<::prost::bytes::Bytes>,
6663 #[prost(enumeration = "Ordering", optional, tag = "4")]
6668 pub ordering: ::core::option::Option<i32>,
6669}
6670#[non_exhaustive]
6696#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6697pub struct LedgerPosition {
6698 #[prost(uint64, optional, tag = "1")]
6700 pub checkpoint: ::core::option::Option<u64>,
6701 #[prost(uint64, optional, tag = "2")]
6703 pub transaction_index: ::core::option::Option<u64>,
6704 #[prost(uint32, optional, tag = "3")]
6707 pub event_index: ::core::option::Option<u32>,
6708}
6709#[non_exhaustive]
6738#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6739pub struct Watermark {
6740 #[prost(bytes = "bytes", optional, tag = "1")]
6748 pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
6749 #[prost(uint64, optional, tag = "2")]
6764 pub checkpoint: ::core::option::Option<u64>,
6765 #[prost(message, optional, tag = "4")]
6785 pub cursor_position: ::core::option::Option<LedgerPosition>,
6786}
6787#[non_exhaustive]
6804#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6805pub struct QueryEnd {
6806 #[prost(enumeration = "QueryEndReason", optional, tag = "1")]
6808 pub reason: ::core::option::Option<i32>,
6809}
6810#[non_exhaustive]
6812#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
6813#[repr(i32)]
6814pub enum Ordering {
6815 Ascending = 0,
6817 Descending = 1,
6819}
6820impl Ordering {
6821 pub fn as_str_name(&self) -> &'static str {
6826 match self {
6827 Self::Ascending => "ORDERING_ASCENDING",
6828 Self::Descending => "ORDERING_DESCENDING",
6829 }
6830 }
6831 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6833 match value {
6834 "ORDERING_ASCENDING" => Some(Self::Ascending),
6835 "ORDERING_DESCENDING" => Some(Self::Descending),
6836 _ => None,
6837 }
6838 }
6839}
6840#[non_exhaustive]
6842#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
6843#[repr(i32)]
6844pub enum QueryEndReason {
6845 Unknown = 0,
6847 ItemLimit = 1,
6853 ScanLimit = 2,
6858 CheckpointBound = 3,
6865 CursorBound = 4,
6870 LedgerTip = 5,
6873}
6874impl QueryEndReason {
6875 pub fn as_str_name(&self) -> &'static str {
6880 match self {
6881 Self::Unknown => "QUERY_END_REASON_UNKNOWN",
6882 Self::ItemLimit => "QUERY_END_REASON_ITEM_LIMIT",
6883 Self::ScanLimit => "QUERY_END_REASON_SCAN_LIMIT",
6884 Self::CheckpointBound => "QUERY_END_REASON_CHECKPOINT_BOUND",
6885 Self::CursorBound => "QUERY_END_REASON_CURSOR_BOUND",
6886 Self::LedgerTip => "QUERY_END_REASON_LEDGER_TIP",
6887 }
6888 }
6889 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6891 match value {
6892 "QUERY_END_REASON_UNKNOWN" => Some(Self::Unknown),
6893 "QUERY_END_REASON_ITEM_LIMIT" => Some(Self::ItemLimit),
6894 "QUERY_END_REASON_SCAN_LIMIT" => Some(Self::ScanLimit),
6895 "QUERY_END_REASON_CHECKPOINT_BOUND" => Some(Self::CheckpointBound),
6896 "QUERY_END_REASON_CURSOR_BOUND" => Some(Self::CursorBound),
6897 "QUERY_END_REASON_LEDGER_TIP" => Some(Self::LedgerTip),
6898 _ => None,
6899 }
6900 }
6901}
6902#[non_exhaustive]
6904#[derive(Clone, PartialEq, ::prost::Message)]
6905pub struct UserSignature {
6906 #[prost(message, optional, tag = "1")]
6911 pub bcs: ::core::option::Option<Bcs>,
6912 #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
6914 pub scheme: ::core::option::Option<i32>,
6915 #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
6916 pub signature: ::core::option::Option<user_signature::Signature>,
6917}
6918pub mod user_signature {
6920 #[non_exhaustive]
6921 #[derive(Clone, PartialEq, ::prost::Oneof)]
6922 pub enum Signature {
6923 #[prost(message, tag = "3")]
6925 Simple(super::SimpleSignature),
6926 #[prost(message, tag = "4")]
6928 Multisig(super::MultisigAggregatedSignature),
6929 #[prost(message, tag = "5")]
6931 Zklogin(super::ZkLoginAuthenticator),
6932 #[prost(message, tag = "6")]
6934 Passkey(super::PasskeyAuthenticator),
6935 }
6936}
6937#[non_exhaustive]
6939#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6940pub struct SimpleSignature {
6941 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
6943 pub scheme: ::core::option::Option<i32>,
6944 #[prost(bytes = "bytes", optional, tag = "2")]
6946 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
6947 #[prost(bytes = "bytes", optional, tag = "3")]
6949 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
6950}
6951#[non_exhaustive]
6953#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6954pub struct ZkLoginPublicIdentifier {
6955 #[prost(string, optional, tag = "1")]
6956 pub iss: ::core::option::Option<::prost::alloc::string::String>,
6957 #[prost(string, optional, tag = "2")]
6959 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
6960}
6961#[non_exhaustive]
6963#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6964pub struct MultisigMemberPublicKey {
6965 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
6967 pub scheme: ::core::option::Option<i32>,
6968 #[prost(bytes = "bytes", optional, tag = "2")]
6970 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
6971 #[prost(message, optional, tag = "3")]
6973 pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
6974}
6975#[non_exhaustive]
6977#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6978pub struct MultisigMember {
6979 #[prost(message, optional, tag = "1")]
6981 pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
6982 #[prost(uint32, optional, tag = "2")]
6984 pub weight: ::core::option::Option<u32>,
6985}
6986#[non_exhaustive]
6988#[derive(Clone, PartialEq, ::prost::Message)]
6989pub struct MultisigCommittee {
6990 #[prost(message, repeated, tag = "1")]
6992 pub members: ::prost::alloc::vec::Vec<MultisigMember>,
6993 #[prost(uint32, optional, tag = "2")]
6996 pub threshold: ::core::option::Option<u32>,
6997}
6998#[non_exhaustive]
7000#[derive(Clone, PartialEq, ::prost::Message)]
7001pub struct MultisigAggregatedSignature {
7002 #[prost(message, repeated, tag = "1")]
7006 pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
7007 #[prost(uint32, optional, tag = "2")]
7010 pub bitmap: ::core::option::Option<u32>,
7011 #[prost(bytes = "bytes", optional, tag = "3")]
7014 pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
7015 #[prost(message, optional, tag = "4")]
7017 pub committee: ::core::option::Option<MultisigCommittee>,
7018}
7019#[non_exhaustive]
7021#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7022pub struct MultisigMemberSignature {
7023 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
7025 pub scheme: ::core::option::Option<i32>,
7026 #[prost(bytes = "bytes", optional, tag = "2")]
7028 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
7029 #[prost(message, optional, tag = "3")]
7031 pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
7032 #[prost(message, optional, tag = "4")]
7034 pub passkey: ::core::option::Option<PasskeyAuthenticator>,
7035}
7036#[non_exhaustive]
7038#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7039pub struct ZkLoginAuthenticator {
7040 #[prost(message, optional, tag = "1")]
7042 pub inputs: ::core::option::Option<ZkLoginInputs>,
7043 #[prost(uint64, optional, tag = "2")]
7045 pub max_epoch: ::core::option::Option<u64>,
7046 #[prost(message, optional, tag = "3")]
7048 pub signature: ::core::option::Option<SimpleSignature>,
7049 #[prost(message, optional, tag = "4")]
7051 pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
7052 #[prost(message, optional, tag = "5")]
7054 pub jwk_id: ::core::option::Option<JwkId>,
7055}
7056#[non_exhaustive]
7058#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7059pub struct ZkLoginInputs {
7060 #[prost(message, optional, tag = "1")]
7061 pub proof_points: ::core::option::Option<ZkLoginProof>,
7062 #[prost(message, optional, tag = "2")]
7063 pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
7064 #[prost(string, optional, tag = "3")]
7065 pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
7066 #[prost(string, optional, tag = "4")]
7068 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
7069}
7070#[non_exhaustive]
7072#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7073pub struct ZkLoginProof {
7074 #[prost(message, optional, tag = "1")]
7075 pub a: ::core::option::Option<CircomG1>,
7076 #[prost(message, optional, tag = "2")]
7077 pub b: ::core::option::Option<CircomG2>,
7078 #[prost(message, optional, tag = "3")]
7079 pub c: ::core::option::Option<CircomG1>,
7080}
7081#[non_exhaustive]
7083#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7084pub struct ZkLoginClaim {
7085 #[prost(string, optional, tag = "1")]
7086 pub value: ::core::option::Option<::prost::alloc::string::String>,
7087 #[prost(uint32, optional, tag = "2")]
7088 pub index_mod_4: ::core::option::Option<u32>,
7089}
7090#[non_exhaustive]
7092#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7093pub struct CircomG1 {
7094 #[prost(string, optional, tag = "1")]
7096 pub e0: ::core::option::Option<::prost::alloc::string::String>,
7097 #[prost(string, optional, tag = "2")]
7099 pub e1: ::core::option::Option<::prost::alloc::string::String>,
7100 #[prost(string, optional, tag = "3")]
7102 pub e2: ::core::option::Option<::prost::alloc::string::String>,
7103}
7104#[non_exhaustive]
7106#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7107pub struct CircomG2 {
7108 #[prost(string, optional, tag = "1")]
7110 pub e00: ::core::option::Option<::prost::alloc::string::String>,
7111 #[prost(string, optional, tag = "2")]
7113 pub e01: ::core::option::Option<::prost::alloc::string::String>,
7114 #[prost(string, optional, tag = "3")]
7116 pub e10: ::core::option::Option<::prost::alloc::string::String>,
7117 #[prost(string, optional, tag = "4")]
7119 pub e11: ::core::option::Option<::prost::alloc::string::String>,
7120 #[prost(string, optional, tag = "5")]
7122 pub e20: ::core::option::Option<::prost::alloc::string::String>,
7123 #[prost(string, optional, tag = "6")]
7125 pub e21: ::core::option::Option<::prost::alloc::string::String>,
7126}
7127#[non_exhaustive]
7134#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7135pub struct PasskeyAuthenticator {
7136 #[prost(bytes = "bytes", optional, tag = "1")]
7141 pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
7142 #[prost(string, optional, tag = "2")]
7147 pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
7148 #[prost(message, optional, tag = "3")]
7150 pub signature: ::core::option::Option<SimpleSignature>,
7151}
7152#[non_exhaustive]
7154#[derive(Clone, PartialEq, ::prost::Message)]
7155pub struct ValidatorCommittee {
7156 #[prost(uint64, optional, tag = "1")]
7158 pub epoch: ::core::option::Option<u64>,
7159 #[prost(message, repeated, tag = "2")]
7161 pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
7162}
7163#[non_exhaustive]
7165#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7166pub struct ValidatorCommitteeMember {
7167 #[prost(bytes = "bytes", optional, tag = "1")]
7169 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
7170 #[prost(uint64, optional, tag = "2")]
7172 pub weight: ::core::option::Option<u64>,
7173}
7174#[non_exhaustive]
7176#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7177pub struct ValidatorAggregatedSignature {
7178 #[prost(uint64, optional, tag = "1")]
7183 pub epoch: ::core::option::Option<u64>,
7184 #[prost(bytes = "bytes", optional, tag = "2")]
7186 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
7187 #[prost(bytes = "bytes", optional, tag = "3")]
7190 pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
7191}
7192#[non_exhaustive]
7199#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
7200#[repr(i32)]
7201pub enum SignatureScheme {
7202 Ed25519 = 0,
7203 Secp256k1 = 1,
7204 Secp256r1 = 2,
7205 Multisig = 3,
7206 Bls12381 = 4,
7207 Zklogin = 5,
7208 Passkey = 6,
7209 Mldsa65 = 7,
7210}
7211impl SignatureScheme {
7212 pub fn as_str_name(&self) -> &'static str {
7217 match self {
7218 Self::Ed25519 => "ED25519",
7219 Self::Secp256k1 => "SECP256K1",
7220 Self::Secp256r1 => "SECP256R1",
7221 Self::Multisig => "MULTISIG",
7222 Self::Bls12381 => "BLS12381",
7223 Self::Zklogin => "ZKLOGIN",
7224 Self::Passkey => "PASSKEY",
7225 Self::Mldsa65 => "MLDSA65",
7226 }
7227 }
7228 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7230 match value {
7231 "ED25519" => Some(Self::Ed25519),
7232 "SECP256K1" => Some(Self::Secp256k1),
7233 "SECP256R1" => Some(Self::Secp256r1),
7234 "MULTISIG" => Some(Self::Multisig),
7235 "BLS12381" => Some(Self::Bls12381),
7236 "ZKLOGIN" => Some(Self::Zklogin),
7237 "PASSKEY" => Some(Self::Passkey),
7238 "MLDSA65" => Some(Self::Mldsa65),
7239 _ => None,
7240 }
7241 }
7242}
7243#[non_exhaustive]
7244#[derive(Clone, PartialEq, ::prost::Message)]
7245pub struct VerifySignatureRequest {
7246 #[prost(message, optional, tag = "1")]
7252 pub message: ::core::option::Option<Bcs>,
7253 #[prost(message, optional, tag = "2")]
7255 pub signature: ::core::option::Option<UserSignature>,
7256 #[prost(string, optional, tag = "3")]
7262 pub address: ::core::option::Option<::prost::alloc::string::String>,
7263 #[prost(message, repeated, tag = "4")]
7266 pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
7267 #[prost(bool, optional, tag = "6")]
7275 pub check_address_aliases: ::core::option::Option<bool>,
7276}
7277#[non_exhaustive]
7278#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7279pub struct VerifySignatureResponse {
7280 #[prost(bool, optional, tag = "1")]
7282 pub is_valid: ::core::option::Option<bool>,
7283 #[prost(string, optional, tag = "2")]
7285 pub reason: ::core::option::Option<::prost::alloc::string::String>,
7286 #[prost(bool, optional, tag = "3")]
7289 pub address_aliases_checked: ::core::option::Option<bool>,
7290}
7291pub mod signature_verification_service_client {
7293 #![allow(
7294 unused_variables,
7295 dead_code,
7296 missing_docs,
7297 clippy::wildcard_imports,
7298 clippy::let_unit_value,
7299 )]
7300 use tonic::codegen::*;
7301 use tonic::codegen::http::Uri;
7302 #[derive(Debug, Clone)]
7303 pub struct SignatureVerificationServiceClient<T> {
7304 inner: tonic::client::Grpc<T>,
7305 }
7306 impl SignatureVerificationServiceClient<tonic::transport::Channel> {
7307 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7309 where
7310 D: TryInto<tonic::transport::Endpoint>,
7311 D::Error: Into<StdError>,
7312 {
7313 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7314 Ok(Self::new(conn))
7315 }
7316 }
7317 impl<T> SignatureVerificationServiceClient<T>
7318 where
7319 T: tonic::client::GrpcService<tonic::body::Body>,
7320 T::Error: Into<StdError>,
7321 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7322 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7323 {
7324 pub fn new(inner: T) -> Self {
7325 let inner = tonic::client::Grpc::new(inner);
7326 Self { inner }
7327 }
7328 pub fn with_origin(inner: T, origin: Uri) -> Self {
7329 let inner = tonic::client::Grpc::with_origin(inner, origin);
7330 Self { inner }
7331 }
7332 pub fn with_interceptor<F>(
7333 inner: T,
7334 interceptor: F,
7335 ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
7336 where
7337 F: tonic::service::Interceptor,
7338 T::ResponseBody: Default,
7339 T: tonic::codegen::Service<
7340 http::Request<tonic::body::Body>,
7341 Response = http::Response<
7342 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7343 >,
7344 >,
7345 <T as tonic::codegen::Service<
7346 http::Request<tonic::body::Body>,
7347 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7348 {
7349 SignatureVerificationServiceClient::new(
7350 InterceptedService::new(inner, interceptor),
7351 )
7352 }
7353 #[must_use]
7358 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7359 self.inner = self.inner.send_compressed(encoding);
7360 self
7361 }
7362 #[must_use]
7364 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7365 self.inner = self.inner.accept_compressed(encoding);
7366 self
7367 }
7368 #[must_use]
7372 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7373 self.inner = self.inner.max_decoding_message_size(limit);
7374 self
7375 }
7376 #[must_use]
7380 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7381 self.inner = self.inner.max_encoding_message_size(limit);
7382 self
7383 }
7384 pub async fn verify_signature(
7386 &mut self,
7387 request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
7388 ) -> std::result::Result<
7389 tonic::Response<super::VerifySignatureResponse>,
7390 tonic::Status,
7391 > {
7392 self.inner
7393 .ready()
7394 .await
7395 .map_err(|e| {
7396 tonic::Status::unknown(
7397 format!("Service was not ready: {}", e.into()),
7398 )
7399 })?;
7400 let codec = tonic_prost::ProstCodec::default();
7401 let path = http::uri::PathAndQuery::from_static(
7402 "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
7403 );
7404 let mut req = request.into_request();
7405 req.extensions_mut()
7406 .insert(
7407 GrpcMethod::new(
7408 "sui.rpc.v2.SignatureVerificationService",
7409 "VerifySignature",
7410 ),
7411 );
7412 self.inner.unary(req, path, codec).await
7413 }
7414 }
7415}
7416pub mod signature_verification_service_server {
7418 #![allow(
7419 unused_variables,
7420 dead_code,
7421 missing_docs,
7422 clippy::wildcard_imports,
7423 clippy::let_unit_value,
7424 )]
7425 use tonic::codegen::*;
7426 #[async_trait]
7428 pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
7429 async fn verify_signature(
7431 &self,
7432 request: tonic::Request<super::VerifySignatureRequest>,
7433 ) -> std::result::Result<
7434 tonic::Response<super::VerifySignatureResponse>,
7435 tonic::Status,
7436 > {
7437 Err(tonic::Status::unimplemented("Not yet implemented"))
7438 }
7439 }
7440 #[derive(Debug)]
7441 pub struct SignatureVerificationServiceServer<T> {
7442 inner: Arc<T>,
7443 accept_compression_encodings: EnabledCompressionEncodings,
7444 send_compression_encodings: EnabledCompressionEncodings,
7445 max_decoding_message_size: Option<usize>,
7446 max_encoding_message_size: Option<usize>,
7447 }
7448 impl<T> SignatureVerificationServiceServer<T> {
7449 pub fn new(inner: T) -> Self {
7450 Self::from_arc(Arc::new(inner))
7451 }
7452 pub fn from_arc(inner: Arc<T>) -> Self {
7453 Self {
7454 inner,
7455 accept_compression_encodings: Default::default(),
7456 send_compression_encodings: Default::default(),
7457 max_decoding_message_size: None,
7458 max_encoding_message_size: None,
7459 }
7460 }
7461 pub fn with_interceptor<F>(
7462 inner: T,
7463 interceptor: F,
7464 ) -> InterceptedService<Self, F>
7465 where
7466 F: tonic::service::Interceptor,
7467 {
7468 InterceptedService::new(Self::new(inner), interceptor)
7469 }
7470 #[must_use]
7472 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7473 self.accept_compression_encodings.enable(encoding);
7474 self
7475 }
7476 #[must_use]
7478 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7479 self.send_compression_encodings.enable(encoding);
7480 self
7481 }
7482 #[must_use]
7486 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7487 self.max_decoding_message_size = Some(limit);
7488 self
7489 }
7490 #[must_use]
7494 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7495 self.max_encoding_message_size = Some(limit);
7496 self
7497 }
7498 }
7499 impl<T, B> tonic::codegen::Service<http::Request<B>>
7500 for SignatureVerificationServiceServer<T>
7501 where
7502 T: SignatureVerificationService,
7503 B: Body + std::marker::Send + 'static,
7504 B::Error: Into<StdError> + std::marker::Send + 'static,
7505 {
7506 type Response = http::Response<tonic::body::Body>;
7507 type Error = std::convert::Infallible;
7508 type Future = BoxFuture<Self::Response, Self::Error>;
7509 fn poll_ready(
7510 &mut self,
7511 _cx: &mut Context<'_>,
7512 ) -> Poll<std::result::Result<(), Self::Error>> {
7513 Poll::Ready(Ok(()))
7514 }
7515 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7516 match req.uri().path() {
7517 "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
7518 #[allow(non_camel_case_types)]
7519 struct VerifySignatureSvc<T: SignatureVerificationService>(
7520 pub Arc<T>,
7521 );
7522 impl<
7523 T: SignatureVerificationService,
7524 > tonic::server::UnaryService<super::VerifySignatureRequest>
7525 for VerifySignatureSvc<T> {
7526 type Response = super::VerifySignatureResponse;
7527 type Future = BoxFuture<
7528 tonic::Response<Self::Response>,
7529 tonic::Status,
7530 >;
7531 fn call(
7532 &mut self,
7533 request: tonic::Request<super::VerifySignatureRequest>,
7534 ) -> Self::Future {
7535 let inner = Arc::clone(&self.0);
7536 let fut = async move {
7537 <T as SignatureVerificationService>::verify_signature(
7538 &inner,
7539 request,
7540 )
7541 .await
7542 };
7543 Box::pin(fut)
7544 }
7545 }
7546 let accept_compression_encodings = self.accept_compression_encodings;
7547 let send_compression_encodings = self.send_compression_encodings;
7548 let max_decoding_message_size = self.max_decoding_message_size;
7549 let max_encoding_message_size = self.max_encoding_message_size;
7550 let inner = self.inner.clone();
7551 let fut = async move {
7552 let method = VerifySignatureSvc(inner);
7553 let codec = tonic_prost::ProstCodec::default();
7554 let mut grpc = tonic::server::Grpc::new(codec)
7555 .apply_compression_config(
7556 accept_compression_encodings,
7557 send_compression_encodings,
7558 )
7559 .apply_max_message_size_config(
7560 max_decoding_message_size,
7561 max_encoding_message_size,
7562 );
7563 let res = grpc.unary(method, req).await;
7564 Ok(res)
7565 };
7566 Box::pin(fut)
7567 }
7568 _ => {
7569 Box::pin(async move {
7570 let mut response = http::Response::new(
7571 tonic::body::Body::default(),
7572 );
7573 let headers = response.headers_mut();
7574 headers
7575 .insert(
7576 tonic::Status::GRPC_STATUS,
7577 (tonic::Code::Unimplemented as i32).into(),
7578 );
7579 headers
7580 .insert(
7581 http::header::CONTENT_TYPE,
7582 tonic::metadata::GRPC_CONTENT_TYPE,
7583 );
7584 Ok(response)
7585 })
7586 }
7587 }
7588 }
7589 }
7590 impl<T> Clone for SignatureVerificationServiceServer<T> {
7591 fn clone(&self) -> Self {
7592 let inner = self.inner.clone();
7593 Self {
7594 inner,
7595 accept_compression_encodings: self.accept_compression_encodings,
7596 send_compression_encodings: self.send_compression_encodings,
7597 max_decoding_message_size: self.max_decoding_message_size,
7598 max_encoding_message_size: self.max_encoding_message_size,
7599 }
7600 }
7601 }
7602 pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
7604 impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
7605 const NAME: &'static str = SERVICE_NAME;
7606 }
7607}
7608#[non_exhaustive]
7610#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7611pub struct GetCoinInfoRequest {
7612 #[prost(string, optional, tag = "1")]
7614 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
7615}
7616#[non_exhaustive]
7618#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7619pub struct GetCoinInfoResponse {
7620 #[prost(string, optional, tag = "1")]
7622 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
7623 #[prost(message, optional, tag = "2")]
7626 pub metadata: ::core::option::Option<CoinMetadata>,
7627 #[prost(message, optional, tag = "3")]
7630 pub treasury: ::core::option::Option<CoinTreasury>,
7631 #[prost(message, optional, tag = "4")]
7639 pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
7640}
7641#[non_exhaustive]
7643#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7644pub struct CoinMetadata {
7645 #[prost(string, optional, tag = "1")]
7648 pub id: ::core::option::Option<::prost::alloc::string::String>,
7649 #[prost(uint32, optional, tag = "2")]
7651 pub decimals: ::core::option::Option<u32>,
7652 #[prost(string, optional, tag = "3")]
7654 pub name: ::core::option::Option<::prost::alloc::string::String>,
7655 #[prost(string, optional, tag = "4")]
7657 pub symbol: ::core::option::Option<::prost::alloc::string::String>,
7658 #[prost(string, optional, tag = "5")]
7660 pub description: ::core::option::Option<::prost::alloc::string::String>,
7661 #[prost(string, optional, tag = "6")]
7663 pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
7664 #[prost(string, optional, tag = "7")]
7668 pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
7669 #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
7671 pub metadata_cap_state: ::core::option::Option<i32>,
7672}
7673pub mod coin_metadata {
7675 #[non_exhaustive]
7677 #[derive(
7678 Clone,
7679 Copy,
7680 Debug,
7681 PartialEq,
7682 Eq,
7683 Hash,
7684 PartialOrd,
7685 Ord,
7686 ::prost::Enumeration
7687 )]
7688 #[repr(i32)]
7689 pub enum MetadataCapState {
7690 Unknown = 0,
7693 Claimed = 1,
7695 Unclaimed = 2,
7697 Deleted = 3,
7699 }
7700 impl MetadataCapState {
7701 pub fn as_str_name(&self) -> &'static str {
7706 match self {
7707 Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
7708 Self::Claimed => "CLAIMED",
7709 Self::Unclaimed => "UNCLAIMED",
7710 Self::Deleted => "DELETED",
7711 }
7712 }
7713 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7715 match value {
7716 "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
7717 "CLAIMED" => Some(Self::Claimed),
7718 "UNCLAIMED" => Some(Self::Unclaimed),
7719 "DELETED" => Some(Self::Deleted),
7720 _ => None,
7721 }
7722 }
7723 }
7724}
7725#[non_exhaustive]
7727#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7728pub struct CoinTreasury {
7729 #[prost(string, optional, tag = "1")]
7731 pub id: ::core::option::Option<::prost::alloc::string::String>,
7732 #[prost(uint64, optional, tag = "2")]
7734 pub total_supply: ::core::option::Option<u64>,
7735 #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
7737 pub supply_state: ::core::option::Option<i32>,
7738}
7739pub mod coin_treasury {
7741 #[non_exhaustive]
7743 #[derive(
7744 Clone,
7745 Copy,
7746 Debug,
7747 PartialEq,
7748 Eq,
7749 Hash,
7750 PartialOrd,
7751 Ord,
7752 ::prost::Enumeration
7753 )]
7754 #[repr(i32)]
7755 pub enum SupplyState {
7756 Unknown = 0,
7758 Fixed = 1,
7760 BurnOnly = 2,
7762 }
7763 impl SupplyState {
7764 pub fn as_str_name(&self) -> &'static str {
7769 match self {
7770 Self::Unknown => "SUPPLY_STATE_UNKNOWN",
7771 Self::Fixed => "FIXED",
7772 Self::BurnOnly => "BURN_ONLY",
7773 }
7774 }
7775 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7777 match value {
7778 "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
7779 "FIXED" => Some(Self::Fixed),
7780 "BURN_ONLY" => Some(Self::BurnOnly),
7781 _ => None,
7782 }
7783 }
7784 }
7785}
7786#[non_exhaustive]
7788#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7789pub struct RegulatedCoinMetadata {
7790 #[prost(string, optional, tag = "1")]
7793 pub id: ::core::option::Option<::prost::alloc::string::String>,
7794 #[prost(string, optional, tag = "2")]
7796 pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
7797 #[prost(string, optional, tag = "3")]
7799 pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
7800 #[prost(bool, optional, tag = "4")]
7802 pub allow_global_pause: ::core::option::Option<bool>,
7803 #[prost(uint32, optional, tag = "5")]
7805 pub variant: ::core::option::Option<u32>,
7806 #[prost(
7808 enumeration = "regulated_coin_metadata::CoinRegulatedState",
7809 optional,
7810 tag = "6"
7811 )]
7812 pub coin_regulated_state: ::core::option::Option<i32>,
7813}
7814pub mod regulated_coin_metadata {
7816 #[non_exhaustive]
7818 #[derive(
7819 Clone,
7820 Copy,
7821 Debug,
7822 PartialEq,
7823 Eq,
7824 Hash,
7825 PartialOrd,
7826 Ord,
7827 ::prost::Enumeration
7828 )]
7829 #[repr(i32)]
7830 pub enum CoinRegulatedState {
7831 Unknown = 0,
7836 Regulated = 1,
7838 Unregulated = 2,
7840 }
7841 impl CoinRegulatedState {
7842 pub fn as_str_name(&self) -> &'static str {
7847 match self {
7848 Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
7849 Self::Regulated => "REGULATED",
7850 Self::Unregulated => "UNREGULATED",
7851 }
7852 }
7853 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7855 match value {
7856 "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
7857 "REGULATED" => Some(Self::Regulated),
7858 "UNREGULATED" => Some(Self::Unregulated),
7859 _ => None,
7860 }
7861 }
7862 }
7863}
7864#[non_exhaustive]
7866#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7867pub struct GetBalanceRequest {
7868 #[prost(string, optional, tag = "1")]
7870 pub owner: ::core::option::Option<::prost::alloc::string::String>,
7871 #[prost(string, optional, tag = "2")]
7873 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
7874}
7875#[non_exhaustive]
7878#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7879pub struct GetBalanceResponse {
7880 #[prost(message, optional, tag = "1")]
7882 pub balance: ::core::option::Option<Balance>,
7883}
7884#[non_exhaustive]
7886#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7887pub struct ListBalancesRequest {
7888 #[prost(string, optional, tag = "1")]
7890 pub owner: ::core::option::Option<::prost::alloc::string::String>,
7891 #[prost(uint32, optional, tag = "2")]
7895 pub page_size: ::core::option::Option<u32>,
7896 #[prost(bytes = "bytes", optional, tag = "3")]
7902 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
7903}
7904#[non_exhaustive]
7907#[derive(Clone, PartialEq, ::prost::Message)]
7908pub struct ListBalancesResponse {
7909 #[prost(message, repeated, tag = "1")]
7911 pub balances: ::prost::alloc::vec::Vec<Balance>,
7912 #[prost(bytes = "bytes", optional, tag = "2")]
7915 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
7916}
7917#[non_exhaustive]
7919#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7920pub struct Balance {
7921 #[prost(string, optional, tag = "1")]
7923 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
7924 #[prost(uint64, optional, tag = "3")]
7928 pub balance: ::core::option::Option<u64>,
7929 #[prost(uint64, optional, tag = "4")]
7931 pub address_balance: ::core::option::Option<u64>,
7932 #[prost(uint64, optional, tag = "5")]
7934 pub coin_balance: ::core::option::Option<u64>,
7935}
7936#[non_exhaustive]
7938#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7939pub struct ListDynamicFieldsRequest {
7940 #[prost(string, optional, tag = "1")]
7942 pub parent: ::core::option::Option<::prost::alloc::string::String>,
7943 #[prost(uint32, optional, tag = "2")]
7947 pub page_size: ::core::option::Option<u32>,
7948 #[prost(bytes = "bytes", optional, tag = "3")]
7954 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
7955 #[prost(message, optional, tag = "4")]
7958 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7959}
7960#[non_exhaustive]
7962#[derive(Clone, PartialEq, ::prost::Message)]
7963pub struct ListDynamicFieldsResponse {
7964 #[prost(message, repeated, tag = "1")]
7966 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
7967 #[prost(bytes = "bytes", optional, tag = "2")]
7970 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
7971}
7972#[non_exhaustive]
7973#[derive(Clone, PartialEq, ::prost::Message)]
7974pub struct DynamicField {
7975 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
7976 pub kind: ::core::option::Option<i32>,
7977 #[prost(string, optional, tag = "2")]
7979 pub parent: ::core::option::Option<::prost::alloc::string::String>,
7980 #[prost(string, optional, tag = "3")]
7982 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
7983 #[prost(message, optional, tag = "4")]
7985 pub field_object: ::core::option::Option<Object>,
7986 #[prost(message, optional, tag = "5")]
7988 pub name: ::core::option::Option<Bcs>,
7989 #[prost(message, optional, tag = "6")]
7991 pub value: ::core::option::Option<Bcs>,
7992 #[prost(string, optional, tag = "7")]
7998 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
7999 #[prost(string, optional, tag = "8")]
8005 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
8006 #[prost(message, optional, tag = "9")]
8008 pub child_object: ::core::option::Option<Object>,
8009}
8010pub mod dynamic_field {
8012 #[non_exhaustive]
8013 #[derive(
8014 Clone,
8015 Copy,
8016 Debug,
8017 PartialEq,
8018 Eq,
8019 Hash,
8020 PartialOrd,
8021 Ord,
8022 ::prost::Enumeration
8023 )]
8024 #[repr(i32)]
8025 pub enum DynamicFieldKind {
8026 Unknown = 0,
8027 Field = 1,
8028 Object = 2,
8029 }
8030 impl DynamicFieldKind {
8031 pub fn as_str_name(&self) -> &'static str {
8036 match self {
8037 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
8038 Self::Field => "FIELD",
8039 Self::Object => "OBJECT",
8040 }
8041 }
8042 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8044 match value {
8045 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
8046 "FIELD" => Some(Self::Field),
8047 "OBJECT" => Some(Self::Object),
8048 _ => None,
8049 }
8050 }
8051 }
8052}
8053#[non_exhaustive]
8054#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8055pub struct ListOwnedObjectsRequest {
8056 #[prost(string, optional, tag = "1")]
8058 pub owner: ::core::option::Option<::prost::alloc::string::String>,
8059 #[prost(uint32, optional, tag = "2")]
8063 pub page_size: ::core::option::Option<u32>,
8064 #[prost(bytes = "bytes", optional, tag = "3")]
8070 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
8071 #[prost(message, optional, tag = "4")]
8074 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
8075 #[prost(string, optional, tag = "5")]
8084 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
8085}
8086#[non_exhaustive]
8087#[derive(Clone, PartialEq, ::prost::Message)]
8088pub struct ListOwnedObjectsResponse {
8089 #[prost(message, repeated, tag = "1")]
8091 pub objects: ::prost::alloc::vec::Vec<Object>,
8092 #[prost(bytes = "bytes", optional, tag = "2")]
8095 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
8096}
8097pub mod state_service_client {
8099 #![allow(
8100 unused_variables,
8101 dead_code,
8102 missing_docs,
8103 clippy::wildcard_imports,
8104 clippy::let_unit_value,
8105 )]
8106 use tonic::codegen::*;
8107 use tonic::codegen::http::Uri;
8108 #[derive(Debug, Clone)]
8109 pub struct StateServiceClient<T> {
8110 inner: tonic::client::Grpc<T>,
8111 }
8112 impl StateServiceClient<tonic::transport::Channel> {
8113 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8115 where
8116 D: TryInto<tonic::transport::Endpoint>,
8117 D::Error: Into<StdError>,
8118 {
8119 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8120 Ok(Self::new(conn))
8121 }
8122 }
8123 impl<T> StateServiceClient<T>
8124 where
8125 T: tonic::client::GrpcService<tonic::body::Body>,
8126 T::Error: Into<StdError>,
8127 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8128 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8129 {
8130 pub fn new(inner: T) -> Self {
8131 let inner = tonic::client::Grpc::new(inner);
8132 Self { inner }
8133 }
8134 pub fn with_origin(inner: T, origin: Uri) -> Self {
8135 let inner = tonic::client::Grpc::with_origin(inner, origin);
8136 Self { inner }
8137 }
8138 pub fn with_interceptor<F>(
8139 inner: T,
8140 interceptor: F,
8141 ) -> StateServiceClient<InterceptedService<T, F>>
8142 where
8143 F: tonic::service::Interceptor,
8144 T::ResponseBody: Default,
8145 T: tonic::codegen::Service<
8146 http::Request<tonic::body::Body>,
8147 Response = http::Response<
8148 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8149 >,
8150 >,
8151 <T as tonic::codegen::Service<
8152 http::Request<tonic::body::Body>,
8153 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8154 {
8155 StateServiceClient::new(InterceptedService::new(inner, interceptor))
8156 }
8157 #[must_use]
8162 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8163 self.inner = self.inner.send_compressed(encoding);
8164 self
8165 }
8166 #[must_use]
8168 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8169 self.inner = self.inner.accept_compressed(encoding);
8170 self
8171 }
8172 #[must_use]
8176 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8177 self.inner = self.inner.max_decoding_message_size(limit);
8178 self
8179 }
8180 #[must_use]
8184 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8185 self.inner = self.inner.max_encoding_message_size(limit);
8186 self
8187 }
8188 pub async fn list_dynamic_fields(
8189 &mut self,
8190 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
8191 ) -> std::result::Result<
8192 tonic::Response<super::ListDynamicFieldsResponse>,
8193 tonic::Status,
8194 > {
8195 self.inner
8196 .ready()
8197 .await
8198 .map_err(|e| {
8199 tonic::Status::unknown(
8200 format!("Service was not ready: {}", e.into()),
8201 )
8202 })?;
8203 let codec = tonic_prost::ProstCodec::default();
8204 let path = http::uri::PathAndQuery::from_static(
8205 "/sui.rpc.v2.StateService/ListDynamicFields",
8206 );
8207 let mut req = request.into_request();
8208 req.extensions_mut()
8209 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
8210 self.inner.unary(req, path, codec).await
8211 }
8212 pub async fn list_owned_objects(
8213 &mut self,
8214 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
8215 ) -> std::result::Result<
8216 tonic::Response<super::ListOwnedObjectsResponse>,
8217 tonic::Status,
8218 > {
8219 self.inner
8220 .ready()
8221 .await
8222 .map_err(|e| {
8223 tonic::Status::unknown(
8224 format!("Service was not ready: {}", e.into()),
8225 )
8226 })?;
8227 let codec = tonic_prost::ProstCodec::default();
8228 let path = http::uri::PathAndQuery::from_static(
8229 "/sui.rpc.v2.StateService/ListOwnedObjects",
8230 );
8231 let mut req = request.into_request();
8232 req.extensions_mut()
8233 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
8234 self.inner.unary(req, path, codec).await
8235 }
8236 pub async fn get_coin_info(
8237 &mut self,
8238 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
8239 ) -> std::result::Result<
8240 tonic::Response<super::GetCoinInfoResponse>,
8241 tonic::Status,
8242 > {
8243 self.inner
8244 .ready()
8245 .await
8246 .map_err(|e| {
8247 tonic::Status::unknown(
8248 format!("Service was not ready: {}", e.into()),
8249 )
8250 })?;
8251 let codec = tonic_prost::ProstCodec::default();
8252 let path = http::uri::PathAndQuery::from_static(
8253 "/sui.rpc.v2.StateService/GetCoinInfo",
8254 );
8255 let mut req = request.into_request();
8256 req.extensions_mut()
8257 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
8258 self.inner.unary(req, path, codec).await
8259 }
8260 pub async fn get_balance(
8261 &mut self,
8262 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
8263 ) -> std::result::Result<
8264 tonic::Response<super::GetBalanceResponse>,
8265 tonic::Status,
8266 > {
8267 self.inner
8268 .ready()
8269 .await
8270 .map_err(|e| {
8271 tonic::Status::unknown(
8272 format!("Service was not ready: {}", e.into()),
8273 )
8274 })?;
8275 let codec = tonic_prost::ProstCodec::default();
8276 let path = http::uri::PathAndQuery::from_static(
8277 "/sui.rpc.v2.StateService/GetBalance",
8278 );
8279 let mut req = request.into_request();
8280 req.extensions_mut()
8281 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
8282 self.inner.unary(req, path, codec).await
8283 }
8284 pub async fn list_balances(
8285 &mut self,
8286 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
8287 ) -> std::result::Result<
8288 tonic::Response<super::ListBalancesResponse>,
8289 tonic::Status,
8290 > {
8291 self.inner
8292 .ready()
8293 .await
8294 .map_err(|e| {
8295 tonic::Status::unknown(
8296 format!("Service was not ready: {}", e.into()),
8297 )
8298 })?;
8299 let codec = tonic_prost::ProstCodec::default();
8300 let path = http::uri::PathAndQuery::from_static(
8301 "/sui.rpc.v2.StateService/ListBalances",
8302 );
8303 let mut req = request.into_request();
8304 req.extensions_mut()
8305 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
8306 self.inner.unary(req, path, codec).await
8307 }
8308 }
8309}
8310pub mod state_service_server {
8312 #![allow(
8313 unused_variables,
8314 dead_code,
8315 missing_docs,
8316 clippy::wildcard_imports,
8317 clippy::let_unit_value,
8318 )]
8319 use tonic::codegen::*;
8320 #[async_trait]
8322 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
8323 async fn list_dynamic_fields(
8324 &self,
8325 request: tonic::Request<super::ListDynamicFieldsRequest>,
8326 ) -> std::result::Result<
8327 tonic::Response<super::ListDynamicFieldsResponse>,
8328 tonic::Status,
8329 > {
8330 Err(tonic::Status::unimplemented("Not yet implemented"))
8331 }
8332 async fn list_owned_objects(
8333 &self,
8334 request: tonic::Request<super::ListOwnedObjectsRequest>,
8335 ) -> std::result::Result<
8336 tonic::Response<super::ListOwnedObjectsResponse>,
8337 tonic::Status,
8338 > {
8339 Err(tonic::Status::unimplemented("Not yet implemented"))
8340 }
8341 async fn get_coin_info(
8342 &self,
8343 request: tonic::Request<super::GetCoinInfoRequest>,
8344 ) -> std::result::Result<
8345 tonic::Response<super::GetCoinInfoResponse>,
8346 tonic::Status,
8347 > {
8348 Err(tonic::Status::unimplemented("Not yet implemented"))
8349 }
8350 async fn get_balance(
8351 &self,
8352 request: tonic::Request<super::GetBalanceRequest>,
8353 ) -> std::result::Result<
8354 tonic::Response<super::GetBalanceResponse>,
8355 tonic::Status,
8356 > {
8357 Err(tonic::Status::unimplemented("Not yet implemented"))
8358 }
8359 async fn list_balances(
8360 &self,
8361 request: tonic::Request<super::ListBalancesRequest>,
8362 ) -> std::result::Result<
8363 tonic::Response<super::ListBalancesResponse>,
8364 tonic::Status,
8365 > {
8366 Err(tonic::Status::unimplemented("Not yet implemented"))
8367 }
8368 }
8369 #[derive(Debug)]
8370 pub struct StateServiceServer<T> {
8371 inner: Arc<T>,
8372 accept_compression_encodings: EnabledCompressionEncodings,
8373 send_compression_encodings: EnabledCompressionEncodings,
8374 max_decoding_message_size: Option<usize>,
8375 max_encoding_message_size: Option<usize>,
8376 }
8377 impl<T> StateServiceServer<T> {
8378 pub fn new(inner: T) -> Self {
8379 Self::from_arc(Arc::new(inner))
8380 }
8381 pub fn from_arc(inner: Arc<T>) -> Self {
8382 Self {
8383 inner,
8384 accept_compression_encodings: Default::default(),
8385 send_compression_encodings: Default::default(),
8386 max_decoding_message_size: None,
8387 max_encoding_message_size: None,
8388 }
8389 }
8390 pub fn with_interceptor<F>(
8391 inner: T,
8392 interceptor: F,
8393 ) -> InterceptedService<Self, F>
8394 where
8395 F: tonic::service::Interceptor,
8396 {
8397 InterceptedService::new(Self::new(inner), interceptor)
8398 }
8399 #[must_use]
8401 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8402 self.accept_compression_encodings.enable(encoding);
8403 self
8404 }
8405 #[must_use]
8407 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8408 self.send_compression_encodings.enable(encoding);
8409 self
8410 }
8411 #[must_use]
8415 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8416 self.max_decoding_message_size = Some(limit);
8417 self
8418 }
8419 #[must_use]
8423 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8424 self.max_encoding_message_size = Some(limit);
8425 self
8426 }
8427 }
8428 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
8429 where
8430 T: StateService,
8431 B: Body + std::marker::Send + 'static,
8432 B::Error: Into<StdError> + std::marker::Send + 'static,
8433 {
8434 type Response = http::Response<tonic::body::Body>;
8435 type Error = std::convert::Infallible;
8436 type Future = BoxFuture<Self::Response, Self::Error>;
8437 fn poll_ready(
8438 &mut self,
8439 _cx: &mut Context<'_>,
8440 ) -> Poll<std::result::Result<(), Self::Error>> {
8441 Poll::Ready(Ok(()))
8442 }
8443 fn call(&mut self, req: http::Request<B>) -> Self::Future {
8444 match req.uri().path() {
8445 "/sui.rpc.v2.StateService/ListDynamicFields" => {
8446 #[allow(non_camel_case_types)]
8447 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
8448 impl<
8449 T: StateService,
8450 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
8451 for ListDynamicFieldsSvc<T> {
8452 type Response = super::ListDynamicFieldsResponse;
8453 type Future = BoxFuture<
8454 tonic::Response<Self::Response>,
8455 tonic::Status,
8456 >;
8457 fn call(
8458 &mut self,
8459 request: tonic::Request<super::ListDynamicFieldsRequest>,
8460 ) -> Self::Future {
8461 let inner = Arc::clone(&self.0);
8462 let fut = async move {
8463 <T as StateService>::list_dynamic_fields(&inner, request)
8464 .await
8465 };
8466 Box::pin(fut)
8467 }
8468 }
8469 let accept_compression_encodings = self.accept_compression_encodings;
8470 let send_compression_encodings = self.send_compression_encodings;
8471 let max_decoding_message_size = self.max_decoding_message_size;
8472 let max_encoding_message_size = self.max_encoding_message_size;
8473 let inner = self.inner.clone();
8474 let fut = async move {
8475 let method = ListDynamicFieldsSvc(inner);
8476 let codec = tonic_prost::ProstCodec::default();
8477 let mut grpc = tonic::server::Grpc::new(codec)
8478 .apply_compression_config(
8479 accept_compression_encodings,
8480 send_compression_encodings,
8481 )
8482 .apply_max_message_size_config(
8483 max_decoding_message_size,
8484 max_encoding_message_size,
8485 );
8486 let res = grpc.unary(method, req).await;
8487 Ok(res)
8488 };
8489 Box::pin(fut)
8490 }
8491 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
8492 #[allow(non_camel_case_types)]
8493 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
8494 impl<
8495 T: StateService,
8496 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
8497 for ListOwnedObjectsSvc<T> {
8498 type Response = super::ListOwnedObjectsResponse;
8499 type Future = BoxFuture<
8500 tonic::Response<Self::Response>,
8501 tonic::Status,
8502 >;
8503 fn call(
8504 &mut self,
8505 request: tonic::Request<super::ListOwnedObjectsRequest>,
8506 ) -> Self::Future {
8507 let inner = Arc::clone(&self.0);
8508 let fut = async move {
8509 <T as StateService>::list_owned_objects(&inner, request)
8510 .await
8511 };
8512 Box::pin(fut)
8513 }
8514 }
8515 let accept_compression_encodings = self.accept_compression_encodings;
8516 let send_compression_encodings = self.send_compression_encodings;
8517 let max_decoding_message_size = self.max_decoding_message_size;
8518 let max_encoding_message_size = self.max_encoding_message_size;
8519 let inner = self.inner.clone();
8520 let fut = async move {
8521 let method = ListOwnedObjectsSvc(inner);
8522 let codec = tonic_prost::ProstCodec::default();
8523 let mut grpc = tonic::server::Grpc::new(codec)
8524 .apply_compression_config(
8525 accept_compression_encodings,
8526 send_compression_encodings,
8527 )
8528 .apply_max_message_size_config(
8529 max_decoding_message_size,
8530 max_encoding_message_size,
8531 );
8532 let res = grpc.unary(method, req).await;
8533 Ok(res)
8534 };
8535 Box::pin(fut)
8536 }
8537 "/sui.rpc.v2.StateService/GetCoinInfo" => {
8538 #[allow(non_camel_case_types)]
8539 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
8540 impl<
8541 T: StateService,
8542 > tonic::server::UnaryService<super::GetCoinInfoRequest>
8543 for GetCoinInfoSvc<T> {
8544 type Response = super::GetCoinInfoResponse;
8545 type Future = BoxFuture<
8546 tonic::Response<Self::Response>,
8547 tonic::Status,
8548 >;
8549 fn call(
8550 &mut self,
8551 request: tonic::Request<super::GetCoinInfoRequest>,
8552 ) -> Self::Future {
8553 let inner = Arc::clone(&self.0);
8554 let fut = async move {
8555 <T as StateService>::get_coin_info(&inner, request).await
8556 };
8557 Box::pin(fut)
8558 }
8559 }
8560 let accept_compression_encodings = self.accept_compression_encodings;
8561 let send_compression_encodings = self.send_compression_encodings;
8562 let max_decoding_message_size = self.max_decoding_message_size;
8563 let max_encoding_message_size = self.max_encoding_message_size;
8564 let inner = self.inner.clone();
8565 let fut = async move {
8566 let method = GetCoinInfoSvc(inner);
8567 let codec = tonic_prost::ProstCodec::default();
8568 let mut grpc = tonic::server::Grpc::new(codec)
8569 .apply_compression_config(
8570 accept_compression_encodings,
8571 send_compression_encodings,
8572 )
8573 .apply_max_message_size_config(
8574 max_decoding_message_size,
8575 max_encoding_message_size,
8576 );
8577 let res = grpc.unary(method, req).await;
8578 Ok(res)
8579 };
8580 Box::pin(fut)
8581 }
8582 "/sui.rpc.v2.StateService/GetBalance" => {
8583 #[allow(non_camel_case_types)]
8584 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
8585 impl<
8586 T: StateService,
8587 > tonic::server::UnaryService<super::GetBalanceRequest>
8588 for GetBalanceSvc<T> {
8589 type Response = super::GetBalanceResponse;
8590 type Future = BoxFuture<
8591 tonic::Response<Self::Response>,
8592 tonic::Status,
8593 >;
8594 fn call(
8595 &mut self,
8596 request: tonic::Request<super::GetBalanceRequest>,
8597 ) -> Self::Future {
8598 let inner = Arc::clone(&self.0);
8599 let fut = async move {
8600 <T as StateService>::get_balance(&inner, request).await
8601 };
8602 Box::pin(fut)
8603 }
8604 }
8605 let accept_compression_encodings = self.accept_compression_encodings;
8606 let send_compression_encodings = self.send_compression_encodings;
8607 let max_decoding_message_size = self.max_decoding_message_size;
8608 let max_encoding_message_size = self.max_encoding_message_size;
8609 let inner = self.inner.clone();
8610 let fut = async move {
8611 let method = GetBalanceSvc(inner);
8612 let codec = tonic_prost::ProstCodec::default();
8613 let mut grpc = tonic::server::Grpc::new(codec)
8614 .apply_compression_config(
8615 accept_compression_encodings,
8616 send_compression_encodings,
8617 )
8618 .apply_max_message_size_config(
8619 max_decoding_message_size,
8620 max_encoding_message_size,
8621 );
8622 let res = grpc.unary(method, req).await;
8623 Ok(res)
8624 };
8625 Box::pin(fut)
8626 }
8627 "/sui.rpc.v2.StateService/ListBalances" => {
8628 #[allow(non_camel_case_types)]
8629 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
8630 impl<
8631 T: StateService,
8632 > tonic::server::UnaryService<super::ListBalancesRequest>
8633 for ListBalancesSvc<T> {
8634 type Response = super::ListBalancesResponse;
8635 type Future = BoxFuture<
8636 tonic::Response<Self::Response>,
8637 tonic::Status,
8638 >;
8639 fn call(
8640 &mut self,
8641 request: tonic::Request<super::ListBalancesRequest>,
8642 ) -> Self::Future {
8643 let inner = Arc::clone(&self.0);
8644 let fut = async move {
8645 <T as StateService>::list_balances(&inner, request).await
8646 };
8647 Box::pin(fut)
8648 }
8649 }
8650 let accept_compression_encodings = self.accept_compression_encodings;
8651 let send_compression_encodings = self.send_compression_encodings;
8652 let max_decoding_message_size = self.max_decoding_message_size;
8653 let max_encoding_message_size = self.max_encoding_message_size;
8654 let inner = self.inner.clone();
8655 let fut = async move {
8656 let method = ListBalancesSvc(inner);
8657 let codec = tonic_prost::ProstCodec::default();
8658 let mut grpc = tonic::server::Grpc::new(codec)
8659 .apply_compression_config(
8660 accept_compression_encodings,
8661 send_compression_encodings,
8662 )
8663 .apply_max_message_size_config(
8664 max_decoding_message_size,
8665 max_encoding_message_size,
8666 );
8667 let res = grpc.unary(method, req).await;
8668 Ok(res)
8669 };
8670 Box::pin(fut)
8671 }
8672 _ => {
8673 Box::pin(async move {
8674 let mut response = http::Response::new(
8675 tonic::body::Body::default(),
8676 );
8677 let headers = response.headers_mut();
8678 headers
8679 .insert(
8680 tonic::Status::GRPC_STATUS,
8681 (tonic::Code::Unimplemented as i32).into(),
8682 );
8683 headers
8684 .insert(
8685 http::header::CONTENT_TYPE,
8686 tonic::metadata::GRPC_CONTENT_TYPE,
8687 );
8688 Ok(response)
8689 })
8690 }
8691 }
8692 }
8693 }
8694 impl<T> Clone for StateServiceServer<T> {
8695 fn clone(&self) -> Self {
8696 let inner = self.inner.clone();
8697 Self {
8698 inner,
8699 accept_compression_encodings: self.accept_compression_encodings,
8700 send_compression_encodings: self.send_compression_encodings,
8701 max_decoding_message_size: self.max_decoding_message_size,
8702 max_encoding_message_size: self.max_encoding_message_size,
8703 }
8704 }
8705 }
8706 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
8708 impl<T> tonic::server::NamedService for StateServiceServer<T> {
8709 const NAME: &'static str = SERVICE_NAME;
8710 }
8711}
8712#[derive(Eq, Hash)]
8714#[non_exhaustive]
8715#[derive(Clone, PartialEq, ::prost::Message)]
8716pub struct SubscribeCheckpointsRequest {
8717 #[prost(message, optional, tag = "1")]
8721 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
8722 #[prost(message, optional, tag = "2")]
8726 pub filter: ::core::option::Option<TransactionFilter>,
8727}
8728#[non_exhaustive]
8736#[derive(Clone, PartialEq, ::prost::Message)]
8737pub struct SubscribeCheckpointsResponse {
8738 #[prost(uint64, optional, tag = "1")]
8743 pub cursor: ::core::option::Option<u64>,
8744 #[prost(message, optional, tag = "2")]
8747 pub checkpoint: ::core::option::Option<Checkpoint>,
8748}
8749#[non_exhaustive]
8751#[derive(Clone, PartialEq, ::prost::Message)]
8752pub struct SubscribeTransactionsRequest {
8753 #[prost(message, optional, tag = "1")]
8756 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
8757 #[prost(message, optional, tag = "2")]
8760 pub filter: ::core::option::Option<TransactionFilter>,
8761}
8762#[non_exhaustive]
8767#[derive(Clone, PartialEq, ::prost::Message)]
8768pub struct SubscribeTransactionsResponse {
8769 #[prost(message, optional, tag = "1")]
8772 pub transaction: ::core::option::Option<ExecutedTransaction>,
8773 #[prost(message, optional, tag = "2")]
8775 pub watermark: ::core::option::Option<Watermark>,
8776}
8777#[non_exhaustive]
8779#[derive(Clone, PartialEq, ::prost::Message)]
8780pub struct SubscribeEventsRequest {
8781 #[prost(message, optional, tag = "1")]
8784 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
8785 #[prost(message, optional, tag = "2")]
8788 pub filter: ::core::option::Option<EventFilter>,
8789}
8790#[non_exhaustive]
8795#[derive(Clone, PartialEq, ::prost::Message)]
8796pub struct SubscribeEventsResponse {
8797 #[prost(message, optional, tag = "1")]
8802 pub event: ::core::option::Option<Event>,
8803 #[prost(message, optional, tag = "2")]
8805 pub watermark: ::core::option::Option<Watermark>,
8806}
8807pub mod subscription_service_client {
8809 #![allow(
8810 unused_variables,
8811 dead_code,
8812 missing_docs,
8813 clippy::wildcard_imports,
8814 clippy::let_unit_value,
8815 )]
8816 use tonic::codegen::*;
8817 use tonic::codegen::http::Uri;
8818 #[derive(Debug, Clone)]
8849 pub struct SubscriptionServiceClient<T> {
8850 inner: tonic::client::Grpc<T>,
8851 }
8852 impl SubscriptionServiceClient<tonic::transport::Channel> {
8853 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8855 where
8856 D: TryInto<tonic::transport::Endpoint>,
8857 D::Error: Into<StdError>,
8858 {
8859 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8860 Ok(Self::new(conn))
8861 }
8862 }
8863 impl<T> SubscriptionServiceClient<T>
8864 where
8865 T: tonic::client::GrpcService<tonic::body::Body>,
8866 T::Error: Into<StdError>,
8867 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8868 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8869 {
8870 pub fn new(inner: T) -> Self {
8871 let inner = tonic::client::Grpc::new(inner);
8872 Self { inner }
8873 }
8874 pub fn with_origin(inner: T, origin: Uri) -> Self {
8875 let inner = tonic::client::Grpc::with_origin(inner, origin);
8876 Self { inner }
8877 }
8878 pub fn with_interceptor<F>(
8879 inner: T,
8880 interceptor: F,
8881 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
8882 where
8883 F: tonic::service::Interceptor,
8884 T::ResponseBody: Default,
8885 T: tonic::codegen::Service<
8886 http::Request<tonic::body::Body>,
8887 Response = http::Response<
8888 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8889 >,
8890 >,
8891 <T as tonic::codegen::Service<
8892 http::Request<tonic::body::Body>,
8893 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8894 {
8895 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
8896 }
8897 #[must_use]
8902 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8903 self.inner = self.inner.send_compressed(encoding);
8904 self
8905 }
8906 #[must_use]
8908 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8909 self.inner = self.inner.accept_compressed(encoding);
8910 self
8911 }
8912 #[must_use]
8916 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8917 self.inner = self.inner.max_decoding_message_size(limit);
8918 self
8919 }
8920 #[must_use]
8924 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8925 self.inner = self.inner.max_encoding_message_size(limit);
8926 self
8927 }
8928 pub async fn subscribe_checkpoints(
8935 &mut self,
8936 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
8937 ) -> std::result::Result<
8938 tonic::Response<
8939 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
8940 >,
8941 tonic::Status,
8942 > {
8943 self.inner
8944 .ready()
8945 .await
8946 .map_err(|e| {
8947 tonic::Status::unknown(
8948 format!("Service was not ready: {}", e.into()),
8949 )
8950 })?;
8951 let codec = tonic_prost::ProstCodec::default();
8952 let path = http::uri::PathAndQuery::from_static(
8953 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
8954 );
8955 let mut req = request.into_request();
8956 req.extensions_mut()
8957 .insert(
8958 GrpcMethod::new(
8959 "sui.rpc.v2.SubscriptionService",
8960 "SubscribeCheckpoints",
8961 ),
8962 );
8963 self.inner.server_streaming(req, path, codec).await
8964 }
8965 pub async fn subscribe_transactions(
8970 &mut self,
8971 request: impl tonic::IntoRequest<super::SubscribeTransactionsRequest>,
8972 ) -> std::result::Result<
8973 tonic::Response<
8974 tonic::codec::Streaming<super::SubscribeTransactionsResponse>,
8975 >,
8976 tonic::Status,
8977 > {
8978 self.inner
8979 .ready()
8980 .await
8981 .map_err(|e| {
8982 tonic::Status::unknown(
8983 format!("Service was not ready: {}", e.into()),
8984 )
8985 })?;
8986 let codec = tonic_prost::ProstCodec::default();
8987 let path = http::uri::PathAndQuery::from_static(
8988 "/sui.rpc.v2.SubscriptionService/SubscribeTransactions",
8989 );
8990 let mut req = request.into_request();
8991 req.extensions_mut()
8992 .insert(
8993 GrpcMethod::new(
8994 "sui.rpc.v2.SubscriptionService",
8995 "SubscribeTransactions",
8996 ),
8997 );
8998 self.inner.server_streaming(req, path, codec).await
8999 }
9000 pub async fn subscribe_events(
9005 &mut self,
9006 request: impl tonic::IntoRequest<super::SubscribeEventsRequest>,
9007 ) -> std::result::Result<
9008 tonic::Response<tonic::codec::Streaming<super::SubscribeEventsResponse>>,
9009 tonic::Status,
9010 > {
9011 self.inner
9012 .ready()
9013 .await
9014 .map_err(|e| {
9015 tonic::Status::unknown(
9016 format!("Service was not ready: {}", e.into()),
9017 )
9018 })?;
9019 let codec = tonic_prost::ProstCodec::default();
9020 let path = http::uri::PathAndQuery::from_static(
9021 "/sui.rpc.v2.SubscriptionService/SubscribeEvents",
9022 );
9023 let mut req = request.into_request();
9024 req.extensions_mut()
9025 .insert(
9026 GrpcMethod::new("sui.rpc.v2.SubscriptionService", "SubscribeEvents"),
9027 );
9028 self.inner.server_streaming(req, path, codec).await
9029 }
9030 }
9031}
9032pub mod subscription_service_server {
9034 #![allow(
9035 unused_variables,
9036 dead_code,
9037 missing_docs,
9038 clippy::wildcard_imports,
9039 clippy::let_unit_value,
9040 )]
9041 use tonic::codegen::*;
9042 #[async_trait]
9044 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
9045 async fn subscribe_checkpoints(
9052 &self,
9053 request: tonic::Request<super::SubscribeCheckpointsRequest>,
9054 ) -> std::result::Result<
9055 tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
9056 tonic::Status,
9057 > {
9058 Err(tonic::Status::unimplemented("Not yet implemented"))
9059 }
9060 async fn subscribe_transactions(
9065 &self,
9066 request: tonic::Request<super::SubscribeTransactionsRequest>,
9067 ) -> std::result::Result<
9068 tonic::Response<BoxStream<super::SubscribeTransactionsResponse>>,
9069 tonic::Status,
9070 > {
9071 Err(tonic::Status::unimplemented("Not yet implemented"))
9072 }
9073 async fn subscribe_events(
9078 &self,
9079 request: tonic::Request<super::SubscribeEventsRequest>,
9080 ) -> std::result::Result<
9081 tonic::Response<BoxStream<super::SubscribeEventsResponse>>,
9082 tonic::Status,
9083 > {
9084 Err(tonic::Status::unimplemented("Not yet implemented"))
9085 }
9086 }
9087 #[derive(Debug)]
9118 pub struct SubscriptionServiceServer<T> {
9119 inner: Arc<T>,
9120 accept_compression_encodings: EnabledCompressionEncodings,
9121 send_compression_encodings: EnabledCompressionEncodings,
9122 max_decoding_message_size: Option<usize>,
9123 max_encoding_message_size: Option<usize>,
9124 }
9125 impl<T> SubscriptionServiceServer<T> {
9126 pub fn new(inner: T) -> Self {
9127 Self::from_arc(Arc::new(inner))
9128 }
9129 pub fn from_arc(inner: Arc<T>) -> Self {
9130 Self {
9131 inner,
9132 accept_compression_encodings: Default::default(),
9133 send_compression_encodings: Default::default(),
9134 max_decoding_message_size: None,
9135 max_encoding_message_size: None,
9136 }
9137 }
9138 pub fn with_interceptor<F>(
9139 inner: T,
9140 interceptor: F,
9141 ) -> InterceptedService<Self, F>
9142 where
9143 F: tonic::service::Interceptor,
9144 {
9145 InterceptedService::new(Self::new(inner), interceptor)
9146 }
9147 #[must_use]
9149 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9150 self.accept_compression_encodings.enable(encoding);
9151 self
9152 }
9153 #[must_use]
9155 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9156 self.send_compression_encodings.enable(encoding);
9157 self
9158 }
9159 #[must_use]
9163 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9164 self.max_decoding_message_size = Some(limit);
9165 self
9166 }
9167 #[must_use]
9171 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9172 self.max_encoding_message_size = Some(limit);
9173 self
9174 }
9175 }
9176 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
9177 where
9178 T: SubscriptionService,
9179 B: Body + std::marker::Send + 'static,
9180 B::Error: Into<StdError> + std::marker::Send + 'static,
9181 {
9182 type Response = http::Response<tonic::body::Body>;
9183 type Error = std::convert::Infallible;
9184 type Future = BoxFuture<Self::Response, Self::Error>;
9185 fn poll_ready(
9186 &mut self,
9187 _cx: &mut Context<'_>,
9188 ) -> Poll<std::result::Result<(), Self::Error>> {
9189 Poll::Ready(Ok(()))
9190 }
9191 fn call(&mut self, req: http::Request<B>) -> Self::Future {
9192 match req.uri().path() {
9193 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
9194 #[allow(non_camel_case_types)]
9195 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
9196 impl<
9197 T: SubscriptionService,
9198 > tonic::server::ServerStreamingService<
9199 super::SubscribeCheckpointsRequest,
9200 > for SubscribeCheckpointsSvc<T> {
9201 type Response = super::SubscribeCheckpointsResponse;
9202 type ResponseStream = BoxStream<
9203 super::SubscribeCheckpointsResponse,
9204 >;
9205 type Future = BoxFuture<
9206 tonic::Response<Self::ResponseStream>,
9207 tonic::Status,
9208 >;
9209 fn call(
9210 &mut self,
9211 request: tonic::Request<super::SubscribeCheckpointsRequest>,
9212 ) -> Self::Future {
9213 let inner = Arc::clone(&self.0);
9214 let fut = async move {
9215 <T as SubscriptionService>::subscribe_checkpoints(
9216 &inner,
9217 request,
9218 )
9219 .await
9220 };
9221 Box::pin(fut)
9222 }
9223 }
9224 let accept_compression_encodings = self.accept_compression_encodings;
9225 let send_compression_encodings = self.send_compression_encodings;
9226 let max_decoding_message_size = self.max_decoding_message_size;
9227 let max_encoding_message_size = self.max_encoding_message_size;
9228 let inner = self.inner.clone();
9229 let fut = async move {
9230 let method = SubscribeCheckpointsSvc(inner);
9231 let codec = tonic_prost::ProstCodec::default();
9232 let mut grpc = tonic::server::Grpc::new(codec)
9233 .apply_compression_config(
9234 accept_compression_encodings,
9235 send_compression_encodings,
9236 )
9237 .apply_max_message_size_config(
9238 max_decoding_message_size,
9239 max_encoding_message_size,
9240 );
9241 let res = grpc.server_streaming(method, req).await;
9242 Ok(res)
9243 };
9244 Box::pin(fut)
9245 }
9246 "/sui.rpc.v2.SubscriptionService/SubscribeTransactions" => {
9247 #[allow(non_camel_case_types)]
9248 struct SubscribeTransactionsSvc<T: SubscriptionService>(pub Arc<T>);
9249 impl<
9250 T: SubscriptionService,
9251 > tonic::server::ServerStreamingService<
9252 super::SubscribeTransactionsRequest,
9253 > for SubscribeTransactionsSvc<T> {
9254 type Response = super::SubscribeTransactionsResponse;
9255 type ResponseStream = BoxStream<
9256 super::SubscribeTransactionsResponse,
9257 >;
9258 type Future = BoxFuture<
9259 tonic::Response<Self::ResponseStream>,
9260 tonic::Status,
9261 >;
9262 fn call(
9263 &mut self,
9264 request: tonic::Request<super::SubscribeTransactionsRequest>,
9265 ) -> Self::Future {
9266 let inner = Arc::clone(&self.0);
9267 let fut = async move {
9268 <T as SubscriptionService>::subscribe_transactions(
9269 &inner,
9270 request,
9271 )
9272 .await
9273 };
9274 Box::pin(fut)
9275 }
9276 }
9277 let accept_compression_encodings = self.accept_compression_encodings;
9278 let send_compression_encodings = self.send_compression_encodings;
9279 let max_decoding_message_size = self.max_decoding_message_size;
9280 let max_encoding_message_size = self.max_encoding_message_size;
9281 let inner = self.inner.clone();
9282 let fut = async move {
9283 let method = SubscribeTransactionsSvc(inner);
9284 let codec = tonic_prost::ProstCodec::default();
9285 let mut grpc = tonic::server::Grpc::new(codec)
9286 .apply_compression_config(
9287 accept_compression_encodings,
9288 send_compression_encodings,
9289 )
9290 .apply_max_message_size_config(
9291 max_decoding_message_size,
9292 max_encoding_message_size,
9293 );
9294 let res = grpc.server_streaming(method, req).await;
9295 Ok(res)
9296 };
9297 Box::pin(fut)
9298 }
9299 "/sui.rpc.v2.SubscriptionService/SubscribeEvents" => {
9300 #[allow(non_camel_case_types)]
9301 struct SubscribeEventsSvc<T: SubscriptionService>(pub Arc<T>);
9302 impl<
9303 T: SubscriptionService,
9304 > tonic::server::ServerStreamingService<
9305 super::SubscribeEventsRequest,
9306 > for SubscribeEventsSvc<T> {
9307 type Response = super::SubscribeEventsResponse;
9308 type ResponseStream = BoxStream<super::SubscribeEventsResponse>;
9309 type Future = BoxFuture<
9310 tonic::Response<Self::ResponseStream>,
9311 tonic::Status,
9312 >;
9313 fn call(
9314 &mut self,
9315 request: tonic::Request<super::SubscribeEventsRequest>,
9316 ) -> Self::Future {
9317 let inner = Arc::clone(&self.0);
9318 let fut = async move {
9319 <T as SubscriptionService>::subscribe_events(
9320 &inner,
9321 request,
9322 )
9323 .await
9324 };
9325 Box::pin(fut)
9326 }
9327 }
9328 let accept_compression_encodings = self.accept_compression_encodings;
9329 let send_compression_encodings = self.send_compression_encodings;
9330 let max_decoding_message_size = self.max_decoding_message_size;
9331 let max_encoding_message_size = self.max_encoding_message_size;
9332 let inner = self.inner.clone();
9333 let fut = async move {
9334 let method = SubscribeEventsSvc(inner);
9335 let codec = tonic_prost::ProstCodec::default();
9336 let mut grpc = tonic::server::Grpc::new(codec)
9337 .apply_compression_config(
9338 accept_compression_encodings,
9339 send_compression_encodings,
9340 )
9341 .apply_max_message_size_config(
9342 max_decoding_message_size,
9343 max_encoding_message_size,
9344 );
9345 let res = grpc.server_streaming(method, req).await;
9346 Ok(res)
9347 };
9348 Box::pin(fut)
9349 }
9350 _ => {
9351 Box::pin(async move {
9352 let mut response = http::Response::new(
9353 tonic::body::Body::default(),
9354 );
9355 let headers = response.headers_mut();
9356 headers
9357 .insert(
9358 tonic::Status::GRPC_STATUS,
9359 (tonic::Code::Unimplemented as i32).into(),
9360 );
9361 headers
9362 .insert(
9363 http::header::CONTENT_TYPE,
9364 tonic::metadata::GRPC_CONTENT_TYPE,
9365 );
9366 Ok(response)
9367 })
9368 }
9369 }
9370 }
9371 }
9372 impl<T> Clone for SubscriptionServiceServer<T> {
9373 fn clone(&self) -> Self {
9374 let inner = self.inner.clone();
9375 Self {
9376 inner,
9377 accept_compression_encodings: self.accept_compression_encodings,
9378 send_compression_encodings: self.send_compression_encodings,
9379 max_decoding_message_size: self.max_decoding_message_size,
9380 max_encoding_message_size: self.max_encoding_message_size,
9381 }
9382 }
9383 }
9384 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
9386 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
9387 const NAME: &'static str = SERVICE_NAME;
9388 }
9389}
9390#[non_exhaustive]
9391#[derive(Clone, PartialEq, ::prost::Message)]
9392pub struct SystemState {
9393 #[prost(uint64, optional, tag = "1")]
9395 pub version: ::core::option::Option<u64>,
9396 #[prost(uint64, optional, tag = "2")]
9398 pub epoch: ::core::option::Option<u64>,
9399 #[prost(uint64, optional, tag = "3")]
9401 pub protocol_version: ::core::option::Option<u64>,
9402 #[prost(message, optional, tag = "4")]
9404 pub validators: ::core::option::Option<ValidatorSet>,
9405 #[prost(message, optional, tag = "5")]
9407 pub storage_fund: ::core::option::Option<StorageFund>,
9408 #[prost(message, optional, tag = "6")]
9410 pub parameters: ::core::option::Option<SystemParameters>,
9411 #[prost(uint64, optional, tag = "7")]
9413 pub reference_gas_price: ::core::option::Option<u64>,
9414 #[prost(message, repeated, tag = "8")]
9422 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
9423 #[prost(message, optional, tag = "9")]
9425 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
9426 #[prost(bool, optional, tag = "10")]
9433 pub safe_mode: ::core::option::Option<bool>,
9434 #[prost(uint64, optional, tag = "11")]
9436 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
9437 #[prost(uint64, optional, tag = "12")]
9439 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
9440 #[prost(uint64, optional, tag = "13")]
9442 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
9443 #[prost(uint64, optional, tag = "14")]
9445 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
9446 #[prost(uint64, optional, tag = "15")]
9448 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
9449 #[prost(message, optional, tag = "16")]
9451 pub extra_fields: ::core::option::Option<MoveTable>,
9452}
9453#[non_exhaustive]
9454#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9455pub struct ValidatorReportRecord {
9456 #[prost(string, optional, tag = "1")]
9458 pub reported: ::core::option::Option<::prost::alloc::string::String>,
9459 #[prost(string, repeated, tag = "2")]
9461 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
9462}
9463#[non_exhaustive]
9464#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9465pub struct SystemParameters {
9466 #[prost(uint64, optional, tag = "1")]
9468 pub epoch_duration_ms: ::core::option::Option<u64>,
9469 #[prost(uint64, optional, tag = "2")]
9471 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
9472 #[prost(uint64, optional, tag = "3")]
9474 pub min_validator_count: ::core::option::Option<u64>,
9475 #[prost(uint64, optional, tag = "4")]
9478 pub max_validator_count: ::core::option::Option<u64>,
9479 #[prost(uint64, optional, tag = "5")]
9482 pub min_validator_joining_stake: ::core::option::Option<u64>,
9483 #[prost(uint64, optional, tag = "6")]
9488 pub validator_low_stake_threshold: ::core::option::Option<u64>,
9489 #[prost(uint64, optional, tag = "7")]
9493 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
9494 #[prost(uint64, optional, tag = "8")]
9497 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
9498 #[prost(message, optional, tag = "9")]
9500 pub extra_fields: ::core::option::Option<MoveTable>,
9501}
9502#[non_exhaustive]
9504#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9505pub struct MoveTable {
9506 #[prost(string, optional, tag = "1")]
9508 pub id: ::core::option::Option<::prost::alloc::string::String>,
9509 #[prost(uint64, optional, tag = "2")]
9511 pub size: ::core::option::Option<u64>,
9512}
9513#[non_exhaustive]
9514#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9515pub struct StakeSubsidy {
9516 #[prost(uint64, optional, tag = "1")]
9518 pub balance: ::core::option::Option<u64>,
9519 #[prost(uint64, optional, tag = "2")]
9521 pub distribution_counter: ::core::option::Option<u64>,
9522 #[prost(uint64, optional, tag = "3")]
9525 pub current_distribution_amount: ::core::option::Option<u64>,
9526 #[prost(uint64, optional, tag = "4")]
9528 pub stake_subsidy_period_length: ::core::option::Option<u64>,
9529 #[prost(uint32, optional, tag = "5")]
9532 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
9533 #[prost(message, optional, tag = "6")]
9535 pub extra_fields: ::core::option::Option<MoveTable>,
9536}
9537#[non_exhaustive]
9539#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
9540pub struct StorageFund {
9541 #[prost(uint64, optional, tag = "1")]
9547 pub total_object_storage_rebates: ::core::option::Option<u64>,
9548 #[prost(uint64, optional, tag = "2")]
9551 pub non_refundable_balance: ::core::option::Option<u64>,
9552}
9553#[non_exhaustive]
9554#[derive(Clone, PartialEq, ::prost::Message)]
9555pub struct ValidatorSet {
9556 #[prost(uint64, optional, tag = "1")]
9559 pub total_stake: ::core::option::Option<u64>,
9560 #[prost(message, repeated, tag = "2")]
9562 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
9563 #[prost(message, optional, tag = "3")]
9568 pub pending_active_validators: ::core::option::Option<MoveTable>,
9569 #[prost(uint64, repeated, tag = "4")]
9572 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
9573 #[prost(message, optional, tag = "5")]
9577 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
9578 #[prost(message, optional, tag = "6")]
9584 pub inactive_validators: ::core::option::Option<MoveTable>,
9585 #[prost(message, optional, tag = "7")]
9593 pub validator_candidates: ::core::option::Option<MoveTable>,
9594 #[prost(btree_map = "string, uint64", tag = "8")]
9596 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
9597 ::prost::alloc::string::String,
9598 u64,
9599 >,
9600 #[prost(message, optional, tag = "9")]
9602 pub extra_fields: ::core::option::Option<MoveTable>,
9603}
9604#[non_exhaustive]
9608#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9609pub struct Validator {
9610 #[prost(string, optional, tag = "1")]
9612 pub name: ::core::option::Option<::prost::alloc::string::String>,
9613 #[prost(string, optional, tag = "2")]
9616 pub address: ::core::option::Option<::prost::alloc::string::String>,
9617 #[prost(string, optional, tag = "3")]
9618 pub description: ::core::option::Option<::prost::alloc::string::String>,
9619 #[prost(string, optional, tag = "4")]
9620 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
9621 #[prost(string, optional, tag = "5")]
9622 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
9623 #[prost(bytes = "bytes", optional, tag = "7")]
9626 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
9627 #[prost(bytes = "bytes", optional, tag = "8")]
9629 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
9630 #[prost(bytes = "bytes", optional, tag = "10")]
9633 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
9634 #[prost(bytes = "bytes", optional, tag = "12")]
9636 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
9637 #[prost(string, optional, tag = "13")]
9639 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
9640 #[prost(string, optional, tag = "14")]
9642 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
9643 #[prost(string, optional, tag = "15")]
9645 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
9646 #[prost(string, optional, tag = "16")]
9648 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
9649 #[prost(bytes = "bytes", optional, tag = "18")]
9650 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
9651 #[prost(bytes = "bytes", optional, tag = "19")]
9652 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
9653 #[prost(bytes = "bytes", optional, tag = "21")]
9654 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
9655 #[prost(bytes = "bytes", optional, tag = "23")]
9656 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
9657 #[prost(string, optional, tag = "24")]
9658 pub next_epoch_network_address: ::core::option::Option<
9659 ::prost::alloc::string::String,
9660 >,
9661 #[prost(string, optional, tag = "25")]
9662 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
9663 #[prost(string, optional, tag = "26")]
9664 pub next_epoch_primary_address: ::core::option::Option<
9665 ::prost::alloc::string::String,
9666 >,
9667 #[prost(string, optional, tag = "27")]
9668 pub next_epoch_worker_address: ::core::option::Option<
9669 ::prost::alloc::string::String,
9670 >,
9671 #[prost(message, optional, tag = "28")]
9673 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
9674 #[prost(uint64, optional, tag = "29")]
9677 pub voting_power: ::core::option::Option<u64>,
9678 #[prost(string, optional, tag = "30")]
9680 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
9681 #[prost(uint64, optional, tag = "31")]
9683 pub gas_price: ::core::option::Option<u64>,
9684 #[prost(message, optional, tag = "32")]
9686 pub staking_pool: ::core::option::Option<StakingPool>,
9687 #[prost(uint64, optional, tag = "33")]
9689 pub commission_rate: ::core::option::Option<u64>,
9690 #[prost(uint64, optional, tag = "34")]
9692 pub next_epoch_stake: ::core::option::Option<u64>,
9693 #[prost(uint64, optional, tag = "35")]
9695 pub next_epoch_gas_price: ::core::option::Option<u64>,
9696 #[prost(uint64, optional, tag = "36")]
9698 pub next_epoch_commission_rate: ::core::option::Option<u64>,
9699 #[prost(message, optional, tag = "37")]
9701 pub extra_fields: ::core::option::Option<MoveTable>,
9702}
9703#[non_exhaustive]
9705#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9706pub struct StakingPool {
9707 #[prost(string, optional, tag = "1")]
9709 pub id: ::core::option::Option<::prost::alloc::string::String>,
9710 #[prost(uint64, optional, tag = "2")]
9713 pub activation_epoch: ::core::option::Option<u64>,
9714 #[prost(uint64, optional, tag = "3")]
9717 pub deactivation_epoch: ::core::option::Option<u64>,
9718 #[prost(uint64, optional, tag = "4")]
9721 pub sui_balance: ::core::option::Option<u64>,
9722 #[prost(uint64, optional, tag = "5")]
9724 pub rewards_pool: ::core::option::Option<u64>,
9725 #[prost(uint64, optional, tag = "6")]
9727 pub pool_token_balance: ::core::option::Option<u64>,
9728 #[prost(message, optional, tag = "7")]
9735 pub exchange_rates: ::core::option::Option<MoveTable>,
9736 #[prost(uint64, optional, tag = "8")]
9738 pub pending_stake: ::core::option::Option<u64>,
9739 #[prost(uint64, optional, tag = "9")]
9742 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
9743 #[prost(uint64, optional, tag = "10")]
9745 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
9746 #[prost(message, optional, tag = "11")]
9748 pub extra_fields: ::core::option::Option<MoveTable>,
9749}
9750#[non_exhaustive]
9752#[derive(Clone, PartialEq, ::prost::Message)]
9753pub struct Transaction {
9754 #[prost(message, optional, tag = "1")]
9756 pub bcs: ::core::option::Option<Bcs>,
9757 #[prost(string, optional, tag = "2")]
9759 pub digest: ::core::option::Option<::prost::alloc::string::String>,
9760 #[prost(int32, optional, tag = "3")]
9762 pub version: ::core::option::Option<i32>,
9763 #[prost(message, optional, tag = "4")]
9764 pub kind: ::core::option::Option<TransactionKind>,
9765 #[prost(string, optional, tag = "5")]
9766 pub sender: ::core::option::Option<::prost::alloc::string::String>,
9767 #[prost(message, optional, tag = "6")]
9768 pub gas_payment: ::core::option::Option<GasPayment>,
9769 #[prost(message, optional, tag = "7")]
9770 pub expiration: ::core::option::Option<TransactionExpiration>,
9771}
9772#[non_exhaustive]
9774#[derive(Clone, PartialEq, ::prost::Message)]
9775pub struct GasPayment {
9776 #[prost(message, repeated, tag = "1")]
9778 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
9779 #[prost(string, optional, tag = "2")]
9781 pub owner: ::core::option::Option<::prost::alloc::string::String>,
9782 #[prost(uint64, optional, tag = "3")]
9786 pub price: ::core::option::Option<u64>,
9787 #[prost(uint64, optional, tag = "4")]
9789 pub budget: ::core::option::Option<u64>,
9790}
9791#[non_exhaustive]
9793#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9794pub struct TransactionExpiration {
9795 #[prost(
9796 enumeration = "transaction_expiration::TransactionExpirationKind",
9797 optional,
9798 tag = "1"
9799 )]
9800 pub kind: ::core::option::Option<i32>,
9801 #[prost(uint64, optional, tag = "2")]
9804 pub epoch: ::core::option::Option<u64>,
9805 #[prost(uint64, optional, tag = "3")]
9808 pub min_epoch: ::core::option::Option<u64>,
9809 #[prost(message, optional, tag = "4")]
9813 pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
9814 #[prost(message, optional, tag = "5")]
9818 pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
9819 #[prost(string, optional, tag = "6")]
9821 pub chain: ::core::option::Option<::prost::alloc::string::String>,
9822 #[prost(uint32, optional, tag = "7")]
9824 pub nonce: ::core::option::Option<u32>,
9825 #[prost(message, optional, tag = "8")]
9828 pub allowed_proposers: ::core::option::Option<AllowedProposers>,
9829}
9830pub mod transaction_expiration {
9832 #[non_exhaustive]
9833 #[derive(
9834 Clone,
9835 Copy,
9836 Debug,
9837 PartialEq,
9838 Eq,
9839 Hash,
9840 PartialOrd,
9841 Ord,
9842 ::prost::Enumeration
9843 )]
9844 #[repr(i32)]
9845 pub enum TransactionExpirationKind {
9846 Unknown = 0,
9847 None = 1,
9849 Epoch = 2,
9852 ValidDuring = 3,
9862 Validity = 4,
9865 }
9866 impl TransactionExpirationKind {
9867 pub fn as_str_name(&self) -> &'static str {
9872 match self {
9873 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
9874 Self::None => "NONE",
9875 Self::Epoch => "EPOCH",
9876 Self::ValidDuring => "VALID_DURING",
9877 Self::Validity => "VALIDITY",
9878 }
9879 }
9880 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9882 match value {
9883 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
9884 "NONE" => Some(Self::None),
9885 "EPOCH" => Some(Self::Epoch),
9886 "VALID_DURING" => Some(Self::ValidDuring),
9887 "VALIDITY" => Some(Self::Validity),
9888 _ => None,
9889 }
9890 }
9891 }
9892}
9893#[non_exhaustive]
9897#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9898pub struct AllowedProposers {
9899 #[prost(uint64, optional, tag = "1")]
9904 pub epoch: ::core::option::Option<u64>,
9905 #[prost(uint32, repeated, tag = "2")]
9910 pub proposers: ::prost::alloc::vec::Vec<u32>,
9911}
9912#[non_exhaustive]
9914#[derive(Clone, PartialEq, ::prost::Message)]
9915pub struct TransactionKind {
9916 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
9917 pub kind: ::core::option::Option<i32>,
9918 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
9919 pub data: ::core::option::Option<transaction_kind::Data>,
9920}
9921pub mod transaction_kind {
9923 #[non_exhaustive]
9924 #[derive(
9925 Clone,
9926 Copy,
9927 Debug,
9928 PartialEq,
9929 Eq,
9930 Hash,
9931 PartialOrd,
9932 Ord,
9933 ::prost::Enumeration
9934 )]
9935 #[repr(i32)]
9936 pub enum Kind {
9937 Unknown = 0,
9938 ProgrammableTransaction = 1,
9940 ChangeEpoch = 2,
9945 Genesis = 3,
9950 ConsensusCommitPrologueV1 = 4,
9952 AuthenticatorStateUpdate = 5,
9954 EndOfEpoch = 6,
9957 RandomnessStateUpdate = 7,
9959 ConsensusCommitPrologueV2 = 8,
9961 ConsensusCommitPrologueV3 = 9,
9963 ConsensusCommitPrologueV4 = 10,
9965 ProgrammableSystemTransaction = 11,
9967 }
9968 impl Kind {
9969 pub fn as_str_name(&self) -> &'static str {
9974 match self {
9975 Self::Unknown => "KIND_UNKNOWN",
9976 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
9977 Self::ChangeEpoch => "CHANGE_EPOCH",
9978 Self::Genesis => "GENESIS",
9979 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
9980 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
9981 Self::EndOfEpoch => "END_OF_EPOCH",
9982 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
9983 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
9984 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
9985 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
9986 Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
9987 }
9988 }
9989 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9991 match value {
9992 "KIND_UNKNOWN" => Some(Self::Unknown),
9993 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
9994 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
9995 "GENESIS" => Some(Self::Genesis),
9996 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
9997 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
9998 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
9999 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
10000 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
10001 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
10002 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
10003 "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
10004 Some(Self::ProgrammableSystemTransaction)
10005 }
10006 _ => None,
10007 }
10008 }
10009 }
10010 #[non_exhaustive]
10011 #[derive(Clone, PartialEq, ::prost::Oneof)]
10012 pub enum Data {
10013 #[prost(message, tag = "2")]
10015 ProgrammableTransaction(super::ProgrammableTransaction),
10016 #[prost(message, tag = "3")]
10021 ChangeEpoch(super::ChangeEpoch),
10022 #[prost(message, tag = "4")]
10027 Genesis(super::GenesisTransaction),
10028 #[prost(message, tag = "5")]
10030 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
10031 #[prost(message, tag = "6")]
10033 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
10034 #[prost(message, tag = "7")]
10037 EndOfEpoch(super::EndOfEpochTransaction),
10038 #[prost(message, tag = "8")]
10040 RandomnessStateUpdate(super::RandomnessStateUpdate),
10041 }
10042}
10043#[non_exhaustive]
10048#[derive(Clone, PartialEq, ::prost::Message)]
10049pub struct ProgrammableTransaction {
10050 #[prost(message, repeated, tag = "1")]
10052 pub inputs: ::prost::alloc::vec::Vec<Input>,
10053 #[prost(message, repeated, tag = "2")]
10056 pub commands: ::prost::alloc::vec::Vec<Command>,
10057}
10058#[non_exhaustive]
10060#[derive(Clone, PartialEq, ::prost::Message)]
10061pub struct Command {
10062 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
10063 pub command: ::core::option::Option<command::Command>,
10064}
10065pub mod command {
10067 #[non_exhaustive]
10068 #[derive(Clone, PartialEq, ::prost::Oneof)]
10069 pub enum Command {
10070 #[prost(message, tag = "1")]
10072 MoveCall(super::MoveCall),
10073 #[prost(message, tag = "2")]
10078 TransferObjects(super::TransferObjects),
10079 #[prost(message, tag = "3")]
10082 SplitCoins(super::SplitCoins),
10083 #[prost(message, tag = "4")]
10086 MergeCoins(super::MergeCoins),
10087 #[prost(message, tag = "5")]
10090 Publish(super::Publish),
10091 #[prost(message, tag = "6")]
10095 MakeMoveVector(super::MakeMoveVector),
10096 #[prost(message, tag = "7")]
10105 Upgrade(super::Upgrade),
10106 }
10107}
10108#[non_exhaustive]
10113#[derive(Clone, PartialEq, ::prost::Message)]
10114pub struct MoveCall {
10115 #[prost(string, optional, tag = "1")]
10117 pub package: ::core::option::Option<::prost::alloc::string::String>,
10118 #[prost(string, optional, tag = "2")]
10120 pub module: ::core::option::Option<::prost::alloc::string::String>,
10121 #[prost(string, optional, tag = "3")]
10123 pub function: ::core::option::Option<::prost::alloc::string::String>,
10124 #[prost(string, repeated, tag = "4")]
10126 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
10127 #[prost(message, repeated, tag = "5")]
10129 pub arguments: ::prost::alloc::vec::Vec<Argument>,
10130}
10131#[non_exhaustive]
10133#[derive(Clone, PartialEq, ::prost::Message)]
10134pub struct TransferObjects {
10135 #[prost(message, repeated, tag = "1")]
10137 pub objects: ::prost::alloc::vec::Vec<Argument>,
10138 #[prost(message, optional, tag = "2")]
10140 pub address: ::core::option::Option<Argument>,
10141}
10142#[non_exhaustive]
10144#[derive(Clone, PartialEq, ::prost::Message)]
10145pub struct SplitCoins {
10146 #[prost(message, optional, tag = "1")]
10148 pub coin: ::core::option::Option<Argument>,
10149 #[prost(message, repeated, tag = "2")]
10151 pub amounts: ::prost::alloc::vec::Vec<Argument>,
10152}
10153#[non_exhaustive]
10155#[derive(Clone, PartialEq, ::prost::Message)]
10156pub struct MergeCoins {
10157 #[prost(message, optional, tag = "1")]
10159 pub coin: ::core::option::Option<Argument>,
10160 #[prost(message, repeated, tag = "2")]
10164 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
10165}
10166#[non_exhaustive]
10168#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10169pub struct Publish {
10170 #[prost(bytes = "bytes", repeated, tag = "1")]
10172 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
10173 #[prost(string, repeated, tag = "2")]
10175 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
10176}
10177#[non_exhaustive]
10179#[derive(Clone, PartialEq, ::prost::Message)]
10180pub struct MakeMoveVector {
10181 #[prost(string, optional, tag = "1")]
10186 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
10187 #[prost(message, repeated, tag = "2")]
10189 pub elements: ::prost::alloc::vec::Vec<Argument>,
10190}
10191#[non_exhaustive]
10193#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10194pub struct Upgrade {
10195 #[prost(bytes = "bytes", repeated, tag = "1")]
10197 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
10198 #[prost(string, repeated, tag = "2")]
10200 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
10201 #[prost(string, optional, tag = "3")]
10203 pub package: ::core::option::Option<::prost::alloc::string::String>,
10204 #[prost(message, optional, tag = "4")]
10206 pub ticket: ::core::option::Option<Argument>,
10207}
10208#[non_exhaustive]
10210#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10211pub struct RandomnessStateUpdate {
10212 #[prost(uint64, optional, tag = "1")]
10214 pub epoch: ::core::option::Option<u64>,
10215 #[prost(uint64, optional, tag = "2")]
10217 pub randomness_round: ::core::option::Option<u64>,
10218 #[prost(bytes = "bytes", optional, tag = "3")]
10220 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
10221 #[prost(uint64, optional, tag = "4")]
10223 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
10224}
10225#[non_exhaustive]
10227#[derive(Clone, PartialEq, ::prost::Message)]
10228pub struct ChangeEpoch {
10229 #[prost(uint64, optional, tag = "1")]
10231 pub epoch: ::core::option::Option<u64>,
10232 #[prost(uint64, optional, tag = "2")]
10234 pub protocol_version: ::core::option::Option<u64>,
10235 #[prost(uint64, optional, tag = "3")]
10237 pub storage_charge: ::core::option::Option<u64>,
10238 #[prost(uint64, optional, tag = "4")]
10240 pub computation_charge: ::core::option::Option<u64>,
10241 #[prost(uint64, optional, tag = "5")]
10243 pub storage_rebate: ::core::option::Option<u64>,
10244 #[prost(uint64, optional, tag = "6")]
10246 pub non_refundable_storage_fee: ::core::option::Option<u64>,
10247 #[prost(message, optional, tag = "7")]
10249 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
10250 #[prost(message, repeated, tag = "8")]
10256 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
10257}
10258#[non_exhaustive]
10260#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10261pub struct SystemPackage {
10262 #[prost(uint64, optional, tag = "1")]
10264 pub version: ::core::option::Option<u64>,
10265 #[prost(bytes = "bytes", repeated, tag = "2")]
10267 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
10268 #[prost(string, repeated, tag = "3")]
10270 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
10271}
10272#[non_exhaustive]
10274#[derive(Clone, PartialEq, ::prost::Message)]
10275pub struct GenesisTransaction {
10276 #[prost(message, repeated, tag = "1")]
10278 pub objects: ::prost::alloc::vec::Vec<Object>,
10279}
10280#[non_exhaustive]
10284#[derive(Clone, PartialEq, ::prost::Message)]
10285pub struct ConsensusCommitPrologue {
10286 #[prost(uint64, optional, tag = "1")]
10290 pub epoch: ::core::option::Option<u64>,
10291 #[prost(uint64, optional, tag = "2")]
10295 pub round: ::core::option::Option<u64>,
10296 #[prost(message, optional, tag = "3")]
10300 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
10301 #[prost(string, optional, tag = "4")]
10305 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
10306 #[prost(uint64, optional, tag = "5")]
10311 pub sub_dag_index: ::core::option::Option<u64>,
10312 #[prost(message, optional, tag = "6")]
10316 pub consensus_determined_version_assignments: ::core::option::Option<
10317 ConsensusDeterminedVersionAssignments,
10318 >,
10319 #[prost(string, optional, tag = "7")]
10324 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
10325}
10326#[non_exhaustive]
10328#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10329pub struct VersionAssignment {
10330 #[prost(string, optional, tag = "1")]
10332 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
10333 #[prost(uint64, optional, tag = "2")]
10335 pub start_version: ::core::option::Option<u64>,
10336 #[prost(uint64, optional, tag = "3")]
10338 pub version: ::core::option::Option<u64>,
10339}
10340#[non_exhaustive]
10342#[derive(Clone, PartialEq, ::prost::Message)]
10343pub struct CanceledTransaction {
10344 #[prost(string, optional, tag = "1")]
10346 pub digest: ::core::option::Option<::prost::alloc::string::String>,
10347 #[prost(message, repeated, tag = "2")]
10349 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
10350}
10351#[non_exhaustive]
10353#[derive(Clone, PartialEq, ::prost::Message)]
10354pub struct ConsensusDeterminedVersionAssignments {
10355 #[prost(int32, optional, tag = "1")]
10357 pub version: ::core::option::Option<i32>,
10358 #[prost(message, repeated, tag = "3")]
10360 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
10361}
10362#[non_exhaustive]
10364#[derive(Clone, PartialEq, ::prost::Message)]
10365pub struct AuthenticatorStateUpdate {
10366 #[prost(uint64, optional, tag = "1")]
10368 pub epoch: ::core::option::Option<u64>,
10369 #[prost(uint64, optional, tag = "2")]
10371 pub round: ::core::option::Option<u64>,
10372 #[prost(message, repeated, tag = "3")]
10374 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
10375 #[prost(uint64, optional, tag = "4")]
10377 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
10378}
10379#[non_exhaustive]
10381#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10382pub struct ActiveJwk {
10383 #[prost(message, optional, tag = "1")]
10385 pub id: ::core::option::Option<JwkId>,
10386 #[prost(message, optional, tag = "2")]
10388 pub jwk: ::core::option::Option<Jwk>,
10389 #[prost(uint64, optional, tag = "3")]
10391 pub epoch: ::core::option::Option<u64>,
10392}
10393#[non_exhaustive]
10396#[derive(Clone, PartialEq, ::prost::Message)]
10397pub struct EndOfEpochTransaction {
10398 #[prost(message, repeated, tag = "1")]
10399 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
10400}
10401#[non_exhaustive]
10403#[derive(Clone, PartialEq, ::prost::Message)]
10404pub struct EndOfEpochTransactionKind {
10405 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
10406 pub kind: ::core::option::Option<i32>,
10407 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
10408 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
10409}
10410pub mod end_of_epoch_transaction_kind {
10412 #[non_exhaustive]
10413 #[derive(
10414 Clone,
10415 Copy,
10416 Debug,
10417 PartialEq,
10418 Eq,
10419 Hash,
10420 PartialOrd,
10421 Ord,
10422 ::prost::Enumeration
10423 )]
10424 #[repr(i32)]
10425 pub enum Kind {
10426 Unknown = 0,
10427 ChangeEpoch = 1,
10429 AuthenticatorStateCreate = 2,
10431 AuthenticatorStateExpire = 3,
10433 RandomnessStateCreate = 4,
10435 DenyListStateCreate = 5,
10437 BridgeStateCreate = 6,
10439 BridgeCommitteeInit = 7,
10441 StoreExecutionTimeObservations = 8,
10443 AccumulatorRootCreate = 9,
10445 CoinRegistryCreate = 10,
10447 DisplayRegistryCreate = 11,
10449 AddressAliasStateCreate = 12,
10451 WriteAccumulatorStorageCost = 13,
10453 ForwardingAddressRegistryCreate = 14,
10455 FreezeListCreate = 15,
10457 }
10458 impl Kind {
10459 pub fn as_str_name(&self) -> &'static str {
10464 match self {
10465 Self::Unknown => "KIND_UNKNOWN",
10466 Self::ChangeEpoch => "CHANGE_EPOCH",
10467 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
10468 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
10469 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
10470 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
10471 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
10472 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
10473 Self::StoreExecutionTimeObservations => {
10474 "STORE_EXECUTION_TIME_OBSERVATIONS"
10475 }
10476 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
10477 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
10478 Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
10479 Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
10480 Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
10481 Self::ForwardingAddressRegistryCreate => {
10482 "FORWARDING_ADDRESS_REGISTRY_CREATE"
10483 }
10484 Self::FreezeListCreate => "FREEZE_LIST_CREATE",
10485 }
10486 }
10487 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
10489 match value {
10490 "KIND_UNKNOWN" => Some(Self::Unknown),
10491 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
10492 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
10493 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
10494 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
10495 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
10496 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
10497 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
10498 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
10499 Some(Self::StoreExecutionTimeObservations)
10500 }
10501 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
10502 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
10503 "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
10504 "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
10505 "WRITE_ACCUMULATOR_STORAGE_COST" => {
10506 Some(Self::WriteAccumulatorStorageCost)
10507 }
10508 "FORWARDING_ADDRESS_REGISTRY_CREATE" => {
10509 Some(Self::ForwardingAddressRegistryCreate)
10510 }
10511 "FREEZE_LIST_CREATE" => Some(Self::FreezeListCreate),
10512 _ => None,
10513 }
10514 }
10515 }
10516 #[non_exhaustive]
10517 #[derive(Clone, PartialEq, ::prost::Oneof)]
10518 pub enum Data {
10519 #[prost(message, tag = "2")]
10521 ChangeEpoch(super::ChangeEpoch),
10522 #[prost(message, tag = "3")]
10524 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
10525 #[prost(message, tag = "4")]
10527 ExecutionTimeObservations(super::ExecutionTimeObservations),
10528 #[prost(string, tag = "5")]
10530 BridgeChainId(::prost::alloc::string::String),
10531 #[prost(uint64, tag = "6")]
10533 BridgeObjectVersion(u64),
10534 #[prost(uint64, tag = "7")]
10536 StorageCost(u64),
10537 }
10538}
10539#[non_exhaustive]
10541#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
10542pub struct AuthenticatorStateExpire {
10543 #[prost(uint64, optional, tag = "1")]
10545 pub min_epoch: ::core::option::Option<u64>,
10546 #[prost(uint64, optional, tag = "2")]
10548 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
10549}
10550#[non_exhaustive]
10551#[derive(Clone, PartialEq, ::prost::Message)]
10552pub struct ExecutionTimeObservations {
10553 #[prost(int32, optional, tag = "1")]
10555 pub version: ::core::option::Option<i32>,
10556 #[prost(message, repeated, tag = "2")]
10557 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
10558}
10559#[non_exhaustive]
10560#[derive(Clone, PartialEq, ::prost::Message)]
10561pub struct ExecutionTimeObservation {
10562 #[prost(
10563 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
10564 optional,
10565 tag = "1"
10566 )]
10567 pub kind: ::core::option::Option<i32>,
10568 #[prost(message, optional, tag = "2")]
10569 pub move_entry_point: ::core::option::Option<MoveCall>,
10570 #[prost(message, repeated, tag = "3")]
10571 pub validator_observations: ::prost::alloc::vec::Vec<
10572 ValidatorExecutionTimeObservation,
10573 >,
10574}
10575pub mod execution_time_observation {
10577 #[non_exhaustive]
10578 #[derive(
10579 Clone,
10580 Copy,
10581 Debug,
10582 PartialEq,
10583 Eq,
10584 Hash,
10585 PartialOrd,
10586 Ord,
10587 ::prost::Enumeration
10588 )]
10589 #[repr(i32)]
10590 pub enum ExecutionTimeObservationKind {
10591 Unknown = 0,
10592 MoveEntryPoint = 1,
10593 TransferObjects = 2,
10594 SplitCoins = 3,
10595 MergeCoins = 4,
10596 Publish = 5,
10597 MakeMoveVector = 6,
10598 Upgrade = 7,
10599 }
10600 impl ExecutionTimeObservationKind {
10601 pub fn as_str_name(&self) -> &'static str {
10606 match self {
10607 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
10608 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
10609 Self::TransferObjects => "TRANSFER_OBJECTS",
10610 Self::SplitCoins => "SPLIT_COINS",
10611 Self::MergeCoins => "MERGE_COINS",
10612 Self::Publish => "PUBLISH",
10613 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
10614 Self::Upgrade => "UPGRADE",
10615 }
10616 }
10617 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
10619 match value {
10620 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
10621 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
10622 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
10623 "SPLIT_COINS" => Some(Self::SplitCoins),
10624 "MERGE_COINS" => Some(Self::MergeCoins),
10625 "PUBLISH" => Some(Self::Publish),
10626 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
10627 "UPGRADE" => Some(Self::Upgrade),
10628 _ => None,
10629 }
10630 }
10631 }
10632}
10633#[non_exhaustive]
10634#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10635pub struct ValidatorExecutionTimeObservation {
10636 #[prost(bytes = "bytes", optional, tag = "1")]
10638 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
10639 #[prost(message, optional, tag = "2")]
10641 pub duration: ::core::option::Option<::prost_types::Duration>,
10642}
10643#[non_exhaustive]
10644#[derive(Clone, PartialEq, ::prost::Message)]
10645pub struct ExecuteTransactionRequest {
10646 #[prost(message, optional, tag = "1")]
10648 pub transaction: ::core::option::Option<Transaction>,
10649 #[prost(message, repeated, tag = "2")]
10652 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
10653 #[prost(message, optional, tag = "3")]
10656 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
10657}
10658#[non_exhaustive]
10660#[derive(Clone, PartialEq, ::prost::Message)]
10661pub struct ExecuteTransactionResponse {
10662 #[prost(message, optional, tag = "1")]
10663 pub transaction: ::core::option::Option<ExecutedTransaction>,
10664}
10665#[non_exhaustive]
10666#[derive(Clone, PartialEq, ::prost::Message)]
10667pub struct SimulateTransactionRequest {
10668 #[prost(message, optional, tag = "1")]
10669 pub transaction: ::core::option::Option<Transaction>,
10670 #[prost(message, optional, tag = "2")]
10672 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
10673 #[prost(
10675 enumeration = "simulate_transaction_request::TransactionChecks",
10676 optional,
10677 tag = "3"
10678 )]
10679 pub checks: ::core::option::Option<i32>,
10680 #[prost(bool, optional, tag = "4")]
10689 pub do_gas_selection: ::core::option::Option<bool>,
10690}
10691pub mod simulate_transaction_request {
10693 #[non_exhaustive]
10695 #[derive(
10696 Clone,
10697 Copy,
10698 Debug,
10699 PartialEq,
10700 Eq,
10701 Hash,
10702 PartialOrd,
10703 Ord,
10704 ::prost::Enumeration
10705 )]
10706 #[repr(i32)]
10707 pub enum TransactionChecks {
10708 Enabled = 0,
10709 Disabled = 1,
10710 }
10711 impl TransactionChecks {
10712 pub fn as_str_name(&self) -> &'static str {
10717 match self {
10718 Self::Enabled => "ENABLED",
10719 Self::Disabled => "DISABLED",
10720 }
10721 }
10722 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
10724 match value {
10725 "ENABLED" => Some(Self::Enabled),
10726 "DISABLED" => Some(Self::Disabled),
10727 _ => None,
10728 }
10729 }
10730 }
10731}
10732#[non_exhaustive]
10733#[derive(Clone, PartialEq, ::prost::Message)]
10734pub struct SimulateTransactionResponse {
10735 #[prost(message, optional, tag = "1")]
10736 pub transaction: ::core::option::Option<ExecutedTransaction>,
10737 #[prost(message, repeated, tag = "2")]
10738 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
10739 #[prost(uint64, optional, tag = "3")]
10743 pub suggested_gas_price: ::core::option::Option<u64>,
10744}
10745#[non_exhaustive]
10747#[derive(Clone, PartialEq, ::prost::Message)]
10748pub struct CommandResult {
10749 #[prost(message, repeated, tag = "1")]
10750 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
10751 #[prost(message, repeated, tag = "2")]
10752 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
10753}
10754#[non_exhaustive]
10755#[derive(Clone, PartialEq, ::prost::Message)]
10756pub struct CommandOutput {
10757 #[prost(message, optional, tag = "1")]
10758 pub argument: ::core::option::Option<Argument>,
10759 #[prost(message, optional, tag = "2")]
10760 pub value: ::core::option::Option<Bcs>,
10761 #[prost(message, optional, boxed, tag = "3")]
10763 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
10764}
10765pub mod transaction_execution_service_client {
10767 #![allow(
10768 unused_variables,
10769 dead_code,
10770 missing_docs,
10771 clippy::wildcard_imports,
10772 clippy::let_unit_value,
10773 )]
10774 use tonic::codegen::*;
10775 use tonic::codegen::http::Uri;
10776 #[derive(Debug, Clone)]
10777 pub struct TransactionExecutionServiceClient<T> {
10778 inner: tonic::client::Grpc<T>,
10779 }
10780 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
10781 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10783 where
10784 D: TryInto<tonic::transport::Endpoint>,
10785 D::Error: Into<StdError>,
10786 {
10787 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10788 Ok(Self::new(conn))
10789 }
10790 }
10791 impl<T> TransactionExecutionServiceClient<T>
10792 where
10793 T: tonic::client::GrpcService<tonic::body::Body>,
10794 T::Error: Into<StdError>,
10795 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10796 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10797 {
10798 pub fn new(inner: T) -> Self {
10799 let inner = tonic::client::Grpc::new(inner);
10800 Self { inner }
10801 }
10802 pub fn with_origin(inner: T, origin: Uri) -> Self {
10803 let inner = tonic::client::Grpc::with_origin(inner, origin);
10804 Self { inner }
10805 }
10806 pub fn with_interceptor<F>(
10807 inner: T,
10808 interceptor: F,
10809 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
10810 where
10811 F: tonic::service::Interceptor,
10812 T::ResponseBody: Default,
10813 T: tonic::codegen::Service<
10814 http::Request<tonic::body::Body>,
10815 Response = http::Response<
10816 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10817 >,
10818 >,
10819 <T as tonic::codegen::Service<
10820 http::Request<tonic::body::Body>,
10821 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10822 {
10823 TransactionExecutionServiceClient::new(
10824 InterceptedService::new(inner, interceptor),
10825 )
10826 }
10827 #[must_use]
10832 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10833 self.inner = self.inner.send_compressed(encoding);
10834 self
10835 }
10836 #[must_use]
10838 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10839 self.inner = self.inner.accept_compressed(encoding);
10840 self
10841 }
10842 #[must_use]
10846 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10847 self.inner = self.inner.max_decoding_message_size(limit);
10848 self
10849 }
10850 #[must_use]
10854 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10855 self.inner = self.inner.max_encoding_message_size(limit);
10856 self
10857 }
10858 pub async fn execute_transaction(
10859 &mut self,
10860 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
10861 ) -> std::result::Result<
10862 tonic::Response<super::ExecuteTransactionResponse>,
10863 tonic::Status,
10864 > {
10865 self.inner
10866 .ready()
10867 .await
10868 .map_err(|e| {
10869 tonic::Status::unknown(
10870 format!("Service was not ready: {}", e.into()),
10871 )
10872 })?;
10873 let codec = tonic_prost::ProstCodec::default();
10874 let path = http::uri::PathAndQuery::from_static(
10875 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
10876 );
10877 let mut req = request.into_request();
10878 req.extensions_mut()
10879 .insert(
10880 GrpcMethod::new(
10881 "sui.rpc.v2.TransactionExecutionService",
10882 "ExecuteTransaction",
10883 ),
10884 );
10885 self.inner.unary(req, path, codec).await
10886 }
10887 pub async fn simulate_transaction(
10888 &mut self,
10889 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
10890 ) -> std::result::Result<
10891 tonic::Response<super::SimulateTransactionResponse>,
10892 tonic::Status,
10893 > {
10894 self.inner
10895 .ready()
10896 .await
10897 .map_err(|e| {
10898 tonic::Status::unknown(
10899 format!("Service was not ready: {}", e.into()),
10900 )
10901 })?;
10902 let codec = tonic_prost::ProstCodec::default();
10903 let path = http::uri::PathAndQuery::from_static(
10904 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
10905 );
10906 let mut req = request.into_request();
10907 req.extensions_mut()
10908 .insert(
10909 GrpcMethod::new(
10910 "sui.rpc.v2.TransactionExecutionService",
10911 "SimulateTransaction",
10912 ),
10913 );
10914 self.inner.unary(req, path, codec).await
10915 }
10916 }
10917}
10918pub mod transaction_execution_service_server {
10920 #![allow(
10921 unused_variables,
10922 dead_code,
10923 missing_docs,
10924 clippy::wildcard_imports,
10925 clippy::let_unit_value,
10926 )]
10927 use tonic::codegen::*;
10928 #[async_trait]
10930 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
10931 async fn execute_transaction(
10932 &self,
10933 request: tonic::Request<super::ExecuteTransactionRequest>,
10934 ) -> std::result::Result<
10935 tonic::Response<super::ExecuteTransactionResponse>,
10936 tonic::Status,
10937 > {
10938 Err(tonic::Status::unimplemented("Not yet implemented"))
10939 }
10940 async fn simulate_transaction(
10941 &self,
10942 request: tonic::Request<super::SimulateTransactionRequest>,
10943 ) -> std::result::Result<
10944 tonic::Response<super::SimulateTransactionResponse>,
10945 tonic::Status,
10946 > {
10947 Err(tonic::Status::unimplemented("Not yet implemented"))
10948 }
10949 }
10950 #[derive(Debug)]
10951 pub struct TransactionExecutionServiceServer<T> {
10952 inner: Arc<T>,
10953 accept_compression_encodings: EnabledCompressionEncodings,
10954 send_compression_encodings: EnabledCompressionEncodings,
10955 max_decoding_message_size: Option<usize>,
10956 max_encoding_message_size: Option<usize>,
10957 }
10958 impl<T> TransactionExecutionServiceServer<T> {
10959 pub fn new(inner: T) -> Self {
10960 Self::from_arc(Arc::new(inner))
10961 }
10962 pub fn from_arc(inner: Arc<T>) -> Self {
10963 Self {
10964 inner,
10965 accept_compression_encodings: Default::default(),
10966 send_compression_encodings: Default::default(),
10967 max_decoding_message_size: None,
10968 max_encoding_message_size: None,
10969 }
10970 }
10971 pub fn with_interceptor<F>(
10972 inner: T,
10973 interceptor: F,
10974 ) -> InterceptedService<Self, F>
10975 where
10976 F: tonic::service::Interceptor,
10977 {
10978 InterceptedService::new(Self::new(inner), interceptor)
10979 }
10980 #[must_use]
10982 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10983 self.accept_compression_encodings.enable(encoding);
10984 self
10985 }
10986 #[must_use]
10988 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10989 self.send_compression_encodings.enable(encoding);
10990 self
10991 }
10992 #[must_use]
10996 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10997 self.max_decoding_message_size = Some(limit);
10998 self
10999 }
11000 #[must_use]
11004 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11005 self.max_encoding_message_size = Some(limit);
11006 self
11007 }
11008 }
11009 impl<T, B> tonic::codegen::Service<http::Request<B>>
11010 for TransactionExecutionServiceServer<T>
11011 where
11012 T: TransactionExecutionService,
11013 B: Body + std::marker::Send + 'static,
11014 B::Error: Into<StdError> + std::marker::Send + 'static,
11015 {
11016 type Response = http::Response<tonic::body::Body>;
11017 type Error = std::convert::Infallible;
11018 type Future = BoxFuture<Self::Response, Self::Error>;
11019 fn poll_ready(
11020 &mut self,
11021 _cx: &mut Context<'_>,
11022 ) -> Poll<std::result::Result<(), Self::Error>> {
11023 Poll::Ready(Ok(()))
11024 }
11025 fn call(&mut self, req: http::Request<B>) -> Self::Future {
11026 match req.uri().path() {
11027 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
11028 #[allow(non_camel_case_types)]
11029 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
11030 pub Arc<T>,
11031 );
11032 impl<
11033 T: TransactionExecutionService,
11034 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
11035 for ExecuteTransactionSvc<T> {
11036 type Response = super::ExecuteTransactionResponse;
11037 type Future = BoxFuture<
11038 tonic::Response<Self::Response>,
11039 tonic::Status,
11040 >;
11041 fn call(
11042 &mut self,
11043 request: tonic::Request<super::ExecuteTransactionRequest>,
11044 ) -> Self::Future {
11045 let inner = Arc::clone(&self.0);
11046 let fut = async move {
11047 <T as TransactionExecutionService>::execute_transaction(
11048 &inner,
11049 request,
11050 )
11051 .await
11052 };
11053 Box::pin(fut)
11054 }
11055 }
11056 let accept_compression_encodings = self.accept_compression_encodings;
11057 let send_compression_encodings = self.send_compression_encodings;
11058 let max_decoding_message_size = self.max_decoding_message_size;
11059 let max_encoding_message_size = self.max_encoding_message_size;
11060 let inner = self.inner.clone();
11061 let fut = async move {
11062 let method = ExecuteTransactionSvc(inner);
11063 let codec = tonic_prost::ProstCodec::default();
11064 let mut grpc = tonic::server::Grpc::new(codec)
11065 .apply_compression_config(
11066 accept_compression_encodings,
11067 send_compression_encodings,
11068 )
11069 .apply_max_message_size_config(
11070 max_decoding_message_size,
11071 max_encoding_message_size,
11072 );
11073 let res = grpc.unary(method, req).await;
11074 Ok(res)
11075 };
11076 Box::pin(fut)
11077 }
11078 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
11079 #[allow(non_camel_case_types)]
11080 struct SimulateTransactionSvc<T: TransactionExecutionService>(
11081 pub Arc<T>,
11082 );
11083 impl<
11084 T: TransactionExecutionService,
11085 > tonic::server::UnaryService<super::SimulateTransactionRequest>
11086 for SimulateTransactionSvc<T> {
11087 type Response = super::SimulateTransactionResponse;
11088 type Future = BoxFuture<
11089 tonic::Response<Self::Response>,
11090 tonic::Status,
11091 >;
11092 fn call(
11093 &mut self,
11094 request: tonic::Request<super::SimulateTransactionRequest>,
11095 ) -> Self::Future {
11096 let inner = Arc::clone(&self.0);
11097 let fut = async move {
11098 <T as TransactionExecutionService>::simulate_transaction(
11099 &inner,
11100 request,
11101 )
11102 .await
11103 };
11104 Box::pin(fut)
11105 }
11106 }
11107 let accept_compression_encodings = self.accept_compression_encodings;
11108 let send_compression_encodings = self.send_compression_encodings;
11109 let max_decoding_message_size = self.max_decoding_message_size;
11110 let max_encoding_message_size = self.max_encoding_message_size;
11111 let inner = self.inner.clone();
11112 let fut = async move {
11113 let method = SimulateTransactionSvc(inner);
11114 let codec = tonic_prost::ProstCodec::default();
11115 let mut grpc = tonic::server::Grpc::new(codec)
11116 .apply_compression_config(
11117 accept_compression_encodings,
11118 send_compression_encodings,
11119 )
11120 .apply_max_message_size_config(
11121 max_decoding_message_size,
11122 max_encoding_message_size,
11123 );
11124 let res = grpc.unary(method, req).await;
11125 Ok(res)
11126 };
11127 Box::pin(fut)
11128 }
11129 _ => {
11130 Box::pin(async move {
11131 let mut response = http::Response::new(
11132 tonic::body::Body::default(),
11133 );
11134 let headers = response.headers_mut();
11135 headers
11136 .insert(
11137 tonic::Status::GRPC_STATUS,
11138 (tonic::Code::Unimplemented as i32).into(),
11139 );
11140 headers
11141 .insert(
11142 http::header::CONTENT_TYPE,
11143 tonic::metadata::GRPC_CONTENT_TYPE,
11144 );
11145 Ok(response)
11146 })
11147 }
11148 }
11149 }
11150 }
11151 impl<T> Clone for TransactionExecutionServiceServer<T> {
11152 fn clone(&self) -> Self {
11153 let inner = self.inner.clone();
11154 Self {
11155 inner,
11156 accept_compression_encodings: self.accept_compression_encodings,
11157 send_compression_encodings: self.send_compression_encodings,
11158 max_decoding_message_size: self.max_decoding_message_size,
11159 max_encoding_message_size: self.max_encoding_message_size,
11160 }
11161 }
11162 }
11163 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
11165 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
11166 const NAME: &'static str = SERVICE_NAME;
11167 }
11168}