1use crate::{Side, TimeInForce, WalletAddress};
4use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Clone, Serialize, Deserialize)]
8#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
9pub struct PlaceOrderRequest {
10 #[cfg_attr(feature = "utoipa", schema(value_type = String))]
11 pub wallet: WalletAddress,
12 pub price: String,
14 pub size: String,
16 pub symbol: String,
17 pub side: Side,
18 #[serde(default)]
19 pub tif: TimeInForce,
20 pub client_id: Option<String>,
21 pub nonce: u64,
22 pub signature: String,
23 #[serde(default)]
24 pub mmp_enabled: bool,
25 #[serde(skip_serializing_if = "Option::is_none")]
27 #[cfg_attr(feature = "utoipa", schema(value_type = Option<String>))]
28 pub builder_code_address: Option<WalletAddress>,
29}
30
31#[derive(Debug, Clone, Serialize, Deserialize)]
33#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
34pub struct CancelOrderRequest {
35 #[cfg_attr(feature = "utoipa", schema(value_type = String))]
36 pub wallet: WalletAddress,
37 pub order_id: u64,
38 pub nonce: u64,
39 pub signature: String,
40}
41
42#[derive(Debug, Clone, Serialize, Deserialize)]
44#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
45pub struct CancelOrderByClientIdRequest {
46 #[cfg_attr(feature = "utoipa", schema(value_type = String))]
47 pub wallet: WalletAddress,
48 pub client_id: String,
49 pub nonce: u64,
50 pub signature: String,
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
56pub struct CancelOrderByCloidRequest {
57 #[cfg_attr(feature = "utoipa", schema(value_type = String))]
58 pub wallet: WalletAddress,
59 pub client_id: String,
60 pub nonce: u64,
61 pub signature: String,
62}
63
64#[derive(Debug, Clone, Serialize, Deserialize)]
66#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
67pub struct SetMarginModeRequest {
68 #[cfg_attr(feature = "utoipa", schema(value_type = String))]
69 pub wallet: WalletAddress,
70 pub margin_mode: String,
71 pub nonce: u64,
72 pub signature: String,
73}
74
75#[derive(Debug, Clone, Serialize, Deserialize)]
77#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
78pub struct BulkPlaceOrderRequest {
79 pub orders: Vec<PlaceOrderRequest>,
80}
81
82#[derive(Debug, Clone, Serialize, Deserialize)]
84#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
85pub struct BulkCancelOrderRequest {
86 pub cancels: Vec<CancelOrderRequest>,
87}
88
89#[derive(Debug, Clone, Serialize, Deserialize)]
91#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
92pub struct ApproveAgentRequest {
93 #[cfg_attr(feature = "utoipa", schema(value_type = String))]
95 pub agent: WalletAddress,
96 pub nonce: u64,
98 pub signature: String,
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
105pub struct RevokeAgentRequest {
106 #[cfg_attr(feature = "utoipa", schema(value_type = String))]
108 pub agent: WalletAddress,
109 pub nonce: u64,
111 pub signature: String,
113}
114
115#[derive(Debug, Clone, Serialize, Deserialize)]
117#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
118pub struct ReplaceOrderRequest {
119 #[cfg_attr(feature = "utoipa", schema(value_type = String))]
120 pub wallet: WalletAddress,
121 pub order_id: u64,
123 pub price: String,
125 pub size: String,
127 pub symbol: String,
129 pub side: Side,
131 #[serde(default)]
133 pub tif: TimeInForce,
134 pub client_id: Option<String>,
136 pub nonce: u64,
137 pub signature: String,
138 #[serde(default)]
139 pub mmp_enabled: bool,
140 #[serde(skip_serializing_if = "Option::is_none")]
142 #[cfg_attr(feature = "utoipa", schema(value_type = Option<String>))]
143 pub builder_code_address: Option<WalletAddress>,
144}
145
146#[derive(Debug, Clone, Serialize, Deserialize)]
148#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
149pub struct FaucetRequest {
150 #[cfg_attr(feature = "utoipa", schema(value_type = String))]
151 pub wallet: WalletAddress,
152 pub amount: f64,
153}
154
155#[derive(Debug, Clone, Serialize, Deserialize)]
159#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
160pub struct RfqLegRequest {
161 pub instrument: String,
162 pub side: Side,
163 pub size: String,
164}
165
166#[derive(Debug, Clone, Serialize, Deserialize)]
168#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
169pub struct SubmitRfqRequest {
170 pub rfq_id: String,
171 pub legs: Vec<RfqLegRequest>,
172 #[cfg_attr(feature = "utoipa", schema(value_type = String))]
173 pub wallet_address: WalletAddress,
174 pub nonce: u64,
175 pub signature: String,
176 #[serde(default, skip_serializing_if = "Option::is_none")]
181 pub auto_accept_limit: Option<String>,
182}
183
184#[derive(Debug, Clone, Serialize, Deserialize)]
186#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
187pub struct AcceptRfqRequest {
188 pub rfq_id: String,
189 pub quote_id: String,
190 #[cfg_attr(feature = "utoipa", schema(value_type = String))]
191 pub wallet_address: WalletAddress,
192 pub nonce: u64,
193 pub signature: String,
194}
195
196#[derive(Debug, Clone, Serialize, Deserialize)]
198#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
199pub struct RegisterQuoteProviderRequest {
200 #[cfg_attr(feature = "utoipa", schema(value_type = String))]
201 pub wallet_address: WalletAddress,
202 pub tier: String,
203 pub allowed_underlyings: Option<Vec<String>>,
204 pub max_notional_per_quote: String,
205 pub max_open_notional: String,
206}