ids-apis 1.0.355

IDS APIs in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
// @generated
// This file is @generated by prost-build.
// ========== SubmitOrder ==========

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubmitOrderRequest {
    /// 펀드 코드 (필수)
    #[prost(string, tag="1")]
    pub fund_code: ::prost::alloc::string::String,
    /// 종목 코드 ISIN (필수)
    #[prost(string, tag="2")]
    pub symbol: ::prost::alloc::string::String,
    /// 매수/매도 (필수)
    #[prost(enumeration="super::common::OrderSide", tag="3")]
    pub side: i32,
    /// 수량 (필수)
    #[prost(int64, tag="4")]
    pub quantity: i64,
    /// 가격 (필수, 시장가 주문 시 0)
    #[prost(string, tag="5")]
    pub price: ::prost::alloc::string::String,
    /// 주문 유형 (기본: LIMIT)
    #[prost(enumeration="QuoteType", tag="6")]
    pub quote_type: i32,
    /// 유동성 공급자 여부
    #[prost(bool, tag="7")]
    pub is_lp: bool,
    /// 자동정정 전략
    #[prost(enumeration="super::common::AmendMethodType", optional, tag="8")]
    pub auto_amend_strategy: ::core::option::Option<i32>,
    /// 지정가 가격 결정 방식 (미지정 시 price 필드의 가격 사용)
    #[prost(enumeration="LimitPriceType", optional, tag="9")]
    pub limit_price_type: ::core::option::Option<i32>,
    /// 호가조건 (미지정 시 FAS, 일반 지정가)
    #[prost(enumeration="super::common::OrderConditionType", optional, tag="10")]
    pub order_condition: ::core::option::Option<i32>,
    /// 헷지 누적 대상 여부 (미지정 시 false)
    /// true 로 설정하면 외부에서 직접 제출한 주문의 체결도 hedge accumulator 에 누적되어 목표 헷지에 반영됨.
    /// 실제 누적되려면 (fund_code, symbol) 조합으로 Hedge 가 DB 에 등록되어 있어야 함.
    #[prost(bool, optional, tag="11")]
    pub need_hedge: ::core::option::Option<bool>,
    /// 자동정정 시작 전 초기 대기 시간 (ms). auto_amend_strategy 지정 시에만 유효, 미지정 시 0 (즉시 정정 시작).
    #[prost(uint64, optional, tag="12")]
    pub auto_amend_initial_wait_ms: ::core::option::Option<u64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubmitOrderResponse {
    /// 주문 ID
    #[prost(uint64, tag="1")]
    pub order_id: u64,
    /// 주문 상태
    #[prost(enumeration="OrderStatus", tag="2")]
    pub status: i32,
    /// 결과 메시지
    #[prost(string, tag="3")]
    pub message: ::prost::alloc::string::String,
}
// ========== AmendOrder ==========

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AmendOrderRequest {
    /// 원주문 ID
    #[prost(uint64, tag="1")]
    pub original_order_id: u64,
    /// 종목 코드
    #[prost(string, tag="3")]
    pub symbol: ::prost::alloc::string::String,
    /// 정정 가격
    #[prost(string, tag="5")]
    pub price: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AmendOrderResponse {
    /// 신규 주문 ID
    #[prost(uint64, tag="1")]
    pub order_id: u64,
    /// 원주문 ID
    #[prost(uint64, tag="2")]
    pub original_order_id: u64,
    /// 주문 상태
    #[prost(enumeration="OrderStatus", tag="3")]
    pub status: i32,
    /// 결과 메시지
    #[prost(string, tag="4")]
    pub message: ::prost::alloc::string::String,
}
// ========== CancelOrder ==========

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelOrderRequest {
    /// 원주문 ID
    #[prost(uint64, tag="1")]
    pub original_order_id: u64,
    /// 종목 코드
    #[prost(string, tag="3")]
    pub symbol: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelOrderResponse {
    /// 취소 주문 ID
    #[prost(uint64, tag="1")]
    pub order_id: u64,
    /// 원주문 ID
    #[prost(uint64, tag="2")]
    pub original_order_id: u64,
    /// 주문 상태
    #[prost(enumeration="OrderStatus", tag="3")]
    pub status: i32,
    /// 결과 메시지
    #[prost(string, tag="4")]
    pub message: ::prost::alloc::string::String,
}
// ========== ListAllUnfilledOrders ==========

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAllUnfilledOrdersRequest {
    /// 펀드 코드 (optional, 미지정 시 전체 펀드)
    #[prost(string, optional, tag="1")]
    pub fund_code: ::core::option::Option<::prost::alloc::string::String>,
    /// 종목 코드 (optional, 미지정 시 전체 종목)
    #[prost(string, optional, tag="2")]
    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
    /// 매수/매도 (optional, 미지정 시 양방향)
    #[prost(enumeration="super::common::OrderSide", optional, tag="3")]
    pub side: ::core::option::Option<i32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAllUnfilledOrdersResponse {
    /// 미체결 주문 목록
    #[prost(message, repeated, tag="1")]
    pub orders: ::prost::alloc::vec::Vec<Order>,
}
// ========== CancelAllOrders ==========

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CancelAllOrdersRequest {
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelAllOrdersResponse {
    /// 취소 요청된 주문 수
    #[prost(int32, tag="1")]
    pub cancelled_count: i32,
    /// 결과 메시지
    #[prost(string, tag="2")]
    pub message: ::prost::alloc::string::String,
}
// ========== StreamOrderResults ==========

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamOrderResultsRequest {
    /// 필터: 특정 펀드만 (optional)
    #[prost(string, optional, tag="1")]
    pub fund_code: ::core::option::Option<::prost::alloc::string::String>,
    /// 필터: 특정 종목만 (optional)
    #[prost(string, optional, tag="2")]
    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderResult {
    /// 주문 ID
    #[prost(uint64, tag="1")]
    pub order_id: u64,
    /// 종목 코드
    #[prost(string, tag="2")]
    pub symbol: ::prost::alloc::string::String,
    /// 펀드 코드
    #[prost(string, tag="3")]
    pub fund_code: ::prost::alloc::string::String,
    /// 매수/매도
    #[prost(enumeration="super::common::OrderSide", tag="4")]
    pub side: i32,
    /// 가격
    #[prost(string, tag="5")]
    pub price: ::prost::alloc::string::String,
    /// 수량
    #[prost(int64, tag="6")]
    pub quantity: i64,
    /// 결과 유형
    #[prost(enumeration="OrderResultType", tag="7")]
    pub result_type: i32,
    /// 타임스탬프
    #[prost(message, optional, tag="8")]
    pub timestamp: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// result_type에 따른 추가 정보
    #[prost(oneof="order_result::Details", tags="10, 11, 12, 13")]
    pub details: ::core::option::Option<order_result::Details>,
}
/// Nested message and enum types in `OrderResult`.
pub mod order_result {
    /// result_type에 따른 추가 정보
    #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Details {
        #[prost(message, tag="10")]
        Received(super::ReceivedDetails),
        #[prost(message, tag="11")]
        Rejected(super::RejectedDetails),
        #[prost(message, tag="12")]
        Filled(super::FilledDetails),
        #[prost(message, tag="13")]
        Cancelled(super::CancelledDetails),
    }
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ReceivedDetails {
    /// 접수 시간 (nanoseconds since epoch)
    #[prost(uint64, tag="1")]
    pub receive_time: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RejectedDetails {
    /// 거부 코드
    #[prost(string, tag="1")]
    pub rejection_code: ::prost::alloc::string::String,
    /// 에러 메시지
    #[prost(string, tag="2")]
    pub error_message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FilledDetails {
    /// 체결 가격
    #[prost(string, tag="1")]
    pub filled_price: ::prost::alloc::string::String,
    /// 체결 수량
    #[prost(int64, tag="2")]
    pub filled_quantity: i64,
    /// 체결 시간 (nanoseconds since epoch)
    #[prost(uint64, tag="3")]
    pub trade_time: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelledDetails {
    /// 취소 코드
    #[prost(string, tag="1")]
    pub cancellation_code: ::prost::alloc::string::String,
    /// 취소 수량
    #[prost(int64, tag="2")]
    pub cancelled_quantity: i64,
}
/// 주문 목록 조회 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOrdersRequest {
    /// 필터링 조건 (선택적, AIP-160)
    #[prost(string, tag="1")]
    pub filter: ::prost::alloc::string::String,
    /// 페이징 (AIP-158)
    #[prost(int32, tag="2")]
    pub page_size: i32,
    #[prost(string, tag="3")]
    pub page_token: ::prost::alloc::string::String,
}
/// 주문 목록 조회 응답
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOrdersResponse {
    /// 주문 목록
    #[prost(message, repeated, tag="1")]
    pub orders: ::prost::alloc::vec::Vec<Order>,
    /// 다음 페이지 토큰 (AIP-158)
    #[prost(string, tag="2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// 주문 정보
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Order {
    /// 주문 ID
    #[prost(string, tag="1")]
    pub order_id: ::prost::alloc::string::String,
    /// 주문 타입
    #[prost(enumeration="super::common::OrderSide", tag="2")]
    pub order_side: i32,
    /// 상품 (예: etfs/A069500)
    #[prost(string, tag="3")]
    pub symbol: ::prost::alloc::string::String,
    /// 주문 가격
    #[prost(string, tag="4")]
    pub price: ::prost::alloc::string::String,
    /// 주문 수량
    #[prost(int64, tag="5")]
    pub quantity: i64,
    /// 체결 수량
    #[prost(int64, tag="6")]
    pub filled_quantity: i64,
    /// 주문 상태
    #[prost(enumeration="OrderStatus", tag="7")]
    pub status: i32,
    /// 주문 시간 (Unix timestamp)
    #[prost(int64, tag="8")]
    pub created_at: i64,
    /// 업데이트 시간 (Unix timestamp)
    #[prost(int64, tag="9")]
    pub updated_at: i64,
    /// 펀드 코드
    #[prost(string, tag="10")]
    pub fund_code: ::prost::alloc::string::String,
}
// ========== Enums ==========

#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum QuoteType {
    Unspecified = 0,
    /// 지정가
    Limit = 1,
    /// 시장가
    Market = 2,
    /// 상대호가
    BestTake = 3,
    /// 자기호가
    BestMake = 4,
}
impl QuoteType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            QuoteType::Unspecified => "QUOTE_TYPE_UNSPECIFIED",
            QuoteType::Limit => "QUOTE_TYPE_LIMIT",
            QuoteType::Market => "QUOTE_TYPE_MARKET",
            QuoteType::BestTake => "QUOTE_TYPE_BEST_TAKE",
            QuoteType::BestMake => "QUOTE_TYPE_BEST_MAKE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "QUOTE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "QUOTE_TYPE_LIMIT" => Some(Self::Limit),
            "QUOTE_TYPE_MARKET" => Some(Self::Market),
            "QUOTE_TYPE_BEST_TAKE" => Some(Self::BestTake),
            "QUOTE_TYPE_BEST_MAKE" => Some(Self::BestMake),
            _ => None,
        }
    }
}
/// 지정가 가격 결정 방식
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LimitPriceType {
    /// 직접 지정한 가격 사용 (price 필드 사용)
    Unspecified = 0,
    /// 상대호가 (매수→매도1호가, 매도→매수1호가)
    BestTake = 1,
    /// 상대호가 +1틱 (더 공격적: 매수는 가격↑, 매도는 가격↓)
    BestTakePlus1 = 2,
    /// 상대호가 +2틱 (더 공격적)
    BestTakePlus2 = 3,
    /// 상대호가 +3틱 (더 공격적)
    BestTakePlus3 = 4,
    /// 자기호가 -1틱 (덜 공격적: 매수는 가격↓, 매도는 가격↑)
    BestMakeMinus1 = 5,
    /// 자기호가 -2틱 (덜 공격적)
    BestMakeMinus2 = 6,
    /// 자기호가 -3틱 (덜 공격적)
    BestMakeMinus3 = 7,
}
impl LimitPriceType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            LimitPriceType::Unspecified => "LIMIT_PRICE_TYPE_UNSPECIFIED",
            LimitPriceType::BestTake => "LIMIT_PRICE_TYPE_BEST_TAKE",
            LimitPriceType::BestTakePlus1 => "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_1",
            LimitPriceType::BestTakePlus2 => "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_2",
            LimitPriceType::BestTakePlus3 => "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_3",
            LimitPriceType::BestMakeMinus1 => "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_1",
            LimitPriceType::BestMakeMinus2 => "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_2",
            LimitPriceType::BestMakeMinus3 => "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_3",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "LIMIT_PRICE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "LIMIT_PRICE_TYPE_BEST_TAKE" => Some(Self::BestTake),
            "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_1" => Some(Self::BestTakePlus1),
            "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_2" => Some(Self::BestTakePlus2),
            "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_3" => Some(Self::BestTakePlus3),
            "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_1" => Some(Self::BestMakeMinus1),
            "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_2" => Some(Self::BestMakeMinus2),
            "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_3" => Some(Self::BestMakeMinus3),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderStatus {
    Unspecified = 0,
    /// 주문 제출됨
    Submitted = 1,
    /// 거부됨 (validation 실패)
    Rejected = 2,
}
impl OrderStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            OrderStatus::Unspecified => "ORDER_STATUS_UNSPECIFIED",
            OrderStatus::Submitted => "ORDER_STATUS_SUBMITTED",
            OrderStatus::Rejected => "ORDER_STATUS_REJECTED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "ORDER_STATUS_SUBMITTED" => Some(Self::Submitted),
            "ORDER_STATUS_REJECTED" => Some(Self::Rejected),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderResultType {
    Unspecified = 0,
    /// 접수됨
    Received = 1,
    /// 거부됨
    Rejected = 2,
    /// 체결됨
    Filled = 3,
    /// 취소됨
    Cancelled = 4,
}
impl OrderResultType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            OrderResultType::Unspecified => "ORDER_RESULT_TYPE_UNSPECIFIED",
            OrderResultType::Received => "ORDER_RESULT_TYPE_RECEIVED",
            OrderResultType::Rejected => "ORDER_RESULT_TYPE_REJECTED",
            OrderResultType::Filled => "ORDER_RESULT_TYPE_FILLED",
            OrderResultType::Cancelled => "ORDER_RESULT_TYPE_CANCELLED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_RESULT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "ORDER_RESULT_TYPE_RECEIVED" => Some(Self::Received),
            "ORDER_RESULT_TYPE_REJECTED" => Some(Self::Rejected),
            "ORDER_RESULT_TYPE_FILLED" => Some(Self::Filled),
            "ORDER_RESULT_TYPE_CANCELLED" => Some(Self::Cancelled),
            _ => None,
        }
    }
}
include!("kdo.v1.order.tonic.rs");
include!("kdo.v1.order.serde.rs");
// @@protoc_insertion_point(module)