crypticorn 2.5.1__py3-none-any.whl → 2.5.3__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 (191) hide show
  1. crypticorn/cli/init.py +3 -0
  2. crypticorn/common/__init__.py +1 -0
  3. crypticorn/common/enums.py +3 -1
  4. crypticorn/common/errors.py +42 -21
  5. crypticorn/common/mixins.py +20 -0
  6. crypticorn/common/scopes.py +4 -20
  7. crypticorn/common/status_router.py +44 -0
  8. crypticorn/common/utils.py +13 -14
  9. crypticorn/hive/client/__init__.py +1 -5
  10. crypticorn/hive/client/api/data_api.py +1 -33
  11. crypticorn/hive/client/api/models_api.py +8 -104
  12. crypticorn/hive/client/api/status_api.py +481 -9
  13. crypticorn/hive/client/configuration.py +12 -4
  14. crypticorn/hive/client/models/__init__.py +1 -5
  15. crypticorn/hive/client/models/coins.py +0 -1
  16. crypticorn/hive/client/models/data_version.py +0 -1
  17. crypticorn/{metrics/client/models/error_response.py → hive/client/models/exception_detail.py} +26 -21
  18. crypticorn/hive/client/rest.py +4 -1
  19. crypticorn/klines/client/__init__.py +0 -5
  20. crypticorn/klines/client/api/change_in_timeframe_api.py +8 -9
  21. crypticorn/klines/client/api/ohlcv_data_api.py +7 -8
  22. crypticorn/klines/client/api/status_api.py +481 -6
  23. crypticorn/klines/client/api/symbols_api.py +7 -8
  24. crypticorn/klines/client/api/udf_api.py +0 -227
  25. crypticorn/klines/client/models/__init__.py +0 -5
  26. crypticorn/klines/client/models/exception_detail.py +3 -6
  27. crypticorn/klines/client/models/search_symbol.py +4 -3
  28. crypticorn/klines/client/models/udf_config.py +1 -2
  29. crypticorn/metrics/client/__init__.py +1 -6
  30. crypticorn/metrics/client/api/exchanges_api.py +29 -31
  31. crypticorn/metrics/client/api/indicators_api.py +15 -16
  32. crypticorn/metrics/client/api/logs_api.py +1 -1
  33. crypticorn/metrics/client/api/marketcap_api.py +15 -16
  34. crypticorn/metrics/client/api/markets_api.py +15 -16
  35. crypticorn/metrics/client/api/status_api.py +477 -2
  36. crypticorn/metrics/client/api/tokens_api.py +1 -1
  37. crypticorn/metrics/client/api_client.py +1 -1
  38. crypticorn/metrics/client/configuration.py +3 -5
  39. crypticorn/metrics/client/exceptions.py +1 -1
  40. crypticorn/metrics/client/models/__init__.py +1 -6
  41. crypticorn/metrics/client/models/exception_detail.py +4 -7
  42. crypticorn/metrics/client/models/severity.py +1 -1
  43. crypticorn/metrics/client/models/time_interval.py +1 -1
  44. crypticorn/metrics/client/models/trading_status.py +1 -1
  45. crypticorn/metrics/client/rest.py +1 -1
  46. crypticorn/pay/client/__init__.py +3 -8
  47. crypticorn/pay/client/api/now_payments_api.py +14 -17
  48. crypticorn/pay/client/api/payments_api.py +2 -11
  49. crypticorn/pay/client/api/products_api.py +2 -11
  50. crypticorn/pay/client/api/status_api.py +483 -8
  51. crypticorn/pay/client/api_client.py +2 -2
  52. crypticorn/pay/client/configuration.py +3 -3
  53. crypticorn/pay/client/exceptions.py +2 -2
  54. crypticorn/pay/client/models/__init__.py +3 -8
  55. crypticorn/{metrics/client/models/base_response_dict.py → pay/client/models/exception_detail.py} +28 -20
  56. crypticorn/pay/client/models/now_create_invoice_req.py +2 -2
  57. crypticorn/pay/client/models/now_create_invoice_res.py +2 -2
  58. crypticorn/pay/client/models/payment.py +2 -2
  59. crypticorn/pay/client/models/payment_status.py +2 -2
  60. crypticorn/pay/client/models/product_create.py +2 -2
  61. crypticorn/pay/client/models/product_read.py +2 -2
  62. crypticorn/pay/client/models/product_sub_read.py +2 -2
  63. crypticorn/pay/client/models/product_update.py +2 -2
  64. crypticorn/pay/client/models/scope.py +2 -2
  65. crypticorn/pay/client/models/services.py +2 -2
  66. crypticorn/pay/client/rest.py +2 -2
  67. crypticorn/trade/client/__init__.py +4 -9
  68. crypticorn/trade/client/api/api_keys_api.py +5 -20
  69. crypticorn/trade/client/api/bots_api.py +7 -19
  70. crypticorn/trade/client/api/exchanges_api.py +8 -8
  71. crypticorn/trade/client/api/futures_trading_panel_api.py +10 -22
  72. crypticorn/trade/client/api/notifications_api.py +10 -25
  73. crypticorn/trade/client/api/orders_api.py +2 -5
  74. crypticorn/trade/client/api/status_api.py +483 -8
  75. crypticorn/trade/client/api/strategies_api.py +5 -17
  76. crypticorn/trade/client/api/trading_actions_api.py +18 -26
  77. crypticorn/trade/client/api_client.py +2 -2
  78. crypticorn/trade/client/configuration.py +5 -5
  79. crypticorn/trade/client/exceptions.py +2 -2
  80. crypticorn/trade/client/models/__init__.py +4 -9
  81. crypticorn/trade/client/models/action_model.py +3 -4
  82. crypticorn/trade/client/models/bot_model.py +2 -2
  83. crypticorn/trade/client/models/bot_status.py +2 -2
  84. crypticorn/{klines/client/models/error_response.py → trade/client/models/exception_detail.py} +26 -21
  85. crypticorn/trade/client/models/exchange_key_model.py +4 -13
  86. crypticorn/trade/client/models/execution_ids.py +2 -2
  87. crypticorn/trade/client/models/futures_balance.py +2 -2
  88. crypticorn/trade/client/models/futures_trading_action.py +3 -4
  89. crypticorn/trade/client/models/margin_mode.py +2 -2
  90. crypticorn/trade/client/models/notification_model.py +2 -2
  91. crypticorn/trade/client/models/order_model.py +6 -16
  92. crypticorn/trade/client/models/order_status.py +2 -2
  93. crypticorn/trade/client/models/post_futures_action.py +2 -2
  94. crypticorn/trade/client/models/spot_trading_action.py +3 -4
  95. crypticorn/trade/client/models/strategy_exchange_info.py +4 -5
  96. crypticorn/trade/client/models/strategy_model_input.py +3 -4
  97. crypticorn/trade/client/models/strategy_model_output.py +3 -4
  98. crypticorn/trade/client/models/tpsl.py +5 -3
  99. crypticorn/trade/client/models/trading_action_type.py +2 -2
  100. crypticorn/trade/client/rest.py +2 -2
  101. {crypticorn-2.5.1.dist-info → crypticorn-2.5.3.dist-info}/METADATA +1 -1
  102. crypticorn-2.5.3.dist-info/RECORD +223 -0
  103. crypticorn/hive/client/models/http_validation_error.py +0 -99
  104. crypticorn/hive/client/models/validation_error.py +0 -105
  105. crypticorn/hive/client/models/validation_error_loc_inner.py +0 -159
  106. crypticorn/klines/client/api/health_check_api.py +0 -265
  107. crypticorn/klines/client/models/api_error_identifier.py +0 -108
  108. crypticorn/klines/client/models/api_error_level.py +0 -37
  109. crypticorn/klines/client/models/api_error_type.py +0 -37
  110. crypticorn/klines/client/models/base_response_health_check_response.py +0 -114
  111. crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +0 -123
  112. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +0 -118
  113. crypticorn/klines/client/models/base_response_list_str.py +0 -106
  114. crypticorn/klines/client/models/base_response_ohlcv_response.py +0 -114
  115. crypticorn/klines/client/models/change_in_timeframe_response.py +0 -86
  116. crypticorn/klines/client/models/exchange.py +0 -91
  117. crypticorn/klines/client/models/funding_rate_response.py +0 -92
  118. crypticorn/klines/client/models/health_check_response.py +0 -91
  119. crypticorn/klines/client/models/history_error_response.py +0 -89
  120. crypticorn/klines/client/models/history_no_data_response.py +0 -99
  121. crypticorn/klines/client/models/history_success_response.py +0 -99
  122. crypticorn/klines/client/models/http_validation_error.py +0 -99
  123. crypticorn/klines/client/models/internal_exchange.py +0 -39
  124. crypticorn/klines/client/models/market.py +0 -35
  125. crypticorn/klines/client/models/market_type.py +0 -35
  126. crypticorn/klines/client/models/ohlcv_response.py +0 -105
  127. crypticorn/klines/client/models/response_get_history_udf_history_get.py +0 -198
  128. crypticorn/klines/client/models/response_get_udf_history.py +0 -198
  129. crypticorn/klines/client/models/search_symbol_response.py +0 -104
  130. crypticorn/klines/client/models/symbol_group_response.py +0 -83
  131. crypticorn/klines/client/models/symbol_info_response.py +0 -131
  132. crypticorn/klines/client/models/udf_config_response.py +0 -160
  133. crypticorn/klines/client/models/validation_error.py +0 -105
  134. crypticorn/klines/client/models/validation_error_loc_inner.py +0 -159
  135. crypticorn/metrics/client/api/health_check_api.py +0 -265
  136. crypticorn/metrics/client/models/api_error_identifier.py +0 -108
  137. crypticorn/metrics/client/models/api_error_level.py +0 -37
  138. crypticorn/metrics/client/models/api_error_type.py +0 -37
  139. crypticorn/metrics/client/models/base_response_health_check_response.py +0 -114
  140. crypticorn/metrics/client/models/base_response_list_dict.py +0 -106
  141. crypticorn/metrics/client/models/base_response_list_exchange_mapping.py +0 -118
  142. crypticorn/metrics/client/models/base_response_list_str.py +0 -106
  143. crypticorn/metrics/client/models/exchange_mapping.py +0 -134
  144. crypticorn/metrics/client/models/health_check_response.py +0 -91
  145. crypticorn/metrics/client/models/http_validation_error.py +0 -99
  146. crypticorn/metrics/client/models/internal_exchange.py +0 -39
  147. crypticorn/metrics/client/models/market.py +0 -35
  148. crypticorn/metrics/client/models/market_type.py +0 -35
  149. crypticorn/metrics/client/models/validation_error.py +0 -105
  150. crypticorn/metrics/client/models/validation_error_loc_inner.py +0 -159
  151. crypticorn/pay/client/models/api_status_res.py +0 -83
  152. crypticorn/pay/client/models/body_create_now_invoice.py +0 -98
  153. crypticorn/pay/client/models/body_create_product.py +0 -98
  154. crypticorn/pay/client/models/body_get_products.py +0 -87
  155. crypticorn/pay/client/models/body_handle_now_webhook.py +0 -98
  156. crypticorn/pay/client/models/body_update_product.py +0 -98
  157. crypticorn/pay/client/models/combined_payment_history.py +0 -101
  158. crypticorn/pay/client/models/create_invoice_req.py +0 -188
  159. crypticorn/pay/client/models/create_invoice_res.py +0 -188
  160. crypticorn/pay/client/models/currency.py +0 -165
  161. crypticorn/pay/client/models/estimate_price_req.py +0 -91
  162. crypticorn/pay/client/models/estimate_price_res.py +0 -102
  163. crypticorn/pay/client/models/get_currencies_res.py +0 -99
  164. crypticorn/pay/client/models/get_payment_status_res.py +0 -222
  165. crypticorn/pay/client/models/get_payments_list_res.py +0 -109
  166. crypticorn/pay/client/models/http_validation_error.py +0 -99
  167. crypticorn/pay/client/models/min_amount_req.py +0 -124
  168. crypticorn/pay/client/models/min_amount_res.py +0 -105
  169. crypticorn/pay/client/models/now_api_status_res.py +0 -83
  170. crypticorn/pay/client/models/now_fee_structure.py +0 -104
  171. crypticorn/pay/client/models/now_payment_model.py +0 -124
  172. crypticorn/pay/client/models/now_payment_status.py +0 -42
  173. crypticorn/pay/client/models/now_webhook_payload.py +0 -181
  174. crypticorn/pay/client/models/partial_product_update_model.py +0 -150
  175. crypticorn/pay/client/models/product.py +0 -87
  176. crypticorn/pay/client/models/product_model.py +0 -128
  177. crypticorn/pay/client/models/product_subs_model.py +0 -108
  178. crypticorn/pay/client/models/product_update_model.py +0 -150
  179. crypticorn/pay/client/models/unified_payment_model.py +0 -112
  180. crypticorn/pay/client/models/validation_error.py +0 -105
  181. crypticorn/pay/client/models/validation_error_loc_inner.py +0 -159
  182. crypticorn/trade/client/models/api_key_model.py +0 -156
  183. crypticorn/trade/client/models/exchange.py +0 -35
  184. crypticorn/trade/client/models/http_validation_error.py +0 -99
  185. crypticorn/trade/client/models/market_type.py +0 -35
  186. crypticorn/trade/client/models/validation_error.py +0 -105
  187. crypticorn/trade/client/models/validation_error_loc_inner.py +0 -159
  188. crypticorn-2.5.1.dist-info/RECORD +0 -307
  189. {crypticorn-2.5.1.dist-info → crypticorn-2.5.3.dist-info}/WHEEL +0 -0
  190. {crypticorn-2.5.1.dist-info → crypticorn-2.5.3.dist-info}/entry_points.txt +0 -0
  191. {crypticorn-2.5.1.dist-info → crypticorn-2.5.3.dist-info}/top_level.txt +0 -0
@@ -1,114 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Klines Service API
5
-
6
- API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
-
8
- The version of the OpenAPI document: 1.0.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 datetime import datetime
21
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from crypticorn.klines.client.models.health_check_response import HealthCheckResponse
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
-
28
- class BaseResponseHealthCheckResponse(BaseModel):
29
- """
30
- BaseResponseHealthCheckResponse
31
- """ # noqa: E501
32
-
33
- success: Optional[StrictBool] = True
34
- message: Optional[StrictStr] = None
35
- data: Optional[HealthCheckResponse] = None
36
- timestamp: Optional[datetime] = None
37
- __properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
38
-
39
- model_config = ConfigDict(
40
- populate_by_name=True,
41
- validate_assignment=True,
42
- protected_namespaces=(),
43
- )
44
-
45
- def to_str(self) -> str:
46
- """Returns the string representation of the model using alias"""
47
- return pprint.pformat(self.model_dump(by_alias=True))
48
-
49
- def to_json(self) -> str:
50
- """Returns the JSON representation of the model using alias"""
51
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
- return json.dumps(self.to_dict())
53
-
54
- @classmethod
55
- def from_json(cls, json_str: str) -> Optional[Self]:
56
- """Create an instance of BaseResponseHealthCheckResponse from a JSON string"""
57
- return cls.from_dict(json.loads(json_str))
58
-
59
- def to_dict(self) -> Dict[str, Any]:
60
- """Return the dictionary representation of the model using alias.
61
-
62
- This has the following differences from calling pydantic's
63
- `self.model_dump(by_alias=True)`:
64
-
65
- * `None` is only added to the output dict for nullable fields that
66
- were set at model initialization. Other fields with value `None`
67
- are ignored.
68
- """
69
- excluded_fields: Set[str] = set([])
70
-
71
- _dict = self.model_dump(
72
- by_alias=True,
73
- exclude=excluded_fields,
74
- exclude_none=True,
75
- )
76
- # override the default output from pydantic by calling `to_dict()` of data
77
- if self.data:
78
- _dict["data"] = self.data.to_dict()
79
- # set to None if message (nullable) is None
80
- # and model_fields_set contains the field
81
- if self.message is None and "message" in self.model_fields_set:
82
- _dict["message"] = None
83
-
84
- # set to None if data (nullable) is None
85
- # and model_fields_set contains the field
86
- if self.data is None and "data" in self.model_fields_set:
87
- _dict["data"] = None
88
-
89
- return _dict
90
-
91
- @classmethod
92
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
- """Create an instance of BaseResponseHealthCheckResponse 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
- "success": (
103
- obj.get("success") if obj.get("success") is not None else True
104
- ),
105
- "message": obj.get("message"),
106
- "data": (
107
- HealthCheckResponse.from_dict(obj["data"])
108
- if obj.get("data") is not None
109
- else None
110
- ),
111
- "timestamp": obj.get("timestamp"),
112
- }
113
- )
114
- return _obj
@@ -1,123 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Klines Service API
5
-
6
- API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
-
8
- The version of the OpenAPI document: 1.0.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 datetime import datetime
21
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from crypticorn.klines.client.models.change_in_timeframe_response import (
24
- ChangeInTimeframeResponse,
25
- )
26
- from typing import Optional, Set
27
- from typing_extensions import Self
28
-
29
-
30
- class BaseResponseListChangeInTimeframeResponse(BaseModel):
31
- """
32
- BaseResponseListChangeInTimeframeResponse
33
- """ # noqa: E501
34
-
35
- success: Optional[StrictBool] = True
36
- message: Optional[StrictStr] = None
37
- data: Optional[List[ChangeInTimeframeResponse]] = None
38
- timestamp: Optional[datetime] = None
39
- __properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
40
-
41
- model_config = ConfigDict(
42
- populate_by_name=True,
43
- validate_assignment=True,
44
- protected_namespaces=(),
45
- )
46
-
47
- def to_str(self) -> str:
48
- """Returns the string representation of the model using alias"""
49
- return pprint.pformat(self.model_dump(by_alias=True))
50
-
51
- def to_json(self) -> str:
52
- """Returns the JSON representation of the model using alias"""
53
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
- return json.dumps(self.to_dict())
55
-
56
- @classmethod
57
- def from_json(cls, json_str: str) -> Optional[Self]:
58
- """Create an instance of BaseResponseListChangeInTimeframeResponse from a JSON string"""
59
- return cls.from_dict(json.loads(json_str))
60
-
61
- def to_dict(self) -> Dict[str, Any]:
62
- """Return the dictionary representation of the model using alias.
63
-
64
- This has the following differences from calling pydantic's
65
- `self.model_dump(by_alias=True)`:
66
-
67
- * `None` is only added to the output dict for nullable fields that
68
- were set at model initialization. Other fields with value `None`
69
- are ignored.
70
- """
71
- excluded_fields: Set[str] = set([])
72
-
73
- _dict = self.model_dump(
74
- by_alias=True,
75
- exclude=excluded_fields,
76
- exclude_none=True,
77
- )
78
- # override the default output from pydantic by calling `to_dict()` of each item in data (list)
79
- _items = []
80
- if self.data:
81
- for _item_data in self.data:
82
- if _item_data:
83
- _items.append(_item_data.to_dict())
84
- _dict["data"] = _items
85
- # set to None if message (nullable) is None
86
- # and model_fields_set contains the field
87
- if self.message is None and "message" in self.model_fields_set:
88
- _dict["message"] = None
89
-
90
- # set to None if data (nullable) is None
91
- # and model_fields_set contains the field
92
- if self.data is None and "data" in self.model_fields_set:
93
- _dict["data"] = None
94
-
95
- return _dict
96
-
97
- @classmethod
98
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
99
- """Create an instance of BaseResponseListChangeInTimeframeResponse from a dict"""
100
- if obj is None:
101
- return None
102
-
103
- if not isinstance(obj, dict):
104
- return cls.model_validate(obj)
105
-
106
- _obj = cls.model_validate(
107
- {
108
- "success": (
109
- obj.get("success") if obj.get("success") is not None else True
110
- ),
111
- "message": obj.get("message"),
112
- "data": (
113
- [
114
- ChangeInTimeframeResponse.from_dict(_item)
115
- for _item in obj["data"]
116
- ]
117
- if obj.get("data") is not None
118
- else None
119
- ),
120
- "timestamp": obj.get("timestamp"),
121
- }
122
- )
123
- return _obj
@@ -1,118 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Klines Service API
5
-
6
- API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
-
8
- The version of the OpenAPI document: 1.0.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 datetime import datetime
21
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from crypticorn.klines.client.models.funding_rate_response import FundingRateResponse
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
-
28
- class BaseResponseListFundingRateResponse(BaseModel):
29
- """
30
- BaseResponseListFundingRateResponse
31
- """ # noqa: E501
32
-
33
- success: Optional[StrictBool] = True
34
- message: Optional[StrictStr] = None
35
- data: Optional[List[FundingRateResponse]] = None
36
- timestamp: Optional[datetime] = None
37
- __properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
38
-
39
- model_config = ConfigDict(
40
- populate_by_name=True,
41
- validate_assignment=True,
42
- protected_namespaces=(),
43
- )
44
-
45
- def to_str(self) -> str:
46
- """Returns the string representation of the model using alias"""
47
- return pprint.pformat(self.model_dump(by_alias=True))
48
-
49
- def to_json(self) -> str:
50
- """Returns the JSON representation of the model using alias"""
51
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
- return json.dumps(self.to_dict())
53
-
54
- @classmethod
55
- def from_json(cls, json_str: str) -> Optional[Self]:
56
- """Create an instance of BaseResponseListFundingRateResponse from a JSON string"""
57
- return cls.from_dict(json.loads(json_str))
58
-
59
- def to_dict(self) -> Dict[str, Any]:
60
- """Return the dictionary representation of the model using alias.
61
-
62
- This has the following differences from calling pydantic's
63
- `self.model_dump(by_alias=True)`:
64
-
65
- * `None` is only added to the output dict for nullable fields that
66
- were set at model initialization. Other fields with value `None`
67
- are ignored.
68
- """
69
- excluded_fields: Set[str] = set([])
70
-
71
- _dict = self.model_dump(
72
- by_alias=True,
73
- exclude=excluded_fields,
74
- exclude_none=True,
75
- )
76
- # override the default output from pydantic by calling `to_dict()` of each item in data (list)
77
- _items = []
78
- if self.data:
79
- for _item_data in self.data:
80
- if _item_data:
81
- _items.append(_item_data.to_dict())
82
- _dict["data"] = _items
83
- # set to None if message (nullable) is None
84
- # and model_fields_set contains the field
85
- if self.message is None and "message" in self.model_fields_set:
86
- _dict["message"] = None
87
-
88
- # set to None if data (nullable) is None
89
- # and model_fields_set contains the field
90
- if self.data is None and "data" in self.model_fields_set:
91
- _dict["data"] = None
92
-
93
- return _dict
94
-
95
- @classmethod
96
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97
- """Create an instance of BaseResponseListFundingRateResponse from a dict"""
98
- if obj is None:
99
- return None
100
-
101
- if not isinstance(obj, dict):
102
- return cls.model_validate(obj)
103
-
104
- _obj = cls.model_validate(
105
- {
106
- "success": (
107
- obj.get("success") if obj.get("success") is not None else True
108
- ),
109
- "message": obj.get("message"),
110
- "data": (
111
- [FundingRateResponse.from_dict(_item) for _item in obj["data"]]
112
- if obj.get("data") is not None
113
- else None
114
- ),
115
- "timestamp": obj.get("timestamp"),
116
- }
117
- )
118
- return _obj
@@ -1,106 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Klines Service API
5
-
6
- API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
-
8
- The version of the OpenAPI document: 1.0.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 datetime import datetime
21
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
-
26
-
27
- class BaseResponseListStr(BaseModel):
28
- """
29
- BaseResponseListStr
30
- """ # noqa: E501
31
-
32
- success: Optional[StrictBool] = True
33
- message: Optional[StrictStr] = None
34
- data: Optional[List[StrictStr]] = None
35
- timestamp: Optional[datetime] = None
36
- __properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
37
-
38
- model_config = ConfigDict(
39
- populate_by_name=True,
40
- validate_assignment=True,
41
- protected_namespaces=(),
42
- )
43
-
44
- def to_str(self) -> str:
45
- """Returns the string representation of the model using alias"""
46
- return pprint.pformat(self.model_dump(by_alias=True))
47
-
48
- def to_json(self) -> str:
49
- """Returns the JSON representation of the model using alias"""
50
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
- return json.dumps(self.to_dict())
52
-
53
- @classmethod
54
- def from_json(cls, json_str: str) -> Optional[Self]:
55
- """Create an instance of BaseResponseListStr from a JSON string"""
56
- return cls.from_dict(json.loads(json_str))
57
-
58
- def to_dict(self) -> Dict[str, Any]:
59
- """Return the dictionary representation of the model using alias.
60
-
61
- This has the following differences from calling pydantic's
62
- `self.model_dump(by_alias=True)`:
63
-
64
- * `None` is only added to the output dict for nullable fields that
65
- were set at model initialization. Other fields with value `None`
66
- are ignored.
67
- """
68
- excluded_fields: Set[str] = set([])
69
-
70
- _dict = self.model_dump(
71
- by_alias=True,
72
- exclude=excluded_fields,
73
- exclude_none=True,
74
- )
75
- # set to None if message (nullable) is None
76
- # and model_fields_set contains the field
77
- if self.message is None and "message" in self.model_fields_set:
78
- _dict["message"] = None
79
-
80
- # set to None if data (nullable) is None
81
- # and model_fields_set contains the field
82
- if self.data is None and "data" in self.model_fields_set:
83
- _dict["data"] = None
84
-
85
- return _dict
86
-
87
- @classmethod
88
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
- """Create an instance of BaseResponseListStr from a dict"""
90
- if obj is None:
91
- return None
92
-
93
- if not isinstance(obj, dict):
94
- return cls.model_validate(obj)
95
-
96
- _obj = cls.model_validate(
97
- {
98
- "success": (
99
- obj.get("success") if obj.get("success") is not None else True
100
- ),
101
- "message": obj.get("message"),
102
- "data": obj.get("data"),
103
- "timestamp": obj.get("timestamp"),
104
- }
105
- )
106
- return _obj
@@ -1,114 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Klines Service API
5
-
6
- API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
-
8
- The version of the OpenAPI document: 1.0.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 datetime import datetime
21
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from crypticorn.klines.client.models.ohlcv_response import OHLCVResponse
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
-
28
- class BaseResponseOHLCVResponse(BaseModel):
29
- """
30
- BaseResponseOHLCVResponse
31
- """ # noqa: E501
32
-
33
- success: Optional[StrictBool] = True
34
- message: Optional[StrictStr] = None
35
- data: Optional[OHLCVResponse] = None
36
- timestamp: Optional[datetime] = None
37
- __properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
38
-
39
- model_config = ConfigDict(
40
- populate_by_name=True,
41
- validate_assignment=True,
42
- protected_namespaces=(),
43
- )
44
-
45
- def to_str(self) -> str:
46
- """Returns the string representation of the model using alias"""
47
- return pprint.pformat(self.model_dump(by_alias=True))
48
-
49
- def to_json(self) -> str:
50
- """Returns the JSON representation of the model using alias"""
51
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
- return json.dumps(self.to_dict())
53
-
54
- @classmethod
55
- def from_json(cls, json_str: str) -> Optional[Self]:
56
- """Create an instance of BaseResponseOHLCVResponse from a JSON string"""
57
- return cls.from_dict(json.loads(json_str))
58
-
59
- def to_dict(self) -> Dict[str, Any]:
60
- """Return the dictionary representation of the model using alias.
61
-
62
- This has the following differences from calling pydantic's
63
- `self.model_dump(by_alias=True)`:
64
-
65
- * `None` is only added to the output dict for nullable fields that
66
- were set at model initialization. Other fields with value `None`
67
- are ignored.
68
- """
69
- excluded_fields: Set[str] = set([])
70
-
71
- _dict = self.model_dump(
72
- by_alias=True,
73
- exclude=excluded_fields,
74
- exclude_none=True,
75
- )
76
- # override the default output from pydantic by calling `to_dict()` of data
77
- if self.data:
78
- _dict["data"] = self.data.to_dict()
79
- # set to None if message (nullable) is None
80
- # and model_fields_set contains the field
81
- if self.message is None and "message" in self.model_fields_set:
82
- _dict["message"] = None
83
-
84
- # set to None if data (nullable) is None
85
- # and model_fields_set contains the field
86
- if self.data is None and "data" in self.model_fields_set:
87
- _dict["data"] = None
88
-
89
- return _dict
90
-
91
- @classmethod
92
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
- """Create an instance of BaseResponseOHLCVResponse 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
- "success": (
103
- obj.get("success") if obj.get("success") is not None else True
104
- ),
105
- "message": obj.get("message"),
106
- "data": (
107
- OHLCVResponse.from_dict(obj["data"])
108
- if obj.get("data") is not None
109
- else None
110
- ),
111
- "timestamp": obj.get("timestamp"),
112
- }
113
- )
114
- return _obj
@@ -1,86 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Klines Service API
5
-
6
- API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
-
8
- The version of the OpenAPI document: 1.0.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, StrictFloat, StrictInt, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Union
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
-
25
-
26
- class ChangeInTimeframeResponse(BaseModel):
27
- """
28
- ChangeInTimeframeResponse
29
- """ # noqa: E501
30
-
31
- pair: StrictStr
32
- change: Union[StrictFloat, StrictInt]
33
- __properties: ClassVar[List[str]] = ["pair", "change"]
34
-
35
- model_config = ConfigDict(
36
- populate_by_name=True,
37
- validate_assignment=True,
38
- protected_namespaces=(),
39
- )
40
-
41
- def to_str(self) -> str:
42
- """Returns the string representation of the model using alias"""
43
- return pprint.pformat(self.model_dump(by_alias=True))
44
-
45
- def to_json(self) -> str:
46
- """Returns the JSON representation of the model using alias"""
47
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
- return json.dumps(self.to_dict())
49
-
50
- @classmethod
51
- def from_json(cls, json_str: str) -> Optional[Self]:
52
- """Create an instance of ChangeInTimeframeResponse from a JSON string"""
53
- return cls.from_dict(json.loads(json_str))
54
-
55
- def to_dict(self) -> Dict[str, Any]:
56
- """Return the dictionary representation of the model using alias.
57
-
58
- This has the following differences from calling pydantic's
59
- `self.model_dump(by_alias=True)`:
60
-
61
- * `None` is only added to the output dict for nullable fields that
62
- were set at model initialization. Other fields with value `None`
63
- are ignored.
64
- """
65
- excluded_fields: Set[str] = set([])
66
-
67
- _dict = self.model_dump(
68
- by_alias=True,
69
- exclude=excluded_fields,
70
- exclude_none=True,
71
- )
72
- return _dict
73
-
74
- @classmethod
75
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
- """Create an instance of ChangeInTimeframeResponse from a dict"""
77
- if obj is None:
78
- return None
79
-
80
- if not isinstance(obj, dict):
81
- return cls.model_validate(obj)
82
-
83
- _obj = cls.model_validate(
84
- {"pair": obj.get("pair"), "change": obj.get("change")}
85
- )
86
- return _obj