elys_std/types/elys/
tradeshield.rs

1use elys_std_deriv::CosmwasmExt;
2/// Params defines the parameters for the module.
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(
5    Clone,
6    PartialEq,
7    Eq,
8    ::prost::Message,
9    ::serde::Serialize,
10    ::serde::Deserialize,
11    ::schemars::JsonSchema,
12    CosmwasmExt,
13)]
14#[proto_message(type_url = "/elys.tradeshield.Params")]
15pub struct Params {
16    #[prost(bool, tag = "1")]
17    pub market_order_enabled: bool,
18    #[prost(bool, tag = "2")]
19    pub stake_enabled: bool,
20    #[prost(bool, tag = "3")]
21    pub process_orders_enabled: bool,
22    #[prost(bool, tag = "4")]
23    pub swap_enabled: bool,
24    #[prost(bool, tag = "5")]
25    pub perpetual_enabled: bool,
26    #[prost(bool, tag = "6")]
27    pub reward_enabled: bool,
28    #[prost(bool, tag = "7")]
29    pub leverage_enabled: bool,
30    #[prost(uint64, tag = "8")]
31    #[serde(
32        serialize_with = "crate::serde::as_str::serialize",
33        deserialize_with = "crate::serde::as_str::deserialize"
34    )]
35    pub limit_process_order: u64,
36    /// For incentive system v2
37    #[prost(string, tag = "9")]
38    pub reward_percentage: ::prost::alloc::string::String,
39    #[prost(string, tag = "10")]
40    pub margin_error: ::prost::alloc::string::String,
41    #[prost(string, tag = "11")]
42    pub minimum_deposit: ::prost::alloc::string::String,
43    #[prost(string, tag = "12")]
44    pub tolerance: ::prost::alloc::string::String,
45}
46#[allow(clippy::derive_partial_eq_without_eq)]
47#[derive(
48    Clone,
49    PartialEq,
50    Eq,
51    ::prost::Message,
52    ::serde::Serialize,
53    ::serde::Deserialize,
54    ::schemars::JsonSchema,
55    CosmwasmExt,
56)]
57#[proto_message(type_url = "/elys.tradeshield.LegacyOrderPriceV1")]
58pub struct LegacyOrderPriceV1 {
59    #[prost(string, tag = "1")]
60    pub base_denom: ::prost::alloc::string::String,
61    #[prost(string, tag = "2")]
62    pub quote_denom: ::prost::alloc::string::String,
63    #[prost(string, tag = "3")]
64    pub rate: ::prost::alloc::string::String,
65}
66#[allow(clippy::derive_partial_eq_without_eq)]
67#[derive(
68    Clone,
69    PartialEq,
70    Eq,
71    ::prost::Message,
72    ::serde::Serialize,
73    ::serde::Deserialize,
74    ::schemars::JsonSchema,
75    CosmwasmExt,
76)]
77#[proto_message(type_url = "/elys.tradeshield.LegacyTriggerPriceV1")]
78pub struct LegacyTriggerPriceV1 {
79    #[prost(string, tag = "1")]
80    pub trading_asset_denom: ::prost::alloc::string::String,
81    #[prost(string, tag = "3")]
82    pub rate: ::prost::alloc::string::String,
83}
84/// Spot order
85#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
86#[repr(i32)]
87#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)]
88pub enum SpotOrderType {
89    Stoploss = 0,
90    Limitsell = 1,
91    Limitbuy = 2,
92    Marketbuy = 3,
93}
94impl SpotOrderType {
95    /// String value of the enum field names used in the ProtoBuf definition.
96    ///
97    /// The values are not transformed in any way and thus are considered stable
98    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
99    pub fn as_str_name(&self) -> &'static str {
100        match self {
101            SpotOrderType::Stoploss => "STOPLOSS",
102            SpotOrderType::Limitsell => "LIMITSELL",
103            SpotOrderType::Limitbuy => "LIMITBUY",
104            SpotOrderType::Marketbuy => "MARKETBUY",
105        }
106    }
107    /// Creates an enum from field names used in the ProtoBuf definition.
108    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
109        match value {
110            "STOPLOSS" => Some(Self::Stoploss),
111            "LIMITSELL" => Some(Self::Limitsell),
112            "LIMITBUY" => Some(Self::Limitbuy),
113            "MARKETBUY" => Some(Self::Marketbuy),
114            _ => None,
115        }
116    }
117}
118#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
119#[repr(i32)]
120#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)]
121pub enum PerpetualPosition {
122    Unspecified = 0,
123    Long = 1,
124    Short = 2,
125}
126impl PerpetualPosition {
127    /// String value of the enum field names used in the ProtoBuf definition.
128    ///
129    /// The values are not transformed in any way and thus are considered stable
130    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
131    pub fn as_str_name(&self) -> &'static str {
132        match self {
133            PerpetualPosition::Unspecified => "UNSPECIFIED",
134            PerpetualPosition::Long => "LONG",
135            PerpetualPosition::Short => "SHORT",
136        }
137    }
138    /// Creates an enum from field names used in the ProtoBuf definition.
139    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
140        match value {
141            "UNSPECIFIED" => Some(Self::Unspecified),
142            "LONG" => Some(Self::Long),
143            "SHORT" => Some(Self::Short),
144            _ => None,
145        }
146    }
147}
148#[allow(clippy::derive_partial_eq_without_eq)]
149#[derive(
150    Clone,
151    PartialEq,
152    Eq,
153    ::prost::Message,
154    ::serde::Serialize,
155    ::serde::Deserialize,
156    ::schemars::JsonSchema,
157    CosmwasmExt,
158)]
159#[proto_message(type_url = "/elys.tradeshield.Date")]
160pub struct Date {
161    #[prost(uint64, tag = "1")]
162    #[serde(
163        serialize_with = "crate::serde::as_str::serialize",
164        deserialize_with = "crate::serde::as_str::deserialize"
165    )]
166    pub height: u64,
167    #[prost(uint64, tag = "2")]
168    #[serde(
169        serialize_with = "crate::serde::as_str::serialize",
170        deserialize_with = "crate::serde::as_str::deserialize"
171    )]
172    pub timestamp: u64,
173}
174#[allow(clippy::derive_partial_eq_without_eq)]
175#[derive(
176    Clone,
177    PartialEq,
178    Eq,
179    ::prost::Message,
180    ::serde::Serialize,
181    ::serde::Deserialize,
182    ::schemars::JsonSchema,
183    CosmwasmExt,
184)]
185#[proto_message(type_url = "/elys.tradeshield.SpotOrder")]
186pub struct SpotOrder {
187    #[prost(enumeration = "SpotOrderType", tag = "1")]
188    #[serde(
189        serialize_with = "crate::serde::as_str::serialize",
190        deserialize_with = "crate::serde::as_str::deserialize"
191    )]
192    pub order_type: i32,
193    #[prost(uint64, tag = "2")]
194    #[serde(alias = "orderID")]
195    #[serde(
196        serialize_with = "crate::serde::as_str::serialize",
197        deserialize_with = "crate::serde::as_str::deserialize"
198    )]
199    pub order_id: u64,
200    #[prost(message, optional, tag = "3")]
201    pub legacy_order_price_v1: ::core::option::Option<LegacyOrderPriceV1>,
202    #[prost(string, tag = "9")]
203    pub order_price: ::prost::alloc::string::String,
204    #[prost(message, optional, tag = "4")]
205    pub order_amount: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
206    #[prost(string, tag = "5")]
207    pub owner_address: ::prost::alloc::string::String,
208    #[prost(string, tag = "6")]
209    pub order_target_denom: ::prost::alloc::string::String,
210    #[prost(enumeration = "Status", tag = "7")]
211    #[serde(
212        serialize_with = "crate::serde::as_str::serialize",
213        deserialize_with = "crate::serde::as_str::deserialize"
214    )]
215    pub status: i32,
216    #[prost(message, optional, tag = "8")]
217    pub date: ::core::option::Option<Date>,
218}
219#[allow(clippy::derive_partial_eq_without_eq)]
220#[derive(
221    Clone,
222    PartialEq,
223    Eq,
224    ::prost::Message,
225    ::serde::Serialize,
226    ::serde::Deserialize,
227    ::schemars::JsonSchema,
228    CosmwasmExt,
229)]
230#[proto_message(type_url = "/elys.tradeshield.PerpetualOrder")]
231pub struct PerpetualOrder {
232    #[prost(uint64, tag = "1")]
233    #[serde(alias = "orderID")]
234    #[serde(
235        serialize_with = "crate::serde::as_str::serialize",
236        deserialize_with = "crate::serde::as_str::deserialize"
237    )]
238    pub order_id: u64,
239    #[prost(string, tag = "2")]
240    pub owner_address: ::prost::alloc::string::String,
241    #[prost(enumeration = "PerpetualOrderType", tag = "3")]
242    #[serde(
243        serialize_with = "crate::serde::as_str::serialize",
244        deserialize_with = "crate::serde::as_str::deserialize"
245    )]
246    pub perpetual_order_type: i32,
247    #[prost(enumeration = "PerpetualPosition", tag = "4")]
248    #[serde(
249        serialize_with = "crate::serde::as_str::serialize",
250        deserialize_with = "crate::serde::as_str::deserialize"
251    )]
252    pub position: i32,
253    #[prost(message, optional, tag = "5")]
254    pub legacy_trigger_price_v1: ::core::option::Option<LegacyTriggerPriceV1>,
255    #[prost(string, tag = "14")]
256    pub trigger_price: ::prost::alloc::string::String,
257    #[prost(message, optional, tag = "6")]
258    pub collateral: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
259    #[prost(string, tag = "7")]
260    pub trading_asset: ::prost::alloc::string::String,
261    #[prost(string, tag = "8")]
262    pub leverage: ::prost::alloc::string::String,
263    #[prost(string, tag = "9")]
264    pub take_profit_price: ::prost::alloc::string::String,
265    #[prost(uint64, tag = "10")]
266    #[serde(alias = "positionID")]
267    #[serde(
268        serialize_with = "crate::serde::as_str::serialize",
269        deserialize_with = "crate::serde::as_str::deserialize"
270    )]
271    pub position_id: u64,
272    #[prost(enumeration = "Status", tag = "11")]
273    #[serde(
274        serialize_with = "crate::serde::as_str::serialize",
275        deserialize_with = "crate::serde::as_str::deserialize"
276    )]
277    pub status: i32,
278    #[prost(string, tag = "12")]
279    pub stop_loss_price: ::prost::alloc::string::String,
280    #[prost(uint64, tag = "13")]
281    #[serde(alias = "poolID")]
282    #[serde(
283        serialize_with = "crate::serde::as_str::serialize",
284        deserialize_with = "crate::serde::as_str::deserialize"
285    )]
286    pub pool_id: u64,
287}
288#[allow(clippy::derive_partial_eq_without_eq)]
289#[derive(
290    Clone,
291    PartialEq,
292    Eq,
293    ::prost::Message,
294    ::serde::Serialize,
295    ::serde::Deserialize,
296    ::schemars::JsonSchema,
297    CosmwasmExt,
298)]
299#[proto_message(type_url = "/elys.tradeshield.PerpetualOrderExtraInfo")]
300pub struct PerpetualOrderExtraInfo {
301    #[prost(message, optional, tag = "1")]
302    pub perpetual_order: ::core::option::Option<PerpetualOrder>,
303    #[prost(message, optional, tag = "2")]
304    pub position_size: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
305    #[prost(string, tag = "3")]
306    pub liquidation_price: ::prost::alloc::string::String,
307    #[prost(string, tag = "4")]
308    pub funding_rate: ::prost::alloc::string::String,
309    #[prost(string, tag = "5")]
310    pub borrow_interest_rate: ::prost::alloc::string::String,
311}
312#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
313#[repr(i32)]
314#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)]
315pub enum Status {
316    Pending = 0,
317    Executed = 1,
318    Canceled = 2,
319    All = 3,
320}
321impl Status {
322    /// String value of the enum field names used in the ProtoBuf definition.
323    ///
324    /// The values are not transformed in any way and thus are considered stable
325    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
326    pub fn as_str_name(&self) -> &'static str {
327        match self {
328            Status::Pending => "PENDING",
329            Status::Executed => "EXECUTED",
330            Status::Canceled => "CANCELED",
331            Status::All => "ALL",
332        }
333    }
334    /// Creates an enum from field names used in the ProtoBuf definition.
335    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
336        match value {
337            "PENDING" => Some(Self::Pending),
338            "EXECUTED" => Some(Self::Executed),
339            "CANCELED" => Some(Self::Canceled),
340            "ALL" => Some(Self::All),
341            _ => None,
342        }
343    }
344}
345/// Perpetual Order
346#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
347#[repr(i32)]
348#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)]
349pub enum PerpetualOrderType {
350    Limitopen = 0,
351    Limitclose = 1,
352    Stoplossperp = 2,
353}
354impl PerpetualOrderType {
355    /// String value of the enum field names used in the ProtoBuf definition.
356    ///
357    /// The values are not transformed in any way and thus are considered stable
358    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
359    pub fn as_str_name(&self) -> &'static str {
360        match self {
361            PerpetualOrderType::Limitopen => "LIMITOPEN",
362            PerpetualOrderType::Limitclose => "LIMITCLOSE",
363            PerpetualOrderType::Stoplossperp => "STOPLOSSPERP",
364        }
365    }
366    /// Creates an enum from field names used in the ProtoBuf definition.
367    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
368        match value {
369            "LIMITOPEN" => Some(Self::Limitopen),
370            "LIMITCLOSE" => Some(Self::Limitclose),
371            "STOPLOSSPERP" => Some(Self::Stoplossperp),
372            _ => None,
373        }
374    }
375}
376/// GenesisState defines the tradeshield module's genesis state.
377#[allow(clippy::derive_partial_eq_without_eq)]
378#[derive(
379    Clone,
380    PartialEq,
381    Eq,
382    ::prost::Message,
383    ::serde::Serialize,
384    ::serde::Deserialize,
385    ::schemars::JsonSchema,
386    CosmwasmExt,
387)]
388#[proto_message(type_url = "/elys.tradeshield.GenesisState")]
389pub struct GenesisState {
390    #[prost(message, optional, tag = "1")]
391    pub params: ::core::option::Option<Params>,
392    #[prost(message, repeated, tag = "2")]
393    pub pending_spot_order_list: ::prost::alloc::vec::Vec<SpotOrder>,
394    #[prost(uint64, tag = "3")]
395    #[serde(
396        serialize_with = "crate::serde::as_str::serialize",
397        deserialize_with = "crate::serde::as_str::deserialize"
398    )]
399    pub pending_spot_order_count: u64,
400    #[prost(message, repeated, tag = "4")]
401    pub pending_perpetual_order_list: ::prost::alloc::vec::Vec<PerpetualOrder>,
402    #[prost(uint64, tag = "5")]
403    #[serde(
404        serialize_with = "crate::serde::as_str::serialize",
405        deserialize_with = "crate::serde::as_str::deserialize"
406    )]
407    pub pending_perpetual_order_count: u64,
408}
409/// QueryParamsRequest is request type for the Query/Params RPC method.
410#[allow(clippy::derive_partial_eq_without_eq)]
411#[derive(
412    Clone,
413    PartialEq,
414    Eq,
415    ::prost::Message,
416    ::serde::Serialize,
417    ::serde::Deserialize,
418    ::schemars::JsonSchema,
419    CosmwasmExt,
420)]
421#[proto_message(type_url = "/elys.tradeshield.QueryParamsRequest")]
422#[proto_query(
423    path = "/elys.tradeshield.Query/Params",
424    response_type = QueryParamsResponse
425)]
426pub struct QueryParamsRequest {}
427/// QueryParamsResponse is response type for the Query/Params RPC method.
428#[allow(clippy::derive_partial_eq_without_eq)]
429#[derive(
430    Clone,
431    PartialEq,
432    Eq,
433    ::prost::Message,
434    ::serde::Serialize,
435    ::serde::Deserialize,
436    ::schemars::JsonSchema,
437    CosmwasmExt,
438)]
439#[proto_message(type_url = "/elys.tradeshield.QueryParamsResponse")]
440pub struct QueryParamsResponse {
441    /// params holds all the parameters of this module.
442    #[prost(message, optional, tag = "1")]
443    pub params: ::core::option::Option<Params>,
444}
445#[allow(clippy::derive_partial_eq_without_eq)]
446#[derive(
447    Clone,
448    PartialEq,
449    Eq,
450    ::prost::Message,
451    ::serde::Serialize,
452    ::serde::Deserialize,
453    ::schemars::JsonSchema,
454    CosmwasmExt,
455)]
456#[proto_message(type_url = "/elys.tradeshield.QueryGetPendingSpotOrderRequest")]
457#[proto_query(
458    path = "/elys.tradeshield.Query/PendingSpotOrder",
459    response_type = QueryGetPendingSpotOrderResponse
460)]
461pub struct QueryGetPendingSpotOrderRequest {
462    #[prost(uint64, tag = "1")]
463    #[serde(alias = "ID")]
464    #[serde(
465        serialize_with = "crate::serde::as_str::serialize",
466        deserialize_with = "crate::serde::as_str::deserialize"
467    )]
468    pub id: u64,
469}
470#[allow(clippy::derive_partial_eq_without_eq)]
471#[derive(
472    Clone,
473    PartialEq,
474    Eq,
475    ::prost::Message,
476    ::serde::Serialize,
477    ::serde::Deserialize,
478    ::schemars::JsonSchema,
479    CosmwasmExt,
480)]
481#[proto_message(type_url = "/elys.tradeshield.QueryGetPendingSpotOrderResponse")]
482pub struct QueryGetPendingSpotOrderResponse {
483    #[prost(message, optional, tag = "1")]
484    pub pending_spot_order: ::core::option::Option<SpotOrder>,
485}
486#[allow(clippy::derive_partial_eq_without_eq)]
487#[derive(
488    Clone,
489    PartialEq,
490    Eq,
491    ::prost::Message,
492    ::serde::Serialize,
493    ::serde::Deserialize,
494    ::schemars::JsonSchema,
495    CosmwasmExt,
496)]
497#[proto_message(type_url = "/elys.tradeshield.QueryAllPendingSpotOrderRequest")]
498#[proto_query(
499    path = "/elys.tradeshield.Query/PendingSpotOrderAll",
500    response_type = QueryAllPendingSpotOrderResponse
501)]
502pub struct QueryAllPendingSpotOrderRequest {
503    #[prost(message, optional, tag = "1")]
504    pub pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
505}
506#[allow(clippy::derive_partial_eq_without_eq)]
507#[derive(
508    Clone,
509    PartialEq,
510    Eq,
511    ::prost::Message,
512    ::serde::Serialize,
513    ::serde::Deserialize,
514    ::schemars::JsonSchema,
515    CosmwasmExt,
516)]
517#[proto_message(type_url = "/elys.tradeshield.QueryAllPendingSpotOrderResponse")]
518pub struct QueryAllPendingSpotOrderResponse {
519    #[prost(message, repeated, tag = "1")]
520    pub pending_spot_order: ::prost::alloc::vec::Vec<SpotOrder>,
521    #[prost(message, optional, tag = "2")]
522    pub pagination:
523        ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageResponse>,
524}
525#[allow(clippy::derive_partial_eq_without_eq)]
526#[derive(
527    Clone,
528    PartialEq,
529    Eq,
530    ::prost::Message,
531    ::serde::Serialize,
532    ::serde::Deserialize,
533    ::schemars::JsonSchema,
534    CosmwasmExt,
535)]
536#[proto_message(type_url = "/elys.tradeshield.QueryGetPendingPerpetualOrderRequest")]
537#[proto_query(
538    path = "/elys.tradeshield.Query/PendingPerpetualOrder",
539    response_type = QueryGetPendingPerpetualOrderResponse
540)]
541pub struct QueryGetPendingPerpetualOrderRequest {
542    #[prost(uint64, tag = "1")]
543    #[serde(alias = "ID")]
544    #[serde(
545        serialize_with = "crate::serde::as_str::serialize",
546        deserialize_with = "crate::serde::as_str::deserialize"
547    )]
548    pub id: u64,
549}
550#[allow(clippy::derive_partial_eq_without_eq)]
551#[derive(
552    Clone,
553    PartialEq,
554    Eq,
555    ::prost::Message,
556    ::serde::Serialize,
557    ::serde::Deserialize,
558    ::schemars::JsonSchema,
559    CosmwasmExt,
560)]
561#[proto_message(type_url = "/elys.tradeshield.QueryGetPendingPerpetualOrderResponse")]
562pub struct QueryGetPendingPerpetualOrderResponse {
563    #[prost(message, optional, tag = "1")]
564    pub pending_perpetual_order: ::core::option::Option<PerpetualOrderExtraInfo>,
565}
566#[allow(clippy::derive_partial_eq_without_eq)]
567#[derive(
568    Clone,
569    PartialEq,
570    Eq,
571    ::prost::Message,
572    ::serde::Serialize,
573    ::serde::Deserialize,
574    ::schemars::JsonSchema,
575    CosmwasmExt,
576)]
577#[proto_message(type_url = "/elys.tradeshield.QueryAllPendingPerpetualOrderRequest")]
578#[proto_query(
579    path = "/elys.tradeshield.Query/PendingPerpetualOrderAll",
580    response_type = QueryAllPendingPerpetualOrderResponse
581)]
582pub struct QueryAllPendingPerpetualOrderRequest {
583    #[prost(message, optional, tag = "1")]
584    pub pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
585}
586#[allow(clippy::derive_partial_eq_without_eq)]
587#[derive(
588    Clone,
589    PartialEq,
590    Eq,
591    ::prost::Message,
592    ::serde::Serialize,
593    ::serde::Deserialize,
594    ::schemars::JsonSchema,
595    CosmwasmExt,
596)]
597#[proto_message(type_url = "/elys.tradeshield.QueryAllPendingPerpetualOrderResponse")]
598pub struct QueryAllPendingPerpetualOrderResponse {
599    #[prost(message, repeated, tag = "1")]
600    pub pending_perpetual_order: ::prost::alloc::vec::Vec<PerpetualOrderExtraInfo>,
601    #[prost(message, optional, tag = "2")]
602    pub pagination:
603        ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageResponse>,
604}
605#[allow(clippy::derive_partial_eq_without_eq)]
606#[derive(
607    Clone,
608    PartialEq,
609    Eq,
610    ::prost::Message,
611    ::serde::Serialize,
612    ::serde::Deserialize,
613    ::schemars::JsonSchema,
614    CosmwasmExt,
615)]
616#[proto_message(type_url = "/elys.tradeshield.QueryPendingPerpetualOrderForAddressRequest")]
617#[proto_query(
618    path = "/elys.tradeshield.Query/PendingPerpetualOrderForAddress",
619    response_type = QueryPendingPerpetualOrderForAddressResponse
620)]
621pub struct QueryPendingPerpetualOrderForAddressRequest {
622    #[prost(string, tag = "1")]
623    pub address: ::prost::alloc::string::String,
624    #[prost(enumeration = "Status", tag = "2")]
625    #[serde(
626        serialize_with = "crate::serde::as_str::serialize",
627        deserialize_with = "crate::serde::as_str::deserialize"
628    )]
629    pub status: i32,
630}
631#[allow(clippy::derive_partial_eq_without_eq)]
632#[derive(
633    Clone,
634    PartialEq,
635    Eq,
636    ::prost::Message,
637    ::serde::Serialize,
638    ::serde::Deserialize,
639    ::schemars::JsonSchema,
640    CosmwasmExt,
641)]
642#[proto_message(type_url = "/elys.tradeshield.QueryPendingPerpetualOrderForAddressResponse")]
643pub struct QueryPendingPerpetualOrderForAddressResponse {
644    #[prost(message, repeated, tag = "1")]
645    pub pending_perpetual_orders: ::prost::alloc::vec::Vec<PerpetualOrderExtraInfo>,
646}
647#[allow(clippy::derive_partial_eq_without_eq)]
648#[derive(
649    Clone,
650    PartialEq,
651    Eq,
652    ::prost::Message,
653    ::serde::Serialize,
654    ::serde::Deserialize,
655    ::schemars::JsonSchema,
656    CosmwasmExt,
657)]
658#[proto_message(type_url = "/elys.tradeshield.QueryPendingSpotOrderForAddressRequest")]
659#[proto_query(
660    path = "/elys.tradeshield.Query/PendingSpotOrderForAddress",
661    response_type = QueryPendingSpotOrderForAddressResponse
662)]
663pub struct QueryPendingSpotOrderForAddressRequest {
664    #[prost(string, tag = "1")]
665    pub address: ::prost::alloc::string::String,
666    #[prost(enumeration = "Status", tag = "2")]
667    #[serde(
668        serialize_with = "crate::serde::as_str::serialize",
669        deserialize_with = "crate::serde::as_str::deserialize"
670    )]
671    pub status: i32,
672}
673#[allow(clippy::derive_partial_eq_without_eq)]
674#[derive(
675    Clone,
676    PartialEq,
677    Eq,
678    ::prost::Message,
679    ::serde::Serialize,
680    ::serde::Deserialize,
681    ::schemars::JsonSchema,
682    CosmwasmExt,
683)]
684#[proto_message(type_url = "/elys.tradeshield.QueryPendingSpotOrderForAddressResponse")]
685pub struct QueryPendingSpotOrderForAddressResponse {
686    #[prost(message, repeated, tag = "1")]
687    pub pending_spot_orders: ::prost::alloc::vec::Vec<SpotOrder>,
688}
689#[allow(clippy::derive_partial_eq_without_eq)]
690#[derive(
691    Clone,
692    PartialEq,
693    Eq,
694    ::prost::Message,
695    ::serde::Serialize,
696    ::serde::Deserialize,
697    ::schemars::JsonSchema,
698    CosmwasmExt,
699)]
700#[proto_message(type_url = "/elys.tradeshield.MsgCreateSpotOrder")]
701pub struct MsgCreateSpotOrder {
702    #[prost(enumeration = "SpotOrderType", tag = "1")]
703    #[serde(
704        serialize_with = "crate::serde::as_str::serialize",
705        deserialize_with = "crate::serde::as_str::deserialize"
706    )]
707    pub order_type: i32,
708    #[prost(message, optional, tag = "2")]
709    pub legacy_order_price_v1: ::core::option::Option<LegacyOrderPriceV1>,
710    #[prost(string, tag = "6")]
711    pub order_price: ::prost::alloc::string::String,
712    #[prost(message, optional, tag = "3")]
713    pub order_amount: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
714    #[prost(string, tag = "4")]
715    pub owner_address: ::prost::alloc::string::String,
716    #[prost(string, tag = "5")]
717    pub order_target_denom: ::prost::alloc::string::String,
718}
719#[allow(clippy::derive_partial_eq_without_eq)]
720#[derive(
721    Clone,
722    PartialEq,
723    Eq,
724    ::prost::Message,
725    ::serde::Serialize,
726    ::serde::Deserialize,
727    ::schemars::JsonSchema,
728    CosmwasmExt,
729)]
730#[proto_message(type_url = "/elys.tradeshield.MsgCreateSpotOrderResponse")]
731pub struct MsgCreateSpotOrderResponse {
732    #[prost(uint64, tag = "1")]
733    #[serde(alias = "orderID")]
734    #[serde(
735        serialize_with = "crate::serde::as_str::serialize",
736        deserialize_with = "crate::serde::as_str::deserialize"
737    )]
738    pub order_id: u64,
739}
740#[allow(clippy::derive_partial_eq_without_eq)]
741#[derive(
742    Clone,
743    PartialEq,
744    Eq,
745    ::prost::Message,
746    ::serde::Serialize,
747    ::serde::Deserialize,
748    ::schemars::JsonSchema,
749    CosmwasmExt,
750)]
751#[proto_message(type_url = "/elys.tradeshield.MsgUpdateSpotOrder")]
752pub struct MsgUpdateSpotOrder {
753    #[prost(string, tag = "1")]
754    pub owner_address: ::prost::alloc::string::String,
755    #[prost(uint64, tag = "2")]
756    #[serde(alias = "orderID")]
757    #[serde(
758        serialize_with = "crate::serde::as_str::serialize",
759        deserialize_with = "crate::serde::as_str::deserialize"
760    )]
761    pub order_id: u64,
762    #[prost(message, optional, tag = "3")]
763    pub legacy_order_price_v1: ::core::option::Option<LegacyOrderPriceV1>,
764    #[prost(string, tag = "4")]
765    pub order_price: ::prost::alloc::string::String,
766}
767#[allow(clippy::derive_partial_eq_without_eq)]
768#[derive(
769    Clone,
770    PartialEq,
771    Eq,
772    ::prost::Message,
773    ::serde::Serialize,
774    ::serde::Deserialize,
775    ::schemars::JsonSchema,
776    CosmwasmExt,
777)]
778#[proto_message(type_url = "/elys.tradeshield.MsgUpdateSpotOrderResponse")]
779pub struct MsgUpdateSpotOrderResponse {}
780#[allow(clippy::derive_partial_eq_without_eq)]
781#[derive(
782    Clone,
783    PartialEq,
784    Eq,
785    ::prost::Message,
786    ::serde::Serialize,
787    ::serde::Deserialize,
788    ::schemars::JsonSchema,
789    CosmwasmExt,
790)]
791#[proto_message(type_url = "/elys.tradeshield.MsgCancelSpotOrder")]
792pub struct MsgCancelSpotOrder {
793    #[prost(string, tag = "1")]
794    pub owner_address: ::prost::alloc::string::String,
795    #[prost(uint64, tag = "2")]
796    #[serde(alias = "orderID")]
797    #[serde(
798        serialize_with = "crate::serde::as_str::serialize",
799        deserialize_with = "crate::serde::as_str::deserialize"
800    )]
801    pub order_id: u64,
802}
803#[allow(clippy::derive_partial_eq_without_eq)]
804#[derive(
805    Clone,
806    PartialEq,
807    Eq,
808    ::prost::Message,
809    ::serde::Serialize,
810    ::serde::Deserialize,
811    ::schemars::JsonSchema,
812    CosmwasmExt,
813)]
814#[proto_message(type_url = "/elys.tradeshield.MsgCancelSpotOrderResponse")]
815pub struct MsgCancelSpotOrderResponse {
816    #[prost(uint64, tag = "1")]
817    #[serde(alias = "orderID")]
818    #[serde(
819        serialize_with = "crate::serde::as_str::serialize",
820        deserialize_with = "crate::serde::as_str::deserialize"
821    )]
822    pub order_id: u64,
823}
824#[allow(clippy::derive_partial_eq_without_eq)]
825#[derive(
826    Clone,
827    PartialEq,
828    Eq,
829    ::prost::Message,
830    ::serde::Serialize,
831    ::serde::Deserialize,
832    ::schemars::JsonSchema,
833    CosmwasmExt,
834)]
835#[proto_message(type_url = "/elys.tradeshield.MsgCancelSpotOrders")]
836pub struct MsgCancelSpotOrders {
837    #[prost(string, tag = "1")]
838    pub creator: ::prost::alloc::string::String,
839    #[prost(uint64, repeated, tag = "2")]
840    #[serde(alias = "spot_orderIDs")]
841    #[serde(
842        serialize_with = "crate::serde::as_str_vec::serialize",
843        deserialize_with = "crate::serde::as_str_vec::deserialize"
844    )]
845    pub spot_order_ids: ::prost::alloc::vec::Vec<u64>,
846}
847#[allow(clippy::derive_partial_eq_without_eq)]
848#[derive(
849    Clone,
850    PartialEq,
851    Eq,
852    ::prost::Message,
853    ::serde::Serialize,
854    ::serde::Deserialize,
855    ::schemars::JsonSchema,
856    CosmwasmExt,
857)]
858#[proto_message(type_url = "/elys.tradeshield.MsgCancelSpotOrdersResponse")]
859pub struct MsgCancelSpotOrdersResponse {}
860#[allow(clippy::derive_partial_eq_without_eq)]
861#[derive(
862    Clone,
863    PartialEq,
864    Eq,
865    ::prost::Message,
866    ::serde::Serialize,
867    ::serde::Deserialize,
868    ::schemars::JsonSchema,
869    CosmwasmExt,
870)]
871#[proto_message(type_url = "/elys.tradeshield.MsgCreatePerpetualOpenOrder")]
872pub struct MsgCreatePerpetualOpenOrder {
873    #[prost(string, tag = "1")]
874    pub owner_address: ::prost::alloc::string::String,
875    #[prost(message, optional, tag = "2")]
876    pub legacy_trigger_price_v1: ::core::option::Option<LegacyTriggerPriceV1>,
877    #[prost(string, tag = "10")]
878    pub trigger_price: ::prost::alloc::string::String,
879    #[prost(message, optional, tag = "3")]
880    pub collateral: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
881    #[prost(string, tag = "4")]
882    pub trading_asset: ::prost::alloc::string::String,
883    #[prost(enumeration = "PerpetualPosition", tag = "5")]
884    #[serde(
885        serialize_with = "crate::serde::as_str::serialize",
886        deserialize_with = "crate::serde::as_str::deserialize"
887    )]
888    pub position: i32,
889    #[prost(string, tag = "6")]
890    pub leverage: ::prost::alloc::string::String,
891    #[prost(string, tag = "7")]
892    pub take_profit_price: ::prost::alloc::string::String,
893    #[prost(string, tag = "8")]
894    pub stop_loss_price: ::prost::alloc::string::String,
895    #[prost(uint64, tag = "9")]
896    #[serde(alias = "poolID")]
897    #[serde(
898        serialize_with = "crate::serde::as_str::serialize",
899        deserialize_with = "crate::serde::as_str::deserialize"
900    )]
901    pub pool_id: u64,
902}
903#[allow(clippy::derive_partial_eq_without_eq)]
904#[derive(
905    Clone,
906    PartialEq,
907    Eq,
908    ::prost::Message,
909    ::serde::Serialize,
910    ::serde::Deserialize,
911    ::schemars::JsonSchema,
912    CosmwasmExt,
913)]
914#[proto_message(type_url = "/elys.tradeshield.MsgCreatePerpetualOpenOrderResponse")]
915pub struct MsgCreatePerpetualOpenOrderResponse {
916    #[prost(uint64, tag = "1")]
917    #[serde(alias = "orderID")]
918    #[serde(
919        serialize_with = "crate::serde::as_str::serialize",
920        deserialize_with = "crate::serde::as_str::deserialize"
921    )]
922    pub order_id: u64,
923}
924#[allow(clippy::derive_partial_eq_without_eq)]
925#[derive(
926    Clone,
927    PartialEq,
928    Eq,
929    ::prost::Message,
930    ::serde::Serialize,
931    ::serde::Deserialize,
932    ::schemars::JsonSchema,
933    CosmwasmExt,
934)]
935#[proto_message(type_url = "/elys.tradeshield.MsgCreatePerpetualCloseOrder")]
936pub struct MsgCreatePerpetualCloseOrder {
937    #[prost(string, tag = "1")]
938    pub owner_address: ::prost::alloc::string::String,
939    #[prost(message, optional, tag = "2")]
940    pub legacy_trigger_price_v1: ::core::option::Option<LegacyTriggerPriceV1>,
941    #[prost(string, tag = "4")]
942    pub trigger_price: ::prost::alloc::string::String,
943    #[prost(uint64, tag = "3")]
944    #[serde(alias = "positionID")]
945    #[serde(
946        serialize_with = "crate::serde::as_str::serialize",
947        deserialize_with = "crate::serde::as_str::deserialize"
948    )]
949    pub position_id: u64,
950}
951#[allow(clippy::derive_partial_eq_without_eq)]
952#[derive(
953    Clone,
954    PartialEq,
955    Eq,
956    ::prost::Message,
957    ::serde::Serialize,
958    ::serde::Deserialize,
959    ::schemars::JsonSchema,
960    CosmwasmExt,
961)]
962#[proto_message(type_url = "/elys.tradeshield.MsgCreatePerpetualCloseOrderResponse")]
963pub struct MsgCreatePerpetualCloseOrderResponse {
964    #[prost(uint64, tag = "1")]
965    #[serde(alias = "orderID")]
966    #[serde(
967        serialize_with = "crate::serde::as_str::serialize",
968        deserialize_with = "crate::serde::as_str::deserialize"
969    )]
970    pub order_id: u64,
971}
972#[allow(clippy::derive_partial_eq_without_eq)]
973#[derive(
974    Clone,
975    PartialEq,
976    Eq,
977    ::prost::Message,
978    ::serde::Serialize,
979    ::serde::Deserialize,
980    ::schemars::JsonSchema,
981    CosmwasmExt,
982)]
983#[proto_message(type_url = "/elys.tradeshield.MsgUpdatePerpetualOrder")]
984pub struct MsgUpdatePerpetualOrder {
985    #[prost(string, tag = "1")]
986    pub owner_address: ::prost::alloc::string::String,
987    #[prost(uint64, tag = "2")]
988    #[serde(alias = "orderID")]
989    #[serde(
990        serialize_with = "crate::serde::as_str::serialize",
991        deserialize_with = "crate::serde::as_str::deserialize"
992    )]
993    pub order_id: u64,
994    #[prost(message, optional, tag = "3")]
995    pub legacy_trigger_price_v1: ::core::option::Option<LegacyTriggerPriceV1>,
996    #[prost(string, tag = "4")]
997    pub trigger_price: ::prost::alloc::string::String,
998}
999#[allow(clippy::derive_partial_eq_without_eq)]
1000#[derive(
1001    Clone,
1002    PartialEq,
1003    Eq,
1004    ::prost::Message,
1005    ::serde::Serialize,
1006    ::serde::Deserialize,
1007    ::schemars::JsonSchema,
1008    CosmwasmExt,
1009)]
1010#[proto_message(type_url = "/elys.tradeshield.MsgUpdatePerpetualOrderResponse")]
1011pub struct MsgUpdatePerpetualOrderResponse {}
1012#[allow(clippy::derive_partial_eq_without_eq)]
1013#[derive(
1014    Clone,
1015    PartialEq,
1016    Eq,
1017    ::prost::Message,
1018    ::serde::Serialize,
1019    ::serde::Deserialize,
1020    ::schemars::JsonSchema,
1021    CosmwasmExt,
1022)]
1023#[proto_message(type_url = "/elys.tradeshield.MsgCancelPerpetualOrder")]
1024pub struct MsgCancelPerpetualOrder {
1025    #[prost(string, tag = "1")]
1026    pub owner_address: ::prost::alloc::string::String,
1027    #[prost(uint64, tag = "2")]
1028    #[serde(alias = "orderID")]
1029    #[serde(
1030        serialize_with = "crate::serde::as_str::serialize",
1031        deserialize_with = "crate::serde::as_str::deserialize"
1032    )]
1033    pub order_id: u64,
1034}
1035#[allow(clippy::derive_partial_eq_without_eq)]
1036#[derive(
1037    Clone,
1038    PartialEq,
1039    Eq,
1040    ::prost::Message,
1041    ::serde::Serialize,
1042    ::serde::Deserialize,
1043    ::schemars::JsonSchema,
1044    CosmwasmExt,
1045)]
1046#[proto_message(type_url = "/elys.tradeshield.MsgCancelPerpetualOrderResponse")]
1047pub struct MsgCancelPerpetualOrderResponse {
1048    #[prost(uint64, tag = "1")]
1049    #[serde(alias = "orderID")]
1050    #[serde(
1051        serialize_with = "crate::serde::as_str::serialize",
1052        deserialize_with = "crate::serde::as_str::deserialize"
1053    )]
1054    pub order_id: u64,
1055}
1056#[allow(clippy::derive_partial_eq_without_eq)]
1057#[derive(
1058    Clone,
1059    PartialEq,
1060    Eq,
1061    ::prost::Message,
1062    ::serde::Serialize,
1063    ::serde::Deserialize,
1064    ::schemars::JsonSchema,
1065    CosmwasmExt,
1066)]
1067#[proto_message(type_url = "/elys.tradeshield.MsgCancelPerpetualOrders")]
1068pub struct MsgCancelPerpetualOrders {
1069    #[prost(string, tag = "1")]
1070    pub owner_address: ::prost::alloc::string::String,
1071    #[prost(uint64, repeated, tag = "2")]
1072    #[serde(alias = "orderIDs")]
1073    #[serde(
1074        serialize_with = "crate::serde::as_str_vec::serialize",
1075        deserialize_with = "crate::serde::as_str_vec::deserialize"
1076    )]
1077    pub order_ids: ::prost::alloc::vec::Vec<u64>,
1078}
1079#[allow(clippy::derive_partial_eq_without_eq)]
1080#[derive(
1081    Clone,
1082    PartialEq,
1083    Eq,
1084    ::prost::Message,
1085    ::serde::Serialize,
1086    ::serde::Deserialize,
1087    ::schemars::JsonSchema,
1088    CosmwasmExt,
1089)]
1090#[proto_message(type_url = "/elys.tradeshield.MsgCancelPerpetualOrdersResponse")]
1091pub struct MsgCancelPerpetualOrdersResponse {}
1092#[allow(clippy::derive_partial_eq_without_eq)]
1093#[derive(
1094    Clone,
1095    PartialEq,
1096    Eq,
1097    ::prost::Message,
1098    ::serde::Serialize,
1099    ::serde::Deserialize,
1100    ::schemars::JsonSchema,
1101    CosmwasmExt,
1102)]
1103#[proto_message(type_url = "/elys.tradeshield.MsgUpdateParams")]
1104pub struct MsgUpdateParams {
1105    /// authority is the address that controls the module (defaults to x/gov unless
1106    /// overwritten).
1107    #[prost(string, tag = "1")]
1108    pub authority: ::prost::alloc::string::String,
1109    /// NOTE: All parameters must be supplied.
1110    #[prost(message, optional, tag = "2")]
1111    pub params: ::core::option::Option<Params>,
1112}
1113#[allow(clippy::derive_partial_eq_without_eq)]
1114#[derive(
1115    Clone,
1116    PartialEq,
1117    Eq,
1118    ::prost::Message,
1119    ::serde::Serialize,
1120    ::serde::Deserialize,
1121    ::schemars::JsonSchema,
1122    CosmwasmExt,
1123)]
1124#[proto_message(type_url = "/elys.tradeshield.MsgUpdateParamsResponse")]
1125pub struct MsgUpdateParamsResponse {}
1126#[allow(clippy::derive_partial_eq_without_eq)]
1127#[derive(
1128    Clone,
1129    PartialEq,
1130    Eq,
1131    ::prost::Message,
1132    ::serde::Serialize,
1133    ::serde::Deserialize,
1134    ::schemars::JsonSchema,
1135    CosmwasmExt,
1136)]
1137#[proto_message(type_url = "/elys.tradeshield.MsgExecuteOrders")]
1138pub struct MsgExecuteOrders {
1139    #[prost(string, tag = "1")]
1140    pub creator: ::prost::alloc::string::String,
1141    #[prost(uint64, repeated, tag = "2")]
1142    #[serde(alias = "spot_orderIDs")]
1143    #[serde(
1144        serialize_with = "crate::serde::as_str_vec::serialize",
1145        deserialize_with = "crate::serde::as_str_vec::deserialize"
1146    )]
1147    pub spot_order_ids: ::prost::alloc::vec::Vec<u64>,
1148    #[prost(uint64, repeated, tag = "3")]
1149    #[serde(alias = "perpetual_orderIDs")]
1150    #[serde(
1151        serialize_with = "crate::serde::as_str_vec::serialize",
1152        deserialize_with = "crate::serde::as_str_vec::deserialize"
1153    )]
1154    pub perpetual_order_ids: ::prost::alloc::vec::Vec<u64>,
1155}
1156#[allow(clippy::derive_partial_eq_without_eq)]
1157#[derive(
1158    Clone,
1159    PartialEq,
1160    Eq,
1161    ::prost::Message,
1162    ::serde::Serialize,
1163    ::serde::Deserialize,
1164    ::schemars::JsonSchema,
1165    CosmwasmExt,
1166)]
1167#[proto_message(type_url = "/elys.tradeshield.MsgExecuteOrdersResponse")]
1168pub struct MsgExecuteOrdersResponse {}
1169pub struct TradeshieldQuerier<'a, Q: cosmwasm_std::CustomQuery> {
1170    querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>,
1171}
1172impl<'a, Q: cosmwasm_std::CustomQuery> TradeshieldQuerier<'a, Q> {
1173    pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self {
1174        Self { querier }
1175    }
1176    pub fn params(&self) -> Result<QueryParamsResponse, cosmwasm_std::StdError> {
1177        QueryParamsRequest {}.query(self.querier)
1178    }
1179    pub fn pending_spot_order(
1180        &self,
1181        id: u64,
1182    ) -> Result<QueryGetPendingSpotOrderResponse, cosmwasm_std::StdError> {
1183        QueryGetPendingSpotOrderRequest { id }.query(self.querier)
1184    }
1185    pub fn pending_spot_order_all(
1186        &self,
1187        pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
1188    ) -> Result<QueryAllPendingSpotOrderResponse, cosmwasm_std::StdError> {
1189        QueryAllPendingSpotOrderRequest { pagination }.query(self.querier)
1190    }
1191    pub fn pending_perpetual_order(
1192        &self,
1193        id: u64,
1194    ) -> Result<QueryGetPendingPerpetualOrderResponse, cosmwasm_std::StdError> {
1195        QueryGetPendingPerpetualOrderRequest { id }.query(self.querier)
1196    }
1197    pub fn pending_perpetual_order_all(
1198        &self,
1199        pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
1200    ) -> Result<QueryAllPendingPerpetualOrderResponse, cosmwasm_std::StdError> {
1201        QueryAllPendingPerpetualOrderRequest { pagination }.query(self.querier)
1202    }
1203    pub fn pending_perpetual_order_for_address(
1204        &self,
1205        address: ::prost::alloc::string::String,
1206        status: i32,
1207    ) -> Result<QueryPendingPerpetualOrderForAddressResponse, cosmwasm_std::StdError> {
1208        QueryPendingPerpetualOrderForAddressRequest { address, status }.query(self.querier)
1209    }
1210    pub fn pending_spot_order_for_address(
1211        &self,
1212        address: ::prost::alloc::string::String,
1213        status: i32,
1214    ) -> Result<QueryPendingSpotOrderForAddressResponse, cosmwasm_std::StdError> {
1215        QueryPendingSpotOrderForAddressRequest { address, status }.query(self.querier)
1216    }
1217}