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, Eq, Hash, ::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]
542#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
543pub struct AccumulatorWrite {
544 #[prost(string, optional, tag = "1")]
545 pub address: ::core::option::Option<::prost::alloc::string::String>,
546 #[prost(string, optional, tag = "2")]
547 pub accumulator_type: ::core::option::Option<::prost::alloc::string::String>,
548 #[prost(
549 enumeration = "accumulator_write::AccumulatorOperation",
550 optional,
551 tag = "3"
552 )]
553 pub operation: ::core::option::Option<i32>,
554 #[prost(uint64, optional, tag = "5")]
555 pub value: ::core::option::Option<u64>,
556}
557pub mod accumulator_write {
559 #[non_exhaustive]
560 #[derive(
561 Clone,
562 Copy,
563 Debug,
564 PartialEq,
565 Eq,
566 Hash,
567 PartialOrd,
568 Ord,
569 ::prost::Enumeration
570 )]
571 #[repr(i32)]
572 pub enum AccumulatorOperation {
573 Unknown = 0,
574 Merge = 1,
575 Split = 2,
576 }
577 impl AccumulatorOperation {
578 pub fn as_str_name(&self) -> &'static str {
583 match self {
584 Self::Unknown => "ACCUMULATOR_OPERATION_UNKNOWN",
585 Self::Merge => "MERGE",
586 Self::Split => "SPLIT",
587 }
588 }
589 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
591 match value {
592 "ACCUMULATOR_OPERATION_UNKNOWN" => Some(Self::Unknown),
593 "MERGE" => Some(Self::Merge),
594 "SPLIT" => Some(Self::Split),
595 _ => None,
596 }
597 }
598 }
599}
600#[non_exhaustive]
602#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
603pub struct UnchangedConsensusObject {
604 #[prost(
605 enumeration = "unchanged_consensus_object::UnchangedConsensusObjectKind",
606 optional,
607 tag = "1"
608 )]
609 pub kind: ::core::option::Option<i32>,
610 #[prost(string, optional, tag = "2")]
612 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
613 #[prost(uint64, optional, tag = "3")]
615 pub version: ::core::option::Option<u64>,
616 #[prost(string, optional, tag = "4")]
618 pub digest: ::core::option::Option<::prost::alloc::string::String>,
619 #[prost(string, optional, tag = "5")]
622 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
623}
624pub mod unchanged_consensus_object {
626 #[non_exhaustive]
627 #[derive(
628 Clone,
629 Copy,
630 Debug,
631 PartialEq,
632 Eq,
633 Hash,
634 PartialOrd,
635 Ord,
636 ::prost::Enumeration
637 )]
638 #[repr(i32)]
639 pub enum UnchangedConsensusObjectKind {
640 Unknown = 0,
641 ReadOnlyRoot = 1,
643 MutateConsensusStreamEnded = 2,
645 ReadConsensusStreamEnded = 3,
647 Canceled = 4,
650 PerEpochConfig = 5,
654 }
655 impl UnchangedConsensusObjectKind {
656 pub fn as_str_name(&self) -> &'static str {
661 match self {
662 Self::Unknown => "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN",
663 Self::ReadOnlyRoot => "READ_ONLY_ROOT",
664 Self::MutateConsensusStreamEnded => "MUTATE_CONSENSUS_STREAM_ENDED",
665 Self::ReadConsensusStreamEnded => "READ_CONSENSUS_STREAM_ENDED",
666 Self::Canceled => "CANCELED",
667 Self::PerEpochConfig => "PER_EPOCH_CONFIG",
668 }
669 }
670 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
672 match value {
673 "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN" => Some(Self::Unknown),
674 "READ_ONLY_ROOT" => Some(Self::ReadOnlyRoot),
675 "MUTATE_CONSENSUS_STREAM_ENDED" => Some(Self::MutateConsensusStreamEnded),
676 "READ_CONSENSUS_STREAM_ENDED" => Some(Self::ReadConsensusStreamEnded),
677 "CANCELED" => Some(Self::Canceled),
678 "PER_EPOCH_CONFIG" => Some(Self::PerEpochConfig),
679 _ => None,
680 }
681 }
682 }
683}
684#[non_exhaustive]
685#[derive(Clone, PartialEq, ::prost::Message)]
686pub struct Epoch {
687 #[prost(uint64, optional, tag = "1")]
688 pub epoch: ::core::option::Option<u64>,
689 #[prost(message, optional, tag = "2")]
691 pub committee: ::core::option::Option<ValidatorCommittee>,
692 #[prost(message, optional, boxed, tag = "3")]
696 pub system_state: ::core::option::Option<::prost::alloc::boxed::Box<SystemState>>,
697 #[prost(uint64, optional, tag = "4")]
698 pub first_checkpoint: ::core::option::Option<u64>,
699 #[prost(uint64, optional, tag = "5")]
700 pub last_checkpoint: ::core::option::Option<u64>,
701 #[prost(message, optional, tag = "6")]
702 pub start: ::core::option::Option<::prost_types::Timestamp>,
703 #[prost(message, optional, tag = "7")]
704 pub end: ::core::option::Option<::prost_types::Timestamp>,
705 #[prost(uint64, optional, tag = "8")]
707 pub reference_gas_price: ::core::option::Option<u64>,
708 #[prost(message, optional, tag = "9")]
709 pub protocol_config: ::core::option::Option<ProtocolConfig>,
710}
711#[non_exhaustive]
712#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
713#[repr(i32)]
714pub enum ErrorReason {
715 Unknown = 0,
716 FieldInvalid = 1,
717 FieldMissing = 2,
718}
719impl ErrorReason {
720 pub fn as_str_name(&self) -> &'static str {
725 match self {
726 Self::Unknown => "ERROR_REASON_UNKNOWN",
727 Self::FieldInvalid => "FIELD_INVALID",
728 Self::FieldMissing => "FIELD_MISSING",
729 }
730 }
731 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
733 match value {
734 "ERROR_REASON_UNKNOWN" => Some(Self::Unknown),
735 "FIELD_INVALID" => Some(Self::FieldInvalid),
736 "FIELD_MISSING" => Some(Self::FieldMissing),
737 _ => None,
738 }
739 }
740}
741#[non_exhaustive]
743#[derive(Clone, PartialEq, ::prost::Message)]
744pub struct TransactionEvents {
745 #[prost(message, optional, tag = "1")]
747 pub bcs: ::core::option::Option<Bcs>,
748 #[prost(string, optional, tag = "2")]
750 pub digest: ::core::option::Option<::prost::alloc::string::String>,
751 #[prost(message, repeated, tag = "3")]
753 pub events: ::prost::alloc::vec::Vec<Event>,
754}
755#[non_exhaustive]
757#[derive(Clone, PartialEq, ::prost::Message)]
758pub struct Event {
759 #[prost(string, optional, tag = "1")]
762 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
763 #[prost(string, optional, tag = "2")]
766 pub module: ::core::option::Option<::prost::alloc::string::String>,
767 #[prost(string, optional, tag = "3")]
769 pub sender: ::core::option::Option<::prost::alloc::string::String>,
770 #[prost(string, optional, tag = "4")]
772 pub event_type: ::core::option::Option<::prost::alloc::string::String>,
773 #[prost(message, optional, tag = "5")]
775 pub contents: ::core::option::Option<Bcs>,
776 #[prost(message, optional, boxed, tag = "6")]
778 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
779}
780#[non_exhaustive]
781#[derive(Clone, PartialEq, ::prost::Message)]
782pub struct ExecutedTransaction {
783 #[prost(string, optional, tag = "1")]
785 pub digest: ::core::option::Option<::prost::alloc::string::String>,
786 #[prost(message, optional, tag = "2")]
788 pub transaction: ::core::option::Option<Transaction>,
789 #[prost(message, repeated, tag = "3")]
792 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
793 #[prost(message, optional, tag = "4")]
795 pub effects: ::core::option::Option<TransactionEffects>,
796 #[prost(message, optional, tag = "5")]
803 pub events: ::core::option::Option<TransactionEvents>,
804 #[prost(uint64, optional, tag = "6")]
806 pub checkpoint: ::core::option::Option<u64>,
807 #[prost(message, optional, tag = "7")]
809 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
810 #[prost(message, repeated, tag = "8")]
811 pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
812 #[prost(message, optional, tag = "9")]
815 pub objects: ::core::option::Option<ObjectSet>,
816}
817#[non_exhaustive]
819#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
820pub struct ExecutionStatus {
821 #[prost(bool, optional, tag = "1")]
823 pub success: ::core::option::Option<bool>,
824 #[prost(message, optional, tag = "2")]
826 pub error: ::core::option::Option<ExecutionError>,
827}
828#[non_exhaustive]
830#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
831pub struct ExecutionError {
832 #[prost(string, optional, tag = "1")]
834 pub description: ::core::option::Option<::prost::alloc::string::String>,
835 #[prost(uint64, optional, tag = "2")]
837 pub command: ::core::option::Option<u64>,
838 #[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
839 pub kind: ::core::option::Option<i32>,
840 #[prost(
841 oneof = "execution_error::ErrorDetails",
842 tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
843 )]
844 pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
845}
846pub mod execution_error {
848 #[non_exhaustive]
849 #[derive(
850 Clone,
851 Copy,
852 Debug,
853 PartialEq,
854 Eq,
855 Hash,
856 PartialOrd,
857 Ord,
858 ::prost::Enumeration
859 )]
860 #[repr(i32)]
861 pub enum ExecutionErrorKind {
862 Unknown = 0,
863 InsufficientGas = 1,
865 InvalidGasObject = 2,
867 InvariantViolation = 3,
869 FeatureNotYetSupported = 4,
871 ObjectTooBig = 5,
873 PackageTooBig = 6,
875 CircularObjectOwnership = 7,
877 InsufficientCoinBalance = 8,
879 CoinBalanceOverflow = 9,
881 PublishErrorNonZeroAddress = 10,
884 SuiMoveVerificationError = 11,
886 MovePrimitiveRuntimeError = 12,
890 MoveAbort = 13,
892 VmVerificationOrDeserializationError = 14,
894 VmInvariantViolation = 15,
896 FunctionNotFound = 16,
898 ArityMismatch = 17,
901 TypeArityMismatch = 18,
904 NonEntryFunctionInvoked = 19,
906 CommandArgumentError = 20,
908 TypeArgumentError = 21,
910 UnusedValueWithoutDrop = 22,
912 InvalidPublicFunctionReturnType = 23,
915 InvalidTransferObject = 24,
917 EffectsTooLarge = 25,
919 PublishUpgradeMissingDependency = 26,
921 PublishUpgradeDependencyDowngrade = 27,
927 PackageUpgradeError = 28,
929 WrittenObjectsTooLarge = 29,
931 CertificateDenied = 30,
933 SuiMoveVerificationTimedout = 31,
935 ConsensusObjectOperationNotAllowed = 32,
937 InputObjectDeleted = 33,
939 ExecutionCanceledDueToConsensusObjectCongestion = 34,
941 AddressDeniedForCoin = 35,
943 CoinTypeGlobalPause = 36,
945 ExecutionCanceledDueToRandomnessUnavailable = 37,
947 MoveVectorElemTooBig = 38,
951 MoveRawValueTooBig = 39,
955 InvalidLinkage = 40,
957 InsufficientFundsForWithdraw = 41,
959 NonExclusiveWriteInputObjectModified = 42,
961 }
962 impl ExecutionErrorKind {
963 pub fn as_str_name(&self) -> &'static str {
968 match self {
969 Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
970 Self::InsufficientGas => "INSUFFICIENT_GAS",
971 Self::InvalidGasObject => "INVALID_GAS_OBJECT",
972 Self::InvariantViolation => "INVARIANT_VIOLATION",
973 Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
974 Self::ObjectTooBig => "OBJECT_TOO_BIG",
975 Self::PackageTooBig => "PACKAGE_TOO_BIG",
976 Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
977 Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
978 Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
979 Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
980 Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
981 Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
982 Self::MoveAbort => "MOVE_ABORT",
983 Self::VmVerificationOrDeserializationError => {
984 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
985 }
986 Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
987 Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
988 Self::ArityMismatch => "ARITY_MISMATCH",
989 Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
990 Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
991 Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
992 Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
993 Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
994 Self::InvalidPublicFunctionReturnType => {
995 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
996 }
997 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
998 Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
999 Self::PublishUpgradeMissingDependency => {
1000 "PUBLISH_UPGRADE_MISSING_DEPENDENCY"
1001 }
1002 Self::PublishUpgradeDependencyDowngrade => {
1003 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
1004 }
1005 Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
1006 Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
1007 Self::CertificateDenied => "CERTIFICATE_DENIED",
1008 Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
1009 Self::ConsensusObjectOperationNotAllowed => {
1010 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1011 }
1012 Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
1013 Self::ExecutionCanceledDueToConsensusObjectCongestion => {
1014 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION"
1015 }
1016 Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
1017 Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
1018 Self::ExecutionCanceledDueToRandomnessUnavailable => {
1019 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
1020 }
1021 Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
1022 Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
1023 Self::InvalidLinkage => "INVALID_LINKAGE",
1024 Self::InsufficientFundsForWithdraw => "INSUFFICIENT_FUNDS_FOR_WITHDRAW",
1025 Self::NonExclusiveWriteInputObjectModified => {
1026 "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED"
1027 }
1028 }
1029 }
1030 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1032 match value {
1033 "EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1034 "INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
1035 "INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
1036 "INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
1037 "FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
1038 "OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
1039 "PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
1040 "CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
1041 "INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
1042 "COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
1043 "PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
1044 Some(Self::PublishErrorNonZeroAddress)
1045 }
1046 "SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
1047 "MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
1048 "MOVE_ABORT" => Some(Self::MoveAbort),
1049 "VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
1050 Some(Self::VmVerificationOrDeserializationError)
1051 }
1052 "VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
1053 "FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
1054 "ARITY_MISMATCH" => Some(Self::ArityMismatch),
1055 "TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
1056 "NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
1057 "COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
1058 "TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
1059 "UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
1060 "INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
1061 Some(Self::InvalidPublicFunctionReturnType)
1062 }
1063 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1064 "EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
1065 "PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
1066 Some(Self::PublishUpgradeMissingDependency)
1067 }
1068 "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
1069 Some(Self::PublishUpgradeDependencyDowngrade)
1070 }
1071 "PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
1072 "WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
1073 "CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
1074 "SUI_MOVE_VERIFICATION_TIMEDOUT" => {
1075 Some(Self::SuiMoveVerificationTimedout)
1076 }
1077 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1078 Some(Self::ConsensusObjectOperationNotAllowed)
1079 }
1080 "INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
1081 "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION" => {
1082 Some(Self::ExecutionCanceledDueToConsensusObjectCongestion)
1083 }
1084 "ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
1085 "COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
1086 "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
1087 Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
1088 }
1089 "MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
1090 "MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
1091 "INVALID_LINKAGE" => Some(Self::InvalidLinkage),
1092 "INSUFFICIENT_FUNDS_FOR_WITHDRAW" => {
1093 Some(Self::InsufficientFundsForWithdraw)
1094 }
1095 "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED" => {
1096 Some(Self::NonExclusiveWriteInputObjectModified)
1097 }
1098 _ => None,
1099 }
1100 }
1101 }
1102 #[non_exhaustive]
1103 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1104 pub enum ErrorDetails {
1105 #[prost(message, tag = "4")]
1106 Abort(super::MoveAbort),
1107 #[prost(message, tag = "5")]
1108 SizeError(super::SizeError),
1109 #[prost(message, tag = "6")]
1110 CommandArgumentError(super::CommandArgumentError),
1111 #[prost(message, tag = "7")]
1112 TypeArgumentError(super::TypeArgumentError),
1113 #[prost(message, tag = "8")]
1114 PackageUpgradeError(super::PackageUpgradeError),
1115 #[prost(message, tag = "9")]
1116 IndexError(super::IndexError),
1117 #[prost(string, tag = "10")]
1118 ObjectId(::prost::alloc::string::String),
1119 #[prost(message, tag = "11")]
1120 CoinDenyListError(super::CoinDenyListError),
1121 #[prost(message, tag = "12")]
1123 CongestedObjects(super::CongestedObjects),
1124 }
1125}
1126#[non_exhaustive]
1127#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1128pub struct MoveAbort {
1129 #[prost(uint64, optional, tag = "1")]
1130 pub abort_code: ::core::option::Option<u64>,
1131 #[prost(message, optional, tag = "2")]
1133 pub location: ::core::option::Option<MoveLocation>,
1134 #[prost(message, optional, tag = "3")]
1136 pub clever_error: ::core::option::Option<CleverError>,
1137}
1138#[non_exhaustive]
1140#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1141pub struct MoveLocation {
1142 #[prost(string, optional, tag = "1")]
1144 pub package: ::core::option::Option<::prost::alloc::string::String>,
1145 #[prost(string, optional, tag = "2")]
1147 pub module: ::core::option::Option<::prost::alloc::string::String>,
1148 #[prost(uint32, optional, tag = "3")]
1150 pub function: ::core::option::Option<u32>,
1151 #[prost(uint32, optional, tag = "4")]
1153 pub instruction: ::core::option::Option<u32>,
1154 #[prost(string, optional, tag = "5")]
1156 pub function_name: ::core::option::Option<::prost::alloc::string::String>,
1157}
1158#[non_exhaustive]
1159#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1160pub struct CleverError {
1161 #[prost(uint64, optional, tag = "1")]
1162 pub error_code: ::core::option::Option<u64>,
1163 #[prost(uint64, optional, tag = "2")]
1164 pub line_number: ::core::option::Option<u64>,
1165 #[prost(string, optional, tag = "3")]
1166 pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
1167 #[prost(string, optional, tag = "4")]
1168 pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
1169 #[prost(oneof = "clever_error::Value", tags = "5, 6")]
1170 pub value: ::core::option::Option<clever_error::Value>,
1171}
1172pub mod clever_error {
1174 #[non_exhaustive]
1175 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1176 pub enum Value {
1177 #[prost(string, tag = "5")]
1178 Rendered(::prost::alloc::string::String),
1179 #[prost(bytes, tag = "6")]
1180 Raw(::prost::bytes::Bytes),
1181 }
1182}
1183#[non_exhaustive]
1185#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1186pub struct SizeError {
1187 #[prost(uint64, optional, tag = "1")]
1189 pub size: ::core::option::Option<u64>,
1190 #[prost(uint64, optional, tag = "2")]
1192 pub max_size: ::core::option::Option<u64>,
1193}
1194#[non_exhaustive]
1195#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1196pub struct IndexError {
1197 #[prost(uint32, optional, tag = "1")]
1199 pub index: ::core::option::Option<u32>,
1200 #[prost(uint32, optional, tag = "2")]
1202 pub subresult: ::core::option::Option<u32>,
1203}
1204#[non_exhaustive]
1205#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1206pub struct CoinDenyListError {
1207 #[prost(string, optional, tag = "1")]
1209 pub address: ::core::option::Option<::prost::alloc::string::String>,
1210 #[prost(string, optional, tag = "2")]
1212 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1213}
1214#[non_exhaustive]
1216#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1217pub struct CongestedObjects {
1218 #[prost(string, repeated, tag = "1")]
1219 pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1220}
1221#[non_exhaustive]
1223#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1224pub struct CommandArgumentError {
1225 #[prost(uint32, optional, tag = "1")]
1227 pub argument: ::core::option::Option<u32>,
1228 #[prost(
1229 enumeration = "command_argument_error::CommandArgumentErrorKind",
1230 optional,
1231 tag = "2"
1232 )]
1233 pub kind: ::core::option::Option<i32>,
1234 #[prost(message, optional, tag = "3")]
1235 pub index_error: ::core::option::Option<IndexError>,
1236}
1237pub mod command_argument_error {
1239 #[non_exhaustive]
1240 #[derive(
1241 Clone,
1242 Copy,
1243 Debug,
1244 PartialEq,
1245 Eq,
1246 Hash,
1247 PartialOrd,
1248 Ord,
1249 ::prost::Enumeration
1250 )]
1251 #[repr(i32)]
1252 pub enum CommandArgumentErrorKind {
1253 Unknown = 0,
1254 TypeMismatch = 1,
1256 InvalidBcsBytes = 2,
1258 InvalidUsageOfPureArgument = 3,
1260 InvalidArgumentToPrivateEntryFunction = 4,
1263 IndexOutOfBounds = 5,
1267 SecondaryIndexOutOfBounds = 6,
1271 InvalidResultArity = 7,
1275 InvalidGasCoinUsage = 8,
1278 InvalidValueUsage = 9,
1283 InvalidObjectByValue = 10,
1285 InvalidObjectByMutRef = 11,
1287 ConsensusObjectOperationNotAllowed = 12,
1290 InvalidArgumentArity = 13,
1293 InvalidTransferObject = 14,
1295 InvalidMakeMoveVecNonObjectArgument = 15,
1298 ArgumentWithoutValue = 16,
1300 CannotMoveBorrowedValue = 17,
1305 CannotWriteToExtendedReference = 18,
1309 InvalidReferenceArgument = 19,
1313 }
1314 impl CommandArgumentErrorKind {
1315 pub fn as_str_name(&self) -> &'static str {
1320 match self {
1321 Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1322 Self::TypeMismatch => "TYPE_MISMATCH",
1323 Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1324 Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1325 Self::InvalidArgumentToPrivateEntryFunction => {
1326 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1327 }
1328 Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1329 Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1330 Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1331 Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1332 Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1333 Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1334 Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1335 Self::ConsensusObjectOperationNotAllowed => {
1336 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1337 }
1338 Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1339 Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1340 Self::InvalidMakeMoveVecNonObjectArgument => {
1341 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1342 }
1343 Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1344 Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1345 Self::CannotWriteToExtendedReference => {
1346 "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1347 }
1348 Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1349 }
1350 }
1351 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1353 match value {
1354 "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1355 "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1356 "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1357 "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1358 Some(Self::InvalidUsageOfPureArgument)
1359 }
1360 "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1361 Some(Self::InvalidArgumentToPrivateEntryFunction)
1362 }
1363 "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1364 "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1365 "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1366 "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1367 "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1368 "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1369 "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1370 "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1371 Some(Self::ConsensusObjectOperationNotAllowed)
1372 }
1373 "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1374 "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1375 "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1376 Some(Self::InvalidMakeMoveVecNonObjectArgument)
1377 }
1378 "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1379 "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1380 "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1381 Some(Self::CannotWriteToExtendedReference)
1382 }
1383 "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1384 _ => None,
1385 }
1386 }
1387 }
1388}
1389#[non_exhaustive]
1391#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1392pub struct PackageUpgradeError {
1393 #[prost(
1394 enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1395 optional,
1396 tag = "1"
1397 )]
1398 pub kind: ::core::option::Option<i32>,
1399 #[prost(string, optional, tag = "2")]
1401 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1402 #[prost(string, optional, tag = "3")]
1404 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1405 #[prost(uint32, optional, tag = "4")]
1407 pub policy: ::core::option::Option<u32>,
1408 #[prost(string, optional, tag = "5")]
1410 pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1411}
1412pub mod package_upgrade_error {
1414 #[non_exhaustive]
1415 #[derive(
1416 Clone,
1417 Copy,
1418 Debug,
1419 PartialEq,
1420 Eq,
1421 Hash,
1422 PartialOrd,
1423 Ord,
1424 ::prost::Enumeration
1425 )]
1426 #[repr(i32)]
1427 pub enum PackageUpgradeErrorKind {
1428 Unknown = 0,
1429 UnableToFetchPackage = 1,
1431 NotAPackage = 2,
1433 IncompatibleUpgrade = 3,
1435 DigestDoesNotMatch = 4,
1437 UnknownUpgradePolicy = 5,
1439 PackageIdDoesNotMatch = 6,
1441 }
1442 impl PackageUpgradeErrorKind {
1443 pub fn as_str_name(&self) -> &'static str {
1448 match self {
1449 Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1450 Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1451 Self::NotAPackage => "NOT_A_PACKAGE",
1452 Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1453 Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1454 Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1455 Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1456 }
1457 }
1458 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1460 match value {
1461 "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1462 "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1463 "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1464 "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1465 "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1466 "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1467 "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1468 _ => None,
1469 }
1470 }
1471 }
1472}
1473#[non_exhaustive]
1475#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1476pub struct TypeArgumentError {
1477 #[prost(uint32, optional, tag = "1")]
1479 pub type_argument: ::core::option::Option<u32>,
1480 #[prost(
1481 enumeration = "type_argument_error::TypeArgumentErrorKind",
1482 optional,
1483 tag = "2"
1484 )]
1485 pub kind: ::core::option::Option<i32>,
1486}
1487pub mod type_argument_error {
1489 #[non_exhaustive]
1490 #[derive(
1491 Clone,
1492 Copy,
1493 Debug,
1494 PartialEq,
1495 Eq,
1496 Hash,
1497 PartialOrd,
1498 Ord,
1499 ::prost::Enumeration
1500 )]
1501 #[repr(i32)]
1502 pub enum TypeArgumentErrorKind {
1503 Unknown = 0,
1504 TypeNotFound = 1,
1506 ConstraintNotSatisfied = 2,
1508 }
1509 impl TypeArgumentErrorKind {
1510 pub fn as_str_name(&self) -> &'static str {
1515 match self {
1516 Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1517 Self::TypeNotFound => "TYPE_NOT_FOUND",
1518 Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1519 }
1520 }
1521 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1523 match value {
1524 "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1525 "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1526 "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1527 _ => None,
1528 }
1529 }
1530 }
1531}
1532#[non_exhaustive]
1534#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1535pub struct GasCostSummary {
1536 #[prost(uint64, optional, tag = "1")]
1538 pub computation_cost: ::core::option::Option<u64>,
1539 #[prost(uint64, optional, tag = "2")]
1541 pub storage_cost: ::core::option::Option<u64>,
1542 #[prost(uint64, optional, tag = "3")]
1545 pub storage_rebate: ::core::option::Option<u64>,
1546 #[prost(uint64, optional, tag = "4")]
1548 pub non_refundable_storage_fee: ::core::option::Option<u64>,
1549}
1550#[non_exhaustive]
1552#[derive(Clone, PartialEq, ::prost::Message)]
1553pub struct Input {
1554 #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1555 pub kind: ::core::option::Option<i32>,
1556 #[prost(bytes = "bytes", optional, tag = "2")]
1561 pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1562 #[prost(string, optional, tag = "3")]
1564 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1565 #[prost(uint64, optional, tag = "4")]
1569 pub version: ::core::option::Option<u64>,
1570 #[prost(string, optional, tag = "5")]
1572 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1573 #[prost(bool, optional, tag = "6")]
1576 pub mutable: ::core::option::Option<bool>,
1577 #[prost(enumeration = "input::Mutability", optional, tag = "7")]
1582 pub mutability: ::core::option::Option<i32>,
1583 #[prost(message, optional, tag = "8")]
1585 pub funds_withdrawal: ::core::option::Option<FundsWithdrawal>,
1586 #[prost(message, optional, boxed, tag = "1000")]
1590 pub literal: ::core::option::Option<
1591 ::prost::alloc::boxed::Box<::prost_types::Value>,
1592 >,
1593}
1594pub mod input {
1596 #[non_exhaustive]
1597 #[derive(
1598 Clone,
1599 Copy,
1600 Debug,
1601 PartialEq,
1602 Eq,
1603 Hash,
1604 PartialOrd,
1605 Ord,
1606 ::prost::Enumeration
1607 )]
1608 #[repr(i32)]
1609 pub enum InputKind {
1610 Unknown = 0,
1611 Pure = 1,
1613 ImmutableOrOwned = 2,
1615 Shared = 3,
1617 Receiving = 4,
1619 FundsWithdrawal = 5,
1621 }
1622 impl InputKind {
1623 pub fn as_str_name(&self) -> &'static str {
1628 match self {
1629 Self::Unknown => "INPUT_KIND_UNKNOWN",
1630 Self::Pure => "PURE",
1631 Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
1632 Self::Shared => "SHARED",
1633 Self::Receiving => "RECEIVING",
1634 Self::FundsWithdrawal => "FUNDS_WITHDRAWAL",
1635 }
1636 }
1637 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1639 match value {
1640 "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
1641 "PURE" => Some(Self::Pure),
1642 "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
1643 "SHARED" => Some(Self::Shared),
1644 "RECEIVING" => Some(Self::Receiving),
1645 "FUNDS_WITHDRAWAL" => Some(Self::FundsWithdrawal),
1646 _ => None,
1647 }
1648 }
1649 }
1650 #[non_exhaustive]
1651 #[derive(
1652 Clone,
1653 Copy,
1654 Debug,
1655 PartialEq,
1656 Eq,
1657 Hash,
1658 PartialOrd,
1659 Ord,
1660 ::prost::Enumeration
1661 )]
1662 #[repr(i32)]
1663 pub enum Mutability {
1664 Unknown = 0,
1665 Immutable = 1,
1666 Mutable = 2,
1667 NonExclusiveWrite = 3,
1671 }
1672 impl Mutability {
1673 pub fn as_str_name(&self) -> &'static str {
1678 match self {
1679 Self::Unknown => "MUTABILITY_UNKNOWN",
1680 Self::Immutable => "IMMUTABLE",
1681 Self::Mutable => "MUTABLE",
1682 Self::NonExclusiveWrite => "NON_EXCLUSIVE_WRITE",
1683 }
1684 }
1685 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1687 match value {
1688 "MUTABILITY_UNKNOWN" => Some(Self::Unknown),
1689 "IMMUTABLE" => Some(Self::Immutable),
1690 "MUTABLE" => Some(Self::Mutable),
1691 "NON_EXCLUSIVE_WRITE" => Some(Self::NonExclusiveWrite),
1692 _ => None,
1693 }
1694 }
1695 }
1696}
1697#[non_exhaustive]
1698#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1699pub struct FundsWithdrawal {
1700 #[prost(uint64, optional, tag = "1")]
1701 pub amount: ::core::option::Option<u64>,
1702 #[prost(string, optional, tag = "2")]
1703 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1704 #[prost(enumeration = "funds_withdrawal::Source", optional, tag = "3")]
1705 pub source: ::core::option::Option<i32>,
1706}
1707pub mod funds_withdrawal {
1709 #[non_exhaustive]
1710 #[derive(
1711 Clone,
1712 Copy,
1713 Debug,
1714 PartialEq,
1715 Eq,
1716 Hash,
1717 PartialOrd,
1718 Ord,
1719 ::prost::Enumeration
1720 )]
1721 #[repr(i32)]
1722 pub enum Source {
1723 Unknown = 0,
1724 Sender = 1,
1725 Sponsor = 2,
1726 }
1727 impl Source {
1728 pub fn as_str_name(&self) -> &'static str {
1733 match self {
1734 Self::Unknown => "SOURCE_UNKNOWN",
1735 Self::Sender => "SENDER",
1736 Self::Sponsor => "SPONSOR",
1737 }
1738 }
1739 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1741 match value {
1742 "SOURCE_UNKNOWN" => Some(Self::Unknown),
1743 "SENDER" => Some(Self::Sender),
1744 "SPONSOR" => Some(Self::Sponsor),
1745 _ => None,
1746 }
1747 }
1748 }
1749}
1750#[non_exhaustive]
1752#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1753pub struct JwkId {
1754 #[prost(string, optional, tag = "1")]
1756 pub iss: ::core::option::Option<::prost::alloc::string::String>,
1757 #[prost(string, optional, tag = "2")]
1759 pub kid: ::core::option::Option<::prost::alloc::string::String>,
1760}
1761#[non_exhaustive]
1767#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1768pub struct Jwk {
1769 #[prost(string, optional, tag = "1")]
1771 pub kty: ::core::option::Option<::prost::alloc::string::String>,
1772 #[prost(string, optional, tag = "2")]
1774 pub e: ::core::option::Option<::prost::alloc::string::String>,
1775 #[prost(string, optional, tag = "3")]
1777 pub n: ::core::option::Option<::prost::alloc::string::String>,
1778 #[prost(string, optional, tag = "4")]
1780 pub alg: ::core::option::Option<::prost::alloc::string::String>,
1781}
1782#[non_exhaustive]
1783#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1784pub struct GetServiceInfoRequest {}
1785#[non_exhaustive]
1786#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1787pub struct GetServiceInfoResponse {
1788 #[prost(string, optional, tag = "1")]
1793 pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
1794 #[prost(string, optional, tag = "2")]
1798 pub chain: ::core::option::Option<::prost::alloc::string::String>,
1799 #[prost(uint64, optional, tag = "3")]
1801 pub epoch: ::core::option::Option<u64>,
1802 #[prost(uint64, optional, tag = "4")]
1804 pub checkpoint_height: ::core::option::Option<u64>,
1805 #[prost(message, optional, tag = "5")]
1807 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
1808 #[prost(uint64, optional, tag = "6")]
1810 pub lowest_available_checkpoint: ::core::option::Option<u64>,
1811 #[prost(uint64, optional, tag = "7")]
1813 pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
1814 #[prost(string, optional, tag = "8")]
1816 pub server: ::core::option::Option<::prost::alloc::string::String>,
1817}
1818#[non_exhaustive]
1819#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1820pub struct GetObjectRequest {
1821 #[prost(string, optional, tag = "1")]
1823 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1824 #[prost(uint64, optional, tag = "2")]
1828 pub version: ::core::option::Option<u64>,
1829 #[prost(message, optional, tag = "3")]
1832 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1833}
1834#[non_exhaustive]
1835#[derive(Clone, PartialEq, ::prost::Message)]
1836pub struct GetObjectResponse {
1837 #[prost(message, optional, tag = "1")]
1838 pub object: ::core::option::Option<Object>,
1839}
1840#[non_exhaustive]
1841#[derive(Clone, PartialEq, ::prost::Message)]
1842pub struct BatchGetObjectsRequest {
1843 #[prost(message, repeated, tag = "1")]
1844 pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
1845 #[prost(message, optional, tag = "2")]
1848 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1849}
1850#[non_exhaustive]
1851#[derive(Clone, PartialEq, ::prost::Message)]
1852pub struct BatchGetObjectsResponse {
1853 #[prost(message, repeated, tag = "1")]
1854 pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
1855}
1856#[non_exhaustive]
1857#[derive(Clone, PartialEq, ::prost::Message)]
1858pub struct GetObjectResult {
1859 #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
1860 pub result: ::core::option::Option<get_object_result::Result>,
1861}
1862pub mod get_object_result {
1864 #[non_exhaustive]
1865 #[derive(Clone, PartialEq, ::prost::Oneof)]
1866 pub enum Result {
1867 #[prost(message, tag = "1")]
1868 Object(super::Object),
1869 #[prost(message, tag = "2")]
1870 Error(super::super::super::super::google::rpc::Status),
1871 }
1872}
1873#[non_exhaustive]
1874#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1875pub struct GetTransactionRequest {
1876 #[prost(string, optional, tag = "1")]
1878 pub digest: ::core::option::Option<::prost::alloc::string::String>,
1879 #[prost(message, optional, tag = "2")]
1882 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1883}
1884#[non_exhaustive]
1885#[derive(Clone, PartialEq, ::prost::Message)]
1886pub struct GetTransactionResponse {
1887 #[prost(message, optional, tag = "1")]
1888 pub transaction: ::core::option::Option<ExecutedTransaction>,
1889}
1890#[non_exhaustive]
1891#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1892pub struct BatchGetTransactionsRequest {
1893 #[prost(string, repeated, tag = "1")]
1895 pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1896 #[prost(message, optional, tag = "2")]
1899 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1900}
1901#[non_exhaustive]
1902#[derive(Clone, PartialEq, ::prost::Message)]
1903pub struct BatchGetTransactionsResponse {
1904 #[prost(message, repeated, tag = "1")]
1905 pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
1906}
1907#[non_exhaustive]
1908#[derive(Clone, PartialEq, ::prost::Message)]
1909pub struct GetTransactionResult {
1910 #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
1911 pub result: ::core::option::Option<get_transaction_result::Result>,
1912}
1913pub mod get_transaction_result {
1915 #[non_exhaustive]
1916 #[derive(Clone, PartialEq, ::prost::Oneof)]
1917 pub enum Result {
1918 #[prost(message, tag = "1")]
1919 Transaction(super::ExecutedTransaction),
1920 #[prost(message, tag = "2")]
1921 Error(super::super::super::super::google::rpc::Status),
1922 }
1923}
1924#[non_exhaustive]
1925#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1926pub struct GetCheckpointRequest {
1927 #[prost(message, optional, tag = "3")]
1930 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1931 #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
1933 pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
1934}
1935pub mod get_checkpoint_request {
1937 #[non_exhaustive]
1939 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1940 pub enum CheckpointId {
1941 #[prost(uint64, tag = "1")]
1943 SequenceNumber(u64),
1944 #[prost(string, tag = "2")]
1946 Digest(::prost::alloc::string::String),
1947 }
1948}
1949#[non_exhaustive]
1950#[derive(Clone, PartialEq, ::prost::Message)]
1951pub struct GetCheckpointResponse {
1952 #[prost(message, optional, tag = "1")]
1953 pub checkpoint: ::core::option::Option<Checkpoint>,
1954}
1955#[non_exhaustive]
1956#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1957pub struct GetEpochRequest {
1958 #[prost(uint64, optional, tag = "1")]
1961 pub epoch: ::core::option::Option<u64>,
1962 #[prost(message, optional, tag = "2")]
1965 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1966}
1967#[non_exhaustive]
1968#[derive(Clone, PartialEq, ::prost::Message)]
1969pub struct GetEpochResponse {
1970 #[prost(message, optional, tag = "1")]
1971 pub epoch: ::core::option::Option<Epoch>,
1972}
1973pub mod ledger_service_client {
1975 #![allow(
1976 unused_variables,
1977 dead_code,
1978 missing_docs,
1979 clippy::wildcard_imports,
1980 clippy::let_unit_value,
1981 )]
1982 use tonic::codegen::*;
1983 use tonic::codegen::http::Uri;
1984 #[derive(Debug, Clone)]
1985 pub struct LedgerServiceClient<T> {
1986 inner: tonic::client::Grpc<T>,
1987 }
1988 impl LedgerServiceClient<tonic::transport::Channel> {
1989 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1991 where
1992 D: TryInto<tonic::transport::Endpoint>,
1993 D::Error: Into<StdError>,
1994 {
1995 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1996 Ok(Self::new(conn))
1997 }
1998 }
1999 impl<T> LedgerServiceClient<T>
2000 where
2001 T: tonic::client::GrpcService<tonic::body::Body>,
2002 T::Error: Into<StdError>,
2003 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2004 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2005 {
2006 pub fn new(inner: T) -> Self {
2007 let inner = tonic::client::Grpc::new(inner);
2008 Self { inner }
2009 }
2010 pub fn with_origin(inner: T, origin: Uri) -> Self {
2011 let inner = tonic::client::Grpc::with_origin(inner, origin);
2012 Self { inner }
2013 }
2014 pub fn with_interceptor<F>(
2015 inner: T,
2016 interceptor: F,
2017 ) -> LedgerServiceClient<InterceptedService<T, F>>
2018 where
2019 F: tonic::service::Interceptor,
2020 T::ResponseBody: Default,
2021 T: tonic::codegen::Service<
2022 http::Request<tonic::body::Body>,
2023 Response = http::Response<
2024 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2025 >,
2026 >,
2027 <T as tonic::codegen::Service<
2028 http::Request<tonic::body::Body>,
2029 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2030 {
2031 LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
2032 }
2033 #[must_use]
2038 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2039 self.inner = self.inner.send_compressed(encoding);
2040 self
2041 }
2042 #[must_use]
2044 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2045 self.inner = self.inner.accept_compressed(encoding);
2046 self
2047 }
2048 #[must_use]
2052 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2053 self.inner = self.inner.max_decoding_message_size(limit);
2054 self
2055 }
2056 #[must_use]
2060 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2061 self.inner = self.inner.max_encoding_message_size(limit);
2062 self
2063 }
2064 pub async fn get_service_info(
2066 &mut self,
2067 request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
2068 ) -> std::result::Result<
2069 tonic::Response<super::GetServiceInfoResponse>,
2070 tonic::Status,
2071 > {
2072 self.inner
2073 .ready()
2074 .await
2075 .map_err(|e| {
2076 tonic::Status::unknown(
2077 format!("Service was not ready: {}", e.into()),
2078 )
2079 })?;
2080 let codec = tonic_prost::ProstCodec::default();
2081 let path = http::uri::PathAndQuery::from_static(
2082 "/sui.rpc.v2.LedgerService/GetServiceInfo",
2083 );
2084 let mut req = request.into_request();
2085 req.extensions_mut()
2086 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
2087 self.inner.unary(req, path, codec).await
2088 }
2089 pub async fn get_object(
2090 &mut self,
2091 request: impl tonic::IntoRequest<super::GetObjectRequest>,
2092 ) -> std::result::Result<
2093 tonic::Response<super::GetObjectResponse>,
2094 tonic::Status,
2095 > {
2096 self.inner
2097 .ready()
2098 .await
2099 .map_err(|e| {
2100 tonic::Status::unknown(
2101 format!("Service was not ready: {}", e.into()),
2102 )
2103 })?;
2104 let codec = tonic_prost::ProstCodec::default();
2105 let path = http::uri::PathAndQuery::from_static(
2106 "/sui.rpc.v2.LedgerService/GetObject",
2107 );
2108 let mut req = request.into_request();
2109 req.extensions_mut()
2110 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
2111 self.inner.unary(req, path, codec).await
2112 }
2113 pub async fn batch_get_objects(
2114 &mut self,
2115 request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
2116 ) -> std::result::Result<
2117 tonic::Response<super::BatchGetObjectsResponse>,
2118 tonic::Status,
2119 > {
2120 self.inner
2121 .ready()
2122 .await
2123 .map_err(|e| {
2124 tonic::Status::unknown(
2125 format!("Service was not ready: {}", e.into()),
2126 )
2127 })?;
2128 let codec = tonic_prost::ProstCodec::default();
2129 let path = http::uri::PathAndQuery::from_static(
2130 "/sui.rpc.v2.LedgerService/BatchGetObjects",
2131 );
2132 let mut req = request.into_request();
2133 req.extensions_mut()
2134 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
2135 self.inner.unary(req, path, codec).await
2136 }
2137 pub async fn get_transaction(
2138 &mut self,
2139 request: impl tonic::IntoRequest<super::GetTransactionRequest>,
2140 ) -> std::result::Result<
2141 tonic::Response<super::GetTransactionResponse>,
2142 tonic::Status,
2143 > {
2144 self.inner
2145 .ready()
2146 .await
2147 .map_err(|e| {
2148 tonic::Status::unknown(
2149 format!("Service was not ready: {}", e.into()),
2150 )
2151 })?;
2152 let codec = tonic_prost::ProstCodec::default();
2153 let path = http::uri::PathAndQuery::from_static(
2154 "/sui.rpc.v2.LedgerService/GetTransaction",
2155 );
2156 let mut req = request.into_request();
2157 req.extensions_mut()
2158 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
2159 self.inner.unary(req, path, codec).await
2160 }
2161 pub async fn batch_get_transactions(
2162 &mut self,
2163 request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
2164 ) -> std::result::Result<
2165 tonic::Response<super::BatchGetTransactionsResponse>,
2166 tonic::Status,
2167 > {
2168 self.inner
2169 .ready()
2170 .await
2171 .map_err(|e| {
2172 tonic::Status::unknown(
2173 format!("Service was not ready: {}", e.into()),
2174 )
2175 })?;
2176 let codec = tonic_prost::ProstCodec::default();
2177 let path = http::uri::PathAndQuery::from_static(
2178 "/sui.rpc.v2.LedgerService/BatchGetTransactions",
2179 );
2180 let mut req = request.into_request();
2181 req.extensions_mut()
2182 .insert(
2183 GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
2184 );
2185 self.inner.unary(req, path, codec).await
2186 }
2187 pub async fn get_checkpoint(
2188 &mut self,
2189 request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
2190 ) -> std::result::Result<
2191 tonic::Response<super::GetCheckpointResponse>,
2192 tonic::Status,
2193 > {
2194 self.inner
2195 .ready()
2196 .await
2197 .map_err(|e| {
2198 tonic::Status::unknown(
2199 format!("Service was not ready: {}", e.into()),
2200 )
2201 })?;
2202 let codec = tonic_prost::ProstCodec::default();
2203 let path = http::uri::PathAndQuery::from_static(
2204 "/sui.rpc.v2.LedgerService/GetCheckpoint",
2205 );
2206 let mut req = request.into_request();
2207 req.extensions_mut()
2208 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
2209 self.inner.unary(req, path, codec).await
2210 }
2211 pub async fn get_epoch(
2212 &mut self,
2213 request: impl tonic::IntoRequest<super::GetEpochRequest>,
2214 ) -> std::result::Result<
2215 tonic::Response<super::GetEpochResponse>,
2216 tonic::Status,
2217 > {
2218 self.inner
2219 .ready()
2220 .await
2221 .map_err(|e| {
2222 tonic::Status::unknown(
2223 format!("Service was not ready: {}", e.into()),
2224 )
2225 })?;
2226 let codec = tonic_prost::ProstCodec::default();
2227 let path = http::uri::PathAndQuery::from_static(
2228 "/sui.rpc.v2.LedgerService/GetEpoch",
2229 );
2230 let mut req = request.into_request();
2231 req.extensions_mut()
2232 .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
2233 self.inner.unary(req, path, codec).await
2234 }
2235 }
2236}
2237pub mod ledger_service_server {
2239 #![allow(
2240 unused_variables,
2241 dead_code,
2242 missing_docs,
2243 clippy::wildcard_imports,
2244 clippy::let_unit_value,
2245 )]
2246 use tonic::codegen::*;
2247 #[async_trait]
2249 pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2250 async fn get_service_info(
2252 &self,
2253 request: tonic::Request<super::GetServiceInfoRequest>,
2254 ) -> std::result::Result<
2255 tonic::Response<super::GetServiceInfoResponse>,
2256 tonic::Status,
2257 >;
2258 async fn get_object(
2259 &self,
2260 request: tonic::Request<super::GetObjectRequest>,
2261 ) -> std::result::Result<
2262 tonic::Response<super::GetObjectResponse>,
2263 tonic::Status,
2264 >;
2265 async fn batch_get_objects(
2266 &self,
2267 request: tonic::Request<super::BatchGetObjectsRequest>,
2268 ) -> std::result::Result<
2269 tonic::Response<super::BatchGetObjectsResponse>,
2270 tonic::Status,
2271 >;
2272 async fn get_transaction(
2273 &self,
2274 request: tonic::Request<super::GetTransactionRequest>,
2275 ) -> std::result::Result<
2276 tonic::Response<super::GetTransactionResponse>,
2277 tonic::Status,
2278 >;
2279 async fn batch_get_transactions(
2280 &self,
2281 request: tonic::Request<super::BatchGetTransactionsRequest>,
2282 ) -> std::result::Result<
2283 tonic::Response<super::BatchGetTransactionsResponse>,
2284 tonic::Status,
2285 >;
2286 async fn get_checkpoint(
2287 &self,
2288 request: tonic::Request<super::GetCheckpointRequest>,
2289 ) -> std::result::Result<
2290 tonic::Response<super::GetCheckpointResponse>,
2291 tonic::Status,
2292 >;
2293 async fn get_epoch(
2294 &self,
2295 request: tonic::Request<super::GetEpochRequest>,
2296 ) -> std::result::Result<
2297 tonic::Response<super::GetEpochResponse>,
2298 tonic::Status,
2299 >;
2300 }
2301 #[derive(Debug)]
2302 pub struct LedgerServiceServer<T> {
2303 inner: Arc<T>,
2304 accept_compression_encodings: EnabledCompressionEncodings,
2305 send_compression_encodings: EnabledCompressionEncodings,
2306 max_decoding_message_size: Option<usize>,
2307 max_encoding_message_size: Option<usize>,
2308 }
2309 impl<T> LedgerServiceServer<T> {
2310 pub fn new(inner: T) -> Self {
2311 Self::from_arc(Arc::new(inner))
2312 }
2313 pub fn from_arc(inner: Arc<T>) -> Self {
2314 Self {
2315 inner,
2316 accept_compression_encodings: Default::default(),
2317 send_compression_encodings: Default::default(),
2318 max_decoding_message_size: None,
2319 max_encoding_message_size: None,
2320 }
2321 }
2322 pub fn with_interceptor<F>(
2323 inner: T,
2324 interceptor: F,
2325 ) -> InterceptedService<Self, F>
2326 where
2327 F: tonic::service::Interceptor,
2328 {
2329 InterceptedService::new(Self::new(inner), interceptor)
2330 }
2331 #[must_use]
2333 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2334 self.accept_compression_encodings.enable(encoding);
2335 self
2336 }
2337 #[must_use]
2339 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2340 self.send_compression_encodings.enable(encoding);
2341 self
2342 }
2343 #[must_use]
2347 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2348 self.max_decoding_message_size = Some(limit);
2349 self
2350 }
2351 #[must_use]
2355 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2356 self.max_encoding_message_size = Some(limit);
2357 self
2358 }
2359 }
2360 impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
2361 where
2362 T: LedgerService,
2363 B: Body + std::marker::Send + 'static,
2364 B::Error: Into<StdError> + std::marker::Send + 'static,
2365 {
2366 type Response = http::Response<tonic::body::Body>;
2367 type Error = std::convert::Infallible;
2368 type Future = BoxFuture<Self::Response, Self::Error>;
2369 fn poll_ready(
2370 &mut self,
2371 _cx: &mut Context<'_>,
2372 ) -> Poll<std::result::Result<(), Self::Error>> {
2373 Poll::Ready(Ok(()))
2374 }
2375 fn call(&mut self, req: http::Request<B>) -> Self::Future {
2376 match req.uri().path() {
2377 "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
2378 #[allow(non_camel_case_types)]
2379 struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
2380 impl<
2381 T: LedgerService,
2382 > tonic::server::UnaryService<super::GetServiceInfoRequest>
2383 for GetServiceInfoSvc<T> {
2384 type Response = super::GetServiceInfoResponse;
2385 type Future = BoxFuture<
2386 tonic::Response<Self::Response>,
2387 tonic::Status,
2388 >;
2389 fn call(
2390 &mut self,
2391 request: tonic::Request<super::GetServiceInfoRequest>,
2392 ) -> Self::Future {
2393 let inner = Arc::clone(&self.0);
2394 let fut = async move {
2395 <T as LedgerService>::get_service_info(&inner, request)
2396 .await
2397 };
2398 Box::pin(fut)
2399 }
2400 }
2401 let accept_compression_encodings = self.accept_compression_encodings;
2402 let send_compression_encodings = self.send_compression_encodings;
2403 let max_decoding_message_size = self.max_decoding_message_size;
2404 let max_encoding_message_size = self.max_encoding_message_size;
2405 let inner = self.inner.clone();
2406 let fut = async move {
2407 let method = GetServiceInfoSvc(inner);
2408 let codec = tonic_prost::ProstCodec::default();
2409 let mut grpc = tonic::server::Grpc::new(codec)
2410 .apply_compression_config(
2411 accept_compression_encodings,
2412 send_compression_encodings,
2413 )
2414 .apply_max_message_size_config(
2415 max_decoding_message_size,
2416 max_encoding_message_size,
2417 );
2418 let res = grpc.unary(method, req).await;
2419 Ok(res)
2420 };
2421 Box::pin(fut)
2422 }
2423 "/sui.rpc.v2.LedgerService/GetObject" => {
2424 #[allow(non_camel_case_types)]
2425 struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
2426 impl<
2427 T: LedgerService,
2428 > tonic::server::UnaryService<super::GetObjectRequest>
2429 for GetObjectSvc<T> {
2430 type Response = super::GetObjectResponse;
2431 type Future = BoxFuture<
2432 tonic::Response<Self::Response>,
2433 tonic::Status,
2434 >;
2435 fn call(
2436 &mut self,
2437 request: tonic::Request<super::GetObjectRequest>,
2438 ) -> Self::Future {
2439 let inner = Arc::clone(&self.0);
2440 let fut = async move {
2441 <T as LedgerService>::get_object(&inner, request).await
2442 };
2443 Box::pin(fut)
2444 }
2445 }
2446 let accept_compression_encodings = self.accept_compression_encodings;
2447 let send_compression_encodings = self.send_compression_encodings;
2448 let max_decoding_message_size = self.max_decoding_message_size;
2449 let max_encoding_message_size = self.max_encoding_message_size;
2450 let inner = self.inner.clone();
2451 let fut = async move {
2452 let method = GetObjectSvc(inner);
2453 let codec = tonic_prost::ProstCodec::default();
2454 let mut grpc = tonic::server::Grpc::new(codec)
2455 .apply_compression_config(
2456 accept_compression_encodings,
2457 send_compression_encodings,
2458 )
2459 .apply_max_message_size_config(
2460 max_decoding_message_size,
2461 max_encoding_message_size,
2462 );
2463 let res = grpc.unary(method, req).await;
2464 Ok(res)
2465 };
2466 Box::pin(fut)
2467 }
2468 "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
2469 #[allow(non_camel_case_types)]
2470 struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
2471 impl<
2472 T: LedgerService,
2473 > tonic::server::UnaryService<super::BatchGetObjectsRequest>
2474 for BatchGetObjectsSvc<T> {
2475 type Response = super::BatchGetObjectsResponse;
2476 type Future = BoxFuture<
2477 tonic::Response<Self::Response>,
2478 tonic::Status,
2479 >;
2480 fn call(
2481 &mut self,
2482 request: tonic::Request<super::BatchGetObjectsRequest>,
2483 ) -> Self::Future {
2484 let inner = Arc::clone(&self.0);
2485 let fut = async move {
2486 <T as LedgerService>::batch_get_objects(&inner, request)
2487 .await
2488 };
2489 Box::pin(fut)
2490 }
2491 }
2492 let accept_compression_encodings = self.accept_compression_encodings;
2493 let send_compression_encodings = self.send_compression_encodings;
2494 let max_decoding_message_size = self.max_decoding_message_size;
2495 let max_encoding_message_size = self.max_encoding_message_size;
2496 let inner = self.inner.clone();
2497 let fut = async move {
2498 let method = BatchGetObjectsSvc(inner);
2499 let codec = tonic_prost::ProstCodec::default();
2500 let mut grpc = tonic::server::Grpc::new(codec)
2501 .apply_compression_config(
2502 accept_compression_encodings,
2503 send_compression_encodings,
2504 )
2505 .apply_max_message_size_config(
2506 max_decoding_message_size,
2507 max_encoding_message_size,
2508 );
2509 let res = grpc.unary(method, req).await;
2510 Ok(res)
2511 };
2512 Box::pin(fut)
2513 }
2514 "/sui.rpc.v2.LedgerService/GetTransaction" => {
2515 #[allow(non_camel_case_types)]
2516 struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
2517 impl<
2518 T: LedgerService,
2519 > tonic::server::UnaryService<super::GetTransactionRequest>
2520 for GetTransactionSvc<T> {
2521 type Response = super::GetTransactionResponse;
2522 type Future = BoxFuture<
2523 tonic::Response<Self::Response>,
2524 tonic::Status,
2525 >;
2526 fn call(
2527 &mut self,
2528 request: tonic::Request<super::GetTransactionRequest>,
2529 ) -> Self::Future {
2530 let inner = Arc::clone(&self.0);
2531 let fut = async move {
2532 <T as LedgerService>::get_transaction(&inner, request).await
2533 };
2534 Box::pin(fut)
2535 }
2536 }
2537 let accept_compression_encodings = self.accept_compression_encodings;
2538 let send_compression_encodings = self.send_compression_encodings;
2539 let max_decoding_message_size = self.max_decoding_message_size;
2540 let max_encoding_message_size = self.max_encoding_message_size;
2541 let inner = self.inner.clone();
2542 let fut = async move {
2543 let method = GetTransactionSvc(inner);
2544 let codec = tonic_prost::ProstCodec::default();
2545 let mut grpc = tonic::server::Grpc::new(codec)
2546 .apply_compression_config(
2547 accept_compression_encodings,
2548 send_compression_encodings,
2549 )
2550 .apply_max_message_size_config(
2551 max_decoding_message_size,
2552 max_encoding_message_size,
2553 );
2554 let res = grpc.unary(method, req).await;
2555 Ok(res)
2556 };
2557 Box::pin(fut)
2558 }
2559 "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
2560 #[allow(non_camel_case_types)]
2561 struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
2562 impl<
2563 T: LedgerService,
2564 > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
2565 for BatchGetTransactionsSvc<T> {
2566 type Response = super::BatchGetTransactionsResponse;
2567 type Future = BoxFuture<
2568 tonic::Response<Self::Response>,
2569 tonic::Status,
2570 >;
2571 fn call(
2572 &mut self,
2573 request: tonic::Request<super::BatchGetTransactionsRequest>,
2574 ) -> Self::Future {
2575 let inner = Arc::clone(&self.0);
2576 let fut = async move {
2577 <T as LedgerService>::batch_get_transactions(
2578 &inner,
2579 request,
2580 )
2581 .await
2582 };
2583 Box::pin(fut)
2584 }
2585 }
2586 let accept_compression_encodings = self.accept_compression_encodings;
2587 let send_compression_encodings = self.send_compression_encodings;
2588 let max_decoding_message_size = self.max_decoding_message_size;
2589 let max_encoding_message_size = self.max_encoding_message_size;
2590 let inner = self.inner.clone();
2591 let fut = async move {
2592 let method = BatchGetTransactionsSvc(inner);
2593 let codec = tonic_prost::ProstCodec::default();
2594 let mut grpc = tonic::server::Grpc::new(codec)
2595 .apply_compression_config(
2596 accept_compression_encodings,
2597 send_compression_encodings,
2598 )
2599 .apply_max_message_size_config(
2600 max_decoding_message_size,
2601 max_encoding_message_size,
2602 );
2603 let res = grpc.unary(method, req).await;
2604 Ok(res)
2605 };
2606 Box::pin(fut)
2607 }
2608 "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
2609 #[allow(non_camel_case_types)]
2610 struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
2611 impl<
2612 T: LedgerService,
2613 > tonic::server::UnaryService<super::GetCheckpointRequest>
2614 for GetCheckpointSvc<T> {
2615 type Response = super::GetCheckpointResponse;
2616 type Future = BoxFuture<
2617 tonic::Response<Self::Response>,
2618 tonic::Status,
2619 >;
2620 fn call(
2621 &mut self,
2622 request: tonic::Request<super::GetCheckpointRequest>,
2623 ) -> Self::Future {
2624 let inner = Arc::clone(&self.0);
2625 let fut = async move {
2626 <T as LedgerService>::get_checkpoint(&inner, request).await
2627 };
2628 Box::pin(fut)
2629 }
2630 }
2631 let accept_compression_encodings = self.accept_compression_encodings;
2632 let send_compression_encodings = self.send_compression_encodings;
2633 let max_decoding_message_size = self.max_decoding_message_size;
2634 let max_encoding_message_size = self.max_encoding_message_size;
2635 let inner = self.inner.clone();
2636 let fut = async move {
2637 let method = GetCheckpointSvc(inner);
2638 let codec = tonic_prost::ProstCodec::default();
2639 let mut grpc = tonic::server::Grpc::new(codec)
2640 .apply_compression_config(
2641 accept_compression_encodings,
2642 send_compression_encodings,
2643 )
2644 .apply_max_message_size_config(
2645 max_decoding_message_size,
2646 max_encoding_message_size,
2647 );
2648 let res = grpc.unary(method, req).await;
2649 Ok(res)
2650 };
2651 Box::pin(fut)
2652 }
2653 "/sui.rpc.v2.LedgerService/GetEpoch" => {
2654 #[allow(non_camel_case_types)]
2655 struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
2656 impl<
2657 T: LedgerService,
2658 > tonic::server::UnaryService<super::GetEpochRequest>
2659 for GetEpochSvc<T> {
2660 type Response = super::GetEpochResponse;
2661 type Future = BoxFuture<
2662 tonic::Response<Self::Response>,
2663 tonic::Status,
2664 >;
2665 fn call(
2666 &mut self,
2667 request: tonic::Request<super::GetEpochRequest>,
2668 ) -> Self::Future {
2669 let inner = Arc::clone(&self.0);
2670 let fut = async move {
2671 <T as LedgerService>::get_epoch(&inner, request).await
2672 };
2673 Box::pin(fut)
2674 }
2675 }
2676 let accept_compression_encodings = self.accept_compression_encodings;
2677 let send_compression_encodings = self.send_compression_encodings;
2678 let max_decoding_message_size = self.max_decoding_message_size;
2679 let max_encoding_message_size = self.max_encoding_message_size;
2680 let inner = self.inner.clone();
2681 let fut = async move {
2682 let method = GetEpochSvc(inner);
2683 let codec = tonic_prost::ProstCodec::default();
2684 let mut grpc = tonic::server::Grpc::new(codec)
2685 .apply_compression_config(
2686 accept_compression_encodings,
2687 send_compression_encodings,
2688 )
2689 .apply_max_message_size_config(
2690 max_decoding_message_size,
2691 max_encoding_message_size,
2692 );
2693 let res = grpc.unary(method, req).await;
2694 Ok(res)
2695 };
2696 Box::pin(fut)
2697 }
2698 _ => {
2699 Box::pin(async move {
2700 let mut response = http::Response::new(
2701 tonic::body::Body::default(),
2702 );
2703 let headers = response.headers_mut();
2704 headers
2705 .insert(
2706 tonic::Status::GRPC_STATUS,
2707 (tonic::Code::Unimplemented as i32).into(),
2708 );
2709 headers
2710 .insert(
2711 http::header::CONTENT_TYPE,
2712 tonic::metadata::GRPC_CONTENT_TYPE,
2713 );
2714 Ok(response)
2715 })
2716 }
2717 }
2718 }
2719 }
2720 impl<T> Clone for LedgerServiceServer<T> {
2721 fn clone(&self) -> Self {
2722 let inner = self.inner.clone();
2723 Self {
2724 inner,
2725 accept_compression_encodings: self.accept_compression_encodings,
2726 send_compression_encodings: self.send_compression_encodings,
2727 max_decoding_message_size: self.max_decoding_message_size,
2728 max_encoding_message_size: self.max_encoding_message_size,
2729 }
2730 }
2731 }
2732 pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
2734 impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
2735 const NAME: &'static str = SERVICE_NAME;
2736 }
2737}
2738#[non_exhaustive]
2740#[derive(Clone, PartialEq, ::prost::Message)]
2741pub struct Package {
2742 #[prost(string, optional, tag = "1")]
2748 pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
2749 #[prost(string, optional, tag = "2")]
2756 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
2757 #[prost(uint64, optional, tag = "3")]
2759 pub version: ::core::option::Option<u64>,
2760 #[prost(message, repeated, tag = "4")]
2762 pub modules: ::prost::alloc::vec::Vec<Module>,
2763 #[prost(message, repeated, tag = "5")]
2766 pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
2767 #[prost(message, repeated, tag = "6")]
2771 pub linkage: ::prost::alloc::vec::Vec<Linkage>,
2772}
2773#[non_exhaustive]
2775#[derive(Clone, PartialEq, ::prost::Message)]
2776pub struct Module {
2777 #[prost(string, optional, tag = "1")]
2779 pub name: ::core::option::Option<::prost::alloc::string::String>,
2780 #[prost(bytes = "bytes", optional, tag = "2")]
2782 pub contents: ::core::option::Option<::prost::bytes::Bytes>,
2783 #[prost(message, repeated, tag = "3")]
2785 pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
2786 #[prost(message, repeated, tag = "4")]
2788 pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
2789}
2790#[non_exhaustive]
2792#[derive(Clone, PartialEq, ::prost::Message)]
2793pub struct DatatypeDescriptor {
2794 #[prost(string, optional, tag = "1")]
2798 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
2799 #[prost(string, optional, tag = "2")]
2803 pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
2804 #[prost(string, optional, tag = "3")]
2806 pub module: ::core::option::Option<::prost::alloc::string::String>,
2807 #[prost(string, optional, tag = "4")]
2809 pub name: ::core::option::Option<::prost::alloc::string::String>,
2810 #[prost(enumeration = "Ability", repeated, tag = "5")]
2812 pub abilities: ::prost::alloc::vec::Vec<i32>,
2813 #[prost(message, repeated, tag = "6")]
2815 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
2816 #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
2818 pub kind: ::core::option::Option<i32>,
2819 #[prost(message, repeated, tag = "8")]
2823 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
2824 #[prost(message, repeated, tag = "9")]
2828 pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
2829}
2830pub mod datatype_descriptor {
2832 #[non_exhaustive]
2833 #[derive(
2834 Clone,
2835 Copy,
2836 Debug,
2837 PartialEq,
2838 Eq,
2839 Hash,
2840 PartialOrd,
2841 Ord,
2842 ::prost::Enumeration
2843 )]
2844 #[repr(i32)]
2845 pub enum DatatypeKind {
2846 Unknown = 0,
2847 Struct = 1,
2848 Enum = 2,
2849 }
2850 impl DatatypeKind {
2851 pub fn as_str_name(&self) -> &'static str {
2856 match self {
2857 Self::Unknown => "DATATYPE_KIND_UNKNOWN",
2858 Self::Struct => "STRUCT",
2859 Self::Enum => "ENUM",
2860 }
2861 }
2862 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2864 match value {
2865 "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
2866 "STRUCT" => Some(Self::Struct),
2867 "ENUM" => Some(Self::Enum),
2868 _ => None,
2869 }
2870 }
2871 }
2872}
2873#[non_exhaustive]
2875#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2876pub struct TypeParameter {
2877 #[prost(enumeration = "Ability", repeated, tag = "1")]
2879 pub constraints: ::prost::alloc::vec::Vec<i32>,
2880 #[prost(bool, optional, tag = "2")]
2882 pub is_phantom: ::core::option::Option<bool>,
2883}
2884#[non_exhaustive]
2886#[derive(Clone, PartialEq, ::prost::Message)]
2887pub struct FieldDescriptor {
2888 #[prost(string, optional, tag = "1")]
2890 pub name: ::core::option::Option<::prost::alloc::string::String>,
2891 #[prost(uint32, optional, tag = "2")]
2893 pub position: ::core::option::Option<u32>,
2894 #[prost(message, optional, tag = "3")]
2896 pub r#type: ::core::option::Option<OpenSignatureBody>,
2897}
2898#[non_exhaustive]
2900#[derive(Clone, PartialEq, ::prost::Message)]
2901pub struct VariantDescriptor {
2902 #[prost(string, optional, tag = "1")]
2904 pub name: ::core::option::Option<::prost::alloc::string::String>,
2905 #[prost(uint32, optional, tag = "2")]
2907 pub position: ::core::option::Option<u32>,
2908 #[prost(message, repeated, tag = "3")]
2910 pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
2911}
2912#[non_exhaustive]
2914#[derive(Clone, PartialEq, ::prost::Message)]
2915pub struct OpenSignatureBody {
2916 #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
2918 pub r#type: ::core::option::Option<i32>,
2919 #[prost(string, optional, tag = "2")]
2921 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
2922 #[prost(message, repeated, tag = "3")]
2924 pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
2925 #[prost(uint32, optional, tag = "4")]
2927 pub type_parameter: ::core::option::Option<u32>,
2928}
2929pub mod open_signature_body {
2931 #[non_exhaustive]
2932 #[derive(
2933 Clone,
2934 Copy,
2935 Debug,
2936 PartialEq,
2937 Eq,
2938 Hash,
2939 PartialOrd,
2940 Ord,
2941 ::prost::Enumeration
2942 )]
2943 #[repr(i32)]
2944 pub enum Type {
2945 Unknown = 0,
2946 Address = 1,
2947 Bool = 2,
2948 U8 = 3,
2949 U16 = 4,
2950 U32 = 5,
2951 U64 = 6,
2952 U128 = 7,
2953 U256 = 8,
2954 Vector = 9,
2955 Datatype = 10,
2956 Parameter = 11,
2957 }
2958 impl Type {
2959 pub fn as_str_name(&self) -> &'static str {
2964 match self {
2965 Self::Unknown => "TYPE_UNKNOWN",
2966 Self::Address => "ADDRESS",
2967 Self::Bool => "BOOL",
2968 Self::U8 => "U8",
2969 Self::U16 => "U16",
2970 Self::U32 => "U32",
2971 Self::U64 => "U64",
2972 Self::U128 => "U128",
2973 Self::U256 => "U256",
2974 Self::Vector => "VECTOR",
2975 Self::Datatype => "DATATYPE",
2976 Self::Parameter => "TYPE_PARAMETER",
2977 }
2978 }
2979 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2981 match value {
2982 "TYPE_UNKNOWN" => Some(Self::Unknown),
2983 "ADDRESS" => Some(Self::Address),
2984 "BOOL" => Some(Self::Bool),
2985 "U8" => Some(Self::U8),
2986 "U16" => Some(Self::U16),
2987 "U32" => Some(Self::U32),
2988 "U64" => Some(Self::U64),
2989 "U128" => Some(Self::U128),
2990 "U256" => Some(Self::U256),
2991 "VECTOR" => Some(Self::Vector),
2992 "DATATYPE" => Some(Self::Datatype),
2993 "TYPE_PARAMETER" => Some(Self::Parameter),
2994 _ => None,
2995 }
2996 }
2997 }
2998}
2999#[non_exhaustive]
3001#[derive(Clone, PartialEq, ::prost::Message)]
3002pub struct FunctionDescriptor {
3003 #[prost(string, optional, tag = "1")]
3005 pub name: ::core::option::Option<::prost::alloc::string::String>,
3006 #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
3008 pub visibility: ::core::option::Option<i32>,
3009 #[prost(bool, optional, tag = "6")]
3011 pub is_entry: ::core::option::Option<bool>,
3012 #[prost(message, repeated, tag = "7")]
3014 pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3015 #[prost(message, repeated, tag = "8")]
3017 pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
3018 #[prost(message, repeated, tag = "9")]
3020 pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
3021}
3022pub mod function_descriptor {
3024 #[non_exhaustive]
3025 #[derive(
3026 Clone,
3027 Copy,
3028 Debug,
3029 PartialEq,
3030 Eq,
3031 Hash,
3032 PartialOrd,
3033 Ord,
3034 ::prost::Enumeration
3035 )]
3036 #[repr(i32)]
3037 pub enum Visibility {
3038 Unknown = 0,
3039 Private = 1,
3040 Public = 2,
3041 Friend = 3,
3042 }
3043 impl Visibility {
3044 pub fn as_str_name(&self) -> &'static str {
3049 match self {
3050 Self::Unknown => "VISIBILITY_UNKNOWN",
3051 Self::Private => "PRIVATE",
3052 Self::Public => "PUBLIC",
3053 Self::Friend => "FRIEND",
3054 }
3055 }
3056 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3058 match value {
3059 "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
3060 "PRIVATE" => Some(Self::Private),
3061 "PUBLIC" => Some(Self::Public),
3062 "FRIEND" => Some(Self::Friend),
3063 _ => None,
3064 }
3065 }
3066 }
3067}
3068#[non_exhaustive]
3070#[derive(Clone, PartialEq, ::prost::Message)]
3071pub struct OpenSignature {
3072 #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
3073 pub reference: ::core::option::Option<i32>,
3074 #[prost(message, optional, tag = "2")]
3075 pub body: ::core::option::Option<OpenSignatureBody>,
3076}
3077pub mod open_signature {
3079 #[non_exhaustive]
3080 #[derive(
3081 Clone,
3082 Copy,
3083 Debug,
3084 PartialEq,
3085 Eq,
3086 Hash,
3087 PartialOrd,
3088 Ord,
3089 ::prost::Enumeration
3090 )]
3091 #[repr(i32)]
3092 pub enum Reference {
3093 Unknown = 0,
3094 Immutable = 1,
3095 Mutable = 2,
3096 }
3097 impl Reference {
3098 pub fn as_str_name(&self) -> &'static str {
3103 match self {
3104 Self::Unknown => "REFERENCE_UNKNOWN",
3105 Self::Immutable => "IMMUTABLE",
3106 Self::Mutable => "MUTABLE",
3107 }
3108 }
3109 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3111 match value {
3112 "REFERENCE_UNKNOWN" => Some(Self::Unknown),
3113 "IMMUTABLE" => Some(Self::Immutable),
3114 "MUTABLE" => Some(Self::Mutable),
3115 _ => None,
3116 }
3117 }
3118 }
3119}
3120#[non_exhaustive]
3122#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3123pub struct TypeOrigin {
3124 #[prost(string, optional, tag = "1")]
3125 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3126 #[prost(string, optional, tag = "2")]
3127 pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
3128 #[prost(string, optional, tag = "3")]
3129 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3130}
3131#[non_exhaustive]
3133#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3134pub struct Linkage {
3135 #[prost(string, optional, tag = "1")]
3137 pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3138 #[prost(string, optional, tag = "2")]
3140 pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
3141 #[prost(uint64, optional, tag = "3")]
3143 pub upgraded_version: ::core::option::Option<u64>,
3144}
3145#[non_exhaustive]
3147#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3148#[repr(i32)]
3149pub enum Ability {
3150 Unknown = 0,
3151 Copy = 1,
3153 Drop = 2,
3155 Store = 3,
3157 Key = 4,
3159}
3160impl Ability {
3161 pub fn as_str_name(&self) -> &'static str {
3166 match self {
3167 Self::Unknown => "ABILITY_UNKNOWN",
3168 Self::Copy => "COPY",
3169 Self::Drop => "DROP",
3170 Self::Store => "STORE",
3171 Self::Key => "KEY",
3172 }
3173 }
3174 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3176 match value {
3177 "ABILITY_UNKNOWN" => Some(Self::Unknown),
3178 "COPY" => Some(Self::Copy),
3179 "DROP" => Some(Self::Drop),
3180 "STORE" => Some(Self::Store),
3181 "KEY" => Some(Self::Key),
3182 _ => None,
3183 }
3184 }
3185}
3186#[non_exhaustive]
3187#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3188pub struct GetPackageRequest {
3189 #[prost(string, optional, tag = "1")]
3191 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3192}
3193#[non_exhaustive]
3194#[derive(Clone, PartialEq, ::prost::Message)]
3195pub struct GetPackageResponse {
3196 #[prost(message, optional, tag = "1")]
3198 pub package: ::core::option::Option<Package>,
3199}
3200#[non_exhaustive]
3201#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3202pub struct GetDatatypeRequest {
3203 #[prost(string, optional, tag = "1")]
3205 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3206 #[prost(string, optional, tag = "2")]
3208 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3209 #[prost(string, optional, tag = "3")]
3211 pub name: ::core::option::Option<::prost::alloc::string::String>,
3212}
3213#[non_exhaustive]
3214#[derive(Clone, PartialEq, ::prost::Message)]
3215pub struct GetDatatypeResponse {
3216 #[prost(message, optional, tag = "1")]
3218 pub datatype: ::core::option::Option<DatatypeDescriptor>,
3219}
3220#[non_exhaustive]
3221#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3222pub struct GetFunctionRequest {
3223 #[prost(string, optional, tag = "1")]
3225 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3226 #[prost(string, optional, tag = "2")]
3228 pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3229 #[prost(string, optional, tag = "3")]
3231 pub name: ::core::option::Option<::prost::alloc::string::String>,
3232}
3233#[non_exhaustive]
3234#[derive(Clone, PartialEq, ::prost::Message)]
3235pub struct GetFunctionResponse {
3236 #[prost(message, optional, tag = "1")]
3238 pub function: ::core::option::Option<FunctionDescriptor>,
3239}
3240#[non_exhaustive]
3241#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3242pub struct ListPackageVersionsRequest {
3243 #[prost(string, optional, tag = "1")]
3245 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3246 #[prost(uint32, optional, tag = "2")]
3250 pub page_size: ::core::option::Option<u32>,
3251 #[prost(bytes = "bytes", optional, tag = "3")]
3257 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
3258}
3259#[non_exhaustive]
3260#[derive(Clone, PartialEq, ::prost::Message)]
3261pub struct ListPackageVersionsResponse {
3262 #[prost(message, repeated, tag = "1")]
3264 pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
3265 #[prost(bytes = "bytes", optional, tag = "2")]
3268 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
3269}
3270#[non_exhaustive]
3272#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3273pub struct PackageVersion {
3274 #[prost(string, optional, tag = "1")]
3276 pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3277 #[prost(uint64, optional, tag = "2")]
3279 pub version: ::core::option::Option<u64>,
3280}
3281pub mod move_package_service_client {
3283 #![allow(
3284 unused_variables,
3285 dead_code,
3286 missing_docs,
3287 clippy::wildcard_imports,
3288 clippy::let_unit_value,
3289 )]
3290 use tonic::codegen::*;
3291 use tonic::codegen::http::Uri;
3292 #[derive(Debug, Clone)]
3293 pub struct MovePackageServiceClient<T> {
3294 inner: tonic::client::Grpc<T>,
3295 }
3296 impl MovePackageServiceClient<tonic::transport::Channel> {
3297 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3299 where
3300 D: TryInto<tonic::transport::Endpoint>,
3301 D::Error: Into<StdError>,
3302 {
3303 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3304 Ok(Self::new(conn))
3305 }
3306 }
3307 impl<T> MovePackageServiceClient<T>
3308 where
3309 T: tonic::client::GrpcService<tonic::body::Body>,
3310 T::Error: Into<StdError>,
3311 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3312 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3313 {
3314 pub fn new(inner: T) -> Self {
3315 let inner = tonic::client::Grpc::new(inner);
3316 Self { inner }
3317 }
3318 pub fn with_origin(inner: T, origin: Uri) -> Self {
3319 let inner = tonic::client::Grpc::with_origin(inner, origin);
3320 Self { inner }
3321 }
3322 pub fn with_interceptor<F>(
3323 inner: T,
3324 interceptor: F,
3325 ) -> MovePackageServiceClient<InterceptedService<T, F>>
3326 where
3327 F: tonic::service::Interceptor,
3328 T::ResponseBody: Default,
3329 T: tonic::codegen::Service<
3330 http::Request<tonic::body::Body>,
3331 Response = http::Response<
3332 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3333 >,
3334 >,
3335 <T as tonic::codegen::Service<
3336 http::Request<tonic::body::Body>,
3337 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3338 {
3339 MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
3340 }
3341 #[must_use]
3346 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3347 self.inner = self.inner.send_compressed(encoding);
3348 self
3349 }
3350 #[must_use]
3352 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3353 self.inner = self.inner.accept_compressed(encoding);
3354 self
3355 }
3356 #[must_use]
3360 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3361 self.inner = self.inner.max_decoding_message_size(limit);
3362 self
3363 }
3364 #[must_use]
3368 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3369 self.inner = self.inner.max_encoding_message_size(limit);
3370 self
3371 }
3372 pub async fn get_package(
3373 &mut self,
3374 request: impl tonic::IntoRequest<super::GetPackageRequest>,
3375 ) -> std::result::Result<
3376 tonic::Response<super::GetPackageResponse>,
3377 tonic::Status,
3378 > {
3379 self.inner
3380 .ready()
3381 .await
3382 .map_err(|e| {
3383 tonic::Status::unknown(
3384 format!("Service was not ready: {}", e.into()),
3385 )
3386 })?;
3387 let codec = tonic_prost::ProstCodec::default();
3388 let path = http::uri::PathAndQuery::from_static(
3389 "/sui.rpc.v2.MovePackageService/GetPackage",
3390 );
3391 let mut req = request.into_request();
3392 req.extensions_mut()
3393 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
3394 self.inner.unary(req, path, codec).await
3395 }
3396 pub async fn get_datatype(
3397 &mut self,
3398 request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
3399 ) -> std::result::Result<
3400 tonic::Response<super::GetDatatypeResponse>,
3401 tonic::Status,
3402 > {
3403 self.inner
3404 .ready()
3405 .await
3406 .map_err(|e| {
3407 tonic::Status::unknown(
3408 format!("Service was not ready: {}", e.into()),
3409 )
3410 })?;
3411 let codec = tonic_prost::ProstCodec::default();
3412 let path = http::uri::PathAndQuery::from_static(
3413 "/sui.rpc.v2.MovePackageService/GetDatatype",
3414 );
3415 let mut req = request.into_request();
3416 req.extensions_mut()
3417 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
3418 self.inner.unary(req, path, codec).await
3419 }
3420 pub async fn get_function(
3421 &mut self,
3422 request: impl tonic::IntoRequest<super::GetFunctionRequest>,
3423 ) -> std::result::Result<
3424 tonic::Response<super::GetFunctionResponse>,
3425 tonic::Status,
3426 > {
3427 self.inner
3428 .ready()
3429 .await
3430 .map_err(|e| {
3431 tonic::Status::unknown(
3432 format!("Service was not ready: {}", e.into()),
3433 )
3434 })?;
3435 let codec = tonic_prost::ProstCodec::default();
3436 let path = http::uri::PathAndQuery::from_static(
3437 "/sui.rpc.v2.MovePackageService/GetFunction",
3438 );
3439 let mut req = request.into_request();
3440 req.extensions_mut()
3441 .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
3442 self.inner.unary(req, path, codec).await
3443 }
3444 pub async fn list_package_versions(
3445 &mut self,
3446 request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
3447 ) -> std::result::Result<
3448 tonic::Response<super::ListPackageVersionsResponse>,
3449 tonic::Status,
3450 > {
3451 self.inner
3452 .ready()
3453 .await
3454 .map_err(|e| {
3455 tonic::Status::unknown(
3456 format!("Service was not ready: {}", e.into()),
3457 )
3458 })?;
3459 let codec = tonic_prost::ProstCodec::default();
3460 let path = http::uri::PathAndQuery::from_static(
3461 "/sui.rpc.v2.MovePackageService/ListPackageVersions",
3462 );
3463 let mut req = request.into_request();
3464 req.extensions_mut()
3465 .insert(
3466 GrpcMethod::new(
3467 "sui.rpc.v2.MovePackageService",
3468 "ListPackageVersions",
3469 ),
3470 );
3471 self.inner.unary(req, path, codec).await
3472 }
3473 }
3474}
3475pub mod move_package_service_server {
3477 #![allow(
3478 unused_variables,
3479 dead_code,
3480 missing_docs,
3481 clippy::wildcard_imports,
3482 clippy::let_unit_value,
3483 )]
3484 use tonic::codegen::*;
3485 #[async_trait]
3487 pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
3488 async fn get_package(
3489 &self,
3490 request: tonic::Request<super::GetPackageRequest>,
3491 ) -> std::result::Result<
3492 tonic::Response<super::GetPackageResponse>,
3493 tonic::Status,
3494 >;
3495 async fn get_datatype(
3496 &self,
3497 request: tonic::Request<super::GetDatatypeRequest>,
3498 ) -> std::result::Result<
3499 tonic::Response<super::GetDatatypeResponse>,
3500 tonic::Status,
3501 >;
3502 async fn get_function(
3503 &self,
3504 request: tonic::Request<super::GetFunctionRequest>,
3505 ) -> std::result::Result<
3506 tonic::Response<super::GetFunctionResponse>,
3507 tonic::Status,
3508 >;
3509 async fn list_package_versions(
3510 &self,
3511 request: tonic::Request<super::ListPackageVersionsRequest>,
3512 ) -> std::result::Result<
3513 tonic::Response<super::ListPackageVersionsResponse>,
3514 tonic::Status,
3515 >;
3516 }
3517 #[derive(Debug)]
3518 pub struct MovePackageServiceServer<T> {
3519 inner: Arc<T>,
3520 accept_compression_encodings: EnabledCompressionEncodings,
3521 send_compression_encodings: EnabledCompressionEncodings,
3522 max_decoding_message_size: Option<usize>,
3523 max_encoding_message_size: Option<usize>,
3524 }
3525 impl<T> MovePackageServiceServer<T> {
3526 pub fn new(inner: T) -> Self {
3527 Self::from_arc(Arc::new(inner))
3528 }
3529 pub fn from_arc(inner: Arc<T>) -> Self {
3530 Self {
3531 inner,
3532 accept_compression_encodings: Default::default(),
3533 send_compression_encodings: Default::default(),
3534 max_decoding_message_size: None,
3535 max_encoding_message_size: None,
3536 }
3537 }
3538 pub fn with_interceptor<F>(
3539 inner: T,
3540 interceptor: F,
3541 ) -> InterceptedService<Self, F>
3542 where
3543 F: tonic::service::Interceptor,
3544 {
3545 InterceptedService::new(Self::new(inner), interceptor)
3546 }
3547 #[must_use]
3549 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3550 self.accept_compression_encodings.enable(encoding);
3551 self
3552 }
3553 #[must_use]
3555 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3556 self.send_compression_encodings.enable(encoding);
3557 self
3558 }
3559 #[must_use]
3563 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3564 self.max_decoding_message_size = Some(limit);
3565 self
3566 }
3567 #[must_use]
3571 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3572 self.max_encoding_message_size = Some(limit);
3573 self
3574 }
3575 }
3576 impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
3577 where
3578 T: MovePackageService,
3579 B: Body + std::marker::Send + 'static,
3580 B::Error: Into<StdError> + std::marker::Send + 'static,
3581 {
3582 type Response = http::Response<tonic::body::Body>;
3583 type Error = std::convert::Infallible;
3584 type Future = BoxFuture<Self::Response, Self::Error>;
3585 fn poll_ready(
3586 &mut self,
3587 _cx: &mut Context<'_>,
3588 ) -> Poll<std::result::Result<(), Self::Error>> {
3589 Poll::Ready(Ok(()))
3590 }
3591 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3592 match req.uri().path() {
3593 "/sui.rpc.v2.MovePackageService/GetPackage" => {
3594 #[allow(non_camel_case_types)]
3595 struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
3596 impl<
3597 T: MovePackageService,
3598 > tonic::server::UnaryService<super::GetPackageRequest>
3599 for GetPackageSvc<T> {
3600 type Response = super::GetPackageResponse;
3601 type Future = BoxFuture<
3602 tonic::Response<Self::Response>,
3603 tonic::Status,
3604 >;
3605 fn call(
3606 &mut self,
3607 request: tonic::Request<super::GetPackageRequest>,
3608 ) -> Self::Future {
3609 let inner = Arc::clone(&self.0);
3610 let fut = async move {
3611 <T as MovePackageService>::get_package(&inner, request)
3612 .await
3613 };
3614 Box::pin(fut)
3615 }
3616 }
3617 let accept_compression_encodings = self.accept_compression_encodings;
3618 let send_compression_encodings = self.send_compression_encodings;
3619 let max_decoding_message_size = self.max_decoding_message_size;
3620 let max_encoding_message_size = self.max_encoding_message_size;
3621 let inner = self.inner.clone();
3622 let fut = async move {
3623 let method = GetPackageSvc(inner);
3624 let codec = tonic_prost::ProstCodec::default();
3625 let mut grpc = tonic::server::Grpc::new(codec)
3626 .apply_compression_config(
3627 accept_compression_encodings,
3628 send_compression_encodings,
3629 )
3630 .apply_max_message_size_config(
3631 max_decoding_message_size,
3632 max_encoding_message_size,
3633 );
3634 let res = grpc.unary(method, req).await;
3635 Ok(res)
3636 };
3637 Box::pin(fut)
3638 }
3639 "/sui.rpc.v2.MovePackageService/GetDatatype" => {
3640 #[allow(non_camel_case_types)]
3641 struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
3642 impl<
3643 T: MovePackageService,
3644 > tonic::server::UnaryService<super::GetDatatypeRequest>
3645 for GetDatatypeSvc<T> {
3646 type Response = super::GetDatatypeResponse;
3647 type Future = BoxFuture<
3648 tonic::Response<Self::Response>,
3649 tonic::Status,
3650 >;
3651 fn call(
3652 &mut self,
3653 request: tonic::Request<super::GetDatatypeRequest>,
3654 ) -> Self::Future {
3655 let inner = Arc::clone(&self.0);
3656 let fut = async move {
3657 <T as MovePackageService>::get_datatype(&inner, request)
3658 .await
3659 };
3660 Box::pin(fut)
3661 }
3662 }
3663 let accept_compression_encodings = self.accept_compression_encodings;
3664 let send_compression_encodings = self.send_compression_encodings;
3665 let max_decoding_message_size = self.max_decoding_message_size;
3666 let max_encoding_message_size = self.max_encoding_message_size;
3667 let inner = self.inner.clone();
3668 let fut = async move {
3669 let method = GetDatatypeSvc(inner);
3670 let codec = tonic_prost::ProstCodec::default();
3671 let mut grpc = tonic::server::Grpc::new(codec)
3672 .apply_compression_config(
3673 accept_compression_encodings,
3674 send_compression_encodings,
3675 )
3676 .apply_max_message_size_config(
3677 max_decoding_message_size,
3678 max_encoding_message_size,
3679 );
3680 let res = grpc.unary(method, req).await;
3681 Ok(res)
3682 };
3683 Box::pin(fut)
3684 }
3685 "/sui.rpc.v2.MovePackageService/GetFunction" => {
3686 #[allow(non_camel_case_types)]
3687 struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
3688 impl<
3689 T: MovePackageService,
3690 > tonic::server::UnaryService<super::GetFunctionRequest>
3691 for GetFunctionSvc<T> {
3692 type Response = super::GetFunctionResponse;
3693 type Future = BoxFuture<
3694 tonic::Response<Self::Response>,
3695 tonic::Status,
3696 >;
3697 fn call(
3698 &mut self,
3699 request: tonic::Request<super::GetFunctionRequest>,
3700 ) -> Self::Future {
3701 let inner = Arc::clone(&self.0);
3702 let fut = async move {
3703 <T as MovePackageService>::get_function(&inner, request)
3704 .await
3705 };
3706 Box::pin(fut)
3707 }
3708 }
3709 let accept_compression_encodings = self.accept_compression_encodings;
3710 let send_compression_encodings = self.send_compression_encodings;
3711 let max_decoding_message_size = self.max_decoding_message_size;
3712 let max_encoding_message_size = self.max_encoding_message_size;
3713 let inner = self.inner.clone();
3714 let fut = async move {
3715 let method = GetFunctionSvc(inner);
3716 let codec = tonic_prost::ProstCodec::default();
3717 let mut grpc = tonic::server::Grpc::new(codec)
3718 .apply_compression_config(
3719 accept_compression_encodings,
3720 send_compression_encodings,
3721 )
3722 .apply_max_message_size_config(
3723 max_decoding_message_size,
3724 max_encoding_message_size,
3725 );
3726 let res = grpc.unary(method, req).await;
3727 Ok(res)
3728 };
3729 Box::pin(fut)
3730 }
3731 "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
3732 #[allow(non_camel_case_types)]
3733 struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
3734 impl<
3735 T: MovePackageService,
3736 > tonic::server::UnaryService<super::ListPackageVersionsRequest>
3737 for ListPackageVersionsSvc<T> {
3738 type Response = super::ListPackageVersionsResponse;
3739 type Future = BoxFuture<
3740 tonic::Response<Self::Response>,
3741 tonic::Status,
3742 >;
3743 fn call(
3744 &mut self,
3745 request: tonic::Request<super::ListPackageVersionsRequest>,
3746 ) -> Self::Future {
3747 let inner = Arc::clone(&self.0);
3748 let fut = async move {
3749 <T as MovePackageService>::list_package_versions(
3750 &inner,
3751 request,
3752 )
3753 .await
3754 };
3755 Box::pin(fut)
3756 }
3757 }
3758 let accept_compression_encodings = self.accept_compression_encodings;
3759 let send_compression_encodings = self.send_compression_encodings;
3760 let max_decoding_message_size = self.max_decoding_message_size;
3761 let max_encoding_message_size = self.max_encoding_message_size;
3762 let inner = self.inner.clone();
3763 let fut = async move {
3764 let method = ListPackageVersionsSvc(inner);
3765 let codec = tonic_prost::ProstCodec::default();
3766 let mut grpc = tonic::server::Grpc::new(codec)
3767 .apply_compression_config(
3768 accept_compression_encodings,
3769 send_compression_encodings,
3770 )
3771 .apply_max_message_size_config(
3772 max_decoding_message_size,
3773 max_encoding_message_size,
3774 );
3775 let res = grpc.unary(method, req).await;
3776 Ok(res)
3777 };
3778 Box::pin(fut)
3779 }
3780 _ => {
3781 Box::pin(async move {
3782 let mut response = http::Response::new(
3783 tonic::body::Body::default(),
3784 );
3785 let headers = response.headers_mut();
3786 headers
3787 .insert(
3788 tonic::Status::GRPC_STATUS,
3789 (tonic::Code::Unimplemented as i32).into(),
3790 );
3791 headers
3792 .insert(
3793 http::header::CONTENT_TYPE,
3794 tonic::metadata::GRPC_CONTENT_TYPE,
3795 );
3796 Ok(response)
3797 })
3798 }
3799 }
3800 }
3801 }
3802 impl<T> Clone for MovePackageServiceServer<T> {
3803 fn clone(&self) -> Self {
3804 let inner = self.inner.clone();
3805 Self {
3806 inner,
3807 accept_compression_encodings: self.accept_compression_encodings,
3808 send_compression_encodings: self.send_compression_encodings,
3809 max_decoding_message_size: self.max_decoding_message_size,
3810 max_encoding_message_size: self.max_encoding_message_size,
3811 }
3812 }
3813 }
3814 pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
3816 impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
3817 const NAME: &'static str = SERVICE_NAME;
3818 }
3819}
3820#[non_exhaustive]
3821#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3822pub struct LookupNameRequest {
3823 #[prost(string, optional, tag = "1")]
3827 pub name: ::core::option::Option<::prost::alloc::string::String>,
3828}
3829#[non_exhaustive]
3830#[derive(Clone, PartialEq, ::prost::Message)]
3831pub struct LookupNameResponse {
3832 #[prost(message, optional, tag = "1")]
3834 pub record: ::core::option::Option<NameRecord>,
3835}
3836#[non_exhaustive]
3837#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3838pub struct ReverseLookupNameRequest {
3839 #[prost(string, optional, tag = "1")]
3841 pub address: ::core::option::Option<::prost::alloc::string::String>,
3842}
3843#[non_exhaustive]
3844#[derive(Clone, PartialEq, ::prost::Message)]
3845pub struct ReverseLookupNameResponse {
3846 #[prost(message, optional, tag = "1")]
3848 pub record: ::core::option::Option<NameRecord>,
3849}
3850#[non_exhaustive]
3851#[derive(Clone, PartialEq, ::prost::Message)]
3852pub struct NameRecord {
3853 #[prost(string, optional, tag = "1")]
3858 pub id: ::core::option::Option<::prost::alloc::string::String>,
3859 #[prost(string, optional, tag = "2")]
3861 pub name: ::core::option::Option<::prost::alloc::string::String>,
3862 #[prost(string, optional, tag = "3")]
3870 pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
3871 #[prost(message, optional, tag = "4")]
3876 pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
3877 #[prost(string, optional, tag = "5")]
3879 pub target_address: ::core::option::Option<::prost::alloc::string::String>,
3880 #[prost(btree_map = "string, string", tag = "6")]
3882 pub data: ::prost::alloc::collections::BTreeMap<
3883 ::prost::alloc::string::String,
3884 ::prost::alloc::string::String,
3885 >,
3886}
3887pub mod name_service_client {
3889 #![allow(
3890 unused_variables,
3891 dead_code,
3892 missing_docs,
3893 clippy::wildcard_imports,
3894 clippy::let_unit_value,
3895 )]
3896 use tonic::codegen::*;
3897 use tonic::codegen::http::Uri;
3898 #[derive(Debug, Clone)]
3899 pub struct NameServiceClient<T> {
3900 inner: tonic::client::Grpc<T>,
3901 }
3902 impl NameServiceClient<tonic::transport::Channel> {
3903 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3905 where
3906 D: TryInto<tonic::transport::Endpoint>,
3907 D::Error: Into<StdError>,
3908 {
3909 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3910 Ok(Self::new(conn))
3911 }
3912 }
3913 impl<T> NameServiceClient<T>
3914 where
3915 T: tonic::client::GrpcService<tonic::body::Body>,
3916 T::Error: Into<StdError>,
3917 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3918 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3919 {
3920 pub fn new(inner: T) -> Self {
3921 let inner = tonic::client::Grpc::new(inner);
3922 Self { inner }
3923 }
3924 pub fn with_origin(inner: T, origin: Uri) -> Self {
3925 let inner = tonic::client::Grpc::with_origin(inner, origin);
3926 Self { inner }
3927 }
3928 pub fn with_interceptor<F>(
3929 inner: T,
3930 interceptor: F,
3931 ) -> NameServiceClient<InterceptedService<T, F>>
3932 where
3933 F: tonic::service::Interceptor,
3934 T::ResponseBody: Default,
3935 T: tonic::codegen::Service<
3936 http::Request<tonic::body::Body>,
3937 Response = http::Response<
3938 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3939 >,
3940 >,
3941 <T as tonic::codegen::Service<
3942 http::Request<tonic::body::Body>,
3943 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3944 {
3945 NameServiceClient::new(InterceptedService::new(inner, interceptor))
3946 }
3947 #[must_use]
3952 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3953 self.inner = self.inner.send_compressed(encoding);
3954 self
3955 }
3956 #[must_use]
3958 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3959 self.inner = self.inner.accept_compressed(encoding);
3960 self
3961 }
3962 #[must_use]
3966 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3967 self.inner = self.inner.max_decoding_message_size(limit);
3968 self
3969 }
3970 #[must_use]
3974 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3975 self.inner = self.inner.max_encoding_message_size(limit);
3976 self
3977 }
3978 pub async fn lookup_name(
3979 &mut self,
3980 request: impl tonic::IntoRequest<super::LookupNameRequest>,
3981 ) -> std::result::Result<
3982 tonic::Response<super::LookupNameResponse>,
3983 tonic::Status,
3984 > {
3985 self.inner
3986 .ready()
3987 .await
3988 .map_err(|e| {
3989 tonic::Status::unknown(
3990 format!("Service was not ready: {}", e.into()),
3991 )
3992 })?;
3993 let codec = tonic_prost::ProstCodec::default();
3994 let path = http::uri::PathAndQuery::from_static(
3995 "/sui.rpc.v2.NameService/LookupName",
3996 );
3997 let mut req = request.into_request();
3998 req.extensions_mut()
3999 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
4000 self.inner.unary(req, path, codec).await
4001 }
4002 pub async fn reverse_lookup_name(
4003 &mut self,
4004 request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
4005 ) -> std::result::Result<
4006 tonic::Response<super::ReverseLookupNameResponse>,
4007 tonic::Status,
4008 > {
4009 self.inner
4010 .ready()
4011 .await
4012 .map_err(|e| {
4013 tonic::Status::unknown(
4014 format!("Service was not ready: {}", e.into()),
4015 )
4016 })?;
4017 let codec = tonic_prost::ProstCodec::default();
4018 let path = http::uri::PathAndQuery::from_static(
4019 "/sui.rpc.v2.NameService/ReverseLookupName",
4020 );
4021 let mut req = request.into_request();
4022 req.extensions_mut()
4023 .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
4024 self.inner.unary(req, path, codec).await
4025 }
4026 }
4027}
4028pub mod name_service_server {
4030 #![allow(
4031 unused_variables,
4032 dead_code,
4033 missing_docs,
4034 clippy::wildcard_imports,
4035 clippy::let_unit_value,
4036 )]
4037 use tonic::codegen::*;
4038 #[async_trait]
4040 pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
4041 async fn lookup_name(
4042 &self,
4043 request: tonic::Request<super::LookupNameRequest>,
4044 ) -> std::result::Result<
4045 tonic::Response<super::LookupNameResponse>,
4046 tonic::Status,
4047 >;
4048 async fn reverse_lookup_name(
4049 &self,
4050 request: tonic::Request<super::ReverseLookupNameRequest>,
4051 ) -> std::result::Result<
4052 tonic::Response<super::ReverseLookupNameResponse>,
4053 tonic::Status,
4054 >;
4055 }
4056 #[derive(Debug)]
4057 pub struct NameServiceServer<T> {
4058 inner: Arc<T>,
4059 accept_compression_encodings: EnabledCompressionEncodings,
4060 send_compression_encodings: EnabledCompressionEncodings,
4061 max_decoding_message_size: Option<usize>,
4062 max_encoding_message_size: Option<usize>,
4063 }
4064 impl<T> NameServiceServer<T> {
4065 pub fn new(inner: T) -> Self {
4066 Self::from_arc(Arc::new(inner))
4067 }
4068 pub fn from_arc(inner: Arc<T>) -> Self {
4069 Self {
4070 inner,
4071 accept_compression_encodings: Default::default(),
4072 send_compression_encodings: Default::default(),
4073 max_decoding_message_size: None,
4074 max_encoding_message_size: None,
4075 }
4076 }
4077 pub fn with_interceptor<F>(
4078 inner: T,
4079 interceptor: F,
4080 ) -> InterceptedService<Self, F>
4081 where
4082 F: tonic::service::Interceptor,
4083 {
4084 InterceptedService::new(Self::new(inner), interceptor)
4085 }
4086 #[must_use]
4088 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4089 self.accept_compression_encodings.enable(encoding);
4090 self
4091 }
4092 #[must_use]
4094 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4095 self.send_compression_encodings.enable(encoding);
4096 self
4097 }
4098 #[must_use]
4102 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4103 self.max_decoding_message_size = Some(limit);
4104 self
4105 }
4106 #[must_use]
4110 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4111 self.max_encoding_message_size = Some(limit);
4112 self
4113 }
4114 }
4115 impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
4116 where
4117 T: NameService,
4118 B: Body + std::marker::Send + 'static,
4119 B::Error: Into<StdError> + std::marker::Send + 'static,
4120 {
4121 type Response = http::Response<tonic::body::Body>;
4122 type Error = std::convert::Infallible;
4123 type Future = BoxFuture<Self::Response, Self::Error>;
4124 fn poll_ready(
4125 &mut self,
4126 _cx: &mut Context<'_>,
4127 ) -> Poll<std::result::Result<(), Self::Error>> {
4128 Poll::Ready(Ok(()))
4129 }
4130 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4131 match req.uri().path() {
4132 "/sui.rpc.v2.NameService/LookupName" => {
4133 #[allow(non_camel_case_types)]
4134 struct LookupNameSvc<T: NameService>(pub Arc<T>);
4135 impl<
4136 T: NameService,
4137 > tonic::server::UnaryService<super::LookupNameRequest>
4138 for LookupNameSvc<T> {
4139 type Response = super::LookupNameResponse;
4140 type Future = BoxFuture<
4141 tonic::Response<Self::Response>,
4142 tonic::Status,
4143 >;
4144 fn call(
4145 &mut self,
4146 request: tonic::Request<super::LookupNameRequest>,
4147 ) -> Self::Future {
4148 let inner = Arc::clone(&self.0);
4149 let fut = async move {
4150 <T as NameService>::lookup_name(&inner, request).await
4151 };
4152 Box::pin(fut)
4153 }
4154 }
4155 let accept_compression_encodings = self.accept_compression_encodings;
4156 let send_compression_encodings = self.send_compression_encodings;
4157 let max_decoding_message_size = self.max_decoding_message_size;
4158 let max_encoding_message_size = self.max_encoding_message_size;
4159 let inner = self.inner.clone();
4160 let fut = async move {
4161 let method = LookupNameSvc(inner);
4162 let codec = tonic_prost::ProstCodec::default();
4163 let mut grpc = tonic::server::Grpc::new(codec)
4164 .apply_compression_config(
4165 accept_compression_encodings,
4166 send_compression_encodings,
4167 )
4168 .apply_max_message_size_config(
4169 max_decoding_message_size,
4170 max_encoding_message_size,
4171 );
4172 let res = grpc.unary(method, req).await;
4173 Ok(res)
4174 };
4175 Box::pin(fut)
4176 }
4177 "/sui.rpc.v2.NameService/ReverseLookupName" => {
4178 #[allow(non_camel_case_types)]
4179 struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
4180 impl<
4181 T: NameService,
4182 > tonic::server::UnaryService<super::ReverseLookupNameRequest>
4183 for ReverseLookupNameSvc<T> {
4184 type Response = super::ReverseLookupNameResponse;
4185 type Future = BoxFuture<
4186 tonic::Response<Self::Response>,
4187 tonic::Status,
4188 >;
4189 fn call(
4190 &mut self,
4191 request: tonic::Request<super::ReverseLookupNameRequest>,
4192 ) -> Self::Future {
4193 let inner = Arc::clone(&self.0);
4194 let fut = async move {
4195 <T as NameService>::reverse_lookup_name(&inner, request)
4196 .await
4197 };
4198 Box::pin(fut)
4199 }
4200 }
4201 let accept_compression_encodings = self.accept_compression_encodings;
4202 let send_compression_encodings = self.send_compression_encodings;
4203 let max_decoding_message_size = self.max_decoding_message_size;
4204 let max_encoding_message_size = self.max_encoding_message_size;
4205 let inner = self.inner.clone();
4206 let fut = async move {
4207 let method = ReverseLookupNameSvc(inner);
4208 let codec = tonic_prost::ProstCodec::default();
4209 let mut grpc = tonic::server::Grpc::new(codec)
4210 .apply_compression_config(
4211 accept_compression_encodings,
4212 send_compression_encodings,
4213 )
4214 .apply_max_message_size_config(
4215 max_decoding_message_size,
4216 max_encoding_message_size,
4217 );
4218 let res = grpc.unary(method, req).await;
4219 Ok(res)
4220 };
4221 Box::pin(fut)
4222 }
4223 _ => {
4224 Box::pin(async move {
4225 let mut response = http::Response::new(
4226 tonic::body::Body::default(),
4227 );
4228 let headers = response.headers_mut();
4229 headers
4230 .insert(
4231 tonic::Status::GRPC_STATUS,
4232 (tonic::Code::Unimplemented as i32).into(),
4233 );
4234 headers
4235 .insert(
4236 http::header::CONTENT_TYPE,
4237 tonic::metadata::GRPC_CONTENT_TYPE,
4238 );
4239 Ok(response)
4240 })
4241 }
4242 }
4243 }
4244 }
4245 impl<T> Clone for NameServiceServer<T> {
4246 fn clone(&self) -> Self {
4247 let inner = self.inner.clone();
4248 Self {
4249 inner,
4250 accept_compression_encodings: self.accept_compression_encodings,
4251 send_compression_encodings: self.send_compression_encodings,
4252 max_decoding_message_size: self.max_decoding_message_size,
4253 max_encoding_message_size: self.max_encoding_message_size,
4254 }
4255 }
4256 }
4257 pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
4259 impl<T> tonic::server::NamedService for NameServiceServer<T> {
4260 const NAME: &'static str = SERVICE_NAME;
4261 }
4262}
4263#[non_exhaustive]
4265#[derive(Clone, PartialEq, ::prost::Message)]
4266pub struct Object {
4267 #[prost(message, optional, tag = "1")]
4269 pub bcs: ::core::option::Option<Bcs>,
4270 #[prost(string, optional, tag = "2")]
4272 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4273 #[prost(uint64, optional, tag = "3")]
4275 pub version: ::core::option::Option<u64>,
4276 #[prost(string, optional, tag = "4")]
4278 pub digest: ::core::option::Option<::prost::alloc::string::String>,
4279 #[prost(message, optional, tag = "5")]
4281 pub owner: ::core::option::Option<Owner>,
4282 #[prost(string, optional, tag = "6")]
4286 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
4287 #[prost(bool, optional, tag = "7")]
4292 pub has_public_transfer: ::core::option::Option<bool>,
4293 #[prost(message, optional, tag = "8")]
4297 pub contents: ::core::option::Option<Bcs>,
4298 #[prost(message, optional, tag = "9")]
4300 pub package: ::core::option::Option<Package>,
4301 #[prost(string, optional, tag = "10")]
4303 pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
4304 #[prost(uint64, optional, tag = "11")]
4308 pub storage_rebate: ::core::option::Option<u64>,
4309 #[prost(message, optional, boxed, tag = "100")]
4311 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
4312 #[prost(uint64, optional, tag = "101")]
4314 pub balance: ::core::option::Option<u64>,
4315 #[prost(message, optional, boxed, tag = "102")]
4318 pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
4319}
4320#[non_exhaustive]
4322#[derive(Clone, PartialEq, ::prost::Message)]
4323pub struct ObjectSet {
4324 #[prost(message, repeated, tag = "1")]
4326 pub objects: ::prost::alloc::vec::Vec<Object>,
4327}
4328#[non_exhaustive]
4330#[derive(Clone, PartialEq, ::prost::Message)]
4331pub struct Display {
4332 #[prost(message, optional, tag = "1")]
4336 pub output: ::core::option::Option<::prost_types::Value>,
4337 #[prost(message, optional, tag = "2")]
4341 pub errors: ::core::option::Option<::prost_types::Value>,
4342}
4343#[non_exhaustive]
4345#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4346pub struct ObjectReference {
4347 #[prost(string, optional, tag = "1")]
4349 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4350 #[prost(uint64, optional, tag = "2")]
4352 pub version: ::core::option::Option<u64>,
4353 #[prost(string, optional, tag = "3")]
4355 pub digest: ::core::option::Option<::prost::alloc::string::String>,
4356}
4357#[non_exhaustive]
4359#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4360pub struct Owner {
4361 #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
4362 pub kind: ::core::option::Option<i32>,
4363 #[prost(string, optional, tag = "2")]
4365 pub address: ::core::option::Option<::prost::alloc::string::String>,
4366 #[prost(uint64, optional, tag = "3")]
4368 pub version: ::core::option::Option<u64>,
4369}
4370pub mod owner {
4372 #[non_exhaustive]
4373 #[derive(
4374 Clone,
4375 Copy,
4376 Debug,
4377 PartialEq,
4378 Eq,
4379 Hash,
4380 PartialOrd,
4381 Ord,
4382 ::prost::Enumeration
4383 )]
4384 #[repr(i32)]
4385 pub enum OwnerKind {
4386 Unknown = 0,
4387 Address = 1,
4388 Object = 2,
4389 Shared = 3,
4390 Immutable = 4,
4391 ConsensusAddress = 5,
4392 }
4393 impl OwnerKind {
4394 pub fn as_str_name(&self) -> &'static str {
4399 match self {
4400 Self::Unknown => "OWNER_KIND_UNKNOWN",
4401 Self::Address => "ADDRESS",
4402 Self::Object => "OBJECT",
4403 Self::Shared => "SHARED",
4404 Self::Immutable => "IMMUTABLE",
4405 Self::ConsensusAddress => "CONSENSUS_ADDRESS",
4406 }
4407 }
4408 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4410 match value {
4411 "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
4412 "ADDRESS" => Some(Self::Address),
4413 "OBJECT" => Some(Self::Object),
4414 "SHARED" => Some(Self::Shared),
4415 "IMMUTABLE" => Some(Self::Immutable),
4416 "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
4417 _ => None,
4418 }
4419 }
4420 }
4421}
4422#[non_exhaustive]
4423#[derive(Clone, PartialEq, ::prost::Message)]
4424pub struct ProtocolConfig {
4425 #[prost(uint64, optional, tag = "1")]
4426 pub protocol_version: ::core::option::Option<u64>,
4427 #[prost(btree_map = "string, bool", tag = "2")]
4428 pub feature_flags: ::prost::alloc::collections::BTreeMap<
4429 ::prost::alloc::string::String,
4430 bool,
4431 >,
4432 #[prost(btree_map = "string, string", tag = "3")]
4433 pub attributes: ::prost::alloc::collections::BTreeMap<
4434 ::prost::alloc::string::String,
4435 ::prost::alloc::string::String,
4436 >,
4437}
4438#[non_exhaustive]
4440#[derive(Clone, PartialEq, ::prost::Message)]
4441pub struct UserSignature {
4442 #[prost(message, optional, tag = "1")]
4447 pub bcs: ::core::option::Option<Bcs>,
4448 #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
4450 pub scheme: ::core::option::Option<i32>,
4451 #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
4452 pub signature: ::core::option::Option<user_signature::Signature>,
4453}
4454pub mod user_signature {
4456 #[non_exhaustive]
4457 #[derive(Clone, PartialEq, ::prost::Oneof)]
4458 pub enum Signature {
4459 #[prost(message, tag = "3")]
4461 Simple(super::SimpleSignature),
4462 #[prost(message, tag = "4")]
4464 Multisig(super::MultisigAggregatedSignature),
4465 #[prost(message, tag = "5")]
4467 Zklogin(super::ZkLoginAuthenticator),
4468 #[prost(message, tag = "6")]
4470 Passkey(super::PasskeyAuthenticator),
4471 }
4472}
4473#[non_exhaustive]
4475#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4476pub struct SimpleSignature {
4477 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4479 pub scheme: ::core::option::Option<i32>,
4480 #[prost(bytes = "bytes", optional, tag = "2")]
4482 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4483 #[prost(bytes = "bytes", optional, tag = "3")]
4485 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4486}
4487#[non_exhaustive]
4489#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4490pub struct ZkLoginPublicIdentifier {
4491 #[prost(string, optional, tag = "1")]
4492 pub iss: ::core::option::Option<::prost::alloc::string::String>,
4493 #[prost(string, optional, tag = "2")]
4495 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4496}
4497#[non_exhaustive]
4499#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4500pub struct MultisigMemberPublicKey {
4501 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4503 pub scheme: ::core::option::Option<i32>,
4504 #[prost(bytes = "bytes", optional, tag = "2")]
4506 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4507 #[prost(message, optional, tag = "3")]
4509 pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
4510}
4511#[non_exhaustive]
4513#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4514pub struct MultisigMember {
4515 #[prost(message, optional, tag = "1")]
4517 pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
4518 #[prost(uint32, optional, tag = "2")]
4520 pub weight: ::core::option::Option<u32>,
4521}
4522#[non_exhaustive]
4524#[derive(Clone, PartialEq, ::prost::Message)]
4525pub struct MultisigCommittee {
4526 #[prost(message, repeated, tag = "1")]
4528 pub members: ::prost::alloc::vec::Vec<MultisigMember>,
4529 #[prost(uint32, optional, tag = "2")]
4532 pub threshold: ::core::option::Option<u32>,
4533}
4534#[non_exhaustive]
4536#[derive(Clone, PartialEq, ::prost::Message)]
4537pub struct MultisigAggregatedSignature {
4538 #[prost(message, repeated, tag = "1")]
4542 pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
4543 #[prost(uint32, optional, tag = "2")]
4546 pub bitmap: ::core::option::Option<u32>,
4547 #[prost(bytes = "bytes", optional, tag = "3")]
4550 pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4551 #[prost(message, optional, tag = "4")]
4553 pub committee: ::core::option::Option<MultisigCommittee>,
4554}
4555#[non_exhaustive]
4557#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4558pub struct MultisigMemberSignature {
4559 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4561 pub scheme: ::core::option::Option<i32>,
4562 #[prost(bytes = "bytes", optional, tag = "2")]
4564 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4565 #[prost(message, optional, tag = "3")]
4567 pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
4568 #[prost(message, optional, tag = "4")]
4570 pub passkey: ::core::option::Option<PasskeyAuthenticator>,
4571}
4572#[non_exhaustive]
4574#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4575pub struct ZkLoginAuthenticator {
4576 #[prost(message, optional, tag = "1")]
4578 pub inputs: ::core::option::Option<ZkLoginInputs>,
4579 #[prost(uint64, optional, tag = "2")]
4581 pub max_epoch: ::core::option::Option<u64>,
4582 #[prost(message, optional, tag = "3")]
4584 pub signature: ::core::option::Option<SimpleSignature>,
4585 #[prost(message, optional, tag = "4")]
4587 pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
4588 #[prost(message, optional, tag = "5")]
4590 pub jwk_id: ::core::option::Option<JwkId>,
4591}
4592#[non_exhaustive]
4594#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4595pub struct ZkLoginInputs {
4596 #[prost(message, optional, tag = "1")]
4597 pub proof_points: ::core::option::Option<ZkLoginProof>,
4598 #[prost(message, optional, tag = "2")]
4599 pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
4600 #[prost(string, optional, tag = "3")]
4601 pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
4602 #[prost(string, optional, tag = "4")]
4604 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4605}
4606#[non_exhaustive]
4608#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4609pub struct ZkLoginProof {
4610 #[prost(message, optional, tag = "1")]
4611 pub a: ::core::option::Option<CircomG1>,
4612 #[prost(message, optional, tag = "2")]
4613 pub b: ::core::option::Option<CircomG2>,
4614 #[prost(message, optional, tag = "3")]
4615 pub c: ::core::option::Option<CircomG1>,
4616}
4617#[non_exhaustive]
4619#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4620pub struct ZkLoginClaim {
4621 #[prost(string, optional, tag = "1")]
4622 pub value: ::core::option::Option<::prost::alloc::string::String>,
4623 #[prost(uint32, optional, tag = "2")]
4624 pub index_mod_4: ::core::option::Option<u32>,
4625}
4626#[non_exhaustive]
4628#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4629pub struct CircomG1 {
4630 #[prost(string, optional, tag = "1")]
4632 pub e0: ::core::option::Option<::prost::alloc::string::String>,
4633 #[prost(string, optional, tag = "2")]
4635 pub e1: ::core::option::Option<::prost::alloc::string::String>,
4636 #[prost(string, optional, tag = "3")]
4638 pub e2: ::core::option::Option<::prost::alloc::string::String>,
4639}
4640#[non_exhaustive]
4642#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4643pub struct CircomG2 {
4644 #[prost(string, optional, tag = "1")]
4646 pub e00: ::core::option::Option<::prost::alloc::string::String>,
4647 #[prost(string, optional, tag = "2")]
4649 pub e01: ::core::option::Option<::prost::alloc::string::String>,
4650 #[prost(string, optional, tag = "3")]
4652 pub e10: ::core::option::Option<::prost::alloc::string::String>,
4653 #[prost(string, optional, tag = "4")]
4655 pub e11: ::core::option::Option<::prost::alloc::string::String>,
4656 #[prost(string, optional, tag = "5")]
4658 pub e20: ::core::option::Option<::prost::alloc::string::String>,
4659 #[prost(string, optional, tag = "6")]
4661 pub e21: ::core::option::Option<::prost::alloc::string::String>,
4662}
4663#[non_exhaustive]
4670#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4671pub struct PasskeyAuthenticator {
4672 #[prost(bytes = "bytes", optional, tag = "1")]
4677 pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
4678 #[prost(string, optional, tag = "2")]
4683 pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
4684 #[prost(message, optional, tag = "3")]
4686 pub signature: ::core::option::Option<SimpleSignature>,
4687}
4688#[non_exhaustive]
4690#[derive(Clone, PartialEq, ::prost::Message)]
4691pub struct ValidatorCommittee {
4692 #[prost(uint64, optional, tag = "1")]
4694 pub epoch: ::core::option::Option<u64>,
4695 #[prost(message, repeated, tag = "2")]
4697 pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
4698}
4699#[non_exhaustive]
4701#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4702pub struct ValidatorCommitteeMember {
4703 #[prost(bytes = "bytes", optional, tag = "1")]
4705 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4706 #[prost(uint64, optional, tag = "2")]
4708 pub weight: ::core::option::Option<u64>,
4709}
4710#[non_exhaustive]
4712#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4713pub struct ValidatorAggregatedSignature {
4714 #[prost(uint64, optional, tag = "1")]
4719 pub epoch: ::core::option::Option<u64>,
4720 #[prost(bytes = "bytes", optional, tag = "2")]
4722 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4723 #[prost(bytes = "bytes", optional, tag = "3")]
4726 pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4727}
4728#[non_exhaustive]
4735#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4736#[repr(i32)]
4737pub enum SignatureScheme {
4738 Ed25519 = 0,
4739 Secp256k1 = 1,
4740 Secp256r1 = 2,
4741 Multisig = 3,
4742 Bls12381 = 4,
4743 Zklogin = 5,
4744 Passkey = 6,
4745}
4746impl SignatureScheme {
4747 pub fn as_str_name(&self) -> &'static str {
4752 match self {
4753 Self::Ed25519 => "ED25519",
4754 Self::Secp256k1 => "SECP256K1",
4755 Self::Secp256r1 => "SECP256R1",
4756 Self::Multisig => "MULTISIG",
4757 Self::Bls12381 => "BLS12381",
4758 Self::Zklogin => "ZKLOGIN",
4759 Self::Passkey => "PASSKEY",
4760 }
4761 }
4762 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4764 match value {
4765 "ED25519" => Some(Self::Ed25519),
4766 "SECP256K1" => Some(Self::Secp256k1),
4767 "SECP256R1" => Some(Self::Secp256r1),
4768 "MULTISIG" => Some(Self::Multisig),
4769 "BLS12381" => Some(Self::Bls12381),
4770 "ZKLOGIN" => Some(Self::Zklogin),
4771 "PASSKEY" => Some(Self::Passkey),
4772 _ => None,
4773 }
4774 }
4775}
4776#[non_exhaustive]
4777#[derive(Clone, PartialEq, ::prost::Message)]
4778pub struct VerifySignatureRequest {
4779 #[prost(message, optional, tag = "1")]
4785 pub message: ::core::option::Option<Bcs>,
4786 #[prost(message, optional, tag = "2")]
4788 pub signature: ::core::option::Option<UserSignature>,
4789 #[prost(string, optional, tag = "3")]
4795 pub address: ::core::option::Option<::prost::alloc::string::String>,
4796 #[prost(message, repeated, tag = "4")]
4799 pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
4800}
4801#[non_exhaustive]
4802#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4803pub struct VerifySignatureResponse {
4804 #[prost(bool, optional, tag = "1")]
4806 pub is_valid: ::core::option::Option<bool>,
4807 #[prost(string, optional, tag = "2")]
4809 pub reason: ::core::option::Option<::prost::alloc::string::String>,
4810}
4811pub mod signature_verification_service_client {
4813 #![allow(
4814 unused_variables,
4815 dead_code,
4816 missing_docs,
4817 clippy::wildcard_imports,
4818 clippy::let_unit_value,
4819 )]
4820 use tonic::codegen::*;
4821 use tonic::codegen::http::Uri;
4822 #[derive(Debug, Clone)]
4823 pub struct SignatureVerificationServiceClient<T> {
4824 inner: tonic::client::Grpc<T>,
4825 }
4826 impl SignatureVerificationServiceClient<tonic::transport::Channel> {
4827 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4829 where
4830 D: TryInto<tonic::transport::Endpoint>,
4831 D::Error: Into<StdError>,
4832 {
4833 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4834 Ok(Self::new(conn))
4835 }
4836 }
4837 impl<T> SignatureVerificationServiceClient<T>
4838 where
4839 T: tonic::client::GrpcService<tonic::body::Body>,
4840 T::Error: Into<StdError>,
4841 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4842 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4843 {
4844 pub fn new(inner: T) -> Self {
4845 let inner = tonic::client::Grpc::new(inner);
4846 Self { inner }
4847 }
4848 pub fn with_origin(inner: T, origin: Uri) -> Self {
4849 let inner = tonic::client::Grpc::with_origin(inner, origin);
4850 Self { inner }
4851 }
4852 pub fn with_interceptor<F>(
4853 inner: T,
4854 interceptor: F,
4855 ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
4856 where
4857 F: tonic::service::Interceptor,
4858 T::ResponseBody: Default,
4859 T: tonic::codegen::Service<
4860 http::Request<tonic::body::Body>,
4861 Response = http::Response<
4862 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4863 >,
4864 >,
4865 <T as tonic::codegen::Service<
4866 http::Request<tonic::body::Body>,
4867 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4868 {
4869 SignatureVerificationServiceClient::new(
4870 InterceptedService::new(inner, interceptor),
4871 )
4872 }
4873 #[must_use]
4878 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4879 self.inner = self.inner.send_compressed(encoding);
4880 self
4881 }
4882 #[must_use]
4884 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4885 self.inner = self.inner.accept_compressed(encoding);
4886 self
4887 }
4888 #[must_use]
4892 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4893 self.inner = self.inner.max_decoding_message_size(limit);
4894 self
4895 }
4896 #[must_use]
4900 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4901 self.inner = self.inner.max_encoding_message_size(limit);
4902 self
4903 }
4904 pub async fn verify_signature(
4906 &mut self,
4907 request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
4908 ) -> std::result::Result<
4909 tonic::Response<super::VerifySignatureResponse>,
4910 tonic::Status,
4911 > {
4912 self.inner
4913 .ready()
4914 .await
4915 .map_err(|e| {
4916 tonic::Status::unknown(
4917 format!("Service was not ready: {}", e.into()),
4918 )
4919 })?;
4920 let codec = tonic_prost::ProstCodec::default();
4921 let path = http::uri::PathAndQuery::from_static(
4922 "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
4923 );
4924 let mut req = request.into_request();
4925 req.extensions_mut()
4926 .insert(
4927 GrpcMethod::new(
4928 "sui.rpc.v2.SignatureVerificationService",
4929 "VerifySignature",
4930 ),
4931 );
4932 self.inner.unary(req, path, codec).await
4933 }
4934 }
4935}
4936pub mod signature_verification_service_server {
4938 #![allow(
4939 unused_variables,
4940 dead_code,
4941 missing_docs,
4942 clippy::wildcard_imports,
4943 clippy::let_unit_value,
4944 )]
4945 use tonic::codegen::*;
4946 #[async_trait]
4948 pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
4949 async fn verify_signature(
4951 &self,
4952 request: tonic::Request<super::VerifySignatureRequest>,
4953 ) -> std::result::Result<
4954 tonic::Response<super::VerifySignatureResponse>,
4955 tonic::Status,
4956 >;
4957 }
4958 #[derive(Debug)]
4959 pub struct SignatureVerificationServiceServer<T> {
4960 inner: Arc<T>,
4961 accept_compression_encodings: EnabledCompressionEncodings,
4962 send_compression_encodings: EnabledCompressionEncodings,
4963 max_decoding_message_size: Option<usize>,
4964 max_encoding_message_size: Option<usize>,
4965 }
4966 impl<T> SignatureVerificationServiceServer<T> {
4967 pub fn new(inner: T) -> Self {
4968 Self::from_arc(Arc::new(inner))
4969 }
4970 pub fn from_arc(inner: Arc<T>) -> Self {
4971 Self {
4972 inner,
4973 accept_compression_encodings: Default::default(),
4974 send_compression_encodings: Default::default(),
4975 max_decoding_message_size: None,
4976 max_encoding_message_size: None,
4977 }
4978 }
4979 pub fn with_interceptor<F>(
4980 inner: T,
4981 interceptor: F,
4982 ) -> InterceptedService<Self, F>
4983 where
4984 F: tonic::service::Interceptor,
4985 {
4986 InterceptedService::new(Self::new(inner), interceptor)
4987 }
4988 #[must_use]
4990 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4991 self.accept_compression_encodings.enable(encoding);
4992 self
4993 }
4994 #[must_use]
4996 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4997 self.send_compression_encodings.enable(encoding);
4998 self
4999 }
5000 #[must_use]
5004 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5005 self.max_decoding_message_size = Some(limit);
5006 self
5007 }
5008 #[must_use]
5012 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5013 self.max_encoding_message_size = Some(limit);
5014 self
5015 }
5016 }
5017 impl<T, B> tonic::codegen::Service<http::Request<B>>
5018 for SignatureVerificationServiceServer<T>
5019 where
5020 T: SignatureVerificationService,
5021 B: Body + std::marker::Send + 'static,
5022 B::Error: Into<StdError> + std::marker::Send + 'static,
5023 {
5024 type Response = http::Response<tonic::body::Body>;
5025 type Error = std::convert::Infallible;
5026 type Future = BoxFuture<Self::Response, Self::Error>;
5027 fn poll_ready(
5028 &mut self,
5029 _cx: &mut Context<'_>,
5030 ) -> Poll<std::result::Result<(), Self::Error>> {
5031 Poll::Ready(Ok(()))
5032 }
5033 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5034 match req.uri().path() {
5035 "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
5036 #[allow(non_camel_case_types)]
5037 struct VerifySignatureSvc<T: SignatureVerificationService>(
5038 pub Arc<T>,
5039 );
5040 impl<
5041 T: SignatureVerificationService,
5042 > tonic::server::UnaryService<super::VerifySignatureRequest>
5043 for VerifySignatureSvc<T> {
5044 type Response = super::VerifySignatureResponse;
5045 type Future = BoxFuture<
5046 tonic::Response<Self::Response>,
5047 tonic::Status,
5048 >;
5049 fn call(
5050 &mut self,
5051 request: tonic::Request<super::VerifySignatureRequest>,
5052 ) -> Self::Future {
5053 let inner = Arc::clone(&self.0);
5054 let fut = async move {
5055 <T as SignatureVerificationService>::verify_signature(
5056 &inner,
5057 request,
5058 )
5059 .await
5060 };
5061 Box::pin(fut)
5062 }
5063 }
5064 let accept_compression_encodings = self.accept_compression_encodings;
5065 let send_compression_encodings = self.send_compression_encodings;
5066 let max_decoding_message_size = self.max_decoding_message_size;
5067 let max_encoding_message_size = self.max_encoding_message_size;
5068 let inner = self.inner.clone();
5069 let fut = async move {
5070 let method = VerifySignatureSvc(inner);
5071 let codec = tonic_prost::ProstCodec::default();
5072 let mut grpc = tonic::server::Grpc::new(codec)
5073 .apply_compression_config(
5074 accept_compression_encodings,
5075 send_compression_encodings,
5076 )
5077 .apply_max_message_size_config(
5078 max_decoding_message_size,
5079 max_encoding_message_size,
5080 );
5081 let res = grpc.unary(method, req).await;
5082 Ok(res)
5083 };
5084 Box::pin(fut)
5085 }
5086 _ => {
5087 Box::pin(async move {
5088 let mut response = http::Response::new(
5089 tonic::body::Body::default(),
5090 );
5091 let headers = response.headers_mut();
5092 headers
5093 .insert(
5094 tonic::Status::GRPC_STATUS,
5095 (tonic::Code::Unimplemented as i32).into(),
5096 );
5097 headers
5098 .insert(
5099 http::header::CONTENT_TYPE,
5100 tonic::metadata::GRPC_CONTENT_TYPE,
5101 );
5102 Ok(response)
5103 })
5104 }
5105 }
5106 }
5107 }
5108 impl<T> Clone for SignatureVerificationServiceServer<T> {
5109 fn clone(&self) -> Self {
5110 let inner = self.inner.clone();
5111 Self {
5112 inner,
5113 accept_compression_encodings: self.accept_compression_encodings,
5114 send_compression_encodings: self.send_compression_encodings,
5115 max_decoding_message_size: self.max_decoding_message_size,
5116 max_encoding_message_size: self.max_encoding_message_size,
5117 }
5118 }
5119 }
5120 pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
5122 impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
5123 const NAME: &'static str = SERVICE_NAME;
5124 }
5125}
5126#[non_exhaustive]
5128#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5129pub struct GetCoinInfoRequest {
5130 #[prost(string, optional, tag = "1")]
5132 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5133}
5134#[non_exhaustive]
5136#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5137pub struct GetCoinInfoResponse {
5138 #[prost(string, optional, tag = "1")]
5140 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5141 #[prost(message, optional, tag = "2")]
5144 pub metadata: ::core::option::Option<CoinMetadata>,
5145 #[prost(message, optional, tag = "3")]
5148 pub treasury: ::core::option::Option<CoinTreasury>,
5149 #[prost(message, optional, tag = "4")]
5157 pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
5158}
5159#[non_exhaustive]
5161#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5162pub struct CoinMetadata {
5163 #[prost(string, optional, tag = "1")]
5166 pub id: ::core::option::Option<::prost::alloc::string::String>,
5167 #[prost(uint32, optional, tag = "2")]
5169 pub decimals: ::core::option::Option<u32>,
5170 #[prost(string, optional, tag = "3")]
5172 pub name: ::core::option::Option<::prost::alloc::string::String>,
5173 #[prost(string, optional, tag = "4")]
5175 pub symbol: ::core::option::Option<::prost::alloc::string::String>,
5176 #[prost(string, optional, tag = "5")]
5178 pub description: ::core::option::Option<::prost::alloc::string::String>,
5179 #[prost(string, optional, tag = "6")]
5181 pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
5182 #[prost(string, optional, tag = "7")]
5186 pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
5187 #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
5189 pub metadata_cap_state: ::core::option::Option<i32>,
5190}
5191pub mod coin_metadata {
5193 #[non_exhaustive]
5195 #[derive(
5196 Clone,
5197 Copy,
5198 Debug,
5199 PartialEq,
5200 Eq,
5201 Hash,
5202 PartialOrd,
5203 Ord,
5204 ::prost::Enumeration
5205 )]
5206 #[repr(i32)]
5207 pub enum MetadataCapState {
5208 Unknown = 0,
5211 Claimed = 1,
5213 Unclaimed = 2,
5215 Deleted = 3,
5217 }
5218 impl MetadataCapState {
5219 pub fn as_str_name(&self) -> &'static str {
5224 match self {
5225 Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
5226 Self::Claimed => "CLAIMED",
5227 Self::Unclaimed => "UNCLAIMED",
5228 Self::Deleted => "DELETED",
5229 }
5230 }
5231 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5233 match value {
5234 "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
5235 "CLAIMED" => Some(Self::Claimed),
5236 "UNCLAIMED" => Some(Self::Unclaimed),
5237 "DELETED" => Some(Self::Deleted),
5238 _ => None,
5239 }
5240 }
5241 }
5242}
5243#[non_exhaustive]
5245#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5246pub struct CoinTreasury {
5247 #[prost(string, optional, tag = "1")]
5249 pub id: ::core::option::Option<::prost::alloc::string::String>,
5250 #[prost(uint64, optional, tag = "2")]
5252 pub total_supply: ::core::option::Option<u64>,
5253 #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
5255 pub supply_state: ::core::option::Option<i32>,
5256}
5257pub mod coin_treasury {
5259 #[non_exhaustive]
5261 #[derive(
5262 Clone,
5263 Copy,
5264 Debug,
5265 PartialEq,
5266 Eq,
5267 Hash,
5268 PartialOrd,
5269 Ord,
5270 ::prost::Enumeration
5271 )]
5272 #[repr(i32)]
5273 pub enum SupplyState {
5274 Unknown = 0,
5276 Fixed = 1,
5278 BurnOnly = 2,
5280 }
5281 impl SupplyState {
5282 pub fn as_str_name(&self) -> &'static str {
5287 match self {
5288 Self::Unknown => "SUPPLY_STATE_UNKNOWN",
5289 Self::Fixed => "FIXED",
5290 Self::BurnOnly => "BURN_ONLY",
5291 }
5292 }
5293 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5295 match value {
5296 "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
5297 "FIXED" => Some(Self::Fixed),
5298 "BURN_ONLY" => Some(Self::BurnOnly),
5299 _ => None,
5300 }
5301 }
5302 }
5303}
5304#[non_exhaustive]
5306#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5307pub struct RegulatedCoinMetadata {
5308 #[prost(string, optional, tag = "1")]
5311 pub id: ::core::option::Option<::prost::alloc::string::String>,
5312 #[prost(string, optional, tag = "2")]
5314 pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
5315 #[prost(string, optional, tag = "3")]
5317 pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
5318 #[prost(bool, optional, tag = "4")]
5320 pub allow_global_pause: ::core::option::Option<bool>,
5321 #[prost(uint32, optional, tag = "5")]
5323 pub variant: ::core::option::Option<u32>,
5324 #[prost(
5326 enumeration = "regulated_coin_metadata::CoinRegulatedState",
5327 optional,
5328 tag = "6"
5329 )]
5330 pub coin_regulated_state: ::core::option::Option<i32>,
5331}
5332pub mod regulated_coin_metadata {
5334 #[non_exhaustive]
5336 #[derive(
5337 Clone,
5338 Copy,
5339 Debug,
5340 PartialEq,
5341 Eq,
5342 Hash,
5343 PartialOrd,
5344 Ord,
5345 ::prost::Enumeration
5346 )]
5347 #[repr(i32)]
5348 pub enum CoinRegulatedState {
5349 Unknown = 0,
5354 Regulated = 1,
5356 Unregulated = 2,
5358 }
5359 impl CoinRegulatedState {
5360 pub fn as_str_name(&self) -> &'static str {
5365 match self {
5366 Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
5367 Self::Regulated => "REGULATED",
5368 Self::Unregulated => "UNREGULATED",
5369 }
5370 }
5371 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5373 match value {
5374 "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
5375 "REGULATED" => Some(Self::Regulated),
5376 "UNREGULATED" => Some(Self::Unregulated),
5377 _ => None,
5378 }
5379 }
5380 }
5381}
5382#[non_exhaustive]
5384#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5385pub struct GetBalanceRequest {
5386 #[prost(string, optional, tag = "1")]
5388 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5389 #[prost(string, optional, tag = "2")]
5391 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5392}
5393#[non_exhaustive]
5396#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5397pub struct GetBalanceResponse {
5398 #[prost(message, optional, tag = "1")]
5400 pub balance: ::core::option::Option<Balance>,
5401}
5402#[non_exhaustive]
5404#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5405pub struct ListBalancesRequest {
5406 #[prost(string, optional, tag = "1")]
5408 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5409 #[prost(uint32, optional, tag = "2")]
5413 pub page_size: ::core::option::Option<u32>,
5414 #[prost(bytes = "bytes", optional, tag = "3")]
5420 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5421}
5422#[non_exhaustive]
5425#[derive(Clone, PartialEq, ::prost::Message)]
5426pub struct ListBalancesResponse {
5427 #[prost(message, repeated, tag = "1")]
5429 pub balances: ::prost::alloc::vec::Vec<Balance>,
5430 #[prost(bytes = "bytes", optional, tag = "2")]
5433 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5434}
5435#[non_exhaustive]
5437#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5438pub struct Balance {
5439 #[prost(string, optional, tag = "1")]
5441 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5442 #[prost(uint64, optional, tag = "3")]
5446 pub balance: ::core::option::Option<u64>,
5447 #[prost(uint64, optional, tag = "4")]
5449 pub address_balance: ::core::option::Option<u64>,
5450 #[prost(uint64, optional, tag = "5")]
5452 pub coin_balance: ::core::option::Option<u64>,
5453}
5454#[non_exhaustive]
5456#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5457pub struct ListDynamicFieldsRequest {
5458 #[prost(string, optional, tag = "1")]
5460 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5461 #[prost(uint32, optional, tag = "2")]
5465 pub page_size: ::core::option::Option<u32>,
5466 #[prost(bytes = "bytes", optional, tag = "3")]
5472 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5473 #[prost(message, optional, tag = "4")]
5476 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5477}
5478#[non_exhaustive]
5480#[derive(Clone, PartialEq, ::prost::Message)]
5481pub struct ListDynamicFieldsResponse {
5482 #[prost(message, repeated, tag = "1")]
5484 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
5485 #[prost(bytes = "bytes", optional, tag = "2")]
5488 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5489}
5490#[non_exhaustive]
5491#[derive(Clone, PartialEq, ::prost::Message)]
5492pub struct DynamicField {
5493 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
5494 pub kind: ::core::option::Option<i32>,
5495 #[prost(string, optional, tag = "2")]
5497 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5498 #[prost(string, optional, tag = "3")]
5500 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
5501 #[prost(message, optional, tag = "4")]
5503 pub field_object: ::core::option::Option<Object>,
5504 #[prost(message, optional, tag = "5")]
5506 pub name: ::core::option::Option<Bcs>,
5507 #[prost(message, optional, tag = "6")]
5509 pub value: ::core::option::Option<Bcs>,
5510 #[prost(string, optional, tag = "7")]
5516 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
5517 #[prost(string, optional, tag = "8")]
5523 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
5524 #[prost(message, optional, tag = "9")]
5526 pub child_object: ::core::option::Option<Object>,
5527}
5528pub mod dynamic_field {
5530 #[non_exhaustive]
5531 #[derive(
5532 Clone,
5533 Copy,
5534 Debug,
5535 PartialEq,
5536 Eq,
5537 Hash,
5538 PartialOrd,
5539 Ord,
5540 ::prost::Enumeration
5541 )]
5542 #[repr(i32)]
5543 pub enum DynamicFieldKind {
5544 Unknown = 0,
5545 Field = 1,
5546 Object = 2,
5547 }
5548 impl DynamicFieldKind {
5549 pub fn as_str_name(&self) -> &'static str {
5554 match self {
5555 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
5556 Self::Field => "FIELD",
5557 Self::Object => "OBJECT",
5558 }
5559 }
5560 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5562 match value {
5563 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
5564 "FIELD" => Some(Self::Field),
5565 "OBJECT" => Some(Self::Object),
5566 _ => None,
5567 }
5568 }
5569 }
5570}
5571#[non_exhaustive]
5572#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5573pub struct ListOwnedObjectsRequest {
5574 #[prost(string, optional, tag = "1")]
5576 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5577 #[prost(uint32, optional, tag = "2")]
5581 pub page_size: ::core::option::Option<u32>,
5582 #[prost(bytes = "bytes", optional, tag = "3")]
5588 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5589 #[prost(message, optional, tag = "4")]
5592 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5593 #[prost(string, optional, tag = "5")]
5602 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5603}
5604#[non_exhaustive]
5605#[derive(Clone, PartialEq, ::prost::Message)]
5606pub struct ListOwnedObjectsResponse {
5607 #[prost(message, repeated, tag = "1")]
5609 pub objects: ::prost::alloc::vec::Vec<Object>,
5610 #[prost(bytes = "bytes", optional, tag = "2")]
5613 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5614}
5615pub mod state_service_client {
5617 #![allow(
5618 unused_variables,
5619 dead_code,
5620 missing_docs,
5621 clippy::wildcard_imports,
5622 clippy::let_unit_value,
5623 )]
5624 use tonic::codegen::*;
5625 use tonic::codegen::http::Uri;
5626 #[derive(Debug, Clone)]
5627 pub struct StateServiceClient<T> {
5628 inner: tonic::client::Grpc<T>,
5629 }
5630 impl StateServiceClient<tonic::transport::Channel> {
5631 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5633 where
5634 D: TryInto<tonic::transport::Endpoint>,
5635 D::Error: Into<StdError>,
5636 {
5637 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5638 Ok(Self::new(conn))
5639 }
5640 }
5641 impl<T> StateServiceClient<T>
5642 where
5643 T: tonic::client::GrpcService<tonic::body::Body>,
5644 T::Error: Into<StdError>,
5645 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5646 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5647 {
5648 pub fn new(inner: T) -> Self {
5649 let inner = tonic::client::Grpc::new(inner);
5650 Self { inner }
5651 }
5652 pub fn with_origin(inner: T, origin: Uri) -> Self {
5653 let inner = tonic::client::Grpc::with_origin(inner, origin);
5654 Self { inner }
5655 }
5656 pub fn with_interceptor<F>(
5657 inner: T,
5658 interceptor: F,
5659 ) -> StateServiceClient<InterceptedService<T, F>>
5660 where
5661 F: tonic::service::Interceptor,
5662 T::ResponseBody: Default,
5663 T: tonic::codegen::Service<
5664 http::Request<tonic::body::Body>,
5665 Response = http::Response<
5666 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5667 >,
5668 >,
5669 <T as tonic::codegen::Service<
5670 http::Request<tonic::body::Body>,
5671 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5672 {
5673 StateServiceClient::new(InterceptedService::new(inner, interceptor))
5674 }
5675 #[must_use]
5680 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5681 self.inner = self.inner.send_compressed(encoding);
5682 self
5683 }
5684 #[must_use]
5686 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5687 self.inner = self.inner.accept_compressed(encoding);
5688 self
5689 }
5690 #[must_use]
5694 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5695 self.inner = self.inner.max_decoding_message_size(limit);
5696 self
5697 }
5698 #[must_use]
5702 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5703 self.inner = self.inner.max_encoding_message_size(limit);
5704 self
5705 }
5706 pub async fn list_dynamic_fields(
5707 &mut self,
5708 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
5709 ) -> std::result::Result<
5710 tonic::Response<super::ListDynamicFieldsResponse>,
5711 tonic::Status,
5712 > {
5713 self.inner
5714 .ready()
5715 .await
5716 .map_err(|e| {
5717 tonic::Status::unknown(
5718 format!("Service was not ready: {}", e.into()),
5719 )
5720 })?;
5721 let codec = tonic_prost::ProstCodec::default();
5722 let path = http::uri::PathAndQuery::from_static(
5723 "/sui.rpc.v2.StateService/ListDynamicFields",
5724 );
5725 let mut req = request.into_request();
5726 req.extensions_mut()
5727 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
5728 self.inner.unary(req, path, codec).await
5729 }
5730 pub async fn list_owned_objects(
5731 &mut self,
5732 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
5733 ) -> std::result::Result<
5734 tonic::Response<super::ListOwnedObjectsResponse>,
5735 tonic::Status,
5736 > {
5737 self.inner
5738 .ready()
5739 .await
5740 .map_err(|e| {
5741 tonic::Status::unknown(
5742 format!("Service was not ready: {}", e.into()),
5743 )
5744 })?;
5745 let codec = tonic_prost::ProstCodec::default();
5746 let path = http::uri::PathAndQuery::from_static(
5747 "/sui.rpc.v2.StateService/ListOwnedObjects",
5748 );
5749 let mut req = request.into_request();
5750 req.extensions_mut()
5751 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
5752 self.inner.unary(req, path, codec).await
5753 }
5754 pub async fn get_coin_info(
5755 &mut self,
5756 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
5757 ) -> std::result::Result<
5758 tonic::Response<super::GetCoinInfoResponse>,
5759 tonic::Status,
5760 > {
5761 self.inner
5762 .ready()
5763 .await
5764 .map_err(|e| {
5765 tonic::Status::unknown(
5766 format!("Service was not ready: {}", e.into()),
5767 )
5768 })?;
5769 let codec = tonic_prost::ProstCodec::default();
5770 let path = http::uri::PathAndQuery::from_static(
5771 "/sui.rpc.v2.StateService/GetCoinInfo",
5772 );
5773 let mut req = request.into_request();
5774 req.extensions_mut()
5775 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
5776 self.inner.unary(req, path, codec).await
5777 }
5778 pub async fn get_balance(
5779 &mut self,
5780 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
5781 ) -> std::result::Result<
5782 tonic::Response<super::GetBalanceResponse>,
5783 tonic::Status,
5784 > {
5785 self.inner
5786 .ready()
5787 .await
5788 .map_err(|e| {
5789 tonic::Status::unknown(
5790 format!("Service was not ready: {}", e.into()),
5791 )
5792 })?;
5793 let codec = tonic_prost::ProstCodec::default();
5794 let path = http::uri::PathAndQuery::from_static(
5795 "/sui.rpc.v2.StateService/GetBalance",
5796 );
5797 let mut req = request.into_request();
5798 req.extensions_mut()
5799 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
5800 self.inner.unary(req, path, codec).await
5801 }
5802 pub async fn list_balances(
5803 &mut self,
5804 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
5805 ) -> std::result::Result<
5806 tonic::Response<super::ListBalancesResponse>,
5807 tonic::Status,
5808 > {
5809 self.inner
5810 .ready()
5811 .await
5812 .map_err(|e| {
5813 tonic::Status::unknown(
5814 format!("Service was not ready: {}", e.into()),
5815 )
5816 })?;
5817 let codec = tonic_prost::ProstCodec::default();
5818 let path = http::uri::PathAndQuery::from_static(
5819 "/sui.rpc.v2.StateService/ListBalances",
5820 );
5821 let mut req = request.into_request();
5822 req.extensions_mut()
5823 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
5824 self.inner.unary(req, path, codec).await
5825 }
5826 }
5827}
5828pub mod state_service_server {
5830 #![allow(
5831 unused_variables,
5832 dead_code,
5833 missing_docs,
5834 clippy::wildcard_imports,
5835 clippy::let_unit_value,
5836 )]
5837 use tonic::codegen::*;
5838 #[async_trait]
5840 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
5841 async fn list_dynamic_fields(
5842 &self,
5843 request: tonic::Request<super::ListDynamicFieldsRequest>,
5844 ) -> std::result::Result<
5845 tonic::Response<super::ListDynamicFieldsResponse>,
5846 tonic::Status,
5847 >;
5848 async fn list_owned_objects(
5849 &self,
5850 request: tonic::Request<super::ListOwnedObjectsRequest>,
5851 ) -> std::result::Result<
5852 tonic::Response<super::ListOwnedObjectsResponse>,
5853 tonic::Status,
5854 >;
5855 async fn get_coin_info(
5856 &self,
5857 request: tonic::Request<super::GetCoinInfoRequest>,
5858 ) -> std::result::Result<
5859 tonic::Response<super::GetCoinInfoResponse>,
5860 tonic::Status,
5861 >;
5862 async fn get_balance(
5863 &self,
5864 request: tonic::Request<super::GetBalanceRequest>,
5865 ) -> std::result::Result<
5866 tonic::Response<super::GetBalanceResponse>,
5867 tonic::Status,
5868 >;
5869 async fn list_balances(
5870 &self,
5871 request: tonic::Request<super::ListBalancesRequest>,
5872 ) -> std::result::Result<
5873 tonic::Response<super::ListBalancesResponse>,
5874 tonic::Status,
5875 >;
5876 }
5877 #[derive(Debug)]
5878 pub struct StateServiceServer<T> {
5879 inner: Arc<T>,
5880 accept_compression_encodings: EnabledCompressionEncodings,
5881 send_compression_encodings: EnabledCompressionEncodings,
5882 max_decoding_message_size: Option<usize>,
5883 max_encoding_message_size: Option<usize>,
5884 }
5885 impl<T> StateServiceServer<T> {
5886 pub fn new(inner: T) -> Self {
5887 Self::from_arc(Arc::new(inner))
5888 }
5889 pub fn from_arc(inner: Arc<T>) -> Self {
5890 Self {
5891 inner,
5892 accept_compression_encodings: Default::default(),
5893 send_compression_encodings: Default::default(),
5894 max_decoding_message_size: None,
5895 max_encoding_message_size: None,
5896 }
5897 }
5898 pub fn with_interceptor<F>(
5899 inner: T,
5900 interceptor: F,
5901 ) -> InterceptedService<Self, F>
5902 where
5903 F: tonic::service::Interceptor,
5904 {
5905 InterceptedService::new(Self::new(inner), interceptor)
5906 }
5907 #[must_use]
5909 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5910 self.accept_compression_encodings.enable(encoding);
5911 self
5912 }
5913 #[must_use]
5915 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5916 self.send_compression_encodings.enable(encoding);
5917 self
5918 }
5919 #[must_use]
5923 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5924 self.max_decoding_message_size = Some(limit);
5925 self
5926 }
5927 #[must_use]
5931 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5932 self.max_encoding_message_size = Some(limit);
5933 self
5934 }
5935 }
5936 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
5937 where
5938 T: StateService,
5939 B: Body + std::marker::Send + 'static,
5940 B::Error: Into<StdError> + std::marker::Send + 'static,
5941 {
5942 type Response = http::Response<tonic::body::Body>;
5943 type Error = std::convert::Infallible;
5944 type Future = BoxFuture<Self::Response, Self::Error>;
5945 fn poll_ready(
5946 &mut self,
5947 _cx: &mut Context<'_>,
5948 ) -> Poll<std::result::Result<(), Self::Error>> {
5949 Poll::Ready(Ok(()))
5950 }
5951 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5952 match req.uri().path() {
5953 "/sui.rpc.v2.StateService/ListDynamicFields" => {
5954 #[allow(non_camel_case_types)]
5955 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
5956 impl<
5957 T: StateService,
5958 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
5959 for ListDynamicFieldsSvc<T> {
5960 type Response = super::ListDynamicFieldsResponse;
5961 type Future = BoxFuture<
5962 tonic::Response<Self::Response>,
5963 tonic::Status,
5964 >;
5965 fn call(
5966 &mut self,
5967 request: tonic::Request<super::ListDynamicFieldsRequest>,
5968 ) -> Self::Future {
5969 let inner = Arc::clone(&self.0);
5970 let fut = async move {
5971 <T as StateService>::list_dynamic_fields(&inner, request)
5972 .await
5973 };
5974 Box::pin(fut)
5975 }
5976 }
5977 let accept_compression_encodings = self.accept_compression_encodings;
5978 let send_compression_encodings = self.send_compression_encodings;
5979 let max_decoding_message_size = self.max_decoding_message_size;
5980 let max_encoding_message_size = self.max_encoding_message_size;
5981 let inner = self.inner.clone();
5982 let fut = async move {
5983 let method = ListDynamicFieldsSvc(inner);
5984 let codec = tonic_prost::ProstCodec::default();
5985 let mut grpc = tonic::server::Grpc::new(codec)
5986 .apply_compression_config(
5987 accept_compression_encodings,
5988 send_compression_encodings,
5989 )
5990 .apply_max_message_size_config(
5991 max_decoding_message_size,
5992 max_encoding_message_size,
5993 );
5994 let res = grpc.unary(method, req).await;
5995 Ok(res)
5996 };
5997 Box::pin(fut)
5998 }
5999 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
6000 #[allow(non_camel_case_types)]
6001 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
6002 impl<
6003 T: StateService,
6004 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
6005 for ListOwnedObjectsSvc<T> {
6006 type Response = super::ListOwnedObjectsResponse;
6007 type Future = BoxFuture<
6008 tonic::Response<Self::Response>,
6009 tonic::Status,
6010 >;
6011 fn call(
6012 &mut self,
6013 request: tonic::Request<super::ListOwnedObjectsRequest>,
6014 ) -> Self::Future {
6015 let inner = Arc::clone(&self.0);
6016 let fut = async move {
6017 <T as StateService>::list_owned_objects(&inner, request)
6018 .await
6019 };
6020 Box::pin(fut)
6021 }
6022 }
6023 let accept_compression_encodings = self.accept_compression_encodings;
6024 let send_compression_encodings = self.send_compression_encodings;
6025 let max_decoding_message_size = self.max_decoding_message_size;
6026 let max_encoding_message_size = self.max_encoding_message_size;
6027 let inner = self.inner.clone();
6028 let fut = async move {
6029 let method = ListOwnedObjectsSvc(inner);
6030 let codec = tonic_prost::ProstCodec::default();
6031 let mut grpc = tonic::server::Grpc::new(codec)
6032 .apply_compression_config(
6033 accept_compression_encodings,
6034 send_compression_encodings,
6035 )
6036 .apply_max_message_size_config(
6037 max_decoding_message_size,
6038 max_encoding_message_size,
6039 );
6040 let res = grpc.unary(method, req).await;
6041 Ok(res)
6042 };
6043 Box::pin(fut)
6044 }
6045 "/sui.rpc.v2.StateService/GetCoinInfo" => {
6046 #[allow(non_camel_case_types)]
6047 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
6048 impl<
6049 T: StateService,
6050 > tonic::server::UnaryService<super::GetCoinInfoRequest>
6051 for GetCoinInfoSvc<T> {
6052 type Response = super::GetCoinInfoResponse;
6053 type Future = BoxFuture<
6054 tonic::Response<Self::Response>,
6055 tonic::Status,
6056 >;
6057 fn call(
6058 &mut self,
6059 request: tonic::Request<super::GetCoinInfoRequest>,
6060 ) -> Self::Future {
6061 let inner = Arc::clone(&self.0);
6062 let fut = async move {
6063 <T as StateService>::get_coin_info(&inner, request).await
6064 };
6065 Box::pin(fut)
6066 }
6067 }
6068 let accept_compression_encodings = self.accept_compression_encodings;
6069 let send_compression_encodings = self.send_compression_encodings;
6070 let max_decoding_message_size = self.max_decoding_message_size;
6071 let max_encoding_message_size = self.max_encoding_message_size;
6072 let inner = self.inner.clone();
6073 let fut = async move {
6074 let method = GetCoinInfoSvc(inner);
6075 let codec = tonic_prost::ProstCodec::default();
6076 let mut grpc = tonic::server::Grpc::new(codec)
6077 .apply_compression_config(
6078 accept_compression_encodings,
6079 send_compression_encodings,
6080 )
6081 .apply_max_message_size_config(
6082 max_decoding_message_size,
6083 max_encoding_message_size,
6084 );
6085 let res = grpc.unary(method, req).await;
6086 Ok(res)
6087 };
6088 Box::pin(fut)
6089 }
6090 "/sui.rpc.v2.StateService/GetBalance" => {
6091 #[allow(non_camel_case_types)]
6092 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
6093 impl<
6094 T: StateService,
6095 > tonic::server::UnaryService<super::GetBalanceRequest>
6096 for GetBalanceSvc<T> {
6097 type Response = super::GetBalanceResponse;
6098 type Future = BoxFuture<
6099 tonic::Response<Self::Response>,
6100 tonic::Status,
6101 >;
6102 fn call(
6103 &mut self,
6104 request: tonic::Request<super::GetBalanceRequest>,
6105 ) -> Self::Future {
6106 let inner = Arc::clone(&self.0);
6107 let fut = async move {
6108 <T as StateService>::get_balance(&inner, request).await
6109 };
6110 Box::pin(fut)
6111 }
6112 }
6113 let accept_compression_encodings = self.accept_compression_encodings;
6114 let send_compression_encodings = self.send_compression_encodings;
6115 let max_decoding_message_size = self.max_decoding_message_size;
6116 let max_encoding_message_size = self.max_encoding_message_size;
6117 let inner = self.inner.clone();
6118 let fut = async move {
6119 let method = GetBalanceSvc(inner);
6120 let codec = tonic_prost::ProstCodec::default();
6121 let mut grpc = tonic::server::Grpc::new(codec)
6122 .apply_compression_config(
6123 accept_compression_encodings,
6124 send_compression_encodings,
6125 )
6126 .apply_max_message_size_config(
6127 max_decoding_message_size,
6128 max_encoding_message_size,
6129 );
6130 let res = grpc.unary(method, req).await;
6131 Ok(res)
6132 };
6133 Box::pin(fut)
6134 }
6135 "/sui.rpc.v2.StateService/ListBalances" => {
6136 #[allow(non_camel_case_types)]
6137 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
6138 impl<
6139 T: StateService,
6140 > tonic::server::UnaryService<super::ListBalancesRequest>
6141 for ListBalancesSvc<T> {
6142 type Response = super::ListBalancesResponse;
6143 type Future = BoxFuture<
6144 tonic::Response<Self::Response>,
6145 tonic::Status,
6146 >;
6147 fn call(
6148 &mut self,
6149 request: tonic::Request<super::ListBalancesRequest>,
6150 ) -> Self::Future {
6151 let inner = Arc::clone(&self.0);
6152 let fut = async move {
6153 <T as StateService>::list_balances(&inner, request).await
6154 };
6155 Box::pin(fut)
6156 }
6157 }
6158 let accept_compression_encodings = self.accept_compression_encodings;
6159 let send_compression_encodings = self.send_compression_encodings;
6160 let max_decoding_message_size = self.max_decoding_message_size;
6161 let max_encoding_message_size = self.max_encoding_message_size;
6162 let inner = self.inner.clone();
6163 let fut = async move {
6164 let method = ListBalancesSvc(inner);
6165 let codec = tonic_prost::ProstCodec::default();
6166 let mut grpc = tonic::server::Grpc::new(codec)
6167 .apply_compression_config(
6168 accept_compression_encodings,
6169 send_compression_encodings,
6170 )
6171 .apply_max_message_size_config(
6172 max_decoding_message_size,
6173 max_encoding_message_size,
6174 );
6175 let res = grpc.unary(method, req).await;
6176 Ok(res)
6177 };
6178 Box::pin(fut)
6179 }
6180 _ => {
6181 Box::pin(async move {
6182 let mut response = http::Response::new(
6183 tonic::body::Body::default(),
6184 );
6185 let headers = response.headers_mut();
6186 headers
6187 .insert(
6188 tonic::Status::GRPC_STATUS,
6189 (tonic::Code::Unimplemented as i32).into(),
6190 );
6191 headers
6192 .insert(
6193 http::header::CONTENT_TYPE,
6194 tonic::metadata::GRPC_CONTENT_TYPE,
6195 );
6196 Ok(response)
6197 })
6198 }
6199 }
6200 }
6201 }
6202 impl<T> Clone for StateServiceServer<T> {
6203 fn clone(&self) -> Self {
6204 let inner = self.inner.clone();
6205 Self {
6206 inner,
6207 accept_compression_encodings: self.accept_compression_encodings,
6208 send_compression_encodings: self.send_compression_encodings,
6209 max_decoding_message_size: self.max_decoding_message_size,
6210 max_encoding_message_size: self.max_encoding_message_size,
6211 }
6212 }
6213 }
6214 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
6216 impl<T> tonic::server::NamedService for StateServiceServer<T> {
6217 const NAME: &'static str = SERVICE_NAME;
6218 }
6219}
6220#[non_exhaustive]
6222#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6223pub struct SubscribeCheckpointsRequest {
6224 #[prost(message, optional, tag = "1")]
6227 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6228}
6229#[non_exhaustive]
6231#[derive(Clone, PartialEq, ::prost::Message)]
6232pub struct SubscribeCheckpointsResponse {
6233 #[prost(uint64, optional, tag = "1")]
6236 pub cursor: ::core::option::Option<u64>,
6237 #[prost(message, optional, tag = "2")]
6239 pub checkpoint: ::core::option::Option<Checkpoint>,
6240}
6241pub mod subscription_service_client {
6243 #![allow(
6244 unused_variables,
6245 dead_code,
6246 missing_docs,
6247 clippy::wildcard_imports,
6248 clippy::let_unit_value,
6249 )]
6250 use tonic::codegen::*;
6251 use tonic::codegen::http::Uri;
6252 #[derive(Debug, Clone)]
6253 pub struct SubscriptionServiceClient<T> {
6254 inner: tonic::client::Grpc<T>,
6255 }
6256 impl SubscriptionServiceClient<tonic::transport::Channel> {
6257 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6259 where
6260 D: TryInto<tonic::transport::Endpoint>,
6261 D::Error: Into<StdError>,
6262 {
6263 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6264 Ok(Self::new(conn))
6265 }
6266 }
6267 impl<T> SubscriptionServiceClient<T>
6268 where
6269 T: tonic::client::GrpcService<tonic::body::Body>,
6270 T::Error: Into<StdError>,
6271 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6272 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6273 {
6274 pub fn new(inner: T) -> Self {
6275 let inner = tonic::client::Grpc::new(inner);
6276 Self { inner }
6277 }
6278 pub fn with_origin(inner: T, origin: Uri) -> Self {
6279 let inner = tonic::client::Grpc::with_origin(inner, origin);
6280 Self { inner }
6281 }
6282 pub fn with_interceptor<F>(
6283 inner: T,
6284 interceptor: F,
6285 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
6286 where
6287 F: tonic::service::Interceptor,
6288 T::ResponseBody: Default,
6289 T: tonic::codegen::Service<
6290 http::Request<tonic::body::Body>,
6291 Response = http::Response<
6292 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6293 >,
6294 >,
6295 <T as tonic::codegen::Service<
6296 http::Request<tonic::body::Body>,
6297 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6298 {
6299 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
6300 }
6301 #[must_use]
6306 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6307 self.inner = self.inner.send_compressed(encoding);
6308 self
6309 }
6310 #[must_use]
6312 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6313 self.inner = self.inner.accept_compressed(encoding);
6314 self
6315 }
6316 #[must_use]
6320 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6321 self.inner = self.inner.max_decoding_message_size(limit);
6322 self
6323 }
6324 #[must_use]
6328 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6329 self.inner = self.inner.max_encoding_message_size(limit);
6330 self
6331 }
6332 pub async fn subscribe_checkpoints(
6344 &mut self,
6345 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
6346 ) -> std::result::Result<
6347 tonic::Response<
6348 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
6349 >,
6350 tonic::Status,
6351 > {
6352 self.inner
6353 .ready()
6354 .await
6355 .map_err(|e| {
6356 tonic::Status::unknown(
6357 format!("Service was not ready: {}", e.into()),
6358 )
6359 })?;
6360 let codec = tonic_prost::ProstCodec::default();
6361 let path = http::uri::PathAndQuery::from_static(
6362 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
6363 );
6364 let mut req = request.into_request();
6365 req.extensions_mut()
6366 .insert(
6367 GrpcMethod::new(
6368 "sui.rpc.v2.SubscriptionService",
6369 "SubscribeCheckpoints",
6370 ),
6371 );
6372 self.inner.server_streaming(req, path, codec).await
6373 }
6374 }
6375}
6376pub mod subscription_service_server {
6378 #![allow(
6379 unused_variables,
6380 dead_code,
6381 missing_docs,
6382 clippy::wildcard_imports,
6383 clippy::let_unit_value,
6384 )]
6385 use tonic::codegen::*;
6386 #[async_trait]
6388 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
6389 type SubscribeCheckpointsStream: tonic::codegen::tokio_stream::Stream<
6391 Item = std::result::Result<
6392 super::SubscribeCheckpointsResponse,
6393 tonic::Status,
6394 >,
6395 >
6396 + std::marker::Send
6397 + 'static;
6398 async fn subscribe_checkpoints(
6410 &self,
6411 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6412 ) -> std::result::Result<
6413 tonic::Response<Self::SubscribeCheckpointsStream>,
6414 tonic::Status,
6415 >;
6416 }
6417 #[derive(Debug)]
6418 pub struct SubscriptionServiceServer<T> {
6419 inner: Arc<T>,
6420 accept_compression_encodings: EnabledCompressionEncodings,
6421 send_compression_encodings: EnabledCompressionEncodings,
6422 max_decoding_message_size: Option<usize>,
6423 max_encoding_message_size: Option<usize>,
6424 }
6425 impl<T> SubscriptionServiceServer<T> {
6426 pub fn new(inner: T) -> Self {
6427 Self::from_arc(Arc::new(inner))
6428 }
6429 pub fn from_arc(inner: Arc<T>) -> Self {
6430 Self {
6431 inner,
6432 accept_compression_encodings: Default::default(),
6433 send_compression_encodings: Default::default(),
6434 max_decoding_message_size: None,
6435 max_encoding_message_size: None,
6436 }
6437 }
6438 pub fn with_interceptor<F>(
6439 inner: T,
6440 interceptor: F,
6441 ) -> InterceptedService<Self, F>
6442 where
6443 F: tonic::service::Interceptor,
6444 {
6445 InterceptedService::new(Self::new(inner), interceptor)
6446 }
6447 #[must_use]
6449 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6450 self.accept_compression_encodings.enable(encoding);
6451 self
6452 }
6453 #[must_use]
6455 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6456 self.send_compression_encodings.enable(encoding);
6457 self
6458 }
6459 #[must_use]
6463 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6464 self.max_decoding_message_size = Some(limit);
6465 self
6466 }
6467 #[must_use]
6471 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6472 self.max_encoding_message_size = Some(limit);
6473 self
6474 }
6475 }
6476 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
6477 where
6478 T: SubscriptionService,
6479 B: Body + std::marker::Send + 'static,
6480 B::Error: Into<StdError> + std::marker::Send + 'static,
6481 {
6482 type Response = http::Response<tonic::body::Body>;
6483 type Error = std::convert::Infallible;
6484 type Future = BoxFuture<Self::Response, Self::Error>;
6485 fn poll_ready(
6486 &mut self,
6487 _cx: &mut Context<'_>,
6488 ) -> Poll<std::result::Result<(), Self::Error>> {
6489 Poll::Ready(Ok(()))
6490 }
6491 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6492 match req.uri().path() {
6493 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
6494 #[allow(non_camel_case_types)]
6495 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
6496 impl<
6497 T: SubscriptionService,
6498 > tonic::server::ServerStreamingService<
6499 super::SubscribeCheckpointsRequest,
6500 > for SubscribeCheckpointsSvc<T> {
6501 type Response = super::SubscribeCheckpointsResponse;
6502 type ResponseStream = T::SubscribeCheckpointsStream;
6503 type Future = BoxFuture<
6504 tonic::Response<Self::ResponseStream>,
6505 tonic::Status,
6506 >;
6507 fn call(
6508 &mut self,
6509 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6510 ) -> Self::Future {
6511 let inner = Arc::clone(&self.0);
6512 let fut = async move {
6513 <T as SubscriptionService>::subscribe_checkpoints(
6514 &inner,
6515 request,
6516 )
6517 .await
6518 };
6519 Box::pin(fut)
6520 }
6521 }
6522 let accept_compression_encodings = self.accept_compression_encodings;
6523 let send_compression_encodings = self.send_compression_encodings;
6524 let max_decoding_message_size = self.max_decoding_message_size;
6525 let max_encoding_message_size = self.max_encoding_message_size;
6526 let inner = self.inner.clone();
6527 let fut = async move {
6528 let method = SubscribeCheckpointsSvc(inner);
6529 let codec = tonic_prost::ProstCodec::default();
6530 let mut grpc = tonic::server::Grpc::new(codec)
6531 .apply_compression_config(
6532 accept_compression_encodings,
6533 send_compression_encodings,
6534 )
6535 .apply_max_message_size_config(
6536 max_decoding_message_size,
6537 max_encoding_message_size,
6538 );
6539 let res = grpc.server_streaming(method, req).await;
6540 Ok(res)
6541 };
6542 Box::pin(fut)
6543 }
6544 _ => {
6545 Box::pin(async move {
6546 let mut response = http::Response::new(
6547 tonic::body::Body::default(),
6548 );
6549 let headers = response.headers_mut();
6550 headers
6551 .insert(
6552 tonic::Status::GRPC_STATUS,
6553 (tonic::Code::Unimplemented as i32).into(),
6554 );
6555 headers
6556 .insert(
6557 http::header::CONTENT_TYPE,
6558 tonic::metadata::GRPC_CONTENT_TYPE,
6559 );
6560 Ok(response)
6561 })
6562 }
6563 }
6564 }
6565 }
6566 impl<T> Clone for SubscriptionServiceServer<T> {
6567 fn clone(&self) -> Self {
6568 let inner = self.inner.clone();
6569 Self {
6570 inner,
6571 accept_compression_encodings: self.accept_compression_encodings,
6572 send_compression_encodings: self.send_compression_encodings,
6573 max_decoding_message_size: self.max_decoding_message_size,
6574 max_encoding_message_size: self.max_encoding_message_size,
6575 }
6576 }
6577 }
6578 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
6580 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
6581 const NAME: &'static str = SERVICE_NAME;
6582 }
6583}
6584#[non_exhaustive]
6585#[derive(Clone, PartialEq, ::prost::Message)]
6586pub struct SystemState {
6587 #[prost(uint64, optional, tag = "1")]
6589 pub version: ::core::option::Option<u64>,
6590 #[prost(uint64, optional, tag = "2")]
6592 pub epoch: ::core::option::Option<u64>,
6593 #[prost(uint64, optional, tag = "3")]
6595 pub protocol_version: ::core::option::Option<u64>,
6596 #[prost(message, optional, tag = "4")]
6598 pub validators: ::core::option::Option<ValidatorSet>,
6599 #[prost(message, optional, tag = "5")]
6601 pub storage_fund: ::core::option::Option<StorageFund>,
6602 #[prost(message, optional, tag = "6")]
6604 pub parameters: ::core::option::Option<SystemParameters>,
6605 #[prost(uint64, optional, tag = "7")]
6607 pub reference_gas_price: ::core::option::Option<u64>,
6608 #[prost(message, repeated, tag = "8")]
6616 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
6617 #[prost(message, optional, tag = "9")]
6619 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
6620 #[prost(bool, optional, tag = "10")]
6627 pub safe_mode: ::core::option::Option<bool>,
6628 #[prost(uint64, optional, tag = "11")]
6630 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
6631 #[prost(uint64, optional, tag = "12")]
6633 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
6634 #[prost(uint64, optional, tag = "13")]
6636 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
6637 #[prost(uint64, optional, tag = "14")]
6639 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
6640 #[prost(uint64, optional, tag = "15")]
6642 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
6643 #[prost(message, optional, tag = "16")]
6645 pub extra_fields: ::core::option::Option<MoveTable>,
6646}
6647#[non_exhaustive]
6648#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6649pub struct ValidatorReportRecord {
6650 #[prost(string, optional, tag = "1")]
6652 pub reported: ::core::option::Option<::prost::alloc::string::String>,
6653 #[prost(string, repeated, tag = "2")]
6655 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6656}
6657#[non_exhaustive]
6658#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6659pub struct SystemParameters {
6660 #[prost(uint64, optional, tag = "1")]
6662 pub epoch_duration_ms: ::core::option::Option<u64>,
6663 #[prost(uint64, optional, tag = "2")]
6665 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
6666 #[prost(uint64, optional, tag = "3")]
6668 pub min_validator_count: ::core::option::Option<u64>,
6669 #[prost(uint64, optional, tag = "4")]
6672 pub max_validator_count: ::core::option::Option<u64>,
6673 #[prost(uint64, optional, tag = "5")]
6676 pub min_validator_joining_stake: ::core::option::Option<u64>,
6677 #[prost(uint64, optional, tag = "6")]
6682 pub validator_low_stake_threshold: ::core::option::Option<u64>,
6683 #[prost(uint64, optional, tag = "7")]
6687 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
6688 #[prost(uint64, optional, tag = "8")]
6691 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
6692 #[prost(message, optional, tag = "9")]
6694 pub extra_fields: ::core::option::Option<MoveTable>,
6695}
6696#[non_exhaustive]
6698#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6699pub struct MoveTable {
6700 #[prost(string, optional, tag = "1")]
6702 pub id: ::core::option::Option<::prost::alloc::string::String>,
6703 #[prost(uint64, optional, tag = "2")]
6705 pub size: ::core::option::Option<u64>,
6706}
6707#[non_exhaustive]
6708#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6709pub struct StakeSubsidy {
6710 #[prost(uint64, optional, tag = "1")]
6712 pub balance: ::core::option::Option<u64>,
6713 #[prost(uint64, optional, tag = "2")]
6715 pub distribution_counter: ::core::option::Option<u64>,
6716 #[prost(uint64, optional, tag = "3")]
6719 pub current_distribution_amount: ::core::option::Option<u64>,
6720 #[prost(uint64, optional, tag = "4")]
6722 pub stake_subsidy_period_length: ::core::option::Option<u64>,
6723 #[prost(uint32, optional, tag = "5")]
6726 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
6727 #[prost(message, optional, tag = "6")]
6729 pub extra_fields: ::core::option::Option<MoveTable>,
6730}
6731#[non_exhaustive]
6733#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6734pub struct StorageFund {
6735 #[prost(uint64, optional, tag = "1")]
6741 pub total_object_storage_rebates: ::core::option::Option<u64>,
6742 #[prost(uint64, optional, tag = "2")]
6745 pub non_refundable_balance: ::core::option::Option<u64>,
6746}
6747#[non_exhaustive]
6748#[derive(Clone, PartialEq, ::prost::Message)]
6749pub struct ValidatorSet {
6750 #[prost(uint64, optional, tag = "1")]
6753 pub total_stake: ::core::option::Option<u64>,
6754 #[prost(message, repeated, tag = "2")]
6756 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
6757 #[prost(message, optional, tag = "3")]
6762 pub pending_active_validators: ::core::option::Option<MoveTable>,
6763 #[prost(uint64, repeated, tag = "4")]
6766 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
6767 #[prost(message, optional, tag = "5")]
6771 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
6772 #[prost(message, optional, tag = "6")]
6778 pub inactive_validators: ::core::option::Option<MoveTable>,
6779 #[prost(message, optional, tag = "7")]
6787 pub validator_candidates: ::core::option::Option<MoveTable>,
6788 #[prost(btree_map = "string, uint64", tag = "8")]
6790 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
6791 ::prost::alloc::string::String,
6792 u64,
6793 >,
6794 #[prost(message, optional, tag = "9")]
6796 pub extra_fields: ::core::option::Option<MoveTable>,
6797}
6798#[non_exhaustive]
6802#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6803pub struct Validator {
6804 #[prost(string, optional, tag = "1")]
6806 pub name: ::core::option::Option<::prost::alloc::string::String>,
6807 #[prost(string, optional, tag = "2")]
6810 pub address: ::core::option::Option<::prost::alloc::string::String>,
6811 #[prost(string, optional, tag = "3")]
6812 pub description: ::core::option::Option<::prost::alloc::string::String>,
6813 #[prost(string, optional, tag = "4")]
6814 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
6815 #[prost(string, optional, tag = "5")]
6816 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
6817 #[prost(bytes = "bytes", optional, tag = "7")]
6820 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6821 #[prost(bytes = "bytes", optional, tag = "8")]
6823 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6824 #[prost(bytes = "bytes", optional, tag = "10")]
6827 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6828 #[prost(bytes = "bytes", optional, tag = "12")]
6830 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6831 #[prost(string, optional, tag = "13")]
6833 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
6834 #[prost(string, optional, tag = "14")]
6836 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6837 #[prost(string, optional, tag = "15")]
6839 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
6840 #[prost(string, optional, tag = "16")]
6842 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
6843 #[prost(bytes = "bytes", optional, tag = "18")]
6844 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6845 #[prost(bytes = "bytes", optional, tag = "19")]
6846 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6847 #[prost(bytes = "bytes", optional, tag = "21")]
6848 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6849 #[prost(bytes = "bytes", optional, tag = "23")]
6850 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6851 #[prost(string, optional, tag = "24")]
6852 pub next_epoch_network_address: ::core::option::Option<
6853 ::prost::alloc::string::String,
6854 >,
6855 #[prost(string, optional, tag = "25")]
6856 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6857 #[prost(string, optional, tag = "26")]
6858 pub next_epoch_primary_address: ::core::option::Option<
6859 ::prost::alloc::string::String,
6860 >,
6861 #[prost(string, optional, tag = "27")]
6862 pub next_epoch_worker_address: ::core::option::Option<
6863 ::prost::alloc::string::String,
6864 >,
6865 #[prost(message, optional, tag = "28")]
6867 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
6868 #[prost(uint64, optional, tag = "29")]
6871 pub voting_power: ::core::option::Option<u64>,
6872 #[prost(string, optional, tag = "30")]
6874 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6875 #[prost(uint64, optional, tag = "31")]
6877 pub gas_price: ::core::option::Option<u64>,
6878 #[prost(message, optional, tag = "32")]
6880 pub staking_pool: ::core::option::Option<StakingPool>,
6881 #[prost(uint64, optional, tag = "33")]
6883 pub commission_rate: ::core::option::Option<u64>,
6884 #[prost(uint64, optional, tag = "34")]
6886 pub next_epoch_stake: ::core::option::Option<u64>,
6887 #[prost(uint64, optional, tag = "35")]
6889 pub next_epoch_gas_price: ::core::option::Option<u64>,
6890 #[prost(uint64, optional, tag = "36")]
6892 pub next_epoch_commission_rate: ::core::option::Option<u64>,
6893 #[prost(message, optional, tag = "37")]
6895 pub extra_fields: ::core::option::Option<MoveTable>,
6896}
6897#[non_exhaustive]
6899#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6900pub struct StakingPool {
6901 #[prost(string, optional, tag = "1")]
6903 pub id: ::core::option::Option<::prost::alloc::string::String>,
6904 #[prost(uint64, optional, tag = "2")]
6907 pub activation_epoch: ::core::option::Option<u64>,
6908 #[prost(uint64, optional, tag = "3")]
6911 pub deactivation_epoch: ::core::option::Option<u64>,
6912 #[prost(uint64, optional, tag = "4")]
6915 pub sui_balance: ::core::option::Option<u64>,
6916 #[prost(uint64, optional, tag = "5")]
6918 pub rewards_pool: ::core::option::Option<u64>,
6919 #[prost(uint64, optional, tag = "6")]
6921 pub pool_token_balance: ::core::option::Option<u64>,
6922 #[prost(message, optional, tag = "7")]
6929 pub exchange_rates: ::core::option::Option<MoveTable>,
6930 #[prost(uint64, optional, tag = "8")]
6932 pub pending_stake: ::core::option::Option<u64>,
6933 #[prost(uint64, optional, tag = "9")]
6936 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
6937 #[prost(uint64, optional, tag = "10")]
6939 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
6940 #[prost(message, optional, tag = "11")]
6942 pub extra_fields: ::core::option::Option<MoveTable>,
6943}
6944#[non_exhaustive]
6946#[derive(Clone, PartialEq, ::prost::Message)]
6947pub struct Transaction {
6948 #[prost(message, optional, tag = "1")]
6950 pub bcs: ::core::option::Option<Bcs>,
6951 #[prost(string, optional, tag = "2")]
6953 pub digest: ::core::option::Option<::prost::alloc::string::String>,
6954 #[prost(int32, optional, tag = "3")]
6956 pub version: ::core::option::Option<i32>,
6957 #[prost(message, optional, tag = "4")]
6958 pub kind: ::core::option::Option<TransactionKind>,
6959 #[prost(string, optional, tag = "5")]
6960 pub sender: ::core::option::Option<::prost::alloc::string::String>,
6961 #[prost(message, optional, tag = "6")]
6962 pub gas_payment: ::core::option::Option<GasPayment>,
6963 #[prost(message, optional, tag = "7")]
6964 pub expiration: ::core::option::Option<TransactionExpiration>,
6965}
6966#[non_exhaustive]
6968#[derive(Clone, PartialEq, ::prost::Message)]
6969pub struct GasPayment {
6970 #[prost(message, repeated, tag = "1")]
6972 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
6973 #[prost(string, optional, tag = "2")]
6975 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6976 #[prost(uint64, optional, tag = "3")]
6980 pub price: ::core::option::Option<u64>,
6981 #[prost(uint64, optional, tag = "4")]
6983 pub budget: ::core::option::Option<u64>,
6984}
6985#[non_exhaustive]
6987#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6988pub struct TransactionExpiration {
6989 #[prost(
6990 enumeration = "transaction_expiration::TransactionExpirationKind",
6991 optional,
6992 tag = "1"
6993 )]
6994 pub kind: ::core::option::Option<i32>,
6995 #[prost(uint64, optional, tag = "2")]
6998 pub epoch: ::core::option::Option<u64>,
6999 #[prost(uint64, optional, tag = "3")]
7002 pub min_epoch: ::core::option::Option<u64>,
7003 #[prost(message, optional, tag = "4")]
7007 pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7008 #[prost(message, optional, tag = "5")]
7012 pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7013 #[prost(string, optional, tag = "6")]
7015 pub chain: ::core::option::Option<::prost::alloc::string::String>,
7016 #[prost(uint32, optional, tag = "7")]
7018 pub nonce: ::core::option::Option<u32>,
7019}
7020pub mod transaction_expiration {
7022 #[non_exhaustive]
7023 #[derive(
7024 Clone,
7025 Copy,
7026 Debug,
7027 PartialEq,
7028 Eq,
7029 Hash,
7030 PartialOrd,
7031 Ord,
7032 ::prost::Enumeration
7033 )]
7034 #[repr(i32)]
7035 pub enum TransactionExpirationKind {
7036 Unknown = 0,
7037 None = 1,
7039 Epoch = 2,
7042 ValidDuring = 3,
7052 }
7053 impl TransactionExpirationKind {
7054 pub fn as_str_name(&self) -> &'static str {
7059 match self {
7060 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
7061 Self::None => "NONE",
7062 Self::Epoch => "EPOCH",
7063 Self::ValidDuring => "VALID_DURING",
7064 }
7065 }
7066 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7068 match value {
7069 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
7070 "NONE" => Some(Self::None),
7071 "EPOCH" => Some(Self::Epoch),
7072 "VALID_DURING" => Some(Self::ValidDuring),
7073 _ => None,
7074 }
7075 }
7076 }
7077}
7078#[non_exhaustive]
7080#[derive(Clone, PartialEq, ::prost::Message)]
7081pub struct TransactionKind {
7082 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
7083 pub kind: ::core::option::Option<i32>,
7084 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
7085 pub data: ::core::option::Option<transaction_kind::Data>,
7086}
7087pub mod transaction_kind {
7089 #[non_exhaustive]
7090 #[derive(
7091 Clone,
7092 Copy,
7093 Debug,
7094 PartialEq,
7095 Eq,
7096 Hash,
7097 PartialOrd,
7098 Ord,
7099 ::prost::Enumeration
7100 )]
7101 #[repr(i32)]
7102 pub enum Kind {
7103 Unknown = 0,
7104 ProgrammableTransaction = 1,
7106 ChangeEpoch = 2,
7111 Genesis = 3,
7116 ConsensusCommitPrologueV1 = 4,
7118 AuthenticatorStateUpdate = 5,
7120 EndOfEpoch = 6,
7123 RandomnessStateUpdate = 7,
7125 ConsensusCommitPrologueV2 = 8,
7127 ConsensusCommitPrologueV3 = 9,
7129 ConsensusCommitPrologueV4 = 10,
7131 ProgrammableSystemTransaction = 11,
7133 }
7134 impl Kind {
7135 pub fn as_str_name(&self) -> &'static str {
7140 match self {
7141 Self::Unknown => "KIND_UNKNOWN",
7142 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
7143 Self::ChangeEpoch => "CHANGE_EPOCH",
7144 Self::Genesis => "GENESIS",
7145 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
7146 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
7147 Self::EndOfEpoch => "END_OF_EPOCH",
7148 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
7149 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
7150 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
7151 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
7152 Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
7153 }
7154 }
7155 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7157 match value {
7158 "KIND_UNKNOWN" => Some(Self::Unknown),
7159 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
7160 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7161 "GENESIS" => Some(Self::Genesis),
7162 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
7163 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
7164 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
7165 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
7166 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
7167 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
7168 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
7169 "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
7170 Some(Self::ProgrammableSystemTransaction)
7171 }
7172 _ => None,
7173 }
7174 }
7175 }
7176 #[non_exhaustive]
7177 #[derive(Clone, PartialEq, ::prost::Oneof)]
7178 pub enum Data {
7179 #[prost(message, tag = "2")]
7181 ProgrammableTransaction(super::ProgrammableTransaction),
7182 #[prost(message, tag = "3")]
7187 ChangeEpoch(super::ChangeEpoch),
7188 #[prost(message, tag = "4")]
7193 Genesis(super::GenesisTransaction),
7194 #[prost(message, tag = "5")]
7196 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
7197 #[prost(message, tag = "6")]
7199 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
7200 #[prost(message, tag = "7")]
7203 EndOfEpoch(super::EndOfEpochTransaction),
7204 #[prost(message, tag = "8")]
7206 RandomnessStateUpdate(super::RandomnessStateUpdate),
7207 }
7208}
7209#[non_exhaustive]
7214#[derive(Clone, PartialEq, ::prost::Message)]
7215pub struct ProgrammableTransaction {
7216 #[prost(message, repeated, tag = "1")]
7218 pub inputs: ::prost::alloc::vec::Vec<Input>,
7219 #[prost(message, repeated, tag = "2")]
7222 pub commands: ::prost::alloc::vec::Vec<Command>,
7223}
7224#[non_exhaustive]
7226#[derive(Clone, PartialEq, ::prost::Message)]
7227pub struct Command {
7228 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
7229 pub command: ::core::option::Option<command::Command>,
7230}
7231pub mod command {
7233 #[non_exhaustive]
7234 #[derive(Clone, PartialEq, ::prost::Oneof)]
7235 pub enum Command {
7236 #[prost(message, tag = "1")]
7238 MoveCall(super::MoveCall),
7239 #[prost(message, tag = "2")]
7244 TransferObjects(super::TransferObjects),
7245 #[prost(message, tag = "3")]
7248 SplitCoins(super::SplitCoins),
7249 #[prost(message, tag = "4")]
7252 MergeCoins(super::MergeCoins),
7253 #[prost(message, tag = "5")]
7256 Publish(super::Publish),
7257 #[prost(message, tag = "6")]
7261 MakeMoveVector(super::MakeMoveVector),
7262 #[prost(message, tag = "7")]
7271 Upgrade(super::Upgrade),
7272 }
7273}
7274#[non_exhaustive]
7279#[derive(Clone, PartialEq, ::prost::Message)]
7280pub struct MoveCall {
7281 #[prost(string, optional, tag = "1")]
7283 pub package: ::core::option::Option<::prost::alloc::string::String>,
7284 #[prost(string, optional, tag = "2")]
7286 pub module: ::core::option::Option<::prost::alloc::string::String>,
7287 #[prost(string, optional, tag = "3")]
7289 pub function: ::core::option::Option<::prost::alloc::string::String>,
7290 #[prost(string, repeated, tag = "4")]
7292 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7293 #[prost(message, repeated, tag = "5")]
7295 pub arguments: ::prost::alloc::vec::Vec<Argument>,
7296}
7297#[non_exhaustive]
7299#[derive(Clone, PartialEq, ::prost::Message)]
7300pub struct TransferObjects {
7301 #[prost(message, repeated, tag = "1")]
7303 pub objects: ::prost::alloc::vec::Vec<Argument>,
7304 #[prost(message, optional, tag = "2")]
7306 pub address: ::core::option::Option<Argument>,
7307}
7308#[non_exhaustive]
7310#[derive(Clone, PartialEq, ::prost::Message)]
7311pub struct SplitCoins {
7312 #[prost(message, optional, tag = "1")]
7314 pub coin: ::core::option::Option<Argument>,
7315 #[prost(message, repeated, tag = "2")]
7317 pub amounts: ::prost::alloc::vec::Vec<Argument>,
7318}
7319#[non_exhaustive]
7321#[derive(Clone, PartialEq, ::prost::Message)]
7322pub struct MergeCoins {
7323 #[prost(message, optional, tag = "1")]
7325 pub coin: ::core::option::Option<Argument>,
7326 #[prost(message, repeated, tag = "2")]
7330 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
7331}
7332#[non_exhaustive]
7334#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7335pub struct Publish {
7336 #[prost(bytes = "bytes", repeated, tag = "1")]
7338 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7339 #[prost(string, repeated, tag = "2")]
7341 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7342}
7343#[non_exhaustive]
7345#[derive(Clone, PartialEq, ::prost::Message)]
7346pub struct MakeMoveVector {
7347 #[prost(string, optional, tag = "1")]
7352 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
7353 #[prost(message, repeated, tag = "2")]
7355 pub elements: ::prost::alloc::vec::Vec<Argument>,
7356}
7357#[non_exhaustive]
7359#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7360pub struct Upgrade {
7361 #[prost(bytes = "bytes", repeated, tag = "1")]
7363 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7364 #[prost(string, repeated, tag = "2")]
7366 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7367 #[prost(string, optional, tag = "3")]
7369 pub package: ::core::option::Option<::prost::alloc::string::String>,
7370 #[prost(message, optional, tag = "4")]
7372 pub ticket: ::core::option::Option<Argument>,
7373}
7374#[non_exhaustive]
7376#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7377pub struct RandomnessStateUpdate {
7378 #[prost(uint64, optional, tag = "1")]
7380 pub epoch: ::core::option::Option<u64>,
7381 #[prost(uint64, optional, tag = "2")]
7383 pub randomness_round: ::core::option::Option<u64>,
7384 #[prost(bytes = "bytes", optional, tag = "3")]
7386 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
7387 #[prost(uint64, optional, tag = "4")]
7389 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
7390}
7391#[non_exhaustive]
7393#[derive(Clone, PartialEq, ::prost::Message)]
7394pub struct ChangeEpoch {
7395 #[prost(uint64, optional, tag = "1")]
7397 pub epoch: ::core::option::Option<u64>,
7398 #[prost(uint64, optional, tag = "2")]
7400 pub protocol_version: ::core::option::Option<u64>,
7401 #[prost(uint64, optional, tag = "3")]
7403 pub storage_charge: ::core::option::Option<u64>,
7404 #[prost(uint64, optional, tag = "4")]
7406 pub computation_charge: ::core::option::Option<u64>,
7407 #[prost(uint64, optional, tag = "5")]
7409 pub storage_rebate: ::core::option::Option<u64>,
7410 #[prost(uint64, optional, tag = "6")]
7412 pub non_refundable_storage_fee: ::core::option::Option<u64>,
7413 #[prost(message, optional, tag = "7")]
7415 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7416 #[prost(message, repeated, tag = "8")]
7422 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
7423}
7424#[non_exhaustive]
7426#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7427pub struct SystemPackage {
7428 #[prost(uint64, optional, tag = "1")]
7430 pub version: ::core::option::Option<u64>,
7431 #[prost(bytes = "bytes", repeated, tag = "2")]
7433 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7434 #[prost(string, repeated, tag = "3")]
7436 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7437}
7438#[non_exhaustive]
7440#[derive(Clone, PartialEq, ::prost::Message)]
7441pub struct GenesisTransaction {
7442 #[prost(message, repeated, tag = "1")]
7444 pub objects: ::prost::alloc::vec::Vec<Object>,
7445}
7446#[non_exhaustive]
7450#[derive(Clone, PartialEq, ::prost::Message)]
7451pub struct ConsensusCommitPrologue {
7452 #[prost(uint64, optional, tag = "1")]
7456 pub epoch: ::core::option::Option<u64>,
7457 #[prost(uint64, optional, tag = "2")]
7461 pub round: ::core::option::Option<u64>,
7462 #[prost(message, optional, tag = "3")]
7466 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7467 #[prost(string, optional, tag = "4")]
7471 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
7472 #[prost(uint64, optional, tag = "5")]
7477 pub sub_dag_index: ::core::option::Option<u64>,
7478 #[prost(message, optional, tag = "6")]
7482 pub consensus_determined_version_assignments: ::core::option::Option<
7483 ConsensusDeterminedVersionAssignments,
7484 >,
7485 #[prost(string, optional, tag = "7")]
7490 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
7491}
7492#[non_exhaustive]
7494#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7495pub struct VersionAssignment {
7496 #[prost(string, optional, tag = "1")]
7498 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
7499 #[prost(uint64, optional, tag = "2")]
7501 pub start_version: ::core::option::Option<u64>,
7502 #[prost(uint64, optional, tag = "3")]
7504 pub version: ::core::option::Option<u64>,
7505}
7506#[non_exhaustive]
7508#[derive(Clone, PartialEq, ::prost::Message)]
7509pub struct CanceledTransaction {
7510 #[prost(string, optional, tag = "1")]
7512 pub digest: ::core::option::Option<::prost::alloc::string::String>,
7513 #[prost(message, repeated, tag = "2")]
7515 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
7516}
7517#[non_exhaustive]
7519#[derive(Clone, PartialEq, ::prost::Message)]
7520pub struct ConsensusDeterminedVersionAssignments {
7521 #[prost(int32, optional, tag = "1")]
7523 pub version: ::core::option::Option<i32>,
7524 #[prost(message, repeated, tag = "3")]
7526 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
7527}
7528#[non_exhaustive]
7530#[derive(Clone, PartialEq, ::prost::Message)]
7531pub struct AuthenticatorStateUpdate {
7532 #[prost(uint64, optional, tag = "1")]
7534 pub epoch: ::core::option::Option<u64>,
7535 #[prost(uint64, optional, tag = "2")]
7537 pub round: ::core::option::Option<u64>,
7538 #[prost(message, repeated, tag = "3")]
7540 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
7541 #[prost(uint64, optional, tag = "4")]
7543 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7544}
7545#[non_exhaustive]
7547#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7548pub struct ActiveJwk {
7549 #[prost(message, optional, tag = "1")]
7551 pub id: ::core::option::Option<JwkId>,
7552 #[prost(message, optional, tag = "2")]
7554 pub jwk: ::core::option::Option<Jwk>,
7555 #[prost(uint64, optional, tag = "3")]
7557 pub epoch: ::core::option::Option<u64>,
7558}
7559#[non_exhaustive]
7562#[derive(Clone, PartialEq, ::prost::Message)]
7563pub struct EndOfEpochTransaction {
7564 #[prost(message, repeated, tag = "1")]
7565 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
7566}
7567#[non_exhaustive]
7569#[derive(Clone, PartialEq, ::prost::Message)]
7570pub struct EndOfEpochTransactionKind {
7571 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
7572 pub kind: ::core::option::Option<i32>,
7573 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
7574 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
7575}
7576pub mod end_of_epoch_transaction_kind {
7578 #[non_exhaustive]
7579 #[derive(
7580 Clone,
7581 Copy,
7582 Debug,
7583 PartialEq,
7584 Eq,
7585 Hash,
7586 PartialOrd,
7587 Ord,
7588 ::prost::Enumeration
7589 )]
7590 #[repr(i32)]
7591 pub enum Kind {
7592 Unknown = 0,
7593 ChangeEpoch = 1,
7595 AuthenticatorStateCreate = 2,
7597 AuthenticatorStateExpire = 3,
7599 RandomnessStateCreate = 4,
7601 DenyListStateCreate = 5,
7603 BridgeStateCreate = 6,
7605 BridgeCommitteeInit = 7,
7607 StoreExecutionTimeObservations = 8,
7609 AccumulatorRootCreate = 9,
7611 CoinRegistryCreate = 10,
7613 DisplayRegistryCreate = 11,
7615 AddressAliasStateCreate = 12,
7617 WriteAccumulatorStorageCost = 13,
7619 }
7620 impl Kind {
7621 pub fn as_str_name(&self) -> &'static str {
7626 match self {
7627 Self::Unknown => "KIND_UNKNOWN",
7628 Self::ChangeEpoch => "CHANGE_EPOCH",
7629 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
7630 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
7631 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
7632 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
7633 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
7634 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
7635 Self::StoreExecutionTimeObservations => {
7636 "STORE_EXECUTION_TIME_OBSERVATIONS"
7637 }
7638 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
7639 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
7640 Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
7641 Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
7642 Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
7643 }
7644 }
7645 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7647 match value {
7648 "KIND_UNKNOWN" => Some(Self::Unknown),
7649 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7650 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
7651 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
7652 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
7653 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
7654 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
7655 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
7656 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
7657 Some(Self::StoreExecutionTimeObservations)
7658 }
7659 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
7660 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
7661 "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
7662 "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
7663 "WRITE_ACCUMULATOR_STORAGE_COST" => {
7664 Some(Self::WriteAccumulatorStorageCost)
7665 }
7666 _ => None,
7667 }
7668 }
7669 }
7670 #[non_exhaustive]
7671 #[derive(Clone, PartialEq, ::prost::Oneof)]
7672 pub enum Data {
7673 #[prost(message, tag = "2")]
7675 ChangeEpoch(super::ChangeEpoch),
7676 #[prost(message, tag = "3")]
7678 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
7679 #[prost(message, tag = "4")]
7681 ExecutionTimeObservations(super::ExecutionTimeObservations),
7682 #[prost(string, tag = "5")]
7684 BridgeChainId(::prost::alloc::string::String),
7685 #[prost(uint64, tag = "6")]
7687 BridgeObjectVersion(u64),
7688 #[prost(uint64, tag = "7")]
7690 StorageCost(u64),
7691 }
7692}
7693#[non_exhaustive]
7695#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7696pub struct AuthenticatorStateExpire {
7697 #[prost(uint64, optional, tag = "1")]
7699 pub min_epoch: ::core::option::Option<u64>,
7700 #[prost(uint64, optional, tag = "2")]
7702 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7703}
7704#[non_exhaustive]
7705#[derive(Clone, PartialEq, ::prost::Message)]
7706pub struct ExecutionTimeObservations {
7707 #[prost(int32, optional, tag = "1")]
7709 pub version: ::core::option::Option<i32>,
7710 #[prost(message, repeated, tag = "2")]
7711 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
7712}
7713#[non_exhaustive]
7714#[derive(Clone, PartialEq, ::prost::Message)]
7715pub struct ExecutionTimeObservation {
7716 #[prost(
7717 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
7718 optional,
7719 tag = "1"
7720 )]
7721 pub kind: ::core::option::Option<i32>,
7722 #[prost(message, optional, tag = "2")]
7723 pub move_entry_point: ::core::option::Option<MoveCall>,
7724 #[prost(message, repeated, tag = "3")]
7725 pub validator_observations: ::prost::alloc::vec::Vec<
7726 ValidatorExecutionTimeObservation,
7727 >,
7728}
7729pub mod execution_time_observation {
7731 #[non_exhaustive]
7732 #[derive(
7733 Clone,
7734 Copy,
7735 Debug,
7736 PartialEq,
7737 Eq,
7738 Hash,
7739 PartialOrd,
7740 Ord,
7741 ::prost::Enumeration
7742 )]
7743 #[repr(i32)]
7744 pub enum ExecutionTimeObservationKind {
7745 Unknown = 0,
7746 MoveEntryPoint = 1,
7747 TransferObjects = 2,
7748 SplitCoins = 3,
7749 MergeCoins = 4,
7750 Publish = 5,
7751 MakeMoveVector = 6,
7752 Upgrade = 7,
7753 }
7754 impl ExecutionTimeObservationKind {
7755 pub fn as_str_name(&self) -> &'static str {
7760 match self {
7761 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
7762 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
7763 Self::TransferObjects => "TRANSFER_OBJECTS",
7764 Self::SplitCoins => "SPLIT_COINS",
7765 Self::MergeCoins => "MERGE_COINS",
7766 Self::Publish => "PUBLISH",
7767 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
7768 Self::Upgrade => "UPGRADE",
7769 }
7770 }
7771 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7773 match value {
7774 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
7775 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
7776 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
7777 "SPLIT_COINS" => Some(Self::SplitCoins),
7778 "MERGE_COINS" => Some(Self::MergeCoins),
7779 "PUBLISH" => Some(Self::Publish),
7780 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
7781 "UPGRADE" => Some(Self::Upgrade),
7782 _ => None,
7783 }
7784 }
7785 }
7786}
7787#[non_exhaustive]
7788#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7789pub struct ValidatorExecutionTimeObservation {
7790 #[prost(bytes = "bytes", optional, tag = "1")]
7792 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
7793 #[prost(message, optional, tag = "2")]
7795 pub duration: ::core::option::Option<::prost_types::Duration>,
7796}
7797#[non_exhaustive]
7798#[derive(Clone, PartialEq, ::prost::Message)]
7799pub struct ExecuteTransactionRequest {
7800 #[prost(message, optional, tag = "1")]
7802 pub transaction: ::core::option::Option<Transaction>,
7803 #[prost(message, repeated, tag = "2")]
7806 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
7807 #[prost(message, optional, tag = "3")]
7810 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7811}
7812#[non_exhaustive]
7814#[derive(Clone, PartialEq, ::prost::Message)]
7815pub struct ExecuteTransactionResponse {
7816 #[prost(message, optional, tag = "1")]
7817 pub transaction: ::core::option::Option<ExecutedTransaction>,
7818}
7819#[non_exhaustive]
7820#[derive(Clone, PartialEq, ::prost::Message)]
7821pub struct SimulateTransactionRequest {
7822 #[prost(message, optional, tag = "1")]
7823 pub transaction: ::core::option::Option<Transaction>,
7824 #[prost(message, optional, tag = "2")]
7826 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7827 #[prost(
7829 enumeration = "simulate_transaction_request::TransactionChecks",
7830 optional,
7831 tag = "3"
7832 )]
7833 pub checks: ::core::option::Option<i32>,
7834 #[prost(bool, optional, tag = "4")]
7839 pub do_gas_selection: ::core::option::Option<bool>,
7840}
7841pub mod simulate_transaction_request {
7843 #[non_exhaustive]
7845 #[derive(
7846 Clone,
7847 Copy,
7848 Debug,
7849 PartialEq,
7850 Eq,
7851 Hash,
7852 PartialOrd,
7853 Ord,
7854 ::prost::Enumeration
7855 )]
7856 #[repr(i32)]
7857 pub enum TransactionChecks {
7858 Enabled = 0,
7859 Disabled = 1,
7860 }
7861 impl TransactionChecks {
7862 pub fn as_str_name(&self) -> &'static str {
7867 match self {
7868 Self::Enabled => "ENABLED",
7869 Self::Disabled => "DISABLED",
7870 }
7871 }
7872 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7874 match value {
7875 "ENABLED" => Some(Self::Enabled),
7876 "DISABLED" => Some(Self::Disabled),
7877 _ => None,
7878 }
7879 }
7880 }
7881}
7882#[non_exhaustive]
7883#[derive(Clone, PartialEq, ::prost::Message)]
7884pub struct SimulateTransactionResponse {
7885 #[prost(message, optional, tag = "1")]
7886 pub transaction: ::core::option::Option<ExecutedTransaction>,
7887 #[prost(message, repeated, tag = "2")]
7888 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
7889 #[prost(uint64, optional, tag = "3")]
7893 pub suggested_gas_price: ::core::option::Option<u64>,
7894}
7895#[non_exhaustive]
7897#[derive(Clone, PartialEq, ::prost::Message)]
7898pub struct CommandResult {
7899 #[prost(message, repeated, tag = "1")]
7900 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
7901 #[prost(message, repeated, tag = "2")]
7902 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
7903}
7904#[non_exhaustive]
7905#[derive(Clone, PartialEq, ::prost::Message)]
7906pub struct CommandOutput {
7907 #[prost(message, optional, tag = "1")]
7908 pub argument: ::core::option::Option<Argument>,
7909 #[prost(message, optional, tag = "2")]
7910 pub value: ::core::option::Option<Bcs>,
7911 #[prost(message, optional, boxed, tag = "3")]
7913 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
7914}
7915pub mod transaction_execution_service_client {
7917 #![allow(
7918 unused_variables,
7919 dead_code,
7920 missing_docs,
7921 clippy::wildcard_imports,
7922 clippy::let_unit_value,
7923 )]
7924 use tonic::codegen::*;
7925 use tonic::codegen::http::Uri;
7926 #[derive(Debug, Clone)]
7927 pub struct TransactionExecutionServiceClient<T> {
7928 inner: tonic::client::Grpc<T>,
7929 }
7930 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
7931 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7933 where
7934 D: TryInto<tonic::transport::Endpoint>,
7935 D::Error: Into<StdError>,
7936 {
7937 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7938 Ok(Self::new(conn))
7939 }
7940 }
7941 impl<T> TransactionExecutionServiceClient<T>
7942 where
7943 T: tonic::client::GrpcService<tonic::body::Body>,
7944 T::Error: Into<StdError>,
7945 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7946 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7947 {
7948 pub fn new(inner: T) -> Self {
7949 let inner = tonic::client::Grpc::new(inner);
7950 Self { inner }
7951 }
7952 pub fn with_origin(inner: T, origin: Uri) -> Self {
7953 let inner = tonic::client::Grpc::with_origin(inner, origin);
7954 Self { inner }
7955 }
7956 pub fn with_interceptor<F>(
7957 inner: T,
7958 interceptor: F,
7959 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
7960 where
7961 F: tonic::service::Interceptor,
7962 T::ResponseBody: Default,
7963 T: tonic::codegen::Service<
7964 http::Request<tonic::body::Body>,
7965 Response = http::Response<
7966 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7967 >,
7968 >,
7969 <T as tonic::codegen::Service<
7970 http::Request<tonic::body::Body>,
7971 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7972 {
7973 TransactionExecutionServiceClient::new(
7974 InterceptedService::new(inner, interceptor),
7975 )
7976 }
7977 #[must_use]
7982 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7983 self.inner = self.inner.send_compressed(encoding);
7984 self
7985 }
7986 #[must_use]
7988 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7989 self.inner = self.inner.accept_compressed(encoding);
7990 self
7991 }
7992 #[must_use]
7996 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7997 self.inner = self.inner.max_decoding_message_size(limit);
7998 self
7999 }
8000 #[must_use]
8004 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8005 self.inner = self.inner.max_encoding_message_size(limit);
8006 self
8007 }
8008 pub async fn execute_transaction(
8009 &mut self,
8010 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
8011 ) -> std::result::Result<
8012 tonic::Response<super::ExecuteTransactionResponse>,
8013 tonic::Status,
8014 > {
8015 self.inner
8016 .ready()
8017 .await
8018 .map_err(|e| {
8019 tonic::Status::unknown(
8020 format!("Service was not ready: {}", e.into()),
8021 )
8022 })?;
8023 let codec = tonic_prost::ProstCodec::default();
8024 let path = http::uri::PathAndQuery::from_static(
8025 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
8026 );
8027 let mut req = request.into_request();
8028 req.extensions_mut()
8029 .insert(
8030 GrpcMethod::new(
8031 "sui.rpc.v2.TransactionExecutionService",
8032 "ExecuteTransaction",
8033 ),
8034 );
8035 self.inner.unary(req, path, codec).await
8036 }
8037 pub async fn simulate_transaction(
8038 &mut self,
8039 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
8040 ) -> std::result::Result<
8041 tonic::Response<super::SimulateTransactionResponse>,
8042 tonic::Status,
8043 > {
8044 self.inner
8045 .ready()
8046 .await
8047 .map_err(|e| {
8048 tonic::Status::unknown(
8049 format!("Service was not ready: {}", e.into()),
8050 )
8051 })?;
8052 let codec = tonic_prost::ProstCodec::default();
8053 let path = http::uri::PathAndQuery::from_static(
8054 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
8055 );
8056 let mut req = request.into_request();
8057 req.extensions_mut()
8058 .insert(
8059 GrpcMethod::new(
8060 "sui.rpc.v2.TransactionExecutionService",
8061 "SimulateTransaction",
8062 ),
8063 );
8064 self.inner.unary(req, path, codec).await
8065 }
8066 }
8067}
8068pub mod transaction_execution_service_server {
8070 #![allow(
8071 unused_variables,
8072 dead_code,
8073 missing_docs,
8074 clippy::wildcard_imports,
8075 clippy::let_unit_value,
8076 )]
8077 use tonic::codegen::*;
8078 #[async_trait]
8080 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
8081 async fn execute_transaction(
8082 &self,
8083 request: tonic::Request<super::ExecuteTransactionRequest>,
8084 ) -> std::result::Result<
8085 tonic::Response<super::ExecuteTransactionResponse>,
8086 tonic::Status,
8087 >;
8088 async fn simulate_transaction(
8089 &self,
8090 request: tonic::Request<super::SimulateTransactionRequest>,
8091 ) -> std::result::Result<
8092 tonic::Response<super::SimulateTransactionResponse>,
8093 tonic::Status,
8094 >;
8095 }
8096 #[derive(Debug)]
8097 pub struct TransactionExecutionServiceServer<T> {
8098 inner: Arc<T>,
8099 accept_compression_encodings: EnabledCompressionEncodings,
8100 send_compression_encodings: EnabledCompressionEncodings,
8101 max_decoding_message_size: Option<usize>,
8102 max_encoding_message_size: Option<usize>,
8103 }
8104 impl<T> TransactionExecutionServiceServer<T> {
8105 pub fn new(inner: T) -> Self {
8106 Self::from_arc(Arc::new(inner))
8107 }
8108 pub fn from_arc(inner: Arc<T>) -> Self {
8109 Self {
8110 inner,
8111 accept_compression_encodings: Default::default(),
8112 send_compression_encodings: Default::default(),
8113 max_decoding_message_size: None,
8114 max_encoding_message_size: None,
8115 }
8116 }
8117 pub fn with_interceptor<F>(
8118 inner: T,
8119 interceptor: F,
8120 ) -> InterceptedService<Self, F>
8121 where
8122 F: tonic::service::Interceptor,
8123 {
8124 InterceptedService::new(Self::new(inner), interceptor)
8125 }
8126 #[must_use]
8128 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8129 self.accept_compression_encodings.enable(encoding);
8130 self
8131 }
8132 #[must_use]
8134 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8135 self.send_compression_encodings.enable(encoding);
8136 self
8137 }
8138 #[must_use]
8142 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8143 self.max_decoding_message_size = Some(limit);
8144 self
8145 }
8146 #[must_use]
8150 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8151 self.max_encoding_message_size = Some(limit);
8152 self
8153 }
8154 }
8155 impl<T, B> tonic::codegen::Service<http::Request<B>>
8156 for TransactionExecutionServiceServer<T>
8157 where
8158 T: TransactionExecutionService,
8159 B: Body + std::marker::Send + 'static,
8160 B::Error: Into<StdError> + std::marker::Send + 'static,
8161 {
8162 type Response = http::Response<tonic::body::Body>;
8163 type Error = std::convert::Infallible;
8164 type Future = BoxFuture<Self::Response, Self::Error>;
8165 fn poll_ready(
8166 &mut self,
8167 _cx: &mut Context<'_>,
8168 ) -> Poll<std::result::Result<(), Self::Error>> {
8169 Poll::Ready(Ok(()))
8170 }
8171 fn call(&mut self, req: http::Request<B>) -> Self::Future {
8172 match req.uri().path() {
8173 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
8174 #[allow(non_camel_case_types)]
8175 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
8176 pub Arc<T>,
8177 );
8178 impl<
8179 T: TransactionExecutionService,
8180 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
8181 for ExecuteTransactionSvc<T> {
8182 type Response = super::ExecuteTransactionResponse;
8183 type Future = BoxFuture<
8184 tonic::Response<Self::Response>,
8185 tonic::Status,
8186 >;
8187 fn call(
8188 &mut self,
8189 request: tonic::Request<super::ExecuteTransactionRequest>,
8190 ) -> Self::Future {
8191 let inner = Arc::clone(&self.0);
8192 let fut = async move {
8193 <T as TransactionExecutionService>::execute_transaction(
8194 &inner,
8195 request,
8196 )
8197 .await
8198 };
8199 Box::pin(fut)
8200 }
8201 }
8202 let accept_compression_encodings = self.accept_compression_encodings;
8203 let send_compression_encodings = self.send_compression_encodings;
8204 let max_decoding_message_size = self.max_decoding_message_size;
8205 let max_encoding_message_size = self.max_encoding_message_size;
8206 let inner = self.inner.clone();
8207 let fut = async move {
8208 let method = ExecuteTransactionSvc(inner);
8209 let codec = tonic_prost::ProstCodec::default();
8210 let mut grpc = tonic::server::Grpc::new(codec)
8211 .apply_compression_config(
8212 accept_compression_encodings,
8213 send_compression_encodings,
8214 )
8215 .apply_max_message_size_config(
8216 max_decoding_message_size,
8217 max_encoding_message_size,
8218 );
8219 let res = grpc.unary(method, req).await;
8220 Ok(res)
8221 };
8222 Box::pin(fut)
8223 }
8224 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
8225 #[allow(non_camel_case_types)]
8226 struct SimulateTransactionSvc<T: TransactionExecutionService>(
8227 pub Arc<T>,
8228 );
8229 impl<
8230 T: TransactionExecutionService,
8231 > tonic::server::UnaryService<super::SimulateTransactionRequest>
8232 for SimulateTransactionSvc<T> {
8233 type Response = super::SimulateTransactionResponse;
8234 type Future = BoxFuture<
8235 tonic::Response<Self::Response>,
8236 tonic::Status,
8237 >;
8238 fn call(
8239 &mut self,
8240 request: tonic::Request<super::SimulateTransactionRequest>,
8241 ) -> Self::Future {
8242 let inner = Arc::clone(&self.0);
8243 let fut = async move {
8244 <T as TransactionExecutionService>::simulate_transaction(
8245 &inner,
8246 request,
8247 )
8248 .await
8249 };
8250 Box::pin(fut)
8251 }
8252 }
8253 let accept_compression_encodings = self.accept_compression_encodings;
8254 let send_compression_encodings = self.send_compression_encodings;
8255 let max_decoding_message_size = self.max_decoding_message_size;
8256 let max_encoding_message_size = self.max_encoding_message_size;
8257 let inner = self.inner.clone();
8258 let fut = async move {
8259 let method = SimulateTransactionSvc(inner);
8260 let codec = tonic_prost::ProstCodec::default();
8261 let mut grpc = tonic::server::Grpc::new(codec)
8262 .apply_compression_config(
8263 accept_compression_encodings,
8264 send_compression_encodings,
8265 )
8266 .apply_max_message_size_config(
8267 max_decoding_message_size,
8268 max_encoding_message_size,
8269 );
8270 let res = grpc.unary(method, req).await;
8271 Ok(res)
8272 };
8273 Box::pin(fut)
8274 }
8275 _ => {
8276 Box::pin(async move {
8277 let mut response = http::Response::new(
8278 tonic::body::Body::default(),
8279 );
8280 let headers = response.headers_mut();
8281 headers
8282 .insert(
8283 tonic::Status::GRPC_STATUS,
8284 (tonic::Code::Unimplemented as i32).into(),
8285 );
8286 headers
8287 .insert(
8288 http::header::CONTENT_TYPE,
8289 tonic::metadata::GRPC_CONTENT_TYPE,
8290 );
8291 Ok(response)
8292 })
8293 }
8294 }
8295 }
8296 }
8297 impl<T> Clone for TransactionExecutionServiceServer<T> {
8298 fn clone(&self) -> Self {
8299 let inner = self.inner.clone();
8300 Self {
8301 inner,
8302 accept_compression_encodings: self.accept_compression_encodings,
8303 send_compression_encodings: self.send_compression_encodings,
8304 max_decoding_message_size: self.max_decoding_message_size,
8305 max_encoding_message_size: self.max_encoding_message_size,
8306 }
8307 }
8308 }
8309 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
8311 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
8312 const NAME: &'static str = SERVICE_NAME;
8313 }
8314}