crypticorn 1.0.0__py3-none-any.whl → 1.0.2rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. crypticorn/__init__.py +3 -3
  2. crypticorn/client.py +722 -0
  3. crypticorn/{api.py → hive/main.py} +6 -6
  4. crypticorn/hive/requirements.txt +4 -0
  5. crypticorn/{utils.py → hive/utils.py} +2 -2
  6. crypticorn/klines/client/__init__.py +62 -0
  7. crypticorn/klines/client/api/__init__.py +9 -0
  8. crypticorn/klines/client/api/funding_rates_api.py +362 -0
  9. crypticorn/klines/client/api/health_check_api.py +281 -0
  10. crypticorn/klines/client/api/ohlcv_data_api.py +409 -0
  11. crypticorn/klines/client/api/symbols_api.py +308 -0
  12. crypticorn/klines/client/api/udf_api.py +1929 -0
  13. crypticorn/klines/client/api_client.py +797 -0
  14. crypticorn/klines/client/api_response.py +21 -0
  15. crypticorn/klines/client/configuration.py +565 -0
  16. crypticorn/klines/client/exceptions.py +216 -0
  17. crypticorn/klines/client/models/__init__.py +41 -0
  18. crypticorn/klines/client/models/base_response_health_check_response.py +108 -0
  19. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +112 -0
  20. crypticorn/klines/client/models/base_response_list_str.py +104 -0
  21. crypticorn/klines/client/models/base_response_ohlcv_response.py +108 -0
  22. crypticorn/klines/client/models/error_response.py +101 -0
  23. crypticorn/klines/client/models/exchange.py +91 -0
  24. crypticorn/klines/client/models/funding_rate_response.py +92 -0
  25. crypticorn/klines/client/models/health_check_response.py +89 -0
  26. crypticorn/klines/client/models/history_error_response.py +89 -0
  27. crypticorn/klines/client/models/history_no_data_response.py +99 -0
  28. crypticorn/klines/client/models/history_success_response.py +99 -0
  29. crypticorn/klines/client/models/http_validation_error.py +95 -0
  30. crypticorn/klines/client/models/market.py +37 -0
  31. crypticorn/klines/client/models/ohlcv_response.py +98 -0
  32. crypticorn/klines/client/models/resolution.py +40 -0
  33. crypticorn/klines/client/models/response_get_history_udf_history_get.py +149 -0
  34. crypticorn/klines/client/models/search_symbol_response.py +97 -0
  35. crypticorn/klines/client/models/sort_direction.py +37 -0
  36. crypticorn/klines/client/models/symbol_group_response.py +87 -0
  37. crypticorn/klines/client/models/symbol_info_response.py +115 -0
  38. crypticorn/klines/client/models/symbol_type.py +89 -0
  39. crypticorn/klines/client/models/timeframe.py +40 -0
  40. crypticorn/klines/client/models/udf_config_response.py +121 -0
  41. crypticorn/klines/client/models/validation_error.py +99 -0
  42. crypticorn/klines/client/models/validation_error_loc_inner.py +138 -0
  43. crypticorn/klines/client/py.typed +0 -0
  44. crypticorn/klines/client/rest.py +257 -0
  45. crypticorn/klines/main.py +42 -0
  46. crypticorn/klines/requirements.txt +4 -0
  47. crypticorn/klines/test/__init__.py +0 -0
  48. crypticorn/klines/test/test_base_response_health_check_response.py +56 -0
  49. crypticorn/klines/test/test_base_response_list_funding_rate_response.py +59 -0
  50. crypticorn/klines/test/test_base_response_list_str.py +56 -0
  51. crypticorn/klines/test/test_base_response_ohlcv_response.py +72 -0
  52. crypticorn/klines/test/test_error_response.py +57 -0
  53. crypticorn/klines/test/test_exchange.py +56 -0
  54. crypticorn/klines/test/test_funding_rate_response.py +56 -0
  55. crypticorn/klines/test/test_funding_rates_api.py +38 -0
  56. crypticorn/klines/test/test_health_check_api.py +38 -0
  57. crypticorn/klines/test/test_health_check_response.py +52 -0
  58. crypticorn/klines/test/test_history_error_response.py +53 -0
  59. crypticorn/klines/test/test_history_no_data_response.py +69 -0
  60. crypticorn/klines/test/test_history_success_response.py +87 -0
  61. crypticorn/klines/test/test_http_validation_error.py +58 -0
  62. crypticorn/klines/test/test_market.py +33 -0
  63. crypticorn/klines/test/test_ohlcv_data_api.py +38 -0
  64. crypticorn/klines/test/test_ohlcv_response.py +86 -0
  65. crypticorn/klines/test/test_resolution.py +33 -0
  66. crypticorn/klines/test/test_response_get_history_udf_history_get.py +89 -0
  67. crypticorn/klines/test/test_search_symbol_response.py +62 -0
  68. crypticorn/klines/test/test_sort_direction.py +33 -0
  69. crypticorn/klines/test/test_symbol_group_response.py +53 -0
  70. crypticorn/klines/test/test_symbol_info_response.py +84 -0
  71. crypticorn/klines/test/test_symbol_type.py +54 -0
  72. crypticorn/klines/test/test_symbols_api.py +38 -0
  73. crypticorn/klines/test/test_timeframe.py +33 -0
  74. crypticorn/klines/test/test_udf_api.py +80 -0
  75. crypticorn/klines/test/test_udf_config_response.py +95 -0
  76. crypticorn/klines/test/test_validation_error.py +60 -0
  77. crypticorn/klines/test/test_validation_error_loc_inner.py +50 -0
  78. crypticorn/trade/client/__init__.py +63 -0
  79. crypticorn/trade/client/api/__init__.py +13 -0
  80. crypticorn/trade/client/api/api_keys_api.py +1468 -0
  81. crypticorn/trade/client/api/bots_api.py +1211 -0
  82. crypticorn/trade/client/api/exchanges_api.py +297 -0
  83. crypticorn/trade/client/api/futures_trading_panel_api.py +1463 -0
  84. crypticorn/trade/client/api/notifications_api.py +1767 -0
  85. crypticorn/trade/client/api/orders_api.py +331 -0
  86. crypticorn/trade/client/api/status_api.py +278 -0
  87. crypticorn/trade/client/api/strategies_api.py +331 -0
  88. crypticorn/trade/client/api/trading_actions_api.py +898 -0
  89. crypticorn/trade/client/api_client.py +797 -0
  90. crypticorn/trade/client/api_response.py +21 -0
  91. crypticorn/trade/client/configuration.py +574 -0
  92. crypticorn/trade/client/exceptions.py +216 -0
  93. crypticorn/trade/client/models/__init__.py +38 -0
  94. crypticorn/trade/client/models/action_model.py +202 -0
  95. crypticorn/trade/client/models/api_error_identifier.py +83 -0
  96. crypticorn/trade/client/models/api_key_model.py +135 -0
  97. crypticorn/trade/client/models/bot_model.py +122 -0
  98. crypticorn/trade/client/models/exchange.py +37 -0
  99. crypticorn/trade/client/models/execution_ids.py +91 -0
  100. crypticorn/trade/client/models/futures_balance.py +109 -0
  101. crypticorn/trade/client/models/futures_trading_action.py +198 -0
  102. crypticorn/trade/client/models/http_validation_error.py +95 -0
  103. crypticorn/trade/client/models/margin_mode.py +37 -0
  104. crypticorn/trade/client/models/market_type.py +37 -0
  105. crypticorn/trade/client/models/notification_model.py +113 -0
  106. crypticorn/trade/client/models/notification_type.py +39 -0
  107. crypticorn/trade/client/models/order_model.py +263 -0
  108. crypticorn/trade/client/models/order_status.py +40 -0
  109. crypticorn/trade/client/models/post_futures_action.py +93 -0
  110. crypticorn/trade/client/models/strategy_exchange_info.py +90 -0
  111. crypticorn/trade/client/models/strategy_model.py +119 -0
  112. crypticorn/trade/client/models/tpsl.py +116 -0
  113. crypticorn/trade/client/models/trading_action_type.py +39 -0
  114. crypticorn/trade/client/models/update_notification.py +91 -0
  115. crypticorn/trade/client/models/validation_error.py +99 -0
  116. crypticorn/trade/client/models/validation_error_loc_inner.py +138 -0
  117. crypticorn/trade/client/py.typed +0 -0
  118. crypticorn/trade/client/rest.py +257 -0
  119. crypticorn/trade/main.py +38 -0
  120. crypticorn/trade/requirements.txt +4 -0
  121. crypticorn/trade/test/__init__.py +0 -0
  122. crypticorn/trade/test/test_action_model.py +87 -0
  123. crypticorn/trade/test/test_api_error_identifier.py +33 -0
  124. crypticorn/trade/test/test_api_key_model.py +61 -0
  125. crypticorn/trade/test/test_api_keys_api.py +66 -0
  126. crypticorn/trade/test/test_bot_model.py +64 -0
  127. crypticorn/trade/test/test_bots_api.py +59 -0
  128. crypticorn/trade/test/test_exchange.py +33 -0
  129. crypticorn/trade/test/test_exchanges_api.py +38 -0
  130. crypticorn/trade/test/test_execution_ids.py +68 -0
  131. crypticorn/trade/test/test_futures_balance.py +62 -0
  132. crypticorn/trade/test/test_futures_trading_action.py +86 -0
  133. crypticorn/trade/test/test_futures_trading_panel_api.py +66 -0
  134. crypticorn/trade/test/test_http_validation_error.py +58 -0
  135. crypticorn/trade/test/test_margin_mode.py +33 -0
  136. crypticorn/trade/test/test_market_type.py +33 -0
  137. crypticorn/trade/test/test_notification_model.py +59 -0
  138. crypticorn/trade/test/test_notification_type.py +33 -0
  139. crypticorn/trade/test/test_notifications_api.py +73 -0
  140. crypticorn/trade/test/test_order_model.py +75 -0
  141. crypticorn/trade/test/test_order_status.py +33 -0
  142. crypticorn/trade/test/test_orders_api.py +38 -0
  143. crypticorn/trade/test/test_post_futures_action.py +72 -0
  144. crypticorn/trade/test/test_status_api.py +38 -0
  145. crypticorn/trade/test/test_strategies_api.py +38 -0
  146. crypticorn/trade/test/test_strategy_exchange_info.py +54 -0
  147. crypticorn/trade/test/test_strategy_model.py +73 -0
  148. crypticorn/trade/test/test_tpsl.py +56 -0
  149. crypticorn/trade/test/test_trading_action_type.py +33 -0
  150. crypticorn/trade/test/test_trading_actions_api.py +52 -0
  151. crypticorn/trade/test/test_update_notification.py +54 -0
  152. crypticorn/trade/test/test_validation_error.py +60 -0
  153. crypticorn/trade/test/test_validation_error_loc_inner.py +50 -0
  154. crypticorn-1.0.2rc1.dist-info/METADATA +47 -0
  155. crypticorn-1.0.2rc1.dist-info/RECORD +158 -0
  156. {crypticorn-1.0.0.dist-info → crypticorn-1.0.2rc1.dist-info}/WHEEL +1 -1
  157. crypticorn-1.0.0.dist-info/METADATA +0 -34
  158. crypticorn-1.0.0.dist-info/RECORD +0 -8
  159. {crypticorn-1.0.0.dist-info → crypticorn-1.0.2rc1.dist-info}/LICENSE.md +0 -0
  160. {crypticorn-1.0.0.dist-info → crypticorn-1.0.2rc1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1463 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FastAPI
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import StrictStr
20
+ from typing import Any, Dict, List, Optional
21
+ from crypticorn.trade.client.models.futures_balance import FuturesBalance
22
+
23
+ from crypticorn.trade.client.api_client import ApiClient, RequestSerialized
24
+ from crypticorn.trade.client.api_response import ApiResponse
25
+ from crypticorn.trade.client.rest import RESTResponseType
26
+
27
+
28
+ class FuturesTradingPanelApi:
29
+ """NOTE: This class is auto generated by OpenAPI Generator
30
+ Ref: https://openapi-generator.tech
31
+
32
+ Do not edit the class manually.
33
+ """
34
+
35
+ def __init__(self, api_client=None) -> None:
36
+ if api_client is None:
37
+ api_client = ApiClient.get_default()
38
+ self.api_client = api_client
39
+
40
+
41
+ @validate_call
42
+ def cancel_futures_order(
43
+ self,
44
+ order_id: StrictStr,
45
+ symbol: StrictStr,
46
+ key: StrictStr,
47
+ access_token: Optional[StrictStr] = None,
48
+ _request_timeout: Union[
49
+ None,
50
+ Annotated[StrictFloat, Field(gt=0)],
51
+ Tuple[
52
+ Annotated[StrictFloat, Field(gt=0)],
53
+ Annotated[StrictFloat, Field(gt=0)]
54
+ ]
55
+ ] = None,
56
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
57
+ _content_type: Optional[StrictStr] = None,
58
+ _headers: Optional[Dict[StrictStr, Any]] = None,
59
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
60
+ ) -> object:
61
+ """Cancel Order
62
+
63
+
64
+ :param order_id: (required)
65
+ :type order_id: str
66
+ :param symbol: (required)
67
+ :type symbol: str
68
+ :param key: (required)
69
+ :type key: str
70
+ :param access_token:
71
+ :type access_token: str
72
+ :param _request_timeout: timeout setting for this request. If one
73
+ number provided, it will be total request
74
+ timeout. It can also be a pair (tuple) of
75
+ (connection, read) timeouts.
76
+ :type _request_timeout: int, tuple(int, int), optional
77
+ :param _request_auth: set to override the auth_settings for an a single
78
+ request; this effectively ignores the
79
+ authentication in the spec for a single request.
80
+ :type _request_auth: dict, optional
81
+ :param _content_type: force content-type for the request.
82
+ :type _content_type: str, Optional
83
+ :param _headers: set to override the headers for a single
84
+ request; this effectively ignores the headers
85
+ in the spec for a single request.
86
+ :type _headers: dict, optional
87
+ :param _host_index: set to override the host_index for a single
88
+ request; this effectively ignores the host_index
89
+ in the spec for a single request.
90
+ :type _host_index: int, optional
91
+ :return: Returns the result object.
92
+ """ # noqa: E501
93
+
94
+ _param = self._cancel_futures_order_serialize(
95
+ order_id=order_id,
96
+ symbol=symbol,
97
+ key=key,
98
+ access_token=access_token,
99
+ _request_auth=_request_auth,
100
+ _content_type=_content_type,
101
+ _headers=_headers,
102
+ _host_index=_host_index
103
+ )
104
+
105
+ _response_types_map: Dict[str, Optional[str]] = {
106
+ '200': "object",
107
+ '422': "HTTPValidationError",
108
+ }
109
+ response_data = self.api_client.call_api(
110
+ *_param,
111
+ _request_timeout=_request_timeout
112
+ )
113
+ response_data.read()
114
+ return self.api_client.response_deserialize(
115
+ response_data=response_data,
116
+ response_types_map=_response_types_map,
117
+ ).data
118
+
119
+
120
+ @validate_call
121
+ def cancel_futures_order_with_http_info(
122
+ self,
123
+ order_id: StrictStr,
124
+ symbol: StrictStr,
125
+ key: StrictStr,
126
+ access_token: Optional[StrictStr] = None,
127
+ _request_timeout: Union[
128
+ None,
129
+ Annotated[StrictFloat, Field(gt=0)],
130
+ Tuple[
131
+ Annotated[StrictFloat, Field(gt=0)],
132
+ Annotated[StrictFloat, Field(gt=0)]
133
+ ]
134
+ ] = None,
135
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
136
+ _content_type: Optional[StrictStr] = None,
137
+ _headers: Optional[Dict[StrictStr, Any]] = None,
138
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
139
+ ) -> ApiResponse[object]:
140
+ """Cancel Order
141
+
142
+
143
+ :param order_id: (required)
144
+ :type order_id: str
145
+ :param symbol: (required)
146
+ :type symbol: str
147
+ :param key: (required)
148
+ :type key: str
149
+ :param access_token:
150
+ :type access_token: str
151
+ :param _request_timeout: timeout setting for this request. If one
152
+ number provided, it will be total request
153
+ timeout. It can also be a pair (tuple) of
154
+ (connection, read) timeouts.
155
+ :type _request_timeout: int, tuple(int, int), optional
156
+ :param _request_auth: set to override the auth_settings for an a single
157
+ request; this effectively ignores the
158
+ authentication in the spec for a single request.
159
+ :type _request_auth: dict, optional
160
+ :param _content_type: force content-type for the request.
161
+ :type _content_type: str, Optional
162
+ :param _headers: set to override the headers for a single
163
+ request; this effectively ignores the headers
164
+ in the spec for a single request.
165
+ :type _headers: dict, optional
166
+ :param _host_index: set to override the host_index for a single
167
+ request; this effectively ignores the host_index
168
+ in the spec for a single request.
169
+ :type _host_index: int, optional
170
+ :return: Returns the result object.
171
+ """ # noqa: E501
172
+
173
+ _param = self._cancel_futures_order_serialize(
174
+ order_id=order_id,
175
+ symbol=symbol,
176
+ key=key,
177
+ access_token=access_token,
178
+ _request_auth=_request_auth,
179
+ _content_type=_content_type,
180
+ _headers=_headers,
181
+ _host_index=_host_index
182
+ )
183
+
184
+ _response_types_map: Dict[str, Optional[str]] = {
185
+ '200': "object",
186
+ '422': "HTTPValidationError",
187
+ }
188
+ response_data = self.api_client.call_api(
189
+ *_param,
190
+ _request_timeout=_request_timeout
191
+ )
192
+ response_data.read()
193
+ return self.api_client.response_deserialize(
194
+ response_data=response_data,
195
+ response_types_map=_response_types_map,
196
+ )
197
+
198
+
199
+ @validate_call
200
+ def cancel_futures_order_without_preload_content(
201
+ self,
202
+ order_id: StrictStr,
203
+ symbol: StrictStr,
204
+ key: StrictStr,
205
+ access_token: Optional[StrictStr] = None,
206
+ _request_timeout: Union[
207
+ None,
208
+ Annotated[StrictFloat, Field(gt=0)],
209
+ Tuple[
210
+ Annotated[StrictFloat, Field(gt=0)],
211
+ Annotated[StrictFloat, Field(gt=0)]
212
+ ]
213
+ ] = None,
214
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
215
+ _content_type: Optional[StrictStr] = None,
216
+ _headers: Optional[Dict[StrictStr, Any]] = None,
217
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
218
+ ) -> RESTResponseType:
219
+ """Cancel Order
220
+
221
+
222
+ :param order_id: (required)
223
+ :type order_id: str
224
+ :param symbol: (required)
225
+ :type symbol: str
226
+ :param key: (required)
227
+ :type key: str
228
+ :param access_token:
229
+ :type access_token: str
230
+ :param _request_timeout: timeout setting for this request. If one
231
+ number provided, it will be total request
232
+ timeout. It can also be a pair (tuple) of
233
+ (connection, read) timeouts.
234
+ :type _request_timeout: int, tuple(int, int), optional
235
+ :param _request_auth: set to override the auth_settings for an a single
236
+ request; this effectively ignores the
237
+ authentication in the spec for a single request.
238
+ :type _request_auth: dict, optional
239
+ :param _content_type: force content-type for the request.
240
+ :type _content_type: str, Optional
241
+ :param _headers: set to override the headers for a single
242
+ request; this effectively ignores the headers
243
+ in the spec for a single request.
244
+ :type _headers: dict, optional
245
+ :param _host_index: set to override the host_index for a single
246
+ request; this effectively ignores the host_index
247
+ in the spec for a single request.
248
+ :type _host_index: int, optional
249
+ :return: Returns the result object.
250
+ """ # noqa: E501
251
+
252
+ _param = self._cancel_futures_order_serialize(
253
+ order_id=order_id,
254
+ symbol=symbol,
255
+ key=key,
256
+ access_token=access_token,
257
+ _request_auth=_request_auth,
258
+ _content_type=_content_type,
259
+ _headers=_headers,
260
+ _host_index=_host_index
261
+ )
262
+
263
+ _response_types_map: Dict[str, Optional[str]] = {
264
+ '200': "object",
265
+ '422': "HTTPValidationError",
266
+ }
267
+ response_data = self.api_client.call_api(
268
+ *_param,
269
+ _request_timeout=_request_timeout
270
+ )
271
+ return response_data.response
272
+
273
+
274
+ def _cancel_futures_order_serialize(
275
+ self,
276
+ order_id,
277
+ symbol,
278
+ key,
279
+ access_token,
280
+ _request_auth,
281
+ _content_type,
282
+ _headers,
283
+ _host_index,
284
+ ) -> RequestSerialized:
285
+
286
+ _host = None
287
+
288
+ _collection_formats: Dict[str, str] = {
289
+ }
290
+
291
+ _path_params: Dict[str, str] = {}
292
+ _query_params: List[Tuple[str, str]] = []
293
+ _header_params: Dict[str, Optional[str]] = _headers or {}
294
+ _form_params: List[Tuple[str, str]] = []
295
+ _files: Dict[
296
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
297
+ ] = {}
298
+ _body_params: Optional[bytes] = None
299
+
300
+ # process the path parameters
301
+ # process the query parameters
302
+ if order_id is not None:
303
+
304
+ _query_params.append(('orderId', order_id))
305
+
306
+ if symbol is not None:
307
+
308
+ _query_params.append(('symbol', symbol))
309
+
310
+ if key is not None:
311
+
312
+ _query_params.append(('key', key))
313
+
314
+ # process the header parameters
315
+ # process the form parameters
316
+ # process the body parameter
317
+
318
+
319
+ # set the HTTP header `Accept`
320
+ if 'Accept' not in _header_params:
321
+ _header_params['Accept'] = self.api_client.select_header_accept(
322
+ [
323
+ 'application/json'
324
+ ]
325
+ )
326
+
327
+
328
+ # authentication setting
329
+ _auth_settings: List[str] = [
330
+ 'OAuth2PasswordBearer'
331
+ ]
332
+
333
+ return self.api_client.param_serialize(
334
+ method='DELETE',
335
+ resource_path='/futures/orders',
336
+ path_params=_path_params,
337
+ query_params=_query_params,
338
+ header_params=_header_params,
339
+ body=_body_params,
340
+ post_params=_form_params,
341
+ files=_files,
342
+ auth_settings=_auth_settings,
343
+ collection_formats=_collection_formats,
344
+ _host=_host,
345
+ _request_auth=_request_auth
346
+ )
347
+
348
+
349
+
350
+
351
+ @validate_call
352
+ def get_futures_balance(
353
+ self,
354
+ access_token: Optional[StrictStr] = None,
355
+ _request_timeout: Union[
356
+ None,
357
+ Annotated[StrictFloat, Field(gt=0)],
358
+ Tuple[
359
+ Annotated[StrictFloat, Field(gt=0)],
360
+ Annotated[StrictFloat, Field(gt=0)]
361
+ ]
362
+ ] = None,
363
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
364
+ _content_type: Optional[StrictStr] = None,
365
+ _headers: Optional[Dict[StrictStr, Any]] = None,
366
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
367
+ ) -> List[FuturesBalance]:
368
+ """Get Futures Balance
369
+
370
+
371
+ :param access_token:
372
+ :type access_token: str
373
+ :param _request_timeout: timeout setting for this request. If one
374
+ number provided, it will be total request
375
+ timeout. It can also be a pair (tuple) of
376
+ (connection, read) timeouts.
377
+ :type _request_timeout: int, tuple(int, int), optional
378
+ :param _request_auth: set to override the auth_settings for an a single
379
+ request; this effectively ignores the
380
+ authentication in the spec for a single request.
381
+ :type _request_auth: dict, optional
382
+ :param _content_type: force content-type for the request.
383
+ :type _content_type: str, Optional
384
+ :param _headers: set to override the headers for a single
385
+ request; this effectively ignores the headers
386
+ in the spec for a single request.
387
+ :type _headers: dict, optional
388
+ :param _host_index: set to override the host_index for a single
389
+ request; this effectively ignores the host_index
390
+ in the spec for a single request.
391
+ :type _host_index: int, optional
392
+ :return: Returns the result object.
393
+ """ # noqa: E501
394
+
395
+ _param = self._get_futures_balance_serialize(
396
+ access_token=access_token,
397
+ _request_auth=_request_auth,
398
+ _content_type=_content_type,
399
+ _headers=_headers,
400
+ _host_index=_host_index
401
+ )
402
+
403
+ _response_types_map: Dict[str, Optional[str]] = {
404
+ '200': "List[FuturesBalance]",
405
+ '422': "HTTPValidationError",
406
+ }
407
+ response_data = self.api_client.call_api(
408
+ *_param,
409
+ _request_timeout=_request_timeout
410
+ )
411
+ response_data.read()
412
+ return self.api_client.response_deserialize(
413
+ response_data=response_data,
414
+ response_types_map=_response_types_map,
415
+ ).data
416
+
417
+
418
+ @validate_call
419
+ def get_futures_balance_with_http_info(
420
+ self,
421
+ access_token: Optional[StrictStr] = None,
422
+ _request_timeout: Union[
423
+ None,
424
+ Annotated[StrictFloat, Field(gt=0)],
425
+ Tuple[
426
+ Annotated[StrictFloat, Field(gt=0)],
427
+ Annotated[StrictFloat, Field(gt=0)]
428
+ ]
429
+ ] = None,
430
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
431
+ _content_type: Optional[StrictStr] = None,
432
+ _headers: Optional[Dict[StrictStr, Any]] = None,
433
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
434
+ ) -> ApiResponse[List[FuturesBalance]]:
435
+ """Get Futures Balance
436
+
437
+
438
+ :param access_token:
439
+ :type access_token: str
440
+ :param _request_timeout: timeout setting for this request. If one
441
+ number provided, it will be total request
442
+ timeout. It can also be a pair (tuple) of
443
+ (connection, read) timeouts.
444
+ :type _request_timeout: int, tuple(int, int), optional
445
+ :param _request_auth: set to override the auth_settings for an a single
446
+ request; this effectively ignores the
447
+ authentication in the spec for a single request.
448
+ :type _request_auth: dict, optional
449
+ :param _content_type: force content-type for the request.
450
+ :type _content_type: str, Optional
451
+ :param _headers: set to override the headers for a single
452
+ request; this effectively ignores the headers
453
+ in the spec for a single request.
454
+ :type _headers: dict, optional
455
+ :param _host_index: set to override the host_index for a single
456
+ request; this effectively ignores the host_index
457
+ in the spec for a single request.
458
+ :type _host_index: int, optional
459
+ :return: Returns the result object.
460
+ """ # noqa: E501
461
+
462
+ _param = self._get_futures_balance_serialize(
463
+ access_token=access_token,
464
+ _request_auth=_request_auth,
465
+ _content_type=_content_type,
466
+ _headers=_headers,
467
+ _host_index=_host_index
468
+ )
469
+
470
+ _response_types_map: Dict[str, Optional[str]] = {
471
+ '200': "List[FuturesBalance]",
472
+ '422': "HTTPValidationError",
473
+ }
474
+ response_data = self.api_client.call_api(
475
+ *_param,
476
+ _request_timeout=_request_timeout
477
+ )
478
+ response_data.read()
479
+ return self.api_client.response_deserialize(
480
+ response_data=response_data,
481
+ response_types_map=_response_types_map,
482
+ )
483
+
484
+
485
+ @validate_call
486
+ def get_futures_balance_without_preload_content(
487
+ self,
488
+ access_token: Optional[StrictStr] = None,
489
+ _request_timeout: Union[
490
+ None,
491
+ Annotated[StrictFloat, Field(gt=0)],
492
+ Tuple[
493
+ Annotated[StrictFloat, Field(gt=0)],
494
+ Annotated[StrictFloat, Field(gt=0)]
495
+ ]
496
+ ] = None,
497
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
498
+ _content_type: Optional[StrictStr] = None,
499
+ _headers: Optional[Dict[StrictStr, Any]] = None,
500
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
501
+ ) -> RESTResponseType:
502
+ """Get Futures Balance
503
+
504
+
505
+ :param access_token:
506
+ :type access_token: str
507
+ :param _request_timeout: timeout setting for this request. If one
508
+ number provided, it will be total request
509
+ timeout. It can also be a pair (tuple) of
510
+ (connection, read) timeouts.
511
+ :type _request_timeout: int, tuple(int, int), optional
512
+ :param _request_auth: set to override the auth_settings for an a single
513
+ request; this effectively ignores the
514
+ authentication in the spec for a single request.
515
+ :type _request_auth: dict, optional
516
+ :param _content_type: force content-type for the request.
517
+ :type _content_type: str, Optional
518
+ :param _headers: set to override the headers for a single
519
+ request; this effectively ignores the headers
520
+ in the spec for a single request.
521
+ :type _headers: dict, optional
522
+ :param _host_index: set to override the host_index for a single
523
+ request; this effectively ignores the host_index
524
+ in the spec for a single request.
525
+ :type _host_index: int, optional
526
+ :return: Returns the result object.
527
+ """ # noqa: E501
528
+
529
+ _param = self._get_futures_balance_serialize(
530
+ access_token=access_token,
531
+ _request_auth=_request_auth,
532
+ _content_type=_content_type,
533
+ _headers=_headers,
534
+ _host_index=_host_index
535
+ )
536
+
537
+ _response_types_map: Dict[str, Optional[str]] = {
538
+ '200': "List[FuturesBalance]",
539
+ '422': "HTTPValidationError",
540
+ }
541
+ response_data = self.api_client.call_api(
542
+ *_param,
543
+ _request_timeout=_request_timeout
544
+ )
545
+ return response_data.response
546
+
547
+
548
+ def _get_futures_balance_serialize(
549
+ self,
550
+ access_token,
551
+ _request_auth,
552
+ _content_type,
553
+ _headers,
554
+ _host_index,
555
+ ) -> RequestSerialized:
556
+
557
+ _host = None
558
+
559
+ _collection_formats: Dict[str, str] = {
560
+ }
561
+
562
+ _path_params: Dict[str, str] = {}
563
+ _query_params: List[Tuple[str, str]] = []
564
+ _header_params: Dict[str, Optional[str]] = _headers or {}
565
+ _form_params: List[Tuple[str, str]] = []
566
+ _files: Dict[
567
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
568
+ ] = {}
569
+ _body_params: Optional[bytes] = None
570
+
571
+ # process the path parameters
572
+ # process the query parameters
573
+ # process the header parameters
574
+ # process the form parameters
575
+ # process the body parameter
576
+
577
+
578
+ # set the HTTP header `Accept`
579
+ if 'Accept' not in _header_params:
580
+ _header_params['Accept'] = self.api_client.select_header_accept(
581
+ [
582
+ 'application/json'
583
+ ]
584
+ )
585
+
586
+
587
+ # authentication setting
588
+ _auth_settings: List[str] = [
589
+ 'OAuth2PasswordBearer'
590
+ ]
591
+
592
+ return self.api_client.param_serialize(
593
+ method='GET',
594
+ resource_path='/futures/balance',
595
+ path_params=_path_params,
596
+ query_params=_query_params,
597
+ header_params=_header_params,
598
+ body=_body_params,
599
+ post_params=_form_params,
600
+ files=_files,
601
+ auth_settings=_auth_settings,
602
+ collection_formats=_collection_formats,
603
+ _host=_host,
604
+ _request_auth=_request_auth
605
+ )
606
+
607
+
608
+
609
+
610
+ @validate_call
611
+ def get_futures_ledger(
612
+ self,
613
+ key: StrictStr,
614
+ access_token: Optional[StrictStr] = None,
615
+ _request_timeout: Union[
616
+ None,
617
+ Annotated[StrictFloat, Field(gt=0)],
618
+ Tuple[
619
+ Annotated[StrictFloat, Field(gt=0)],
620
+ Annotated[StrictFloat, Field(gt=0)]
621
+ ]
622
+ ] = None,
623
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
624
+ _content_type: Optional[StrictStr] = None,
625
+ _headers: Optional[Dict[StrictStr, Any]] = None,
626
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
627
+ ) -> object:
628
+ """Get Futures Ledger
629
+
630
+
631
+ :param key: (required)
632
+ :type key: str
633
+ :param access_token:
634
+ :type access_token: str
635
+ :param _request_timeout: timeout setting for this request. If one
636
+ number provided, it will be total request
637
+ timeout. It can also be a pair (tuple) of
638
+ (connection, read) timeouts.
639
+ :type _request_timeout: int, tuple(int, int), optional
640
+ :param _request_auth: set to override the auth_settings for an a single
641
+ request; this effectively ignores the
642
+ authentication in the spec for a single request.
643
+ :type _request_auth: dict, optional
644
+ :param _content_type: force content-type for the request.
645
+ :type _content_type: str, Optional
646
+ :param _headers: set to override the headers for a single
647
+ request; this effectively ignores the headers
648
+ in the spec for a single request.
649
+ :type _headers: dict, optional
650
+ :param _host_index: set to override the host_index for a single
651
+ request; this effectively ignores the host_index
652
+ in the spec for a single request.
653
+ :type _host_index: int, optional
654
+ :return: Returns the result object.
655
+ """ # noqa: E501
656
+
657
+ _param = self._get_futures_ledger_serialize(
658
+ key=key,
659
+ access_token=access_token,
660
+ _request_auth=_request_auth,
661
+ _content_type=_content_type,
662
+ _headers=_headers,
663
+ _host_index=_host_index
664
+ )
665
+
666
+ _response_types_map: Dict[str, Optional[str]] = {
667
+ '200': "object",
668
+ '422': "HTTPValidationError",
669
+ }
670
+ response_data = self.api_client.call_api(
671
+ *_param,
672
+ _request_timeout=_request_timeout
673
+ )
674
+ response_data.read()
675
+ return self.api_client.response_deserialize(
676
+ response_data=response_data,
677
+ response_types_map=_response_types_map,
678
+ ).data
679
+
680
+
681
+ @validate_call
682
+ def get_futures_ledger_with_http_info(
683
+ self,
684
+ key: StrictStr,
685
+ access_token: Optional[StrictStr] = None,
686
+ _request_timeout: Union[
687
+ None,
688
+ Annotated[StrictFloat, Field(gt=0)],
689
+ Tuple[
690
+ Annotated[StrictFloat, Field(gt=0)],
691
+ Annotated[StrictFloat, Field(gt=0)]
692
+ ]
693
+ ] = None,
694
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
695
+ _content_type: Optional[StrictStr] = None,
696
+ _headers: Optional[Dict[StrictStr, Any]] = None,
697
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
698
+ ) -> ApiResponse[object]:
699
+ """Get Futures Ledger
700
+
701
+
702
+ :param key: (required)
703
+ :type key: str
704
+ :param access_token:
705
+ :type access_token: str
706
+ :param _request_timeout: timeout setting for this request. If one
707
+ number provided, it will be total request
708
+ timeout. It can also be a pair (tuple) of
709
+ (connection, read) timeouts.
710
+ :type _request_timeout: int, tuple(int, int), optional
711
+ :param _request_auth: set to override the auth_settings for an a single
712
+ request; this effectively ignores the
713
+ authentication in the spec for a single request.
714
+ :type _request_auth: dict, optional
715
+ :param _content_type: force content-type for the request.
716
+ :type _content_type: str, Optional
717
+ :param _headers: set to override the headers for a single
718
+ request; this effectively ignores the headers
719
+ in the spec for a single request.
720
+ :type _headers: dict, optional
721
+ :param _host_index: set to override the host_index for a single
722
+ request; this effectively ignores the host_index
723
+ in the spec for a single request.
724
+ :type _host_index: int, optional
725
+ :return: Returns the result object.
726
+ """ # noqa: E501
727
+
728
+ _param = self._get_futures_ledger_serialize(
729
+ key=key,
730
+ access_token=access_token,
731
+ _request_auth=_request_auth,
732
+ _content_type=_content_type,
733
+ _headers=_headers,
734
+ _host_index=_host_index
735
+ )
736
+
737
+ _response_types_map: Dict[str, Optional[str]] = {
738
+ '200': "object",
739
+ '422': "HTTPValidationError",
740
+ }
741
+ response_data = self.api_client.call_api(
742
+ *_param,
743
+ _request_timeout=_request_timeout
744
+ )
745
+ response_data.read()
746
+ return self.api_client.response_deserialize(
747
+ response_data=response_data,
748
+ response_types_map=_response_types_map,
749
+ )
750
+
751
+
752
+ @validate_call
753
+ def get_futures_ledger_without_preload_content(
754
+ self,
755
+ key: StrictStr,
756
+ access_token: Optional[StrictStr] = None,
757
+ _request_timeout: Union[
758
+ None,
759
+ Annotated[StrictFloat, Field(gt=0)],
760
+ Tuple[
761
+ Annotated[StrictFloat, Field(gt=0)],
762
+ Annotated[StrictFloat, Field(gt=0)]
763
+ ]
764
+ ] = None,
765
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
766
+ _content_type: Optional[StrictStr] = None,
767
+ _headers: Optional[Dict[StrictStr, Any]] = None,
768
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
769
+ ) -> RESTResponseType:
770
+ """Get Futures Ledger
771
+
772
+
773
+ :param key: (required)
774
+ :type key: str
775
+ :param access_token:
776
+ :type access_token: str
777
+ :param _request_timeout: timeout setting for this request. If one
778
+ number provided, it will be total request
779
+ timeout. It can also be a pair (tuple) of
780
+ (connection, read) timeouts.
781
+ :type _request_timeout: int, tuple(int, int), optional
782
+ :param _request_auth: set to override the auth_settings for an a single
783
+ request; this effectively ignores the
784
+ authentication in the spec for a single request.
785
+ :type _request_auth: dict, optional
786
+ :param _content_type: force content-type for the request.
787
+ :type _content_type: str, Optional
788
+ :param _headers: set to override the headers for a single
789
+ request; this effectively ignores the headers
790
+ in the spec for a single request.
791
+ :type _headers: dict, optional
792
+ :param _host_index: set to override the host_index for a single
793
+ request; this effectively ignores the host_index
794
+ in the spec for a single request.
795
+ :type _host_index: int, optional
796
+ :return: Returns the result object.
797
+ """ # noqa: E501
798
+
799
+ _param = self._get_futures_ledger_serialize(
800
+ key=key,
801
+ access_token=access_token,
802
+ _request_auth=_request_auth,
803
+ _content_type=_content_type,
804
+ _headers=_headers,
805
+ _host_index=_host_index
806
+ )
807
+
808
+ _response_types_map: Dict[str, Optional[str]] = {
809
+ '200': "object",
810
+ '422': "HTTPValidationError",
811
+ }
812
+ response_data = self.api_client.call_api(
813
+ *_param,
814
+ _request_timeout=_request_timeout
815
+ )
816
+ return response_data.response
817
+
818
+
819
+ def _get_futures_ledger_serialize(
820
+ self,
821
+ key,
822
+ access_token,
823
+ _request_auth,
824
+ _content_type,
825
+ _headers,
826
+ _host_index,
827
+ ) -> RequestSerialized:
828
+
829
+ _host = None
830
+
831
+ _collection_formats: Dict[str, str] = {
832
+ }
833
+
834
+ _path_params: Dict[str, str] = {}
835
+ _query_params: List[Tuple[str, str]] = []
836
+ _header_params: Dict[str, Optional[str]] = _headers or {}
837
+ _form_params: List[Tuple[str, str]] = []
838
+ _files: Dict[
839
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
840
+ ] = {}
841
+ _body_params: Optional[bytes] = None
842
+
843
+ # process the path parameters
844
+ # process the query parameters
845
+ if key is not None:
846
+
847
+ _query_params.append(('key', key))
848
+
849
+ # process the header parameters
850
+ # process the form parameters
851
+ # process the body parameter
852
+
853
+
854
+ # set the HTTP header `Accept`
855
+ if 'Accept' not in _header_params:
856
+ _header_params['Accept'] = self.api_client.select_header_accept(
857
+ [
858
+ 'application/json'
859
+ ]
860
+ )
861
+
862
+
863
+ # authentication setting
864
+ _auth_settings: List[str] = [
865
+ 'OAuth2PasswordBearer'
866
+ ]
867
+
868
+ return self.api_client.param_serialize(
869
+ method='GET',
870
+ resource_path='/futures/ledger',
871
+ path_params=_path_params,
872
+ query_params=_query_params,
873
+ header_params=_header_params,
874
+ body=_body_params,
875
+ post_params=_form_params,
876
+ files=_files,
877
+ auth_settings=_auth_settings,
878
+ collection_formats=_collection_formats,
879
+ _host=_host,
880
+ _request_auth=_request_auth
881
+ )
882
+
883
+
884
+
885
+
886
+ @validate_call
887
+ def get_historical_futures_orders(
888
+ self,
889
+ key: StrictStr,
890
+ access_token: Optional[StrictStr] = None,
891
+ _request_timeout: Union[
892
+ None,
893
+ Annotated[StrictFloat, Field(gt=0)],
894
+ Tuple[
895
+ Annotated[StrictFloat, Field(gt=0)],
896
+ Annotated[StrictFloat, Field(gt=0)]
897
+ ]
898
+ ] = None,
899
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
900
+ _content_type: Optional[StrictStr] = None,
901
+ _headers: Optional[Dict[StrictStr, Any]] = None,
902
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
903
+ ) -> object:
904
+ """Get Historical Futures Orders
905
+
906
+
907
+ :param key: (required)
908
+ :type key: str
909
+ :param access_token:
910
+ :type access_token: str
911
+ :param _request_timeout: timeout setting for this request. If one
912
+ number provided, it will be total request
913
+ timeout. It can also be a pair (tuple) of
914
+ (connection, read) timeouts.
915
+ :type _request_timeout: int, tuple(int, int), optional
916
+ :param _request_auth: set to override the auth_settings for an a single
917
+ request; this effectively ignores the
918
+ authentication in the spec for a single request.
919
+ :type _request_auth: dict, optional
920
+ :param _content_type: force content-type for the request.
921
+ :type _content_type: str, Optional
922
+ :param _headers: set to override the headers for a single
923
+ request; this effectively ignores the headers
924
+ in the spec for a single request.
925
+ :type _headers: dict, optional
926
+ :param _host_index: set to override the host_index for a single
927
+ request; this effectively ignores the host_index
928
+ in the spec for a single request.
929
+ :type _host_index: int, optional
930
+ :return: Returns the result object.
931
+ """ # noqa: E501
932
+
933
+ _param = self._get_historical_futures_orders_serialize(
934
+ key=key,
935
+ access_token=access_token,
936
+ _request_auth=_request_auth,
937
+ _content_type=_content_type,
938
+ _headers=_headers,
939
+ _host_index=_host_index
940
+ )
941
+
942
+ _response_types_map: Dict[str, Optional[str]] = {
943
+ '200': "object",
944
+ '422': "HTTPValidationError",
945
+ }
946
+ response_data = self.api_client.call_api(
947
+ *_param,
948
+ _request_timeout=_request_timeout
949
+ )
950
+ response_data.read()
951
+ return self.api_client.response_deserialize(
952
+ response_data=response_data,
953
+ response_types_map=_response_types_map,
954
+ ).data
955
+
956
+
957
+ @validate_call
958
+ def get_historical_futures_orders_with_http_info(
959
+ self,
960
+ key: StrictStr,
961
+ access_token: Optional[StrictStr] = None,
962
+ _request_timeout: Union[
963
+ None,
964
+ Annotated[StrictFloat, Field(gt=0)],
965
+ Tuple[
966
+ Annotated[StrictFloat, Field(gt=0)],
967
+ Annotated[StrictFloat, Field(gt=0)]
968
+ ]
969
+ ] = None,
970
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
971
+ _content_type: Optional[StrictStr] = None,
972
+ _headers: Optional[Dict[StrictStr, Any]] = None,
973
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
974
+ ) -> ApiResponse[object]:
975
+ """Get Historical Futures Orders
976
+
977
+
978
+ :param key: (required)
979
+ :type key: str
980
+ :param access_token:
981
+ :type access_token: str
982
+ :param _request_timeout: timeout setting for this request. If one
983
+ number provided, it will be total request
984
+ timeout. It can also be a pair (tuple) of
985
+ (connection, read) timeouts.
986
+ :type _request_timeout: int, tuple(int, int), optional
987
+ :param _request_auth: set to override the auth_settings for an a single
988
+ request; this effectively ignores the
989
+ authentication in the spec for a single request.
990
+ :type _request_auth: dict, optional
991
+ :param _content_type: force content-type for the request.
992
+ :type _content_type: str, Optional
993
+ :param _headers: set to override the headers for a single
994
+ request; this effectively ignores the headers
995
+ in the spec for a single request.
996
+ :type _headers: dict, optional
997
+ :param _host_index: set to override the host_index for a single
998
+ request; this effectively ignores the host_index
999
+ in the spec for a single request.
1000
+ :type _host_index: int, optional
1001
+ :return: Returns the result object.
1002
+ """ # noqa: E501
1003
+
1004
+ _param = self._get_historical_futures_orders_serialize(
1005
+ key=key,
1006
+ access_token=access_token,
1007
+ _request_auth=_request_auth,
1008
+ _content_type=_content_type,
1009
+ _headers=_headers,
1010
+ _host_index=_host_index
1011
+ )
1012
+
1013
+ _response_types_map: Dict[str, Optional[str]] = {
1014
+ '200': "object",
1015
+ '422': "HTTPValidationError",
1016
+ }
1017
+ response_data = self.api_client.call_api(
1018
+ *_param,
1019
+ _request_timeout=_request_timeout
1020
+ )
1021
+ response_data.read()
1022
+ return self.api_client.response_deserialize(
1023
+ response_data=response_data,
1024
+ response_types_map=_response_types_map,
1025
+ )
1026
+
1027
+
1028
+ @validate_call
1029
+ def get_historical_futures_orders_without_preload_content(
1030
+ self,
1031
+ key: StrictStr,
1032
+ access_token: Optional[StrictStr] = None,
1033
+ _request_timeout: Union[
1034
+ None,
1035
+ Annotated[StrictFloat, Field(gt=0)],
1036
+ Tuple[
1037
+ Annotated[StrictFloat, Field(gt=0)],
1038
+ Annotated[StrictFloat, Field(gt=0)]
1039
+ ]
1040
+ ] = None,
1041
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1042
+ _content_type: Optional[StrictStr] = None,
1043
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1044
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1045
+ ) -> RESTResponseType:
1046
+ """Get Historical Futures Orders
1047
+
1048
+
1049
+ :param key: (required)
1050
+ :type key: str
1051
+ :param access_token:
1052
+ :type access_token: str
1053
+ :param _request_timeout: timeout setting for this request. If one
1054
+ number provided, it will be total request
1055
+ timeout. It can also be a pair (tuple) of
1056
+ (connection, read) timeouts.
1057
+ :type _request_timeout: int, tuple(int, int), optional
1058
+ :param _request_auth: set to override the auth_settings for an a single
1059
+ request; this effectively ignores the
1060
+ authentication in the spec for a single request.
1061
+ :type _request_auth: dict, optional
1062
+ :param _content_type: force content-type for the request.
1063
+ :type _content_type: str, Optional
1064
+ :param _headers: set to override the headers for a single
1065
+ request; this effectively ignores the headers
1066
+ in the spec for a single request.
1067
+ :type _headers: dict, optional
1068
+ :param _host_index: set to override the host_index for a single
1069
+ request; this effectively ignores the host_index
1070
+ in the spec for a single request.
1071
+ :type _host_index: int, optional
1072
+ :return: Returns the result object.
1073
+ """ # noqa: E501
1074
+
1075
+ _param = self._get_historical_futures_orders_serialize(
1076
+ key=key,
1077
+ access_token=access_token,
1078
+ _request_auth=_request_auth,
1079
+ _content_type=_content_type,
1080
+ _headers=_headers,
1081
+ _host_index=_host_index
1082
+ )
1083
+
1084
+ _response_types_map: Dict[str, Optional[str]] = {
1085
+ '200': "object",
1086
+ '422': "HTTPValidationError",
1087
+ }
1088
+ response_data = self.api_client.call_api(
1089
+ *_param,
1090
+ _request_timeout=_request_timeout
1091
+ )
1092
+ return response_data.response
1093
+
1094
+
1095
+ def _get_historical_futures_orders_serialize(
1096
+ self,
1097
+ key,
1098
+ access_token,
1099
+ _request_auth,
1100
+ _content_type,
1101
+ _headers,
1102
+ _host_index,
1103
+ ) -> RequestSerialized:
1104
+
1105
+ _host = None
1106
+
1107
+ _collection_formats: Dict[str, str] = {
1108
+ }
1109
+
1110
+ _path_params: Dict[str, str] = {}
1111
+ _query_params: List[Tuple[str, str]] = []
1112
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1113
+ _form_params: List[Tuple[str, str]] = []
1114
+ _files: Dict[
1115
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1116
+ ] = {}
1117
+ _body_params: Optional[bytes] = None
1118
+
1119
+ # process the path parameters
1120
+ # process the query parameters
1121
+ if key is not None:
1122
+
1123
+ _query_params.append(('key', key))
1124
+
1125
+ # process the header parameters
1126
+ # process the form parameters
1127
+ # process the body parameter
1128
+
1129
+
1130
+ # set the HTTP header `Accept`
1131
+ if 'Accept' not in _header_params:
1132
+ _header_params['Accept'] = self.api_client.select_header_accept(
1133
+ [
1134
+ 'application/json'
1135
+ ]
1136
+ )
1137
+
1138
+
1139
+ # authentication setting
1140
+ _auth_settings: List[str] = [
1141
+ 'OAuth2PasswordBearer'
1142
+ ]
1143
+
1144
+ return self.api_client.param_serialize(
1145
+ method='GET',
1146
+ resource_path='/futures/orders',
1147
+ path_params=_path_params,
1148
+ query_params=_query_params,
1149
+ header_params=_header_params,
1150
+ body=_body_params,
1151
+ post_params=_form_params,
1152
+ files=_files,
1153
+ auth_settings=_auth_settings,
1154
+ collection_formats=_collection_formats,
1155
+ _host=_host,
1156
+ _request_auth=_request_auth
1157
+ )
1158
+
1159
+
1160
+
1161
+
1162
+ @validate_call
1163
+ def place_futures_order(
1164
+ self,
1165
+ key: StrictStr,
1166
+ body: Dict[str, Any],
1167
+ access_token: Optional[StrictStr] = None,
1168
+ _request_timeout: Union[
1169
+ None,
1170
+ Annotated[StrictFloat, Field(gt=0)],
1171
+ Tuple[
1172
+ Annotated[StrictFloat, Field(gt=0)],
1173
+ Annotated[StrictFloat, Field(gt=0)]
1174
+ ]
1175
+ ] = None,
1176
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1177
+ _content_type: Optional[StrictStr] = None,
1178
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1179
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1180
+ ) -> object:
1181
+ """Place Order
1182
+
1183
+
1184
+ :param key: (required)
1185
+ :type key: str
1186
+ :param body: (required)
1187
+ :type body: object
1188
+ :param access_token:
1189
+ :type access_token: str
1190
+ :param _request_timeout: timeout setting for this request. If one
1191
+ number provided, it will be total request
1192
+ timeout. It can also be a pair (tuple) of
1193
+ (connection, read) timeouts.
1194
+ :type _request_timeout: int, tuple(int, int), optional
1195
+ :param _request_auth: set to override the auth_settings for an a single
1196
+ request; this effectively ignores the
1197
+ authentication in the spec for a single request.
1198
+ :type _request_auth: dict, optional
1199
+ :param _content_type: force content-type for the request.
1200
+ :type _content_type: str, Optional
1201
+ :param _headers: set to override the headers for a single
1202
+ request; this effectively ignores the headers
1203
+ in the spec for a single request.
1204
+ :type _headers: dict, optional
1205
+ :param _host_index: set to override the host_index for a single
1206
+ request; this effectively ignores the host_index
1207
+ in the spec for a single request.
1208
+ :type _host_index: int, optional
1209
+ :return: Returns the result object.
1210
+ """ # noqa: E501
1211
+
1212
+ _param = self._place_futures_order_serialize(
1213
+ key=key,
1214
+ body=body,
1215
+ access_token=access_token,
1216
+ _request_auth=_request_auth,
1217
+ _content_type=_content_type,
1218
+ _headers=_headers,
1219
+ _host_index=_host_index
1220
+ )
1221
+
1222
+ _response_types_map: Dict[str, Optional[str]] = {
1223
+ '200': "object",
1224
+ '422': "HTTPValidationError",
1225
+ }
1226
+ response_data = self.api_client.call_api(
1227
+ *_param,
1228
+ _request_timeout=_request_timeout
1229
+ )
1230
+ response_data.read()
1231
+ return self.api_client.response_deserialize(
1232
+ response_data=response_data,
1233
+ response_types_map=_response_types_map,
1234
+ ).data
1235
+
1236
+
1237
+ @validate_call
1238
+ def place_futures_order_with_http_info(
1239
+ self,
1240
+ key: StrictStr,
1241
+ body: Dict[str, Any],
1242
+ access_token: Optional[StrictStr] = None,
1243
+ _request_timeout: Union[
1244
+ None,
1245
+ Annotated[StrictFloat, Field(gt=0)],
1246
+ Tuple[
1247
+ Annotated[StrictFloat, Field(gt=0)],
1248
+ Annotated[StrictFloat, Field(gt=0)]
1249
+ ]
1250
+ ] = None,
1251
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1252
+ _content_type: Optional[StrictStr] = None,
1253
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1254
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1255
+ ) -> ApiResponse[object]:
1256
+ """Place Order
1257
+
1258
+
1259
+ :param key: (required)
1260
+ :type key: str
1261
+ :param body: (required)
1262
+ :type body: object
1263
+ :param access_token:
1264
+ :type access_token: str
1265
+ :param _request_timeout: timeout setting for this request. If one
1266
+ number provided, it will be total request
1267
+ timeout. It can also be a pair (tuple) of
1268
+ (connection, read) timeouts.
1269
+ :type _request_timeout: int, tuple(int, int), optional
1270
+ :param _request_auth: set to override the auth_settings for an a single
1271
+ request; this effectively ignores the
1272
+ authentication in the spec for a single request.
1273
+ :type _request_auth: dict, optional
1274
+ :param _content_type: force content-type for the request.
1275
+ :type _content_type: str, Optional
1276
+ :param _headers: set to override the headers for a single
1277
+ request; this effectively ignores the headers
1278
+ in the spec for a single request.
1279
+ :type _headers: dict, optional
1280
+ :param _host_index: set to override the host_index for a single
1281
+ request; this effectively ignores the host_index
1282
+ in the spec for a single request.
1283
+ :type _host_index: int, optional
1284
+ :return: Returns the result object.
1285
+ """ # noqa: E501
1286
+
1287
+ _param = self._place_futures_order_serialize(
1288
+ key=key,
1289
+ body=body,
1290
+ access_token=access_token,
1291
+ _request_auth=_request_auth,
1292
+ _content_type=_content_type,
1293
+ _headers=_headers,
1294
+ _host_index=_host_index
1295
+ )
1296
+
1297
+ _response_types_map: Dict[str, Optional[str]] = {
1298
+ '200': "object",
1299
+ '422': "HTTPValidationError",
1300
+ }
1301
+ response_data = self.api_client.call_api(
1302
+ *_param,
1303
+ _request_timeout=_request_timeout
1304
+ )
1305
+ response_data.read()
1306
+ return self.api_client.response_deserialize(
1307
+ response_data=response_data,
1308
+ response_types_map=_response_types_map,
1309
+ )
1310
+
1311
+
1312
+ @validate_call
1313
+ def place_futures_order_without_preload_content(
1314
+ self,
1315
+ key: StrictStr,
1316
+ body: Dict[str, Any],
1317
+ access_token: Optional[StrictStr] = None,
1318
+ _request_timeout: Union[
1319
+ None,
1320
+ Annotated[StrictFloat, Field(gt=0)],
1321
+ Tuple[
1322
+ Annotated[StrictFloat, Field(gt=0)],
1323
+ Annotated[StrictFloat, Field(gt=0)]
1324
+ ]
1325
+ ] = None,
1326
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1327
+ _content_type: Optional[StrictStr] = None,
1328
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1329
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1330
+ ) -> RESTResponseType:
1331
+ """Place Order
1332
+
1333
+
1334
+ :param key: (required)
1335
+ :type key: str
1336
+ :param body: (required)
1337
+ :type body: object
1338
+ :param access_token:
1339
+ :type access_token: str
1340
+ :param _request_timeout: timeout setting for this request. If one
1341
+ number provided, it will be total request
1342
+ timeout. It can also be a pair (tuple) of
1343
+ (connection, read) timeouts.
1344
+ :type _request_timeout: int, tuple(int, int), optional
1345
+ :param _request_auth: set to override the auth_settings for an a single
1346
+ request; this effectively ignores the
1347
+ authentication in the spec for a single request.
1348
+ :type _request_auth: dict, optional
1349
+ :param _content_type: force content-type for the request.
1350
+ :type _content_type: str, Optional
1351
+ :param _headers: set to override the headers for a single
1352
+ request; this effectively ignores the headers
1353
+ in the spec for a single request.
1354
+ :type _headers: dict, optional
1355
+ :param _host_index: set to override the host_index for a single
1356
+ request; this effectively ignores the host_index
1357
+ in the spec for a single request.
1358
+ :type _host_index: int, optional
1359
+ :return: Returns the result object.
1360
+ """ # noqa: E501
1361
+
1362
+ _param = self._place_futures_order_serialize(
1363
+ key=key,
1364
+ body=body,
1365
+ access_token=access_token,
1366
+ _request_auth=_request_auth,
1367
+ _content_type=_content_type,
1368
+ _headers=_headers,
1369
+ _host_index=_host_index
1370
+ )
1371
+
1372
+ _response_types_map: Dict[str, Optional[str]] = {
1373
+ '200': "object",
1374
+ '422': "HTTPValidationError",
1375
+ }
1376
+ response_data = self.api_client.call_api(
1377
+ *_param,
1378
+ _request_timeout=_request_timeout
1379
+ )
1380
+ return response_data.response
1381
+
1382
+
1383
+ def _place_futures_order_serialize(
1384
+ self,
1385
+ key,
1386
+ body,
1387
+ access_token,
1388
+ _request_auth,
1389
+ _content_type,
1390
+ _headers,
1391
+ _host_index,
1392
+ ) -> RequestSerialized:
1393
+
1394
+ _host = None
1395
+
1396
+ _collection_formats: Dict[str, str] = {
1397
+ }
1398
+
1399
+ _path_params: Dict[str, str] = {}
1400
+ _query_params: List[Tuple[str, str]] = []
1401
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1402
+ _form_params: List[Tuple[str, str]] = []
1403
+ _files: Dict[
1404
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1405
+ ] = {}
1406
+ _body_params: Optional[bytes] = None
1407
+
1408
+ # process the path parameters
1409
+ # process the query parameters
1410
+ if key is not None:
1411
+
1412
+ _query_params.append(('key', key))
1413
+
1414
+ # process the header parameters
1415
+ # process the form parameters
1416
+ # process the body parameter
1417
+ if body is not None:
1418
+ _body_params = body
1419
+
1420
+
1421
+ # set the HTTP header `Accept`
1422
+ if 'Accept' not in _header_params:
1423
+ _header_params['Accept'] = self.api_client.select_header_accept(
1424
+ [
1425
+ 'application/json'
1426
+ ]
1427
+ )
1428
+
1429
+ # set the HTTP header `Content-Type`
1430
+ if _content_type:
1431
+ _header_params['Content-Type'] = _content_type
1432
+ else:
1433
+ _default_content_type = (
1434
+ self.api_client.select_header_content_type(
1435
+ [
1436
+ 'application/json'
1437
+ ]
1438
+ )
1439
+ )
1440
+ if _default_content_type is not None:
1441
+ _header_params['Content-Type'] = _default_content_type
1442
+
1443
+ # authentication setting
1444
+ _auth_settings: List[str] = [
1445
+ 'OAuth2PasswordBearer'
1446
+ ]
1447
+
1448
+ return self.api_client.param_serialize(
1449
+ method='POST',
1450
+ resource_path='/futures/orders',
1451
+ path_params=_path_params,
1452
+ query_params=_query_params,
1453
+ header_params=_header_params,
1454
+ body=_body_params,
1455
+ post_params=_form_params,
1456
+ files=_files,
1457
+ auth_settings=_auth_settings,
1458
+ collection_formats=_collection_formats,
1459
+ _host=_host,
1460
+ _request_auth=_request_auth
1461
+ )
1462
+
1463
+