1#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct Instrument {
7 #[prost(string, tag="1")]
9 pub name: ::prost::alloc::string::String,
10 #[prost(string, tag="2")]
12 pub symbol: ::prost::alloc::string::String,
13 #[prost(string, tag="3")]
15 pub code: ::prost::alloc::string::String,
16 #[prost(string, tag="4")]
18 pub display_name: ::prost::alloc::string::String,
19 #[prost(enumeration="ProductType", tag="5")]
21 pub product_type: i32,
22 #[prost(string, tag="6")]
24 pub prev_close: ::prost::alloc::string::String,
25 #[prost(string, tag="7")]
27 pub last_price: ::prost::alloc::string::String,
28 #[prost(bool, tag="8")]
30 pub tradable: bool,
31 #[prost(oneof="instrument::Details", tags="20, 21, 22")]
33 pub details: ::core::option::Option<instrument::Details>,
34}
35pub mod instrument {
37 #[allow(clippy::derive_partial_eq_without_eq)]
39#[derive(Clone, PartialEq, ::prost::Oneof)]
40 pub enum Details {
41 #[prost(message, tag="20")]
42 Etf(super::EtfDetails),
43 #[prost(message, tag="21")]
44 Futures(super::FuturesDetails),
45 #[prost(message, tag="22")]
46 Stock(super::StockDetails),
47 }
48}
49#[allow(clippy::derive_partial_eq_without_eq)]
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct EtfDetails {
53 #[prost(string, tag="1")]
55 pub prev_nav: ::prost::alloc::string::String,
56 #[prost(string, tag="2")]
58 pub last_inav: ::prost::alloc::string::String,
59 #[prost(int64, tag="3")]
61 pub creation_unit: i64,
62 #[prost(int64, tag="4")]
64 pub tick_size: i64,
65 #[prost(float, tag="5")]
67 pub leverage: f32,
68 #[prost(bool, tag="6")]
70 pub short_sellable: bool,
71 #[prost(int64, tag="7")]
73 pub listed_quantity: i64,
74 #[prost(bool, tag="8")]
76 pub cash_creditable: bool,
77 #[prost(int64, tag="9")]
79 pub cash_creation_amount: i64,
80}
81#[allow(clippy::derive_partial_eq_without_eq)]
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct FuturesDetails {
85 #[prost(string, tag="1")]
87 pub underlying_symbol: ::prost::alloc::string::String,
88 #[prost(string, tag="2")]
90 pub underlying_name: ::prost::alloc::string::String,
91 #[prost(string, tag="3")]
93 pub expiry_date: ::prost::alloc::string::String,
94 #[prost(double, tag="4")]
96 pub multiplier: f64,
97 #[prost(double, tag="5")]
99 pub tick_size: f64,
100 #[prost(int64, tag="6")]
102 pub tick_value: i64,
103 #[prost(string, tag="7")]
105 pub last_trading_date: ::prost::alloc::string::String,
106}
107#[allow(clippy::derive_partial_eq_without_eq)]
109#[derive(Clone, PartialEq, ::prost::Message)]
110pub struct StockDetails {
111 #[prost(enumeration="super::stock::MarketType", tag="1")]
113 pub market_type: i32,
114 #[prost(int64, tag="2")]
116 pub listed_shares: i64,
117 #[prost(int64, tag="3")]
119 pub tick_size: i64,
120 #[prost(bool, tag="4")]
122 pub short_sellable: bool,
123 #[prost(bool, tag="5")]
125 pub margin_tradable: bool,
126 #[prost(string, tag="6")]
128 pub sector_code: ::prost::alloc::string::String,
129 #[prost(string, tag="7")]
131 pub sector_name: ::prost::alloc::string::String,
132}
133#[allow(clippy::derive_partial_eq_without_eq)]
136#[derive(Clone, PartialEq, ::prost::Message)]
137pub struct GetInstrumentRequest {
138 #[prost(string, tag="1")]
140 pub instrument: ::prost::alloc::string::String,
141}
142#[allow(clippy::derive_partial_eq_without_eq)]
144#[derive(Clone, PartialEq, ::prost::Message)]
145pub struct BatchGetInstrumentsRequest {
146 #[prost(string, repeated, tag="1")]
149 pub instruments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
150}
151#[allow(clippy::derive_partial_eq_without_eq)]
152#[derive(Clone, PartialEq, ::prost::Message)]
153pub struct BatchGetInstrumentsResponse {
154 #[prost(message, repeated, tag="1")]
156 pub instruments: ::prost::alloc::vec::Vec<Instrument>,
157 #[prost(string, repeated, tag="2")]
159 pub not_found: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
160}
161#[allow(clippy::derive_partial_eq_without_eq)]
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct ListInstrumentsRequest {
164 #[prost(uint32, optional, tag="1")]
166 pub page_size: ::core::option::Option<u32>,
167 #[prost(string, optional, tag="2")]
169 pub page_token: ::core::option::Option<::prost::alloc::string::String>,
170 #[prost(string, tag="3")]
185 pub filter: ::prost::alloc::string::String,
186}
187#[allow(clippy::derive_partial_eq_without_eq)]
188#[derive(Clone, PartialEq, ::prost::Message)]
189pub struct ListInstrumentsResponse {
190 #[prost(message, repeated, tag="1")]
192 pub instruments: ::prost::alloc::vec::Vec<Instrument>,
193 #[prost(string, tag="2")]
195 pub next_page_token: ::prost::alloc::string::String,
196}
197#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
199#[repr(i32)]
200pub enum ProductType {
201 Unspecified = 0,
202 Etf = 1,
203 Futures = 2,
204 Stock = 3,
205}
206impl ProductType {
207 pub fn as_str_name(&self) -> &'static str {
212 match self {
213 ProductType::Unspecified => "PRODUCT_TYPE_UNSPECIFIED",
214 ProductType::Etf => "PRODUCT_TYPE_ETF",
215 ProductType::Futures => "PRODUCT_TYPE_FUTURES",
216 ProductType::Stock => "PRODUCT_TYPE_STOCK",
217 }
218 }
219 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
221 match value {
222 "PRODUCT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
223 "PRODUCT_TYPE_ETF" => Some(Self::Etf),
224 "PRODUCT_TYPE_FUTURES" => Some(Self::Futures),
225 "PRODUCT_TYPE_STOCK" => Some(Self::Stock),
226 _ => None,
227 }
228 }
229}
230include!("master_sync.v1.instrument.tonic.rs");
231include!("master_sync.v1.instrument.serde.rs");
232