crypticorn 2.11.7__py3-none-any.whl → 2.11.9__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/common/errors.py +11 -0
- crypticorn/trade/client/api/notifications_api.py +15 -15
- crypticorn/trade/client/api/strategies_api.py +6 -6
- crypticorn/trade/client/api/trading_actions_api.py +9 -9
- crypticorn/trade/client/models/api_error_identifier.py +1 -0
- crypticorn/trade/client/models/order.py +30 -28
- crypticorn/trade/client/models/strategy.py +9 -0
- crypticorn/trade/client/models/strategy_create.py +10 -1
- {crypticorn-2.11.7.dist-info → crypticorn-2.11.9.dist-info}/METADATA +1 -1
- {crypticorn-2.11.7.dist-info → crypticorn-2.11.9.dist-info}/RECORD +14 -14
- {crypticorn-2.11.7.dist-info → crypticorn-2.11.9.dist-info}/WHEEL +0 -0
- {crypticorn-2.11.7.dist-info → crypticorn-2.11.9.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.11.7.dist-info → crypticorn-2.11.9.dist-info}/licenses/LICENSE +0 -0
- {crypticorn-2.11.7.dist-info → crypticorn-2.11.9.dist-info}/top_level.txt +0 -0
crypticorn/common/errors.py
CHANGED
@@ -74,6 +74,7 @@ class ApiErrorIdentifier(StrEnum):
|
|
74
74
|
OBJECT_ALREADY_EXISTS = "object_already_exists"
|
75
75
|
OBJECT_CREATED = "object_created"
|
76
76
|
OBJECT_DELETED = "object_deleted"
|
77
|
+
OBJECT_LOCKED = "object_locked"
|
77
78
|
OBJECT_NOT_FOUND = "object_not_found"
|
78
79
|
OBJECT_UPDATED = "object_updated"
|
79
80
|
ORDER_ALREADY_FILLED = "order_is_already_filled"
|
@@ -362,6 +363,11 @@ class ApiError(Enum, metaclass=ApiErrorFallback):
|
|
362
363
|
ApiErrorType.SERVER_ERROR,
|
363
364
|
ApiErrorLevel.INFO,
|
364
365
|
)
|
366
|
+
OBJECT_LOCKED = (
|
367
|
+
ApiErrorIdentifier.OBJECT_LOCKED,
|
368
|
+
ApiErrorType.NO_ERROR,
|
369
|
+
ApiErrorLevel.INFO,
|
370
|
+
)
|
365
371
|
OBJECT_NOT_FOUND = (
|
366
372
|
ApiErrorIdentifier.OBJECT_NOT_FOUND,
|
367
373
|
ApiErrorType.SERVER_ERROR,
|
@@ -842,6 +848,11 @@ class StatusCodeMapper:
|
|
842
848
|
status.HTTP_204_NO_CONTENT,
|
843
849
|
status.WS_1000_NORMAL_CLOSURE,
|
844
850
|
),
|
851
|
+
# Miscellaneous
|
852
|
+
ApiError.OBJECT_LOCKED: (
|
853
|
+
status.HTTP_423_LOCKED,
|
854
|
+
status.WS_1013_TRY_AGAIN_LATER,
|
855
|
+
),
|
845
856
|
}
|
846
857
|
|
847
858
|
@classmethod
|
@@ -544,7 +544,7 @@ class NotificationsApi:
|
|
544
544
|
_content_type: Optional[StrictStr] = None,
|
545
545
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
546
546
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
547
|
-
) ->
|
547
|
+
) -> None:
|
548
548
|
"""Delete Notifications
|
549
549
|
|
550
550
|
Delete all notifications for the authenticated user
|
@@ -579,7 +579,7 @@ class NotificationsApi:
|
|
579
579
|
)
|
580
580
|
|
581
581
|
_response_types_map: Dict[str, Optional[str]] = {
|
582
|
-
"
|
582
|
+
"204": None,
|
583
583
|
}
|
584
584
|
response_data = await self.api_client.call_api(
|
585
585
|
*_param, _request_timeout=_request_timeout
|
@@ -604,7 +604,7 @@ class NotificationsApi:
|
|
604
604
|
_content_type: Optional[StrictStr] = None,
|
605
605
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
606
606
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
607
|
-
) -> ApiResponse[
|
607
|
+
) -> ApiResponse[None]:
|
608
608
|
"""Delete Notifications
|
609
609
|
|
610
610
|
Delete all notifications for the authenticated user
|
@@ -639,7 +639,7 @@ class NotificationsApi:
|
|
639
639
|
)
|
640
640
|
|
641
641
|
_response_types_map: Dict[str, Optional[str]] = {
|
642
|
-
"
|
642
|
+
"204": None,
|
643
643
|
}
|
644
644
|
response_data = await self.api_client.call_api(
|
645
645
|
*_param, _request_timeout=_request_timeout
|
@@ -699,7 +699,7 @@ class NotificationsApi:
|
|
699
699
|
)
|
700
700
|
|
701
701
|
_response_types_map: Dict[str, Optional[str]] = {
|
702
|
-
"
|
702
|
+
"204": None,
|
703
703
|
}
|
704
704
|
response_data = await self.api_client.call_api(
|
705
705
|
*_param, _request_timeout=_request_timeout
|
@@ -1034,7 +1034,7 @@ class NotificationsApi:
|
|
1034
1034
|
_content_type: Optional[StrictStr] = None,
|
1035
1035
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1036
1036
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1037
|
-
) ->
|
1037
|
+
) -> None:
|
1038
1038
|
"""Update Notification
|
1039
1039
|
|
1040
1040
|
Update a notification's viewed status
|
@@ -1075,7 +1075,7 @@ class NotificationsApi:
|
|
1075
1075
|
)
|
1076
1076
|
|
1077
1077
|
_response_types_map: Dict[str, Optional[str]] = {
|
1078
|
-
"
|
1078
|
+
"204": None,
|
1079
1079
|
}
|
1080
1080
|
response_data = await self.api_client.call_api(
|
1081
1081
|
*_param, _request_timeout=_request_timeout
|
@@ -1102,7 +1102,7 @@ class NotificationsApi:
|
|
1102
1102
|
_content_type: Optional[StrictStr] = None,
|
1103
1103
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1104
1104
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1105
|
-
) -> ApiResponse[
|
1105
|
+
) -> ApiResponse[None]:
|
1106
1106
|
"""Update Notification
|
1107
1107
|
|
1108
1108
|
Update a notification's viewed status
|
@@ -1143,7 +1143,7 @@ class NotificationsApi:
|
|
1143
1143
|
)
|
1144
1144
|
|
1145
1145
|
_response_types_map: Dict[str, Optional[str]] = {
|
1146
|
-
"
|
1146
|
+
"204": None,
|
1147
1147
|
}
|
1148
1148
|
response_data = await self.api_client.call_api(
|
1149
1149
|
*_param, _request_timeout=_request_timeout
|
@@ -1211,7 +1211,7 @@ class NotificationsApi:
|
|
1211
1211
|
)
|
1212
1212
|
|
1213
1213
|
_response_types_map: Dict[str, Optional[str]] = {
|
1214
|
-
"
|
1214
|
+
"204": None,
|
1215
1215
|
}
|
1216
1216
|
response_data = await self.api_client.call_api(
|
1217
1217
|
*_param, _request_timeout=_request_timeout
|
@@ -1300,7 +1300,7 @@ class NotificationsApi:
|
|
1300
1300
|
_content_type: Optional[StrictStr] = None,
|
1301
1301
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1302
1302
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1303
|
-
) ->
|
1303
|
+
) -> None:
|
1304
1304
|
"""Update Notifications
|
1305
1305
|
|
1306
1306
|
Bulk update notifications
|
@@ -1338,7 +1338,7 @@ class NotificationsApi:
|
|
1338
1338
|
)
|
1339
1339
|
|
1340
1340
|
_response_types_map: Dict[str, Optional[str]] = {
|
1341
|
-
"
|
1341
|
+
"204": None,
|
1342
1342
|
}
|
1343
1343
|
response_data = await self.api_client.call_api(
|
1344
1344
|
*_param, _request_timeout=_request_timeout
|
@@ -1364,7 +1364,7 @@ class NotificationsApi:
|
|
1364
1364
|
_content_type: Optional[StrictStr] = None,
|
1365
1365
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1366
1366
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1367
|
-
) -> ApiResponse[
|
1367
|
+
) -> ApiResponse[None]:
|
1368
1368
|
"""Update Notifications
|
1369
1369
|
|
1370
1370
|
Bulk update notifications
|
@@ -1402,7 +1402,7 @@ class NotificationsApi:
|
|
1402
1402
|
)
|
1403
1403
|
|
1404
1404
|
_response_types_map: Dict[str, Optional[str]] = {
|
1405
|
-
"
|
1405
|
+
"204": None,
|
1406
1406
|
}
|
1407
1407
|
response_data = await self.api_client.call_api(
|
1408
1408
|
*_param, _request_timeout=_request_timeout
|
@@ -1466,7 +1466,7 @@ class NotificationsApi:
|
|
1466
1466
|
)
|
1467
1467
|
|
1468
1468
|
_response_types_map: Dict[str, Optional[str]] = {
|
1469
|
-
"
|
1469
|
+
"204": None,
|
1470
1470
|
}
|
1471
1471
|
response_data = await self.api_client.call_api(
|
1472
1472
|
*_param, _request_timeout=_request_timeout
|
@@ -17,7 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
17
|
from typing_extensions import Annotated
|
18
18
|
|
19
19
|
from pydantic import StrictInt, StrictStr
|
20
|
-
from typing import
|
20
|
+
from typing import List, Optional
|
21
21
|
from crypticorn.trade.client.models.strategy import Strategy
|
22
22
|
from crypticorn.trade.client.models.strategy_create import StrategyCreate
|
23
23
|
from crypticorn.trade.client.models.strategy_update import StrategyUpdate
|
@@ -561,7 +561,7 @@ class StrategiesApi:
|
|
561
561
|
_content_type: Optional[StrictStr] = None,
|
562
562
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
563
563
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
564
|
-
) ->
|
564
|
+
) -> None:
|
565
565
|
"""Kill Strategy
|
566
566
|
|
567
567
|
Kills a strategy by disabling it and deleting all bots associated with it.
|
@@ -599,7 +599,7 @@ class StrategiesApi:
|
|
599
599
|
)
|
600
600
|
|
601
601
|
_response_types_map: Dict[str, Optional[str]] = {
|
602
|
-
"
|
602
|
+
"204": None,
|
603
603
|
}
|
604
604
|
response_data = await self.api_client.call_api(
|
605
605
|
*_param, _request_timeout=_request_timeout
|
@@ -625,7 +625,7 @@ class StrategiesApi:
|
|
625
625
|
_content_type: Optional[StrictStr] = None,
|
626
626
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
627
627
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
628
|
-
) -> ApiResponse[
|
628
|
+
) -> ApiResponse[None]:
|
629
629
|
"""Kill Strategy
|
630
630
|
|
631
631
|
Kills a strategy by disabling it and deleting all bots associated with it.
|
@@ -663,7 +663,7 @@ class StrategiesApi:
|
|
663
663
|
)
|
664
664
|
|
665
665
|
_response_types_map: Dict[str, Optional[str]] = {
|
666
|
-
"
|
666
|
+
"204": None,
|
667
667
|
}
|
668
668
|
response_data = await self.api_client.call_api(
|
669
669
|
*_param, _request_timeout=_request_timeout
|
@@ -727,7 +727,7 @@ class StrategiesApi:
|
|
727
727
|
)
|
728
728
|
|
729
729
|
_response_types_map: Dict[str, Optional[str]] = {
|
730
|
-
"
|
730
|
+
"204": None,
|
731
731
|
}
|
732
732
|
response_data = await self.api_client.call_api(
|
733
733
|
*_param, _request_timeout=_request_timeout
|
@@ -320,7 +320,7 @@ class TradingActionsApi:
|
|
320
320
|
) -> PostFuturesAction:
|
321
321
|
"""Post Futures Action
|
322
322
|
|
323
|
-
Endpoint to receive futures trading actions
|
323
|
+
Endpoint to receive futures trading actions. The action is queued for processing and the response is returned immediately.
|
324
324
|
|
325
325
|
:param futures_trading_action_create: (required)
|
326
326
|
:type futures_trading_action_create: FuturesTradingActionCreate
|
@@ -355,7 +355,7 @@ class TradingActionsApi:
|
|
355
355
|
)
|
356
356
|
|
357
357
|
_response_types_map: Dict[str, Optional[str]] = {
|
358
|
-
"
|
358
|
+
"202": "PostFuturesAction",
|
359
359
|
}
|
360
360
|
response_data = await self.api_client.call_api(
|
361
361
|
*_param, _request_timeout=_request_timeout
|
@@ -384,7 +384,7 @@ class TradingActionsApi:
|
|
384
384
|
) -> ApiResponse[PostFuturesAction]:
|
385
385
|
"""Post Futures Action
|
386
386
|
|
387
|
-
Endpoint to receive futures trading actions
|
387
|
+
Endpoint to receive futures trading actions. The action is queued for processing and the response is returned immediately.
|
388
388
|
|
389
389
|
:param futures_trading_action_create: (required)
|
390
390
|
:type futures_trading_action_create: FuturesTradingActionCreate
|
@@ -419,7 +419,7 @@ class TradingActionsApi:
|
|
419
419
|
)
|
420
420
|
|
421
421
|
_response_types_map: Dict[str, Optional[str]] = {
|
422
|
-
"
|
422
|
+
"202": "PostFuturesAction",
|
423
423
|
}
|
424
424
|
response_data = await self.api_client.call_api(
|
425
425
|
*_param, _request_timeout=_request_timeout
|
@@ -448,7 +448,7 @@ class TradingActionsApi:
|
|
448
448
|
) -> RESTResponseType:
|
449
449
|
"""Post Futures Action
|
450
450
|
|
451
|
-
Endpoint to receive futures trading actions
|
451
|
+
Endpoint to receive futures trading actions. The action is queued for processing and the response is returned immediately.
|
452
452
|
|
453
453
|
:param futures_trading_action_create: (required)
|
454
454
|
:type futures_trading_action_create: FuturesTradingActionCreate
|
@@ -483,7 +483,7 @@ class TradingActionsApi:
|
|
483
483
|
)
|
484
484
|
|
485
485
|
_response_types_map: Dict[str, Optional[str]] = {
|
486
|
-
"
|
486
|
+
"202": "PostFuturesAction",
|
487
487
|
}
|
488
488
|
response_data = await self.api_client.call_api(
|
489
489
|
*_param, _request_timeout=_request_timeout
|
@@ -606,7 +606,7 @@ class TradingActionsApi:
|
|
606
606
|
)
|
607
607
|
|
608
608
|
_response_types_map: Dict[str, Optional[str]] = {
|
609
|
-
"
|
609
|
+
"202": "object",
|
610
610
|
}
|
611
611
|
response_data = await self.api_client.call_api(
|
612
612
|
*_param, _request_timeout=_request_timeout
|
@@ -669,7 +669,7 @@ class TradingActionsApi:
|
|
669
669
|
)
|
670
670
|
|
671
671
|
_response_types_map: Dict[str, Optional[str]] = {
|
672
|
-
"
|
672
|
+
"202": "object",
|
673
673
|
}
|
674
674
|
response_data = await self.api_client.call_api(
|
675
675
|
*_param, _request_timeout=_request_timeout
|
@@ -732,7 +732,7 @@ class TradingActionsApi:
|
|
732
732
|
)
|
733
733
|
|
734
734
|
_response_types_map: Dict[str, Optional[str]] = {
|
735
|
-
"
|
735
|
+
"202": "object",
|
736
736
|
}
|
737
737
|
response_data = await self.api_client.call_api(
|
738
738
|
*_param, _request_timeout=_request_timeout
|
@@ -80,6 +80,7 @@ class ApiErrorIdentifier(str, Enum):
|
|
80
80
|
OBJECT_ALREADY_EXISTS = "object_already_exists"
|
81
81
|
OBJECT_CREATED = "object_created"
|
82
82
|
OBJECT_DELETED = "object_deleted"
|
83
|
+
OBJECT_LOCKED = "object_locked"
|
83
84
|
OBJECT_NOT_FOUND = "object_not_found"
|
84
85
|
OBJECT_UPDATED = "object_updated"
|
85
86
|
ORDER_IS_ALREADY_FILLED = "order_is_already_filled"
|
@@ -19,6 +19,7 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
|
+
from typing_extensions import Annotated
|
22
23
|
from crypticorn.trade.client.models.api_error_identifier import ApiErrorIdentifier
|
23
24
|
from crypticorn.trade.client.models.exchange import Exchange
|
24
25
|
from crypticorn.trade.client.models.margin_mode import MarginMode
|
@@ -60,14 +61,31 @@ class Order(BaseModel):
|
|
60
61
|
margin_mode: Optional[MarginMode] = None
|
61
62
|
status_code: Optional[ApiErrorIdentifier] = None
|
62
63
|
status: Optional[OrderStatus] = None
|
63
|
-
filled_perc: Optional[
|
64
|
-
|
65
|
-
|
64
|
+
filled_perc: Optional[
|
65
|
+
Union[
|
66
|
+
Annotated[float, Field(le=1.0, strict=True, ge=0.0)],
|
67
|
+
Annotated[int, Field(le=1, strict=True, ge=0)],
|
68
|
+
]
|
69
|
+
] = Field(default=0, description="Percentage of the order filled")
|
70
|
+
filled_qty: Optional[
|
71
|
+
Union[
|
72
|
+
Annotated[float, Field(strict=True, ge=0.0)],
|
73
|
+
Annotated[int, Field(strict=True, ge=0)],
|
74
|
+
]
|
75
|
+
] = Field(
|
76
|
+
default=0,
|
77
|
+
description="Quantity filled. Needed for pnl calculation. In the symbol's base currency.",
|
78
|
+
)
|
79
|
+
fee: Optional[Union[StrictFloat, StrictInt]] = Field(
|
80
|
+
default=0, description="Fees for the order"
|
81
|
+
)
|
66
82
|
leverage: Optional[Union[StrictFloat, StrictInt]] = None
|
67
83
|
order_details: Optional[Any] = Field(
|
68
84
|
default=None, description="Exchange specific details of the order"
|
69
85
|
)
|
70
|
-
pnl: Optional[Union[StrictFloat, StrictInt]] =
|
86
|
+
pnl: Optional[Union[StrictFloat, StrictInt]] = Field(
|
87
|
+
default=0, description="Profit and loss for the order"
|
88
|
+
)
|
71
89
|
order_time: Optional[StrictInt] = None
|
72
90
|
__properties: ClassVar[List[str]] = [
|
73
91
|
"id",
|
@@ -230,21 +248,6 @@ class Order(BaseModel):
|
|
230
248
|
if self.status is None and "status" in self.model_fields_set:
|
231
249
|
_dict["status"] = None
|
232
250
|
|
233
|
-
# set to None if filled_perc (nullable) is None
|
234
|
-
# and model_fields_set contains the field
|
235
|
-
if self.filled_perc is None and "filled_perc" in self.model_fields_set:
|
236
|
-
_dict["filled_perc"] = None
|
237
|
-
|
238
|
-
# set to None if filled_qty (nullable) is None
|
239
|
-
# and model_fields_set contains the field
|
240
|
-
if self.filled_qty is None and "filled_qty" in self.model_fields_set:
|
241
|
-
_dict["filled_qty"] = None
|
242
|
-
|
243
|
-
# set to None if fee (nullable) is None
|
244
|
-
# and model_fields_set contains the field
|
245
|
-
if self.fee is None and "fee" in self.model_fields_set:
|
246
|
-
_dict["fee"] = None
|
247
|
-
|
248
251
|
# set to None if leverage (nullable) is None
|
249
252
|
# and model_fields_set contains the field
|
250
253
|
if self.leverage is None and "leverage" in self.model_fields_set:
|
@@ -255,11 +258,6 @@ class Order(BaseModel):
|
|
255
258
|
if self.order_details is None and "order_details" in self.model_fields_set:
|
256
259
|
_dict["order_details"] = None
|
257
260
|
|
258
|
-
# set to None if pnl (nullable) is None
|
259
|
-
# and model_fields_set contains the field
|
260
|
-
if self.pnl is None and "pnl" in self.model_fields_set:
|
261
|
-
_dict["pnl"] = None
|
262
|
-
|
263
261
|
# set to None if order_time (nullable) is None
|
264
262
|
# and model_fields_set contains the field
|
265
263
|
if self.order_time is None and "order_time" in self.model_fields_set:
|
@@ -298,16 +296,20 @@ class Order(BaseModel):
|
|
298
296
|
"margin_mode": obj.get("margin_mode"),
|
299
297
|
"status_code": obj.get("status_code"),
|
300
298
|
"status": obj.get("status"),
|
301
|
-
"filled_perc":
|
302
|
-
|
303
|
-
|
299
|
+
"filled_perc": (
|
300
|
+
obj.get("filled_perc") if obj.get("filled_perc") is not None else 0
|
301
|
+
),
|
302
|
+
"filled_qty": (
|
303
|
+
obj.get("filled_qty") if obj.get("filled_qty") is not None else 0
|
304
|
+
),
|
305
|
+
"fee": obj.get("fee") if obj.get("fee") is not None else 0,
|
304
306
|
"leverage": obj.get("leverage"),
|
305
307
|
"order_details": (
|
306
308
|
AnyOf.from_dict(obj["order_details"])
|
307
309
|
if obj.get("order_details") is not None
|
308
310
|
else None
|
309
311
|
),
|
310
|
-
"pnl": obj.get("pnl"),
|
312
|
+
"pnl": obj.get("pnl") if obj.get("pnl") is not None else 0,
|
311
313
|
"order_time": obj.get("order_time"),
|
312
314
|
}
|
313
315
|
)
|
@@ -20,6 +20,7 @@ import json
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
22
|
from typing_extensions import Annotated
|
23
|
+
from crypticorn.trade.client.models.margin_mode import MarginMode
|
23
24
|
from crypticorn.trade.client.models.market_type import MarketType
|
24
25
|
from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchangeInfo
|
25
26
|
from typing import Optional, Set
|
@@ -55,6 +56,7 @@ class Strategy(BaseModel):
|
|
55
56
|
identifier: StrictStr = Field(
|
56
57
|
description="Unique human readable identifier for the strategy e.g. 'daily_trend_momentum'"
|
57
58
|
)
|
59
|
+
margin_mode: Optional[MarginMode] = None
|
58
60
|
leverage: StrictInt = Field(description="Leverage for the strategy")
|
59
61
|
market_type: MarketType = Field(description="Market of operation of the strategy")
|
60
62
|
__properties: ClassVar[List[str]] = [
|
@@ -67,6 +69,7 @@ class Strategy(BaseModel):
|
|
67
69
|
"enabled",
|
68
70
|
"performance_fee",
|
69
71
|
"identifier",
|
72
|
+
"margin_mode",
|
70
73
|
"leverage",
|
71
74
|
"market_type",
|
72
75
|
]
|
@@ -115,6 +118,11 @@ class Strategy(BaseModel):
|
|
115
118
|
if _item_exchanges:
|
116
119
|
_items.append(_item_exchanges.to_dict())
|
117
120
|
_dict["exchanges"] = _items
|
121
|
+
# set to None if margin_mode (nullable) is None
|
122
|
+
# and model_fields_set contains the field
|
123
|
+
if self.margin_mode is None and "margin_mode" in self.model_fields_set:
|
124
|
+
_dict["margin_mode"] = None
|
125
|
+
|
118
126
|
return _dict
|
119
127
|
|
120
128
|
@classmethod
|
@@ -144,6 +152,7 @@ class Strategy(BaseModel):
|
|
144
152
|
"enabled": obj.get("enabled"),
|
145
153
|
"performance_fee": obj.get("performance_fee"),
|
146
154
|
"identifier": obj.get("identifier"),
|
155
|
+
"margin_mode": obj.get("margin_mode"),
|
147
156
|
"leverage": obj.get("leverage"),
|
148
157
|
"market_type": obj.get("market_type"),
|
149
158
|
}
|
@@ -18,8 +18,9 @@ import re # noqa: F401
|
|
18
18
|
import json
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
21
|
-
from typing import Any, ClassVar, Dict, List, Union
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
22
|
from typing_extensions import Annotated
|
23
|
+
from crypticorn.trade.client.models.margin_mode import MarginMode
|
23
24
|
from crypticorn.trade.client.models.market_type import MarketType
|
24
25
|
from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchangeInfo
|
25
26
|
from typing import Optional, Set
|
@@ -46,6 +47,7 @@ class StrategyCreate(BaseModel):
|
|
46
47
|
identifier: StrictStr = Field(
|
47
48
|
description="Unique human readable identifier for the strategy e.g. 'daily_trend_momentum'"
|
48
49
|
)
|
50
|
+
margin_mode: Optional[MarginMode] = None
|
49
51
|
leverage: StrictInt = Field(description="Leverage for the strategy")
|
50
52
|
market_type: MarketType = Field(description="Market of operation of the strategy")
|
51
53
|
__properties: ClassVar[List[str]] = [
|
@@ -55,6 +57,7 @@ class StrategyCreate(BaseModel):
|
|
55
57
|
"enabled",
|
56
58
|
"performance_fee",
|
57
59
|
"identifier",
|
60
|
+
"margin_mode",
|
58
61
|
"leverage",
|
59
62
|
"market_type",
|
60
63
|
]
|
@@ -103,6 +106,11 @@ class StrategyCreate(BaseModel):
|
|
103
106
|
if _item_exchanges:
|
104
107
|
_items.append(_item_exchanges.to_dict())
|
105
108
|
_dict["exchanges"] = _items
|
109
|
+
# set to None if margin_mode (nullable) is None
|
110
|
+
# and model_fields_set contains the field
|
111
|
+
if self.margin_mode is None and "margin_mode" in self.model_fields_set:
|
112
|
+
_dict["margin_mode"] = None
|
113
|
+
|
106
114
|
return _dict
|
107
115
|
|
108
116
|
@classmethod
|
@@ -129,6 +137,7 @@ class StrategyCreate(BaseModel):
|
|
129
137
|
"enabled": obj.get("enabled"),
|
130
138
|
"performance_fee": obj.get("performance_fee"),
|
131
139
|
"identifier": obj.get("identifier"),
|
140
|
+
"margin_mode": obj.get("margin_mode"),
|
132
141
|
"leverage": obj.get("leverage"),
|
133
142
|
"market_type": obj.get("market_type"),
|
134
143
|
}
|
@@ -70,7 +70,7 @@ crypticorn/common/ansi_colors.py,sha256=-tMlUTE8NI7TPv7uj0kGRe-SI2hGaUNPKBFI_dfi
|
|
70
70
|
crypticorn/common/auth.py,sha256=HxiAEej315qQGbX0p8WmQI50blUTOWsMWpCtguMx-A4,8786
|
71
71
|
crypticorn/common/decorators.py,sha256=t5Y3vSJ-gt0n2vOYYjYN0dtzNXvZxrJs2SEItpzG8oo,1127
|
72
72
|
crypticorn/common/enums.py,sha256=YE7ObydyWAKO8MOSQBwk9M1PzzaPvlnxc6Dbpu78QMk,787
|
73
|
-
crypticorn/common/errors.py,sha256=
|
73
|
+
crypticorn/common/errors.py,sha256=6GykQkXoIWOvRA9EP5J-qNWUFFLxYnUwcjseX5SY4EA,28721
|
74
74
|
crypticorn/common/exceptions.py,sha256=31WcS1OEcGBAMc3FnPrtb6jFbh6Ni1v9Kciz7Av4y84,6098
|
75
75
|
crypticorn/common/logging.py,sha256=3ZTFB9j8Mqy_AlNYABUFQ_134OH0YtophJkP4_GDJ9w,4408
|
76
76
|
crypticorn/common/middleware.py,sha256=O7XiXPimNYUhF9QTv6yFUTVlb91-SK-3CfTrWMNP6Ck,1011
|
@@ -237,13 +237,13 @@ crypticorn/trade/client/api/api_keys_api.py,sha256=qfauZXQySnqnah6mvZmTk5xLGk9Ax
|
|
237
237
|
crypticorn/trade/client/api/bots_api.py,sha256=Ub6SVM6PgA0exB4eGVtipvm19epKNtIpxiepdCjztLU,50859
|
238
238
|
crypticorn/trade/client/api/exchanges_api.py,sha256=PVTRapNFD-tOVJmSaC_X_8NbWMxM97YDB77IljKdCkw,29007
|
239
239
|
crypticorn/trade/client/api/futures_trading_panel_api.py,sha256=L4wVotLLu4p-44nEInIgM79I40xeObmn3hN1zYPiNWM,50071
|
240
|
-
crypticorn/trade/client/api/notifications_api.py,sha256
|
240
|
+
crypticorn/trade/client/api/notifications_api.py,sha256=-_b61sYBL7jBkSnBqhN8feDzUA3K8KLZOiLPV6Wae24,61426
|
241
241
|
crypticorn/trade/client/api/orders_api.py,sha256=AtDyddOSCp7Y974F45niIaql9w70KVi-7kTV7ZZEOM8,11065
|
242
242
|
crypticorn/trade/client/api/status_api.py,sha256=YtSZh7xuOl_vq9xfPqdnfuOEA9EpftOqCR7H7yWVAcI,19671
|
243
|
-
crypticorn/trade/client/api/strategies_api.py,sha256=
|
244
|
-
crypticorn/trade/client/api/trading_actions_api.py,sha256=
|
243
|
+
crypticorn/trade/client/api/strategies_api.py,sha256=bUzv2DNBlYJsjABI-Jsrg_Sgx7-Vwzv4GLFsKXfEd-M,41707
|
244
|
+
crypticorn/trade/client/api/trading_actions_api.py,sha256=PBl1hSkkP9yRSRbr7jpUzgH4VEFOW7fHaNYYvD37fp8,32634
|
245
245
|
crypticorn/trade/client/models/__init__.py,sha256=T3rP5b5DS5tiW-cgTQuHMQ8L_-OrrTR8vnB8cwON4io,2723
|
246
|
-
crypticorn/trade/client/models/api_error_identifier.py,sha256=
|
246
|
+
crypticorn/trade/client/models/api_error_identifier.py,sha256=2bN3TUHA4aAyFOvewUM3-EKzBAXqWe9UEQc5YbIuK_M,5086
|
247
247
|
crypticorn/trade/client/models/api_error_level.py,sha256=8Sau6q3K29fg-EIGnex0yrw7gXJZLmyGTicYIXcehmY,816
|
248
248
|
crypticorn/trade/client/models/api_error_type.py,sha256=34NBgCP296pQx8doVpeqlhopPfBfRH1I-135YVtN19Y,855
|
249
249
|
crypticorn/trade/client/models/bot.py,sha256=UhpD-sRc4AZvnqqlVBfY9_P4zCCN2qL2jPocH1jYpYU,5513
|
@@ -265,19 +265,19 @@ crypticorn/trade/client/models/market_type.py,sha256=OkEE5lAPw2FAudw_98BLcyglEXQ
|
|
265
265
|
crypticorn/trade/client/models/notification.py,sha256=Xl3hsWJP24-hJv-3QAZFyN_BBI9PNyp73Y_wqcmUyYs,4416
|
266
266
|
crypticorn/trade/client/models/notification_create.py,sha256=iXkqvDhFYGoKW4yCWkJP7_5q-DPpJpE0FqWKqK21CE8,3749
|
267
267
|
crypticorn/trade/client/models/notification_update.py,sha256=a1tpTjKWA2kOqBJxxeyheMdIOZ_2NtAYu9X7R5h1M3c,3034
|
268
|
-
crypticorn/trade/client/models/order.py,sha256=
|
268
|
+
crypticorn/trade/client/models/order.py,sha256=f82QyKRMteuO7bTcTJj9BT1fh9j9diO7e3UARU6eKXM,12252
|
269
269
|
crypticorn/trade/client/models/order_status.py,sha256=dQkbXtPSW4bVGQOVL0M9-Q_fMpAUa4v3uwuuUwXNcnY,852
|
270
270
|
crypticorn/trade/client/models/post_futures_action.py,sha256=KBI3lPayQQNfQP8Attow9tkuo9zimJk19cKQQb9JK-w,3123
|
271
271
|
crypticorn/trade/client/models/spot_trading_action_create.py,sha256=NGtT-hpfhYYizIjGZQ0X67IxP9l99aiCjvxu1oDNnxA,7668
|
272
|
-
crypticorn/trade/client/models/strategy.py,sha256=
|
273
|
-
crypticorn/trade/client/models/strategy_create.py,sha256=
|
272
|
+
crypticorn/trade/client/models/strategy.py,sha256=cN2X-biPaBuEzG0qOZ4eu5mPIF7xzqYGwlNdvYl9Z8s,5797
|
273
|
+
crypticorn/trade/client/models/strategy_create.py,sha256=jtr1lUcafFzqYQKiuSXWEqfhLiT4WPj9yw63jtVW6kI,5285
|
274
274
|
crypticorn/trade/client/models/strategy_exchange_info.py,sha256=MhPqBXHNM-jM0JPYHuhzfTKTzEaaNBGMwK9FW2Kq_OI,2841
|
275
275
|
crypticorn/trade/client/models/strategy_update.py,sha256=f7UsKSlNardj5h6uqHYbacjWWQscXkFDqcLOoefa28M,5048
|
276
276
|
crypticorn/trade/client/models/tpsl.py,sha256=vUWMI9T69kCgiN0aQobiIkGFb3MYdMfkhPUjQuCLeYE,4405
|
277
277
|
crypticorn/trade/client/models/trading_action_type.py,sha256=BysUEOl85zs79EA2zOcDN1EExcpQdABaJ4Jz08_z8VU,857
|
278
|
-
crypticorn-2.11.
|
279
|
-
crypticorn-2.11.
|
280
|
-
crypticorn-2.11.
|
281
|
-
crypticorn-2.11.
|
282
|
-
crypticorn-2.11.
|
283
|
-
crypticorn-2.11.
|
278
|
+
crypticorn-2.11.9.dist-info/licenses/LICENSE,sha256=HonAVvzFXkP2C1d7D3ByIKPwjGH8NcHTAQvKH7uvOHQ,1856
|
279
|
+
crypticorn-2.11.9.dist-info/METADATA,sha256=VTjaoMrJ1GCsHKX2aFPlPowrls5x2slXIt61LFGZrIo,8640
|
280
|
+
crypticorn-2.11.9.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
281
|
+
crypticorn-2.11.9.dist-info/entry_points.txt,sha256=d_xHsGvUTebPveVUK0SrpDFQ5ZRSjlI7lNCc11sn2PM,59
|
282
|
+
crypticorn-2.11.9.dist-info/top_level.txt,sha256=EP3NY216qIBYfmvGl0L2Zc9ItP0DjGSkiYqd9xJwGcM,11
|
283
|
+
crypticorn-2.11.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|