penumbra_sdk_proto/gen/
penumbra.core.component.auction.v1.rs

1// This file is @generated by prost-build.
2/// The configuration parameters for the auction component.
3#[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/// Genesis data for the auction component.
16#[derive(Clone, Copy, PartialEq, ::prost::Message)]
17pub struct GenesisContent {
18    /// The configuration parameters for the auction component at genesis.
19    #[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    /// If present, the state of the auction. If not present, no such auction is known.
50    #[prost(message, optional, tag = "2")]
51    pub auction: ::core::option::Option<::pbjson_types::Any>,
52    /// The state of any DEX positions relevant to the returned auction.
53    ///
54    /// Could be empty, depending on the auction state.
55    #[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    /// The auction IDs to request. Only known IDs will be returned in the response.
71    #[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    /// The auction ID of the returned auction.
87    #[prost(message, optional, tag = "1")]
88    pub id: ::core::option::Option<AuctionId>,
89    /// The state of the returned auction.
90    #[prost(message, optional, tag = "2")]
91    pub auction: ::core::option::Option<DutchAuctionState>,
92    /// The state of any DEX positions relevant to the returned auction.
93    ///
94    /// Could be empty, depending on the auction state.
95    #[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/// A unique identifier for an auction, obtained from hashing a domain separator
109/// along with the immutable part of an auction description.
110#[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/// A bearer NFT tracking ownership of an auction and its proceeds.
126#[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/// Describes a Dutch auction using programmatic liquidity on the DEX.
144#[derive(Clone, PartialEq, ::prost::Message)]
145pub struct DutchAuctionDescription {
146    /// The value the seller wishes to auction.
147    #[prost(message, optional, tag = "1")]
148    pub input: ::core::option::Option<super::super::super::asset::v1::Value>,
149    /// The asset ID of the target asset the seller wishes to acquire.
150    #[prost(message, optional, tag = "2")]
151    pub output_id: ::core::option::Option<super::super::super::asset::v1::AssetId>,
152    /// The maximum output the seller can receive.
153    ///
154    /// This implicitly defines the starting price for the auction.
155    #[prost(message, optional, tag = "3")]
156    pub max_output: ::core::option::Option<super::super::super::num::v1::Amount>,
157    /// The minimum output the seller is willing to receive.
158    ///
159    /// This implicitly defines the ending price for the auction.
160    #[prost(message, optional, tag = "4")]
161    pub min_output: ::core::option::Option<super::super::super::num::v1::Amount>,
162    /// The block height at which the auction begins.
163    ///
164    /// This allows the seller to schedule an auction at a future time.
165    #[prost(uint64, tag = "5")]
166    pub start_height: u64,
167    /// The block height at which the auction ends.
168    ///
169    /// Together with `start_height`, `max_output`, and `min_output`,
170    /// this implicitly defines the speed of the auction.
171    #[prost(uint64, tag = "6")]
172    pub end_height: u64,
173    /// The number of discrete price steps to use for the auction.
174    ///
175    /// `end_height - start_height` must be a multiple of `step_count`.
176    #[prost(uint64, tag = "7")]
177    pub step_count: u64,
178    /// A random nonce used to allow identical auctions to have
179    /// distinct auction IDs.
180    #[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    /// The sequence number of the auction state.
196    ///
197    /// Dutch auctions move from:
198    /// 0 (opened) => 1 (closed) => n (withdrawn)
199    #[prost(uint64, tag = "1")]
200    pub seq: u64,
201    /// If present, the current position controlled by this auction.
202    #[prost(message, optional, tag = "2")]
203    pub current_position: ::core::option::Option<super::super::dex::v1::PositionId>,
204    /// If present, the next trigger height to step down the price.
205    #[prost(uint64, tag = "3")]
206    pub next_trigger: u64,
207    /// The amount of the input asset directly owned by the auction.
208    ///
209    /// The auction may also own the input asset indirectly,
210    /// via the reserves of `current_position` if it exists.
211    #[prost(message, optional, tag = "4")]
212    pub input_reserves: ::core::option::Option<super::super::super::num::v1::Amount>,
213    /// The amount of the output asset directly owned by the auction.
214    ///
215    /// The auction may also own the output asset indirectly,
216    /// via the reserves of `current_position` if it exists.
217    #[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    /// The immutable data describing the auction and its auction ID.
233    #[prost(message, optional, tag = "1")]
234    pub description: ::core::option::Option<DutchAuctionDescription>,
235    /// The mutable data describing the auction's execution.
236    #[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/// Initiates a Dutch auction using protocol-controlled liquidity.
250#[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/// Terminate the auction associated with the specified `auction_id`
266#[derive(Clone, PartialEq, ::prost::Message)]
267pub struct ActionDutchAuctionEnd {
268    /// The auction to end.
269    #[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/// Withdraw funds from the ended auction associated with the specified `auction_id`
283#[derive(Clone, PartialEq, ::prost::Message)]
284pub struct ActionDutchAuctionWithdraw {
285    /// The auction to withdraw funds from.
286    #[prost(message, optional, tag = "1")]
287    pub auction_id: ::core::option::Option<AuctionId>,
288    /// The sequence number of the withdrawal.
289    #[prost(uint64, tag = "2")]
290    pub seq: u64,
291    /// A transparent (zero blinding factor) commitment to the
292    /// auction's final reserves.
293    ///
294    /// The chain will check this commitment by recomputing it
295    /// with the on-chain state.
296    #[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/// A plan to a `ActionDutchAuctionWithdraw` which contains both private and public data.
312#[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/// An `ActionDutchAuctionSchedule` augmented with additional metadata.
334#[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/// An `ActionDutchAuctionWithdraw` augmented with additional metadata.
358#[derive(Clone, PartialEq, ::prost::Message)]
359pub struct ActionDutchAuctionWithdrawView {
360    #[prost(message, optional, tag = "1")]
361    pub action: ::core::option::Option<ActionDutchAuctionWithdraw>,
362    /// A sequence of values that sum together to the provided
363    /// reserves commitment.
364    #[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}
420/// Nested message and enum types in `EventDutchAuctionEnded`.
421pub mod event_dutch_auction_ended {
422    /// The reason the auction ended.
423    #[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        /// The auction ended due to reaching its terminal height.
438        Expired = 1,
439        /// The auction ran out of reserves.
440        Filled = 2,
441        /// The auction ended was terminated by the initiator.
442        ClosedByOwner = 3,
443    }
444    impl Reason {
445        /// String value of the enum field names used in the ProtoBuf definition.
446        ///
447        /// The values are not transformed in any way and thus are considered stable
448        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
449        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        /// Creates an enum from field names used in the ProtoBuf definition.
458        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/// A message emitted when value flows *into* the auction component.
497#[derive(Clone, PartialEq, ::prost::Message)]
498pub struct EventValueCircuitBreakerCredit {
499    /// The asset ID being deposited into the Auction component.
500    #[prost(message, optional, tag = "1")]
501    pub asset_id: ::core::option::Option<super::super::super::asset::v1::AssetId>,
502    /// The previous balance of the asset in the Auction component.
503    #[prost(message, optional, tag = "2")]
504    pub previous_balance: ::core::option::Option<super::super::super::num::v1::Amount>,
505    /// The new balance of the asset in the Auction component.
506    #[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/// A message emitted when value flows *out* of the auction component.
520#[derive(Clone, PartialEq, ::prost::Message)]
521pub struct EventValueCircuitBreakerDebit {
522    /// The asset ID being deposited into the Auction component.
523    #[prost(message, optional, tag = "1")]
524    pub asset_id: ::core::option::Option<super::super::super::asset::v1::AssetId>,
525    /// The previous balance of the asset in the Auction component.
526    #[prost(message, optional, tag = "2")]
527    pub previous_balance: ::core::option::Option<super::super::super::num::v1::Amount>,
528    /// The new balance of the asset in the Auction component.
529    #[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/// Generated client implementations.
543#[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    /// Query operations for the auction component.
555    #[derive(Debug, Clone)]
556    pub struct QueryServiceClient<T> {
557        inner: tonic::client::Grpc<T>,
558    }
559    impl QueryServiceClient<tonic::transport::Channel> {
560        /// Attempt to create a new client by connecting to a given endpoint.
561        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        /// Compress requests with the given encoding.
605        ///
606        /// This requires the server to support it otherwise it might respond with an
607        /// error.
608        #[must_use]
609        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
610            self.inner = self.inner.send_compressed(encoding);
611            self
612        }
613        /// Enable decompressing responses.
614        #[must_use]
615        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
616            self.inner = self.inner.accept_compressed(encoding);
617            self
618        }
619        /// Limits the maximum size of a decoded message.
620        ///
621        /// Default: `4MB`
622        #[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        /// Limits the maximum size of an encoded message.
628        ///
629        /// Default: `usize::MAX`
630        #[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        /// Get the current state of an auction by ID.
636        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        /// Get the current state of a group of auctions by ID.
666        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/// Generated server implementations.
698#[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    /// Generated trait containing gRPC methods that should be implemented for use with QueryServiceServer.
709    #[async_trait]
710    pub trait QueryService: std::marker::Send + std::marker::Sync + 'static {
711        /// Get the current state of an auction by ID.
712        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        /// Server streaming response type for the AuctionStateByIds method.
720        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        /// Get the current state of a group of auctions by ID.
729        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    /// Query operations for the auction component.
738    #[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        /// Enable decompressing requests with the given encoding.
769        #[must_use]
770        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
771            self.accept_compression_encodings.enable(encoding);
772            self
773        }
774        /// Compress responses with the given encoding, if the client supports it.
775        #[must_use]
776        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
777            self.send_compression_encodings.enable(encoding);
778            self
779        }
780        /// Limits the maximum size of a decoded message.
781        ///
782        /// Default: `4MB`
783        #[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        /// Limits the maximum size of an encoded message.
789        ///
790        /// Default: `usize::MAX`
791        #[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    /// Generated gRPC service name
941    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}