crypticorn 2.5.0rc5__py3-none-any.whl → 2.5.2__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 (144) hide show
  1. crypticorn/auth/main.py +2 -0
  2. crypticorn/client.py +60 -69
  3. crypticorn/common/__init__.py +3 -1
  4. crypticorn/common/auth.py +38 -20
  5. crypticorn/common/enums.py +4 -31
  6. crypticorn/common/errors.py +72 -17
  7. crypticorn/common/exceptions.py +29 -15
  8. crypticorn/common/mixins.py +37 -0
  9. crypticorn/common/status_router.py +42 -0
  10. crypticorn/common/urls.py +2 -1
  11. crypticorn/common/utils.py +9 -14
  12. crypticorn/hive/main.py +2 -0
  13. crypticorn/klines/client/__init__.py +10 -43
  14. crypticorn/klines/client/api/__init__.py +1 -1
  15. crypticorn/klines/client/api/change_in_timeframe_api.py +16 -31
  16. crypticorn/klines/client/api/funding_rates_api.py +8 -22
  17. crypticorn/klines/client/api/ohlcv_data_api.py +17 -38
  18. crypticorn/klines/client/api/{health_check_api.py → status_api.py} +18 -23
  19. crypticorn/klines/client/api/symbols_api.py +18 -34
  20. crypticorn/klines/client/api/udf_api.py +48 -59
  21. crypticorn/klines/client/api_client.py +1 -1
  22. crypticorn/klines/client/configuration.py +1 -1
  23. crypticorn/klines/client/exceptions.py +1 -1
  24. crypticorn/klines/client/models/__init__.py +9 -42
  25. crypticorn/klines/client/models/{change_in_timeframe_response.py → change_in_timeframe.py} +5 -5
  26. crypticorn/klines/client/models/{error_response.py → exception_detail.py} +25 -20
  27. crypticorn/klines/client/models/{funding_rate_response.py → funding_rate.py} +5 -5
  28. crypticorn/klines/client/models/{ohlcv_response.py → ohlcv_history.py} +14 -14
  29. crypticorn/klines/client/models/resolution.py +1 -1
  30. crypticorn/klines/client/models/{exchange.py → search_symbol.py} +17 -13
  31. crypticorn/klines/client/models/sort_direction.py +1 -1
  32. crypticorn/klines/client/models/{symbol_group_response.py → symbol_group.py} +5 -5
  33. crypticorn/klines/client/models/{symbol_info_response.py → symbol_info.py} +5 -5
  34. crypticorn/klines/client/models/symbol_type.py +1 -1
  35. crypticorn/klines/client/models/timeframe.py +1 -1
  36. crypticorn/klines/client/models/{udf_config_response.py → udf_config.py} +7 -19
  37. crypticorn/klines/client/rest.py +1 -1
  38. crypticorn/klines/main.py +40 -23
  39. crypticorn/metrics/client/__init__.py +3 -22
  40. crypticorn/metrics/client/api/__init__.py +1 -1
  41. crypticorn/metrics/client/api/exchanges_api.py +53 -97
  42. crypticorn/metrics/client/api/indicators_api.py +26 -52
  43. crypticorn/metrics/client/api/logs_api.py +8 -23
  44. crypticorn/metrics/client/api/marketcap_api.py +36 -88
  45. crypticorn/metrics/client/api/markets_api.py +26 -55
  46. crypticorn/metrics/client/api/{health_check_api.py → status_api.py} +18 -23
  47. crypticorn/metrics/client/api/tokens_api.py +7 -21
  48. crypticorn/metrics/client/api_client.py +1 -1
  49. crypticorn/metrics/client/configuration.py +1 -1
  50. crypticorn/metrics/client/exceptions.py +1 -1
  51. crypticorn/metrics/client/models/__init__.py +2 -21
  52. crypticorn/metrics/client/models/{error_response.py → exception_detail.py} +25 -20
  53. crypticorn/metrics/client/models/severity.py +1 -1
  54. crypticorn/metrics/client/models/time_interval.py +1 -1
  55. crypticorn/metrics/client/models/trading_status.py +1 -1
  56. crypticorn/metrics/client/rest.py +1 -1
  57. crypticorn/metrics/main.py +51 -43
  58. crypticorn/pay/main.py +2 -0
  59. crypticorn/trade/client/__init__.py +1 -5
  60. crypticorn/trade/client/api/exchanges_api.py +6 -6
  61. crypticorn/trade/client/api/trading_actions_api.py +16 -15
  62. crypticorn/trade/client/models/__init__.py +1 -5
  63. crypticorn/trade/client/models/action_model.py +1 -2
  64. crypticorn/trade/client/models/bot_model.py +3 -7
  65. crypticorn/trade/client/models/exchange_key_model.py +2 -11
  66. crypticorn/trade/client/models/execution_ids.py +1 -1
  67. crypticorn/trade/client/models/futures_trading_action.py +1 -2
  68. crypticorn/trade/client/models/notification_model.py +3 -12
  69. crypticorn/trade/client/models/order_model.py +7 -21
  70. crypticorn/trade/client/models/spot_trading_action.py +230 -0
  71. crypticorn/trade/client/models/strategy_exchange_info.py +2 -3
  72. crypticorn/trade/client/models/strategy_model_input.py +1 -2
  73. crypticorn/trade/client/models/strategy_model_output.py +1 -2
  74. crypticorn/trade/client/models/tpsl.py +3 -1
  75. crypticorn/trade/main.py +2 -0
  76. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/METADATA +7 -5
  77. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/RECORD +81 -141
  78. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/WHEEL +1 -1
  79. crypticorn/common/sorter.py +0 -40
  80. crypticorn/klines/client/models/base_response_health_check_response.py +0 -114
  81. crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +0 -123
  82. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +0 -118
  83. crypticorn/klines/client/models/base_response_list_str.py +0 -106
  84. crypticorn/klines/client/models/base_response_ohlcv_response.py +0 -114
  85. crypticorn/klines/client/models/health_check_response.py +0 -91
  86. crypticorn/klines/client/models/history_error_response.py +0 -89
  87. crypticorn/klines/client/models/history_no_data_response.py +0 -99
  88. crypticorn/klines/client/models/history_success_response.py +0 -99
  89. crypticorn/klines/client/models/http_validation_error.py +0 -99
  90. crypticorn/klines/client/models/market.py +0 -35
  91. crypticorn/klines/client/models/market_type.py +0 -35
  92. crypticorn/klines/client/models/response_get_history_udf_history_get.py +0 -198
  93. crypticorn/klines/client/models/response_get_udf_history.py +0 -198
  94. crypticorn/klines/client/models/search_symbol_response.py +0 -104
  95. crypticorn/klines/client/models/validation_error.py +0 -105
  96. crypticorn/klines/client/models/validation_error_loc_inner.py +0 -159
  97. crypticorn/metrics/client/models/base_response_dict.py +0 -106
  98. crypticorn/metrics/client/models/base_response_health_check_response.py +0 -114
  99. crypticorn/metrics/client/models/base_response_list_dict.py +0 -106
  100. crypticorn/metrics/client/models/base_response_list_exchange_mapping.py +0 -118
  101. crypticorn/metrics/client/models/base_response_list_str.py +0 -106
  102. crypticorn/metrics/client/models/exchange_mapping.py +0 -134
  103. crypticorn/metrics/client/models/health_check_response.py +0 -91
  104. crypticorn/metrics/client/models/http_validation_error.py +0 -99
  105. crypticorn/metrics/client/models/market.py +0 -35
  106. crypticorn/metrics/client/models/market_type.py +0 -35
  107. crypticorn/metrics/client/models/validation_error.py +0 -105
  108. crypticorn/metrics/client/models/validation_error_loc_inner.py +0 -159
  109. crypticorn/pay/client/models/api_status_res.py +0 -83
  110. crypticorn/pay/client/models/body_create_now_invoice.py +0 -98
  111. crypticorn/pay/client/models/body_create_product.py +0 -98
  112. crypticorn/pay/client/models/body_get_products.py +0 -87
  113. crypticorn/pay/client/models/body_handle_now_webhook.py +0 -98
  114. crypticorn/pay/client/models/body_update_product.py +0 -98
  115. crypticorn/pay/client/models/combined_payment_history.py +0 -101
  116. crypticorn/pay/client/models/create_invoice_req.py +0 -188
  117. crypticorn/pay/client/models/create_invoice_res.py +0 -188
  118. crypticorn/pay/client/models/currency.py +0 -165
  119. crypticorn/pay/client/models/estimate_price_req.py +0 -91
  120. crypticorn/pay/client/models/estimate_price_res.py +0 -102
  121. crypticorn/pay/client/models/get_currencies_res.py +0 -99
  122. crypticorn/pay/client/models/get_payment_status_res.py +0 -222
  123. crypticorn/pay/client/models/get_payments_list_res.py +0 -109
  124. crypticorn/pay/client/models/min_amount_req.py +0 -124
  125. crypticorn/pay/client/models/min_amount_res.py +0 -105
  126. crypticorn/pay/client/models/now_fee_structure.py +0 -104
  127. crypticorn/pay/client/models/now_payment_model.py +0 -124
  128. crypticorn/pay/client/models/now_payment_status.py +0 -42
  129. crypticorn/pay/client/models/now_webhook_payload.py +0 -181
  130. crypticorn/pay/client/models/partial_product_update_model.py +0 -150
  131. crypticorn/pay/client/models/product.py +0 -87
  132. crypticorn/pay/client/models/product_model.py +0 -128
  133. crypticorn/pay/client/models/product_subs_model.py +0 -108
  134. crypticorn/pay/client/models/product_update_model.py +0 -150
  135. crypticorn/pay/client/models/unified_payment_model.py +0 -112
  136. crypticorn/trade/client/models/api_error_identifier.py +0 -104
  137. crypticorn/trade/client/models/api_error_level.py +0 -37
  138. crypticorn/trade/client/models/api_error_type.py +0 -37
  139. crypticorn/trade/client/models/api_key_model.py +0 -156
  140. crypticorn/trade/client/models/exchange.py +0 -35
  141. crypticorn/trade/client/models/market_type.py +0 -35
  142. /crypticorn/common/{pydantic.py → decorators.py} +0 -0
  143. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/entry_points.txt +0 -0
  144. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/top_level.txt +0 -0
@@ -1,150 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Payment API
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
-
15
- from __future__ import annotations
16
- import pprint
17
- import re # noqa: F401
18
- import json
19
-
20
- from pydantic import (
21
- BaseModel,
22
- ConfigDict,
23
- StrictBool,
24
- StrictFloat,
25
- StrictInt,
26
- StrictStr,
27
- )
28
- from typing import Any, ClassVar, Dict, List, Optional, Union
29
- from crypticorn.pay.client.models.scope import Scope
30
- from typing import Optional, Set
31
- from typing_extensions import Self
32
-
33
-
34
- class ProductUpdateModel(BaseModel):
35
- """
36
- ProductUpdateModel
37
- """ # noqa: E501
38
-
39
- id: Optional[StrictStr] = None
40
- name: Optional[StrictStr] = None
41
- price: Optional[Union[StrictFloat, StrictInt]] = None
42
- scopes: Optional[List[Scope]] = None
43
- duration: Optional[StrictInt] = None
44
- description: Optional[StrictStr] = None
45
- is_active: Optional[StrictBool] = None
46
- __properties: ClassVar[List[str]] = [
47
- "id",
48
- "name",
49
- "price",
50
- "scopes",
51
- "duration",
52
- "description",
53
- "is_active",
54
- ]
55
-
56
- model_config = ConfigDict(
57
- populate_by_name=True,
58
- validate_assignment=True,
59
- protected_namespaces=(),
60
- )
61
-
62
- def to_str(self) -> str:
63
- """Returns the string representation of the model using alias"""
64
- return pprint.pformat(self.model_dump(by_alias=True))
65
-
66
- def to_json(self) -> str:
67
- """Returns the JSON representation of the model using alias"""
68
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
69
- return json.dumps(self.to_dict())
70
-
71
- @classmethod
72
- def from_json(cls, json_str: str) -> Optional[Self]:
73
- """Create an instance of ProductUpdateModel from a JSON string"""
74
- return cls.from_dict(json.loads(json_str))
75
-
76
- def to_dict(self) -> Dict[str, Any]:
77
- """Return the dictionary representation of the model using alias.
78
-
79
- This has the following differences from calling pydantic's
80
- `self.model_dump(by_alias=True)`:
81
-
82
- * `None` is only added to the output dict for nullable fields that
83
- were set at model initialization. Other fields with value `None`
84
- are ignored.
85
- """
86
- excluded_fields: Set[str] = set([])
87
-
88
- _dict = self.model_dump(
89
- by_alias=True,
90
- exclude=excluded_fields,
91
- exclude_none=True,
92
- )
93
- # set to None if id (nullable) is None
94
- # and model_fields_set contains the field
95
- if self.id is None and "id" in self.model_fields_set:
96
- _dict["id"] = None
97
-
98
- # set to None if name (nullable) is None
99
- # and model_fields_set contains the field
100
- if self.name is None and "name" in self.model_fields_set:
101
- _dict["name"] = None
102
-
103
- # set to None if price (nullable) is None
104
- # and model_fields_set contains the field
105
- if self.price is None and "price" in self.model_fields_set:
106
- _dict["price"] = None
107
-
108
- # set to None if scopes (nullable) is None
109
- # and model_fields_set contains the field
110
- if self.scopes is None and "scopes" in self.model_fields_set:
111
- _dict["scopes"] = None
112
-
113
- # set to None if duration (nullable) is None
114
- # and model_fields_set contains the field
115
- if self.duration is None and "duration" in self.model_fields_set:
116
- _dict["duration"] = None
117
-
118
- # set to None if description (nullable) is None
119
- # and model_fields_set contains the field
120
- if self.description is None and "description" in self.model_fields_set:
121
- _dict["description"] = None
122
-
123
- # set to None if is_active (nullable) is None
124
- # and model_fields_set contains the field
125
- if self.is_active is None and "is_active" in self.model_fields_set:
126
- _dict["is_active"] = None
127
-
128
- return _dict
129
-
130
- @classmethod
131
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
132
- """Create an instance of ProductUpdateModel from a dict"""
133
- if obj is None:
134
- return None
135
-
136
- if not isinstance(obj, dict):
137
- return cls.model_validate(obj)
138
-
139
- _obj = cls.model_validate(
140
- {
141
- "id": obj.get("id"),
142
- "name": obj.get("name"),
143
- "price": obj.get("price"),
144
- "scopes": obj.get("scopes"),
145
- "duration": obj.get("duration"),
146
- "description": obj.get("description"),
147
- "is_active": obj.get("is_active"),
148
- }
149
- )
150
- return _obj
@@ -1,112 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Payment API
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
-
15
- from __future__ import annotations
16
- import pprint
17
- import re # noqa: F401
18
- import json
19
-
20
- from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Union
22
- from crypticorn.pay.client.models.payment_status import PaymentStatus
23
- from crypticorn.pay.client.models.services import Services
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
-
28
- class UnifiedPaymentModel(BaseModel):
29
- """
30
- Combined payment model across all services
31
- """ # noqa: E501
32
-
33
- id: StrictStr = Field(description="Payment ID")
34
- product_id: StrictStr = Field(description="Product ID")
35
- var_date: StrictInt = Field(description="Payment date in seconds", alias="date")
36
- amount: Union[StrictFloat, StrictInt] = Field(description="Payment amount")
37
- currency: StrictStr = Field(description="Payment currency")
38
- status: PaymentStatus
39
- service: Services = Field(description="Payment service")
40
- market: StrictStr = Field(description="Payment market")
41
- __properties: ClassVar[List[str]] = [
42
- "id",
43
- "product_id",
44
- "date",
45
- "amount",
46
- "currency",
47
- "status",
48
- "service",
49
- "market",
50
- ]
51
-
52
- model_config = ConfigDict(
53
- populate_by_name=True,
54
- validate_assignment=True,
55
- protected_namespaces=(),
56
- )
57
-
58
- def to_str(self) -> str:
59
- """Returns the string representation of the model using alias"""
60
- return pprint.pformat(self.model_dump(by_alias=True))
61
-
62
- def to_json(self) -> str:
63
- """Returns the JSON representation of the model using alias"""
64
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
65
- return json.dumps(self.to_dict())
66
-
67
- @classmethod
68
- def from_json(cls, json_str: str) -> Optional[Self]:
69
- """Create an instance of UnifiedPaymentModel from a JSON string"""
70
- return cls.from_dict(json.loads(json_str))
71
-
72
- def to_dict(self) -> Dict[str, Any]:
73
- """Return the dictionary representation of the model using alias.
74
-
75
- This has the following differences from calling pydantic's
76
- `self.model_dump(by_alias=True)`:
77
-
78
- * `None` is only added to the output dict for nullable fields that
79
- were set at model initialization. Other fields with value `None`
80
- are ignored.
81
- """
82
- excluded_fields: Set[str] = set([])
83
-
84
- _dict = self.model_dump(
85
- by_alias=True,
86
- exclude=excluded_fields,
87
- exclude_none=True,
88
- )
89
- return _dict
90
-
91
- @classmethod
92
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
- """Create an instance of UnifiedPaymentModel from a dict"""
94
- if obj is None:
95
- return None
96
-
97
- if not isinstance(obj, dict):
98
- return cls.model_validate(obj)
99
-
100
- _obj = cls.model_validate(
101
- {
102
- "id": obj.get("id"),
103
- "product_id": obj.get("product_id"),
104
- "date": obj.get("date"),
105
- "amount": obj.get("amount"),
106
- "currency": obj.get("currency"),
107
- "status": obj.get("status"),
108
- "service": obj.get("service"),
109
- "market": obj.get("market"),
110
- }
111
- )
112
- return _obj
@@ -1,104 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Trading API
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
-
15
- from __future__ import annotations
16
- import json
17
- from enum import Enum
18
- from typing_extensions import Self
19
-
20
-
21
- class ApiErrorIdentifier(str, Enum):
22
- """
23
- API error identifiers
24
- """
25
-
26
- """
27
- allowed enum values
28
- """
29
- ALLOCATION_BELOW_CURRENT_EXPOSURE = "allocation_below_current_exposure"
30
- ALLOCATION_BELOW_MIN_AMOUNT = "allocation_below_min_amount"
31
- BLACK_SWAN = "black_swan"
32
- BOT_ALREADY_DELETED = "bot_already_deleted"
33
- BOT_DISABLED = "bot_disabled"
34
- BOT_STOPPING_COMPLETED = "bot_stopping_completed"
35
- CLIENT_ORDER_ID_ALREADY_EXISTS = "client_order_id_already_exists"
36
- INVALID_CONTENT_TYPE = "invalid_content_type"
37
- DELETE_BOT_ERROR = "delete_bot_error"
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_KEY_ALREADY_EXISTS = "exchange_key_already_exists"
42
- EXCHANGE_KEY_IN_USE = "exchange_key_in_use"
43
- EXCHANGE_SYSTEM_UNDER_MAINTENANCE = "exchange_system_under_maintenance"
44
- EXCHANGE_RATE_LIMIT_EXCEEDED = "exchange_rate_limit_exceeded"
45
- INSUFFICIENT_PERMISSIONS_SPOT_AND_FUTURES_REQUIRED = (
46
- "insufficient_permissions_spot_and_futures_required"
47
- )
48
- EXCHANGE_SERVICE_TEMPORARILY_UNAVAILABLE = (
49
- "exchange_service_temporarily_unavailable"
50
- )
51
- EXCHANGE_SYSTEM_IS_BUSY = "exchange_system_is_busy"
52
- EXCHANGE_SYSTEM_CONFIGURATION_ERROR = "exchange_system_configuration_error"
53
- EXCHANGE_INTERNAL_SYSTEM_ERROR = "exchange_internal_system_error"
54
- EXCHANGE_USER_ACCOUNT_IS_FROZEN = "exchange_user_account_is_frozen"
55
- HEDGE_MODE_NOT_ACTIVE = "hedge_mode_not_active"
56
- HTTP_REQUEST_ERROR = "http_request_error"
57
- INSUFFICIENT_BALANCE = "insufficient_balance"
58
- INSUFFICIENT_MARGIN = "insufficient_margin"
59
- INSUFFICIENT_SCOPES = "insufficient_scopes"
60
- INVALID_API_KEY = "invalid_api_key"
61
- INVALID_BEARER = "invalid_bearer"
62
- INVALID_EXCHANGE_KEY = "invalid_exchange_key"
63
- INVALID_MARGIN_MODE = "invalid_margin_mode"
64
- INVALID_PARAMETER_PROVIDED = "invalid_parameter_provided"
65
- JWT_EXPIRED = "jwt_expired"
66
- LEVERAGE_LIMIT_EXCEEDED = "leverage_limit_exceeded"
67
- ORDER_VIOLATES_LIQUIDATION_PRICE_CONSTRAINTS = (
68
- "order_violates_liquidation_price_constraints"
69
- )
70
- NO_CREDENTIALS = "no_credentials"
71
- NOW_API_DOWN = "now_api_down"
72
- OBJECT_NOT_FOUND = "object_not_found"
73
- OBJECT_ALREADY_EXISTS = "object_already_exists"
74
- ORDER_IS_ALREADY_FILLED = "order_is_already_filled"
75
- ORDER_IS_BEING_PROCESSED = "order_is_being_processed"
76
- ORDER_QUANTITY_LIMIT_EXCEEDED = "order_quantity_limit_exceeded"
77
- ORDER_DOES_NOT_EXIST = "order_does_not_exist"
78
- ORDER_PRICE_IS_INVALID = "order_price_is_invalid"
79
- ORDER_SIZE_TOO_LARGE = "order_size_too_large"
80
- ORDER_SIZE_TOO_SMALL = "order_size_too_small"
81
- POSITION_LIMIT_EXCEEDED = "position_limit_exceeded"
82
- POSITION_DOES_NOT_EXIST = "position_does_not_exist"
83
- POSITION_OPENING_TEMPORARILY_SUSPENDED = "position_opening_temporarily_suspended"
84
- POST_ONLY_ORDER_WOULD_IMMEDIATELY_MATCH = "post_only_order_would_immediately_match"
85
- REQUEST_SCOPE_LIMIT_EXCEEDED = "request_scope_limit_exceeded"
86
- RISK_LIMIT_EXCEEDED = "risk_limit_exceeded"
87
- RPC_TIMEOUT = "rpc_timeout"
88
- SYSTEM_SETTLEMENT_IN_PROCESS = "system_settlement_in_process"
89
- STRATEGY_DISABLED = "strategy_disabled"
90
- STRATEGY_LEVERAGE_MISMATCH = "strategy_leverage_mismatch"
91
- STRATEGY_NOT_SUPPORTING_EXCHANGE = "strategy_not_supporting_exchange"
92
- SUCCESS = "success"
93
- SYMBOL_DOES_NOT_EXIST = "symbol_does_not_exist"
94
- TRADING_ACTION_EXPIRED = "trading_action_expired"
95
- TRADING_ACTION_SKIPPED = "trading_action_skipped"
96
- TRADING_HAS_BEEN_LOCKED = "trading_has_been_locked"
97
- TRADING_IS_SUSPENDED = "trading_is_suspended"
98
- UNKNOWN_ERROR_OCCURRED = "unknown_error_occurred"
99
- REQUESTED_RESOURCE_NOT_FOUND = "requested_resource_not_found"
100
-
101
- @classmethod
102
- def from_json(cls, json_str: str) -> Self:
103
- """Create an instance of ApiErrorIdentifier from a JSON string"""
104
- return cls(json.loads(json_str))
@@ -1,37 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Trading API
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
-
15
- from __future__ import annotations
16
- import json
17
- from enum import Enum
18
- from typing_extensions import Self
19
-
20
-
21
- class ApiErrorLevel(str, Enum):
22
- """
23
- API error levels
24
- """
25
-
26
- """
27
- allowed enum values
28
- """
29
- ERROR = "error"
30
- INFO = "info"
31
- SUCCESS = "success"
32
- WARNING = "warning"
33
-
34
- @classmethod
35
- def from_json(cls, json_str: str) -> Self:
36
- """Create an instance of ApiErrorLevel from a JSON string"""
37
- return cls(json.loads(json_str))
@@ -1,37 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Trading API
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
-
15
- from __future__ import annotations
16
- import json
17
- from enum import Enum
18
- from typing_extensions import Self
19
-
20
-
21
- class ApiErrorType(str, Enum):
22
- """
23
- Type of API error
24
- """
25
-
26
- """
27
- allowed enum values
28
- """
29
- USER_ERROR = "user error"
30
- EXCHANGE_ERROR = "exchange error"
31
- SERVER_ERROR = "server error"
32
- NO_ERROR = "no error"
33
-
34
- @classmethod
35
- def from_json(cls, json_str: str) -> Self:
36
- """Create an instance of ApiErrorType from a JSON string"""
37
- return cls(json.loads(json_str))
@@ -1,156 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Trading API
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
-
15
- from __future__ import annotations
16
- import pprint
17
- import re # noqa: F401
18
- import json
19
-
20
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
-
25
-
26
- class APIKeyModel(BaseModel):
27
- """
28
- APIKeyModel
29
- """ # noqa: E501
30
-
31
- created_at: Optional[StrictInt] = None
32
- updated_at: Optional[StrictInt] = None
33
- id: Optional[StrictStr] = None
34
- exchange: StrictStr = Field(description="Exchange name")
35
- api_key: Optional[StrictStr] = None
36
- secret: Optional[StrictStr] = None
37
- passphrase: Optional[StrictStr] = None
38
- label: StrictStr = Field(description="Label for the API key")
39
- enabled: Optional[StrictBool] = None
40
- user_id: Optional[StrictStr] = None
41
- __properties: ClassVar[List[str]] = [
42
- "created_at",
43
- "updated_at",
44
- "id",
45
- "exchange",
46
- "api_key",
47
- "secret",
48
- "passphrase",
49
- "label",
50
- "enabled",
51
- "user_id",
52
- ]
53
-
54
- model_config = ConfigDict(
55
- populate_by_name=True,
56
- validate_assignment=True,
57
- protected_namespaces=(),
58
- )
59
-
60
- def to_str(self) -> str:
61
- """Returns the string representation of the model using alias"""
62
- return pprint.pformat(self.model_dump(by_alias=True))
63
-
64
- def to_json(self) -> str:
65
- """Returns the JSON representation of the model using alias"""
66
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
67
- return json.dumps(self.to_dict())
68
-
69
- @classmethod
70
- def from_json(cls, json_str: str) -> Optional[Self]:
71
- """Create an instance of APIKeyModel from a JSON string"""
72
- return cls.from_dict(json.loads(json_str))
73
-
74
- def to_dict(self) -> Dict[str, Any]:
75
- """Return the dictionary representation of the model using alias.
76
-
77
- This has the following differences from calling pydantic's
78
- `self.model_dump(by_alias=True)`:
79
-
80
- * `None` is only added to the output dict for nullable fields that
81
- were set at model initialization. Other fields with value `None`
82
- are ignored.
83
- """
84
- excluded_fields: Set[str] = set([])
85
-
86
- _dict = self.model_dump(
87
- by_alias=True,
88
- exclude=excluded_fields,
89
- exclude_none=True,
90
- )
91
- # set to None if created_at (nullable) is None
92
- # and model_fields_set contains the field
93
- if self.created_at is None and "created_at" in self.model_fields_set:
94
- _dict["created_at"] = None
95
-
96
- # set to None if updated_at (nullable) is None
97
- # and model_fields_set contains the field
98
- if self.updated_at is None and "updated_at" in self.model_fields_set:
99
- _dict["updated_at"] = None
100
-
101
- # set to None if id (nullable) is None
102
- # and model_fields_set contains the field
103
- if self.id is None and "id" in self.model_fields_set:
104
- _dict["id"] = None
105
-
106
- # set to None if api_key (nullable) is None
107
- # and model_fields_set contains the field
108
- if self.api_key is None and "api_key" in self.model_fields_set:
109
- _dict["api_key"] = None
110
-
111
- # set to None if secret (nullable) is None
112
- # and model_fields_set contains the field
113
- if self.secret is None and "secret" in self.model_fields_set:
114
- _dict["secret"] = None
115
-
116
- # set to None if passphrase (nullable) is None
117
- # and model_fields_set contains the field
118
- if self.passphrase is None and "passphrase" in self.model_fields_set:
119
- _dict["passphrase"] = None
120
-
121
- # set to None if enabled (nullable) is None
122
- # and model_fields_set contains the field
123
- if self.enabled is None and "enabled" in self.model_fields_set:
124
- _dict["enabled"] = None
125
-
126
- # set to None if user_id (nullable) is None
127
- # and model_fields_set contains the field
128
- if self.user_id is None and "user_id" in self.model_fields_set:
129
- _dict["user_id"] = None
130
-
131
- return _dict
132
-
133
- @classmethod
134
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
135
- """Create an instance of APIKeyModel from a dict"""
136
- if obj is None:
137
- return None
138
-
139
- if not isinstance(obj, dict):
140
- return cls.model_validate(obj)
141
-
142
- _obj = cls.model_validate(
143
- {
144
- "created_at": obj.get("created_at"),
145
- "updated_at": obj.get("updated_at"),
146
- "id": obj.get("id"),
147
- "exchange": obj.get("exchange"),
148
- "api_key": obj.get("api_key"),
149
- "secret": obj.get("secret"),
150
- "passphrase": obj.get("passphrase"),
151
- "label": obj.get("label"),
152
- "enabled": obj.get("enabled"),
153
- "user_id": obj.get("user_id"),
154
- }
155
- )
156
- return _obj
@@ -1,35 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Trading API
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
-
15
- from __future__ import annotations
16
- import json
17
- from enum import Enum
18
- from typing_extensions import Self
19
-
20
-
21
- class Exchange(str, Enum):
22
- """
23
- Supported exchanges for trading
24
- """
25
-
26
- """
27
- allowed enum values
28
- """
29
- KUCOIN = "kucoin"
30
- BINGX = "bingx"
31
-
32
- @classmethod
33
- def from_json(cls, json_str: str) -> Self:
34
- """Create an instance of Exchange from a JSON string"""
35
- return cls(json.loads(json_str))
@@ -1,35 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Trading API
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
-
15
- from __future__ import annotations
16
- import json
17
- from enum import Enum
18
- from typing_extensions import Self
19
-
20
-
21
- class MarketType(str, Enum):
22
- """
23
- Market types
24
- """
25
-
26
- """
27
- allowed enum values
28
- """
29
- SPOT = "spot"
30
- FUTURES = "futures"
31
-
32
- @classmethod
33
- def from_json(cls, json_str: str) -> Self:
34
- """Create an instance of MarketType from a JSON string"""
35
- return cls(json.loads(json_str))
File without changes