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}
4316#[non_exhaustive]
4318#[derive(Clone, PartialEq, ::prost::Message)]
4319pub struct ObjectSet {
4320 #[prost(message, repeated, tag = "1")]
4322 pub objects: ::prost::alloc::vec::Vec<Object>,
4323}
4324#[non_exhaustive]
4326#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4327pub struct ObjectReference {
4328 #[prost(string, optional, tag = "1")]
4330 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4331 #[prost(uint64, optional, tag = "2")]
4333 pub version: ::core::option::Option<u64>,
4334 #[prost(string, optional, tag = "3")]
4336 pub digest: ::core::option::Option<::prost::alloc::string::String>,
4337}
4338#[non_exhaustive]
4340#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4341pub struct Owner {
4342 #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
4343 pub kind: ::core::option::Option<i32>,
4344 #[prost(string, optional, tag = "2")]
4346 pub address: ::core::option::Option<::prost::alloc::string::String>,
4347 #[prost(uint64, optional, tag = "3")]
4349 pub version: ::core::option::Option<u64>,
4350}
4351pub mod owner {
4353 #[non_exhaustive]
4354 #[derive(
4355 Clone,
4356 Copy,
4357 Debug,
4358 PartialEq,
4359 Eq,
4360 Hash,
4361 PartialOrd,
4362 Ord,
4363 ::prost::Enumeration
4364 )]
4365 #[repr(i32)]
4366 pub enum OwnerKind {
4367 Unknown = 0,
4368 Address = 1,
4369 Object = 2,
4370 Shared = 3,
4371 Immutable = 4,
4372 ConsensusAddress = 5,
4373 }
4374 impl OwnerKind {
4375 pub fn as_str_name(&self) -> &'static str {
4380 match self {
4381 Self::Unknown => "OWNER_KIND_UNKNOWN",
4382 Self::Address => "ADDRESS",
4383 Self::Object => "OBJECT",
4384 Self::Shared => "SHARED",
4385 Self::Immutable => "IMMUTABLE",
4386 Self::ConsensusAddress => "CONSENSUS_ADDRESS",
4387 }
4388 }
4389 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4391 match value {
4392 "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
4393 "ADDRESS" => Some(Self::Address),
4394 "OBJECT" => Some(Self::Object),
4395 "SHARED" => Some(Self::Shared),
4396 "IMMUTABLE" => Some(Self::Immutable),
4397 "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
4398 _ => None,
4399 }
4400 }
4401 }
4402}
4403#[non_exhaustive]
4404#[derive(Clone, PartialEq, ::prost::Message)]
4405pub struct ProtocolConfig {
4406 #[prost(uint64, optional, tag = "1")]
4407 pub protocol_version: ::core::option::Option<u64>,
4408 #[prost(btree_map = "string, bool", tag = "2")]
4409 pub feature_flags: ::prost::alloc::collections::BTreeMap<
4410 ::prost::alloc::string::String,
4411 bool,
4412 >,
4413 #[prost(btree_map = "string, string", tag = "3")]
4414 pub attributes: ::prost::alloc::collections::BTreeMap<
4415 ::prost::alloc::string::String,
4416 ::prost::alloc::string::String,
4417 >,
4418}
4419#[non_exhaustive]
4421#[derive(Clone, PartialEq, ::prost::Message)]
4422pub struct UserSignature {
4423 #[prost(message, optional, tag = "1")]
4428 pub bcs: ::core::option::Option<Bcs>,
4429 #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
4431 pub scheme: ::core::option::Option<i32>,
4432 #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
4433 pub signature: ::core::option::Option<user_signature::Signature>,
4434}
4435pub mod user_signature {
4437 #[non_exhaustive]
4438 #[derive(Clone, PartialEq, ::prost::Oneof)]
4439 pub enum Signature {
4440 #[prost(message, tag = "3")]
4442 Simple(super::SimpleSignature),
4443 #[prost(message, tag = "4")]
4445 Multisig(super::MultisigAggregatedSignature),
4446 #[prost(message, tag = "5")]
4448 Zklogin(super::ZkLoginAuthenticator),
4449 #[prost(message, tag = "6")]
4451 Passkey(super::PasskeyAuthenticator),
4452 }
4453}
4454#[non_exhaustive]
4456#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4457pub struct SimpleSignature {
4458 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4460 pub scheme: ::core::option::Option<i32>,
4461 #[prost(bytes = "bytes", optional, tag = "2")]
4463 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4464 #[prost(bytes = "bytes", optional, tag = "3")]
4466 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4467}
4468#[non_exhaustive]
4470#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4471pub struct ZkLoginPublicIdentifier {
4472 #[prost(string, optional, tag = "1")]
4473 pub iss: ::core::option::Option<::prost::alloc::string::String>,
4474 #[prost(string, optional, tag = "2")]
4476 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4477}
4478#[non_exhaustive]
4480#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4481pub struct MultisigMemberPublicKey {
4482 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4484 pub scheme: ::core::option::Option<i32>,
4485 #[prost(bytes = "bytes", optional, tag = "2")]
4487 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4488 #[prost(message, optional, tag = "3")]
4490 pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
4491}
4492#[non_exhaustive]
4494#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4495pub struct MultisigMember {
4496 #[prost(message, optional, tag = "1")]
4498 pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
4499 #[prost(uint32, optional, tag = "2")]
4501 pub weight: ::core::option::Option<u32>,
4502}
4503#[non_exhaustive]
4505#[derive(Clone, PartialEq, ::prost::Message)]
4506pub struct MultisigCommittee {
4507 #[prost(message, repeated, tag = "1")]
4509 pub members: ::prost::alloc::vec::Vec<MultisigMember>,
4510 #[prost(uint32, optional, tag = "2")]
4513 pub threshold: ::core::option::Option<u32>,
4514}
4515#[non_exhaustive]
4517#[derive(Clone, PartialEq, ::prost::Message)]
4518pub struct MultisigAggregatedSignature {
4519 #[prost(message, repeated, tag = "1")]
4523 pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
4524 #[prost(uint32, optional, tag = "2")]
4527 pub bitmap: ::core::option::Option<u32>,
4528 #[prost(bytes = "bytes", optional, tag = "3")]
4531 pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4532 #[prost(message, optional, tag = "4")]
4534 pub committee: ::core::option::Option<MultisigCommittee>,
4535}
4536#[non_exhaustive]
4538#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4539pub struct MultisigMemberSignature {
4540 #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4542 pub scheme: ::core::option::Option<i32>,
4543 #[prost(bytes = "bytes", optional, tag = "2")]
4545 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4546 #[prost(message, optional, tag = "3")]
4548 pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
4549 #[prost(message, optional, tag = "4")]
4551 pub passkey: ::core::option::Option<PasskeyAuthenticator>,
4552}
4553#[non_exhaustive]
4555#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4556pub struct ZkLoginAuthenticator {
4557 #[prost(message, optional, tag = "1")]
4559 pub inputs: ::core::option::Option<ZkLoginInputs>,
4560 #[prost(uint64, optional, tag = "2")]
4562 pub max_epoch: ::core::option::Option<u64>,
4563 #[prost(message, optional, tag = "3")]
4565 pub signature: ::core::option::Option<SimpleSignature>,
4566 #[prost(message, optional, tag = "4")]
4568 pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
4569 #[prost(message, optional, tag = "5")]
4571 pub jwk_id: ::core::option::Option<JwkId>,
4572}
4573#[non_exhaustive]
4575#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4576pub struct ZkLoginInputs {
4577 #[prost(message, optional, tag = "1")]
4578 pub proof_points: ::core::option::Option<ZkLoginProof>,
4579 #[prost(message, optional, tag = "2")]
4580 pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
4581 #[prost(string, optional, tag = "3")]
4582 pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
4583 #[prost(string, optional, tag = "4")]
4585 pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4586}
4587#[non_exhaustive]
4589#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4590pub struct ZkLoginProof {
4591 #[prost(message, optional, tag = "1")]
4592 pub a: ::core::option::Option<CircomG1>,
4593 #[prost(message, optional, tag = "2")]
4594 pub b: ::core::option::Option<CircomG2>,
4595 #[prost(message, optional, tag = "3")]
4596 pub c: ::core::option::Option<CircomG1>,
4597}
4598#[non_exhaustive]
4600#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4601pub struct ZkLoginClaim {
4602 #[prost(string, optional, tag = "1")]
4603 pub value: ::core::option::Option<::prost::alloc::string::String>,
4604 #[prost(uint32, optional, tag = "2")]
4605 pub index_mod_4: ::core::option::Option<u32>,
4606}
4607#[non_exhaustive]
4609#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4610pub struct CircomG1 {
4611 #[prost(string, optional, tag = "1")]
4613 pub e0: ::core::option::Option<::prost::alloc::string::String>,
4614 #[prost(string, optional, tag = "2")]
4616 pub e1: ::core::option::Option<::prost::alloc::string::String>,
4617 #[prost(string, optional, tag = "3")]
4619 pub e2: ::core::option::Option<::prost::alloc::string::String>,
4620}
4621#[non_exhaustive]
4623#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4624pub struct CircomG2 {
4625 #[prost(string, optional, tag = "1")]
4627 pub e00: ::core::option::Option<::prost::alloc::string::String>,
4628 #[prost(string, optional, tag = "2")]
4630 pub e01: ::core::option::Option<::prost::alloc::string::String>,
4631 #[prost(string, optional, tag = "3")]
4633 pub e10: ::core::option::Option<::prost::alloc::string::String>,
4634 #[prost(string, optional, tag = "4")]
4636 pub e11: ::core::option::Option<::prost::alloc::string::String>,
4637 #[prost(string, optional, tag = "5")]
4639 pub e20: ::core::option::Option<::prost::alloc::string::String>,
4640 #[prost(string, optional, tag = "6")]
4642 pub e21: ::core::option::Option<::prost::alloc::string::String>,
4643}
4644#[non_exhaustive]
4651#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4652pub struct PasskeyAuthenticator {
4653 #[prost(bytes = "bytes", optional, tag = "1")]
4658 pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
4659 #[prost(string, optional, tag = "2")]
4664 pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
4665 #[prost(message, optional, tag = "3")]
4667 pub signature: ::core::option::Option<SimpleSignature>,
4668}
4669#[non_exhaustive]
4671#[derive(Clone, PartialEq, ::prost::Message)]
4672pub struct ValidatorCommittee {
4673 #[prost(uint64, optional, tag = "1")]
4675 pub epoch: ::core::option::Option<u64>,
4676 #[prost(message, repeated, tag = "2")]
4678 pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
4679}
4680#[non_exhaustive]
4682#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4683pub struct ValidatorCommitteeMember {
4684 #[prost(bytes = "bytes", optional, tag = "1")]
4686 pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4687 #[prost(uint64, optional, tag = "2")]
4689 pub weight: ::core::option::Option<u64>,
4690}
4691#[non_exhaustive]
4693#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4694pub struct ValidatorAggregatedSignature {
4695 #[prost(uint64, optional, tag = "1")]
4700 pub epoch: ::core::option::Option<u64>,
4701 #[prost(bytes = "bytes", optional, tag = "2")]
4703 pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4704 #[prost(bytes = "bytes", optional, tag = "3")]
4707 pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4708}
4709#[non_exhaustive]
4716#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4717#[repr(i32)]
4718pub enum SignatureScheme {
4719 Ed25519 = 0,
4720 Secp256k1 = 1,
4721 Secp256r1 = 2,
4722 Multisig = 3,
4723 Bls12381 = 4,
4724 Zklogin = 5,
4725 Passkey = 6,
4726}
4727impl SignatureScheme {
4728 pub fn as_str_name(&self) -> &'static str {
4733 match self {
4734 Self::Ed25519 => "ED25519",
4735 Self::Secp256k1 => "SECP256K1",
4736 Self::Secp256r1 => "SECP256R1",
4737 Self::Multisig => "MULTISIG",
4738 Self::Bls12381 => "BLS12381",
4739 Self::Zklogin => "ZKLOGIN",
4740 Self::Passkey => "PASSKEY",
4741 }
4742 }
4743 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4745 match value {
4746 "ED25519" => Some(Self::Ed25519),
4747 "SECP256K1" => Some(Self::Secp256k1),
4748 "SECP256R1" => Some(Self::Secp256r1),
4749 "MULTISIG" => Some(Self::Multisig),
4750 "BLS12381" => Some(Self::Bls12381),
4751 "ZKLOGIN" => Some(Self::Zklogin),
4752 "PASSKEY" => Some(Self::Passkey),
4753 _ => None,
4754 }
4755 }
4756}
4757#[non_exhaustive]
4758#[derive(Clone, PartialEq, ::prost::Message)]
4759pub struct VerifySignatureRequest {
4760 #[prost(message, optional, tag = "1")]
4766 pub message: ::core::option::Option<Bcs>,
4767 #[prost(message, optional, tag = "2")]
4769 pub signature: ::core::option::Option<UserSignature>,
4770 #[prost(string, optional, tag = "3")]
4776 pub address: ::core::option::Option<::prost::alloc::string::String>,
4777 #[prost(message, repeated, tag = "4")]
4780 pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
4781}
4782#[non_exhaustive]
4783#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4784pub struct VerifySignatureResponse {
4785 #[prost(bool, optional, tag = "1")]
4787 pub is_valid: ::core::option::Option<bool>,
4788 #[prost(string, optional, tag = "2")]
4790 pub reason: ::core::option::Option<::prost::alloc::string::String>,
4791}
4792pub mod signature_verification_service_client {
4794 #![allow(
4795 unused_variables,
4796 dead_code,
4797 missing_docs,
4798 clippy::wildcard_imports,
4799 clippy::let_unit_value,
4800 )]
4801 use tonic::codegen::*;
4802 use tonic::codegen::http::Uri;
4803 #[derive(Debug, Clone)]
4804 pub struct SignatureVerificationServiceClient<T> {
4805 inner: tonic::client::Grpc<T>,
4806 }
4807 impl SignatureVerificationServiceClient<tonic::transport::Channel> {
4808 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4810 where
4811 D: TryInto<tonic::transport::Endpoint>,
4812 D::Error: Into<StdError>,
4813 {
4814 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4815 Ok(Self::new(conn))
4816 }
4817 }
4818 impl<T> SignatureVerificationServiceClient<T>
4819 where
4820 T: tonic::client::GrpcService<tonic::body::Body>,
4821 T::Error: Into<StdError>,
4822 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4823 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4824 {
4825 pub fn new(inner: T) -> Self {
4826 let inner = tonic::client::Grpc::new(inner);
4827 Self { inner }
4828 }
4829 pub fn with_origin(inner: T, origin: Uri) -> Self {
4830 let inner = tonic::client::Grpc::with_origin(inner, origin);
4831 Self { inner }
4832 }
4833 pub fn with_interceptor<F>(
4834 inner: T,
4835 interceptor: F,
4836 ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
4837 where
4838 F: tonic::service::Interceptor,
4839 T::ResponseBody: Default,
4840 T: tonic::codegen::Service<
4841 http::Request<tonic::body::Body>,
4842 Response = http::Response<
4843 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4844 >,
4845 >,
4846 <T as tonic::codegen::Service<
4847 http::Request<tonic::body::Body>,
4848 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4849 {
4850 SignatureVerificationServiceClient::new(
4851 InterceptedService::new(inner, interceptor),
4852 )
4853 }
4854 #[must_use]
4859 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4860 self.inner = self.inner.send_compressed(encoding);
4861 self
4862 }
4863 #[must_use]
4865 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4866 self.inner = self.inner.accept_compressed(encoding);
4867 self
4868 }
4869 #[must_use]
4873 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4874 self.inner = self.inner.max_decoding_message_size(limit);
4875 self
4876 }
4877 #[must_use]
4881 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4882 self.inner = self.inner.max_encoding_message_size(limit);
4883 self
4884 }
4885 pub async fn verify_signature(
4887 &mut self,
4888 request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
4889 ) -> std::result::Result<
4890 tonic::Response<super::VerifySignatureResponse>,
4891 tonic::Status,
4892 > {
4893 self.inner
4894 .ready()
4895 .await
4896 .map_err(|e| {
4897 tonic::Status::unknown(
4898 format!("Service was not ready: {}", e.into()),
4899 )
4900 })?;
4901 let codec = tonic_prost::ProstCodec::default();
4902 let path = http::uri::PathAndQuery::from_static(
4903 "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
4904 );
4905 let mut req = request.into_request();
4906 req.extensions_mut()
4907 .insert(
4908 GrpcMethod::new(
4909 "sui.rpc.v2.SignatureVerificationService",
4910 "VerifySignature",
4911 ),
4912 );
4913 self.inner.unary(req, path, codec).await
4914 }
4915 }
4916}
4917pub mod signature_verification_service_server {
4919 #![allow(
4920 unused_variables,
4921 dead_code,
4922 missing_docs,
4923 clippy::wildcard_imports,
4924 clippy::let_unit_value,
4925 )]
4926 use tonic::codegen::*;
4927 #[async_trait]
4929 pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
4930 async fn verify_signature(
4932 &self,
4933 request: tonic::Request<super::VerifySignatureRequest>,
4934 ) -> std::result::Result<
4935 tonic::Response<super::VerifySignatureResponse>,
4936 tonic::Status,
4937 >;
4938 }
4939 #[derive(Debug)]
4940 pub struct SignatureVerificationServiceServer<T> {
4941 inner: Arc<T>,
4942 accept_compression_encodings: EnabledCompressionEncodings,
4943 send_compression_encodings: EnabledCompressionEncodings,
4944 max_decoding_message_size: Option<usize>,
4945 max_encoding_message_size: Option<usize>,
4946 }
4947 impl<T> SignatureVerificationServiceServer<T> {
4948 pub fn new(inner: T) -> Self {
4949 Self::from_arc(Arc::new(inner))
4950 }
4951 pub fn from_arc(inner: Arc<T>) -> Self {
4952 Self {
4953 inner,
4954 accept_compression_encodings: Default::default(),
4955 send_compression_encodings: Default::default(),
4956 max_decoding_message_size: None,
4957 max_encoding_message_size: None,
4958 }
4959 }
4960 pub fn with_interceptor<F>(
4961 inner: T,
4962 interceptor: F,
4963 ) -> InterceptedService<Self, F>
4964 where
4965 F: tonic::service::Interceptor,
4966 {
4967 InterceptedService::new(Self::new(inner), interceptor)
4968 }
4969 #[must_use]
4971 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4972 self.accept_compression_encodings.enable(encoding);
4973 self
4974 }
4975 #[must_use]
4977 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4978 self.send_compression_encodings.enable(encoding);
4979 self
4980 }
4981 #[must_use]
4985 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4986 self.max_decoding_message_size = Some(limit);
4987 self
4988 }
4989 #[must_use]
4993 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4994 self.max_encoding_message_size = Some(limit);
4995 self
4996 }
4997 }
4998 impl<T, B> tonic::codegen::Service<http::Request<B>>
4999 for SignatureVerificationServiceServer<T>
5000 where
5001 T: SignatureVerificationService,
5002 B: Body + std::marker::Send + 'static,
5003 B::Error: Into<StdError> + std::marker::Send + 'static,
5004 {
5005 type Response = http::Response<tonic::body::Body>;
5006 type Error = std::convert::Infallible;
5007 type Future = BoxFuture<Self::Response, Self::Error>;
5008 fn poll_ready(
5009 &mut self,
5010 _cx: &mut Context<'_>,
5011 ) -> Poll<std::result::Result<(), Self::Error>> {
5012 Poll::Ready(Ok(()))
5013 }
5014 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5015 match req.uri().path() {
5016 "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
5017 #[allow(non_camel_case_types)]
5018 struct VerifySignatureSvc<T: SignatureVerificationService>(
5019 pub Arc<T>,
5020 );
5021 impl<
5022 T: SignatureVerificationService,
5023 > tonic::server::UnaryService<super::VerifySignatureRequest>
5024 for VerifySignatureSvc<T> {
5025 type Response = super::VerifySignatureResponse;
5026 type Future = BoxFuture<
5027 tonic::Response<Self::Response>,
5028 tonic::Status,
5029 >;
5030 fn call(
5031 &mut self,
5032 request: tonic::Request<super::VerifySignatureRequest>,
5033 ) -> Self::Future {
5034 let inner = Arc::clone(&self.0);
5035 let fut = async move {
5036 <T as SignatureVerificationService>::verify_signature(
5037 &inner,
5038 request,
5039 )
5040 .await
5041 };
5042 Box::pin(fut)
5043 }
5044 }
5045 let accept_compression_encodings = self.accept_compression_encodings;
5046 let send_compression_encodings = self.send_compression_encodings;
5047 let max_decoding_message_size = self.max_decoding_message_size;
5048 let max_encoding_message_size = self.max_encoding_message_size;
5049 let inner = self.inner.clone();
5050 let fut = async move {
5051 let method = VerifySignatureSvc(inner);
5052 let codec = tonic_prost::ProstCodec::default();
5053 let mut grpc = tonic::server::Grpc::new(codec)
5054 .apply_compression_config(
5055 accept_compression_encodings,
5056 send_compression_encodings,
5057 )
5058 .apply_max_message_size_config(
5059 max_decoding_message_size,
5060 max_encoding_message_size,
5061 );
5062 let res = grpc.unary(method, req).await;
5063 Ok(res)
5064 };
5065 Box::pin(fut)
5066 }
5067 _ => {
5068 Box::pin(async move {
5069 let mut response = http::Response::new(
5070 tonic::body::Body::default(),
5071 );
5072 let headers = response.headers_mut();
5073 headers
5074 .insert(
5075 tonic::Status::GRPC_STATUS,
5076 (tonic::Code::Unimplemented as i32).into(),
5077 );
5078 headers
5079 .insert(
5080 http::header::CONTENT_TYPE,
5081 tonic::metadata::GRPC_CONTENT_TYPE,
5082 );
5083 Ok(response)
5084 })
5085 }
5086 }
5087 }
5088 }
5089 impl<T> Clone for SignatureVerificationServiceServer<T> {
5090 fn clone(&self) -> Self {
5091 let inner = self.inner.clone();
5092 Self {
5093 inner,
5094 accept_compression_encodings: self.accept_compression_encodings,
5095 send_compression_encodings: self.send_compression_encodings,
5096 max_decoding_message_size: self.max_decoding_message_size,
5097 max_encoding_message_size: self.max_encoding_message_size,
5098 }
5099 }
5100 }
5101 pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
5103 impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
5104 const NAME: &'static str = SERVICE_NAME;
5105 }
5106}
5107#[non_exhaustive]
5109#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5110pub struct GetCoinInfoRequest {
5111 #[prost(string, optional, tag = "1")]
5113 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5114}
5115#[non_exhaustive]
5117#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5118pub struct GetCoinInfoResponse {
5119 #[prost(string, optional, tag = "1")]
5121 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5122 #[prost(message, optional, tag = "2")]
5125 pub metadata: ::core::option::Option<CoinMetadata>,
5126 #[prost(message, optional, tag = "3")]
5129 pub treasury: ::core::option::Option<CoinTreasury>,
5130 #[prost(message, optional, tag = "4")]
5138 pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
5139}
5140#[non_exhaustive]
5142#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5143pub struct CoinMetadata {
5144 #[prost(string, optional, tag = "1")]
5147 pub id: ::core::option::Option<::prost::alloc::string::String>,
5148 #[prost(uint32, optional, tag = "2")]
5150 pub decimals: ::core::option::Option<u32>,
5151 #[prost(string, optional, tag = "3")]
5153 pub name: ::core::option::Option<::prost::alloc::string::String>,
5154 #[prost(string, optional, tag = "4")]
5156 pub symbol: ::core::option::Option<::prost::alloc::string::String>,
5157 #[prost(string, optional, tag = "5")]
5159 pub description: ::core::option::Option<::prost::alloc::string::String>,
5160 #[prost(string, optional, tag = "6")]
5162 pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
5163 #[prost(string, optional, tag = "7")]
5167 pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
5168 #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
5170 pub metadata_cap_state: ::core::option::Option<i32>,
5171}
5172pub mod coin_metadata {
5174 #[non_exhaustive]
5176 #[derive(
5177 Clone,
5178 Copy,
5179 Debug,
5180 PartialEq,
5181 Eq,
5182 Hash,
5183 PartialOrd,
5184 Ord,
5185 ::prost::Enumeration
5186 )]
5187 #[repr(i32)]
5188 pub enum MetadataCapState {
5189 Unknown = 0,
5192 Claimed = 1,
5194 Unclaimed = 2,
5196 Deleted = 3,
5198 }
5199 impl MetadataCapState {
5200 pub fn as_str_name(&self) -> &'static str {
5205 match self {
5206 Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
5207 Self::Claimed => "CLAIMED",
5208 Self::Unclaimed => "UNCLAIMED",
5209 Self::Deleted => "DELETED",
5210 }
5211 }
5212 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5214 match value {
5215 "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
5216 "CLAIMED" => Some(Self::Claimed),
5217 "UNCLAIMED" => Some(Self::Unclaimed),
5218 "DELETED" => Some(Self::Deleted),
5219 _ => None,
5220 }
5221 }
5222 }
5223}
5224#[non_exhaustive]
5226#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5227pub struct CoinTreasury {
5228 #[prost(string, optional, tag = "1")]
5230 pub id: ::core::option::Option<::prost::alloc::string::String>,
5231 #[prost(uint64, optional, tag = "2")]
5233 pub total_supply: ::core::option::Option<u64>,
5234 #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
5236 pub supply_state: ::core::option::Option<i32>,
5237}
5238pub mod coin_treasury {
5240 #[non_exhaustive]
5242 #[derive(
5243 Clone,
5244 Copy,
5245 Debug,
5246 PartialEq,
5247 Eq,
5248 Hash,
5249 PartialOrd,
5250 Ord,
5251 ::prost::Enumeration
5252 )]
5253 #[repr(i32)]
5254 pub enum SupplyState {
5255 Unknown = 0,
5257 Fixed = 1,
5259 BurnOnly = 2,
5261 }
5262 impl SupplyState {
5263 pub fn as_str_name(&self) -> &'static str {
5268 match self {
5269 Self::Unknown => "SUPPLY_STATE_UNKNOWN",
5270 Self::Fixed => "FIXED",
5271 Self::BurnOnly => "BURN_ONLY",
5272 }
5273 }
5274 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5276 match value {
5277 "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
5278 "FIXED" => Some(Self::Fixed),
5279 "BURN_ONLY" => Some(Self::BurnOnly),
5280 _ => None,
5281 }
5282 }
5283 }
5284}
5285#[non_exhaustive]
5287#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5288pub struct RegulatedCoinMetadata {
5289 #[prost(string, optional, tag = "1")]
5292 pub id: ::core::option::Option<::prost::alloc::string::String>,
5293 #[prost(string, optional, tag = "2")]
5295 pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
5296 #[prost(string, optional, tag = "3")]
5298 pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
5299 #[prost(bool, optional, tag = "4")]
5301 pub allow_global_pause: ::core::option::Option<bool>,
5302 #[prost(uint32, optional, tag = "5")]
5304 pub variant: ::core::option::Option<u32>,
5305 #[prost(
5307 enumeration = "regulated_coin_metadata::CoinRegulatedState",
5308 optional,
5309 tag = "6"
5310 )]
5311 pub coin_regulated_state: ::core::option::Option<i32>,
5312}
5313pub mod regulated_coin_metadata {
5315 #[non_exhaustive]
5317 #[derive(
5318 Clone,
5319 Copy,
5320 Debug,
5321 PartialEq,
5322 Eq,
5323 Hash,
5324 PartialOrd,
5325 Ord,
5326 ::prost::Enumeration
5327 )]
5328 #[repr(i32)]
5329 pub enum CoinRegulatedState {
5330 Unknown = 0,
5335 Regulated = 1,
5337 Unregulated = 2,
5339 }
5340 impl CoinRegulatedState {
5341 pub fn as_str_name(&self) -> &'static str {
5346 match self {
5347 Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
5348 Self::Regulated => "REGULATED",
5349 Self::Unregulated => "UNREGULATED",
5350 }
5351 }
5352 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5354 match value {
5355 "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
5356 "REGULATED" => Some(Self::Regulated),
5357 "UNREGULATED" => Some(Self::Unregulated),
5358 _ => None,
5359 }
5360 }
5361 }
5362}
5363#[non_exhaustive]
5365#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5366pub struct GetBalanceRequest {
5367 #[prost(string, optional, tag = "1")]
5369 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5370 #[prost(string, optional, tag = "2")]
5372 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5373}
5374#[non_exhaustive]
5377#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5378pub struct GetBalanceResponse {
5379 #[prost(message, optional, tag = "1")]
5381 pub balance: ::core::option::Option<Balance>,
5382}
5383#[non_exhaustive]
5385#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5386pub struct ListBalancesRequest {
5387 #[prost(string, optional, tag = "1")]
5389 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5390 #[prost(uint32, optional, tag = "2")]
5394 pub page_size: ::core::option::Option<u32>,
5395 #[prost(bytes = "bytes", optional, tag = "3")]
5401 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5402}
5403#[non_exhaustive]
5406#[derive(Clone, PartialEq, ::prost::Message)]
5407pub struct ListBalancesResponse {
5408 #[prost(message, repeated, tag = "1")]
5410 pub balances: ::prost::alloc::vec::Vec<Balance>,
5411 #[prost(bytes = "bytes", optional, tag = "2")]
5414 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5415}
5416#[non_exhaustive]
5418#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5419pub struct Balance {
5420 #[prost(string, optional, tag = "1")]
5422 pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5423 #[prost(uint64, optional, tag = "3")]
5427 pub balance: ::core::option::Option<u64>,
5428 #[prost(uint64, optional, tag = "4")]
5430 pub address_balance: ::core::option::Option<u64>,
5431 #[prost(uint64, optional, tag = "5")]
5433 pub coin_balance: ::core::option::Option<u64>,
5434}
5435#[non_exhaustive]
5437#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5438pub struct ListDynamicFieldsRequest {
5439 #[prost(string, optional, tag = "1")]
5441 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5442 #[prost(uint32, optional, tag = "2")]
5446 pub page_size: ::core::option::Option<u32>,
5447 #[prost(bytes = "bytes", optional, tag = "3")]
5453 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5454 #[prost(message, optional, tag = "4")]
5457 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5458}
5459#[non_exhaustive]
5461#[derive(Clone, PartialEq, ::prost::Message)]
5462pub struct ListDynamicFieldsResponse {
5463 #[prost(message, repeated, tag = "1")]
5465 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
5466 #[prost(bytes = "bytes", optional, tag = "2")]
5469 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5470}
5471#[non_exhaustive]
5472#[derive(Clone, PartialEq, ::prost::Message)]
5473pub struct DynamicField {
5474 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
5475 pub kind: ::core::option::Option<i32>,
5476 #[prost(string, optional, tag = "2")]
5478 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5479 #[prost(string, optional, tag = "3")]
5481 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
5482 #[prost(message, optional, tag = "4")]
5484 pub field_object: ::core::option::Option<Object>,
5485 #[prost(message, optional, tag = "5")]
5487 pub name: ::core::option::Option<Bcs>,
5488 #[prost(message, optional, tag = "6")]
5490 pub value: ::core::option::Option<Bcs>,
5491 #[prost(string, optional, tag = "7")]
5497 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
5498 #[prost(string, optional, tag = "8")]
5504 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
5505 #[prost(message, optional, tag = "9")]
5507 pub child_object: ::core::option::Option<Object>,
5508}
5509pub mod dynamic_field {
5511 #[non_exhaustive]
5512 #[derive(
5513 Clone,
5514 Copy,
5515 Debug,
5516 PartialEq,
5517 Eq,
5518 Hash,
5519 PartialOrd,
5520 Ord,
5521 ::prost::Enumeration
5522 )]
5523 #[repr(i32)]
5524 pub enum DynamicFieldKind {
5525 Unknown = 0,
5526 Field = 1,
5527 Object = 2,
5528 }
5529 impl DynamicFieldKind {
5530 pub fn as_str_name(&self) -> &'static str {
5535 match self {
5536 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
5537 Self::Field => "FIELD",
5538 Self::Object => "OBJECT",
5539 }
5540 }
5541 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5543 match value {
5544 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
5545 "FIELD" => Some(Self::Field),
5546 "OBJECT" => Some(Self::Object),
5547 _ => None,
5548 }
5549 }
5550 }
5551}
5552#[non_exhaustive]
5553#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5554pub struct ListOwnedObjectsRequest {
5555 #[prost(string, optional, tag = "1")]
5557 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5558 #[prost(uint32, optional, tag = "2")]
5562 pub page_size: ::core::option::Option<u32>,
5563 #[prost(bytes = "bytes", optional, tag = "3")]
5569 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5570 #[prost(message, optional, tag = "4")]
5573 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5574 #[prost(string, optional, tag = "5")]
5583 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5584}
5585#[non_exhaustive]
5586#[derive(Clone, PartialEq, ::prost::Message)]
5587pub struct ListOwnedObjectsResponse {
5588 #[prost(message, repeated, tag = "1")]
5590 pub objects: ::prost::alloc::vec::Vec<Object>,
5591 #[prost(bytes = "bytes", optional, tag = "2")]
5594 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5595}
5596pub mod state_service_client {
5598 #![allow(
5599 unused_variables,
5600 dead_code,
5601 missing_docs,
5602 clippy::wildcard_imports,
5603 clippy::let_unit_value,
5604 )]
5605 use tonic::codegen::*;
5606 use tonic::codegen::http::Uri;
5607 #[derive(Debug, Clone)]
5608 pub struct StateServiceClient<T> {
5609 inner: tonic::client::Grpc<T>,
5610 }
5611 impl StateServiceClient<tonic::transport::Channel> {
5612 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5614 where
5615 D: TryInto<tonic::transport::Endpoint>,
5616 D::Error: Into<StdError>,
5617 {
5618 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5619 Ok(Self::new(conn))
5620 }
5621 }
5622 impl<T> StateServiceClient<T>
5623 where
5624 T: tonic::client::GrpcService<tonic::body::Body>,
5625 T::Error: Into<StdError>,
5626 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5627 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5628 {
5629 pub fn new(inner: T) -> Self {
5630 let inner = tonic::client::Grpc::new(inner);
5631 Self { inner }
5632 }
5633 pub fn with_origin(inner: T, origin: Uri) -> Self {
5634 let inner = tonic::client::Grpc::with_origin(inner, origin);
5635 Self { inner }
5636 }
5637 pub fn with_interceptor<F>(
5638 inner: T,
5639 interceptor: F,
5640 ) -> StateServiceClient<InterceptedService<T, F>>
5641 where
5642 F: tonic::service::Interceptor,
5643 T::ResponseBody: Default,
5644 T: tonic::codegen::Service<
5645 http::Request<tonic::body::Body>,
5646 Response = http::Response<
5647 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5648 >,
5649 >,
5650 <T as tonic::codegen::Service<
5651 http::Request<tonic::body::Body>,
5652 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5653 {
5654 StateServiceClient::new(InterceptedService::new(inner, interceptor))
5655 }
5656 #[must_use]
5661 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5662 self.inner = self.inner.send_compressed(encoding);
5663 self
5664 }
5665 #[must_use]
5667 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5668 self.inner = self.inner.accept_compressed(encoding);
5669 self
5670 }
5671 #[must_use]
5675 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5676 self.inner = self.inner.max_decoding_message_size(limit);
5677 self
5678 }
5679 #[must_use]
5683 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5684 self.inner = self.inner.max_encoding_message_size(limit);
5685 self
5686 }
5687 pub async fn list_dynamic_fields(
5688 &mut self,
5689 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
5690 ) -> std::result::Result<
5691 tonic::Response<super::ListDynamicFieldsResponse>,
5692 tonic::Status,
5693 > {
5694 self.inner
5695 .ready()
5696 .await
5697 .map_err(|e| {
5698 tonic::Status::unknown(
5699 format!("Service was not ready: {}", e.into()),
5700 )
5701 })?;
5702 let codec = tonic_prost::ProstCodec::default();
5703 let path = http::uri::PathAndQuery::from_static(
5704 "/sui.rpc.v2.StateService/ListDynamicFields",
5705 );
5706 let mut req = request.into_request();
5707 req.extensions_mut()
5708 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
5709 self.inner.unary(req, path, codec).await
5710 }
5711 pub async fn list_owned_objects(
5712 &mut self,
5713 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
5714 ) -> std::result::Result<
5715 tonic::Response<super::ListOwnedObjectsResponse>,
5716 tonic::Status,
5717 > {
5718 self.inner
5719 .ready()
5720 .await
5721 .map_err(|e| {
5722 tonic::Status::unknown(
5723 format!("Service was not ready: {}", e.into()),
5724 )
5725 })?;
5726 let codec = tonic_prost::ProstCodec::default();
5727 let path = http::uri::PathAndQuery::from_static(
5728 "/sui.rpc.v2.StateService/ListOwnedObjects",
5729 );
5730 let mut req = request.into_request();
5731 req.extensions_mut()
5732 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
5733 self.inner.unary(req, path, codec).await
5734 }
5735 pub async fn get_coin_info(
5736 &mut self,
5737 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
5738 ) -> std::result::Result<
5739 tonic::Response<super::GetCoinInfoResponse>,
5740 tonic::Status,
5741 > {
5742 self.inner
5743 .ready()
5744 .await
5745 .map_err(|e| {
5746 tonic::Status::unknown(
5747 format!("Service was not ready: {}", e.into()),
5748 )
5749 })?;
5750 let codec = tonic_prost::ProstCodec::default();
5751 let path = http::uri::PathAndQuery::from_static(
5752 "/sui.rpc.v2.StateService/GetCoinInfo",
5753 );
5754 let mut req = request.into_request();
5755 req.extensions_mut()
5756 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
5757 self.inner.unary(req, path, codec).await
5758 }
5759 pub async fn get_balance(
5760 &mut self,
5761 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
5762 ) -> std::result::Result<
5763 tonic::Response<super::GetBalanceResponse>,
5764 tonic::Status,
5765 > {
5766 self.inner
5767 .ready()
5768 .await
5769 .map_err(|e| {
5770 tonic::Status::unknown(
5771 format!("Service was not ready: {}", e.into()),
5772 )
5773 })?;
5774 let codec = tonic_prost::ProstCodec::default();
5775 let path = http::uri::PathAndQuery::from_static(
5776 "/sui.rpc.v2.StateService/GetBalance",
5777 );
5778 let mut req = request.into_request();
5779 req.extensions_mut()
5780 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
5781 self.inner.unary(req, path, codec).await
5782 }
5783 pub async fn list_balances(
5784 &mut self,
5785 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
5786 ) -> std::result::Result<
5787 tonic::Response<super::ListBalancesResponse>,
5788 tonic::Status,
5789 > {
5790 self.inner
5791 .ready()
5792 .await
5793 .map_err(|e| {
5794 tonic::Status::unknown(
5795 format!("Service was not ready: {}", e.into()),
5796 )
5797 })?;
5798 let codec = tonic_prost::ProstCodec::default();
5799 let path = http::uri::PathAndQuery::from_static(
5800 "/sui.rpc.v2.StateService/ListBalances",
5801 );
5802 let mut req = request.into_request();
5803 req.extensions_mut()
5804 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
5805 self.inner.unary(req, path, codec).await
5806 }
5807 }
5808}
5809pub mod state_service_server {
5811 #![allow(
5812 unused_variables,
5813 dead_code,
5814 missing_docs,
5815 clippy::wildcard_imports,
5816 clippy::let_unit_value,
5817 )]
5818 use tonic::codegen::*;
5819 #[async_trait]
5821 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
5822 async fn list_dynamic_fields(
5823 &self,
5824 request: tonic::Request<super::ListDynamicFieldsRequest>,
5825 ) -> std::result::Result<
5826 tonic::Response<super::ListDynamicFieldsResponse>,
5827 tonic::Status,
5828 >;
5829 async fn list_owned_objects(
5830 &self,
5831 request: tonic::Request<super::ListOwnedObjectsRequest>,
5832 ) -> std::result::Result<
5833 tonic::Response<super::ListOwnedObjectsResponse>,
5834 tonic::Status,
5835 >;
5836 async fn get_coin_info(
5837 &self,
5838 request: tonic::Request<super::GetCoinInfoRequest>,
5839 ) -> std::result::Result<
5840 tonic::Response<super::GetCoinInfoResponse>,
5841 tonic::Status,
5842 >;
5843 async fn get_balance(
5844 &self,
5845 request: tonic::Request<super::GetBalanceRequest>,
5846 ) -> std::result::Result<
5847 tonic::Response<super::GetBalanceResponse>,
5848 tonic::Status,
5849 >;
5850 async fn list_balances(
5851 &self,
5852 request: tonic::Request<super::ListBalancesRequest>,
5853 ) -> std::result::Result<
5854 tonic::Response<super::ListBalancesResponse>,
5855 tonic::Status,
5856 >;
5857 }
5858 #[derive(Debug)]
5859 pub struct StateServiceServer<T> {
5860 inner: Arc<T>,
5861 accept_compression_encodings: EnabledCompressionEncodings,
5862 send_compression_encodings: EnabledCompressionEncodings,
5863 max_decoding_message_size: Option<usize>,
5864 max_encoding_message_size: Option<usize>,
5865 }
5866 impl<T> StateServiceServer<T> {
5867 pub fn new(inner: T) -> Self {
5868 Self::from_arc(Arc::new(inner))
5869 }
5870 pub fn from_arc(inner: Arc<T>) -> Self {
5871 Self {
5872 inner,
5873 accept_compression_encodings: Default::default(),
5874 send_compression_encodings: Default::default(),
5875 max_decoding_message_size: None,
5876 max_encoding_message_size: None,
5877 }
5878 }
5879 pub fn with_interceptor<F>(
5880 inner: T,
5881 interceptor: F,
5882 ) -> InterceptedService<Self, F>
5883 where
5884 F: tonic::service::Interceptor,
5885 {
5886 InterceptedService::new(Self::new(inner), interceptor)
5887 }
5888 #[must_use]
5890 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5891 self.accept_compression_encodings.enable(encoding);
5892 self
5893 }
5894 #[must_use]
5896 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5897 self.send_compression_encodings.enable(encoding);
5898 self
5899 }
5900 #[must_use]
5904 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5905 self.max_decoding_message_size = Some(limit);
5906 self
5907 }
5908 #[must_use]
5912 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5913 self.max_encoding_message_size = Some(limit);
5914 self
5915 }
5916 }
5917 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
5918 where
5919 T: StateService,
5920 B: Body + std::marker::Send + 'static,
5921 B::Error: Into<StdError> + std::marker::Send + 'static,
5922 {
5923 type Response = http::Response<tonic::body::Body>;
5924 type Error = std::convert::Infallible;
5925 type Future = BoxFuture<Self::Response, Self::Error>;
5926 fn poll_ready(
5927 &mut self,
5928 _cx: &mut Context<'_>,
5929 ) -> Poll<std::result::Result<(), Self::Error>> {
5930 Poll::Ready(Ok(()))
5931 }
5932 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5933 match req.uri().path() {
5934 "/sui.rpc.v2.StateService/ListDynamicFields" => {
5935 #[allow(non_camel_case_types)]
5936 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
5937 impl<
5938 T: StateService,
5939 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
5940 for ListDynamicFieldsSvc<T> {
5941 type Response = super::ListDynamicFieldsResponse;
5942 type Future = BoxFuture<
5943 tonic::Response<Self::Response>,
5944 tonic::Status,
5945 >;
5946 fn call(
5947 &mut self,
5948 request: tonic::Request<super::ListDynamicFieldsRequest>,
5949 ) -> Self::Future {
5950 let inner = Arc::clone(&self.0);
5951 let fut = async move {
5952 <T as StateService>::list_dynamic_fields(&inner, request)
5953 .await
5954 };
5955 Box::pin(fut)
5956 }
5957 }
5958 let accept_compression_encodings = self.accept_compression_encodings;
5959 let send_compression_encodings = self.send_compression_encodings;
5960 let max_decoding_message_size = self.max_decoding_message_size;
5961 let max_encoding_message_size = self.max_encoding_message_size;
5962 let inner = self.inner.clone();
5963 let fut = async move {
5964 let method = ListDynamicFieldsSvc(inner);
5965 let codec = tonic_prost::ProstCodec::default();
5966 let mut grpc = tonic::server::Grpc::new(codec)
5967 .apply_compression_config(
5968 accept_compression_encodings,
5969 send_compression_encodings,
5970 )
5971 .apply_max_message_size_config(
5972 max_decoding_message_size,
5973 max_encoding_message_size,
5974 );
5975 let res = grpc.unary(method, req).await;
5976 Ok(res)
5977 };
5978 Box::pin(fut)
5979 }
5980 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
5981 #[allow(non_camel_case_types)]
5982 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
5983 impl<
5984 T: StateService,
5985 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
5986 for ListOwnedObjectsSvc<T> {
5987 type Response = super::ListOwnedObjectsResponse;
5988 type Future = BoxFuture<
5989 tonic::Response<Self::Response>,
5990 tonic::Status,
5991 >;
5992 fn call(
5993 &mut self,
5994 request: tonic::Request<super::ListOwnedObjectsRequest>,
5995 ) -> Self::Future {
5996 let inner = Arc::clone(&self.0);
5997 let fut = async move {
5998 <T as StateService>::list_owned_objects(&inner, request)
5999 .await
6000 };
6001 Box::pin(fut)
6002 }
6003 }
6004 let accept_compression_encodings = self.accept_compression_encodings;
6005 let send_compression_encodings = self.send_compression_encodings;
6006 let max_decoding_message_size = self.max_decoding_message_size;
6007 let max_encoding_message_size = self.max_encoding_message_size;
6008 let inner = self.inner.clone();
6009 let fut = async move {
6010 let method = ListOwnedObjectsSvc(inner);
6011 let codec = tonic_prost::ProstCodec::default();
6012 let mut grpc = tonic::server::Grpc::new(codec)
6013 .apply_compression_config(
6014 accept_compression_encodings,
6015 send_compression_encodings,
6016 )
6017 .apply_max_message_size_config(
6018 max_decoding_message_size,
6019 max_encoding_message_size,
6020 );
6021 let res = grpc.unary(method, req).await;
6022 Ok(res)
6023 };
6024 Box::pin(fut)
6025 }
6026 "/sui.rpc.v2.StateService/GetCoinInfo" => {
6027 #[allow(non_camel_case_types)]
6028 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
6029 impl<
6030 T: StateService,
6031 > tonic::server::UnaryService<super::GetCoinInfoRequest>
6032 for GetCoinInfoSvc<T> {
6033 type Response = super::GetCoinInfoResponse;
6034 type Future = BoxFuture<
6035 tonic::Response<Self::Response>,
6036 tonic::Status,
6037 >;
6038 fn call(
6039 &mut self,
6040 request: tonic::Request<super::GetCoinInfoRequest>,
6041 ) -> Self::Future {
6042 let inner = Arc::clone(&self.0);
6043 let fut = async move {
6044 <T as StateService>::get_coin_info(&inner, request).await
6045 };
6046 Box::pin(fut)
6047 }
6048 }
6049 let accept_compression_encodings = self.accept_compression_encodings;
6050 let send_compression_encodings = self.send_compression_encodings;
6051 let max_decoding_message_size = self.max_decoding_message_size;
6052 let max_encoding_message_size = self.max_encoding_message_size;
6053 let inner = self.inner.clone();
6054 let fut = async move {
6055 let method = GetCoinInfoSvc(inner);
6056 let codec = tonic_prost::ProstCodec::default();
6057 let mut grpc = tonic::server::Grpc::new(codec)
6058 .apply_compression_config(
6059 accept_compression_encodings,
6060 send_compression_encodings,
6061 )
6062 .apply_max_message_size_config(
6063 max_decoding_message_size,
6064 max_encoding_message_size,
6065 );
6066 let res = grpc.unary(method, req).await;
6067 Ok(res)
6068 };
6069 Box::pin(fut)
6070 }
6071 "/sui.rpc.v2.StateService/GetBalance" => {
6072 #[allow(non_camel_case_types)]
6073 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
6074 impl<
6075 T: StateService,
6076 > tonic::server::UnaryService<super::GetBalanceRequest>
6077 for GetBalanceSvc<T> {
6078 type Response = super::GetBalanceResponse;
6079 type Future = BoxFuture<
6080 tonic::Response<Self::Response>,
6081 tonic::Status,
6082 >;
6083 fn call(
6084 &mut self,
6085 request: tonic::Request<super::GetBalanceRequest>,
6086 ) -> Self::Future {
6087 let inner = Arc::clone(&self.0);
6088 let fut = async move {
6089 <T as StateService>::get_balance(&inner, request).await
6090 };
6091 Box::pin(fut)
6092 }
6093 }
6094 let accept_compression_encodings = self.accept_compression_encodings;
6095 let send_compression_encodings = self.send_compression_encodings;
6096 let max_decoding_message_size = self.max_decoding_message_size;
6097 let max_encoding_message_size = self.max_encoding_message_size;
6098 let inner = self.inner.clone();
6099 let fut = async move {
6100 let method = GetBalanceSvc(inner);
6101 let codec = tonic_prost::ProstCodec::default();
6102 let mut grpc = tonic::server::Grpc::new(codec)
6103 .apply_compression_config(
6104 accept_compression_encodings,
6105 send_compression_encodings,
6106 )
6107 .apply_max_message_size_config(
6108 max_decoding_message_size,
6109 max_encoding_message_size,
6110 );
6111 let res = grpc.unary(method, req).await;
6112 Ok(res)
6113 };
6114 Box::pin(fut)
6115 }
6116 "/sui.rpc.v2.StateService/ListBalances" => {
6117 #[allow(non_camel_case_types)]
6118 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
6119 impl<
6120 T: StateService,
6121 > tonic::server::UnaryService<super::ListBalancesRequest>
6122 for ListBalancesSvc<T> {
6123 type Response = super::ListBalancesResponse;
6124 type Future = BoxFuture<
6125 tonic::Response<Self::Response>,
6126 tonic::Status,
6127 >;
6128 fn call(
6129 &mut self,
6130 request: tonic::Request<super::ListBalancesRequest>,
6131 ) -> Self::Future {
6132 let inner = Arc::clone(&self.0);
6133 let fut = async move {
6134 <T as StateService>::list_balances(&inner, request).await
6135 };
6136 Box::pin(fut)
6137 }
6138 }
6139 let accept_compression_encodings = self.accept_compression_encodings;
6140 let send_compression_encodings = self.send_compression_encodings;
6141 let max_decoding_message_size = self.max_decoding_message_size;
6142 let max_encoding_message_size = self.max_encoding_message_size;
6143 let inner = self.inner.clone();
6144 let fut = async move {
6145 let method = ListBalancesSvc(inner);
6146 let codec = tonic_prost::ProstCodec::default();
6147 let mut grpc = tonic::server::Grpc::new(codec)
6148 .apply_compression_config(
6149 accept_compression_encodings,
6150 send_compression_encodings,
6151 )
6152 .apply_max_message_size_config(
6153 max_decoding_message_size,
6154 max_encoding_message_size,
6155 );
6156 let res = grpc.unary(method, req).await;
6157 Ok(res)
6158 };
6159 Box::pin(fut)
6160 }
6161 _ => {
6162 Box::pin(async move {
6163 let mut response = http::Response::new(
6164 tonic::body::Body::default(),
6165 );
6166 let headers = response.headers_mut();
6167 headers
6168 .insert(
6169 tonic::Status::GRPC_STATUS,
6170 (tonic::Code::Unimplemented as i32).into(),
6171 );
6172 headers
6173 .insert(
6174 http::header::CONTENT_TYPE,
6175 tonic::metadata::GRPC_CONTENT_TYPE,
6176 );
6177 Ok(response)
6178 })
6179 }
6180 }
6181 }
6182 }
6183 impl<T> Clone for StateServiceServer<T> {
6184 fn clone(&self) -> Self {
6185 let inner = self.inner.clone();
6186 Self {
6187 inner,
6188 accept_compression_encodings: self.accept_compression_encodings,
6189 send_compression_encodings: self.send_compression_encodings,
6190 max_decoding_message_size: self.max_decoding_message_size,
6191 max_encoding_message_size: self.max_encoding_message_size,
6192 }
6193 }
6194 }
6195 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
6197 impl<T> tonic::server::NamedService for StateServiceServer<T> {
6198 const NAME: &'static str = SERVICE_NAME;
6199 }
6200}
6201#[non_exhaustive]
6203#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6204pub struct SubscribeCheckpointsRequest {
6205 #[prost(message, optional, tag = "1")]
6208 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6209}
6210#[non_exhaustive]
6212#[derive(Clone, PartialEq, ::prost::Message)]
6213pub struct SubscribeCheckpointsResponse {
6214 #[prost(uint64, optional, tag = "1")]
6217 pub cursor: ::core::option::Option<u64>,
6218 #[prost(message, optional, tag = "2")]
6220 pub checkpoint: ::core::option::Option<Checkpoint>,
6221}
6222pub mod subscription_service_client {
6224 #![allow(
6225 unused_variables,
6226 dead_code,
6227 missing_docs,
6228 clippy::wildcard_imports,
6229 clippy::let_unit_value,
6230 )]
6231 use tonic::codegen::*;
6232 use tonic::codegen::http::Uri;
6233 #[derive(Debug, Clone)]
6234 pub struct SubscriptionServiceClient<T> {
6235 inner: tonic::client::Grpc<T>,
6236 }
6237 impl SubscriptionServiceClient<tonic::transport::Channel> {
6238 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6240 where
6241 D: TryInto<tonic::transport::Endpoint>,
6242 D::Error: Into<StdError>,
6243 {
6244 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6245 Ok(Self::new(conn))
6246 }
6247 }
6248 impl<T> SubscriptionServiceClient<T>
6249 where
6250 T: tonic::client::GrpcService<tonic::body::Body>,
6251 T::Error: Into<StdError>,
6252 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6253 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6254 {
6255 pub fn new(inner: T) -> Self {
6256 let inner = tonic::client::Grpc::new(inner);
6257 Self { inner }
6258 }
6259 pub fn with_origin(inner: T, origin: Uri) -> Self {
6260 let inner = tonic::client::Grpc::with_origin(inner, origin);
6261 Self { inner }
6262 }
6263 pub fn with_interceptor<F>(
6264 inner: T,
6265 interceptor: F,
6266 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
6267 where
6268 F: tonic::service::Interceptor,
6269 T::ResponseBody: Default,
6270 T: tonic::codegen::Service<
6271 http::Request<tonic::body::Body>,
6272 Response = http::Response<
6273 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6274 >,
6275 >,
6276 <T as tonic::codegen::Service<
6277 http::Request<tonic::body::Body>,
6278 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6279 {
6280 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
6281 }
6282 #[must_use]
6287 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6288 self.inner = self.inner.send_compressed(encoding);
6289 self
6290 }
6291 #[must_use]
6293 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6294 self.inner = self.inner.accept_compressed(encoding);
6295 self
6296 }
6297 #[must_use]
6301 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6302 self.inner = self.inner.max_decoding_message_size(limit);
6303 self
6304 }
6305 #[must_use]
6309 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6310 self.inner = self.inner.max_encoding_message_size(limit);
6311 self
6312 }
6313 pub async fn subscribe_checkpoints(
6325 &mut self,
6326 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
6327 ) -> std::result::Result<
6328 tonic::Response<
6329 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
6330 >,
6331 tonic::Status,
6332 > {
6333 self.inner
6334 .ready()
6335 .await
6336 .map_err(|e| {
6337 tonic::Status::unknown(
6338 format!("Service was not ready: {}", e.into()),
6339 )
6340 })?;
6341 let codec = tonic_prost::ProstCodec::default();
6342 let path = http::uri::PathAndQuery::from_static(
6343 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
6344 );
6345 let mut req = request.into_request();
6346 req.extensions_mut()
6347 .insert(
6348 GrpcMethod::new(
6349 "sui.rpc.v2.SubscriptionService",
6350 "SubscribeCheckpoints",
6351 ),
6352 );
6353 self.inner.server_streaming(req, path, codec).await
6354 }
6355 }
6356}
6357pub mod subscription_service_server {
6359 #![allow(
6360 unused_variables,
6361 dead_code,
6362 missing_docs,
6363 clippy::wildcard_imports,
6364 clippy::let_unit_value,
6365 )]
6366 use tonic::codegen::*;
6367 #[async_trait]
6369 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
6370 type SubscribeCheckpointsStream: tonic::codegen::tokio_stream::Stream<
6372 Item = std::result::Result<
6373 super::SubscribeCheckpointsResponse,
6374 tonic::Status,
6375 >,
6376 >
6377 + std::marker::Send
6378 + 'static;
6379 async fn subscribe_checkpoints(
6391 &self,
6392 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6393 ) -> std::result::Result<
6394 tonic::Response<Self::SubscribeCheckpointsStream>,
6395 tonic::Status,
6396 >;
6397 }
6398 #[derive(Debug)]
6399 pub struct SubscriptionServiceServer<T> {
6400 inner: Arc<T>,
6401 accept_compression_encodings: EnabledCompressionEncodings,
6402 send_compression_encodings: EnabledCompressionEncodings,
6403 max_decoding_message_size: Option<usize>,
6404 max_encoding_message_size: Option<usize>,
6405 }
6406 impl<T> SubscriptionServiceServer<T> {
6407 pub fn new(inner: T) -> Self {
6408 Self::from_arc(Arc::new(inner))
6409 }
6410 pub fn from_arc(inner: Arc<T>) -> Self {
6411 Self {
6412 inner,
6413 accept_compression_encodings: Default::default(),
6414 send_compression_encodings: Default::default(),
6415 max_decoding_message_size: None,
6416 max_encoding_message_size: None,
6417 }
6418 }
6419 pub fn with_interceptor<F>(
6420 inner: T,
6421 interceptor: F,
6422 ) -> InterceptedService<Self, F>
6423 where
6424 F: tonic::service::Interceptor,
6425 {
6426 InterceptedService::new(Self::new(inner), interceptor)
6427 }
6428 #[must_use]
6430 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6431 self.accept_compression_encodings.enable(encoding);
6432 self
6433 }
6434 #[must_use]
6436 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6437 self.send_compression_encodings.enable(encoding);
6438 self
6439 }
6440 #[must_use]
6444 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6445 self.max_decoding_message_size = Some(limit);
6446 self
6447 }
6448 #[must_use]
6452 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6453 self.max_encoding_message_size = Some(limit);
6454 self
6455 }
6456 }
6457 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
6458 where
6459 T: SubscriptionService,
6460 B: Body + std::marker::Send + 'static,
6461 B::Error: Into<StdError> + std::marker::Send + 'static,
6462 {
6463 type Response = http::Response<tonic::body::Body>;
6464 type Error = std::convert::Infallible;
6465 type Future = BoxFuture<Self::Response, Self::Error>;
6466 fn poll_ready(
6467 &mut self,
6468 _cx: &mut Context<'_>,
6469 ) -> Poll<std::result::Result<(), Self::Error>> {
6470 Poll::Ready(Ok(()))
6471 }
6472 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6473 match req.uri().path() {
6474 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
6475 #[allow(non_camel_case_types)]
6476 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
6477 impl<
6478 T: SubscriptionService,
6479 > tonic::server::ServerStreamingService<
6480 super::SubscribeCheckpointsRequest,
6481 > for SubscribeCheckpointsSvc<T> {
6482 type Response = super::SubscribeCheckpointsResponse;
6483 type ResponseStream = T::SubscribeCheckpointsStream;
6484 type Future = BoxFuture<
6485 tonic::Response<Self::ResponseStream>,
6486 tonic::Status,
6487 >;
6488 fn call(
6489 &mut self,
6490 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6491 ) -> Self::Future {
6492 let inner = Arc::clone(&self.0);
6493 let fut = async move {
6494 <T as SubscriptionService>::subscribe_checkpoints(
6495 &inner,
6496 request,
6497 )
6498 .await
6499 };
6500 Box::pin(fut)
6501 }
6502 }
6503 let accept_compression_encodings = self.accept_compression_encodings;
6504 let send_compression_encodings = self.send_compression_encodings;
6505 let max_decoding_message_size = self.max_decoding_message_size;
6506 let max_encoding_message_size = self.max_encoding_message_size;
6507 let inner = self.inner.clone();
6508 let fut = async move {
6509 let method = SubscribeCheckpointsSvc(inner);
6510 let codec = tonic_prost::ProstCodec::default();
6511 let mut grpc = tonic::server::Grpc::new(codec)
6512 .apply_compression_config(
6513 accept_compression_encodings,
6514 send_compression_encodings,
6515 )
6516 .apply_max_message_size_config(
6517 max_decoding_message_size,
6518 max_encoding_message_size,
6519 );
6520 let res = grpc.server_streaming(method, req).await;
6521 Ok(res)
6522 };
6523 Box::pin(fut)
6524 }
6525 _ => {
6526 Box::pin(async move {
6527 let mut response = http::Response::new(
6528 tonic::body::Body::default(),
6529 );
6530 let headers = response.headers_mut();
6531 headers
6532 .insert(
6533 tonic::Status::GRPC_STATUS,
6534 (tonic::Code::Unimplemented as i32).into(),
6535 );
6536 headers
6537 .insert(
6538 http::header::CONTENT_TYPE,
6539 tonic::metadata::GRPC_CONTENT_TYPE,
6540 );
6541 Ok(response)
6542 })
6543 }
6544 }
6545 }
6546 }
6547 impl<T> Clone for SubscriptionServiceServer<T> {
6548 fn clone(&self) -> Self {
6549 let inner = self.inner.clone();
6550 Self {
6551 inner,
6552 accept_compression_encodings: self.accept_compression_encodings,
6553 send_compression_encodings: self.send_compression_encodings,
6554 max_decoding_message_size: self.max_decoding_message_size,
6555 max_encoding_message_size: self.max_encoding_message_size,
6556 }
6557 }
6558 }
6559 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
6561 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
6562 const NAME: &'static str = SERVICE_NAME;
6563 }
6564}
6565#[non_exhaustive]
6566#[derive(Clone, PartialEq, ::prost::Message)]
6567pub struct SystemState {
6568 #[prost(uint64, optional, tag = "1")]
6570 pub version: ::core::option::Option<u64>,
6571 #[prost(uint64, optional, tag = "2")]
6573 pub epoch: ::core::option::Option<u64>,
6574 #[prost(uint64, optional, tag = "3")]
6576 pub protocol_version: ::core::option::Option<u64>,
6577 #[prost(message, optional, tag = "4")]
6579 pub validators: ::core::option::Option<ValidatorSet>,
6580 #[prost(message, optional, tag = "5")]
6582 pub storage_fund: ::core::option::Option<StorageFund>,
6583 #[prost(message, optional, tag = "6")]
6585 pub parameters: ::core::option::Option<SystemParameters>,
6586 #[prost(uint64, optional, tag = "7")]
6588 pub reference_gas_price: ::core::option::Option<u64>,
6589 #[prost(message, repeated, tag = "8")]
6597 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
6598 #[prost(message, optional, tag = "9")]
6600 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
6601 #[prost(bool, optional, tag = "10")]
6608 pub safe_mode: ::core::option::Option<bool>,
6609 #[prost(uint64, optional, tag = "11")]
6611 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
6612 #[prost(uint64, optional, tag = "12")]
6614 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
6615 #[prost(uint64, optional, tag = "13")]
6617 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
6618 #[prost(uint64, optional, tag = "14")]
6620 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
6621 #[prost(uint64, optional, tag = "15")]
6623 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
6624 #[prost(message, optional, tag = "16")]
6626 pub extra_fields: ::core::option::Option<MoveTable>,
6627}
6628#[non_exhaustive]
6629#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6630pub struct ValidatorReportRecord {
6631 #[prost(string, optional, tag = "1")]
6633 pub reported: ::core::option::Option<::prost::alloc::string::String>,
6634 #[prost(string, repeated, tag = "2")]
6636 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6637}
6638#[non_exhaustive]
6639#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6640pub struct SystemParameters {
6641 #[prost(uint64, optional, tag = "1")]
6643 pub epoch_duration_ms: ::core::option::Option<u64>,
6644 #[prost(uint64, optional, tag = "2")]
6646 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
6647 #[prost(uint64, optional, tag = "3")]
6649 pub min_validator_count: ::core::option::Option<u64>,
6650 #[prost(uint64, optional, tag = "4")]
6653 pub max_validator_count: ::core::option::Option<u64>,
6654 #[prost(uint64, optional, tag = "5")]
6657 pub min_validator_joining_stake: ::core::option::Option<u64>,
6658 #[prost(uint64, optional, tag = "6")]
6663 pub validator_low_stake_threshold: ::core::option::Option<u64>,
6664 #[prost(uint64, optional, tag = "7")]
6668 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
6669 #[prost(uint64, optional, tag = "8")]
6672 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
6673 #[prost(message, optional, tag = "9")]
6675 pub extra_fields: ::core::option::Option<MoveTable>,
6676}
6677#[non_exhaustive]
6679#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6680pub struct MoveTable {
6681 #[prost(string, optional, tag = "1")]
6683 pub id: ::core::option::Option<::prost::alloc::string::String>,
6684 #[prost(uint64, optional, tag = "2")]
6686 pub size: ::core::option::Option<u64>,
6687}
6688#[non_exhaustive]
6689#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6690pub struct StakeSubsidy {
6691 #[prost(uint64, optional, tag = "1")]
6693 pub balance: ::core::option::Option<u64>,
6694 #[prost(uint64, optional, tag = "2")]
6696 pub distribution_counter: ::core::option::Option<u64>,
6697 #[prost(uint64, optional, tag = "3")]
6700 pub current_distribution_amount: ::core::option::Option<u64>,
6701 #[prost(uint64, optional, tag = "4")]
6703 pub stake_subsidy_period_length: ::core::option::Option<u64>,
6704 #[prost(uint32, optional, tag = "5")]
6707 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
6708 #[prost(message, optional, tag = "6")]
6710 pub extra_fields: ::core::option::Option<MoveTable>,
6711}
6712#[non_exhaustive]
6714#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6715pub struct StorageFund {
6716 #[prost(uint64, optional, tag = "1")]
6722 pub total_object_storage_rebates: ::core::option::Option<u64>,
6723 #[prost(uint64, optional, tag = "2")]
6726 pub non_refundable_balance: ::core::option::Option<u64>,
6727}
6728#[non_exhaustive]
6729#[derive(Clone, PartialEq, ::prost::Message)]
6730pub struct ValidatorSet {
6731 #[prost(uint64, optional, tag = "1")]
6734 pub total_stake: ::core::option::Option<u64>,
6735 #[prost(message, repeated, tag = "2")]
6737 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
6738 #[prost(message, optional, tag = "3")]
6743 pub pending_active_validators: ::core::option::Option<MoveTable>,
6744 #[prost(uint64, repeated, tag = "4")]
6747 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
6748 #[prost(message, optional, tag = "5")]
6752 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
6753 #[prost(message, optional, tag = "6")]
6759 pub inactive_validators: ::core::option::Option<MoveTable>,
6760 #[prost(message, optional, tag = "7")]
6768 pub validator_candidates: ::core::option::Option<MoveTable>,
6769 #[prost(btree_map = "string, uint64", tag = "8")]
6771 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
6772 ::prost::alloc::string::String,
6773 u64,
6774 >,
6775 #[prost(message, optional, tag = "9")]
6777 pub extra_fields: ::core::option::Option<MoveTable>,
6778}
6779#[non_exhaustive]
6783#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6784pub struct Validator {
6785 #[prost(string, optional, tag = "1")]
6787 pub name: ::core::option::Option<::prost::alloc::string::String>,
6788 #[prost(string, optional, tag = "2")]
6791 pub address: ::core::option::Option<::prost::alloc::string::String>,
6792 #[prost(string, optional, tag = "3")]
6793 pub description: ::core::option::Option<::prost::alloc::string::String>,
6794 #[prost(string, optional, tag = "4")]
6795 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
6796 #[prost(string, optional, tag = "5")]
6797 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
6798 #[prost(bytes = "bytes", optional, tag = "7")]
6801 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6802 #[prost(bytes = "bytes", optional, tag = "8")]
6804 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6805 #[prost(bytes = "bytes", optional, tag = "10")]
6808 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6809 #[prost(bytes = "bytes", optional, tag = "12")]
6811 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6812 #[prost(string, optional, tag = "13")]
6814 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
6815 #[prost(string, optional, tag = "14")]
6817 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6818 #[prost(string, optional, tag = "15")]
6820 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
6821 #[prost(string, optional, tag = "16")]
6823 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
6824 #[prost(bytes = "bytes", optional, tag = "18")]
6825 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6826 #[prost(bytes = "bytes", optional, tag = "19")]
6827 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6828 #[prost(bytes = "bytes", optional, tag = "21")]
6829 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6830 #[prost(bytes = "bytes", optional, tag = "23")]
6831 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6832 #[prost(string, optional, tag = "24")]
6833 pub next_epoch_network_address: ::core::option::Option<
6834 ::prost::alloc::string::String,
6835 >,
6836 #[prost(string, optional, tag = "25")]
6837 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6838 #[prost(string, optional, tag = "26")]
6839 pub next_epoch_primary_address: ::core::option::Option<
6840 ::prost::alloc::string::String,
6841 >,
6842 #[prost(string, optional, tag = "27")]
6843 pub next_epoch_worker_address: ::core::option::Option<
6844 ::prost::alloc::string::String,
6845 >,
6846 #[prost(message, optional, tag = "28")]
6848 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
6849 #[prost(uint64, optional, tag = "29")]
6852 pub voting_power: ::core::option::Option<u64>,
6853 #[prost(string, optional, tag = "30")]
6855 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6856 #[prost(uint64, optional, tag = "31")]
6858 pub gas_price: ::core::option::Option<u64>,
6859 #[prost(message, optional, tag = "32")]
6861 pub staking_pool: ::core::option::Option<StakingPool>,
6862 #[prost(uint64, optional, tag = "33")]
6864 pub commission_rate: ::core::option::Option<u64>,
6865 #[prost(uint64, optional, tag = "34")]
6867 pub next_epoch_stake: ::core::option::Option<u64>,
6868 #[prost(uint64, optional, tag = "35")]
6870 pub next_epoch_gas_price: ::core::option::Option<u64>,
6871 #[prost(uint64, optional, tag = "36")]
6873 pub next_epoch_commission_rate: ::core::option::Option<u64>,
6874 #[prost(message, optional, tag = "37")]
6876 pub extra_fields: ::core::option::Option<MoveTable>,
6877}
6878#[non_exhaustive]
6880#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6881pub struct StakingPool {
6882 #[prost(string, optional, tag = "1")]
6884 pub id: ::core::option::Option<::prost::alloc::string::String>,
6885 #[prost(uint64, optional, tag = "2")]
6888 pub activation_epoch: ::core::option::Option<u64>,
6889 #[prost(uint64, optional, tag = "3")]
6892 pub deactivation_epoch: ::core::option::Option<u64>,
6893 #[prost(uint64, optional, tag = "4")]
6896 pub sui_balance: ::core::option::Option<u64>,
6897 #[prost(uint64, optional, tag = "5")]
6899 pub rewards_pool: ::core::option::Option<u64>,
6900 #[prost(uint64, optional, tag = "6")]
6902 pub pool_token_balance: ::core::option::Option<u64>,
6903 #[prost(message, optional, tag = "7")]
6910 pub exchange_rates: ::core::option::Option<MoveTable>,
6911 #[prost(uint64, optional, tag = "8")]
6913 pub pending_stake: ::core::option::Option<u64>,
6914 #[prost(uint64, optional, tag = "9")]
6917 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
6918 #[prost(uint64, optional, tag = "10")]
6920 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
6921 #[prost(message, optional, tag = "11")]
6923 pub extra_fields: ::core::option::Option<MoveTable>,
6924}
6925#[non_exhaustive]
6927#[derive(Clone, PartialEq, ::prost::Message)]
6928pub struct Transaction {
6929 #[prost(message, optional, tag = "1")]
6931 pub bcs: ::core::option::Option<Bcs>,
6932 #[prost(string, optional, tag = "2")]
6934 pub digest: ::core::option::Option<::prost::alloc::string::String>,
6935 #[prost(int32, optional, tag = "3")]
6937 pub version: ::core::option::Option<i32>,
6938 #[prost(message, optional, tag = "4")]
6939 pub kind: ::core::option::Option<TransactionKind>,
6940 #[prost(string, optional, tag = "5")]
6941 pub sender: ::core::option::Option<::prost::alloc::string::String>,
6942 #[prost(message, optional, tag = "6")]
6943 pub gas_payment: ::core::option::Option<GasPayment>,
6944 #[prost(message, optional, tag = "7")]
6945 pub expiration: ::core::option::Option<TransactionExpiration>,
6946}
6947#[non_exhaustive]
6949#[derive(Clone, PartialEq, ::prost::Message)]
6950pub struct GasPayment {
6951 #[prost(message, repeated, tag = "1")]
6953 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
6954 #[prost(string, optional, tag = "2")]
6956 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6957 #[prost(uint64, optional, tag = "3")]
6961 pub price: ::core::option::Option<u64>,
6962 #[prost(uint64, optional, tag = "4")]
6964 pub budget: ::core::option::Option<u64>,
6965}
6966#[non_exhaustive]
6968#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6969pub struct TransactionExpiration {
6970 #[prost(
6971 enumeration = "transaction_expiration::TransactionExpirationKind",
6972 optional,
6973 tag = "1"
6974 )]
6975 pub kind: ::core::option::Option<i32>,
6976 #[prost(uint64, optional, tag = "2")]
6979 pub epoch: ::core::option::Option<u64>,
6980 #[prost(uint64, optional, tag = "3")]
6983 pub min_epoch: ::core::option::Option<u64>,
6984 #[prost(message, optional, tag = "4")]
6988 pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
6989 #[prost(message, optional, tag = "5")]
6993 pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
6994 #[prost(string, optional, tag = "6")]
6996 pub chain: ::core::option::Option<::prost::alloc::string::String>,
6997 #[prost(uint32, optional, tag = "7")]
6999 pub nonce: ::core::option::Option<u32>,
7000}
7001pub mod transaction_expiration {
7003 #[non_exhaustive]
7004 #[derive(
7005 Clone,
7006 Copy,
7007 Debug,
7008 PartialEq,
7009 Eq,
7010 Hash,
7011 PartialOrd,
7012 Ord,
7013 ::prost::Enumeration
7014 )]
7015 #[repr(i32)]
7016 pub enum TransactionExpirationKind {
7017 Unknown = 0,
7018 None = 1,
7020 Epoch = 2,
7023 ValidDuring = 3,
7033 }
7034 impl TransactionExpirationKind {
7035 pub fn as_str_name(&self) -> &'static str {
7040 match self {
7041 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
7042 Self::None => "NONE",
7043 Self::Epoch => "EPOCH",
7044 Self::ValidDuring => "VALID_DURING",
7045 }
7046 }
7047 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7049 match value {
7050 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
7051 "NONE" => Some(Self::None),
7052 "EPOCH" => Some(Self::Epoch),
7053 "VALID_DURING" => Some(Self::ValidDuring),
7054 _ => None,
7055 }
7056 }
7057 }
7058}
7059#[non_exhaustive]
7061#[derive(Clone, PartialEq, ::prost::Message)]
7062pub struct TransactionKind {
7063 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
7064 pub kind: ::core::option::Option<i32>,
7065 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
7066 pub data: ::core::option::Option<transaction_kind::Data>,
7067}
7068pub mod transaction_kind {
7070 #[non_exhaustive]
7071 #[derive(
7072 Clone,
7073 Copy,
7074 Debug,
7075 PartialEq,
7076 Eq,
7077 Hash,
7078 PartialOrd,
7079 Ord,
7080 ::prost::Enumeration
7081 )]
7082 #[repr(i32)]
7083 pub enum Kind {
7084 Unknown = 0,
7085 ProgrammableTransaction = 1,
7087 ChangeEpoch = 2,
7092 Genesis = 3,
7097 ConsensusCommitPrologueV1 = 4,
7099 AuthenticatorStateUpdate = 5,
7101 EndOfEpoch = 6,
7104 RandomnessStateUpdate = 7,
7106 ConsensusCommitPrologueV2 = 8,
7108 ConsensusCommitPrologueV3 = 9,
7110 ConsensusCommitPrologueV4 = 10,
7112 }
7113 impl Kind {
7114 pub fn as_str_name(&self) -> &'static str {
7119 match self {
7120 Self::Unknown => "KIND_UNKNOWN",
7121 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
7122 Self::ChangeEpoch => "CHANGE_EPOCH",
7123 Self::Genesis => "GENESIS",
7124 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
7125 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
7126 Self::EndOfEpoch => "END_OF_EPOCH",
7127 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
7128 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
7129 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
7130 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
7131 }
7132 }
7133 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7135 match value {
7136 "KIND_UNKNOWN" => Some(Self::Unknown),
7137 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
7138 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7139 "GENESIS" => Some(Self::Genesis),
7140 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
7141 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
7142 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
7143 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
7144 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
7145 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
7146 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
7147 _ => None,
7148 }
7149 }
7150 }
7151 #[non_exhaustive]
7152 #[derive(Clone, PartialEq, ::prost::Oneof)]
7153 pub enum Data {
7154 #[prost(message, tag = "2")]
7156 ProgrammableTransaction(super::ProgrammableTransaction),
7157 #[prost(message, tag = "3")]
7162 ChangeEpoch(super::ChangeEpoch),
7163 #[prost(message, tag = "4")]
7168 Genesis(super::GenesisTransaction),
7169 #[prost(message, tag = "5")]
7171 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
7172 #[prost(message, tag = "6")]
7174 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
7175 #[prost(message, tag = "7")]
7178 EndOfEpoch(super::EndOfEpochTransaction),
7179 #[prost(message, tag = "8")]
7181 RandomnessStateUpdate(super::RandomnessStateUpdate),
7182 }
7183}
7184#[non_exhaustive]
7189#[derive(Clone, PartialEq, ::prost::Message)]
7190pub struct ProgrammableTransaction {
7191 #[prost(message, repeated, tag = "1")]
7193 pub inputs: ::prost::alloc::vec::Vec<Input>,
7194 #[prost(message, repeated, tag = "2")]
7197 pub commands: ::prost::alloc::vec::Vec<Command>,
7198}
7199#[non_exhaustive]
7201#[derive(Clone, PartialEq, ::prost::Message)]
7202pub struct Command {
7203 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
7204 pub command: ::core::option::Option<command::Command>,
7205}
7206pub mod command {
7208 #[non_exhaustive]
7209 #[derive(Clone, PartialEq, ::prost::Oneof)]
7210 pub enum Command {
7211 #[prost(message, tag = "1")]
7213 MoveCall(super::MoveCall),
7214 #[prost(message, tag = "2")]
7219 TransferObjects(super::TransferObjects),
7220 #[prost(message, tag = "3")]
7223 SplitCoins(super::SplitCoins),
7224 #[prost(message, tag = "4")]
7227 MergeCoins(super::MergeCoins),
7228 #[prost(message, tag = "5")]
7231 Publish(super::Publish),
7232 #[prost(message, tag = "6")]
7236 MakeMoveVector(super::MakeMoveVector),
7237 #[prost(message, tag = "7")]
7246 Upgrade(super::Upgrade),
7247 }
7248}
7249#[non_exhaustive]
7254#[derive(Clone, PartialEq, ::prost::Message)]
7255pub struct MoveCall {
7256 #[prost(string, optional, tag = "1")]
7258 pub package: ::core::option::Option<::prost::alloc::string::String>,
7259 #[prost(string, optional, tag = "2")]
7261 pub module: ::core::option::Option<::prost::alloc::string::String>,
7262 #[prost(string, optional, tag = "3")]
7264 pub function: ::core::option::Option<::prost::alloc::string::String>,
7265 #[prost(string, repeated, tag = "4")]
7267 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7268 #[prost(message, repeated, tag = "5")]
7270 pub arguments: ::prost::alloc::vec::Vec<Argument>,
7271}
7272#[non_exhaustive]
7274#[derive(Clone, PartialEq, ::prost::Message)]
7275pub struct TransferObjects {
7276 #[prost(message, repeated, tag = "1")]
7278 pub objects: ::prost::alloc::vec::Vec<Argument>,
7279 #[prost(message, optional, tag = "2")]
7281 pub address: ::core::option::Option<Argument>,
7282}
7283#[non_exhaustive]
7285#[derive(Clone, PartialEq, ::prost::Message)]
7286pub struct SplitCoins {
7287 #[prost(message, optional, tag = "1")]
7289 pub coin: ::core::option::Option<Argument>,
7290 #[prost(message, repeated, tag = "2")]
7292 pub amounts: ::prost::alloc::vec::Vec<Argument>,
7293}
7294#[non_exhaustive]
7296#[derive(Clone, PartialEq, ::prost::Message)]
7297pub struct MergeCoins {
7298 #[prost(message, optional, tag = "1")]
7300 pub coin: ::core::option::Option<Argument>,
7301 #[prost(message, repeated, tag = "2")]
7305 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
7306}
7307#[non_exhaustive]
7309#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7310pub struct Publish {
7311 #[prost(bytes = "bytes", repeated, tag = "1")]
7313 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7314 #[prost(string, repeated, tag = "2")]
7316 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7317}
7318#[non_exhaustive]
7320#[derive(Clone, PartialEq, ::prost::Message)]
7321pub struct MakeMoveVector {
7322 #[prost(string, optional, tag = "1")]
7327 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
7328 #[prost(message, repeated, tag = "2")]
7330 pub elements: ::prost::alloc::vec::Vec<Argument>,
7331}
7332#[non_exhaustive]
7334#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7335pub struct Upgrade {
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 #[prost(string, optional, tag = "3")]
7344 pub package: ::core::option::Option<::prost::alloc::string::String>,
7345 #[prost(message, optional, tag = "4")]
7347 pub ticket: ::core::option::Option<Argument>,
7348}
7349#[non_exhaustive]
7351#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7352pub struct RandomnessStateUpdate {
7353 #[prost(uint64, optional, tag = "1")]
7355 pub epoch: ::core::option::Option<u64>,
7356 #[prost(uint64, optional, tag = "2")]
7358 pub randomness_round: ::core::option::Option<u64>,
7359 #[prost(bytes = "bytes", optional, tag = "3")]
7361 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
7362 #[prost(uint64, optional, tag = "4")]
7364 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
7365}
7366#[non_exhaustive]
7368#[derive(Clone, PartialEq, ::prost::Message)]
7369pub struct ChangeEpoch {
7370 #[prost(uint64, optional, tag = "1")]
7372 pub epoch: ::core::option::Option<u64>,
7373 #[prost(uint64, optional, tag = "2")]
7375 pub protocol_version: ::core::option::Option<u64>,
7376 #[prost(uint64, optional, tag = "3")]
7378 pub storage_charge: ::core::option::Option<u64>,
7379 #[prost(uint64, optional, tag = "4")]
7381 pub computation_charge: ::core::option::Option<u64>,
7382 #[prost(uint64, optional, tag = "5")]
7384 pub storage_rebate: ::core::option::Option<u64>,
7385 #[prost(uint64, optional, tag = "6")]
7387 pub non_refundable_storage_fee: ::core::option::Option<u64>,
7388 #[prost(message, optional, tag = "7")]
7390 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7391 #[prost(message, repeated, tag = "8")]
7397 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
7398}
7399#[non_exhaustive]
7401#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7402pub struct SystemPackage {
7403 #[prost(uint64, optional, tag = "1")]
7405 pub version: ::core::option::Option<u64>,
7406 #[prost(bytes = "bytes", repeated, tag = "2")]
7408 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7409 #[prost(string, repeated, tag = "3")]
7411 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7412}
7413#[non_exhaustive]
7415#[derive(Clone, PartialEq, ::prost::Message)]
7416pub struct GenesisTransaction {
7417 #[prost(message, repeated, tag = "1")]
7419 pub objects: ::prost::alloc::vec::Vec<Object>,
7420}
7421#[non_exhaustive]
7425#[derive(Clone, PartialEq, ::prost::Message)]
7426pub struct ConsensusCommitPrologue {
7427 #[prost(uint64, optional, tag = "1")]
7431 pub epoch: ::core::option::Option<u64>,
7432 #[prost(uint64, optional, tag = "2")]
7436 pub round: ::core::option::Option<u64>,
7437 #[prost(message, optional, tag = "3")]
7441 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7442 #[prost(string, optional, tag = "4")]
7446 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
7447 #[prost(uint64, optional, tag = "5")]
7452 pub sub_dag_index: ::core::option::Option<u64>,
7453 #[prost(message, optional, tag = "6")]
7457 pub consensus_determined_version_assignments: ::core::option::Option<
7458 ConsensusDeterminedVersionAssignments,
7459 >,
7460 #[prost(string, optional, tag = "7")]
7465 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
7466}
7467#[non_exhaustive]
7469#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7470pub struct VersionAssignment {
7471 #[prost(string, optional, tag = "1")]
7473 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
7474 #[prost(uint64, optional, tag = "2")]
7476 pub start_version: ::core::option::Option<u64>,
7477 #[prost(uint64, optional, tag = "3")]
7479 pub version: ::core::option::Option<u64>,
7480}
7481#[non_exhaustive]
7483#[derive(Clone, PartialEq, ::prost::Message)]
7484pub struct CanceledTransaction {
7485 #[prost(string, optional, tag = "1")]
7487 pub digest: ::core::option::Option<::prost::alloc::string::String>,
7488 #[prost(message, repeated, tag = "2")]
7490 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
7491}
7492#[non_exhaustive]
7494#[derive(Clone, PartialEq, ::prost::Message)]
7495pub struct ConsensusDeterminedVersionAssignments {
7496 #[prost(int32, optional, tag = "1")]
7498 pub version: ::core::option::Option<i32>,
7499 #[prost(message, repeated, tag = "3")]
7501 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
7502}
7503#[non_exhaustive]
7505#[derive(Clone, PartialEq, ::prost::Message)]
7506pub struct AuthenticatorStateUpdate {
7507 #[prost(uint64, optional, tag = "1")]
7509 pub epoch: ::core::option::Option<u64>,
7510 #[prost(uint64, optional, tag = "2")]
7512 pub round: ::core::option::Option<u64>,
7513 #[prost(message, repeated, tag = "3")]
7515 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
7516 #[prost(uint64, optional, tag = "4")]
7518 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7519}
7520#[non_exhaustive]
7522#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7523pub struct ActiveJwk {
7524 #[prost(message, optional, tag = "1")]
7526 pub id: ::core::option::Option<JwkId>,
7527 #[prost(message, optional, tag = "2")]
7529 pub jwk: ::core::option::Option<Jwk>,
7530 #[prost(uint64, optional, tag = "3")]
7532 pub epoch: ::core::option::Option<u64>,
7533}
7534#[non_exhaustive]
7537#[derive(Clone, PartialEq, ::prost::Message)]
7538pub struct EndOfEpochTransaction {
7539 #[prost(message, repeated, tag = "1")]
7540 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
7541}
7542#[non_exhaustive]
7544#[derive(Clone, PartialEq, ::prost::Message)]
7545pub struct EndOfEpochTransactionKind {
7546 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
7547 pub kind: ::core::option::Option<i32>,
7548 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6")]
7549 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
7550}
7551pub mod end_of_epoch_transaction_kind {
7553 #[non_exhaustive]
7554 #[derive(
7555 Clone,
7556 Copy,
7557 Debug,
7558 PartialEq,
7559 Eq,
7560 Hash,
7561 PartialOrd,
7562 Ord,
7563 ::prost::Enumeration
7564 )]
7565 #[repr(i32)]
7566 pub enum Kind {
7567 Unknown = 0,
7568 ChangeEpoch = 1,
7570 AuthenticatorStateCreate = 2,
7572 AuthenticatorStateExpire = 3,
7574 RandomnessStateCreate = 4,
7576 DenyListStateCreate = 5,
7578 BridgeStateCreate = 6,
7580 BridgeCommitteeInit = 7,
7582 StoreExecutionTimeObservations = 8,
7584 AccumulatorRootCreate = 9,
7586 CoinRegistryCreate = 10,
7588 DisplayRegistryCreate = 11,
7590 AddressAliasStateCreate = 12,
7592 }
7593 impl Kind {
7594 pub fn as_str_name(&self) -> &'static str {
7599 match self {
7600 Self::Unknown => "KIND_UNKNOWN",
7601 Self::ChangeEpoch => "CHANGE_EPOCH",
7602 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
7603 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
7604 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
7605 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
7606 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
7607 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
7608 Self::StoreExecutionTimeObservations => {
7609 "STORE_EXECUTION_TIME_OBSERVATIONS"
7610 }
7611 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
7612 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
7613 Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
7614 Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
7615 }
7616 }
7617 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7619 match value {
7620 "KIND_UNKNOWN" => Some(Self::Unknown),
7621 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7622 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
7623 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
7624 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
7625 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
7626 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
7627 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
7628 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
7629 Some(Self::StoreExecutionTimeObservations)
7630 }
7631 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
7632 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
7633 "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
7634 "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
7635 _ => None,
7636 }
7637 }
7638 }
7639 #[non_exhaustive]
7640 #[derive(Clone, PartialEq, ::prost::Oneof)]
7641 pub enum Data {
7642 #[prost(message, tag = "2")]
7644 ChangeEpoch(super::ChangeEpoch),
7645 #[prost(message, tag = "3")]
7647 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
7648 #[prost(message, tag = "4")]
7650 ExecutionTimeObservations(super::ExecutionTimeObservations),
7651 #[prost(string, tag = "5")]
7653 BridgeChainId(::prost::alloc::string::String),
7654 #[prost(uint64, tag = "6")]
7656 BridgeObjectVersion(u64),
7657 }
7658}
7659#[non_exhaustive]
7661#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7662pub struct AuthenticatorStateExpire {
7663 #[prost(uint64, optional, tag = "1")]
7665 pub min_epoch: ::core::option::Option<u64>,
7666 #[prost(uint64, optional, tag = "2")]
7668 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7669}
7670#[non_exhaustive]
7671#[derive(Clone, PartialEq, ::prost::Message)]
7672pub struct ExecutionTimeObservations {
7673 #[prost(int32, optional, tag = "1")]
7675 pub version: ::core::option::Option<i32>,
7676 #[prost(message, repeated, tag = "2")]
7677 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
7678}
7679#[non_exhaustive]
7680#[derive(Clone, PartialEq, ::prost::Message)]
7681pub struct ExecutionTimeObservation {
7682 #[prost(
7683 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
7684 optional,
7685 tag = "1"
7686 )]
7687 pub kind: ::core::option::Option<i32>,
7688 #[prost(message, optional, tag = "2")]
7689 pub move_entry_point: ::core::option::Option<MoveCall>,
7690 #[prost(message, repeated, tag = "3")]
7691 pub validator_observations: ::prost::alloc::vec::Vec<
7692 ValidatorExecutionTimeObservation,
7693 >,
7694}
7695pub mod execution_time_observation {
7697 #[non_exhaustive]
7698 #[derive(
7699 Clone,
7700 Copy,
7701 Debug,
7702 PartialEq,
7703 Eq,
7704 Hash,
7705 PartialOrd,
7706 Ord,
7707 ::prost::Enumeration
7708 )]
7709 #[repr(i32)]
7710 pub enum ExecutionTimeObservationKind {
7711 Unknown = 0,
7712 MoveEntryPoint = 1,
7713 TransferObjects = 2,
7714 SplitCoins = 3,
7715 MergeCoins = 4,
7716 Publish = 5,
7717 MakeMoveVector = 6,
7718 Upgrade = 7,
7719 }
7720 impl ExecutionTimeObservationKind {
7721 pub fn as_str_name(&self) -> &'static str {
7726 match self {
7727 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
7728 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
7729 Self::TransferObjects => "TRANSFER_OBJECTS",
7730 Self::SplitCoins => "SPLIT_COINS",
7731 Self::MergeCoins => "MERGE_COINS",
7732 Self::Publish => "PUBLISH",
7733 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
7734 Self::Upgrade => "UPGRADE",
7735 }
7736 }
7737 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7739 match value {
7740 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
7741 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
7742 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
7743 "SPLIT_COINS" => Some(Self::SplitCoins),
7744 "MERGE_COINS" => Some(Self::MergeCoins),
7745 "PUBLISH" => Some(Self::Publish),
7746 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
7747 "UPGRADE" => Some(Self::Upgrade),
7748 _ => None,
7749 }
7750 }
7751 }
7752}
7753#[non_exhaustive]
7754#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7755pub struct ValidatorExecutionTimeObservation {
7756 #[prost(bytes = "bytes", optional, tag = "1")]
7758 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
7759 #[prost(message, optional, tag = "2")]
7761 pub duration: ::core::option::Option<::prost_types::Duration>,
7762}
7763#[non_exhaustive]
7764#[derive(Clone, PartialEq, ::prost::Message)]
7765pub struct ExecuteTransactionRequest {
7766 #[prost(message, optional, tag = "1")]
7768 pub transaction: ::core::option::Option<Transaction>,
7769 #[prost(message, repeated, tag = "2")]
7772 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
7773 #[prost(message, optional, tag = "3")]
7776 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7777}
7778#[non_exhaustive]
7780#[derive(Clone, PartialEq, ::prost::Message)]
7781pub struct ExecuteTransactionResponse {
7782 #[prost(message, optional, tag = "1")]
7783 pub transaction: ::core::option::Option<ExecutedTransaction>,
7784}
7785#[non_exhaustive]
7786#[derive(Clone, PartialEq, ::prost::Message)]
7787pub struct SimulateTransactionRequest {
7788 #[prost(message, optional, tag = "1")]
7789 pub transaction: ::core::option::Option<Transaction>,
7790 #[prost(message, optional, tag = "2")]
7792 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7793 #[prost(
7795 enumeration = "simulate_transaction_request::TransactionChecks",
7796 optional,
7797 tag = "3"
7798 )]
7799 pub checks: ::core::option::Option<i32>,
7800 #[prost(bool, optional, tag = "4")]
7805 pub do_gas_selection: ::core::option::Option<bool>,
7806}
7807pub mod simulate_transaction_request {
7809 #[non_exhaustive]
7811 #[derive(
7812 Clone,
7813 Copy,
7814 Debug,
7815 PartialEq,
7816 Eq,
7817 Hash,
7818 PartialOrd,
7819 Ord,
7820 ::prost::Enumeration
7821 )]
7822 #[repr(i32)]
7823 pub enum TransactionChecks {
7824 Enabled = 0,
7825 Disabled = 1,
7826 }
7827 impl TransactionChecks {
7828 pub fn as_str_name(&self) -> &'static str {
7833 match self {
7834 Self::Enabled => "ENABLED",
7835 Self::Disabled => "DISABLED",
7836 }
7837 }
7838 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7840 match value {
7841 "ENABLED" => Some(Self::Enabled),
7842 "DISABLED" => Some(Self::Disabled),
7843 _ => None,
7844 }
7845 }
7846 }
7847}
7848#[non_exhaustive]
7849#[derive(Clone, PartialEq, ::prost::Message)]
7850pub struct SimulateTransactionResponse {
7851 #[prost(message, optional, tag = "1")]
7852 pub transaction: ::core::option::Option<ExecutedTransaction>,
7853 #[prost(message, repeated, tag = "2")]
7854 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
7855}
7856#[non_exhaustive]
7858#[derive(Clone, PartialEq, ::prost::Message)]
7859pub struct CommandResult {
7860 #[prost(message, repeated, tag = "1")]
7861 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
7862 #[prost(message, repeated, tag = "2")]
7863 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
7864}
7865#[non_exhaustive]
7866#[derive(Clone, PartialEq, ::prost::Message)]
7867pub struct CommandOutput {
7868 #[prost(message, optional, tag = "1")]
7869 pub argument: ::core::option::Option<Argument>,
7870 #[prost(message, optional, tag = "2")]
7871 pub value: ::core::option::Option<Bcs>,
7872 #[prost(message, optional, boxed, tag = "3")]
7874 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
7875}
7876pub mod transaction_execution_service_client {
7878 #![allow(
7879 unused_variables,
7880 dead_code,
7881 missing_docs,
7882 clippy::wildcard_imports,
7883 clippy::let_unit_value,
7884 )]
7885 use tonic::codegen::*;
7886 use tonic::codegen::http::Uri;
7887 #[derive(Debug, Clone)]
7888 pub struct TransactionExecutionServiceClient<T> {
7889 inner: tonic::client::Grpc<T>,
7890 }
7891 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
7892 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7894 where
7895 D: TryInto<tonic::transport::Endpoint>,
7896 D::Error: Into<StdError>,
7897 {
7898 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7899 Ok(Self::new(conn))
7900 }
7901 }
7902 impl<T> TransactionExecutionServiceClient<T>
7903 where
7904 T: tonic::client::GrpcService<tonic::body::Body>,
7905 T::Error: Into<StdError>,
7906 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7907 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7908 {
7909 pub fn new(inner: T) -> Self {
7910 let inner = tonic::client::Grpc::new(inner);
7911 Self { inner }
7912 }
7913 pub fn with_origin(inner: T, origin: Uri) -> Self {
7914 let inner = tonic::client::Grpc::with_origin(inner, origin);
7915 Self { inner }
7916 }
7917 pub fn with_interceptor<F>(
7918 inner: T,
7919 interceptor: F,
7920 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
7921 where
7922 F: tonic::service::Interceptor,
7923 T::ResponseBody: Default,
7924 T: tonic::codegen::Service<
7925 http::Request<tonic::body::Body>,
7926 Response = http::Response<
7927 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7928 >,
7929 >,
7930 <T as tonic::codegen::Service<
7931 http::Request<tonic::body::Body>,
7932 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7933 {
7934 TransactionExecutionServiceClient::new(
7935 InterceptedService::new(inner, interceptor),
7936 )
7937 }
7938 #[must_use]
7943 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7944 self.inner = self.inner.send_compressed(encoding);
7945 self
7946 }
7947 #[must_use]
7949 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7950 self.inner = self.inner.accept_compressed(encoding);
7951 self
7952 }
7953 #[must_use]
7957 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7958 self.inner = self.inner.max_decoding_message_size(limit);
7959 self
7960 }
7961 #[must_use]
7965 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7966 self.inner = self.inner.max_encoding_message_size(limit);
7967 self
7968 }
7969 pub async fn execute_transaction(
7970 &mut self,
7971 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
7972 ) -> std::result::Result<
7973 tonic::Response<super::ExecuteTransactionResponse>,
7974 tonic::Status,
7975 > {
7976 self.inner
7977 .ready()
7978 .await
7979 .map_err(|e| {
7980 tonic::Status::unknown(
7981 format!("Service was not ready: {}", e.into()),
7982 )
7983 })?;
7984 let codec = tonic_prost::ProstCodec::default();
7985 let path = http::uri::PathAndQuery::from_static(
7986 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
7987 );
7988 let mut req = request.into_request();
7989 req.extensions_mut()
7990 .insert(
7991 GrpcMethod::new(
7992 "sui.rpc.v2.TransactionExecutionService",
7993 "ExecuteTransaction",
7994 ),
7995 );
7996 self.inner.unary(req, path, codec).await
7997 }
7998 pub async fn simulate_transaction(
7999 &mut self,
8000 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
8001 ) -> std::result::Result<
8002 tonic::Response<super::SimulateTransactionResponse>,
8003 tonic::Status,
8004 > {
8005 self.inner
8006 .ready()
8007 .await
8008 .map_err(|e| {
8009 tonic::Status::unknown(
8010 format!("Service was not ready: {}", e.into()),
8011 )
8012 })?;
8013 let codec = tonic_prost::ProstCodec::default();
8014 let path = http::uri::PathAndQuery::from_static(
8015 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
8016 );
8017 let mut req = request.into_request();
8018 req.extensions_mut()
8019 .insert(
8020 GrpcMethod::new(
8021 "sui.rpc.v2.TransactionExecutionService",
8022 "SimulateTransaction",
8023 ),
8024 );
8025 self.inner.unary(req, path, codec).await
8026 }
8027 }
8028}
8029pub mod transaction_execution_service_server {
8031 #![allow(
8032 unused_variables,
8033 dead_code,
8034 missing_docs,
8035 clippy::wildcard_imports,
8036 clippy::let_unit_value,
8037 )]
8038 use tonic::codegen::*;
8039 #[async_trait]
8041 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
8042 async fn execute_transaction(
8043 &self,
8044 request: tonic::Request<super::ExecuteTransactionRequest>,
8045 ) -> std::result::Result<
8046 tonic::Response<super::ExecuteTransactionResponse>,
8047 tonic::Status,
8048 >;
8049 async fn simulate_transaction(
8050 &self,
8051 request: tonic::Request<super::SimulateTransactionRequest>,
8052 ) -> std::result::Result<
8053 tonic::Response<super::SimulateTransactionResponse>,
8054 tonic::Status,
8055 >;
8056 }
8057 #[derive(Debug)]
8058 pub struct TransactionExecutionServiceServer<T> {
8059 inner: Arc<T>,
8060 accept_compression_encodings: EnabledCompressionEncodings,
8061 send_compression_encodings: EnabledCompressionEncodings,
8062 max_decoding_message_size: Option<usize>,
8063 max_encoding_message_size: Option<usize>,
8064 }
8065 impl<T> TransactionExecutionServiceServer<T> {
8066 pub fn new(inner: T) -> Self {
8067 Self::from_arc(Arc::new(inner))
8068 }
8069 pub fn from_arc(inner: Arc<T>) -> Self {
8070 Self {
8071 inner,
8072 accept_compression_encodings: Default::default(),
8073 send_compression_encodings: Default::default(),
8074 max_decoding_message_size: None,
8075 max_encoding_message_size: None,
8076 }
8077 }
8078 pub fn with_interceptor<F>(
8079 inner: T,
8080 interceptor: F,
8081 ) -> InterceptedService<Self, F>
8082 where
8083 F: tonic::service::Interceptor,
8084 {
8085 InterceptedService::new(Self::new(inner), interceptor)
8086 }
8087 #[must_use]
8089 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8090 self.accept_compression_encodings.enable(encoding);
8091 self
8092 }
8093 #[must_use]
8095 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8096 self.send_compression_encodings.enable(encoding);
8097 self
8098 }
8099 #[must_use]
8103 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8104 self.max_decoding_message_size = Some(limit);
8105 self
8106 }
8107 #[must_use]
8111 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8112 self.max_encoding_message_size = Some(limit);
8113 self
8114 }
8115 }
8116 impl<T, B> tonic::codegen::Service<http::Request<B>>
8117 for TransactionExecutionServiceServer<T>
8118 where
8119 T: TransactionExecutionService,
8120 B: Body + std::marker::Send + 'static,
8121 B::Error: Into<StdError> + std::marker::Send + 'static,
8122 {
8123 type Response = http::Response<tonic::body::Body>;
8124 type Error = std::convert::Infallible;
8125 type Future = BoxFuture<Self::Response, Self::Error>;
8126 fn poll_ready(
8127 &mut self,
8128 _cx: &mut Context<'_>,
8129 ) -> Poll<std::result::Result<(), Self::Error>> {
8130 Poll::Ready(Ok(()))
8131 }
8132 fn call(&mut self, req: http::Request<B>) -> Self::Future {
8133 match req.uri().path() {
8134 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
8135 #[allow(non_camel_case_types)]
8136 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
8137 pub Arc<T>,
8138 );
8139 impl<
8140 T: TransactionExecutionService,
8141 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
8142 for ExecuteTransactionSvc<T> {
8143 type Response = super::ExecuteTransactionResponse;
8144 type Future = BoxFuture<
8145 tonic::Response<Self::Response>,
8146 tonic::Status,
8147 >;
8148 fn call(
8149 &mut self,
8150 request: tonic::Request<super::ExecuteTransactionRequest>,
8151 ) -> Self::Future {
8152 let inner = Arc::clone(&self.0);
8153 let fut = async move {
8154 <T as TransactionExecutionService>::execute_transaction(
8155 &inner,
8156 request,
8157 )
8158 .await
8159 };
8160 Box::pin(fut)
8161 }
8162 }
8163 let accept_compression_encodings = self.accept_compression_encodings;
8164 let send_compression_encodings = self.send_compression_encodings;
8165 let max_decoding_message_size = self.max_decoding_message_size;
8166 let max_encoding_message_size = self.max_encoding_message_size;
8167 let inner = self.inner.clone();
8168 let fut = async move {
8169 let method = ExecuteTransactionSvc(inner);
8170 let codec = tonic_prost::ProstCodec::default();
8171 let mut grpc = tonic::server::Grpc::new(codec)
8172 .apply_compression_config(
8173 accept_compression_encodings,
8174 send_compression_encodings,
8175 )
8176 .apply_max_message_size_config(
8177 max_decoding_message_size,
8178 max_encoding_message_size,
8179 );
8180 let res = grpc.unary(method, req).await;
8181 Ok(res)
8182 };
8183 Box::pin(fut)
8184 }
8185 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
8186 #[allow(non_camel_case_types)]
8187 struct SimulateTransactionSvc<T: TransactionExecutionService>(
8188 pub Arc<T>,
8189 );
8190 impl<
8191 T: TransactionExecutionService,
8192 > tonic::server::UnaryService<super::SimulateTransactionRequest>
8193 for SimulateTransactionSvc<T> {
8194 type Response = super::SimulateTransactionResponse;
8195 type Future = BoxFuture<
8196 tonic::Response<Self::Response>,
8197 tonic::Status,
8198 >;
8199 fn call(
8200 &mut self,
8201 request: tonic::Request<super::SimulateTransactionRequest>,
8202 ) -> Self::Future {
8203 let inner = Arc::clone(&self.0);
8204 let fut = async move {
8205 <T as TransactionExecutionService>::simulate_transaction(
8206 &inner,
8207 request,
8208 )
8209 .await
8210 };
8211 Box::pin(fut)
8212 }
8213 }
8214 let accept_compression_encodings = self.accept_compression_encodings;
8215 let send_compression_encodings = self.send_compression_encodings;
8216 let max_decoding_message_size = self.max_decoding_message_size;
8217 let max_encoding_message_size = self.max_encoding_message_size;
8218 let inner = self.inner.clone();
8219 let fut = async move {
8220 let method = SimulateTransactionSvc(inner);
8221 let codec = tonic_prost::ProstCodec::default();
8222 let mut grpc = tonic::server::Grpc::new(codec)
8223 .apply_compression_config(
8224 accept_compression_encodings,
8225 send_compression_encodings,
8226 )
8227 .apply_max_message_size_config(
8228 max_decoding_message_size,
8229 max_encoding_message_size,
8230 );
8231 let res = grpc.unary(method, req).await;
8232 Ok(res)
8233 };
8234 Box::pin(fut)
8235 }
8236 _ => {
8237 Box::pin(async move {
8238 let mut response = http::Response::new(
8239 tonic::body::Body::default(),
8240 );
8241 let headers = response.headers_mut();
8242 headers
8243 .insert(
8244 tonic::Status::GRPC_STATUS,
8245 (tonic::Code::Unimplemented as i32).into(),
8246 );
8247 headers
8248 .insert(
8249 http::header::CONTENT_TYPE,
8250 tonic::metadata::GRPC_CONTENT_TYPE,
8251 );
8252 Ok(response)
8253 })
8254 }
8255 }
8256 }
8257 }
8258 impl<T> Clone for TransactionExecutionServiceServer<T> {
8259 fn clone(&self) -> Self {
8260 let inner = self.inner.clone();
8261 Self {
8262 inner,
8263 accept_compression_encodings: self.accept_compression_encodings,
8264 send_compression_encodings: self.send_compression_encodings,
8265 max_decoding_message_size: self.max_decoding_message_size,
8266 max_encoding_message_size: self.max_encoding_message_size,
8267 }
8268 }
8269 }
8270 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
8272 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
8273 const NAME: &'static str = SERVICE_NAME;
8274 }
8275}