trading_client/datastructures/order.rs
1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Deserialize, Serialize)]
4pub struct Order {
5 symbol: String,
6 quantity: u32,
7 order_type: OrderType,
8 time_in_force: String, // "gtc", "ioc", etc.
9}
10
11// Response after placing an order
12pub struct OrderResponse {
13 pub id: String,
14 pub status: OrderStatus,
15}
16
17#[derive(Debug, Deserialize, Serialize)]
18pub enum OrderType {
19 Buy,
20 Sell,
21}
22
23// Example of order status
24pub enum OrderStatus {
25 Filled,
26 Pending,
27 Cancelled,
28}