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")]
5425 pub balance: ::core::option::Option<u64>,
5426}
5427#[non_exhaustive]
5429#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5430pub struct ListDynamicFieldsRequest {
5431 #[prost(string, optional, tag = "1")]
5433 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5434 #[prost(uint32, optional, tag = "2")]
5438 pub page_size: ::core::option::Option<u32>,
5439 #[prost(bytes = "bytes", optional, tag = "3")]
5445 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5446 #[prost(message, optional, tag = "4")]
5449 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5450}
5451#[non_exhaustive]
5453#[derive(Clone, PartialEq, ::prost::Message)]
5454pub struct ListDynamicFieldsResponse {
5455 #[prost(message, repeated, tag = "1")]
5457 pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
5458 #[prost(bytes = "bytes", optional, tag = "2")]
5461 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5462}
5463#[non_exhaustive]
5464#[derive(Clone, PartialEq, ::prost::Message)]
5465pub struct DynamicField {
5466 #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
5467 pub kind: ::core::option::Option<i32>,
5468 #[prost(string, optional, tag = "2")]
5470 pub parent: ::core::option::Option<::prost::alloc::string::String>,
5471 #[prost(string, optional, tag = "3")]
5473 pub field_id: ::core::option::Option<::prost::alloc::string::String>,
5474 #[prost(message, optional, tag = "4")]
5476 pub field_object: ::core::option::Option<Object>,
5477 #[prost(message, optional, tag = "5")]
5479 pub name: ::core::option::Option<Bcs>,
5480 #[prost(message, optional, tag = "6")]
5482 pub value: ::core::option::Option<Bcs>,
5483 #[prost(string, optional, tag = "7")]
5489 pub value_type: ::core::option::Option<::prost::alloc::string::String>,
5490 #[prost(string, optional, tag = "8")]
5496 pub child_id: ::core::option::Option<::prost::alloc::string::String>,
5497 #[prost(message, optional, tag = "9")]
5499 pub child_object: ::core::option::Option<Object>,
5500}
5501pub mod dynamic_field {
5503 #[non_exhaustive]
5504 #[derive(
5505 Clone,
5506 Copy,
5507 Debug,
5508 PartialEq,
5509 Eq,
5510 Hash,
5511 PartialOrd,
5512 Ord,
5513 ::prost::Enumeration
5514 )]
5515 #[repr(i32)]
5516 pub enum DynamicFieldKind {
5517 Unknown = 0,
5518 Field = 1,
5519 Object = 2,
5520 }
5521 impl DynamicFieldKind {
5522 pub fn as_str_name(&self) -> &'static str {
5527 match self {
5528 Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
5529 Self::Field => "FIELD",
5530 Self::Object => "OBJECT",
5531 }
5532 }
5533 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5535 match value {
5536 "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
5537 "FIELD" => Some(Self::Field),
5538 "OBJECT" => Some(Self::Object),
5539 _ => None,
5540 }
5541 }
5542 }
5543}
5544#[non_exhaustive]
5545#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5546pub struct ListOwnedObjectsRequest {
5547 #[prost(string, optional, tag = "1")]
5549 pub owner: ::core::option::Option<::prost::alloc::string::String>,
5550 #[prost(uint32, optional, tag = "2")]
5554 pub page_size: ::core::option::Option<u32>,
5555 #[prost(bytes = "bytes", optional, tag = "3")]
5561 pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5562 #[prost(message, optional, tag = "4")]
5565 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5566 #[prost(string, optional, tag = "5")]
5575 pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5576}
5577#[non_exhaustive]
5578#[derive(Clone, PartialEq, ::prost::Message)]
5579pub struct ListOwnedObjectsResponse {
5580 #[prost(message, repeated, tag = "1")]
5582 pub objects: ::prost::alloc::vec::Vec<Object>,
5583 #[prost(bytes = "bytes", optional, tag = "2")]
5586 pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5587}
5588pub mod state_service_client {
5590 #![allow(
5591 unused_variables,
5592 dead_code,
5593 missing_docs,
5594 clippy::wildcard_imports,
5595 clippy::let_unit_value,
5596 )]
5597 use tonic::codegen::*;
5598 use tonic::codegen::http::Uri;
5599 #[derive(Debug, Clone)]
5600 pub struct StateServiceClient<T> {
5601 inner: tonic::client::Grpc<T>,
5602 }
5603 impl StateServiceClient<tonic::transport::Channel> {
5604 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5606 where
5607 D: TryInto<tonic::transport::Endpoint>,
5608 D::Error: Into<StdError>,
5609 {
5610 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5611 Ok(Self::new(conn))
5612 }
5613 }
5614 impl<T> StateServiceClient<T>
5615 where
5616 T: tonic::client::GrpcService<tonic::body::Body>,
5617 T::Error: Into<StdError>,
5618 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5619 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5620 {
5621 pub fn new(inner: T) -> Self {
5622 let inner = tonic::client::Grpc::new(inner);
5623 Self { inner }
5624 }
5625 pub fn with_origin(inner: T, origin: Uri) -> Self {
5626 let inner = tonic::client::Grpc::with_origin(inner, origin);
5627 Self { inner }
5628 }
5629 pub fn with_interceptor<F>(
5630 inner: T,
5631 interceptor: F,
5632 ) -> StateServiceClient<InterceptedService<T, F>>
5633 where
5634 F: tonic::service::Interceptor,
5635 T::ResponseBody: Default,
5636 T: tonic::codegen::Service<
5637 http::Request<tonic::body::Body>,
5638 Response = http::Response<
5639 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5640 >,
5641 >,
5642 <T as tonic::codegen::Service<
5643 http::Request<tonic::body::Body>,
5644 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5645 {
5646 StateServiceClient::new(InterceptedService::new(inner, interceptor))
5647 }
5648 #[must_use]
5653 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5654 self.inner = self.inner.send_compressed(encoding);
5655 self
5656 }
5657 #[must_use]
5659 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5660 self.inner = self.inner.accept_compressed(encoding);
5661 self
5662 }
5663 #[must_use]
5667 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5668 self.inner = self.inner.max_decoding_message_size(limit);
5669 self
5670 }
5671 #[must_use]
5675 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5676 self.inner = self.inner.max_encoding_message_size(limit);
5677 self
5678 }
5679 pub async fn list_dynamic_fields(
5680 &mut self,
5681 request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
5682 ) -> std::result::Result<
5683 tonic::Response<super::ListDynamicFieldsResponse>,
5684 tonic::Status,
5685 > {
5686 self.inner
5687 .ready()
5688 .await
5689 .map_err(|e| {
5690 tonic::Status::unknown(
5691 format!("Service was not ready: {}", e.into()),
5692 )
5693 })?;
5694 let codec = tonic_prost::ProstCodec::default();
5695 let path = http::uri::PathAndQuery::from_static(
5696 "/sui.rpc.v2.StateService/ListDynamicFields",
5697 );
5698 let mut req = request.into_request();
5699 req.extensions_mut()
5700 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
5701 self.inner.unary(req, path, codec).await
5702 }
5703 pub async fn list_owned_objects(
5704 &mut self,
5705 request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
5706 ) -> std::result::Result<
5707 tonic::Response<super::ListOwnedObjectsResponse>,
5708 tonic::Status,
5709 > {
5710 self.inner
5711 .ready()
5712 .await
5713 .map_err(|e| {
5714 tonic::Status::unknown(
5715 format!("Service was not ready: {}", e.into()),
5716 )
5717 })?;
5718 let codec = tonic_prost::ProstCodec::default();
5719 let path = http::uri::PathAndQuery::from_static(
5720 "/sui.rpc.v2.StateService/ListOwnedObjects",
5721 );
5722 let mut req = request.into_request();
5723 req.extensions_mut()
5724 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
5725 self.inner.unary(req, path, codec).await
5726 }
5727 pub async fn get_coin_info(
5728 &mut self,
5729 request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
5730 ) -> std::result::Result<
5731 tonic::Response<super::GetCoinInfoResponse>,
5732 tonic::Status,
5733 > {
5734 self.inner
5735 .ready()
5736 .await
5737 .map_err(|e| {
5738 tonic::Status::unknown(
5739 format!("Service was not ready: {}", e.into()),
5740 )
5741 })?;
5742 let codec = tonic_prost::ProstCodec::default();
5743 let path = http::uri::PathAndQuery::from_static(
5744 "/sui.rpc.v2.StateService/GetCoinInfo",
5745 );
5746 let mut req = request.into_request();
5747 req.extensions_mut()
5748 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
5749 self.inner.unary(req, path, codec).await
5750 }
5751 pub async fn get_balance(
5752 &mut self,
5753 request: impl tonic::IntoRequest<super::GetBalanceRequest>,
5754 ) -> std::result::Result<
5755 tonic::Response<super::GetBalanceResponse>,
5756 tonic::Status,
5757 > {
5758 self.inner
5759 .ready()
5760 .await
5761 .map_err(|e| {
5762 tonic::Status::unknown(
5763 format!("Service was not ready: {}", e.into()),
5764 )
5765 })?;
5766 let codec = tonic_prost::ProstCodec::default();
5767 let path = http::uri::PathAndQuery::from_static(
5768 "/sui.rpc.v2.StateService/GetBalance",
5769 );
5770 let mut req = request.into_request();
5771 req.extensions_mut()
5772 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
5773 self.inner.unary(req, path, codec).await
5774 }
5775 pub async fn list_balances(
5776 &mut self,
5777 request: impl tonic::IntoRequest<super::ListBalancesRequest>,
5778 ) -> std::result::Result<
5779 tonic::Response<super::ListBalancesResponse>,
5780 tonic::Status,
5781 > {
5782 self.inner
5783 .ready()
5784 .await
5785 .map_err(|e| {
5786 tonic::Status::unknown(
5787 format!("Service was not ready: {}", e.into()),
5788 )
5789 })?;
5790 let codec = tonic_prost::ProstCodec::default();
5791 let path = http::uri::PathAndQuery::from_static(
5792 "/sui.rpc.v2.StateService/ListBalances",
5793 );
5794 let mut req = request.into_request();
5795 req.extensions_mut()
5796 .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
5797 self.inner.unary(req, path, codec).await
5798 }
5799 }
5800}
5801pub mod state_service_server {
5803 #![allow(
5804 unused_variables,
5805 dead_code,
5806 missing_docs,
5807 clippy::wildcard_imports,
5808 clippy::let_unit_value,
5809 )]
5810 use tonic::codegen::*;
5811 #[async_trait]
5813 pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
5814 async fn list_dynamic_fields(
5815 &self,
5816 request: tonic::Request<super::ListDynamicFieldsRequest>,
5817 ) -> std::result::Result<
5818 tonic::Response<super::ListDynamicFieldsResponse>,
5819 tonic::Status,
5820 >;
5821 async fn list_owned_objects(
5822 &self,
5823 request: tonic::Request<super::ListOwnedObjectsRequest>,
5824 ) -> std::result::Result<
5825 tonic::Response<super::ListOwnedObjectsResponse>,
5826 tonic::Status,
5827 >;
5828 async fn get_coin_info(
5829 &self,
5830 request: tonic::Request<super::GetCoinInfoRequest>,
5831 ) -> std::result::Result<
5832 tonic::Response<super::GetCoinInfoResponse>,
5833 tonic::Status,
5834 >;
5835 async fn get_balance(
5836 &self,
5837 request: tonic::Request<super::GetBalanceRequest>,
5838 ) -> std::result::Result<
5839 tonic::Response<super::GetBalanceResponse>,
5840 tonic::Status,
5841 >;
5842 async fn list_balances(
5843 &self,
5844 request: tonic::Request<super::ListBalancesRequest>,
5845 ) -> std::result::Result<
5846 tonic::Response<super::ListBalancesResponse>,
5847 tonic::Status,
5848 >;
5849 }
5850 #[derive(Debug)]
5851 pub struct StateServiceServer<T> {
5852 inner: Arc<T>,
5853 accept_compression_encodings: EnabledCompressionEncodings,
5854 send_compression_encodings: EnabledCompressionEncodings,
5855 max_decoding_message_size: Option<usize>,
5856 max_encoding_message_size: Option<usize>,
5857 }
5858 impl<T> StateServiceServer<T> {
5859 pub fn new(inner: T) -> Self {
5860 Self::from_arc(Arc::new(inner))
5861 }
5862 pub fn from_arc(inner: Arc<T>) -> Self {
5863 Self {
5864 inner,
5865 accept_compression_encodings: Default::default(),
5866 send_compression_encodings: Default::default(),
5867 max_decoding_message_size: None,
5868 max_encoding_message_size: None,
5869 }
5870 }
5871 pub fn with_interceptor<F>(
5872 inner: T,
5873 interceptor: F,
5874 ) -> InterceptedService<Self, F>
5875 where
5876 F: tonic::service::Interceptor,
5877 {
5878 InterceptedService::new(Self::new(inner), interceptor)
5879 }
5880 #[must_use]
5882 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5883 self.accept_compression_encodings.enable(encoding);
5884 self
5885 }
5886 #[must_use]
5888 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5889 self.send_compression_encodings.enable(encoding);
5890 self
5891 }
5892 #[must_use]
5896 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5897 self.max_decoding_message_size = Some(limit);
5898 self
5899 }
5900 #[must_use]
5904 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5905 self.max_encoding_message_size = Some(limit);
5906 self
5907 }
5908 }
5909 impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
5910 where
5911 T: StateService,
5912 B: Body + std::marker::Send + 'static,
5913 B::Error: Into<StdError> + std::marker::Send + 'static,
5914 {
5915 type Response = http::Response<tonic::body::Body>;
5916 type Error = std::convert::Infallible;
5917 type Future = BoxFuture<Self::Response, Self::Error>;
5918 fn poll_ready(
5919 &mut self,
5920 _cx: &mut Context<'_>,
5921 ) -> Poll<std::result::Result<(), Self::Error>> {
5922 Poll::Ready(Ok(()))
5923 }
5924 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5925 match req.uri().path() {
5926 "/sui.rpc.v2.StateService/ListDynamicFields" => {
5927 #[allow(non_camel_case_types)]
5928 struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
5929 impl<
5930 T: StateService,
5931 > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
5932 for ListDynamicFieldsSvc<T> {
5933 type Response = super::ListDynamicFieldsResponse;
5934 type Future = BoxFuture<
5935 tonic::Response<Self::Response>,
5936 tonic::Status,
5937 >;
5938 fn call(
5939 &mut self,
5940 request: tonic::Request<super::ListDynamicFieldsRequest>,
5941 ) -> Self::Future {
5942 let inner = Arc::clone(&self.0);
5943 let fut = async move {
5944 <T as StateService>::list_dynamic_fields(&inner, request)
5945 .await
5946 };
5947 Box::pin(fut)
5948 }
5949 }
5950 let accept_compression_encodings = self.accept_compression_encodings;
5951 let send_compression_encodings = self.send_compression_encodings;
5952 let max_decoding_message_size = self.max_decoding_message_size;
5953 let max_encoding_message_size = self.max_encoding_message_size;
5954 let inner = self.inner.clone();
5955 let fut = async move {
5956 let method = ListDynamicFieldsSvc(inner);
5957 let codec = tonic_prost::ProstCodec::default();
5958 let mut grpc = tonic::server::Grpc::new(codec)
5959 .apply_compression_config(
5960 accept_compression_encodings,
5961 send_compression_encodings,
5962 )
5963 .apply_max_message_size_config(
5964 max_decoding_message_size,
5965 max_encoding_message_size,
5966 );
5967 let res = grpc.unary(method, req).await;
5968 Ok(res)
5969 };
5970 Box::pin(fut)
5971 }
5972 "/sui.rpc.v2.StateService/ListOwnedObjects" => {
5973 #[allow(non_camel_case_types)]
5974 struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
5975 impl<
5976 T: StateService,
5977 > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
5978 for ListOwnedObjectsSvc<T> {
5979 type Response = super::ListOwnedObjectsResponse;
5980 type Future = BoxFuture<
5981 tonic::Response<Self::Response>,
5982 tonic::Status,
5983 >;
5984 fn call(
5985 &mut self,
5986 request: tonic::Request<super::ListOwnedObjectsRequest>,
5987 ) -> Self::Future {
5988 let inner = Arc::clone(&self.0);
5989 let fut = async move {
5990 <T as StateService>::list_owned_objects(&inner, request)
5991 .await
5992 };
5993 Box::pin(fut)
5994 }
5995 }
5996 let accept_compression_encodings = self.accept_compression_encodings;
5997 let send_compression_encodings = self.send_compression_encodings;
5998 let max_decoding_message_size = self.max_decoding_message_size;
5999 let max_encoding_message_size = self.max_encoding_message_size;
6000 let inner = self.inner.clone();
6001 let fut = async move {
6002 let method = ListOwnedObjectsSvc(inner);
6003 let codec = tonic_prost::ProstCodec::default();
6004 let mut grpc = tonic::server::Grpc::new(codec)
6005 .apply_compression_config(
6006 accept_compression_encodings,
6007 send_compression_encodings,
6008 )
6009 .apply_max_message_size_config(
6010 max_decoding_message_size,
6011 max_encoding_message_size,
6012 );
6013 let res = grpc.unary(method, req).await;
6014 Ok(res)
6015 };
6016 Box::pin(fut)
6017 }
6018 "/sui.rpc.v2.StateService/GetCoinInfo" => {
6019 #[allow(non_camel_case_types)]
6020 struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
6021 impl<
6022 T: StateService,
6023 > tonic::server::UnaryService<super::GetCoinInfoRequest>
6024 for GetCoinInfoSvc<T> {
6025 type Response = super::GetCoinInfoResponse;
6026 type Future = BoxFuture<
6027 tonic::Response<Self::Response>,
6028 tonic::Status,
6029 >;
6030 fn call(
6031 &mut self,
6032 request: tonic::Request<super::GetCoinInfoRequest>,
6033 ) -> Self::Future {
6034 let inner = Arc::clone(&self.0);
6035 let fut = async move {
6036 <T as StateService>::get_coin_info(&inner, request).await
6037 };
6038 Box::pin(fut)
6039 }
6040 }
6041 let accept_compression_encodings = self.accept_compression_encodings;
6042 let send_compression_encodings = self.send_compression_encodings;
6043 let max_decoding_message_size = self.max_decoding_message_size;
6044 let max_encoding_message_size = self.max_encoding_message_size;
6045 let inner = self.inner.clone();
6046 let fut = async move {
6047 let method = GetCoinInfoSvc(inner);
6048 let codec = tonic_prost::ProstCodec::default();
6049 let mut grpc = tonic::server::Grpc::new(codec)
6050 .apply_compression_config(
6051 accept_compression_encodings,
6052 send_compression_encodings,
6053 )
6054 .apply_max_message_size_config(
6055 max_decoding_message_size,
6056 max_encoding_message_size,
6057 );
6058 let res = grpc.unary(method, req).await;
6059 Ok(res)
6060 };
6061 Box::pin(fut)
6062 }
6063 "/sui.rpc.v2.StateService/GetBalance" => {
6064 #[allow(non_camel_case_types)]
6065 struct GetBalanceSvc<T: StateService>(pub Arc<T>);
6066 impl<
6067 T: StateService,
6068 > tonic::server::UnaryService<super::GetBalanceRequest>
6069 for GetBalanceSvc<T> {
6070 type Response = super::GetBalanceResponse;
6071 type Future = BoxFuture<
6072 tonic::Response<Self::Response>,
6073 tonic::Status,
6074 >;
6075 fn call(
6076 &mut self,
6077 request: tonic::Request<super::GetBalanceRequest>,
6078 ) -> Self::Future {
6079 let inner = Arc::clone(&self.0);
6080 let fut = async move {
6081 <T as StateService>::get_balance(&inner, request).await
6082 };
6083 Box::pin(fut)
6084 }
6085 }
6086 let accept_compression_encodings = self.accept_compression_encodings;
6087 let send_compression_encodings = self.send_compression_encodings;
6088 let max_decoding_message_size = self.max_decoding_message_size;
6089 let max_encoding_message_size = self.max_encoding_message_size;
6090 let inner = self.inner.clone();
6091 let fut = async move {
6092 let method = GetBalanceSvc(inner);
6093 let codec = tonic_prost::ProstCodec::default();
6094 let mut grpc = tonic::server::Grpc::new(codec)
6095 .apply_compression_config(
6096 accept_compression_encodings,
6097 send_compression_encodings,
6098 )
6099 .apply_max_message_size_config(
6100 max_decoding_message_size,
6101 max_encoding_message_size,
6102 );
6103 let res = grpc.unary(method, req).await;
6104 Ok(res)
6105 };
6106 Box::pin(fut)
6107 }
6108 "/sui.rpc.v2.StateService/ListBalances" => {
6109 #[allow(non_camel_case_types)]
6110 struct ListBalancesSvc<T: StateService>(pub Arc<T>);
6111 impl<
6112 T: StateService,
6113 > tonic::server::UnaryService<super::ListBalancesRequest>
6114 for ListBalancesSvc<T> {
6115 type Response = super::ListBalancesResponse;
6116 type Future = BoxFuture<
6117 tonic::Response<Self::Response>,
6118 tonic::Status,
6119 >;
6120 fn call(
6121 &mut self,
6122 request: tonic::Request<super::ListBalancesRequest>,
6123 ) -> Self::Future {
6124 let inner = Arc::clone(&self.0);
6125 let fut = async move {
6126 <T as StateService>::list_balances(&inner, request).await
6127 };
6128 Box::pin(fut)
6129 }
6130 }
6131 let accept_compression_encodings = self.accept_compression_encodings;
6132 let send_compression_encodings = self.send_compression_encodings;
6133 let max_decoding_message_size = self.max_decoding_message_size;
6134 let max_encoding_message_size = self.max_encoding_message_size;
6135 let inner = self.inner.clone();
6136 let fut = async move {
6137 let method = ListBalancesSvc(inner);
6138 let codec = tonic_prost::ProstCodec::default();
6139 let mut grpc = tonic::server::Grpc::new(codec)
6140 .apply_compression_config(
6141 accept_compression_encodings,
6142 send_compression_encodings,
6143 )
6144 .apply_max_message_size_config(
6145 max_decoding_message_size,
6146 max_encoding_message_size,
6147 );
6148 let res = grpc.unary(method, req).await;
6149 Ok(res)
6150 };
6151 Box::pin(fut)
6152 }
6153 _ => {
6154 Box::pin(async move {
6155 let mut response = http::Response::new(
6156 tonic::body::Body::default(),
6157 );
6158 let headers = response.headers_mut();
6159 headers
6160 .insert(
6161 tonic::Status::GRPC_STATUS,
6162 (tonic::Code::Unimplemented as i32).into(),
6163 );
6164 headers
6165 .insert(
6166 http::header::CONTENT_TYPE,
6167 tonic::metadata::GRPC_CONTENT_TYPE,
6168 );
6169 Ok(response)
6170 })
6171 }
6172 }
6173 }
6174 }
6175 impl<T> Clone for StateServiceServer<T> {
6176 fn clone(&self) -> Self {
6177 let inner = self.inner.clone();
6178 Self {
6179 inner,
6180 accept_compression_encodings: self.accept_compression_encodings,
6181 send_compression_encodings: self.send_compression_encodings,
6182 max_decoding_message_size: self.max_decoding_message_size,
6183 max_encoding_message_size: self.max_encoding_message_size,
6184 }
6185 }
6186 }
6187 pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
6189 impl<T> tonic::server::NamedService for StateServiceServer<T> {
6190 const NAME: &'static str = SERVICE_NAME;
6191 }
6192}
6193#[non_exhaustive]
6195#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6196pub struct SubscribeCheckpointsRequest {
6197 #[prost(message, optional, tag = "1")]
6200 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6201}
6202#[non_exhaustive]
6204#[derive(Clone, PartialEq, ::prost::Message)]
6205pub struct SubscribeCheckpointsResponse {
6206 #[prost(uint64, optional, tag = "1")]
6209 pub cursor: ::core::option::Option<u64>,
6210 #[prost(message, optional, tag = "2")]
6212 pub checkpoint: ::core::option::Option<Checkpoint>,
6213}
6214pub mod subscription_service_client {
6216 #![allow(
6217 unused_variables,
6218 dead_code,
6219 missing_docs,
6220 clippy::wildcard_imports,
6221 clippy::let_unit_value,
6222 )]
6223 use tonic::codegen::*;
6224 use tonic::codegen::http::Uri;
6225 #[derive(Debug, Clone)]
6226 pub struct SubscriptionServiceClient<T> {
6227 inner: tonic::client::Grpc<T>,
6228 }
6229 impl SubscriptionServiceClient<tonic::transport::Channel> {
6230 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6232 where
6233 D: TryInto<tonic::transport::Endpoint>,
6234 D::Error: Into<StdError>,
6235 {
6236 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6237 Ok(Self::new(conn))
6238 }
6239 }
6240 impl<T> SubscriptionServiceClient<T>
6241 where
6242 T: tonic::client::GrpcService<tonic::body::Body>,
6243 T::Error: Into<StdError>,
6244 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6245 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6246 {
6247 pub fn new(inner: T) -> Self {
6248 let inner = tonic::client::Grpc::new(inner);
6249 Self { inner }
6250 }
6251 pub fn with_origin(inner: T, origin: Uri) -> Self {
6252 let inner = tonic::client::Grpc::with_origin(inner, origin);
6253 Self { inner }
6254 }
6255 pub fn with_interceptor<F>(
6256 inner: T,
6257 interceptor: F,
6258 ) -> SubscriptionServiceClient<InterceptedService<T, F>>
6259 where
6260 F: tonic::service::Interceptor,
6261 T::ResponseBody: Default,
6262 T: tonic::codegen::Service<
6263 http::Request<tonic::body::Body>,
6264 Response = http::Response<
6265 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6266 >,
6267 >,
6268 <T as tonic::codegen::Service<
6269 http::Request<tonic::body::Body>,
6270 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6271 {
6272 SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
6273 }
6274 #[must_use]
6279 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6280 self.inner = self.inner.send_compressed(encoding);
6281 self
6282 }
6283 #[must_use]
6285 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6286 self.inner = self.inner.accept_compressed(encoding);
6287 self
6288 }
6289 #[must_use]
6293 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6294 self.inner = self.inner.max_decoding_message_size(limit);
6295 self
6296 }
6297 #[must_use]
6301 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6302 self.inner = self.inner.max_encoding_message_size(limit);
6303 self
6304 }
6305 pub async fn subscribe_checkpoints(
6317 &mut self,
6318 request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
6319 ) -> std::result::Result<
6320 tonic::Response<
6321 tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
6322 >,
6323 tonic::Status,
6324 > {
6325 self.inner
6326 .ready()
6327 .await
6328 .map_err(|e| {
6329 tonic::Status::unknown(
6330 format!("Service was not ready: {}", e.into()),
6331 )
6332 })?;
6333 let codec = tonic_prost::ProstCodec::default();
6334 let path = http::uri::PathAndQuery::from_static(
6335 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
6336 );
6337 let mut req = request.into_request();
6338 req.extensions_mut()
6339 .insert(
6340 GrpcMethod::new(
6341 "sui.rpc.v2.SubscriptionService",
6342 "SubscribeCheckpoints",
6343 ),
6344 );
6345 self.inner.server_streaming(req, path, codec).await
6346 }
6347 }
6348}
6349pub mod subscription_service_server {
6351 #![allow(
6352 unused_variables,
6353 dead_code,
6354 missing_docs,
6355 clippy::wildcard_imports,
6356 clippy::let_unit_value,
6357 )]
6358 use tonic::codegen::*;
6359 #[async_trait]
6361 pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
6362 type SubscribeCheckpointsStream: tonic::codegen::tokio_stream::Stream<
6364 Item = std::result::Result<
6365 super::SubscribeCheckpointsResponse,
6366 tonic::Status,
6367 >,
6368 >
6369 + std::marker::Send
6370 + 'static;
6371 async fn subscribe_checkpoints(
6383 &self,
6384 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6385 ) -> std::result::Result<
6386 tonic::Response<Self::SubscribeCheckpointsStream>,
6387 tonic::Status,
6388 >;
6389 }
6390 #[derive(Debug)]
6391 pub struct SubscriptionServiceServer<T> {
6392 inner: Arc<T>,
6393 accept_compression_encodings: EnabledCompressionEncodings,
6394 send_compression_encodings: EnabledCompressionEncodings,
6395 max_decoding_message_size: Option<usize>,
6396 max_encoding_message_size: Option<usize>,
6397 }
6398 impl<T> SubscriptionServiceServer<T> {
6399 pub fn new(inner: T) -> Self {
6400 Self::from_arc(Arc::new(inner))
6401 }
6402 pub fn from_arc(inner: Arc<T>) -> Self {
6403 Self {
6404 inner,
6405 accept_compression_encodings: Default::default(),
6406 send_compression_encodings: Default::default(),
6407 max_decoding_message_size: None,
6408 max_encoding_message_size: None,
6409 }
6410 }
6411 pub fn with_interceptor<F>(
6412 inner: T,
6413 interceptor: F,
6414 ) -> InterceptedService<Self, F>
6415 where
6416 F: tonic::service::Interceptor,
6417 {
6418 InterceptedService::new(Self::new(inner), interceptor)
6419 }
6420 #[must_use]
6422 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6423 self.accept_compression_encodings.enable(encoding);
6424 self
6425 }
6426 #[must_use]
6428 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6429 self.send_compression_encodings.enable(encoding);
6430 self
6431 }
6432 #[must_use]
6436 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6437 self.max_decoding_message_size = Some(limit);
6438 self
6439 }
6440 #[must_use]
6444 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6445 self.max_encoding_message_size = Some(limit);
6446 self
6447 }
6448 }
6449 impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
6450 where
6451 T: SubscriptionService,
6452 B: Body + std::marker::Send + 'static,
6453 B::Error: Into<StdError> + std::marker::Send + 'static,
6454 {
6455 type Response = http::Response<tonic::body::Body>;
6456 type Error = std::convert::Infallible;
6457 type Future = BoxFuture<Self::Response, Self::Error>;
6458 fn poll_ready(
6459 &mut self,
6460 _cx: &mut Context<'_>,
6461 ) -> Poll<std::result::Result<(), Self::Error>> {
6462 Poll::Ready(Ok(()))
6463 }
6464 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6465 match req.uri().path() {
6466 "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
6467 #[allow(non_camel_case_types)]
6468 struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
6469 impl<
6470 T: SubscriptionService,
6471 > tonic::server::ServerStreamingService<
6472 super::SubscribeCheckpointsRequest,
6473 > for SubscribeCheckpointsSvc<T> {
6474 type Response = super::SubscribeCheckpointsResponse;
6475 type ResponseStream = T::SubscribeCheckpointsStream;
6476 type Future = BoxFuture<
6477 tonic::Response<Self::ResponseStream>,
6478 tonic::Status,
6479 >;
6480 fn call(
6481 &mut self,
6482 request: tonic::Request<super::SubscribeCheckpointsRequest>,
6483 ) -> Self::Future {
6484 let inner = Arc::clone(&self.0);
6485 let fut = async move {
6486 <T as SubscriptionService>::subscribe_checkpoints(
6487 &inner,
6488 request,
6489 )
6490 .await
6491 };
6492 Box::pin(fut)
6493 }
6494 }
6495 let accept_compression_encodings = self.accept_compression_encodings;
6496 let send_compression_encodings = self.send_compression_encodings;
6497 let max_decoding_message_size = self.max_decoding_message_size;
6498 let max_encoding_message_size = self.max_encoding_message_size;
6499 let inner = self.inner.clone();
6500 let fut = async move {
6501 let method = SubscribeCheckpointsSvc(inner);
6502 let codec = tonic_prost::ProstCodec::default();
6503 let mut grpc = tonic::server::Grpc::new(codec)
6504 .apply_compression_config(
6505 accept_compression_encodings,
6506 send_compression_encodings,
6507 )
6508 .apply_max_message_size_config(
6509 max_decoding_message_size,
6510 max_encoding_message_size,
6511 );
6512 let res = grpc.server_streaming(method, req).await;
6513 Ok(res)
6514 };
6515 Box::pin(fut)
6516 }
6517 _ => {
6518 Box::pin(async move {
6519 let mut response = http::Response::new(
6520 tonic::body::Body::default(),
6521 );
6522 let headers = response.headers_mut();
6523 headers
6524 .insert(
6525 tonic::Status::GRPC_STATUS,
6526 (tonic::Code::Unimplemented as i32).into(),
6527 );
6528 headers
6529 .insert(
6530 http::header::CONTENT_TYPE,
6531 tonic::metadata::GRPC_CONTENT_TYPE,
6532 );
6533 Ok(response)
6534 })
6535 }
6536 }
6537 }
6538 }
6539 impl<T> Clone for SubscriptionServiceServer<T> {
6540 fn clone(&self) -> Self {
6541 let inner = self.inner.clone();
6542 Self {
6543 inner,
6544 accept_compression_encodings: self.accept_compression_encodings,
6545 send_compression_encodings: self.send_compression_encodings,
6546 max_decoding_message_size: self.max_decoding_message_size,
6547 max_encoding_message_size: self.max_encoding_message_size,
6548 }
6549 }
6550 }
6551 pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
6553 impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
6554 const NAME: &'static str = SERVICE_NAME;
6555 }
6556}
6557#[non_exhaustive]
6558#[derive(Clone, PartialEq, ::prost::Message)]
6559pub struct SystemState {
6560 #[prost(uint64, optional, tag = "1")]
6562 pub version: ::core::option::Option<u64>,
6563 #[prost(uint64, optional, tag = "2")]
6565 pub epoch: ::core::option::Option<u64>,
6566 #[prost(uint64, optional, tag = "3")]
6568 pub protocol_version: ::core::option::Option<u64>,
6569 #[prost(message, optional, tag = "4")]
6571 pub validators: ::core::option::Option<ValidatorSet>,
6572 #[prost(message, optional, tag = "5")]
6574 pub storage_fund: ::core::option::Option<StorageFund>,
6575 #[prost(message, optional, tag = "6")]
6577 pub parameters: ::core::option::Option<SystemParameters>,
6578 #[prost(uint64, optional, tag = "7")]
6580 pub reference_gas_price: ::core::option::Option<u64>,
6581 #[prost(message, repeated, tag = "8")]
6589 pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
6590 #[prost(message, optional, tag = "9")]
6592 pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
6593 #[prost(bool, optional, tag = "10")]
6600 pub safe_mode: ::core::option::Option<bool>,
6601 #[prost(uint64, optional, tag = "11")]
6603 pub safe_mode_storage_rewards: ::core::option::Option<u64>,
6604 #[prost(uint64, optional, tag = "12")]
6606 pub safe_mode_computation_rewards: ::core::option::Option<u64>,
6607 #[prost(uint64, optional, tag = "13")]
6609 pub safe_mode_storage_rebates: ::core::option::Option<u64>,
6610 #[prost(uint64, optional, tag = "14")]
6612 pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
6613 #[prost(uint64, optional, tag = "15")]
6615 pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
6616 #[prost(message, optional, tag = "16")]
6618 pub extra_fields: ::core::option::Option<MoveTable>,
6619}
6620#[non_exhaustive]
6621#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6622pub struct ValidatorReportRecord {
6623 #[prost(string, optional, tag = "1")]
6625 pub reported: ::core::option::Option<::prost::alloc::string::String>,
6626 #[prost(string, repeated, tag = "2")]
6628 pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6629}
6630#[non_exhaustive]
6631#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6632pub struct SystemParameters {
6633 #[prost(uint64, optional, tag = "1")]
6635 pub epoch_duration_ms: ::core::option::Option<u64>,
6636 #[prost(uint64, optional, tag = "2")]
6638 pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
6639 #[prost(uint64, optional, tag = "3")]
6641 pub min_validator_count: ::core::option::Option<u64>,
6642 #[prost(uint64, optional, tag = "4")]
6645 pub max_validator_count: ::core::option::Option<u64>,
6646 #[prost(uint64, optional, tag = "5")]
6649 pub min_validator_joining_stake: ::core::option::Option<u64>,
6650 #[prost(uint64, optional, tag = "6")]
6655 pub validator_low_stake_threshold: ::core::option::Option<u64>,
6656 #[prost(uint64, optional, tag = "7")]
6660 pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
6661 #[prost(uint64, optional, tag = "8")]
6664 pub validator_low_stake_grace_period: ::core::option::Option<u64>,
6665 #[prost(message, optional, tag = "9")]
6667 pub extra_fields: ::core::option::Option<MoveTable>,
6668}
6669#[non_exhaustive]
6671#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6672pub struct MoveTable {
6673 #[prost(string, optional, tag = "1")]
6675 pub id: ::core::option::Option<::prost::alloc::string::String>,
6676 #[prost(uint64, optional, tag = "2")]
6678 pub size: ::core::option::Option<u64>,
6679}
6680#[non_exhaustive]
6681#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6682pub struct StakeSubsidy {
6683 #[prost(uint64, optional, tag = "1")]
6685 pub balance: ::core::option::Option<u64>,
6686 #[prost(uint64, optional, tag = "2")]
6688 pub distribution_counter: ::core::option::Option<u64>,
6689 #[prost(uint64, optional, tag = "3")]
6692 pub current_distribution_amount: ::core::option::Option<u64>,
6693 #[prost(uint64, optional, tag = "4")]
6695 pub stake_subsidy_period_length: ::core::option::Option<u64>,
6696 #[prost(uint32, optional, tag = "5")]
6699 pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
6700 #[prost(message, optional, tag = "6")]
6702 pub extra_fields: ::core::option::Option<MoveTable>,
6703}
6704#[non_exhaustive]
6706#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6707pub struct StorageFund {
6708 #[prost(uint64, optional, tag = "1")]
6714 pub total_object_storage_rebates: ::core::option::Option<u64>,
6715 #[prost(uint64, optional, tag = "2")]
6718 pub non_refundable_balance: ::core::option::Option<u64>,
6719}
6720#[non_exhaustive]
6721#[derive(Clone, PartialEq, ::prost::Message)]
6722pub struct ValidatorSet {
6723 #[prost(uint64, optional, tag = "1")]
6726 pub total_stake: ::core::option::Option<u64>,
6727 #[prost(message, repeated, tag = "2")]
6729 pub active_validators: ::prost::alloc::vec::Vec<Validator>,
6730 #[prost(message, optional, tag = "3")]
6735 pub pending_active_validators: ::core::option::Option<MoveTable>,
6736 #[prost(uint64, repeated, tag = "4")]
6739 pub pending_removals: ::prost::alloc::vec::Vec<u64>,
6740 #[prost(message, optional, tag = "5")]
6744 pub staking_pool_mappings: ::core::option::Option<MoveTable>,
6745 #[prost(message, optional, tag = "6")]
6751 pub inactive_validators: ::core::option::Option<MoveTable>,
6752 #[prost(message, optional, tag = "7")]
6760 pub validator_candidates: ::core::option::Option<MoveTable>,
6761 #[prost(btree_map = "string, uint64", tag = "8")]
6763 pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
6764 ::prost::alloc::string::String,
6765 u64,
6766 >,
6767 #[prost(message, optional, tag = "9")]
6769 pub extra_fields: ::core::option::Option<MoveTable>,
6770}
6771#[non_exhaustive]
6775#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6776pub struct Validator {
6777 #[prost(string, optional, tag = "1")]
6779 pub name: ::core::option::Option<::prost::alloc::string::String>,
6780 #[prost(string, optional, tag = "2")]
6783 pub address: ::core::option::Option<::prost::alloc::string::String>,
6784 #[prost(string, optional, tag = "3")]
6785 pub description: ::core::option::Option<::prost::alloc::string::String>,
6786 #[prost(string, optional, tag = "4")]
6787 pub image_url: ::core::option::Option<::prost::alloc::string::String>,
6788 #[prost(string, optional, tag = "5")]
6789 pub project_url: ::core::option::Option<::prost::alloc::string::String>,
6790 #[prost(bytes = "bytes", optional, tag = "7")]
6793 pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6794 #[prost(bytes = "bytes", optional, tag = "8")]
6796 pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6797 #[prost(bytes = "bytes", optional, tag = "10")]
6800 pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6801 #[prost(bytes = "bytes", optional, tag = "12")]
6803 pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6804 #[prost(string, optional, tag = "13")]
6806 pub network_address: ::core::option::Option<::prost::alloc::string::String>,
6807 #[prost(string, optional, tag = "14")]
6809 pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6810 #[prost(string, optional, tag = "15")]
6812 pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
6813 #[prost(string, optional, tag = "16")]
6815 pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
6816 #[prost(bytes = "bytes", optional, tag = "18")]
6817 pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6818 #[prost(bytes = "bytes", optional, tag = "19")]
6819 pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6820 #[prost(bytes = "bytes", optional, tag = "21")]
6821 pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6822 #[prost(bytes = "bytes", optional, tag = "23")]
6823 pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6824 #[prost(string, optional, tag = "24")]
6825 pub next_epoch_network_address: ::core::option::Option<
6826 ::prost::alloc::string::String,
6827 >,
6828 #[prost(string, optional, tag = "25")]
6829 pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6830 #[prost(string, optional, tag = "26")]
6831 pub next_epoch_primary_address: ::core::option::Option<
6832 ::prost::alloc::string::String,
6833 >,
6834 #[prost(string, optional, tag = "27")]
6835 pub next_epoch_worker_address: ::core::option::Option<
6836 ::prost::alloc::string::String,
6837 >,
6838 #[prost(message, optional, tag = "28")]
6840 pub metadata_extra_fields: ::core::option::Option<MoveTable>,
6841 #[prost(uint64, optional, tag = "29")]
6844 pub voting_power: ::core::option::Option<u64>,
6845 #[prost(string, optional, tag = "30")]
6847 pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6848 #[prost(uint64, optional, tag = "31")]
6850 pub gas_price: ::core::option::Option<u64>,
6851 #[prost(message, optional, tag = "32")]
6853 pub staking_pool: ::core::option::Option<StakingPool>,
6854 #[prost(uint64, optional, tag = "33")]
6856 pub commission_rate: ::core::option::Option<u64>,
6857 #[prost(uint64, optional, tag = "34")]
6859 pub next_epoch_stake: ::core::option::Option<u64>,
6860 #[prost(uint64, optional, tag = "35")]
6862 pub next_epoch_gas_price: ::core::option::Option<u64>,
6863 #[prost(uint64, optional, tag = "36")]
6865 pub next_epoch_commission_rate: ::core::option::Option<u64>,
6866 #[prost(message, optional, tag = "37")]
6868 pub extra_fields: ::core::option::Option<MoveTable>,
6869}
6870#[non_exhaustive]
6872#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6873pub struct StakingPool {
6874 #[prost(string, optional, tag = "1")]
6876 pub id: ::core::option::Option<::prost::alloc::string::String>,
6877 #[prost(uint64, optional, tag = "2")]
6880 pub activation_epoch: ::core::option::Option<u64>,
6881 #[prost(uint64, optional, tag = "3")]
6884 pub deactivation_epoch: ::core::option::Option<u64>,
6885 #[prost(uint64, optional, tag = "4")]
6888 pub sui_balance: ::core::option::Option<u64>,
6889 #[prost(uint64, optional, tag = "5")]
6891 pub rewards_pool: ::core::option::Option<u64>,
6892 #[prost(uint64, optional, tag = "6")]
6894 pub pool_token_balance: ::core::option::Option<u64>,
6895 #[prost(message, optional, tag = "7")]
6902 pub exchange_rates: ::core::option::Option<MoveTable>,
6903 #[prost(uint64, optional, tag = "8")]
6905 pub pending_stake: ::core::option::Option<u64>,
6906 #[prost(uint64, optional, tag = "9")]
6909 pub pending_total_sui_withdraw: ::core::option::Option<u64>,
6910 #[prost(uint64, optional, tag = "10")]
6912 pub pending_pool_token_withdraw: ::core::option::Option<u64>,
6913 #[prost(message, optional, tag = "11")]
6915 pub extra_fields: ::core::option::Option<MoveTable>,
6916}
6917#[non_exhaustive]
6919#[derive(Clone, PartialEq, ::prost::Message)]
6920pub struct Transaction {
6921 #[prost(message, optional, tag = "1")]
6923 pub bcs: ::core::option::Option<Bcs>,
6924 #[prost(string, optional, tag = "2")]
6926 pub digest: ::core::option::Option<::prost::alloc::string::String>,
6927 #[prost(int32, optional, tag = "3")]
6929 pub version: ::core::option::Option<i32>,
6930 #[prost(message, optional, tag = "4")]
6931 pub kind: ::core::option::Option<TransactionKind>,
6932 #[prost(string, optional, tag = "5")]
6933 pub sender: ::core::option::Option<::prost::alloc::string::String>,
6934 #[prost(message, optional, tag = "6")]
6935 pub gas_payment: ::core::option::Option<GasPayment>,
6936 #[prost(message, optional, tag = "7")]
6937 pub expiration: ::core::option::Option<TransactionExpiration>,
6938}
6939#[non_exhaustive]
6941#[derive(Clone, PartialEq, ::prost::Message)]
6942pub struct GasPayment {
6943 #[prost(message, repeated, tag = "1")]
6945 pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
6946 #[prost(string, optional, tag = "2")]
6948 pub owner: ::core::option::Option<::prost::alloc::string::String>,
6949 #[prost(uint64, optional, tag = "3")]
6953 pub price: ::core::option::Option<u64>,
6954 #[prost(uint64, optional, tag = "4")]
6956 pub budget: ::core::option::Option<u64>,
6957}
6958#[non_exhaustive]
6960#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6961pub struct TransactionExpiration {
6962 #[prost(
6963 enumeration = "transaction_expiration::TransactionExpirationKind",
6964 optional,
6965 tag = "1"
6966 )]
6967 pub kind: ::core::option::Option<i32>,
6968 #[prost(uint64, optional, tag = "2")]
6971 pub epoch: ::core::option::Option<u64>,
6972 #[prost(uint64, optional, tag = "3")]
6975 pub min_epoch: ::core::option::Option<u64>,
6976 #[prost(message, optional, tag = "4")]
6980 pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
6981 #[prost(message, optional, tag = "5")]
6985 pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
6986 #[prost(string, optional, tag = "6")]
6988 pub chain: ::core::option::Option<::prost::alloc::string::String>,
6989 #[prost(uint32, optional, tag = "7")]
6991 pub nonce: ::core::option::Option<u32>,
6992}
6993pub mod transaction_expiration {
6995 #[non_exhaustive]
6996 #[derive(
6997 Clone,
6998 Copy,
6999 Debug,
7000 PartialEq,
7001 Eq,
7002 Hash,
7003 PartialOrd,
7004 Ord,
7005 ::prost::Enumeration
7006 )]
7007 #[repr(i32)]
7008 pub enum TransactionExpirationKind {
7009 Unknown = 0,
7010 None = 1,
7012 Epoch = 2,
7015 ValidDuring = 3,
7025 }
7026 impl TransactionExpirationKind {
7027 pub fn as_str_name(&self) -> &'static str {
7032 match self {
7033 Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
7034 Self::None => "NONE",
7035 Self::Epoch => "EPOCH",
7036 Self::ValidDuring => "VALID_DURING",
7037 }
7038 }
7039 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7041 match value {
7042 "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
7043 "NONE" => Some(Self::None),
7044 "EPOCH" => Some(Self::Epoch),
7045 "VALID_DURING" => Some(Self::ValidDuring),
7046 _ => None,
7047 }
7048 }
7049 }
7050}
7051#[non_exhaustive]
7053#[derive(Clone, PartialEq, ::prost::Message)]
7054pub struct TransactionKind {
7055 #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
7056 pub kind: ::core::option::Option<i32>,
7057 #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
7058 pub data: ::core::option::Option<transaction_kind::Data>,
7059}
7060pub mod transaction_kind {
7062 #[non_exhaustive]
7063 #[derive(
7064 Clone,
7065 Copy,
7066 Debug,
7067 PartialEq,
7068 Eq,
7069 Hash,
7070 PartialOrd,
7071 Ord,
7072 ::prost::Enumeration
7073 )]
7074 #[repr(i32)]
7075 pub enum Kind {
7076 Unknown = 0,
7077 ProgrammableTransaction = 1,
7079 ChangeEpoch = 2,
7084 Genesis = 3,
7089 ConsensusCommitPrologueV1 = 4,
7091 AuthenticatorStateUpdate = 5,
7093 EndOfEpoch = 6,
7096 RandomnessStateUpdate = 7,
7098 ConsensusCommitPrologueV2 = 8,
7100 ConsensusCommitPrologueV3 = 9,
7102 ConsensusCommitPrologueV4 = 10,
7104 }
7105 impl Kind {
7106 pub fn as_str_name(&self) -> &'static str {
7111 match self {
7112 Self::Unknown => "KIND_UNKNOWN",
7113 Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
7114 Self::ChangeEpoch => "CHANGE_EPOCH",
7115 Self::Genesis => "GENESIS",
7116 Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
7117 Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
7118 Self::EndOfEpoch => "END_OF_EPOCH",
7119 Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
7120 Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
7121 Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
7122 Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
7123 }
7124 }
7125 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7127 match value {
7128 "KIND_UNKNOWN" => Some(Self::Unknown),
7129 "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
7130 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7131 "GENESIS" => Some(Self::Genesis),
7132 "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
7133 "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
7134 "END_OF_EPOCH" => Some(Self::EndOfEpoch),
7135 "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
7136 "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
7137 "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
7138 "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
7139 _ => None,
7140 }
7141 }
7142 }
7143 #[non_exhaustive]
7144 #[derive(Clone, PartialEq, ::prost::Oneof)]
7145 pub enum Data {
7146 #[prost(message, tag = "2")]
7148 ProgrammableTransaction(super::ProgrammableTransaction),
7149 #[prost(message, tag = "3")]
7154 ChangeEpoch(super::ChangeEpoch),
7155 #[prost(message, tag = "4")]
7160 Genesis(super::GenesisTransaction),
7161 #[prost(message, tag = "5")]
7163 ConsensusCommitPrologue(super::ConsensusCommitPrologue),
7164 #[prost(message, tag = "6")]
7166 AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
7167 #[prost(message, tag = "7")]
7170 EndOfEpoch(super::EndOfEpochTransaction),
7171 #[prost(message, tag = "8")]
7173 RandomnessStateUpdate(super::RandomnessStateUpdate),
7174 }
7175}
7176#[non_exhaustive]
7181#[derive(Clone, PartialEq, ::prost::Message)]
7182pub struct ProgrammableTransaction {
7183 #[prost(message, repeated, tag = "1")]
7185 pub inputs: ::prost::alloc::vec::Vec<Input>,
7186 #[prost(message, repeated, tag = "2")]
7189 pub commands: ::prost::alloc::vec::Vec<Command>,
7190}
7191#[non_exhaustive]
7193#[derive(Clone, PartialEq, ::prost::Message)]
7194pub struct Command {
7195 #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
7196 pub command: ::core::option::Option<command::Command>,
7197}
7198pub mod command {
7200 #[non_exhaustive]
7201 #[derive(Clone, PartialEq, ::prost::Oneof)]
7202 pub enum Command {
7203 #[prost(message, tag = "1")]
7205 MoveCall(super::MoveCall),
7206 #[prost(message, tag = "2")]
7211 TransferObjects(super::TransferObjects),
7212 #[prost(message, tag = "3")]
7215 SplitCoins(super::SplitCoins),
7216 #[prost(message, tag = "4")]
7219 MergeCoins(super::MergeCoins),
7220 #[prost(message, tag = "5")]
7223 Publish(super::Publish),
7224 #[prost(message, tag = "6")]
7228 MakeMoveVector(super::MakeMoveVector),
7229 #[prost(message, tag = "7")]
7238 Upgrade(super::Upgrade),
7239 }
7240}
7241#[non_exhaustive]
7246#[derive(Clone, PartialEq, ::prost::Message)]
7247pub struct MoveCall {
7248 #[prost(string, optional, tag = "1")]
7250 pub package: ::core::option::Option<::prost::alloc::string::String>,
7251 #[prost(string, optional, tag = "2")]
7253 pub module: ::core::option::Option<::prost::alloc::string::String>,
7254 #[prost(string, optional, tag = "3")]
7256 pub function: ::core::option::Option<::prost::alloc::string::String>,
7257 #[prost(string, repeated, tag = "4")]
7259 pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7260 #[prost(message, repeated, tag = "5")]
7262 pub arguments: ::prost::alloc::vec::Vec<Argument>,
7263}
7264#[non_exhaustive]
7266#[derive(Clone, PartialEq, ::prost::Message)]
7267pub struct TransferObjects {
7268 #[prost(message, repeated, tag = "1")]
7270 pub objects: ::prost::alloc::vec::Vec<Argument>,
7271 #[prost(message, optional, tag = "2")]
7273 pub address: ::core::option::Option<Argument>,
7274}
7275#[non_exhaustive]
7277#[derive(Clone, PartialEq, ::prost::Message)]
7278pub struct SplitCoins {
7279 #[prost(message, optional, tag = "1")]
7281 pub coin: ::core::option::Option<Argument>,
7282 #[prost(message, repeated, tag = "2")]
7284 pub amounts: ::prost::alloc::vec::Vec<Argument>,
7285}
7286#[non_exhaustive]
7288#[derive(Clone, PartialEq, ::prost::Message)]
7289pub struct MergeCoins {
7290 #[prost(message, optional, tag = "1")]
7292 pub coin: ::core::option::Option<Argument>,
7293 #[prost(message, repeated, tag = "2")]
7297 pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
7298}
7299#[non_exhaustive]
7301#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7302pub struct Publish {
7303 #[prost(bytes = "bytes", repeated, tag = "1")]
7305 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7306 #[prost(string, repeated, tag = "2")]
7308 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7309}
7310#[non_exhaustive]
7312#[derive(Clone, PartialEq, ::prost::Message)]
7313pub struct MakeMoveVector {
7314 #[prost(string, optional, tag = "1")]
7319 pub element_type: ::core::option::Option<::prost::alloc::string::String>,
7320 #[prost(message, repeated, tag = "2")]
7322 pub elements: ::prost::alloc::vec::Vec<Argument>,
7323}
7324#[non_exhaustive]
7326#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7327pub struct Upgrade {
7328 #[prost(bytes = "bytes", repeated, tag = "1")]
7330 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7331 #[prost(string, repeated, tag = "2")]
7333 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7334 #[prost(string, optional, tag = "3")]
7336 pub package: ::core::option::Option<::prost::alloc::string::String>,
7337 #[prost(message, optional, tag = "4")]
7339 pub ticket: ::core::option::Option<Argument>,
7340}
7341#[non_exhaustive]
7343#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7344pub struct RandomnessStateUpdate {
7345 #[prost(uint64, optional, tag = "1")]
7347 pub epoch: ::core::option::Option<u64>,
7348 #[prost(uint64, optional, tag = "2")]
7350 pub randomness_round: ::core::option::Option<u64>,
7351 #[prost(bytes = "bytes", optional, tag = "3")]
7353 pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
7354 #[prost(uint64, optional, tag = "4")]
7356 pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
7357}
7358#[non_exhaustive]
7360#[derive(Clone, PartialEq, ::prost::Message)]
7361pub struct ChangeEpoch {
7362 #[prost(uint64, optional, tag = "1")]
7364 pub epoch: ::core::option::Option<u64>,
7365 #[prost(uint64, optional, tag = "2")]
7367 pub protocol_version: ::core::option::Option<u64>,
7368 #[prost(uint64, optional, tag = "3")]
7370 pub storage_charge: ::core::option::Option<u64>,
7371 #[prost(uint64, optional, tag = "4")]
7373 pub computation_charge: ::core::option::Option<u64>,
7374 #[prost(uint64, optional, tag = "5")]
7376 pub storage_rebate: ::core::option::Option<u64>,
7377 #[prost(uint64, optional, tag = "6")]
7379 pub non_refundable_storage_fee: ::core::option::Option<u64>,
7380 #[prost(message, optional, tag = "7")]
7382 pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7383 #[prost(message, repeated, tag = "8")]
7389 pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
7390}
7391#[non_exhaustive]
7393#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7394pub struct SystemPackage {
7395 #[prost(uint64, optional, tag = "1")]
7397 pub version: ::core::option::Option<u64>,
7398 #[prost(bytes = "bytes", repeated, tag = "2")]
7400 pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7401 #[prost(string, repeated, tag = "3")]
7403 pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7404}
7405#[non_exhaustive]
7407#[derive(Clone, PartialEq, ::prost::Message)]
7408pub struct GenesisTransaction {
7409 #[prost(message, repeated, tag = "1")]
7411 pub objects: ::prost::alloc::vec::Vec<Object>,
7412}
7413#[non_exhaustive]
7417#[derive(Clone, PartialEq, ::prost::Message)]
7418pub struct ConsensusCommitPrologue {
7419 #[prost(uint64, optional, tag = "1")]
7423 pub epoch: ::core::option::Option<u64>,
7424 #[prost(uint64, optional, tag = "2")]
7428 pub round: ::core::option::Option<u64>,
7429 #[prost(message, optional, tag = "3")]
7433 pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7434 #[prost(string, optional, tag = "4")]
7438 pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
7439 #[prost(uint64, optional, tag = "5")]
7444 pub sub_dag_index: ::core::option::Option<u64>,
7445 #[prost(message, optional, tag = "6")]
7449 pub consensus_determined_version_assignments: ::core::option::Option<
7450 ConsensusDeterminedVersionAssignments,
7451 >,
7452 #[prost(string, optional, tag = "7")]
7457 pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
7458}
7459#[non_exhaustive]
7461#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7462pub struct VersionAssignment {
7463 #[prost(string, optional, tag = "1")]
7465 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
7466 #[prost(uint64, optional, tag = "2")]
7468 pub start_version: ::core::option::Option<u64>,
7469 #[prost(uint64, optional, tag = "3")]
7471 pub version: ::core::option::Option<u64>,
7472}
7473#[non_exhaustive]
7475#[derive(Clone, PartialEq, ::prost::Message)]
7476pub struct CanceledTransaction {
7477 #[prost(string, optional, tag = "1")]
7479 pub digest: ::core::option::Option<::prost::alloc::string::String>,
7480 #[prost(message, repeated, tag = "2")]
7482 pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
7483}
7484#[non_exhaustive]
7486#[derive(Clone, PartialEq, ::prost::Message)]
7487pub struct ConsensusDeterminedVersionAssignments {
7488 #[prost(int32, optional, tag = "1")]
7490 pub version: ::core::option::Option<i32>,
7491 #[prost(message, repeated, tag = "3")]
7493 pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
7494}
7495#[non_exhaustive]
7497#[derive(Clone, PartialEq, ::prost::Message)]
7498pub struct AuthenticatorStateUpdate {
7499 #[prost(uint64, optional, tag = "1")]
7501 pub epoch: ::core::option::Option<u64>,
7502 #[prost(uint64, optional, tag = "2")]
7504 pub round: ::core::option::Option<u64>,
7505 #[prost(message, repeated, tag = "3")]
7507 pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
7508 #[prost(uint64, optional, tag = "4")]
7510 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7511}
7512#[non_exhaustive]
7514#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7515pub struct ActiveJwk {
7516 #[prost(message, optional, tag = "1")]
7518 pub id: ::core::option::Option<JwkId>,
7519 #[prost(message, optional, tag = "2")]
7521 pub jwk: ::core::option::Option<Jwk>,
7522 #[prost(uint64, optional, tag = "3")]
7524 pub epoch: ::core::option::Option<u64>,
7525}
7526#[non_exhaustive]
7529#[derive(Clone, PartialEq, ::prost::Message)]
7530pub struct EndOfEpochTransaction {
7531 #[prost(message, repeated, tag = "1")]
7532 pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
7533}
7534#[non_exhaustive]
7536#[derive(Clone, PartialEq, ::prost::Message)]
7537pub struct EndOfEpochTransactionKind {
7538 #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
7539 pub kind: ::core::option::Option<i32>,
7540 #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6")]
7541 pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
7542}
7543pub mod end_of_epoch_transaction_kind {
7545 #[non_exhaustive]
7546 #[derive(
7547 Clone,
7548 Copy,
7549 Debug,
7550 PartialEq,
7551 Eq,
7552 Hash,
7553 PartialOrd,
7554 Ord,
7555 ::prost::Enumeration
7556 )]
7557 #[repr(i32)]
7558 pub enum Kind {
7559 Unknown = 0,
7560 ChangeEpoch = 1,
7562 AuthenticatorStateCreate = 2,
7564 AuthenticatorStateExpire = 3,
7566 RandomnessStateCreate = 4,
7568 DenyListStateCreate = 5,
7570 BridgeStateCreate = 6,
7572 BridgeCommitteeInit = 7,
7574 StoreExecutionTimeObservations = 8,
7576 AccumulatorRootCreate = 9,
7578 CoinRegistryCreate = 10,
7580 DisplayRegistryCreate = 11,
7582 AddressAliasStateCreate = 12,
7584 }
7585 impl Kind {
7586 pub fn as_str_name(&self) -> &'static str {
7591 match self {
7592 Self::Unknown => "KIND_UNKNOWN",
7593 Self::ChangeEpoch => "CHANGE_EPOCH",
7594 Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
7595 Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
7596 Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
7597 Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
7598 Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
7599 Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
7600 Self::StoreExecutionTimeObservations => {
7601 "STORE_EXECUTION_TIME_OBSERVATIONS"
7602 }
7603 Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
7604 Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
7605 Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
7606 Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
7607 }
7608 }
7609 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7611 match value {
7612 "KIND_UNKNOWN" => Some(Self::Unknown),
7613 "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7614 "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
7615 "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
7616 "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
7617 "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
7618 "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
7619 "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
7620 "STORE_EXECUTION_TIME_OBSERVATIONS" => {
7621 Some(Self::StoreExecutionTimeObservations)
7622 }
7623 "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
7624 "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
7625 "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
7626 "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
7627 _ => None,
7628 }
7629 }
7630 }
7631 #[non_exhaustive]
7632 #[derive(Clone, PartialEq, ::prost::Oneof)]
7633 pub enum Data {
7634 #[prost(message, tag = "2")]
7636 ChangeEpoch(super::ChangeEpoch),
7637 #[prost(message, tag = "3")]
7639 AuthenticatorStateExpire(super::AuthenticatorStateExpire),
7640 #[prost(message, tag = "4")]
7642 ExecutionTimeObservations(super::ExecutionTimeObservations),
7643 #[prost(string, tag = "5")]
7645 BridgeChainId(::prost::alloc::string::String),
7646 #[prost(uint64, tag = "6")]
7648 BridgeObjectVersion(u64),
7649 }
7650}
7651#[non_exhaustive]
7653#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7654pub struct AuthenticatorStateExpire {
7655 #[prost(uint64, optional, tag = "1")]
7657 pub min_epoch: ::core::option::Option<u64>,
7658 #[prost(uint64, optional, tag = "2")]
7660 pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7661}
7662#[non_exhaustive]
7663#[derive(Clone, PartialEq, ::prost::Message)]
7664pub struct ExecutionTimeObservations {
7665 #[prost(int32, optional, tag = "1")]
7667 pub version: ::core::option::Option<i32>,
7668 #[prost(message, repeated, tag = "2")]
7669 pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
7670}
7671#[non_exhaustive]
7672#[derive(Clone, PartialEq, ::prost::Message)]
7673pub struct ExecutionTimeObservation {
7674 #[prost(
7675 enumeration = "execution_time_observation::ExecutionTimeObservationKind",
7676 optional,
7677 tag = "1"
7678 )]
7679 pub kind: ::core::option::Option<i32>,
7680 #[prost(message, optional, tag = "2")]
7681 pub move_entry_point: ::core::option::Option<MoveCall>,
7682 #[prost(message, repeated, tag = "3")]
7683 pub validator_observations: ::prost::alloc::vec::Vec<
7684 ValidatorExecutionTimeObservation,
7685 >,
7686}
7687pub mod execution_time_observation {
7689 #[non_exhaustive]
7690 #[derive(
7691 Clone,
7692 Copy,
7693 Debug,
7694 PartialEq,
7695 Eq,
7696 Hash,
7697 PartialOrd,
7698 Ord,
7699 ::prost::Enumeration
7700 )]
7701 #[repr(i32)]
7702 pub enum ExecutionTimeObservationKind {
7703 Unknown = 0,
7704 MoveEntryPoint = 1,
7705 TransferObjects = 2,
7706 SplitCoins = 3,
7707 MergeCoins = 4,
7708 Publish = 5,
7709 MakeMoveVector = 6,
7710 Upgrade = 7,
7711 }
7712 impl ExecutionTimeObservationKind {
7713 pub fn as_str_name(&self) -> &'static str {
7718 match self {
7719 Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
7720 Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
7721 Self::TransferObjects => "TRANSFER_OBJECTS",
7722 Self::SplitCoins => "SPLIT_COINS",
7723 Self::MergeCoins => "MERGE_COINS",
7724 Self::Publish => "PUBLISH",
7725 Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
7726 Self::Upgrade => "UPGRADE",
7727 }
7728 }
7729 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7731 match value {
7732 "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
7733 "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
7734 "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
7735 "SPLIT_COINS" => Some(Self::SplitCoins),
7736 "MERGE_COINS" => Some(Self::MergeCoins),
7737 "PUBLISH" => Some(Self::Publish),
7738 "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
7739 "UPGRADE" => Some(Self::Upgrade),
7740 _ => None,
7741 }
7742 }
7743 }
7744}
7745#[non_exhaustive]
7746#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7747pub struct ValidatorExecutionTimeObservation {
7748 #[prost(bytes = "bytes", optional, tag = "1")]
7750 pub validator: ::core::option::Option<::prost::bytes::Bytes>,
7751 #[prost(message, optional, tag = "2")]
7753 pub duration: ::core::option::Option<::prost_types::Duration>,
7754}
7755#[non_exhaustive]
7756#[derive(Clone, PartialEq, ::prost::Message)]
7757pub struct ExecuteTransactionRequest {
7758 #[prost(message, optional, tag = "1")]
7760 pub transaction: ::core::option::Option<Transaction>,
7761 #[prost(message, repeated, tag = "2")]
7764 pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
7765 #[prost(message, optional, tag = "3")]
7768 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7769}
7770#[non_exhaustive]
7772#[derive(Clone, PartialEq, ::prost::Message)]
7773pub struct ExecuteTransactionResponse {
7774 #[prost(message, optional, tag = "1")]
7775 pub transaction: ::core::option::Option<ExecutedTransaction>,
7776}
7777#[non_exhaustive]
7778#[derive(Clone, PartialEq, ::prost::Message)]
7779pub struct SimulateTransactionRequest {
7780 #[prost(message, optional, tag = "1")]
7781 pub transaction: ::core::option::Option<Transaction>,
7782 #[prost(message, optional, tag = "2")]
7784 pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7785 #[prost(
7787 enumeration = "simulate_transaction_request::TransactionChecks",
7788 optional,
7789 tag = "3"
7790 )]
7791 pub checks: ::core::option::Option<i32>,
7792 #[prost(bool, optional, tag = "4")]
7797 pub do_gas_selection: ::core::option::Option<bool>,
7798}
7799pub mod simulate_transaction_request {
7801 #[non_exhaustive]
7803 #[derive(
7804 Clone,
7805 Copy,
7806 Debug,
7807 PartialEq,
7808 Eq,
7809 Hash,
7810 PartialOrd,
7811 Ord,
7812 ::prost::Enumeration
7813 )]
7814 #[repr(i32)]
7815 pub enum TransactionChecks {
7816 Enabled = 0,
7817 Disabled = 1,
7818 }
7819 impl TransactionChecks {
7820 pub fn as_str_name(&self) -> &'static str {
7825 match self {
7826 Self::Enabled => "ENABLED",
7827 Self::Disabled => "DISABLED",
7828 }
7829 }
7830 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7832 match value {
7833 "ENABLED" => Some(Self::Enabled),
7834 "DISABLED" => Some(Self::Disabled),
7835 _ => None,
7836 }
7837 }
7838 }
7839}
7840#[non_exhaustive]
7841#[derive(Clone, PartialEq, ::prost::Message)]
7842pub struct SimulateTransactionResponse {
7843 #[prost(message, optional, tag = "1")]
7844 pub transaction: ::core::option::Option<ExecutedTransaction>,
7845 #[prost(message, repeated, tag = "2")]
7846 pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
7847}
7848#[non_exhaustive]
7850#[derive(Clone, PartialEq, ::prost::Message)]
7851pub struct CommandResult {
7852 #[prost(message, repeated, tag = "1")]
7853 pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
7854 #[prost(message, repeated, tag = "2")]
7855 pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
7856}
7857#[non_exhaustive]
7858#[derive(Clone, PartialEq, ::prost::Message)]
7859pub struct CommandOutput {
7860 #[prost(message, optional, tag = "1")]
7861 pub argument: ::core::option::Option<Argument>,
7862 #[prost(message, optional, tag = "2")]
7863 pub value: ::core::option::Option<Bcs>,
7864 #[prost(message, optional, boxed, tag = "3")]
7866 pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
7867}
7868pub mod transaction_execution_service_client {
7870 #![allow(
7871 unused_variables,
7872 dead_code,
7873 missing_docs,
7874 clippy::wildcard_imports,
7875 clippy::let_unit_value,
7876 )]
7877 use tonic::codegen::*;
7878 use tonic::codegen::http::Uri;
7879 #[derive(Debug, Clone)]
7880 pub struct TransactionExecutionServiceClient<T> {
7881 inner: tonic::client::Grpc<T>,
7882 }
7883 impl TransactionExecutionServiceClient<tonic::transport::Channel> {
7884 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7886 where
7887 D: TryInto<tonic::transport::Endpoint>,
7888 D::Error: Into<StdError>,
7889 {
7890 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7891 Ok(Self::new(conn))
7892 }
7893 }
7894 impl<T> TransactionExecutionServiceClient<T>
7895 where
7896 T: tonic::client::GrpcService<tonic::body::Body>,
7897 T::Error: Into<StdError>,
7898 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7899 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7900 {
7901 pub fn new(inner: T) -> Self {
7902 let inner = tonic::client::Grpc::new(inner);
7903 Self { inner }
7904 }
7905 pub fn with_origin(inner: T, origin: Uri) -> Self {
7906 let inner = tonic::client::Grpc::with_origin(inner, origin);
7907 Self { inner }
7908 }
7909 pub fn with_interceptor<F>(
7910 inner: T,
7911 interceptor: F,
7912 ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
7913 where
7914 F: tonic::service::Interceptor,
7915 T::ResponseBody: Default,
7916 T: tonic::codegen::Service<
7917 http::Request<tonic::body::Body>,
7918 Response = http::Response<
7919 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7920 >,
7921 >,
7922 <T as tonic::codegen::Service<
7923 http::Request<tonic::body::Body>,
7924 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7925 {
7926 TransactionExecutionServiceClient::new(
7927 InterceptedService::new(inner, interceptor),
7928 )
7929 }
7930 #[must_use]
7935 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7936 self.inner = self.inner.send_compressed(encoding);
7937 self
7938 }
7939 #[must_use]
7941 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7942 self.inner = self.inner.accept_compressed(encoding);
7943 self
7944 }
7945 #[must_use]
7949 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7950 self.inner = self.inner.max_decoding_message_size(limit);
7951 self
7952 }
7953 #[must_use]
7957 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7958 self.inner = self.inner.max_encoding_message_size(limit);
7959 self
7960 }
7961 pub async fn execute_transaction(
7962 &mut self,
7963 request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
7964 ) -> std::result::Result<
7965 tonic::Response<super::ExecuteTransactionResponse>,
7966 tonic::Status,
7967 > {
7968 self.inner
7969 .ready()
7970 .await
7971 .map_err(|e| {
7972 tonic::Status::unknown(
7973 format!("Service was not ready: {}", e.into()),
7974 )
7975 })?;
7976 let codec = tonic_prost::ProstCodec::default();
7977 let path = http::uri::PathAndQuery::from_static(
7978 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
7979 );
7980 let mut req = request.into_request();
7981 req.extensions_mut()
7982 .insert(
7983 GrpcMethod::new(
7984 "sui.rpc.v2.TransactionExecutionService",
7985 "ExecuteTransaction",
7986 ),
7987 );
7988 self.inner.unary(req, path, codec).await
7989 }
7990 pub async fn simulate_transaction(
7991 &mut self,
7992 request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
7993 ) -> std::result::Result<
7994 tonic::Response<super::SimulateTransactionResponse>,
7995 tonic::Status,
7996 > {
7997 self.inner
7998 .ready()
7999 .await
8000 .map_err(|e| {
8001 tonic::Status::unknown(
8002 format!("Service was not ready: {}", e.into()),
8003 )
8004 })?;
8005 let codec = tonic_prost::ProstCodec::default();
8006 let path = http::uri::PathAndQuery::from_static(
8007 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
8008 );
8009 let mut req = request.into_request();
8010 req.extensions_mut()
8011 .insert(
8012 GrpcMethod::new(
8013 "sui.rpc.v2.TransactionExecutionService",
8014 "SimulateTransaction",
8015 ),
8016 );
8017 self.inner.unary(req, path, codec).await
8018 }
8019 }
8020}
8021pub mod transaction_execution_service_server {
8023 #![allow(
8024 unused_variables,
8025 dead_code,
8026 missing_docs,
8027 clippy::wildcard_imports,
8028 clippy::let_unit_value,
8029 )]
8030 use tonic::codegen::*;
8031 #[async_trait]
8033 pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
8034 async fn execute_transaction(
8035 &self,
8036 request: tonic::Request<super::ExecuteTransactionRequest>,
8037 ) -> std::result::Result<
8038 tonic::Response<super::ExecuteTransactionResponse>,
8039 tonic::Status,
8040 >;
8041 async fn simulate_transaction(
8042 &self,
8043 request: tonic::Request<super::SimulateTransactionRequest>,
8044 ) -> std::result::Result<
8045 tonic::Response<super::SimulateTransactionResponse>,
8046 tonic::Status,
8047 >;
8048 }
8049 #[derive(Debug)]
8050 pub struct TransactionExecutionServiceServer<T> {
8051 inner: Arc<T>,
8052 accept_compression_encodings: EnabledCompressionEncodings,
8053 send_compression_encodings: EnabledCompressionEncodings,
8054 max_decoding_message_size: Option<usize>,
8055 max_encoding_message_size: Option<usize>,
8056 }
8057 impl<T> TransactionExecutionServiceServer<T> {
8058 pub fn new(inner: T) -> Self {
8059 Self::from_arc(Arc::new(inner))
8060 }
8061 pub fn from_arc(inner: Arc<T>) -> Self {
8062 Self {
8063 inner,
8064 accept_compression_encodings: Default::default(),
8065 send_compression_encodings: Default::default(),
8066 max_decoding_message_size: None,
8067 max_encoding_message_size: None,
8068 }
8069 }
8070 pub fn with_interceptor<F>(
8071 inner: T,
8072 interceptor: F,
8073 ) -> InterceptedService<Self, F>
8074 where
8075 F: tonic::service::Interceptor,
8076 {
8077 InterceptedService::new(Self::new(inner), interceptor)
8078 }
8079 #[must_use]
8081 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8082 self.accept_compression_encodings.enable(encoding);
8083 self
8084 }
8085 #[must_use]
8087 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8088 self.send_compression_encodings.enable(encoding);
8089 self
8090 }
8091 #[must_use]
8095 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8096 self.max_decoding_message_size = Some(limit);
8097 self
8098 }
8099 #[must_use]
8103 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8104 self.max_encoding_message_size = Some(limit);
8105 self
8106 }
8107 }
8108 impl<T, B> tonic::codegen::Service<http::Request<B>>
8109 for TransactionExecutionServiceServer<T>
8110 where
8111 T: TransactionExecutionService,
8112 B: Body + std::marker::Send + 'static,
8113 B::Error: Into<StdError> + std::marker::Send + 'static,
8114 {
8115 type Response = http::Response<tonic::body::Body>;
8116 type Error = std::convert::Infallible;
8117 type Future = BoxFuture<Self::Response, Self::Error>;
8118 fn poll_ready(
8119 &mut self,
8120 _cx: &mut Context<'_>,
8121 ) -> Poll<std::result::Result<(), Self::Error>> {
8122 Poll::Ready(Ok(()))
8123 }
8124 fn call(&mut self, req: http::Request<B>) -> Self::Future {
8125 match req.uri().path() {
8126 "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
8127 #[allow(non_camel_case_types)]
8128 struct ExecuteTransactionSvc<T: TransactionExecutionService>(
8129 pub Arc<T>,
8130 );
8131 impl<
8132 T: TransactionExecutionService,
8133 > tonic::server::UnaryService<super::ExecuteTransactionRequest>
8134 for ExecuteTransactionSvc<T> {
8135 type Response = super::ExecuteTransactionResponse;
8136 type Future = BoxFuture<
8137 tonic::Response<Self::Response>,
8138 tonic::Status,
8139 >;
8140 fn call(
8141 &mut self,
8142 request: tonic::Request<super::ExecuteTransactionRequest>,
8143 ) -> Self::Future {
8144 let inner = Arc::clone(&self.0);
8145 let fut = async move {
8146 <T as TransactionExecutionService>::execute_transaction(
8147 &inner,
8148 request,
8149 )
8150 .await
8151 };
8152 Box::pin(fut)
8153 }
8154 }
8155 let accept_compression_encodings = self.accept_compression_encodings;
8156 let send_compression_encodings = self.send_compression_encodings;
8157 let max_decoding_message_size = self.max_decoding_message_size;
8158 let max_encoding_message_size = self.max_encoding_message_size;
8159 let inner = self.inner.clone();
8160 let fut = async move {
8161 let method = ExecuteTransactionSvc(inner);
8162 let codec = tonic_prost::ProstCodec::default();
8163 let mut grpc = tonic::server::Grpc::new(codec)
8164 .apply_compression_config(
8165 accept_compression_encodings,
8166 send_compression_encodings,
8167 )
8168 .apply_max_message_size_config(
8169 max_decoding_message_size,
8170 max_encoding_message_size,
8171 );
8172 let res = grpc.unary(method, req).await;
8173 Ok(res)
8174 };
8175 Box::pin(fut)
8176 }
8177 "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
8178 #[allow(non_camel_case_types)]
8179 struct SimulateTransactionSvc<T: TransactionExecutionService>(
8180 pub Arc<T>,
8181 );
8182 impl<
8183 T: TransactionExecutionService,
8184 > tonic::server::UnaryService<super::SimulateTransactionRequest>
8185 for SimulateTransactionSvc<T> {
8186 type Response = super::SimulateTransactionResponse;
8187 type Future = BoxFuture<
8188 tonic::Response<Self::Response>,
8189 tonic::Status,
8190 >;
8191 fn call(
8192 &mut self,
8193 request: tonic::Request<super::SimulateTransactionRequest>,
8194 ) -> Self::Future {
8195 let inner = Arc::clone(&self.0);
8196 let fut = async move {
8197 <T as TransactionExecutionService>::simulate_transaction(
8198 &inner,
8199 request,
8200 )
8201 .await
8202 };
8203 Box::pin(fut)
8204 }
8205 }
8206 let accept_compression_encodings = self.accept_compression_encodings;
8207 let send_compression_encodings = self.send_compression_encodings;
8208 let max_decoding_message_size = self.max_decoding_message_size;
8209 let max_encoding_message_size = self.max_encoding_message_size;
8210 let inner = self.inner.clone();
8211 let fut = async move {
8212 let method = SimulateTransactionSvc(inner);
8213 let codec = tonic_prost::ProstCodec::default();
8214 let mut grpc = tonic::server::Grpc::new(codec)
8215 .apply_compression_config(
8216 accept_compression_encodings,
8217 send_compression_encodings,
8218 )
8219 .apply_max_message_size_config(
8220 max_decoding_message_size,
8221 max_encoding_message_size,
8222 );
8223 let res = grpc.unary(method, req).await;
8224 Ok(res)
8225 };
8226 Box::pin(fut)
8227 }
8228 _ => {
8229 Box::pin(async move {
8230 let mut response = http::Response::new(
8231 tonic::body::Body::default(),
8232 );
8233 let headers = response.headers_mut();
8234 headers
8235 .insert(
8236 tonic::Status::GRPC_STATUS,
8237 (tonic::Code::Unimplemented as i32).into(),
8238 );
8239 headers
8240 .insert(
8241 http::header::CONTENT_TYPE,
8242 tonic::metadata::GRPC_CONTENT_TYPE,
8243 );
8244 Ok(response)
8245 })
8246 }
8247 }
8248 }
8249 }
8250 impl<T> Clone for TransactionExecutionServiceServer<T> {
8251 fn clone(&self) -> Self {
8252 let inner = self.inner.clone();
8253 Self {
8254 inner,
8255 accept_compression_encodings: self.accept_compression_encodings,
8256 send_compression_encodings: self.send_compression_encodings,
8257 max_decoding_message_size: self.max_decoding_message_size,
8258 max_encoding_message_size: self.max_encoding_message_size,
8259 }
8260 }
8261 }
8262 pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
8264 impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
8265 const NAME: &'static str = SERVICE_NAME;
8266 }
8267}