crypticorn 2.17.0rc4__py3-none-any.whl → 2.17.0rc5__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.
- crypticorn/auth/client/api/admin_api.py +0 -2
- crypticorn/auth/client/api/auth_api.py +0 -4
- crypticorn/auth/client/api/service_api.py +0 -4
- crypticorn/auth/client/api/user_api.py +0 -4
- crypticorn/auth/client/api/wallet_api.py +0 -4
- crypticorn/auth/client/api_client.py +0 -5
- crypticorn/auth/client/models/add_wallet_request.py +1 -1
- crypticorn/auth/client/models/authorize_user_request.py +1 -1
- crypticorn/auth/client/models/create_api_key_request.py +1 -1
- crypticorn/auth/client/models/create_user_request.py +1 -1
- crypticorn/auth/client/models/get_api_keys200_response_inner.py +1 -1
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +1 -1
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +1 -1
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +1 -1
- crypticorn/auth/client/models/list_wallets200_response_data_inner.py +1 -1
- crypticorn/auth/client/models/logout_default_response.py +1 -1
- crypticorn/auth/client/models/oauth_callback200_response_user.py +1 -1
- crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +1 -1
- crypticorn/auth/client/models/rotate_tokens200_response.py +1 -1
- crypticorn/auth/client/models/token_info200_response.py +1 -1
- crypticorn/auth/client/models/update_user_request.py +1 -1
- crypticorn/auth/client/models/user_by_username200_response.py +1 -1
- crypticorn/auth/client/models/verify200_response.py +1 -1
- crypticorn/auth/client/models/verify_email200_response_auth.py +1 -1
- crypticorn/auth/client/models/verify_email200_response_auth_auth.py +1 -1
- crypticorn/auth/client/models/whoami200_response.py +1 -1
- crypticorn/cli/init.py +1 -1
- crypticorn/cli/templates/.env.docker.temp +3 -0
- crypticorn/cli/templates/.env.example.temp +4 -0
- crypticorn/client.py +0 -1
- crypticorn/common/auth.py +1 -4
- crypticorn/common/decorators.py +1 -2
- crypticorn/common/enums.py +0 -2
- crypticorn/common/metrics.py +1 -1
- crypticorn/common/middleware.py +0 -1
- crypticorn/common/pagination.py +116 -24
- crypticorn/common/utils.py +1 -2
- crypticorn/dex/__init__.py +6 -0
- crypticorn/dex/client/__init__.py +49 -0
- crypticorn/dex/client/api/__init__.py +6 -0
- crypticorn/dex/client/api/admin_api.py +3046 -0
- crypticorn/dex/client/api/signals_api.py +1821 -0
- crypticorn/dex/client/api/status_api.py +907 -0
- crypticorn/dex/client/api_client.py +753 -0
- crypticorn/dex/client/api_response.py +20 -0
- crypticorn/dex/client/configuration.py +620 -0
- crypticorn/dex/client/exceptions.py +220 -0
- crypticorn/dex/client/models/__init__.py +30 -0
- crypticorn/dex/client/models/api_error_identifier.py +121 -0
- crypticorn/dex/client/models/api_error_level.py +37 -0
- crypticorn/dex/client/models/api_error_type.py +37 -0
- crypticorn/dex/client/models/exception_detail.py +117 -0
- crypticorn/dex/client/models/log_level.py +38 -0
- crypticorn/dex/client/models/paginated_response_signal_with_token.py +134 -0
- crypticorn/dex/client/models/risk.py +86 -0
- crypticorn/dex/client/models/signal_overview_stats.py +156 -0
- crypticorn/dex/client/models/signal_volume.py +84 -0
- crypticorn/dex/client/models/signal_with_token.py +163 -0
- crypticorn/dex/client/models/token_data.py +127 -0
- crypticorn/dex/client/models/token_detail.py +116 -0
- crypticorn/dex/client/py.typed +0 -0
- crypticorn/dex/client/rest.py +217 -0
- crypticorn/dex/main.py +1 -0
- crypticorn/hive/client/api/admin_api.py +0 -3
- crypticorn/hive/client/api/data_api.py +0 -4
- crypticorn/hive/client/api/models_api.py +1 -4
- crypticorn/hive/client/api/status_api.py +0 -3
- crypticorn/hive/client/api_client.py +0 -5
- crypticorn/hive/client/models/coin_info.py +1 -1
- crypticorn/hive/client/models/exception_detail.py +1 -1
- crypticorn/hive/client/models/target_info.py +1 -1
- crypticorn/hive/utils.py +2 -2
- crypticorn/klines/client/api/admin_api.py +0 -3
- crypticorn/klines/client/api/change_in_timeframe_api.py +0 -4
- crypticorn/klines/client/api/funding_rates_api.py +0 -4
- crypticorn/klines/client/api/ohlcv_data_api.py +0 -4
- crypticorn/klines/client/api/status_api.py +0 -3
- crypticorn/klines/client/api/symbols_api.py +0 -4
- crypticorn/klines/client/api/udf_api.py +0 -2
- crypticorn/klines/client/api_client.py +0 -5
- crypticorn/klines/client/models/exception_detail.py +1 -1
- crypticorn/klines/client/models/ohlcv.py +1 -1
- crypticorn/klines/client/models/symbol_group.py +1 -1
- crypticorn/klines/client/models/udf_config.py +1 -1
- crypticorn/metrics/client/api/admin_api.py +0 -3
- crypticorn/metrics/client/api/exchanges_api.py +0 -4
- crypticorn/metrics/client/api/indicators_api.py +0 -4
- crypticorn/metrics/client/api/logs_api.py +0 -4
- crypticorn/metrics/client/api/marketcap_api.py +0 -4
- crypticorn/metrics/client/api/markets_api.py +0 -4
- crypticorn/metrics/client/api/quote_currencies_api.py +0 -4
- crypticorn/metrics/client/api/status_api.py +0 -3
- crypticorn/metrics/client/api/tokens_api.py +0 -2
- crypticorn/metrics/client/api_client.py +0 -5
- crypticorn/metrics/client/models/exception_detail.py +1 -1
- crypticorn/metrics/client/models/exchange_mapping.py +1 -1
- crypticorn/metrics/client/models/marketcap_ranking.py +1 -1
- crypticorn/metrics/client/models/marketcap_symbol_ranking.py +1 -1
- crypticorn/metrics/client/models/ohlcv.py +1 -1
- crypticorn/pay/client/api/admin_api.py +0 -3
- crypticorn/pay/client/api/now_payments_api.py +0 -4
- crypticorn/pay/client/api/payments_api.py +0 -4
- crypticorn/pay/client/api/products_api.py +0 -4
- crypticorn/pay/client/api/status_api.py +0 -3
- crypticorn/pay/client/api_client.py +0 -5
- crypticorn/pay/client/models/exception_detail.py +1 -1
- crypticorn/pay/client/models/now_create_invoice_req.py +1 -1
- crypticorn/pay/client/models/now_create_invoice_res.py +1 -1
- crypticorn/pay/client/models/product.py +1 -1
- crypticorn/pay/client/models/product_create.py +1 -1
- crypticorn/pay/client/models/product_update.py +1 -1
- crypticorn/trade/client/__init__.py +5 -0
- crypticorn/trade/client/api/admin_api.py +22 -23
- crypticorn/trade/client/api/bots_api.py +4712 -168
- crypticorn/trade/client/api/orders_api.py +220 -106
- crypticorn/trade/client/configuration.py +2 -2
- crypticorn/trade/client/models/__init__.py +5 -0
- crypticorn/trade/client/models/bot.py +7 -18
- crypticorn/trade/client/models/bot_create.py +17 -1
- crypticorn/trade/client/models/bot_update.py +17 -1
- crypticorn/trade/client/models/exchange_key_create.py +17 -1
- crypticorn/trade/client/models/exchange_key_update.py +17 -1
- crypticorn/trade/client/models/notification.py +17 -1
- crypticorn/trade/client/models/notification_create.py +17 -1
- crypticorn/trade/client/models/notification_update.py +17 -1
- crypticorn/trade/client/models/orders_count.py +88 -0
- crypticorn/trade/client/models/paginated_response_order.py +134 -0
- crypticorn/trade/client/models/pn_l.py +95 -0
- crypticorn/trade/client/models/strategy.py +17 -1
- crypticorn/trade/client/models/strategy_create.py +17 -1
- crypticorn/trade/client/models/strategy_update.py +17 -1
- {crypticorn-2.17.0rc4.dist-info → crypticorn-2.17.0rc5.dist-info}/METADATA +1 -1
- {crypticorn-2.17.0rc4.dist-info → crypticorn-2.17.0rc5.dist-info}/RECORD +137 -106
- {crypticorn-2.17.0rc4.dist-info → crypticorn-2.17.0rc5.dist-info}/WHEEL +0 -0
- {crypticorn-2.17.0rc4.dist-info → crypticorn-2.17.0rc5.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.17.0rc4.dist-info → crypticorn-2.17.0rc5.dist-info}/licenses/LICENSE +0 -0
- {crypticorn-2.17.0rc4.dist-info → crypticorn-2.17.0rc5.dist-info}/top_level.txt +0 -0
@@ -16,9 +16,10 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
16
16
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
17
17
|
from typing_extensions import Annotated
|
18
18
|
|
19
|
-
from pydantic import
|
19
|
+
from pydantic import Field, StrictStr, field_validator
|
20
20
|
from typing import List, Optional
|
21
|
-
from
|
21
|
+
from typing_extensions import Annotated
|
22
|
+
from crypticorn.trade.client.models.orders_count import OrdersCount
|
22
23
|
|
23
24
|
from crypticorn.trade.client.api_client import ApiClient, RequestSerialized
|
24
25
|
from crypticorn.trade.client.api_response import ApiResponse
|
@@ -57,10 +58,20 @@ class OrdersApi:
|
|
57
58
|
self.is_sync = is_sync
|
58
59
|
|
59
60
|
@validate_call
|
60
|
-
def
|
61
|
+
def get_orders_count(
|
61
62
|
self,
|
62
|
-
|
63
|
-
|
63
|
+
sort_order: Annotated[
|
64
|
+
Optional[StrictStr], Field(description="The order to sort by")
|
65
|
+
] = None,
|
66
|
+
sort_by: Annotated[
|
67
|
+
Optional[StrictStr], Field(description="The field to sort by")
|
68
|
+
] = None,
|
69
|
+
group_by: Annotated[
|
70
|
+
Optional[StrictStr],
|
71
|
+
Field(
|
72
|
+
description="The group by period for the orders count. Defaults to day."
|
73
|
+
),
|
74
|
+
] = None,
|
64
75
|
_request_timeout: Union[
|
65
76
|
None,
|
66
77
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -72,15 +83,16 @@ class OrdersApi:
|
|
72
83
|
_content_type: Optional[StrictStr] = None,
|
73
84
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
74
85
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
75
|
-
) -> List[
|
76
|
-
"""Get Orders
|
86
|
+
) -> List[OrdersCount]:
|
87
|
+
"""Get Orders Count
|
77
88
|
|
78
89
|
This method can work in both sync and async modes based on the is_sync flag.
|
79
90
|
"""
|
80
91
|
if self.is_sync:
|
81
|
-
return self.
|
82
|
-
|
83
|
-
|
92
|
+
return self._get_orders_count_sync(
|
93
|
+
sort_order=sort_order,
|
94
|
+
sort_by=sort_by,
|
95
|
+
group_by=group_by,
|
84
96
|
_request_timeout=_request_timeout,
|
85
97
|
_request_auth=_request_auth,
|
86
98
|
_content_type=_content_type,
|
@@ -89,9 +101,10 @@ class OrdersApi:
|
|
89
101
|
)
|
90
102
|
|
91
103
|
else:
|
92
|
-
return self.
|
93
|
-
|
94
|
-
|
104
|
+
return self._get_orders_count_async(
|
105
|
+
sort_order=sort_order,
|
106
|
+
sort_by=sort_by,
|
107
|
+
group_by=group_by,
|
95
108
|
_request_timeout=_request_timeout,
|
96
109
|
_request_auth=_request_auth,
|
97
110
|
_content_type=_content_type,
|
@@ -100,10 +113,20 @@ class OrdersApi:
|
|
100
113
|
)
|
101
114
|
|
102
115
|
@validate_call
|
103
|
-
def
|
116
|
+
def get_orders_count_with_http_info(
|
104
117
|
self,
|
105
|
-
|
106
|
-
|
118
|
+
sort_order: Annotated[
|
119
|
+
Optional[StrictStr], Field(description="The order to sort by")
|
120
|
+
] = None,
|
121
|
+
sort_by: Annotated[
|
122
|
+
Optional[StrictStr], Field(description="The field to sort by")
|
123
|
+
] = None,
|
124
|
+
group_by: Annotated[
|
125
|
+
Optional[StrictStr],
|
126
|
+
Field(
|
127
|
+
description="The group by period for the orders count. Defaults to day."
|
128
|
+
),
|
129
|
+
] = None,
|
107
130
|
_request_timeout: Union[
|
108
131
|
None,
|
109
132
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -115,15 +138,16 @@ class OrdersApi:
|
|
115
138
|
_content_type: Optional[StrictStr] = None,
|
116
139
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
117
140
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
118
|
-
) -> ApiResponse[List[
|
119
|
-
"""Get Orders with HTTP info
|
141
|
+
) -> ApiResponse[List[OrdersCount]]:
|
142
|
+
"""Get Orders Count with HTTP info
|
120
143
|
|
121
144
|
This method can work in both sync and async modes based on the is_sync flag.
|
122
145
|
"""
|
123
146
|
if self.is_sync:
|
124
|
-
return self.
|
125
|
-
|
126
|
-
|
147
|
+
return self._get_orders_count_sync_with_http_info(
|
148
|
+
sort_order=sort_order,
|
149
|
+
sort_by=sort_by,
|
150
|
+
group_by=group_by,
|
127
151
|
_request_timeout=_request_timeout,
|
128
152
|
_request_auth=_request_auth,
|
129
153
|
_content_type=_content_type,
|
@@ -132,9 +156,10 @@ class OrdersApi:
|
|
132
156
|
)
|
133
157
|
|
134
158
|
else:
|
135
|
-
return self.
|
136
|
-
|
137
|
-
|
159
|
+
return self._get_orders_count_async_with_http_info(
|
160
|
+
sort_order=sort_order,
|
161
|
+
sort_by=sort_by,
|
162
|
+
group_by=group_by,
|
138
163
|
_request_timeout=_request_timeout,
|
139
164
|
_request_auth=_request_auth,
|
140
165
|
_content_type=_content_type,
|
@@ -143,10 +168,20 @@ class OrdersApi:
|
|
143
168
|
)
|
144
169
|
|
145
170
|
@validate_call
|
146
|
-
def
|
171
|
+
def get_orders_count_without_preload_content(
|
147
172
|
self,
|
148
|
-
|
149
|
-
|
173
|
+
sort_order: Annotated[
|
174
|
+
Optional[StrictStr], Field(description="The order to sort by")
|
175
|
+
] = None,
|
176
|
+
sort_by: Annotated[
|
177
|
+
Optional[StrictStr], Field(description="The field to sort by")
|
178
|
+
] = None,
|
179
|
+
group_by: Annotated[
|
180
|
+
Optional[StrictStr],
|
181
|
+
Field(
|
182
|
+
description="The group by period for the orders count. Defaults to day."
|
183
|
+
),
|
184
|
+
] = None,
|
150
185
|
_request_timeout: Union[
|
151
186
|
None,
|
152
187
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -159,14 +194,15 @@ class OrdersApi:
|
|
159
194
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
160
195
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
161
196
|
) -> RESTResponseType:
|
162
|
-
"""Get Orders without preloading content
|
197
|
+
"""Get Orders Count without preloading content
|
163
198
|
|
164
199
|
This method can work in both sync and async modes based on the is_sync flag.
|
165
200
|
"""
|
166
201
|
if self.is_sync:
|
167
|
-
return self.
|
168
|
-
|
169
|
-
|
202
|
+
return self._get_orders_count_sync_without_preload_content(
|
203
|
+
sort_order=sort_order,
|
204
|
+
sort_by=sort_by,
|
205
|
+
group_by=group_by,
|
170
206
|
_request_timeout=_request_timeout,
|
171
207
|
_request_auth=_request_auth,
|
172
208
|
_content_type=_content_type,
|
@@ -175,9 +211,10 @@ class OrdersApi:
|
|
175
211
|
)
|
176
212
|
|
177
213
|
else:
|
178
|
-
return self.
|
179
|
-
|
180
|
-
|
214
|
+
return self._get_orders_count_async_without_preload_content(
|
215
|
+
sort_order=sort_order,
|
216
|
+
sort_by=sort_by,
|
217
|
+
group_by=group_by,
|
181
218
|
_request_timeout=_request_timeout,
|
182
219
|
_request_auth=_request_auth,
|
183
220
|
_content_type=_content_type,
|
@@ -187,10 +224,20 @@ class OrdersApi:
|
|
187
224
|
|
188
225
|
# Private async implementation methods
|
189
226
|
@validate_call
|
190
|
-
async def
|
227
|
+
async def _get_orders_count_async(
|
191
228
|
self,
|
192
|
-
|
193
|
-
|
229
|
+
sort_order: Annotated[
|
230
|
+
Optional[StrictStr], Field(description="The order to sort by")
|
231
|
+
] = None,
|
232
|
+
sort_by: Annotated[
|
233
|
+
Optional[StrictStr], Field(description="The field to sort by")
|
234
|
+
] = None,
|
235
|
+
group_by: Annotated[
|
236
|
+
Optional[StrictStr],
|
237
|
+
Field(
|
238
|
+
description="The group by period for the orders count. Defaults to day."
|
239
|
+
),
|
240
|
+
] = None,
|
194
241
|
_request_timeout: Union[
|
195
242
|
None,
|
196
243
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -202,15 +249,17 @@ class OrdersApi:
|
|
202
249
|
_content_type: Optional[StrictStr] = None,
|
203
250
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
204
251
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
205
|
-
) -> List[
|
206
|
-
"""Get Orders
|
252
|
+
) -> List[OrdersCount]:
|
253
|
+
"""Get Orders Count
|
207
254
|
|
208
|
-
Get
|
255
|
+
Get the number of orders for all users by day, week, month, or year. The default sort is `timestamp` and the default order is `asc`..
|
209
256
|
|
210
|
-
:param
|
211
|
-
:type
|
212
|
-
:param
|
213
|
-
:type
|
257
|
+
:param sort_order: The order to sort by
|
258
|
+
:type sort_order: str
|
259
|
+
:param sort_by: The field to sort by
|
260
|
+
:type sort_by: str
|
261
|
+
:param group_by: The group by period for the orders count. Defaults to day.
|
262
|
+
:type group_by: str
|
214
263
|
:param _request_timeout: timeout setting for this request. If one
|
215
264
|
number provided, it will be total request
|
216
265
|
timeout. It can also be a pair (tuple) of
|
@@ -233,9 +282,10 @@ class OrdersApi:
|
|
233
282
|
:return: Returns the result object.
|
234
283
|
""" # noqa: E501
|
235
284
|
|
236
|
-
_param = self.
|
237
|
-
|
238
|
-
|
285
|
+
_param = self._get_orders_count_serialize(
|
286
|
+
sort_order=sort_order,
|
287
|
+
sort_by=sort_by,
|
288
|
+
group_by=group_by,
|
239
289
|
_request_auth=_request_auth,
|
240
290
|
_content_type=_content_type,
|
241
291
|
_headers=_headers,
|
@@ -243,7 +293,7 @@ class OrdersApi:
|
|
243
293
|
)
|
244
294
|
|
245
295
|
_response_types_map: Dict[str, Optional[str]] = {
|
246
|
-
"200": "List[
|
296
|
+
"200": "List[OrdersCount]",
|
247
297
|
}
|
248
298
|
response_data = await self.api_client.call_api(
|
249
299
|
*_param, _request_timeout=_request_timeout
|
@@ -255,10 +305,20 @@ class OrdersApi:
|
|
255
305
|
).data
|
256
306
|
|
257
307
|
@validate_call
|
258
|
-
async def
|
308
|
+
async def _get_orders_count_async_with_http_info(
|
259
309
|
self,
|
260
|
-
|
261
|
-
|
310
|
+
sort_order: Annotated[
|
311
|
+
Optional[StrictStr], Field(description="The order to sort by")
|
312
|
+
] = None,
|
313
|
+
sort_by: Annotated[
|
314
|
+
Optional[StrictStr], Field(description="The field to sort by")
|
315
|
+
] = None,
|
316
|
+
group_by: Annotated[
|
317
|
+
Optional[StrictStr],
|
318
|
+
Field(
|
319
|
+
description="The group by period for the orders count. Defaults to day."
|
320
|
+
),
|
321
|
+
] = None,
|
262
322
|
_request_timeout: Union[
|
263
323
|
None,
|
264
324
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -270,15 +330,17 @@ class OrdersApi:
|
|
270
330
|
_content_type: Optional[StrictStr] = None,
|
271
331
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
272
332
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
273
|
-
) -> ApiResponse[List[
|
274
|
-
"""Get Orders
|
333
|
+
) -> ApiResponse[List[OrdersCount]]:
|
334
|
+
"""Get Orders Count
|
275
335
|
|
276
|
-
Get
|
336
|
+
Get the number of orders for all users by day, week, month, or year. The default sort is `timestamp` and the default order is `asc`..
|
277
337
|
|
278
|
-
:param
|
279
|
-
:type
|
280
|
-
:param
|
281
|
-
:type
|
338
|
+
:param sort_order: The order to sort by
|
339
|
+
:type sort_order: str
|
340
|
+
:param sort_by: The field to sort by
|
341
|
+
:type sort_by: str
|
342
|
+
:param group_by: The group by period for the orders count. Defaults to day.
|
343
|
+
:type group_by: str
|
282
344
|
:param _request_timeout: timeout setting for this request. If one
|
283
345
|
number provided, it will be total request
|
284
346
|
timeout. It can also be a pair (tuple) of
|
@@ -301,9 +363,10 @@ class OrdersApi:
|
|
301
363
|
:return: Returns the result object.
|
302
364
|
""" # noqa: E501
|
303
365
|
|
304
|
-
_param = self.
|
305
|
-
|
306
|
-
|
366
|
+
_param = self._get_orders_count_serialize(
|
367
|
+
sort_order=sort_order,
|
368
|
+
sort_by=sort_by,
|
369
|
+
group_by=group_by,
|
307
370
|
_request_auth=_request_auth,
|
308
371
|
_content_type=_content_type,
|
309
372
|
_headers=_headers,
|
@@ -311,7 +374,7 @@ class OrdersApi:
|
|
311
374
|
)
|
312
375
|
|
313
376
|
_response_types_map: Dict[str, Optional[str]] = {
|
314
|
-
"200": "List[
|
377
|
+
"200": "List[OrdersCount]",
|
315
378
|
}
|
316
379
|
response_data = await self.api_client.call_api(
|
317
380
|
*_param, _request_timeout=_request_timeout
|
@@ -322,10 +385,20 @@ class OrdersApi:
|
|
322
385
|
)
|
323
386
|
|
324
387
|
@validate_call
|
325
|
-
async def
|
388
|
+
async def _get_orders_count_async_without_preload_content(
|
326
389
|
self,
|
327
|
-
|
328
|
-
|
390
|
+
sort_order: Annotated[
|
391
|
+
Optional[StrictStr], Field(description="The order to sort by")
|
392
|
+
] = None,
|
393
|
+
sort_by: Annotated[
|
394
|
+
Optional[StrictStr], Field(description="The field to sort by")
|
395
|
+
] = None,
|
396
|
+
group_by: Annotated[
|
397
|
+
Optional[StrictStr],
|
398
|
+
Field(
|
399
|
+
description="The group by period for the orders count. Defaults to day."
|
400
|
+
),
|
401
|
+
] = None,
|
329
402
|
_request_timeout: Union[
|
330
403
|
None,
|
331
404
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -338,14 +411,16 @@ class OrdersApi:
|
|
338
411
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
339
412
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
340
413
|
) -> RESTResponseType:
|
341
|
-
"""Get Orders
|
414
|
+
"""Get Orders Count
|
342
415
|
|
343
|
-
Get
|
416
|
+
Get the number of orders for all users by day, week, month, or year. The default sort is `timestamp` and the default order is `asc`..
|
344
417
|
|
345
|
-
:param
|
346
|
-
:type
|
347
|
-
:param
|
348
|
-
:type
|
418
|
+
:param sort_order: The order to sort by
|
419
|
+
:type sort_order: str
|
420
|
+
:param sort_by: The field to sort by
|
421
|
+
:type sort_by: str
|
422
|
+
:param group_by: The group by period for the orders count. Defaults to day.
|
423
|
+
:type group_by: str
|
349
424
|
:param _request_timeout: timeout setting for this request. If one
|
350
425
|
number provided, it will be total request
|
351
426
|
timeout. It can also be a pair (tuple) of
|
@@ -368,9 +443,10 @@ class OrdersApi:
|
|
368
443
|
:return: Returns the result object.
|
369
444
|
""" # noqa: E501
|
370
445
|
|
371
|
-
_param = self.
|
372
|
-
|
373
|
-
|
446
|
+
_param = self._get_orders_count_serialize(
|
447
|
+
sort_order=sort_order,
|
448
|
+
sort_by=sort_by,
|
449
|
+
group_by=group_by,
|
374
450
|
_request_auth=_request_auth,
|
375
451
|
_content_type=_content_type,
|
376
452
|
_headers=_headers,
|
@@ -378,7 +454,7 @@ class OrdersApi:
|
|
378
454
|
)
|
379
455
|
|
380
456
|
_response_types_map: Dict[str, Optional[str]] = {
|
381
|
-
"200": "List[
|
457
|
+
"200": "List[OrdersCount]",
|
382
458
|
}
|
383
459
|
response_data = await self.api_client.call_api(
|
384
460
|
*_param, _request_timeout=_request_timeout
|
@@ -387,10 +463,20 @@ class OrdersApi:
|
|
387
463
|
|
388
464
|
# Private sync implementation methods
|
389
465
|
@validate_call
|
390
|
-
def
|
466
|
+
def _get_orders_count_sync(
|
391
467
|
self,
|
392
|
-
|
393
|
-
|
468
|
+
sort_order: Annotated[
|
469
|
+
Optional[StrictStr], Field(description="The order to sort by")
|
470
|
+
] = None,
|
471
|
+
sort_by: Annotated[
|
472
|
+
Optional[StrictStr], Field(description="The field to sort by")
|
473
|
+
] = None,
|
474
|
+
group_by: Annotated[
|
475
|
+
Optional[StrictStr],
|
476
|
+
Field(
|
477
|
+
description="The group by period for the orders count. Defaults to day."
|
478
|
+
),
|
479
|
+
] = None,
|
394
480
|
_request_timeout: Union[
|
395
481
|
None,
|
396
482
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -402,11 +488,12 @@ class OrdersApi:
|
|
402
488
|
_content_type: Optional[StrictStr] = None,
|
403
489
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
404
490
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
405
|
-
) -> List[
|
406
|
-
"""Synchronous version of
|
407
|
-
return async_to_sync(self.
|
408
|
-
|
409
|
-
|
491
|
+
) -> List[OrdersCount]:
|
492
|
+
"""Synchronous version of get_orders_count"""
|
493
|
+
return async_to_sync(self._get_orders_count_async)(
|
494
|
+
sort_order=sort_order,
|
495
|
+
sort_by=sort_by,
|
496
|
+
group_by=group_by,
|
410
497
|
_request_timeout=_request_timeout,
|
411
498
|
_request_auth=_request_auth,
|
412
499
|
_content_type=_content_type,
|
@@ -415,10 +502,20 @@ class OrdersApi:
|
|
415
502
|
)
|
416
503
|
|
417
504
|
@validate_call
|
418
|
-
def
|
505
|
+
def _get_orders_count_sync_with_http_info(
|
419
506
|
self,
|
420
|
-
|
421
|
-
|
507
|
+
sort_order: Annotated[
|
508
|
+
Optional[StrictStr], Field(description="The order to sort by")
|
509
|
+
] = None,
|
510
|
+
sort_by: Annotated[
|
511
|
+
Optional[StrictStr], Field(description="The field to sort by")
|
512
|
+
] = None,
|
513
|
+
group_by: Annotated[
|
514
|
+
Optional[StrictStr],
|
515
|
+
Field(
|
516
|
+
description="The group by period for the orders count. Defaults to day."
|
517
|
+
),
|
518
|
+
] = None,
|
422
519
|
_request_timeout: Union[
|
423
520
|
None,
|
424
521
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -430,11 +527,12 @@ class OrdersApi:
|
|
430
527
|
_content_type: Optional[StrictStr] = None,
|
431
528
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
432
529
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
433
|
-
) -> ApiResponse[List[
|
434
|
-
"""Synchronous version of
|
435
|
-
return async_to_sync(self.
|
436
|
-
|
437
|
-
|
530
|
+
) -> ApiResponse[List[OrdersCount]]:
|
531
|
+
"""Synchronous version of get_orders_count_with_http_info"""
|
532
|
+
return async_to_sync(self._get_orders_count_async_with_http_info)(
|
533
|
+
sort_order=sort_order,
|
534
|
+
sort_by=sort_by,
|
535
|
+
group_by=group_by,
|
438
536
|
_request_timeout=_request_timeout,
|
439
537
|
_request_auth=_request_auth,
|
440
538
|
_content_type=_content_type,
|
@@ -443,10 +541,20 @@ class OrdersApi:
|
|
443
541
|
)
|
444
542
|
|
445
543
|
@validate_call
|
446
|
-
def
|
544
|
+
def _get_orders_count_sync_without_preload_content(
|
447
545
|
self,
|
448
|
-
|
449
|
-
|
546
|
+
sort_order: Annotated[
|
547
|
+
Optional[StrictStr], Field(description="The order to sort by")
|
548
|
+
] = None,
|
549
|
+
sort_by: Annotated[
|
550
|
+
Optional[StrictStr], Field(description="The field to sort by")
|
551
|
+
] = None,
|
552
|
+
group_by: Annotated[
|
553
|
+
Optional[StrictStr],
|
554
|
+
Field(
|
555
|
+
description="The group by period for the orders count. Defaults to day."
|
556
|
+
),
|
557
|
+
] = None,
|
450
558
|
_request_timeout: Union[
|
451
559
|
None,
|
452
560
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -459,10 +567,11 @@ class OrdersApi:
|
|
459
567
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
460
568
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
461
569
|
) -> RESTResponseType:
|
462
|
-
"""Synchronous version of
|
463
|
-
return async_to_sync(self.
|
464
|
-
|
465
|
-
|
570
|
+
"""Synchronous version of get_orders_count_without_preload_content"""
|
571
|
+
return async_to_sync(self._get_orders_count_async_without_preload_content)(
|
572
|
+
sort_order=sort_order,
|
573
|
+
sort_by=sort_by,
|
574
|
+
group_by=group_by,
|
466
575
|
_request_timeout=_request_timeout,
|
467
576
|
_request_auth=_request_auth,
|
468
577
|
_content_type=_content_type,
|
@@ -470,10 +579,11 @@ class OrdersApi:
|
|
470
579
|
_host_index=_host_index,
|
471
580
|
)
|
472
581
|
|
473
|
-
def
|
582
|
+
def _get_orders_count_serialize(
|
474
583
|
self,
|
475
|
-
|
476
|
-
|
584
|
+
sort_order,
|
585
|
+
sort_by,
|
586
|
+
group_by,
|
477
587
|
_request_auth,
|
478
588
|
_content_type,
|
479
589
|
_headers,
|
@@ -495,13 +605,17 @@ class OrdersApi:
|
|
495
605
|
|
496
606
|
# process the path parameters
|
497
607
|
# process the query parameters
|
498
|
-
if
|
608
|
+
if sort_order is not None:
|
609
|
+
|
610
|
+
_query_params.append(("sort_order", sort_order))
|
611
|
+
|
612
|
+
if sort_by is not None:
|
499
613
|
|
500
|
-
_query_params.append(("
|
614
|
+
_query_params.append(("sort_by", sort_by))
|
501
615
|
|
502
|
-
if
|
616
|
+
if group_by is not None:
|
503
617
|
|
504
|
-
_query_params.append(("
|
618
|
+
_query_params.append(("group_by", group_by))
|
505
619
|
|
506
620
|
# process the header parameters
|
507
621
|
# process the form parameters
|
@@ -518,7 +632,7 @@ class OrdersApi:
|
|
518
632
|
|
519
633
|
return self.api_client.param_serialize(
|
520
634
|
method="GET",
|
521
|
-
resource_path="/orders",
|
635
|
+
resource_path="/orders/count",
|
522
636
|
path_params=_path_params,
|
523
637
|
query_params=_query_params,
|
524
638
|
header_params=_header_params,
|
@@ -215,7 +215,7 @@ class Configuration:
|
|
215
215
|
debug: Optional[bool] = None,
|
216
216
|
) -> None:
|
217
217
|
"""Constructor"""
|
218
|
-
self._base_path = "http://localhost/v1/trade" if host is None else host
|
218
|
+
self._base_path = "http://localhost:8000/v1/trade" if host is None else host
|
219
219
|
"""Default Base url
|
220
220
|
"""
|
221
221
|
self.server_index = 0 if server_index is None and host is None else server_index
|
@@ -557,7 +557,7 @@ class Configuration:
|
|
557
557
|
"""
|
558
558
|
return [
|
559
559
|
{
|
560
|
-
"url": "http://localhost/v1/trade",
|
560
|
+
"url": "http://localhost:8000/v1/trade",
|
561
561
|
"description": "No description provided",
|
562
562
|
}
|
563
563
|
]
|
@@ -41,6 +41,11 @@ from crypticorn.trade.client.models.notification_create import NotificationCreat
|
|
41
41
|
from crypticorn.trade.client.models.notification_update import NotificationUpdate
|
42
42
|
from crypticorn.trade.client.models.order import Order
|
43
43
|
from crypticorn.trade.client.models.order_status import OrderStatus
|
44
|
+
from crypticorn.trade.client.models.orders_count import OrdersCount
|
45
|
+
from crypticorn.trade.client.models.paginated_response_order import (
|
46
|
+
PaginatedResponseOrder,
|
47
|
+
)
|
48
|
+
from crypticorn.trade.client.models.pn_l import PnL
|
44
49
|
from crypticorn.trade.client.models.post_futures_action import PostFuturesAction
|
45
50
|
from crypticorn.trade.client.models.spot_balance import SpotBalance
|
46
51
|
from crypticorn.trade.client.models.spot_trading_action_create import (
|
@@ -18,8 +18,7 @@ import re # noqa: F401
|
|
18
18
|
import json
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from typing_extensions import Annotated
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
22
|
from crypticorn.trade.client.models.api_error_identifier import ApiErrorIdentifier
|
24
23
|
from crypticorn.trade.client.models.bot_status import BotStatus
|
25
24
|
from typing import Optional, Set
|
@@ -49,22 +48,12 @@ class Bot(BaseModel):
|
|
49
48
|
)
|
50
49
|
api_key_id: StrictStr = Field(description="UID for the API key")
|
51
50
|
status_code: Optional[ApiErrorIdentifier] = None
|
52
|
-
current_allocation: Optional[
|
53
|
-
|
54
|
-
Annotated[float, Field(strict=True, ge=0.0)],
|
55
|
-
Annotated[int, Field(strict=True, ge=0)],
|
56
|
-
]
|
57
|
-
] = Field(
|
58
|
-
default=0,
|
51
|
+
current_allocation: Optional[StrictStr] = Field(
|
52
|
+
default="0",
|
59
53
|
description="Initial allocation for the bot + accumulated PnL of the orders after the last allocation change",
|
60
54
|
)
|
61
|
-
current_exposure: Optional[
|
62
|
-
|
63
|
-
Annotated[float, Field(strict=True, ge=0.0)],
|
64
|
-
Annotated[int, Field(strict=True, ge=0)],
|
65
|
-
]
|
66
|
-
] = Field(
|
67
|
-
default=0,
|
55
|
+
current_exposure: Optional[StrictStr] = Field(
|
56
|
+
default="0",
|
68
57
|
description="Current exposure of the bot, aka. the sum of the absolute values of the open positions",
|
69
58
|
)
|
70
59
|
__properties: ClassVar[List[str]] = [
|
@@ -150,12 +139,12 @@ class Bot(BaseModel):
|
|
150
139
|
"current_allocation": (
|
151
140
|
obj.get("current_allocation")
|
152
141
|
if obj.get("current_allocation") is not None
|
153
|
-
else 0
|
142
|
+
else "0"
|
154
143
|
),
|
155
144
|
"current_exposure": (
|
156
145
|
obj.get("current_exposure")
|
157
146
|
if obj.get("current_exposure") is not None
|
158
|
-
else 0
|
147
|
+
else "0"
|
159
148
|
),
|
160
149
|
}
|
161
150
|
)
|