1#[non_exhaustive]
4#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct ListAuthenticatedEventsRequest {
6 #[prost(string, optional, tag = "1")]
8 pub stream_id: ::core::option::Option<::prost::alloc::string::String>,
9 #[prost(uint64, optional, tag = "2")]
11 pub start_checkpoint: ::core::option::Option<u64>,
12 #[prost(uint32, optional, tag = "3")]
14 pub page_size: ::core::option::Option<u32>,
15 #[prost(bytes = "vec", optional, tag = "4")]
17 pub page_token: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
18}
19#[non_exhaustive]
21#[derive(Clone, PartialEq, ::prost::Message)]
22pub struct ListAuthenticatedEventsResponse {
23 #[prost(message, repeated, tag = "1")]
24 pub events: ::prost::alloc::vec::Vec<AuthenticatedEvent>,
25 #[prost(uint64, optional, tag = "2")]
27 pub highest_indexed_checkpoint: ::core::option::Option<u64>,
28 #[prost(bytes = "vec", optional, tag = "3")]
30 pub next_page_token: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
31}
32#[non_exhaustive]
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct AuthenticatedEvent {
36 #[prost(uint64, optional, tag = "1")]
38 pub checkpoint: ::core::option::Option<u64>,
39 #[prost(uint64, optional, tag = "2")]
41 pub accumulator_version: ::core::option::Option<u64>,
42 #[prost(uint32, optional, tag = "3")]
44 pub transaction_idx: ::core::option::Option<u32>,
45 #[prost(uint32, optional, tag = "4")]
47 pub event_idx: ::core::option::Option<u32>,
48 #[prost(message, optional, tag = "5")]
50 pub event: ::core::option::Option<::sui_rpc::proto::sui::rpc::v2::Event>,
51 #[prost(string, optional, tag = "6")]
53 pub stream_id: ::core::option::Option<::prost::alloc::string::String>,
54}
55pub mod event_service_client {
57 #![allow(
58 unused_variables,
59 dead_code,
60 missing_docs,
61 clippy::wildcard_imports,
62 clippy::let_unit_value,
63 )]
64 use tonic::codegen::*;
65 use tonic::codegen::http::Uri;
66 #[derive(Debug, Clone)]
68 pub struct EventServiceClient<T> {
69 inner: tonic::client::Grpc<T>,
70 }
71 impl EventServiceClient<tonic::transport::Channel> {
72 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
74 where
75 D: TryInto<tonic::transport::Endpoint>,
76 D::Error: Into<StdError>,
77 {
78 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
79 Ok(Self::new(conn))
80 }
81 }
82 impl<T> EventServiceClient<T>
83 where
84 T: tonic::client::GrpcService<tonic::body::Body>,
85 T::Error: Into<StdError>,
86 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
87 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
88 {
89 pub fn new(inner: T) -> Self {
90 let inner = tonic::client::Grpc::new(inner);
91 Self { inner }
92 }
93 pub fn with_origin(inner: T, origin: Uri) -> Self {
94 let inner = tonic::client::Grpc::with_origin(inner, origin);
95 Self { inner }
96 }
97 pub fn with_interceptor<F>(
98 inner: T,
99 interceptor: F,
100 ) -> EventServiceClient<InterceptedService<T, F>>
101 where
102 F: tonic::service::Interceptor,
103 T::ResponseBody: Default,
104 T: tonic::codegen::Service<
105 http::Request<tonic::body::Body>,
106 Response = http::Response<
107 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
108 >,
109 >,
110 <T as tonic::codegen::Service<
111 http::Request<tonic::body::Body>,
112 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
113 {
114 EventServiceClient::new(InterceptedService::new(inner, interceptor))
115 }
116 #[must_use]
121 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
122 self.inner = self.inner.send_compressed(encoding);
123 self
124 }
125 #[must_use]
127 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
128 self.inner = self.inner.accept_compressed(encoding);
129 self
130 }
131 #[must_use]
135 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
136 self.inner = self.inner.max_decoding_message_size(limit);
137 self
138 }
139 #[must_use]
143 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
144 self.inner = self.inner.max_encoding_message_size(limit);
145 self
146 }
147 pub async fn list_authenticated_events(
149 &mut self,
150 request: impl tonic::IntoRequest<super::ListAuthenticatedEventsRequest>,
151 ) -> std::result::Result<
152 tonic::Response<super::ListAuthenticatedEventsResponse>,
153 tonic::Status,
154 > {
155 self.inner
156 .ready()
157 .await
158 .map_err(|e| {
159 tonic::Status::unknown(
160 format!("Service was not ready: {}", e.into()),
161 )
162 })?;
163 let codec = tonic_prost::ProstCodec::default();
164 let path = http::uri::PathAndQuery::from_static(
165 "/sui.rpc.alpha.EventService/ListAuthenticatedEvents",
166 );
167 let mut req = request.into_request();
168 req.extensions_mut()
169 .insert(
170 GrpcMethod::new(
171 "sui.rpc.alpha.EventService",
172 "ListAuthenticatedEvents",
173 ),
174 );
175 self.inner.unary(req, path, codec).await
176 }
177 }
178}
179pub mod event_service_server {
181 #![allow(
182 unused_variables,
183 dead_code,
184 missing_docs,
185 clippy::wildcard_imports,
186 clippy::let_unit_value,
187 )]
188 use tonic::codegen::*;
189 #[async_trait]
191 pub trait EventService: std::marker::Send + std::marker::Sync + 'static {
192 async fn list_authenticated_events(
194 &self,
195 request: tonic::Request<super::ListAuthenticatedEventsRequest>,
196 ) -> std::result::Result<
197 tonic::Response<super::ListAuthenticatedEventsResponse>,
198 tonic::Status,
199 >;
200 }
201 #[derive(Debug)]
203 pub struct EventServiceServer<T> {
204 inner: Arc<T>,
205 accept_compression_encodings: EnabledCompressionEncodings,
206 send_compression_encodings: EnabledCompressionEncodings,
207 max_decoding_message_size: Option<usize>,
208 max_encoding_message_size: Option<usize>,
209 }
210 impl<T> EventServiceServer<T> {
211 pub fn new(inner: T) -> Self {
212 Self::from_arc(Arc::new(inner))
213 }
214 pub fn from_arc(inner: Arc<T>) -> Self {
215 Self {
216 inner,
217 accept_compression_encodings: Default::default(),
218 send_compression_encodings: Default::default(),
219 max_decoding_message_size: None,
220 max_encoding_message_size: None,
221 }
222 }
223 pub fn with_interceptor<F>(
224 inner: T,
225 interceptor: F,
226 ) -> InterceptedService<Self, F>
227 where
228 F: tonic::service::Interceptor,
229 {
230 InterceptedService::new(Self::new(inner), interceptor)
231 }
232 #[must_use]
234 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
235 self.accept_compression_encodings.enable(encoding);
236 self
237 }
238 #[must_use]
240 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
241 self.send_compression_encodings.enable(encoding);
242 self
243 }
244 #[must_use]
248 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
249 self.max_decoding_message_size = Some(limit);
250 self
251 }
252 #[must_use]
256 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
257 self.max_encoding_message_size = Some(limit);
258 self
259 }
260 }
261 impl<T, B> tonic::codegen::Service<http::Request<B>> for EventServiceServer<T>
262 where
263 T: EventService,
264 B: Body + std::marker::Send + 'static,
265 B::Error: Into<StdError> + std::marker::Send + 'static,
266 {
267 type Response = http::Response<tonic::body::Body>;
268 type Error = std::convert::Infallible;
269 type Future = BoxFuture<Self::Response, Self::Error>;
270 fn poll_ready(
271 &mut self,
272 _cx: &mut Context<'_>,
273 ) -> Poll<std::result::Result<(), Self::Error>> {
274 Poll::Ready(Ok(()))
275 }
276 fn call(&mut self, req: http::Request<B>) -> Self::Future {
277 match req.uri().path() {
278 "/sui.rpc.alpha.EventService/ListAuthenticatedEvents" => {
279 #[allow(non_camel_case_types)]
280 struct ListAuthenticatedEventsSvc<T: EventService>(pub Arc<T>);
281 impl<
282 T: EventService,
283 > tonic::server::UnaryService<super::ListAuthenticatedEventsRequest>
284 for ListAuthenticatedEventsSvc<T> {
285 type Response = super::ListAuthenticatedEventsResponse;
286 type Future = BoxFuture<
287 tonic::Response<Self::Response>,
288 tonic::Status,
289 >;
290 fn call(
291 &mut self,
292 request: tonic::Request<
293 super::ListAuthenticatedEventsRequest,
294 >,
295 ) -> Self::Future {
296 let inner = Arc::clone(&self.0);
297 let fut = async move {
298 <T as EventService>::list_authenticated_events(
299 &inner,
300 request,
301 )
302 .await
303 };
304 Box::pin(fut)
305 }
306 }
307 let accept_compression_encodings = self.accept_compression_encodings;
308 let send_compression_encodings = self.send_compression_encodings;
309 let max_decoding_message_size = self.max_decoding_message_size;
310 let max_encoding_message_size = self.max_encoding_message_size;
311 let inner = self.inner.clone();
312 let fut = async move {
313 let method = ListAuthenticatedEventsSvc(inner);
314 let codec = tonic_prost::ProstCodec::default();
315 let mut grpc = tonic::server::Grpc::new(codec)
316 .apply_compression_config(
317 accept_compression_encodings,
318 send_compression_encodings,
319 )
320 .apply_max_message_size_config(
321 max_decoding_message_size,
322 max_encoding_message_size,
323 );
324 let res = grpc.unary(method, req).await;
325 Ok(res)
326 };
327 Box::pin(fut)
328 }
329 _ => {
330 Box::pin(async move {
331 let mut response = http::Response::new(
332 tonic::body::Body::default(),
333 );
334 let headers = response.headers_mut();
335 headers
336 .insert(
337 tonic::Status::GRPC_STATUS,
338 (tonic::Code::Unimplemented as i32).into(),
339 );
340 headers
341 .insert(
342 http::header::CONTENT_TYPE,
343 tonic::metadata::GRPC_CONTENT_TYPE,
344 );
345 Ok(response)
346 })
347 }
348 }
349 }
350 }
351 impl<T> Clone for EventServiceServer<T> {
352 fn clone(&self) -> Self {
353 let inner = self.inner.clone();
354 Self {
355 inner,
356 accept_compression_encodings: self.accept_compression_encodings,
357 send_compression_encodings: self.send_compression_encodings,
358 max_decoding_message_size: self.max_decoding_message_size,
359 max_encoding_message_size: self.max_encoding_message_size,
360 }
361 }
362 }
363 pub const SERVICE_NAME: &str = "sui.rpc.alpha.EventService";
365 impl<T> tonic::server::NamedService for EventServiceServer<T> {
366 const NAME: &'static str = SERVICE_NAME;
367 }
368}
369#[non_exhaustive]
371#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
372pub struct OcsInclusionProof {
373 #[prost(bytes = "vec", optional, tag = "1")]
375 pub merkle_proof: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
376 #[prost(uint64, optional, tag = "2")]
378 pub leaf_index: ::core::option::Option<u64>,
379 #[prost(bytes = "vec", optional, tag = "3")]
381 pub tree_root: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
382}
383#[non_exhaustive]
385#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
386pub struct GetObjectInclusionProofRequest {
387 #[prost(string, optional, tag = "1")]
389 pub object_id: ::core::option::Option<::prost::alloc::string::String>,
390 #[prost(uint64, optional, tag = "2")]
392 pub checkpoint: ::core::option::Option<u64>,
393}
394#[non_exhaustive]
396#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
397pub struct GetObjectInclusionProofResponse {
398 #[prost(message, optional, tag = "1")]
400 pub object_ref: ::core::option::Option<
401 ::sui_rpc::proto::sui::rpc::v2::ObjectReference,
402 >,
403 #[prost(message, optional, tag = "2")]
405 pub inclusion_proof: ::core::option::Option<OcsInclusionProof>,
406 #[prost(bytes = "vec", optional, tag = "3")]
408 pub object_data: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
409}
410pub mod proof_service_client {
412 #![allow(
413 unused_variables,
414 dead_code,
415 missing_docs,
416 clippy::wildcard_imports,
417 clippy::let_unit_value,
418 )]
419 use tonic::codegen::*;
420 use tonic::codegen::http::Uri;
421 #[derive(Debug, Clone)]
423 pub struct ProofServiceClient<T> {
424 inner: tonic::client::Grpc<T>,
425 }
426 impl ProofServiceClient<tonic::transport::Channel> {
427 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
429 where
430 D: TryInto<tonic::transport::Endpoint>,
431 D::Error: Into<StdError>,
432 {
433 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
434 Ok(Self::new(conn))
435 }
436 }
437 impl<T> ProofServiceClient<T>
438 where
439 T: tonic::client::GrpcService<tonic::body::Body>,
440 T::Error: Into<StdError>,
441 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
442 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
443 {
444 pub fn new(inner: T) -> Self {
445 let inner = tonic::client::Grpc::new(inner);
446 Self { inner }
447 }
448 pub fn with_origin(inner: T, origin: Uri) -> Self {
449 let inner = tonic::client::Grpc::with_origin(inner, origin);
450 Self { inner }
451 }
452 pub fn with_interceptor<F>(
453 inner: T,
454 interceptor: F,
455 ) -> ProofServiceClient<InterceptedService<T, F>>
456 where
457 F: tonic::service::Interceptor,
458 T::ResponseBody: Default,
459 T: tonic::codegen::Service<
460 http::Request<tonic::body::Body>,
461 Response = http::Response<
462 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
463 >,
464 >,
465 <T as tonic::codegen::Service<
466 http::Request<tonic::body::Body>,
467 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
468 {
469 ProofServiceClient::new(InterceptedService::new(inner, interceptor))
470 }
471 #[must_use]
476 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
477 self.inner = self.inner.send_compressed(encoding);
478 self
479 }
480 #[must_use]
482 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
483 self.inner = self.inner.accept_compressed(encoding);
484 self
485 }
486 #[must_use]
490 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
491 self.inner = self.inner.max_decoding_message_size(limit);
492 self
493 }
494 #[must_use]
498 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
499 self.inner = self.inner.max_encoding_message_size(limit);
500 self
501 }
502 pub async fn get_object_inclusion_proof(
504 &mut self,
505 request: impl tonic::IntoRequest<super::GetObjectInclusionProofRequest>,
506 ) -> std::result::Result<
507 tonic::Response<super::GetObjectInclusionProofResponse>,
508 tonic::Status,
509 > {
510 self.inner
511 .ready()
512 .await
513 .map_err(|e| {
514 tonic::Status::unknown(
515 format!("Service was not ready: {}", e.into()),
516 )
517 })?;
518 let codec = tonic_prost::ProstCodec::default();
519 let path = http::uri::PathAndQuery::from_static(
520 "/sui.rpc.alpha.ProofService/GetObjectInclusionProof",
521 );
522 let mut req = request.into_request();
523 req.extensions_mut()
524 .insert(
525 GrpcMethod::new(
526 "sui.rpc.alpha.ProofService",
527 "GetObjectInclusionProof",
528 ),
529 );
530 self.inner.unary(req, path, codec).await
531 }
532 }
533}
534pub mod proof_service_server {
536 #![allow(
537 unused_variables,
538 dead_code,
539 missing_docs,
540 clippy::wildcard_imports,
541 clippy::let_unit_value,
542 )]
543 use tonic::codegen::*;
544 #[async_trait]
546 pub trait ProofService: std::marker::Send + std::marker::Sync + 'static {
547 async fn get_object_inclusion_proof(
549 &self,
550 request: tonic::Request<super::GetObjectInclusionProofRequest>,
551 ) -> std::result::Result<
552 tonic::Response<super::GetObjectInclusionProofResponse>,
553 tonic::Status,
554 >;
555 }
556 #[derive(Debug)]
558 pub struct ProofServiceServer<T> {
559 inner: Arc<T>,
560 accept_compression_encodings: EnabledCompressionEncodings,
561 send_compression_encodings: EnabledCompressionEncodings,
562 max_decoding_message_size: Option<usize>,
563 max_encoding_message_size: Option<usize>,
564 }
565 impl<T> ProofServiceServer<T> {
566 pub fn new(inner: T) -> Self {
567 Self::from_arc(Arc::new(inner))
568 }
569 pub fn from_arc(inner: Arc<T>) -> Self {
570 Self {
571 inner,
572 accept_compression_encodings: Default::default(),
573 send_compression_encodings: Default::default(),
574 max_decoding_message_size: None,
575 max_encoding_message_size: None,
576 }
577 }
578 pub fn with_interceptor<F>(
579 inner: T,
580 interceptor: F,
581 ) -> InterceptedService<Self, F>
582 where
583 F: tonic::service::Interceptor,
584 {
585 InterceptedService::new(Self::new(inner), interceptor)
586 }
587 #[must_use]
589 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
590 self.accept_compression_encodings.enable(encoding);
591 self
592 }
593 #[must_use]
595 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
596 self.send_compression_encodings.enable(encoding);
597 self
598 }
599 #[must_use]
603 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
604 self.max_decoding_message_size = Some(limit);
605 self
606 }
607 #[must_use]
611 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
612 self.max_encoding_message_size = Some(limit);
613 self
614 }
615 }
616 impl<T, B> tonic::codegen::Service<http::Request<B>> for ProofServiceServer<T>
617 where
618 T: ProofService,
619 B: Body + std::marker::Send + 'static,
620 B::Error: Into<StdError> + std::marker::Send + 'static,
621 {
622 type Response = http::Response<tonic::body::Body>;
623 type Error = std::convert::Infallible;
624 type Future = BoxFuture<Self::Response, Self::Error>;
625 fn poll_ready(
626 &mut self,
627 _cx: &mut Context<'_>,
628 ) -> Poll<std::result::Result<(), Self::Error>> {
629 Poll::Ready(Ok(()))
630 }
631 fn call(&mut self, req: http::Request<B>) -> Self::Future {
632 match req.uri().path() {
633 "/sui.rpc.alpha.ProofService/GetObjectInclusionProof" => {
634 #[allow(non_camel_case_types)]
635 struct GetObjectInclusionProofSvc<T: ProofService>(pub Arc<T>);
636 impl<
637 T: ProofService,
638 > tonic::server::UnaryService<super::GetObjectInclusionProofRequest>
639 for GetObjectInclusionProofSvc<T> {
640 type Response = super::GetObjectInclusionProofResponse;
641 type Future = BoxFuture<
642 tonic::Response<Self::Response>,
643 tonic::Status,
644 >;
645 fn call(
646 &mut self,
647 request: tonic::Request<
648 super::GetObjectInclusionProofRequest,
649 >,
650 ) -> Self::Future {
651 let inner = Arc::clone(&self.0);
652 let fut = async move {
653 <T as ProofService>::get_object_inclusion_proof(
654 &inner,
655 request,
656 )
657 .await
658 };
659 Box::pin(fut)
660 }
661 }
662 let accept_compression_encodings = self.accept_compression_encodings;
663 let send_compression_encodings = self.send_compression_encodings;
664 let max_decoding_message_size = self.max_decoding_message_size;
665 let max_encoding_message_size = self.max_encoding_message_size;
666 let inner = self.inner.clone();
667 let fut = async move {
668 let method = GetObjectInclusionProofSvc(inner);
669 let codec = tonic_prost::ProstCodec::default();
670 let mut grpc = tonic::server::Grpc::new(codec)
671 .apply_compression_config(
672 accept_compression_encodings,
673 send_compression_encodings,
674 )
675 .apply_max_message_size_config(
676 max_decoding_message_size,
677 max_encoding_message_size,
678 );
679 let res = grpc.unary(method, req).await;
680 Ok(res)
681 };
682 Box::pin(fut)
683 }
684 _ => {
685 Box::pin(async move {
686 let mut response = http::Response::new(
687 tonic::body::Body::default(),
688 );
689 let headers = response.headers_mut();
690 headers
691 .insert(
692 tonic::Status::GRPC_STATUS,
693 (tonic::Code::Unimplemented as i32).into(),
694 );
695 headers
696 .insert(
697 http::header::CONTENT_TYPE,
698 tonic::metadata::GRPC_CONTENT_TYPE,
699 );
700 Ok(response)
701 })
702 }
703 }
704 }
705 }
706 impl<T> Clone for ProofServiceServer<T> {
707 fn clone(&self) -> Self {
708 let inner = self.inner.clone();
709 Self {
710 inner,
711 accept_compression_encodings: self.accept_compression_encodings,
712 send_compression_encodings: self.send_compression_encodings,
713 max_decoding_message_size: self.max_decoding_message_size,
714 max_encoding_message_size: self.max_encoding_message_size,
715 }
716 }
717 }
718 pub const SERVICE_NAME: &str = "sui.rpc.alpha.ProofService";
720 impl<T> tonic::server::NamedService for ProofServiceServer<T> {
721 const NAME: &'static str = SERVICE_NAME;
722 }
723}