1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
4pub struct AuctionParameters {}
5impl ::prost::Name for AuctionParameters {
6 const NAME: &'static str = "AuctionParameters";
7 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
8 fn full_name() -> ::prost::alloc::string::String {
9 "penumbra.core.component.auction.v1.AuctionParameters".into()
10 }
11 fn type_url() -> ::prost::alloc::string::String {
12 "/penumbra.core.component.auction.v1.AuctionParameters".into()
13 }
14}
15#[derive(Clone, Copy, PartialEq, ::prost::Message)]
17pub struct GenesisContent {
18 #[prost(message, optional, tag = "1")]
20 pub params: ::core::option::Option<AuctionParameters>,
21}
22impl ::prost::Name for GenesisContent {
23 const NAME: &'static str = "GenesisContent";
24 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
25 fn full_name() -> ::prost::alloc::string::String {
26 "penumbra.core.component.auction.v1.GenesisContent".into()
27 }
28 fn type_url() -> ::prost::alloc::string::String {
29 "/penumbra.core.component.auction.v1.GenesisContent".into()
30 }
31}
32#[derive(Clone, PartialEq, ::prost::Message)]
33pub struct AuctionStateByIdRequest {
34 #[prost(message, optional, tag = "1")]
35 pub id: ::core::option::Option<AuctionId>,
36}
37impl ::prost::Name for AuctionStateByIdRequest {
38 const NAME: &'static str = "AuctionStateByIdRequest";
39 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
40 fn full_name() -> ::prost::alloc::string::String {
41 "penumbra.core.component.auction.v1.AuctionStateByIdRequest".into()
42 }
43 fn type_url() -> ::prost::alloc::string::String {
44 "/penumbra.core.component.auction.v1.AuctionStateByIdRequest".into()
45 }
46}
47#[derive(Clone, PartialEq, ::prost::Message)]
48pub struct AuctionStateByIdResponse {
49 #[prost(message, optional, tag = "2")]
51 pub auction: ::core::option::Option<::pbjson_types::Any>,
52 #[prost(message, repeated, tag = "3")]
56 pub positions: ::prost::alloc::vec::Vec<super::super::dex::v1::Position>,
57}
58impl ::prost::Name for AuctionStateByIdResponse {
59 const NAME: &'static str = "AuctionStateByIdResponse";
60 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
61 fn full_name() -> ::prost::alloc::string::String {
62 "penumbra.core.component.auction.v1.AuctionStateByIdResponse".into()
63 }
64 fn type_url() -> ::prost::alloc::string::String {
65 "/penumbra.core.component.auction.v1.AuctionStateByIdResponse".into()
66 }
67}
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct AuctionStateByIdsRequest {
70 #[prost(message, repeated, tag = "1")]
72 pub id: ::prost::alloc::vec::Vec<AuctionId>,
73}
74impl ::prost::Name for AuctionStateByIdsRequest {
75 const NAME: &'static str = "AuctionStateByIdsRequest";
76 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
77 fn full_name() -> ::prost::alloc::string::String {
78 "penumbra.core.component.auction.v1.AuctionStateByIdsRequest".into()
79 }
80 fn type_url() -> ::prost::alloc::string::String {
81 "/penumbra.core.component.auction.v1.AuctionStateByIdsRequest".into()
82 }
83}
84#[derive(Clone, PartialEq, ::prost::Message)]
85pub struct AuctionStateByIdsResponse {
86 #[prost(message, optional, tag = "1")]
88 pub id: ::core::option::Option<AuctionId>,
89 #[prost(message, optional, tag = "2")]
91 pub auction: ::core::option::Option<DutchAuctionState>,
92 #[prost(message, repeated, tag = "3")]
96 pub positions: ::prost::alloc::vec::Vec<super::super::dex::v1::Position>,
97}
98impl ::prost::Name for AuctionStateByIdsResponse {
99 const NAME: &'static str = "AuctionStateByIdsResponse";
100 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
101 fn full_name() -> ::prost::alloc::string::String {
102 "penumbra.core.component.auction.v1.AuctionStateByIdsResponse".into()
103 }
104 fn type_url() -> ::prost::alloc::string::String {
105 "/penumbra.core.component.auction.v1.AuctionStateByIdsResponse".into()
106 }
107}
108#[derive(Clone, PartialEq, ::prost::Message)]
111pub struct AuctionId {
112 #[prost(bytes = "vec", tag = "1")]
113 pub inner: ::prost::alloc::vec::Vec<u8>,
114}
115impl ::prost::Name for AuctionId {
116 const NAME: &'static str = "AuctionId";
117 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
118 fn full_name() -> ::prost::alloc::string::String {
119 "penumbra.core.component.auction.v1.AuctionId".into()
120 }
121 fn type_url() -> ::prost::alloc::string::String {
122 "/penumbra.core.component.auction.v1.AuctionId".into()
123 }
124}
125#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct AuctionNft {
128 #[prost(message, optional, tag = "1")]
129 pub id: ::core::option::Option<AuctionId>,
130 #[prost(uint64, tag = "2")]
131 pub seq: u64,
132}
133impl ::prost::Name for AuctionNft {
134 const NAME: &'static str = "AuctionNft";
135 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
136 fn full_name() -> ::prost::alloc::string::String {
137 "penumbra.core.component.auction.v1.AuctionNft".into()
138 }
139 fn type_url() -> ::prost::alloc::string::String {
140 "/penumbra.core.component.auction.v1.AuctionNft".into()
141 }
142}
143#[derive(Clone, PartialEq, ::prost::Message)]
145pub struct DutchAuctionDescription {
146 #[prost(message, optional, tag = "1")]
148 pub input: ::core::option::Option<super::super::super::asset::v1::Value>,
149 #[prost(message, optional, tag = "2")]
151 pub output_id: ::core::option::Option<super::super::super::asset::v1::AssetId>,
152 #[prost(message, optional, tag = "3")]
156 pub max_output: ::core::option::Option<super::super::super::num::v1::Amount>,
157 #[prost(message, optional, tag = "4")]
161 pub min_output: ::core::option::Option<super::super::super::num::v1::Amount>,
162 #[prost(uint64, tag = "5")]
166 pub start_height: u64,
167 #[prost(uint64, tag = "6")]
172 pub end_height: u64,
173 #[prost(uint64, tag = "7")]
177 pub step_count: u64,
178 #[prost(bytes = "vec", tag = "8")]
181 pub nonce: ::prost::alloc::vec::Vec<u8>,
182}
183impl ::prost::Name for DutchAuctionDescription {
184 const NAME: &'static str = "DutchAuctionDescription";
185 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
186 fn full_name() -> ::prost::alloc::string::String {
187 "penumbra.core.component.auction.v1.DutchAuctionDescription".into()
188 }
189 fn type_url() -> ::prost::alloc::string::String {
190 "/penumbra.core.component.auction.v1.DutchAuctionDescription".into()
191 }
192}
193#[derive(Clone, PartialEq, ::prost::Message)]
194pub struct DutchAuctionState {
195 #[prost(uint64, tag = "1")]
200 pub seq: u64,
201 #[prost(message, optional, tag = "2")]
203 pub current_position: ::core::option::Option<super::super::dex::v1::PositionId>,
204 #[prost(uint64, tag = "3")]
206 pub next_trigger: u64,
207 #[prost(message, optional, tag = "4")]
212 pub input_reserves: ::core::option::Option<super::super::super::num::v1::Amount>,
213 #[prost(message, optional, tag = "5")]
218 pub output_reserves: ::core::option::Option<super::super::super::num::v1::Amount>,
219}
220impl ::prost::Name for DutchAuctionState {
221 const NAME: &'static str = "DutchAuctionState";
222 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
223 fn full_name() -> ::prost::alloc::string::String {
224 "penumbra.core.component.auction.v1.DutchAuctionState".into()
225 }
226 fn type_url() -> ::prost::alloc::string::String {
227 "/penumbra.core.component.auction.v1.DutchAuctionState".into()
228 }
229}
230#[derive(Clone, PartialEq, ::prost::Message)]
231pub struct DutchAuction {
232 #[prost(message, optional, tag = "1")]
234 pub description: ::core::option::Option<DutchAuctionDescription>,
235 #[prost(message, optional, tag = "2")]
237 pub state: ::core::option::Option<DutchAuctionState>,
238}
239impl ::prost::Name for DutchAuction {
240 const NAME: &'static str = "DutchAuction";
241 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
242 fn full_name() -> ::prost::alloc::string::String {
243 "penumbra.core.component.auction.v1.DutchAuction".into()
244 }
245 fn type_url() -> ::prost::alloc::string::String {
246 "/penumbra.core.component.auction.v1.DutchAuction".into()
247 }
248}
249#[derive(Clone, PartialEq, ::prost::Message)]
251pub struct ActionDutchAuctionSchedule {
252 #[prost(message, optional, tag = "1")]
253 pub description: ::core::option::Option<DutchAuctionDescription>,
254}
255impl ::prost::Name for ActionDutchAuctionSchedule {
256 const NAME: &'static str = "ActionDutchAuctionSchedule";
257 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
258 fn full_name() -> ::prost::alloc::string::String {
259 "penumbra.core.component.auction.v1.ActionDutchAuctionSchedule".into()
260 }
261 fn type_url() -> ::prost::alloc::string::String {
262 "/penumbra.core.component.auction.v1.ActionDutchAuctionSchedule".into()
263 }
264}
265#[derive(Clone, PartialEq, ::prost::Message)]
267pub struct ActionDutchAuctionEnd {
268 #[prost(message, optional, tag = "1")]
270 pub auction_id: ::core::option::Option<AuctionId>,
271}
272impl ::prost::Name for ActionDutchAuctionEnd {
273 const NAME: &'static str = "ActionDutchAuctionEnd";
274 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
275 fn full_name() -> ::prost::alloc::string::String {
276 "penumbra.core.component.auction.v1.ActionDutchAuctionEnd".into()
277 }
278 fn type_url() -> ::prost::alloc::string::String {
279 "/penumbra.core.component.auction.v1.ActionDutchAuctionEnd".into()
280 }
281}
282#[derive(Clone, PartialEq, ::prost::Message)]
284pub struct ActionDutchAuctionWithdraw {
285 #[prost(message, optional, tag = "1")]
287 pub auction_id: ::core::option::Option<AuctionId>,
288 #[prost(uint64, tag = "2")]
290 pub seq: u64,
291 #[prost(message, optional, tag = "3")]
297 pub reserves_commitment: ::core::option::Option<
298 super::super::super::asset::v1::BalanceCommitment,
299 >,
300}
301impl ::prost::Name for ActionDutchAuctionWithdraw {
302 const NAME: &'static str = "ActionDutchAuctionWithdraw";
303 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
304 fn full_name() -> ::prost::alloc::string::String {
305 "penumbra.core.component.auction.v1.ActionDutchAuctionWithdraw".into()
306 }
307 fn type_url() -> ::prost::alloc::string::String {
308 "/penumbra.core.component.auction.v1.ActionDutchAuctionWithdraw".into()
309 }
310}
311#[derive(Clone, PartialEq, ::prost::Message)]
313pub struct ActionDutchAuctionWithdrawPlan {
314 #[prost(message, optional, tag = "1")]
315 pub auction_id: ::core::option::Option<AuctionId>,
316 #[prost(uint64, tag = "2")]
317 pub seq: u64,
318 #[prost(message, optional, tag = "3")]
319 pub reserves_input: ::core::option::Option<super::super::super::asset::v1::Value>,
320 #[prost(message, optional, tag = "4")]
321 pub reserves_output: ::core::option::Option<super::super::super::asset::v1::Value>,
322}
323impl ::prost::Name for ActionDutchAuctionWithdrawPlan {
324 const NAME: &'static str = "ActionDutchAuctionWithdrawPlan";
325 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
326 fn full_name() -> ::prost::alloc::string::String {
327 "penumbra.core.component.auction.v1.ActionDutchAuctionWithdrawPlan".into()
328 }
329 fn type_url() -> ::prost::alloc::string::String {
330 "/penumbra.core.component.auction.v1.ActionDutchAuctionWithdrawPlan".into()
331 }
332}
333#[derive(Clone, PartialEq, ::prost::Message)]
335pub struct ActionDutchAuctionScheduleView {
336 #[prost(message, optional, tag = "1")]
337 pub action: ::core::option::Option<ActionDutchAuctionSchedule>,
338 #[prost(message, optional, tag = "2")]
339 pub auction_id: ::core::option::Option<AuctionId>,
340 #[prost(message, optional, tag = "3")]
341 pub input_metadata: ::core::option::Option<super::super::super::asset::v1::Metadata>,
342 #[prost(message, optional, tag = "4")]
343 pub output_metadata: ::core::option::Option<
344 super::super::super::asset::v1::Metadata,
345 >,
346}
347impl ::prost::Name for ActionDutchAuctionScheduleView {
348 const NAME: &'static str = "ActionDutchAuctionScheduleView";
349 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
350 fn full_name() -> ::prost::alloc::string::String {
351 "penumbra.core.component.auction.v1.ActionDutchAuctionScheduleView".into()
352 }
353 fn type_url() -> ::prost::alloc::string::String {
354 "/penumbra.core.component.auction.v1.ActionDutchAuctionScheduleView".into()
355 }
356}
357#[derive(Clone, PartialEq, ::prost::Message)]
359pub struct ActionDutchAuctionWithdrawView {
360 #[prost(message, optional, tag = "1")]
361 pub action: ::core::option::Option<ActionDutchAuctionWithdraw>,
362 #[prost(message, repeated, tag = "2")]
365 pub reserves: ::prost::alloc::vec::Vec<super::super::super::asset::v1::ValueView>,
366}
367impl ::prost::Name for ActionDutchAuctionWithdrawView {
368 const NAME: &'static str = "ActionDutchAuctionWithdrawView";
369 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
370 fn full_name() -> ::prost::alloc::string::String {
371 "penumbra.core.component.auction.v1.ActionDutchAuctionWithdrawView".into()
372 }
373 fn type_url() -> ::prost::alloc::string::String {
374 "/penumbra.core.component.auction.v1.ActionDutchAuctionWithdrawView".into()
375 }
376}
377#[derive(Clone, PartialEq, ::prost::Message)]
378pub struct EventDutchAuctionScheduled {
379 #[prost(message, optional, tag = "1")]
380 pub auction_id: ::core::option::Option<AuctionId>,
381 #[prost(message, optional, tag = "2")]
382 pub description: ::core::option::Option<DutchAuctionDescription>,
383}
384impl ::prost::Name for EventDutchAuctionScheduled {
385 const NAME: &'static str = "EventDutchAuctionScheduled";
386 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
387 fn full_name() -> ::prost::alloc::string::String {
388 "penumbra.core.component.auction.v1.EventDutchAuctionScheduled".into()
389 }
390 fn type_url() -> ::prost::alloc::string::String {
391 "/penumbra.core.component.auction.v1.EventDutchAuctionScheduled".into()
392 }
393}
394#[derive(Clone, PartialEq, ::prost::Message)]
395pub struct EventDutchAuctionUpdated {
396 #[prost(message, optional, tag = "1")]
397 pub auction_id: ::core::option::Option<AuctionId>,
398 #[prost(message, optional, tag = "2")]
399 pub state: ::core::option::Option<DutchAuctionState>,
400}
401impl ::prost::Name for EventDutchAuctionUpdated {
402 const NAME: &'static str = "EventDutchAuctionUpdated";
403 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
404 fn full_name() -> ::prost::alloc::string::String {
405 "penumbra.core.component.auction.v1.EventDutchAuctionUpdated".into()
406 }
407 fn type_url() -> ::prost::alloc::string::String {
408 "/penumbra.core.component.auction.v1.EventDutchAuctionUpdated".into()
409 }
410}
411#[derive(Clone, PartialEq, ::prost::Message)]
412pub struct EventDutchAuctionEnded {
413 #[prost(message, optional, tag = "1")]
414 pub auction_id: ::core::option::Option<AuctionId>,
415 #[prost(message, optional, tag = "2")]
416 pub state: ::core::option::Option<DutchAuctionState>,
417 #[prost(enumeration = "event_dutch_auction_ended::Reason", tag = "3")]
418 pub reason: i32,
419}
420pub mod event_dutch_auction_ended {
422 #[derive(
424 Clone,
425 Copy,
426 Debug,
427 PartialEq,
428 Eq,
429 Hash,
430 PartialOrd,
431 Ord,
432 ::prost::Enumeration
433 )]
434 #[repr(i32)]
435 pub enum Reason {
436 Unspecified = 0,
437 Expired = 1,
439 Filled = 2,
441 ClosedByOwner = 3,
443 }
444 impl Reason {
445 pub fn as_str_name(&self) -> &'static str {
450 match self {
451 Self::Unspecified => "REASON_UNSPECIFIED",
452 Self::Expired => "REASON_EXPIRED",
453 Self::Filled => "REASON_FILLED",
454 Self::ClosedByOwner => "REASON_CLOSED_BY_OWNER",
455 }
456 }
457 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
459 match value {
460 "REASON_UNSPECIFIED" => Some(Self::Unspecified),
461 "REASON_EXPIRED" => Some(Self::Expired),
462 "REASON_FILLED" => Some(Self::Filled),
463 "REASON_CLOSED_BY_OWNER" => Some(Self::ClosedByOwner),
464 _ => None,
465 }
466 }
467 }
468}
469impl ::prost::Name for EventDutchAuctionEnded {
470 const NAME: &'static str = "EventDutchAuctionEnded";
471 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
472 fn full_name() -> ::prost::alloc::string::String {
473 "penumbra.core.component.auction.v1.EventDutchAuctionEnded".into()
474 }
475 fn type_url() -> ::prost::alloc::string::String {
476 "/penumbra.core.component.auction.v1.EventDutchAuctionEnded".into()
477 }
478}
479#[derive(Clone, PartialEq, ::prost::Message)]
480pub struct EventDutchAuctionWithdrawn {
481 #[prost(message, optional, tag = "1")]
482 pub auction_id: ::core::option::Option<AuctionId>,
483 #[prost(message, optional, tag = "2")]
484 pub state: ::core::option::Option<DutchAuctionState>,
485}
486impl ::prost::Name for EventDutchAuctionWithdrawn {
487 const NAME: &'static str = "EventDutchAuctionWithdrawn";
488 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
489 fn full_name() -> ::prost::alloc::string::String {
490 "penumbra.core.component.auction.v1.EventDutchAuctionWithdrawn".into()
491 }
492 fn type_url() -> ::prost::alloc::string::String {
493 "/penumbra.core.component.auction.v1.EventDutchAuctionWithdrawn".into()
494 }
495}
496#[derive(Clone, PartialEq, ::prost::Message)]
498pub struct EventValueCircuitBreakerCredit {
499 #[prost(message, optional, tag = "1")]
501 pub asset_id: ::core::option::Option<super::super::super::asset::v1::AssetId>,
502 #[prost(message, optional, tag = "2")]
504 pub previous_balance: ::core::option::Option<super::super::super::num::v1::Amount>,
505 #[prost(message, optional, tag = "3")]
507 pub new_balance: ::core::option::Option<super::super::super::num::v1::Amount>,
508}
509impl ::prost::Name for EventValueCircuitBreakerCredit {
510 const NAME: &'static str = "EventValueCircuitBreakerCredit";
511 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
512 fn full_name() -> ::prost::alloc::string::String {
513 "penumbra.core.component.auction.v1.EventValueCircuitBreakerCredit".into()
514 }
515 fn type_url() -> ::prost::alloc::string::String {
516 "/penumbra.core.component.auction.v1.EventValueCircuitBreakerCredit".into()
517 }
518}
519#[derive(Clone, PartialEq, ::prost::Message)]
521pub struct EventValueCircuitBreakerDebit {
522 #[prost(message, optional, tag = "1")]
524 pub asset_id: ::core::option::Option<super::super::super::asset::v1::AssetId>,
525 #[prost(message, optional, tag = "2")]
527 pub previous_balance: ::core::option::Option<super::super::super::num::v1::Amount>,
528 #[prost(message, optional, tag = "3")]
530 pub new_balance: ::core::option::Option<super::super::super::num::v1::Amount>,
531}
532impl ::prost::Name for EventValueCircuitBreakerDebit {
533 const NAME: &'static str = "EventValueCircuitBreakerDebit";
534 const PACKAGE: &'static str = "penumbra.core.component.auction.v1";
535 fn full_name() -> ::prost::alloc::string::String {
536 "penumbra.core.component.auction.v1.EventValueCircuitBreakerDebit".into()
537 }
538 fn type_url() -> ::prost::alloc::string::String {
539 "/penumbra.core.component.auction.v1.EventValueCircuitBreakerDebit".into()
540 }
541}
542#[cfg(feature = "rpc")]
544pub mod query_service_client {
545 #![allow(
546 unused_variables,
547 dead_code,
548 missing_docs,
549 clippy::wildcard_imports,
550 clippy::let_unit_value,
551 )]
552 use tonic::codegen::*;
553 use tonic::codegen::http::Uri;
554 #[derive(Debug, Clone)]
556 pub struct QueryServiceClient<T> {
557 inner: tonic::client::Grpc<T>,
558 }
559 impl QueryServiceClient<tonic::transport::Channel> {
560 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
562 where
563 D: TryInto<tonic::transport::Endpoint>,
564 D::Error: Into<StdError>,
565 {
566 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
567 Ok(Self::new(conn))
568 }
569 }
570 impl<T> QueryServiceClient<T>
571 where
572 T: tonic::client::GrpcService<tonic::body::BoxBody>,
573 T::Error: Into<StdError>,
574 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
575 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
576 {
577 pub fn new(inner: T) -> Self {
578 let inner = tonic::client::Grpc::new(inner);
579 Self { inner }
580 }
581 pub fn with_origin(inner: T, origin: Uri) -> Self {
582 let inner = tonic::client::Grpc::with_origin(inner, origin);
583 Self { inner }
584 }
585 pub fn with_interceptor<F>(
586 inner: T,
587 interceptor: F,
588 ) -> QueryServiceClient<InterceptedService<T, F>>
589 where
590 F: tonic::service::Interceptor,
591 T::ResponseBody: Default,
592 T: tonic::codegen::Service<
593 http::Request<tonic::body::BoxBody>,
594 Response = http::Response<
595 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
596 >,
597 >,
598 <T as tonic::codegen::Service<
599 http::Request<tonic::body::BoxBody>,
600 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
601 {
602 QueryServiceClient::new(InterceptedService::new(inner, interceptor))
603 }
604 #[must_use]
609 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
610 self.inner = self.inner.send_compressed(encoding);
611 self
612 }
613 #[must_use]
615 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
616 self.inner = self.inner.accept_compressed(encoding);
617 self
618 }
619 #[must_use]
623 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
624 self.inner = self.inner.max_decoding_message_size(limit);
625 self
626 }
627 #[must_use]
631 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
632 self.inner = self.inner.max_encoding_message_size(limit);
633 self
634 }
635 pub async fn auction_state_by_id(
637 &mut self,
638 request: impl tonic::IntoRequest<super::AuctionStateByIdRequest>,
639 ) -> std::result::Result<
640 tonic::Response<super::AuctionStateByIdResponse>,
641 tonic::Status,
642 > {
643 self.inner
644 .ready()
645 .await
646 .map_err(|e| {
647 tonic::Status::unknown(
648 format!("Service was not ready: {}", e.into()),
649 )
650 })?;
651 let codec = tonic::codec::ProstCodec::default();
652 let path = http::uri::PathAndQuery::from_static(
653 "/penumbra.core.component.auction.v1.QueryService/AuctionStateById",
654 );
655 let mut req = request.into_request();
656 req.extensions_mut()
657 .insert(
658 GrpcMethod::new(
659 "penumbra.core.component.auction.v1.QueryService",
660 "AuctionStateById",
661 ),
662 );
663 self.inner.unary(req, path, codec).await
664 }
665 pub async fn auction_state_by_ids(
667 &mut self,
668 request: impl tonic::IntoRequest<super::AuctionStateByIdsRequest>,
669 ) -> std::result::Result<
670 tonic::Response<tonic::codec::Streaming<super::AuctionStateByIdsResponse>>,
671 tonic::Status,
672 > {
673 self.inner
674 .ready()
675 .await
676 .map_err(|e| {
677 tonic::Status::unknown(
678 format!("Service was not ready: {}", e.into()),
679 )
680 })?;
681 let codec = tonic::codec::ProstCodec::default();
682 let path = http::uri::PathAndQuery::from_static(
683 "/penumbra.core.component.auction.v1.QueryService/AuctionStateByIds",
684 );
685 let mut req = request.into_request();
686 req.extensions_mut()
687 .insert(
688 GrpcMethod::new(
689 "penumbra.core.component.auction.v1.QueryService",
690 "AuctionStateByIds",
691 ),
692 );
693 self.inner.server_streaming(req, path, codec).await
694 }
695 }
696}
697#[cfg(feature = "rpc")]
699pub mod query_service_server {
700 #![allow(
701 unused_variables,
702 dead_code,
703 missing_docs,
704 clippy::wildcard_imports,
705 clippy::let_unit_value,
706 )]
707 use tonic::codegen::*;
708 #[async_trait]
710 pub trait QueryService: std::marker::Send + std::marker::Sync + 'static {
711 async fn auction_state_by_id(
713 &self,
714 request: tonic::Request<super::AuctionStateByIdRequest>,
715 ) -> std::result::Result<
716 tonic::Response<super::AuctionStateByIdResponse>,
717 tonic::Status,
718 >;
719 type AuctionStateByIdsStream: tonic::codegen::tokio_stream::Stream<
721 Item = std::result::Result<
722 super::AuctionStateByIdsResponse,
723 tonic::Status,
724 >,
725 >
726 + std::marker::Send
727 + 'static;
728 async fn auction_state_by_ids(
730 &self,
731 request: tonic::Request<super::AuctionStateByIdsRequest>,
732 ) -> std::result::Result<
733 tonic::Response<Self::AuctionStateByIdsStream>,
734 tonic::Status,
735 >;
736 }
737 #[derive(Debug)]
739 pub struct QueryServiceServer<T> {
740 inner: Arc<T>,
741 accept_compression_encodings: EnabledCompressionEncodings,
742 send_compression_encodings: EnabledCompressionEncodings,
743 max_decoding_message_size: Option<usize>,
744 max_encoding_message_size: Option<usize>,
745 }
746 impl<T> QueryServiceServer<T> {
747 pub fn new(inner: T) -> Self {
748 Self::from_arc(Arc::new(inner))
749 }
750 pub fn from_arc(inner: Arc<T>) -> Self {
751 Self {
752 inner,
753 accept_compression_encodings: Default::default(),
754 send_compression_encodings: Default::default(),
755 max_decoding_message_size: None,
756 max_encoding_message_size: None,
757 }
758 }
759 pub fn with_interceptor<F>(
760 inner: T,
761 interceptor: F,
762 ) -> InterceptedService<Self, F>
763 where
764 F: tonic::service::Interceptor,
765 {
766 InterceptedService::new(Self::new(inner), interceptor)
767 }
768 #[must_use]
770 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
771 self.accept_compression_encodings.enable(encoding);
772 self
773 }
774 #[must_use]
776 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
777 self.send_compression_encodings.enable(encoding);
778 self
779 }
780 #[must_use]
784 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
785 self.max_decoding_message_size = Some(limit);
786 self
787 }
788 #[must_use]
792 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
793 self.max_encoding_message_size = Some(limit);
794 self
795 }
796 }
797 impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServiceServer<T>
798 where
799 T: QueryService,
800 B: Body + std::marker::Send + 'static,
801 B::Error: Into<StdError> + std::marker::Send + 'static,
802 {
803 type Response = http::Response<tonic::body::BoxBody>;
804 type Error = std::convert::Infallible;
805 type Future = BoxFuture<Self::Response, Self::Error>;
806 fn poll_ready(
807 &mut self,
808 _cx: &mut Context<'_>,
809 ) -> Poll<std::result::Result<(), Self::Error>> {
810 Poll::Ready(Ok(()))
811 }
812 fn call(&mut self, req: http::Request<B>) -> Self::Future {
813 match req.uri().path() {
814 "/penumbra.core.component.auction.v1.QueryService/AuctionStateById" => {
815 #[allow(non_camel_case_types)]
816 struct AuctionStateByIdSvc<T: QueryService>(pub Arc<T>);
817 impl<
818 T: QueryService,
819 > tonic::server::UnaryService<super::AuctionStateByIdRequest>
820 for AuctionStateByIdSvc<T> {
821 type Response = super::AuctionStateByIdResponse;
822 type Future = BoxFuture<
823 tonic::Response<Self::Response>,
824 tonic::Status,
825 >;
826 fn call(
827 &mut self,
828 request: tonic::Request<super::AuctionStateByIdRequest>,
829 ) -> Self::Future {
830 let inner = Arc::clone(&self.0);
831 let fut = async move {
832 <T as QueryService>::auction_state_by_id(&inner, request)
833 .await
834 };
835 Box::pin(fut)
836 }
837 }
838 let accept_compression_encodings = self.accept_compression_encodings;
839 let send_compression_encodings = self.send_compression_encodings;
840 let max_decoding_message_size = self.max_decoding_message_size;
841 let max_encoding_message_size = self.max_encoding_message_size;
842 let inner = self.inner.clone();
843 let fut = async move {
844 let method = AuctionStateByIdSvc(inner);
845 let codec = tonic::codec::ProstCodec::default();
846 let mut grpc = tonic::server::Grpc::new(codec)
847 .apply_compression_config(
848 accept_compression_encodings,
849 send_compression_encodings,
850 )
851 .apply_max_message_size_config(
852 max_decoding_message_size,
853 max_encoding_message_size,
854 );
855 let res = grpc.unary(method, req).await;
856 Ok(res)
857 };
858 Box::pin(fut)
859 }
860 "/penumbra.core.component.auction.v1.QueryService/AuctionStateByIds" => {
861 #[allow(non_camel_case_types)]
862 struct AuctionStateByIdsSvc<T: QueryService>(pub Arc<T>);
863 impl<
864 T: QueryService,
865 > tonic::server::ServerStreamingService<
866 super::AuctionStateByIdsRequest,
867 > for AuctionStateByIdsSvc<T> {
868 type Response = super::AuctionStateByIdsResponse;
869 type ResponseStream = T::AuctionStateByIdsStream;
870 type Future = BoxFuture<
871 tonic::Response<Self::ResponseStream>,
872 tonic::Status,
873 >;
874 fn call(
875 &mut self,
876 request: tonic::Request<super::AuctionStateByIdsRequest>,
877 ) -> Self::Future {
878 let inner = Arc::clone(&self.0);
879 let fut = async move {
880 <T as QueryService>::auction_state_by_ids(&inner, request)
881 .await
882 };
883 Box::pin(fut)
884 }
885 }
886 let accept_compression_encodings = self.accept_compression_encodings;
887 let send_compression_encodings = self.send_compression_encodings;
888 let max_decoding_message_size = self.max_decoding_message_size;
889 let max_encoding_message_size = self.max_encoding_message_size;
890 let inner = self.inner.clone();
891 let fut = async move {
892 let method = AuctionStateByIdsSvc(inner);
893 let codec = tonic::codec::ProstCodec::default();
894 let mut grpc = tonic::server::Grpc::new(codec)
895 .apply_compression_config(
896 accept_compression_encodings,
897 send_compression_encodings,
898 )
899 .apply_max_message_size_config(
900 max_decoding_message_size,
901 max_encoding_message_size,
902 );
903 let res = grpc.server_streaming(method, req).await;
904 Ok(res)
905 };
906 Box::pin(fut)
907 }
908 _ => {
909 Box::pin(async move {
910 let mut response = http::Response::new(empty_body());
911 let headers = response.headers_mut();
912 headers
913 .insert(
914 tonic::Status::GRPC_STATUS,
915 (tonic::Code::Unimplemented as i32).into(),
916 );
917 headers
918 .insert(
919 http::header::CONTENT_TYPE,
920 tonic::metadata::GRPC_CONTENT_TYPE,
921 );
922 Ok(response)
923 })
924 }
925 }
926 }
927 }
928 impl<T> Clone for QueryServiceServer<T> {
929 fn clone(&self) -> Self {
930 let inner = self.inner.clone();
931 Self {
932 inner,
933 accept_compression_encodings: self.accept_compression_encodings,
934 send_compression_encodings: self.send_compression_encodings,
935 max_decoding_message_size: self.max_decoding_message_size,
936 max_encoding_message_size: self.max_encoding_message_size,
937 }
938 }
939 }
940 pub const SERVICE_NAME: &str = "penumbra.core.component.auction.v1.QueryService";
942 impl<T> tonic::server::NamedService for QueryServiceServer<T> {
943 const NAME: &'static str = SERVICE_NAME;
944 }
945}