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
@@ -3,7 +3,7 @@
3
3
  """
4
4
  Klines Service API
5
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\" } ```
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance.
7
7
 
8
8
  The version of the OpenAPI document: 1.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
@@ -18,25 +18,25 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from datetime import datetime
21
- from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
22
22
  from typing import Any, ClassVar, Dict, List, Union
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
26
 
27
- class OHLCVResponse(BaseModel):
27
+ class OHLCVHistory(BaseModel):
28
28
  """
29
- OHLCVResponse
29
+ OHLCVHistory
30
30
  """ # noqa: E501
31
31
 
32
- timestamp: List[datetime]
33
- open: List[Union[StrictFloat, StrictInt]]
34
- high: List[Union[StrictFloat, StrictInt]]
35
- low: List[Union[StrictFloat, StrictInt]]
36
- close: List[Union[StrictFloat, StrictInt]]
37
- volume: List[Union[StrictFloat, StrictInt]]
32
+ timestamps: List[datetime] = Field(description="Timestamps in seconds")
33
+ open: List[Union[StrictFloat, StrictInt]] = Field(description="Open prices")
34
+ high: List[Union[StrictFloat, StrictInt]] = Field(description="High prices")
35
+ low: List[Union[StrictFloat, StrictInt]] = Field(description="Low prices")
36
+ close: List[Union[StrictFloat, StrictInt]] = Field(description="Close prices")
37
+ volume: List[Union[StrictFloat, StrictInt]] = Field(description="Volume")
38
38
  __properties: ClassVar[List[str]] = [
39
- "timestamp",
39
+ "timestamps",
40
40
  "open",
41
41
  "high",
42
42
  "low",
@@ -61,7 +61,7 @@ class OHLCVResponse(BaseModel):
61
61
 
62
62
  @classmethod
63
63
  def from_json(cls, json_str: str) -> Optional[Self]:
64
- """Create an instance of OHLCVResponse from a JSON string"""
64
+ """Create an instance of OHLCVHistory from a JSON string"""
65
65
  return cls.from_dict(json.loads(json_str))
66
66
 
67
67
  def to_dict(self) -> Dict[str, Any]:
@@ -85,7 +85,7 @@ class OHLCVResponse(BaseModel):
85
85
 
86
86
  @classmethod
87
87
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
- """Create an instance of OHLCVResponse from a dict"""
88
+ """Create an instance of OHLCVHistory from a dict"""
89
89
  if obj is None:
90
90
  return None
91
91
 
@@ -94,7 +94,7 @@ class OHLCVResponse(BaseModel):
94
94
 
95
95
  _obj = cls.model_validate(
96
96
  {
97
- "timestamp": obj.get("timestamp"),
97
+ "timestamps": obj.get("timestamps"),
98
98
  "open": obj.get("open"),
99
99
  "high": obj.get("high"),
100
100
  "low": obj.get("low"),
@@ -3,7 +3,7 @@
3
3
  """
4
4
  Klines Service API
5
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\" } ```
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance.
7
7
 
8
8
  The version of the OpenAPI document: 1.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
@@ -3,7 +3,7 @@
3
3
  """
4
4
  Klines Service API
5
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\" } ```
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance.
7
7
 
8
8
  The version of the OpenAPI document: 1.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
@@ -17,21 +17,24 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, StrictStr
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
25
25
 
26
- class Exchange(BaseModel):
26
+ class SearchSymbol(BaseModel):
27
27
  """
28
- Exchange
28
+ SearchSymbol
29
29
  """ # noqa: E501
30
30
 
31
- value: StrictStr
32
- name: StrictStr
33
- desc: StrictStr
34
- __properties: ClassVar[List[str]] = ["value", "name", "desc"]
31
+ symbol: StrictStr
32
+ description: StrictStr
33
+ exchange: StrictStr = Field(
34
+ description="All exchanges we are using, including public (Exchange)"
35
+ )
36
+ type: StrictStr
37
+ __properties: ClassVar[List[str]] = ["symbol", "description", "exchange", "type"]
35
38
 
36
39
  model_config = ConfigDict(
37
40
  populate_by_name=True,
@@ -50,7 +53,7 @@ class Exchange(BaseModel):
50
53
 
51
54
  @classmethod
52
55
  def from_json(cls, json_str: str) -> Optional[Self]:
53
- """Create an instance of Exchange from a JSON string"""
56
+ """Create an instance of SearchSymbol from a JSON string"""
54
57
  return cls.from_dict(json.loads(json_str))
55
58
 
56
59
  def to_dict(self) -> Dict[str, Any]:
@@ -74,7 +77,7 @@ class Exchange(BaseModel):
74
77
 
75
78
  @classmethod
76
79
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
- """Create an instance of Exchange from a dict"""
80
+ """Create an instance of SearchSymbol from a dict"""
78
81
  if obj is None:
79
82
  return None
80
83
 
@@ -83,9 +86,10 @@ class Exchange(BaseModel):
83
86
 
84
87
  _obj = cls.model_validate(
85
88
  {
86
- "value": obj.get("value"),
87
- "name": obj.get("name"),
88
- "desc": obj.get("desc"),
89
+ "symbol": obj.get("symbol"),
90
+ "description": obj.get("description"),
91
+ "exchange": obj.get("exchange"),
92
+ "type": obj.get("type"),
89
93
  }
90
94
  )
91
95
  return _obj
@@ -3,7 +3,7 @@
3
3
  """
4
4
  Klines Service API
5
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\" } ```
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance.
7
7
 
8
8
  The version of the OpenAPI document: 1.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
@@ -3,7 +3,7 @@
3
3
  """
4
4
  Klines Service API
5
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\" } ```
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance.
7
7
 
8
8
  The version of the OpenAPI document: 1.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
@@ -23,9 +23,9 @@ from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
25
25
 
26
- class SymbolGroupResponse(BaseModel):
26
+ class SymbolGroup(BaseModel):
27
27
  """
28
- SymbolGroupResponse
28
+ SymbolGroup
29
29
  """ # noqa: E501
30
30
 
31
31
  symbol: Optional[List[StrictStr]] = None
@@ -48,7 +48,7 @@ class SymbolGroupResponse(BaseModel):
48
48
 
49
49
  @classmethod
50
50
  def from_json(cls, json_str: str) -> Optional[Self]:
51
- """Create an instance of SymbolGroupResponse from a JSON string"""
51
+ """Create an instance of SymbolGroup from a JSON string"""
52
52
  return cls.from_dict(json.loads(json_str))
53
53
 
54
54
  def to_dict(self) -> Dict[str, Any]:
@@ -72,7 +72,7 @@ class SymbolGroupResponse(BaseModel):
72
72
 
73
73
  @classmethod
74
74
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
- """Create an instance of SymbolGroupResponse from a dict"""
75
+ """Create an instance of SymbolGroup from a dict"""
76
76
  if obj is None:
77
77
  return None
78
78
 
@@ -3,7 +3,7 @@
3
3
  """
4
4
  Klines Service API
5
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\" } ```
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance.
7
7
 
8
8
  The version of the OpenAPI document: 1.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
@@ -23,9 +23,9 @@ from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
25
25
 
26
- class SymbolInfoResponse(BaseModel):
26
+ class SymbolInfo(BaseModel):
27
27
  """
28
- SymbolInfoResponse
28
+ SymbolInfo
29
29
  """ # noqa: E501
30
30
 
31
31
  name: StrictStr
@@ -78,7 +78,7 @@ class SymbolInfoResponse(BaseModel):
78
78
 
79
79
  @classmethod
80
80
  def from_json(cls, json_str: str) -> Optional[Self]:
81
- """Create an instance of SymbolInfoResponse from a JSON string"""
81
+ """Create an instance of SymbolInfo from a JSON string"""
82
82
  return cls.from_dict(json.loads(json_str))
83
83
 
84
84
  def to_dict(self) -> Dict[str, Any]:
@@ -102,7 +102,7 @@ class SymbolInfoResponse(BaseModel):
102
102
 
103
103
  @classmethod
104
104
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
105
- """Create an instance of SymbolInfoResponse from a dict"""
105
+ """Create an instance of SymbolInfo from a dict"""
106
106
  if obj is None:
107
107
  return None
108
108
 
@@ -3,7 +3,7 @@
3
3
  """
4
4
  Klines Service API
5
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\" } ```
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance.
7
7
 
8
8
  The version of the OpenAPI document: 1.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
@@ -3,7 +3,7 @@
3
3
  """
4
4
  Klines Service API
5
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\" } ```
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance.
7
7
 
8
8
  The version of the OpenAPI document: 1.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
@@ -3,7 +3,7 @@
3
3
  """
4
4
  Klines Service API
5
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\" } ```
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance.
7
7
 
8
8
  The version of the OpenAPI document: 1.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
@@ -19,15 +19,14 @@ import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
- from crypticorn.klines.client.models.exchange import Exchange
23
22
  from crypticorn.klines.client.models.symbol_type import SymbolType
24
23
  from typing import Optional, Set
25
24
  from typing_extensions import Self
26
25
 
27
26
 
28
- class UDFConfigResponse(BaseModel):
27
+ class UDFConfig(BaseModel):
29
28
  """
30
- UDFConfigResponse
29
+ UDFConfig
31
30
  """ # noqa: E501
32
31
 
33
32
  supported_resolutions: List[StrictStr]
@@ -36,7 +35,7 @@ class UDFConfigResponse(BaseModel):
36
35
  supports_search: Optional[StrictBool] = True
37
36
  supports_timescale_marks: Optional[StrictBool] = False
38
37
  supports_time: Optional[StrictBool] = True
39
- exchanges: List[Exchange]
38
+ exchanges: List[StrictStr]
40
39
  symbols_types: List[SymbolType]
41
40
  currency_codes: List[StrictStr]
42
41
  supported_markets: List[StrictStr]
@@ -70,7 +69,7 @@ class UDFConfigResponse(BaseModel):
70
69
 
71
70
  @classmethod
72
71
  def from_json(cls, json_str: str) -> Optional[Self]:
73
- """Create an instance of UDFConfigResponse from a JSON string"""
72
+ """Create an instance of UDFConfig from a JSON string"""
74
73
  return cls.from_dict(json.loads(json_str))
75
74
 
76
75
  def to_dict(self) -> Dict[str, Any]:
@@ -90,13 +89,6 @@ class UDFConfigResponse(BaseModel):
90
89
  exclude=excluded_fields,
91
90
  exclude_none=True,
92
91
  )
93
- # override the default output from pydantic by calling `to_dict()` of each item in exchanges (list)
94
- _items = []
95
- if self.exchanges:
96
- for _item_exchanges in self.exchanges:
97
- if _item_exchanges:
98
- _items.append(_item_exchanges.to_dict())
99
- _dict["exchanges"] = _items
100
92
  # override the default output from pydantic by calling `to_dict()` of each item in symbols_types (list)
101
93
  _items = []
102
94
  if self.symbols_types:
@@ -108,7 +100,7 @@ class UDFConfigResponse(BaseModel):
108
100
 
109
101
  @classmethod
110
102
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
111
- """Create an instance of UDFConfigResponse from a dict"""
103
+ """Create an instance of UDFConfig from a dict"""
112
104
  if obj is None:
113
105
  return None
114
106
 
@@ -143,11 +135,7 @@ class UDFConfigResponse(BaseModel):
143
135
  if obj.get("supports_time") is not None
144
136
  else True
145
137
  ),
146
- "exchanges": (
147
- [Exchange.from_dict(_item) for _item in obj["exchanges"]]
148
- if obj.get("exchanges") is not None
149
- else None
150
- ),
138
+ "exchanges": obj.get("exchanges"),
151
139
  "symbols_types": (
152
140
  [SymbolType.from_dict(_item) for _item in obj["symbols_types"]]
153
141
  if obj.get("symbols_types") is not None
@@ -3,7 +3,7 @@
3
3
  """
4
4
  Klines Service API
5
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\" } ```
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance.
7
7
 
8
8
  The version of the OpenAPI document: 1.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
crypticorn/klines/main.py CHANGED
@@ -3,7 +3,7 @@ from crypticorn.klines import (
3
3
  ApiClient,
4
4
  Configuration,
5
5
  FundingRatesApi,
6
- HealthCheckApi,
6
+ StatusApi,
7
7
  OHLCVDataApi,
8
8
  SymbolsApi,
9
9
  UDFApi,
@@ -16,10 +16,15 @@ class FundingRatesApiWrapper(FundingRatesApi):
16
16
  A wrapper for the FundingRatesApi class.
17
17
  """
18
18
 
19
- def get_funding_rates_fmt(self) -> pd.DataFrame:
19
+ async def get_funding_rates_fmt(self, *args, **kwargs) -> pd.DataFrame: # type: ignore
20
+ """
21
+ Get the funding rates in a pandas DataFrame.
22
+ """
20
23
  pd = optional_import("pandas", "extra")
21
- response = self.funding_rate_funding_rates_symbol_get()
22
- return pd.DataFrame(response.json())
24
+ response = await self.get_funding_rates_without_preload_content(*args, **kwargs)
25
+ response.raise_for_status()
26
+ json_data = await response.json()
27
+ return pd.DataFrame(json_data)
23
28
 
24
29
 
25
30
  class OHLCVDataApiWrapper(OHLCVDataApi):
@@ -27,10 +32,24 @@ class OHLCVDataApiWrapper(OHLCVDataApi):
27
32
  A wrapper for the OHLCVDataApi class.
28
33
  """
29
34
 
30
- def get_ohlcv_data_fmt(self) -> pd.DataFrame:
35
+ async def get_ohlcv_data_fmt(self, *args, **kwargs) -> pd.DataFrame: # type: ignore
36
+ """
37
+ Get the OHLCV data in a pandas DataFrame.
38
+ """
31
39
  pd = optional_import("pandas", "extra")
32
- response = self.get_ohlcv_market_timeframe_symbol_get()
33
- return pd.DataFrame(response.json())
40
+ response = await self.get_ohlcv_without_preload_content(*args, **kwargs)
41
+ response.raise_for_status()
42
+ json_data = await response.json()
43
+ return pd.DataFrame(
44
+ {
45
+ "timestamp": json_data["timestamp"],
46
+ "open": json_data["open"],
47
+ "high": json_data["high"],
48
+ "low": json_data["low"],
49
+ "close": json_data["close"],
50
+ "volume": json_data["volume"],
51
+ }
52
+ )
34
53
 
35
54
 
36
55
  class SymbolsApiWrapper(SymbolsApi):
@@ -38,21 +57,17 @@ class SymbolsApiWrapper(SymbolsApi):
38
57
  A wrapper for the SymbolsApi class.
39
58
  """
40
59
 
41
- def get_symbols_fmt(self) -> pd.DataFrame:
60
+ async def get_symbols_fmt(self, *args, **kwargs) -> pd.DataFrame: # type: ignore
61
+ """
62
+ Get the symbols in a pandas DataFrame.
63
+ """
42
64
  pd = optional_import("pandas", "extra")
43
- response = self.symbols_symbols_market_get()
44
- return pd.DataFrame(response.json())
45
-
46
-
47
- class UDFApiWrapper(UDFApi):
48
- """
49
- A wrapper for the UDFApi class.
50
- """
51
-
52
- def get_udf_fmt(self) -> pd.DataFrame:
53
- pd = optional_import("pandas", "extra")
54
- response = self.get_history_udf_history_get()
55
- return pd.DataFrame(response.json())
65
+ response = await self.get_klines_symbols_without_preload_content(
66
+ *args, **kwargs
67
+ )
68
+ response.raise_for_status()
69
+ json_data = await response.json()
70
+ return pd.DataFrame(json_data["data"], columns=["symbol"])
56
71
 
57
72
 
58
73
  class KlinesClient:
@@ -60,6 +75,8 @@ class KlinesClient:
60
75
  A client for interacting with the Crypticorn Klines API.
61
76
  """
62
77
 
78
+ config_class = Configuration
79
+
63
80
  def __init__(
64
81
  self,
65
82
  config: Configuration,
@@ -70,5 +87,5 @@ class KlinesClient:
70
87
  self.funding = FundingRatesApiWrapper(self.base_client)
71
88
  self.ohlcv = OHLCVDataApiWrapper(self.base_client)
72
89
  self.symbols = SymbolsApiWrapper(self.base_client)
73
- self.udf = UDFApiWrapper(self.base_client)
74
- self.health = HealthCheckApi(self.base_client)
90
+ self.udf = UDFApi(self.base_client)
91
+ self.status = StatusApi(self.base_client)
@@ -5,7 +5,7 @@
5
5
  """
6
6
  Marketcap Service API
7
7
 
8
- API for retrieving historical marketcap data, available exchanges, and indicators. ## Features - Historical marketcap data - OHLCV data with marketcap - Technical indicators (KER, SMA) - Exchange and symbol mappings - Error logs
8
+ API for retrieving historical marketcap data, available exchanges, and indicators.
9
9
 
10
10
  The version of the OpenAPI document: 1.0.0
11
11
  Generated by OpenAPI Generator (https://openapi-generator.tech)
@@ -18,11 +18,11 @@ __version__ = "1.0.0"
18
18
 
19
19
  # import apis into sdk package
20
20
  from crypticorn.metrics.client.api.exchanges_api import ExchangesApi
21
- from crypticorn.metrics.client.api.health_check_api import HealthCheckApi
22
21
  from crypticorn.metrics.client.api.indicators_api import IndicatorsApi
23
22
  from crypticorn.metrics.client.api.logs_api import LogsApi
24
23
  from crypticorn.metrics.client.api.marketcap_api import MarketcapApi
25
24
  from crypticorn.metrics.client.api.markets_api import MarketsApi
25
+ from crypticorn.metrics.client.api.status_api import StatusApi
26
26
  from crypticorn.metrics.client.api.tokens_api import TokensApi
27
27
 
28
28
  # import ApiClient
@@ -37,26 +37,7 @@ from crypticorn.metrics.client.exceptions import ApiAttributeError
37
37
  from crypticorn.metrics.client.exceptions import ApiException
38
38
 
39
39
  # import models into sdk package
40
- from crypticorn.metrics.client.models.base_response_dict import BaseResponseDict
41
- from crypticorn.metrics.client.models.base_response_health_check_response import (
42
- BaseResponseHealthCheckResponse,
43
- )
44
- from crypticorn.metrics.client.models.base_response_list_dict import (
45
- BaseResponseListDict,
46
- )
47
- from crypticorn.metrics.client.models.base_response_list_exchange_mapping import (
48
- BaseResponseListExchangeMapping,
49
- )
50
- from crypticorn.metrics.client.models.base_response_list_str import BaseResponseListStr
51
- from crypticorn.metrics.client.models.error_response import ErrorResponse
52
- from crypticorn.metrics.client.models.exchange_mapping import ExchangeMapping
53
- from crypticorn.metrics.client.models.http_validation_error import HTTPValidationError
54
- from crypticorn.metrics.client.models.health_check_response import HealthCheckResponse
55
- from crypticorn.metrics.client.models.market_type import MarketType
40
+ from crypticorn.metrics.client.models.exception_detail import ExceptionDetail
56
41
  from crypticorn.metrics.client.models.severity import Severity
57
42
  from crypticorn.metrics.client.models.time_interval import TimeInterval
58
43
  from crypticorn.metrics.client.models.trading_status import TradingStatus
59
- from crypticorn.metrics.client.models.validation_error import ValidationError
60
- from crypticorn.metrics.client.models.validation_error_loc_inner import (
61
- ValidationErrorLocInner,
62
- )
@@ -2,9 +2,9 @@
2
2
 
3
3
  # import apis into api package
4
4
  from crypticorn.metrics.client.api.exchanges_api import ExchangesApi
5
- from crypticorn.metrics.client.api.health_check_api import HealthCheckApi
6
5
  from crypticorn.metrics.client.api.indicators_api import IndicatorsApi
7
6
  from crypticorn.metrics.client.api.logs_api import LogsApi
8
7
  from crypticorn.metrics.client.api.marketcap_api import MarketcapApi
9
8
  from crypticorn.metrics.client.api.markets_api import MarketsApi
9
+ from crypticorn.metrics.client.api.status_api import StatusApi
10
10
  from crypticorn.metrics.client.api.tokens_api import TokensApi