crypticorn 2.1.3__py3-none-any.whl → 2.1.5__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 (32) hide show
  1. crypticorn/common/errors.py +215 -252
  2. crypticorn/common/sorter.py +38 -0
  3. crypticorn/pay/client/__init__.py +1 -0
  4. crypticorn/pay/client/api/now_payments_api.py +3 -16
  5. crypticorn/pay/client/api/payments_api.py +0 -42
  6. crypticorn/pay/client/api/products_api.py +3 -42
  7. crypticorn/pay/client/configuration.py +2 -1
  8. crypticorn/pay/client/models/__init__.py +1 -0
  9. crypticorn/pay/client/models/body_create_now_invoice.py +98 -0
  10. crypticorn/{trade/client/models/update_notification.py → pay/client/models/body_create_product.py} +20 -17
  11. crypticorn/pay/client/models/body_get_products.py +87 -0
  12. crypticorn/pay/client/models/body_handle_now_webhook.py +98 -0
  13. crypticorn/pay/client/models/body_update_product.py +98 -0
  14. crypticorn/pay/client/models/product_model.py +9 -0
  15. crypticorn/pay/client/models/scope.py +56 -0
  16. crypticorn/trade/client/api/api_keys_api.py +5 -70
  17. crypticorn/trade/client/api/bots_api.py +4 -56
  18. crypticorn/trade/client/api/exchanges_api.py +2 -19
  19. crypticorn/trade/client/api/futures_trading_panel_api.py +21 -89
  20. crypticorn/trade/client/api/notifications_api.py +6 -87
  21. crypticorn/trade/client/api/orders_api.py +2 -15
  22. crypticorn/trade/client/api/strategies_api.py +4 -56
  23. crypticorn/trade/client/api/trading_actions_api.py +1 -14
  24. crypticorn/trade/client/configuration.py +2 -1
  25. crypticorn/trade/client/models/api_error_identifier.py +49 -43
  26. crypticorn/trade/client/models/api_error_level.py +2 -2
  27. {crypticorn-2.1.3.dist-info → crypticorn-2.1.5.dist-info}/METADATA +3 -3
  28. {crypticorn-2.1.3.dist-info → crypticorn-2.1.5.dist-info}/RECORD +30 -26
  29. crypticorn/trade/client/models/notification_type.py +0 -37
  30. crypticorn/trade/client/models/strategy_model.py +0 -158
  31. {crypticorn-2.1.3.dist-info → crypticorn-2.1.5.dist-info}/WHEEL +0 -0
  32. {crypticorn-2.1.3.dist-info → crypticorn-2.1.5.dist-info}/top_level.txt +0 -0
@@ -42,7 +42,6 @@ class StrategiesApi:
42
42
  async def create_strategy(
43
43
  self,
44
44
  strategy_model_input: StrategyModelInput,
45
- access_token: Optional[StrictStr] = None,
46
45
  _request_timeout: Union[
47
46
  None,
48
47
  Annotated[StrictFloat, Field(gt=0)],
@@ -60,8 +59,6 @@ class StrategiesApi:
60
59
 
61
60
  :param strategy_model_input: (required)
62
61
  :type strategy_model_input: StrategyModelInput
63
- :param access_token:
64
- :type access_token: str
65
62
  :param _request_timeout: timeout setting for this request. If one
66
63
  number provided, it will be total request
67
64
  timeout. It can also be a pair (tuple) of
@@ -86,7 +83,6 @@ class StrategiesApi:
86
83
 
87
84
  _param = self._create_strategy_serialize(
88
85
  strategy_model_input=strategy_model_input,
89
- access_token=access_token,
90
86
  _request_auth=_request_auth,
91
87
  _content_type=_content_type,
92
88
  _headers=_headers,
@@ -110,7 +106,6 @@ class StrategiesApi:
110
106
  async def create_strategy_with_http_info(
111
107
  self,
112
108
  strategy_model_input: StrategyModelInput,
113
- access_token: Optional[StrictStr] = None,
114
109
  _request_timeout: Union[
115
110
  None,
116
111
  Annotated[StrictFloat, Field(gt=0)],
@@ -128,8 +123,6 @@ class StrategiesApi:
128
123
 
129
124
  :param strategy_model_input: (required)
130
125
  :type strategy_model_input: StrategyModelInput
131
- :param access_token:
132
- :type access_token: str
133
126
  :param _request_timeout: timeout setting for this request. If one
134
127
  number provided, it will be total request
135
128
  timeout. It can also be a pair (tuple) of
@@ -154,7 +147,6 @@ class StrategiesApi:
154
147
 
155
148
  _param = self._create_strategy_serialize(
156
149
  strategy_model_input=strategy_model_input,
157
- access_token=access_token,
158
150
  _request_auth=_request_auth,
159
151
  _content_type=_content_type,
160
152
  _headers=_headers,
@@ -178,7 +170,6 @@ class StrategiesApi:
178
170
  async def create_strategy_without_preload_content(
179
171
  self,
180
172
  strategy_model_input: StrategyModelInput,
181
- access_token: Optional[StrictStr] = None,
182
173
  _request_timeout: Union[
183
174
  None,
184
175
  Annotated[StrictFloat, Field(gt=0)],
@@ -196,8 +187,6 @@ class StrategiesApi:
196
187
 
197
188
  :param strategy_model_input: (required)
198
189
  :type strategy_model_input: StrategyModelInput
199
- :param access_token:
200
- :type access_token: str
201
190
  :param _request_timeout: timeout setting for this request. If one
202
191
  number provided, it will be total request
203
192
  timeout. It can also be a pair (tuple) of
@@ -222,7 +211,6 @@ class StrategiesApi:
222
211
 
223
212
  _param = self._create_strategy_serialize(
224
213
  strategy_model_input=strategy_model_input,
225
- access_token=access_token,
226
214
  _request_auth=_request_auth,
227
215
  _content_type=_content_type,
228
216
  _headers=_headers,
@@ -241,7 +229,6 @@ class StrategiesApi:
241
229
  def _create_strategy_serialize(
242
230
  self,
243
231
  strategy_model_input,
244
- access_token,
245
232
  _request_auth,
246
233
  _content_type,
247
234
  _headers,
@@ -286,7 +273,7 @@ class StrategiesApi:
286
273
  _header_params["Content-Type"] = _default_content_type
287
274
 
288
275
  # authentication setting
289
- _auth_settings: List[str] = ["HTTPBearer"]
276
+ _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
290
277
 
291
278
  return self.api_client.param_serialize(
292
279
  method="POST",
@@ -308,7 +295,6 @@ class StrategiesApi:
308
295
  self,
309
296
  limit: Optional[StrictInt] = None,
310
297
  offset: Optional[StrictInt] = None,
311
- access_token: Optional[StrictStr] = None,
312
298
  _request_timeout: Union[
313
299
  None,
314
300
  Annotated[StrictFloat, Field(gt=0)],
@@ -328,8 +314,6 @@ class StrategiesApi:
328
314
  :type limit: int
329
315
  :param offset:
330
316
  :type offset: int
331
- :param access_token:
332
- :type access_token: str
333
317
  :param _request_timeout: timeout setting for this request. If one
334
318
  number provided, it will be total request
335
319
  timeout. It can also be a pair (tuple) of
@@ -355,7 +339,6 @@ class StrategiesApi:
355
339
  _param = self._get_strategies_serialize(
356
340
  limit=limit,
357
341
  offset=offset,
358
- access_token=access_token,
359
342
  _request_auth=_request_auth,
360
343
  _content_type=_content_type,
361
344
  _headers=_headers,
@@ -380,7 +363,6 @@ class StrategiesApi:
380
363
  self,
381
364
  limit: Optional[StrictInt] = None,
382
365
  offset: Optional[StrictInt] = None,
383
- access_token: Optional[StrictStr] = None,
384
366
  _request_timeout: Union[
385
367
  None,
386
368
  Annotated[StrictFloat, Field(gt=0)],
@@ -400,8 +382,6 @@ class StrategiesApi:
400
382
  :type limit: int
401
383
  :param offset:
402
384
  :type offset: int
403
- :param access_token:
404
- :type access_token: str
405
385
  :param _request_timeout: timeout setting for this request. If one
406
386
  number provided, it will be total request
407
387
  timeout. It can also be a pair (tuple) of
@@ -427,7 +407,6 @@ class StrategiesApi:
427
407
  _param = self._get_strategies_serialize(
428
408
  limit=limit,
429
409
  offset=offset,
430
- access_token=access_token,
431
410
  _request_auth=_request_auth,
432
411
  _content_type=_content_type,
433
412
  _headers=_headers,
@@ -452,7 +431,6 @@ class StrategiesApi:
452
431
  self,
453
432
  limit: Optional[StrictInt] = None,
454
433
  offset: Optional[StrictInt] = None,
455
- access_token: Optional[StrictStr] = None,
456
434
  _request_timeout: Union[
457
435
  None,
458
436
  Annotated[StrictFloat, Field(gt=0)],
@@ -472,8 +450,6 @@ class StrategiesApi:
472
450
  :type limit: int
473
451
  :param offset:
474
452
  :type offset: int
475
- :param access_token:
476
- :type access_token: str
477
453
  :param _request_timeout: timeout setting for this request. If one
478
454
  number provided, it will be total request
479
455
  timeout. It can also be a pair (tuple) of
@@ -499,7 +475,6 @@ class StrategiesApi:
499
475
  _param = self._get_strategies_serialize(
500
476
  limit=limit,
501
477
  offset=offset,
502
- access_token=access_token,
503
478
  _request_auth=_request_auth,
504
479
  _content_type=_content_type,
505
480
  _headers=_headers,
@@ -519,7 +494,6 @@ class StrategiesApi:
519
494
  self,
520
495
  limit,
521
496
  offset,
522
- access_token,
523
497
  _request_auth,
524
498
  _content_type,
525
499
  _headers,
@@ -560,7 +534,7 @@ class StrategiesApi:
560
534
  )
561
535
 
562
536
  # authentication setting
563
- _auth_settings: List[str] = ["HTTPBearer"]
537
+ _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
564
538
 
565
539
  return self.api_client.param_serialize(
566
540
  method="GET",
@@ -581,7 +555,6 @@ class StrategiesApi:
581
555
  async def kill_strategy(
582
556
  self,
583
557
  id: StrictStr,
584
- access_token: Optional[StrictStr] = None,
585
558
  _request_timeout: Union[
586
559
  None,
587
560
  Annotated[StrictFloat, Field(gt=0)],
@@ -600,8 +573,6 @@ class StrategiesApi:
600
573
 
601
574
  :param id: (required)
602
575
  :type id: str
603
- :param access_token:
604
- :type access_token: str
605
576
  :param _request_timeout: timeout setting for this request. If one
606
577
  number provided, it will be total request
607
578
  timeout. It can also be a pair (tuple) of
@@ -626,7 +597,6 @@ class StrategiesApi:
626
597
 
627
598
  _param = self._kill_strategy_serialize(
628
599
  id=id,
629
- access_token=access_token,
630
600
  _request_auth=_request_auth,
631
601
  _content_type=_content_type,
632
602
  _headers=_headers,
@@ -650,7 +620,6 @@ class StrategiesApi:
650
620
  async def kill_strategy_with_http_info(
651
621
  self,
652
622
  id: StrictStr,
653
- access_token: Optional[StrictStr] = None,
654
623
  _request_timeout: Union[
655
624
  None,
656
625
  Annotated[StrictFloat, Field(gt=0)],
@@ -669,8 +638,6 @@ class StrategiesApi:
669
638
 
670
639
  :param id: (required)
671
640
  :type id: str
672
- :param access_token:
673
- :type access_token: str
674
641
  :param _request_timeout: timeout setting for this request. If one
675
642
  number provided, it will be total request
676
643
  timeout. It can also be a pair (tuple) of
@@ -695,7 +662,6 @@ class StrategiesApi:
695
662
 
696
663
  _param = self._kill_strategy_serialize(
697
664
  id=id,
698
- access_token=access_token,
699
665
  _request_auth=_request_auth,
700
666
  _content_type=_content_type,
701
667
  _headers=_headers,
@@ -719,7 +685,6 @@ class StrategiesApi:
719
685
  async def kill_strategy_without_preload_content(
720
686
  self,
721
687
  id: StrictStr,
722
- access_token: Optional[StrictStr] = None,
723
688
  _request_timeout: Union[
724
689
  None,
725
690
  Annotated[StrictFloat, Field(gt=0)],
@@ -738,8 +703,6 @@ class StrategiesApi:
738
703
 
739
704
  :param id: (required)
740
705
  :type id: str
741
- :param access_token:
742
- :type access_token: str
743
706
  :param _request_timeout: timeout setting for this request. If one
744
707
  number provided, it will be total request
745
708
  timeout. It can also be a pair (tuple) of
@@ -764,7 +727,6 @@ class StrategiesApi:
764
727
 
765
728
  _param = self._kill_strategy_serialize(
766
729
  id=id,
767
- access_token=access_token,
768
730
  _request_auth=_request_auth,
769
731
  _content_type=_content_type,
770
732
  _headers=_headers,
@@ -783,7 +745,6 @@ class StrategiesApi:
783
745
  def _kill_strategy_serialize(
784
746
  self,
785
747
  id,
786
- access_token,
787
748
  _request_auth,
788
749
  _content_type,
789
750
  _headers,
@@ -818,7 +779,7 @@ class StrategiesApi:
818
779
  )
819
780
 
820
781
  # authentication setting
821
- _auth_settings: List[str] = ["HTTPBearer"]
782
+ _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
822
783
 
823
784
  return self.api_client.param_serialize(
824
785
  method="DELETE",
@@ -840,7 +801,6 @@ class StrategiesApi:
840
801
  self,
841
802
  id: StrictStr,
842
803
  strategy_model_input: StrategyModelInput,
843
- access_token: Optional[StrictStr] = None,
844
804
  _request_timeout: Union[
845
805
  None,
846
806
  Annotated[StrictFloat, Field(gt=0)],
@@ -861,8 +821,6 @@ class StrategiesApi:
861
821
  :type id: str
862
822
  :param strategy_model_input: (required)
863
823
  :type strategy_model_input: StrategyModelInput
864
- :param access_token:
865
- :type access_token: str
866
824
  :param _request_timeout: timeout setting for this request. If one
867
825
  number provided, it will be total request
868
826
  timeout. It can also be a pair (tuple) of
@@ -888,7 +846,6 @@ class StrategiesApi:
888
846
  _param = self._update_strategy_serialize(
889
847
  id=id,
890
848
  strategy_model_input=strategy_model_input,
891
- access_token=access_token,
892
849
  _request_auth=_request_auth,
893
850
  _content_type=_content_type,
894
851
  _headers=_headers,
@@ -913,7 +870,6 @@ class StrategiesApi:
913
870
  self,
914
871
  id: StrictStr,
915
872
  strategy_model_input: StrategyModelInput,
916
- access_token: Optional[StrictStr] = None,
917
873
  _request_timeout: Union[
918
874
  None,
919
875
  Annotated[StrictFloat, Field(gt=0)],
@@ -934,8 +890,6 @@ class StrategiesApi:
934
890
  :type id: str
935
891
  :param strategy_model_input: (required)
936
892
  :type strategy_model_input: StrategyModelInput
937
- :param access_token:
938
- :type access_token: str
939
893
  :param _request_timeout: timeout setting for this request. If one
940
894
  number provided, it will be total request
941
895
  timeout. It can also be a pair (tuple) of
@@ -961,7 +915,6 @@ class StrategiesApi:
961
915
  _param = self._update_strategy_serialize(
962
916
  id=id,
963
917
  strategy_model_input=strategy_model_input,
964
- access_token=access_token,
965
918
  _request_auth=_request_auth,
966
919
  _content_type=_content_type,
967
920
  _headers=_headers,
@@ -986,7 +939,6 @@ class StrategiesApi:
986
939
  self,
987
940
  id: StrictStr,
988
941
  strategy_model_input: StrategyModelInput,
989
- access_token: Optional[StrictStr] = None,
990
942
  _request_timeout: Union[
991
943
  None,
992
944
  Annotated[StrictFloat, Field(gt=0)],
@@ -1007,8 +959,6 @@ class StrategiesApi:
1007
959
  :type id: str
1008
960
  :param strategy_model_input: (required)
1009
961
  :type strategy_model_input: StrategyModelInput
1010
- :param access_token:
1011
- :type access_token: str
1012
962
  :param _request_timeout: timeout setting for this request. If one
1013
963
  number provided, it will be total request
1014
964
  timeout. It can also be a pair (tuple) of
@@ -1034,7 +984,6 @@ class StrategiesApi:
1034
984
  _param = self._update_strategy_serialize(
1035
985
  id=id,
1036
986
  strategy_model_input=strategy_model_input,
1037
- access_token=access_token,
1038
987
  _request_auth=_request_auth,
1039
988
  _content_type=_content_type,
1040
989
  _headers=_headers,
@@ -1054,7 +1003,6 @@ class StrategiesApi:
1054
1003
  self,
1055
1004
  id,
1056
1005
  strategy_model_input,
1057
- access_token,
1058
1006
  _request_auth,
1059
1007
  _content_type,
1060
1008
  _headers,
@@ -1101,7 +1049,7 @@ class StrategiesApi:
1101
1049
  _header_params["Content-Type"] = _default_content_type
1102
1050
 
1103
1051
  # authentication setting
1104
- _auth_settings: List[str] = ["HTTPBearer"]
1052
+ _auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
1105
1053
 
1106
1054
  return self.api_client.param_serialize(
1107
1055
  method="PUT",
@@ -16,7 +16,7 @@ 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 StrictInt, StrictStr
19
+ from pydantic import StrictInt
20
20
  from typing import Any, List, Optional
21
21
  from crypticorn.trade.client.models.action_model import ActionModel
22
22
  from crypticorn.trade.client.models.futures_trading_action import FuturesTradingAction
@@ -44,7 +44,6 @@ class TradingActionsApi:
44
44
  self,
45
45
  limit: Optional[StrictInt] = None,
46
46
  offset: Optional[StrictInt] = None,
47
- access_token: Optional[StrictStr] = None,
48
47
  _request_timeout: Union[
49
48
  None,
50
49
  Annotated[StrictFloat, Field(gt=0)],
@@ -64,8 +63,6 @@ class TradingActionsApi:
64
63
  :type limit: int
65
64
  :param offset:
66
65
  :type offset: int
67
- :param access_token:
68
- :type access_token: str
69
66
  :param _request_timeout: timeout setting for this request. If one
70
67
  number provided, it will be total request
71
68
  timeout. It can also be a pair (tuple) of
@@ -91,7 +88,6 @@ class TradingActionsApi:
91
88
  _param = self._get_actions_serialize(
92
89
  limit=limit,
93
90
  offset=offset,
94
- access_token=access_token,
95
91
  _request_auth=_request_auth,
96
92
  _content_type=_content_type,
97
93
  _headers=_headers,
@@ -116,7 +112,6 @@ class TradingActionsApi:
116
112
  self,
117
113
  limit: Optional[StrictInt] = None,
118
114
  offset: Optional[StrictInt] = None,
119
- access_token: Optional[StrictStr] = None,
120
115
  _request_timeout: Union[
121
116
  None,
122
117
  Annotated[StrictFloat, Field(gt=0)],
@@ -136,8 +131,6 @@ class TradingActionsApi:
136
131
  :type limit: int
137
132
  :param offset:
138
133
  :type offset: int
139
- :param access_token:
140
- :type access_token: str
141
134
  :param _request_timeout: timeout setting for this request. If one
142
135
  number provided, it will be total request
143
136
  timeout. It can also be a pair (tuple) of
@@ -163,7 +156,6 @@ class TradingActionsApi:
163
156
  _param = self._get_actions_serialize(
164
157
  limit=limit,
165
158
  offset=offset,
166
- access_token=access_token,
167
159
  _request_auth=_request_auth,
168
160
  _content_type=_content_type,
169
161
  _headers=_headers,
@@ -188,7 +180,6 @@ class TradingActionsApi:
188
180
  self,
189
181
  limit: Optional[StrictInt] = None,
190
182
  offset: Optional[StrictInt] = None,
191
- access_token: Optional[StrictStr] = None,
192
183
  _request_timeout: Union[
193
184
  None,
194
185
  Annotated[StrictFloat, Field(gt=0)],
@@ -208,8 +199,6 @@ class TradingActionsApi:
208
199
  :type limit: int
209
200
  :param offset:
210
201
  :type offset: int
211
- :param access_token:
212
- :type access_token: str
213
202
  :param _request_timeout: timeout setting for this request. If one
214
203
  number provided, it will be total request
215
204
  timeout. It can also be a pair (tuple) of
@@ -235,7 +224,6 @@ class TradingActionsApi:
235
224
  _param = self._get_actions_serialize(
236
225
  limit=limit,
237
226
  offset=offset,
238
- access_token=access_token,
239
227
  _request_auth=_request_auth,
240
228
  _content_type=_content_type,
241
229
  _headers=_headers,
@@ -255,7 +243,6 @@ class TradingActionsApi:
255
243
  self,
256
244
  limit,
257
245
  offset,
258
- access_token,
259
246
  _request_auth,
260
247
  _content_type,
261
248
  _headers,
@@ -119,7 +119,7 @@ HTTPSignatureAuthSetting = TypedDict(
119
119
  AuthSettings = TypedDict(
120
120
  "AuthSettings",
121
121
  {
122
- "HTTPBearer": BearerAuthSetting,
122
+ "HTTPBearer": BearerFormatAuthSetting,
123
123
  "APIKeyHeader": APIKeyAuthSetting,
124
124
  },
125
125
  total=False,
@@ -515,6 +515,7 @@ class Configuration:
515
515
  auth["HTTPBearer"] = {
516
516
  "type": "bearer",
517
517
  "in": "header",
518
+ "format": "JWT",
518
519
  "key": "Authorization",
519
520
  "value": "Bearer " + self.access_token,
520
521
  }
@@ -26,65 +26,71 @@ class ApiErrorIdentifier(str, Enum):
26
26
  """
27
27
  allowed enum values
28
28
  """
29
- SUCCESS = "success"
30
- INVALID_API_KEY = "invalid_api_key"
31
- INVALID_SIGNATURE = "invalid_signature"
32
- INVALID_TIMESTAMP = "invalid_timestamp"
33
- IP_ADDRESS_IS_NOT_AUTHORIZED = "ip_address_is_not_authorized"
29
+ API_KEY_ALREADY_EXISTS = "api_key_already_exists"
30
+ BLACK_SWAN = "black_swan"
31
+ BOT_ALREADY_DELETED = "bot_already_deleted"
32
+ BOT_DISABLED = "bot_disabled"
33
+ BOT_STOPPING_COMPLETED = "bot_stopping_completed"
34
+ CLIENT_ORDER_ID_ALREADY_EXISTS = "client_order_id_already_exists"
35
+ INVALID_CONTENT_TYPE = "invalid_content_type"
36
+ DELETE_BOT_ERROR = "delete_bot_error"
37
+ EXCHANGE_API_KEY_IN_USE = "exchange_api_key_in_use"
38
+ EXCHANGE_INVALID_SIGNATURE = "exchange_invalid_signature"
39
+ EXCHANGE_INVALID_TIMESTAMP = "exchange_invalid_timestamp"
40
+ EXCHANGE_IP_ADDRESS_IS_NOT_AUTHORIZED = "exchange_ip_address_is_not_authorized"
41
+ EXCHANGE_SYSTEM_UNDER_MAINTENANCE = "exchange_system_under_maintenance"
42
+ EXCHANGE_RATE_LIMIT_EXCEEDED = "exchange_rate_limit_exceeded"
43
+ EXCHANGE_SERVICE_TEMPORARILY_UNAVAILABLE = (
44
+ "exchange_service_temporarily_unavailable"
45
+ )
46
+ EXCHANGE_SYSTEM_IS_BUSY = "exchange_system_is_busy"
47
+ EXCHANGE_SYSTEM_CONFIGURATION_ERROR = "exchange_system_configuration_error"
48
+ EXCHANGE_INTERNAL_SYSTEM_ERROR = "exchange_internal_system_error"
49
+ EXCHANGE_USER_ACCOUNT_IS_FROZEN = "exchange_user_account_is_frozen"
34
50
  INSUFFICIENT_PERMISSIONS_SPOT_AND_FUTURES_REQUIRED = (
35
51
  "insufficient_permissions_spot_and_futures_required"
36
52
  )
37
- USER_ACCOUNT_IS_FROZEN = "user_account_is_frozen"
38
- RATE_LIMIT_EXCEEDED = "rate_limit_exceeded"
53
+ HEDGE_MODE_NOT_ACTIVE = "hedge_mode_not_active"
54
+ HTTP_REQUEST_ERROR = "http_request_error"
55
+ INSUFFICIENT_BALANCE = "insufficient_balance"
56
+ INSUFFICIENT_MARGIN = "insufficient_margin"
57
+ INSUFFICIENT_SCOPES = "insufficient_scopes"
58
+ INVALID_API_KEY = "invalid_api_key"
59
+ INVALID_BEARER = "invalid_bearer"
60
+ INVALID_EXCHANGE_API_KEY = "invalid_exchange_api_key"
61
+ INVALID_MARGIN_MODE = "invalid_margin_mode"
39
62
  INVALID_PARAMETER_PROVIDED = "invalid_parameter_provided"
40
- REQUEST_SCOPE_LIMIT_EXCEEDED = "request_scope_limit_exceeded"
41
- INVALID_CONTENT_TYPE = "invalid_content_type"
42
- REQUESTED_RESOURCE_NOT_FOUND = "requested_resource_not_found"
43
- ORDER_DOES_NOT_EXIST = "order_does_not_exist"
63
+ JWT_EXPIRED = "jwt_expired"
64
+ LEVERAGE_LIMIT_EXCEEDED = "leverage_limit_exceeded"
65
+ ORDER_VIOLATES_LIQUIDATION_PRICE_CONSTRAINTS = (
66
+ "order_violates_liquidation_price_constraints"
67
+ )
68
+ NO_CREDENTIALS = "no_credentials"
69
+ OBJECT_NOT_FOUND = "object_not_found"
44
70
  ORDER_IS_ALREADY_FILLED = "order_is_already_filled"
45
71
  ORDER_IS_BEING_PROCESSED = "order_is_being_processed"
46
72
  ORDER_QUANTITY_LIMIT_EXCEEDED = "order_quantity_limit_exceeded"
73
+ ORDER_DOES_NOT_EXIST = "order_does_not_exist"
47
74
  ORDER_PRICE_IS_INVALID = "order_price_is_invalid"
48
- POST_ONLY_ORDER_WOULD_IMMEDIATELY_MATCH = "post_only_order_would_immediately_match"
49
- SYMBOL_DOES_NOT_EXIST = "symbol_does_not_exist"
50
- CLIENT_ORDER_ID_ALREADY_EXISTS = "client_order_id_already_exists"
51
- POSITION_DOES_NOT_EXIST = "position_does_not_exist"
75
+ ORDER_SIZE_TOO_LARGE = "order_size_too_large"
76
+ ORDER_SIZE_TOO_SMALL = "order_size_too_small"
52
77
  POSITION_LIMIT_EXCEEDED = "position_limit_exceeded"
78
+ POSITION_DOES_NOT_EXIST = "position_does_not_exist"
53
79
  POSITION_OPENING_TEMPORARILY_SUSPENDED = "position_opening_temporarily_suspended"
54
- INSUFFICIENT_BALANCE = "insufficient_balance"
55
- INSUFFICIENT_MARGIN = "insufficient_margin"
56
- LEVERAGE_LIMIT_EXCEEDED = "leverage_limit_exceeded"
80
+ POST_ONLY_ORDER_WOULD_IMMEDIATELY_MATCH = "post_only_order_would_immediately_match"
81
+ REQUEST_SCOPE_LIMIT_EXCEEDED = "request_scope_limit_exceeded"
57
82
  RISK_LIMIT_EXCEEDED = "risk_limit_exceeded"
58
- ORDER_VIOLATES_LIQUIDATION_PRICE_CONSTRAINTS = (
59
- "order_violates_liquidation_price_constraints"
60
- )
61
- INVALID_MARGIN_MODE = "invalid_margin_mode"
62
- INTERNAL_SYSTEM_ERROR = "internal_system_error"
63
- SYSTEM_CONFIGURATION_ERROR = "system_configuration_error"
64
- SERVICE_TEMPORARILY_UNAVAILABLE = "service_temporarily_unavailable"
65
- SYSTEM_IS_BUSY_PLEASE_TRY_AGAIN_LATER = "system_is_busy_please_try_again_later"
66
- SYSTEM_UNDER_MAINTENANCE = "system_under_maintenance"
67
83
  RPC_TIMEOUT = "rpc_timeout"
68
84
  SYSTEM_SETTLEMENT_IN_PROCESS = "system_settlement_in_process"
69
- TRADING_IS_SUSPENDED = "trading_is_suspended"
85
+ STRATEGY_DISABLED = "strategy_disabled"
86
+ SUCCESS = "success"
87
+ SYMBOL_DOES_NOT_EXIST = "symbol_does_not_exist"
70
88
  TRADING_HAS_BEEN_LOCKED = "trading_has_been_locked"
71
- UNKNOWN_ERROR_OCCURRED = "unknown_error_occurred"
72
- HTTP_REQUEST_ERROR = "http_request_error"
73
- BLACK_SWAN = "black_swan"
74
89
  TRADING_ACTION_EXPIRED = "trading_action_expired"
75
90
  TRADING_ACTION_SKIPPED = "trading_action_skipped"
76
- BOT_DISABLED = "bot_disabled"
77
- ORDER_SIZE_TOO_SMALL = "order_size_too_small"
78
- ORDER_SIZE_TOO_LARGE = "order_size_too_large"
79
- HEDGE_MODE_NOT_ACTIVE = "hedge_mode_not_active"
80
- API_KEY_ALREADY_EXISTS = "api_key_already_exists"
81
- DELETE_BOT_ERROR = "delete_bot_error"
82
- JWT_EXPIRED = "jwt_expired"
83
- BOT_STOPPING_COMPLETED = "bot_stopping_completed"
84
- OBJECT_NOT_FOUND = "object_not_found"
85
- STRATEGY_DISABLED = "strategy_disabled"
86
- API_KEY_IN_USE_BY_BOTS = "api_key_in_use_by_bots"
87
- BOT_ALREADY_DELETED = "bot_already_deleted"
91
+ TRADING_IS_SUSPENDED = "trading_is_suspended"
92
+ UNKNOWN_ERROR_OCCURRED = "unknown_error_occurred"
93
+ REQUESTED_RESOURCE_NOT_FOUND = "requested_resource_not_found"
88
94
 
89
95
  @classmethod
90
96
  def from_json(cls, json_str: str) -> Self:
@@ -20,15 +20,15 @@ from typing_extensions import Self
20
20
 
21
21
  class ApiErrorLevel(str, Enum):
22
22
  """
23
- ApiErrorLevel
23
+ API error levels
24
24
  """
25
25
 
26
26
  """
27
27
  allowed enum values
28
28
  """
29
29
  ERROR = "error"
30
- SUCCESS = "success"
31
30
  INFO = "info"
31
+ SUCCESS = "success"
32
32
  WARNING = "warning"
33
33
 
34
34
  @classmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crypticorn
3
- Version: 2.1.3
3
+ Version: 2.1.5
4
4
  Summary: Maximise Your Crypto Trading Profits with AI Predictions
5
5
  Author-email: Crypticorn <timon@crypticorn.com>
6
6
  Project-URL: Homepage, https://crypticorn.com
@@ -71,7 +71,7 @@ As of know the library is available in async mode only. There are two was of usi
71
71
 
72
72
  ## With Async Context Protocol
73
73
  ```python
74
- async with ApiClient(base_url="http://localhost", jwt=jwt) as client:
74
+ async with ApiClient(base_url=BaseUrl.Prod, api_key="your-api-key") as client:
75
75
  # json response
76
76
  response = await client.pay.products.get_products_without_preload_content()
77
77
  print(await response.json())
@@ -86,7 +86,7 @@ async with ApiClient(base_url="http://localhost", jwt=jwt) as client:
86
86
  ## Without Async Context Protocol
87
87
  Without the context you need to close the session manually.
88
88
  ```python
89
- client = ApiClient(base_url="http://localhost", jwt=jwt)
89
+ client = ApiClient(base_url=BaseUrl.Prod, api_key="your-api-key")
90
90
  response = asyncio.run(client.hive.models.get_all_models())
91
91
  asyncio.run(client.close())
92
92
  ```