crypticorn 1.0.2rc3__py3-none-any.whl → 2.0.0__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 (259) hide show
  1. crypticorn/__init__.py +3 -3
  2. crypticorn/auth/__init__.py +2 -0
  3. crypticorn/auth/client/__init__.py +112 -0
  4. crypticorn/auth/client/api/__init__.py +8 -0
  5. crypticorn/auth/client/api/admin_api.py +522 -0
  6. crypticorn/auth/client/api/auth_api.py +2089 -0
  7. crypticorn/auth/client/api/service_api.py +309 -0
  8. crypticorn/auth/client/api/user_api.py +2540 -0
  9. crypticorn/auth/client/api/wallet_api.py +1698 -0
  10. crypticorn/auth/client/api_client.py +758 -0
  11. crypticorn/auth/client/api_response.py +20 -0
  12. crypticorn/auth/client/configuration.py +584 -0
  13. crypticorn/auth/client/exceptions.py +220 -0
  14. crypticorn/auth/client/models/__init__.py +91 -0
  15. crypticorn/auth/client/models/add_wallet200_response.py +86 -0
  16. crypticorn/auth/client/models/add_wallet_request.py +107 -0
  17. crypticorn/auth/client/models/authorize_user200_response.py +107 -0
  18. crypticorn/auth/client/models/authorize_user200_response_auth.py +101 -0
  19. crypticorn/auth/client/models/authorize_user_request.py +96 -0
  20. crypticorn/auth/client/models/create_user_request.py +114 -0
  21. crypticorn/auth/client/models/list_wallets200_response.py +137 -0
  22. crypticorn/auth/client/models/list_wallets200_response_balances_inner.py +115 -0
  23. crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +115 -0
  24. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +168 -0
  25. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +191 -0
  26. crypticorn/auth/client/models/list_wallets200_response_data_inner.py +102 -0
  27. crypticorn/auth/client/models/list_wallets200_response_user_value.py +118 -0
  28. crypticorn/auth/client/models/logout_default_response.py +108 -0
  29. crypticorn/auth/client/models/logout_default_response_issues_inner.py +83 -0
  30. crypticorn/auth/client/models/refresh_token_info200_response.py +97 -0
  31. crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +105 -0
  32. crypticorn/auth/client/models/resend_verification_email_request.py +84 -0
  33. crypticorn/auth/client/models/revoke_user_tokens_request.py +83 -0
  34. crypticorn/auth/client/models/rotate_tokens200_response.py +110 -0
  35. crypticorn/auth/client/models/token_info200_response.py +97 -0
  36. crypticorn/auth/client/models/unlink_wallet_request.py +83 -0
  37. crypticorn/auth/client/models/update_user_request.py +93 -0
  38. crypticorn/auth/client/models/user_reset_password_request.py +87 -0
  39. crypticorn/auth/client/models/user_set_password_request.py +89 -0
  40. crypticorn/auth/client/models/verify200_response.py +110 -0
  41. crypticorn/auth/client/models/verify_email200_response.py +107 -0
  42. crypticorn/auth/client/models/verify_email200_response_auth.py +101 -0
  43. crypticorn/auth/client/models/verify_email200_response_auth_auth.py +110 -0
  44. crypticorn/auth/client/models/verify_email_request.py +83 -0
  45. crypticorn/auth/client/models/verify_wallet_request.py +91 -0
  46. crypticorn/auth/client/models/wallet_verified200_response.py +83 -0
  47. crypticorn/auth/client/models/whoami200_response.py +104 -0
  48. crypticorn/auth/client/rest.py +195 -0
  49. crypticorn/auth/main.py +45 -0
  50. crypticorn/client.py +46 -8
  51. crypticorn/common/__init__.py +5 -0
  52. crypticorn/common/auth.py +43 -0
  53. crypticorn/common/auth_client.py +163 -0
  54. crypticorn/common/errors.py +432 -0
  55. crypticorn/common/scopes.py +29 -0
  56. crypticorn/common/urls.py +25 -0
  57. crypticorn/hive/__init__.py +2 -1
  58. crypticorn/hive/client/__init__.py +57 -0
  59. crypticorn/hive/client/api/__init__.py +6 -0
  60. crypticorn/hive/client/api/data_api.py +594 -0
  61. crypticorn/hive/client/api/models_api.py +1680 -0
  62. crypticorn/hive/client/api/status_api.py +263 -0
  63. crypticorn/hive/client/api_client.py +758 -0
  64. crypticorn/hive/client/api_response.py +20 -0
  65. crypticorn/hive/client/configuration.py +612 -0
  66. crypticorn/hive/client/exceptions.py +220 -0
  67. crypticorn/hive/client/models/__init__.py +38 -0
  68. crypticorn/hive/client/models/coins.py +44 -0
  69. crypticorn/hive/client/models/data_download_response.py +113 -0
  70. crypticorn/hive/client/models/data_info.py +115 -0
  71. crypticorn/hive/client/models/data_value_value_value_inner.py +154 -0
  72. crypticorn/hive/client/models/data_version.py +35 -0
  73. crypticorn/hive/client/models/download_links.py +91 -0
  74. crypticorn/hive/client/models/evaluation.py +86 -0
  75. crypticorn/hive/client/models/evaluation_response.py +85 -0
  76. crypticorn/hive/client/models/feature_size.py +36 -0
  77. crypticorn/hive/client/models/http_validation_error.py +99 -0
  78. crypticorn/hive/client/models/model.py +133 -0
  79. crypticorn/hive/client/models/model_create.py +93 -0
  80. crypticorn/hive/client/models/model_status.py +35 -0
  81. crypticorn/hive/client/models/model_update.py +83 -0
  82. crypticorn/hive/client/models/target.py +36 -0
  83. crypticorn/hive/client/models/target_type.py +35 -0
  84. crypticorn/hive/client/models/validation_error.py +105 -0
  85. crypticorn/hive/client/models/validation_error_loc_inner.py +159 -0
  86. crypticorn/hive/client/py.typed +0 -0
  87. crypticorn/hive/client/rest.py +195 -0
  88. crypticorn/hive/main.py +27 -100
  89. crypticorn/klines/client/__init__.py +21 -7
  90. crypticorn/klines/client/api/__init__.py +0 -1
  91. crypticorn/klines/client/api/funding_rates_api.py +90 -79
  92. crypticorn/klines/client/api/health_check_api.py +29 -45
  93. crypticorn/klines/client/api/ohlcv_data_api.py +104 -87
  94. crypticorn/klines/client/api/symbols_api.py +36 -54
  95. crypticorn/klines/client/api/udf_api.py +228 -352
  96. crypticorn/klines/client/api_client.py +106 -148
  97. crypticorn/klines/client/api_response.py +2 -3
  98. crypticorn/klines/client/configuration.py +64 -50
  99. crypticorn/klines/client/exceptions.py +20 -16
  100. crypticorn/klines/client/models/__init__.py +21 -7
  101. crypticorn/klines/client/models/base_response_health_check_response.py +21 -15
  102. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +21 -15
  103. crypticorn/klines/client/models/base_response_list_str.py +16 -14
  104. crypticorn/klines/client/models/base_response_ohlcv_response.py +21 -15
  105. crypticorn/klines/client/models/error_response.py +23 -15
  106. crypticorn/klines/client/models/exchange.py +11 -11
  107. crypticorn/klines/client/models/funding_rate_response.py +11 -11
  108. crypticorn/klines/client/models/health_check_response.py +14 -12
  109. crypticorn/klines/client/models/history_error_response.py +11 -11
  110. crypticorn/klines/client/models/history_no_data_response.py +16 -16
  111. crypticorn/klines/client/models/history_success_response.py +16 -16
  112. crypticorn/klines/client/models/http_validation_error.py +14 -10
  113. crypticorn/klines/client/models/market.py +2 -4
  114. crypticorn/klines/client/models/ohlcv_response.py +22 -15
  115. crypticorn/klines/client/models/resolution.py +5 -7
  116. crypticorn/klines/client/models/response_get_history_udf_history_get.py +71 -22
  117. crypticorn/klines/client/models/search_symbol_response.py +22 -15
  118. crypticorn/klines/client/models/sort_direction.py +2 -4
  119. crypticorn/klines/client/models/symbol_group_response.py +5 -9
  120. crypticorn/klines/client/models/symbol_info_response.py +40 -24
  121. crypticorn/klines/client/models/symbol_type.py +5 -10
  122. crypticorn/klines/client/models/timeframe.py +5 -7
  123. crypticorn/klines/client/models/udf_config_response.py +60 -21
  124. crypticorn/klines/client/models/validation_error.py +19 -13
  125. crypticorn/klines/client/models/validation_error_loc_inner.py +32 -11
  126. crypticorn/klines/client/rest.py +30 -41
  127. crypticorn/klines/main.py +52 -15
  128. crypticorn/pay/__init__.py +2 -0
  129. crypticorn/pay/client/__init__.py +52 -0
  130. crypticorn/pay/client/api/__init__.py +7 -0
  131. crypticorn/pay/client/api/now_payments_api.py +813 -0
  132. crypticorn/pay/client/api/payments_api.py +799 -0
  133. crypticorn/pay/client/api/products_api.py +891 -0
  134. crypticorn/pay/client/api/status_api.py +260 -0
  135. crypticorn/pay/client/api_client.py +758 -0
  136. crypticorn/pay/client/api_response.py +20 -0
  137. crypticorn/pay/client/configuration.py +612 -0
  138. crypticorn/pay/client/exceptions.py +220 -0
  139. crypticorn/pay/client/models/__init__.py +32 -0
  140. crypticorn/pay/client/models/api_status_res.py +83 -0
  141. crypticorn/pay/client/models/combined_payment_history.py +101 -0
  142. crypticorn/pay/client/models/create_invoice_req.py +188 -0
  143. crypticorn/pay/client/models/create_invoice_res.py +188 -0
  144. crypticorn/pay/client/models/currency.py +165 -0
  145. crypticorn/pay/client/models/estimate_price_req.py +91 -0
  146. crypticorn/pay/client/models/estimate_price_res.py +102 -0
  147. crypticorn/pay/client/models/get_currencies_res.py +99 -0
  148. crypticorn/pay/client/models/get_payment_status_res.py +222 -0
  149. crypticorn/pay/client/models/get_payments_list_res.py +109 -0
  150. crypticorn/pay/client/models/http_validation_error.py +99 -0
  151. crypticorn/pay/client/models/min_amount_req.py +124 -0
  152. crypticorn/pay/client/models/min_amount_res.py +105 -0
  153. crypticorn/pay/client/models/now_api_status_res.py +83 -0
  154. crypticorn/pay/client/models/now_create_invoice_req.py +188 -0
  155. crypticorn/pay/client/models/now_create_invoice_res.py +188 -0
  156. crypticorn/pay/client/models/now_fee_structure.py +104 -0
  157. crypticorn/pay/client/models/now_payment_model.py +124 -0
  158. crypticorn/pay/client/models/now_payment_status.py +42 -0
  159. crypticorn/pay/client/models/now_webhook_payload.py +181 -0
  160. crypticorn/pay/client/models/payment.py +231 -0
  161. crypticorn/pay/client/models/payment_status.py +40 -0
  162. crypticorn/pay/client/models/product.py +87 -0
  163. crypticorn/pay/client/models/product_model.py +119 -0
  164. crypticorn/pay/client/models/product_subs_model.py +108 -0
  165. crypticorn/pay/client/models/services.py +34 -0
  166. crypticorn/pay/client/models/unified_payment_model.py +112 -0
  167. crypticorn/pay/client/models/validation_error.py +105 -0
  168. crypticorn/pay/client/models/validation_error_loc_inner.py +159 -0
  169. crypticorn/pay/client/py.typed +0 -0
  170. crypticorn/pay/client/rest.py +195 -0
  171. crypticorn/pay/main.py +35 -0
  172. crypticorn/trade/client/__init__.py +9 -4
  173. crypticorn/trade/client/api/__init__.py +0 -1
  174. crypticorn/trade/client/api/api_keys_api.py +203 -304
  175. crypticorn/trade/client/api/bots_api.py +177 -250
  176. crypticorn/trade/client/api/exchanges_api.py +38 -57
  177. crypticorn/trade/client/api/futures_trading_panel_api.py +223 -321
  178. crypticorn/trade/client/api/notifications_api.py +247 -364
  179. crypticorn/trade/client/api/orders_api.py +44 -63
  180. crypticorn/trade/client/api/status_api.py +35 -53
  181. crypticorn/trade/client/api/strategies_api.py +852 -64
  182. crypticorn/trade/client/api/trading_actions_api.py +126 -203
  183. crypticorn/trade/client/api_client.py +115 -154
  184. crypticorn/trade/client/api_response.py +2 -3
  185. crypticorn/trade/client/configuration.py +128 -90
  186. crypticorn/trade/client/exceptions.py +21 -17
  187. crypticorn/trade/client/models/__init__.py +9 -4
  188. crypticorn/trade/client/models/action_model.py +114 -50
  189. crypticorn/trade/client/models/api_error_identifier.py +60 -51
  190. crypticorn/trade/client/models/api_error_level.py +37 -0
  191. crypticorn/trade/client/models/api_error_type.py +37 -0
  192. crypticorn/trade/client/models/api_key_model.py +49 -28
  193. crypticorn/trade/client/models/bot_model.py +76 -31
  194. crypticorn/trade/client/models/bot_status.py +37 -0
  195. crypticorn/trade/client/models/exchange.py +3 -5
  196. crypticorn/trade/client/models/execution_ids.py +14 -14
  197. crypticorn/trade/client/models/futures_balance.py +39 -23
  198. crypticorn/trade/client/models/futures_trading_action.py +98 -46
  199. crypticorn/trade/client/models/http_validation_error.py +15 -11
  200. crypticorn/trade/client/models/margin_mode.py +3 -5
  201. crypticorn/trade/client/models/market_type.py +3 -5
  202. crypticorn/trade/client/models/notification_model.py +60 -27
  203. crypticorn/trade/client/models/notification_type.py +4 -6
  204. crypticorn/trade/client/models/order_model.py +125 -65
  205. crypticorn/trade/client/models/order_status.py +6 -8
  206. crypticorn/trade/client/models/post_futures_action.py +16 -12
  207. crypticorn/trade/client/models/strategy_exchange_info.py +11 -12
  208. crypticorn/trade/client/models/strategy_model.py +66 -27
  209. crypticorn/trade/client/models/strategy_model_input.py +160 -0
  210. crypticorn/trade/client/models/strategy_model_output.py +160 -0
  211. crypticorn/trade/client/models/tpsl.py +35 -21
  212. crypticorn/trade/client/models/trading_action_type.py +5 -7
  213. crypticorn/trade/client/models/update_notification.py +17 -13
  214. crypticorn/trade/client/models/validation_error.py +20 -14
  215. crypticorn/trade/client/models/validation_error_loc_inner.py +33 -12
  216. crypticorn/trade/client/rest.py +108 -170
  217. crypticorn/trade/main.py +26 -19
  218. crypticorn-2.0.0.dist-info/METADATA +74 -0
  219. crypticorn-2.0.0.dist-info/RECORD +226 -0
  220. {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/WHEEL +1 -1
  221. crypticorn/hive/requirements.txt +0 -4
  222. crypticorn/hive/utils.py +0 -109
  223. crypticorn/klines/requirements.txt +0 -4
  224. crypticorn/klines/test/test_base_response_health_check_response.py +0 -56
  225. crypticorn/klines/test/test_base_response_list_funding_rate_response.py +0 -59
  226. crypticorn/klines/test/test_base_response_list_str.py +0 -56
  227. crypticorn/klines/test/test_base_response_ohlcv_response.py +0 -72
  228. crypticorn/klines/test/test_error_response.py +0 -57
  229. crypticorn/klines/test/test_exchange.py +0 -56
  230. crypticorn/klines/test/test_funding_rate_response.py +0 -56
  231. crypticorn/klines/test/test_funding_rates_api.py +0 -38
  232. crypticorn/klines/test/test_health_check_api.py +0 -38
  233. crypticorn/klines/test/test_health_check_response.py +0 -52
  234. crypticorn/klines/test/test_history_error_response.py +0 -53
  235. crypticorn/klines/test/test_history_no_data_response.py +0 -69
  236. crypticorn/klines/test/test_history_success_response.py +0 -87
  237. crypticorn/klines/test/test_http_validation_error.py +0 -58
  238. crypticorn/klines/test/test_market.py +0 -33
  239. crypticorn/klines/test/test_ohlcv_data_api.py +0 -38
  240. crypticorn/klines/test/test_ohlcv_response.py +0 -86
  241. crypticorn/klines/test/test_resolution.py +0 -33
  242. crypticorn/klines/test/test_response_get_history_udf_history_get.py +0 -89
  243. crypticorn/klines/test/test_search_symbol_response.py +0 -62
  244. crypticorn/klines/test/test_sort_direction.py +0 -33
  245. crypticorn/klines/test/test_symbol_group_response.py +0 -53
  246. crypticorn/klines/test/test_symbol_info_response.py +0 -84
  247. crypticorn/klines/test/test_symbol_type.py +0 -54
  248. crypticorn/klines/test/test_symbols_api.py +0 -38
  249. crypticorn/klines/test/test_timeframe.py +0 -33
  250. crypticorn/klines/test/test_udf_api.py +0 -80
  251. crypticorn/klines/test/test_udf_config_response.py +0 -95
  252. crypticorn/klines/test/test_validation_error.py +0 -60
  253. crypticorn/klines/test/test_validation_error_loc_inner.py +0 -50
  254. crypticorn/trade/requirements.txt +0 -4
  255. crypticorn-1.0.2rc3.dist-info/LICENSE.md +0 -19
  256. crypticorn-1.0.2rc3.dist-info/METADATA +0 -47
  257. crypticorn-1.0.2rc3.dist-info/RECORD +0 -128
  258. /crypticorn/{klines/test/__init__.py → auth/client/py.typed} +0 -0
  259. {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/top_level.txt +0 -0
@@ -25,9 +25,16 @@ import urllib3
25
25
 
26
26
 
27
27
  JSON_SCHEMA_VALIDATION_KEYWORDS = {
28
- 'multipleOf', 'maximum', 'exclusiveMaximum',
29
- 'minimum', 'exclusiveMinimum', 'maxLength',
30
- 'minLength', 'pattern', 'maxItems', 'minItems'
28
+ "multipleOf",
29
+ "maximum",
30
+ "exclusiveMaximum",
31
+ "minimum",
32
+ "exclusiveMinimum",
33
+ "maxLength",
34
+ "minLength",
35
+ "pattern",
36
+ "maxItems",
37
+ "minItems",
31
38
  }
32
39
 
33
40
  ServerVariablesT = Dict[str, str]
@@ -112,8 +119,7 @@ HTTPSignatureAuthSetting = TypedDict(
112
119
 
113
120
  AuthSettings = TypedDict(
114
121
  "AuthSettings",
115
- {
116
- },
122
+ {},
117
123
  total=False,
118
124
  )
119
125
 
@@ -167,25 +173,26 @@ class Configuration:
167
173
 
168
174
  def __init__(
169
175
  self,
170
- host: Optional[str]=None,
171
- api_key: Optional[Dict[str, str]]=None,
172
- api_key_prefix: Optional[Dict[str, str]]=None,
173
- username: Optional[str]=None,
174
- password: Optional[str]=None,
175
- access_token: Optional[str]=None,
176
- server_index: Optional[int]=None,
177
- server_variables: Optional[ServerVariablesT]=None,
178
- server_operation_index: Optional[Dict[int, int]]=None,
179
- server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
180
- ignore_operation_servers: bool=False,
181
- ssl_ca_cert: Optional[str]=None,
176
+ host: Optional[str] = None,
177
+ api_key: Optional[Dict[str, str]] = None,
178
+ api_key_prefix: Optional[Dict[str, str]] = None,
179
+ username: Optional[str] = None,
180
+ password: Optional[str] = None,
181
+ access_token: Optional[str] = None,
182
+ server_index: Optional[int] = None,
183
+ server_variables: Optional[ServerVariablesT] = None,
184
+ server_operation_index: Optional[Dict[int, int]] = None,
185
+ server_operation_variables: Optional[Dict[int, ServerVariablesT]] = None,
186
+ ignore_operation_servers: bool = False,
187
+ ssl_ca_cert: Optional[str] = None,
182
188
  retries: Optional[int] = None,
183
189
  *,
184
190
  debug: Optional[bool] = None,
185
191
  ) -> None:
186
- """Constructor
187
- """
188
- self._base_path = "http://api.crypticorn.dev/v1/klines" if host is None else host
192
+ """Constructor"""
193
+ self._base_path = (
194
+ "https://api.crypticorn.dev/v1/klines" if host is None else host
195
+ )
189
196
  """Default Base url
190
197
  """
191
198
  self.server_index = 0 if server_index is None and host is None else server_index
@@ -230,7 +237,7 @@ class Configuration:
230
237
  """
231
238
  self.logger["package_logger"] = logging.getLogger("client")
232
239
  self.logger["urllib3_logger"] = logging.getLogger("urllib3")
233
- self.logger_format = '%(asctime)s %(levelname)s %(message)s'
240
+ self.logger_format = "%(asctime)s %(levelname)s %(message)s"
234
241
  """Log format
235
242
  """
236
243
  self.logger_stream_handler = None
@@ -285,7 +292,7 @@ class Configuration:
285
292
  self.proxy_headers = None
286
293
  """Proxy headers
287
294
  """
288
- self.safe_chars_for_path_param = ''
295
+ self.safe_chars_for_path_param = ""
289
296
  """Safe chars for path_param
290
297
  """
291
298
  self.retries = retries
@@ -306,12 +313,12 @@ class Configuration:
306
313
  """date format
307
314
  """
308
315
 
309
- def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
316
+ def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
310
317
  cls = self.__class__
311
318
  result = cls.__new__(cls)
312
319
  memo[id(self)] = result
313
320
  for k, v in self.__dict__.items():
314
- if k not in ('logger', 'logger_file_handler'):
321
+ if k not in ("logger", "logger_file_handler"):
315
322
  setattr(result, k, copy.deepcopy(v, memo))
316
323
  # shallow copy of loggers
317
324
  result.logger = copy.copy(self.logger)
@@ -443,7 +450,9 @@ class Configuration:
443
450
  self.__logger_format = value
444
451
  self.logger_formatter = logging.Formatter(self.__logger_format)
445
452
 
446
- def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
453
+ def get_api_key_with_prefix(
454
+ self, identifier: str, alias: Optional[str] = None
455
+ ) -> Optional[str]:
447
456
  """Gets API key (with prefix if set).
448
457
 
449
458
  :param identifier: The identifier of apiKey.
@@ -452,7 +461,9 @@ class Configuration:
452
461
  """
453
462
  if self.refresh_api_key_hook is not None:
454
463
  self.refresh_api_key_hook(self)
455
- key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
464
+ key = self.api_key.get(
465
+ identifier, self.api_key.get(alias) if alias is not None else None
466
+ )
456
467
  if key:
457
468
  prefix = self.api_key_prefix.get(identifier)
458
469
  if prefix:
@@ -473,11 +484,11 @@ class Configuration:
473
484
  password = ""
474
485
  if self.password is not None:
475
486
  password = self.password
476
- return urllib3.util.make_headers(
477
- basic_auth=username + ':' + password
478
- ).get('authorization')
487
+ return urllib3.util.make_headers(basic_auth=username + ":" + password).get(
488
+ "authorization"
489
+ )
479
490
 
480
- def auth_settings(self)-> AuthSettings:
491
+ def auth_settings(self) -> AuthSettings:
481
492
  """Gets Auth Settings dict for api client.
482
493
 
483
494
  :return: The Auth Settings information dict.
@@ -490,12 +501,13 @@ class Configuration:
490
501
 
491
502
  :return: The report for debugging.
492
503
  """
493
- return "Python SDK Debug Report:\n"\
494
- "OS: {env}\n"\
495
- "Python Version: {pyversion}\n"\
496
- "Version of the API: 1.0.0\n"\
497
- "SDK Package Version: 1.0.0".\
498
- format(env=sys.platform, pyversion=sys.version)
504
+ return (
505
+ "Python SDK Debug Report:\n"
506
+ "OS: {env}\n"
507
+ "Python Version: {pyversion}\n"
508
+ "Version of the API: 1.0.0\n"
509
+ "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version)
510
+ )
499
511
 
500
512
  def get_host_settings(self) -> List[HostSetting]:
501
513
  """Gets an array of host settings
@@ -504,16 +516,16 @@ class Configuration:
504
516
  """
505
517
  return [
506
518
  {
507
- 'url': "http://api.crypticorn.dev/v1/klines",
508
- 'description': "No description provided",
519
+ "url": "https://api.crypticorn.dev/v1/klines",
520
+ "description": "No description provided",
509
521
  }
510
522
  ]
511
523
 
512
524
  def get_host_from_settings(
513
525
  self,
514
526
  index: Optional[int],
515
- variables: Optional[ServerVariablesT]=None,
516
- servers: Optional[List[HostSetting]]=None,
527
+ variables: Optional[ServerVariablesT] = None,
528
+ servers: Optional[List[HostSetting]] = None,
517
529
  ) -> str:
518
530
  """Gets host URL based on the index and variables
519
531
  :param index: array index of the host settings
@@ -532,22 +544,22 @@ class Configuration:
532
544
  except IndexError:
533
545
  raise ValueError(
534
546
  "Invalid index {0} when selecting the host settings. "
535
- "Must be less than {1}".format(index, len(servers)))
547
+ "Must be less than {1}".format(index, len(servers))
548
+ )
536
549
 
537
- url = server['url']
550
+ url = server["url"]
538
551
 
539
552
  # go through variables and replace placeholders
540
- for variable_name, variable in server.get('variables', {}).items():
541
- used_value = variables.get(
542
- variable_name, variable['default_value'])
553
+ for variable_name, variable in server.get("variables", {}).items():
554
+ used_value = variables.get(variable_name, variable["default_value"])
543
555
 
544
- if 'enum_values' in variable \
545
- and used_value not in variable['enum_values']:
556
+ if "enum_values" in variable and used_value not in variable["enum_values"]:
546
557
  raise ValueError(
547
558
  "The variable `{0}` in the host URL has invalid value "
548
559
  "{1}. Must be {2}.".format(
549
- variable_name, variables[variable_name],
550
- variable['enum_values']))
560
+ variable_name, variables[variable_name], variable["enum_values"]
561
+ )
562
+ )
551
563
 
552
564
  url = url.replace("{" + variable_name + "}", used_value)
553
565
 
@@ -556,7 +568,9 @@ class Configuration:
556
568
  @property
557
569
  def host(self) -> str:
558
570
  """Return generated host."""
559
- return self.get_host_from_settings(self.server_index, variables=self.server_variables)
571
+ return self.get_host_from_settings(
572
+ self.server_index, variables=self.server_variables
573
+ )
560
574
 
561
575
  @host.setter
562
576
  def host(self, value: str) -> None:
@@ -14,14 +14,16 @@
14
14
  from typing import Any, Optional
15
15
  from typing_extensions import Self
16
16
 
17
+
17
18
  class OpenApiException(Exception):
18
19
  """The base exception class for all OpenAPIExceptions"""
19
20
 
20
21
 
21
22
  class ApiTypeError(OpenApiException, TypeError):
22
- def __init__(self, msg, path_to_item=None, valid_classes=None,
23
- key_type=None) -> None:
24
- """ Raises an exception for TypeErrors
23
+ def __init__(
24
+ self, msg, path_to_item=None, valid_classes=None, key_type=None
25
+ ) -> None:
26
+ """Raises an exception for TypeErrors
25
27
 
26
28
  Args:
27
29
  msg (str): the exception message
@@ -104,9 +106,9 @@ class ApiKeyError(OpenApiException, KeyError):
104
106
  class ApiException(OpenApiException):
105
107
 
106
108
  def __init__(
107
- self,
108
- status=None,
109
- reason=None,
109
+ self,
110
+ status=None,
111
+ reason=None,
110
112
  http_resp=None,
111
113
  *,
112
114
  body: Optional[str] = None,
@@ -125,17 +127,17 @@ class ApiException(OpenApiException):
125
127
  self.reason = http_resp.reason
126
128
  if self.body is None:
127
129
  try:
128
- self.body = http_resp.data.decode('utf-8')
130
+ self.body = http_resp.data.decode("utf-8")
129
131
  except Exception:
130
132
  pass
131
133
  self.headers = http_resp.getheaders()
132
134
 
133
135
  @classmethod
134
136
  def from_response(
135
- cls,
136
- *,
137
- http_resp,
138
- body: Optional[str],
137
+ cls,
138
+ *,
139
+ http_resp,
140
+ body: Optional[str],
139
141
  data: Optional[Any],
140
142
  ) -> Self:
141
143
  if http_resp.status == 400:
@@ -155,7 +157,9 @@ class ApiException(OpenApiException):
155
157
  raise ConflictException(http_resp=http_resp, body=body, data=data)
156
158
 
157
159
  if http_resp.status == 422:
158
- raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
160
+ raise UnprocessableEntityException(
161
+ http_resp=http_resp, body=body, data=data
162
+ )
159
163
 
160
164
  if 500 <= http_resp.status <= 599:
161
165
  raise ServiceException(http_resp=http_resp, body=body, data=data)
@@ -163,11 +167,9 @@ class ApiException(OpenApiException):
163
167
 
164
168
  def __str__(self):
165
169
  """Custom error messages for exception"""
166
- error_message = "({0})\n"\
167
- "Reason: {1}\n".format(self.status, self.reason)
170
+ error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason)
168
171
  if self.headers:
169
- error_message += "HTTP response headers: {0}\n".format(
170
- self.headers)
172
+ error_message += "HTTP response headers: {0}\n".format(self.headers)
171
173
 
172
174
  if self.data or self.body:
173
175
  error_message += "HTTP response body: {0}\n".format(self.data or self.body)
@@ -197,11 +199,13 @@ class ServiceException(ApiException):
197
199
 
198
200
  class ConflictException(ApiException):
199
201
  """Exception for HTTP 409 Conflict."""
202
+
200
203
  pass
201
204
 
202
205
 
203
206
  class UnprocessableEntityException(ApiException):
204
207
  """Exception for HTTP 422 Unprocessable Entity."""
208
+
205
209
  pass
206
210
 
207
211
 
@@ -14,22 +14,34 @@
14
14
 
15
15
 
16
16
  # import models into model package
17
- from crypticorn.klines.client.models.base_response_health_check_response import BaseResponseHealthCheckResponse
18
- from crypticorn.klines.client.models.base_response_list_funding_rate_response import BaseResponseListFundingRateResponse
17
+ from crypticorn.klines.client.models.base_response_health_check_response import (
18
+ BaseResponseHealthCheckResponse,
19
+ )
20
+ from crypticorn.klines.client.models.base_response_list_funding_rate_response import (
21
+ BaseResponseListFundingRateResponse,
22
+ )
19
23
  from crypticorn.klines.client.models.base_response_list_str import BaseResponseListStr
20
- from crypticorn.klines.client.models.base_response_ohlcv_response import BaseResponseOHLCVResponse
24
+ from crypticorn.klines.client.models.base_response_ohlcv_response import (
25
+ BaseResponseOHLCVResponse,
26
+ )
21
27
  from crypticorn.klines.client.models.error_response import ErrorResponse
22
28
  from crypticorn.klines.client.models.exchange import Exchange
23
29
  from crypticorn.klines.client.models.funding_rate_response import FundingRateResponse
24
30
  from crypticorn.klines.client.models.http_validation_error import HTTPValidationError
25
31
  from crypticorn.klines.client.models.health_check_response import HealthCheckResponse
26
32
  from crypticorn.klines.client.models.history_error_response import HistoryErrorResponse
27
- from crypticorn.klines.client.models.history_no_data_response import HistoryNoDataResponse
28
- from crypticorn.klines.client.models.history_success_response import HistorySuccessResponse
33
+ from crypticorn.klines.client.models.history_no_data_response import (
34
+ HistoryNoDataResponse,
35
+ )
36
+ from crypticorn.klines.client.models.history_success_response import (
37
+ HistorySuccessResponse,
38
+ )
29
39
  from crypticorn.klines.client.models.market import Market
30
40
  from crypticorn.klines.client.models.ohlcv_response import OHLCVResponse
31
41
  from crypticorn.klines.client.models.resolution import Resolution
32
- from crypticorn.klines.client.models.response_get_history_udf_history_get import ResponseGetHistoryUdfHistoryGet
42
+ from crypticorn.klines.client.models.response_get_history_udf_history_get import (
43
+ ResponseGetHistoryUdfHistoryGet,
44
+ )
33
45
  from crypticorn.klines.client.models.search_symbol_response import SearchSymbolResponse
34
46
  from crypticorn.klines.client.models.sort_direction import SortDirection
35
47
  from crypticorn.klines.client.models.symbol_group_response import SymbolGroupResponse
@@ -38,4 +50,6 @@ from crypticorn.klines.client.models.symbol_type import SymbolType
38
50
  from crypticorn.klines.client.models.timeframe import Timeframe
39
51
  from crypticorn.klines.client.models.udf_config_response import UDFConfigResponse
40
52
  from crypticorn.klines.client.models.validation_error import ValidationError
41
- from crypticorn.klines.client.models.validation_error_loc_inner import ValidationErrorLocInner
53
+ from crypticorn.klines.client.models.validation_error_loc_inner import (
54
+ ValidationErrorLocInner,
55
+ )
@@ -24,10 +24,12 @@ from crypticorn.klines.client.models.health_check_response import HealthCheckRes
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
 
27
+
27
28
  class BaseResponseHealthCheckResponse(BaseModel):
28
29
  """
29
30
  BaseResponseHealthCheckResponse
30
- """ # noqa: E501
31
+ """ # noqa: E501
32
+
31
33
  success: Optional[StrictBool] = True
32
34
  message: Optional[StrictStr] = None
33
35
  data: Optional[HealthCheckResponse] = None
@@ -40,7 +42,6 @@ class BaseResponseHealthCheckResponse(BaseModel):
40
42
  protected_namespaces=(),
41
43
  )
42
44
 
43
-
44
45
  def to_str(self) -> str:
45
46
  """Returns the string representation of the model using alias"""
46
47
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -65,8 +66,7 @@ class BaseResponseHealthCheckResponse(BaseModel):
65
66
  were set at model initialization. Other fields with value `None`
66
67
  are ignored.
67
68
  """
68
- excluded_fields: Set[str] = set([
69
- ])
69
+ excluded_fields: Set[str] = set([])
70
70
 
71
71
  _dict = self.model_dump(
72
72
  by_alias=True,
@@ -75,16 +75,16 @@ class BaseResponseHealthCheckResponse(BaseModel):
75
75
  )
76
76
  # override the default output from pydantic by calling `to_dict()` of data
77
77
  if self.data:
78
- _dict['data'] = self.data.to_dict()
78
+ _dict["data"] = self.data.to_dict()
79
79
  # set to None if message (nullable) is None
80
80
  # and model_fields_set contains the field
81
81
  if self.message is None and "message" in self.model_fields_set:
82
- _dict['message'] = None
82
+ _dict["message"] = None
83
83
 
84
84
  # set to None if data (nullable) is None
85
85
  # and model_fields_set contains the field
86
86
  if self.data is None and "data" in self.model_fields_set:
87
- _dict['data'] = None
87
+ _dict["data"] = None
88
88
 
89
89
  return _dict
90
90
 
@@ -97,12 +97,18 @@ class BaseResponseHealthCheckResponse(BaseModel):
97
97
  if not isinstance(obj, dict):
98
98
  return cls.model_validate(obj)
99
99
 
100
- _obj = cls.model_validate({
101
- "success": obj.get("success") if obj.get("success") is not None else True,
102
- "message": obj.get("message"),
103
- "data": HealthCheckResponse.from_dict(obj["data"]) if obj.get("data") is not None else None,
104
- "timestamp": obj.get("timestamp")
105
- })
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
+ )
106
114
  return _obj
107
-
108
-
@@ -24,10 +24,12 @@ from crypticorn.klines.client.models.funding_rate_response import FundingRateRes
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
 
27
+
27
28
  class BaseResponseListFundingRateResponse(BaseModel):
28
29
  """
29
30
  BaseResponseListFundingRateResponse
30
- """ # noqa: E501
31
+ """ # noqa: E501
32
+
31
33
  success: Optional[StrictBool] = True
32
34
  message: Optional[StrictStr] = None
33
35
  data: Optional[List[FundingRateResponse]] = None
@@ -40,7 +42,6 @@ class BaseResponseListFundingRateResponse(BaseModel):
40
42
  protected_namespaces=(),
41
43
  )
42
44
 
43
-
44
45
  def to_str(self) -> str:
45
46
  """Returns the string representation of the model using alias"""
46
47
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -65,8 +66,7 @@ class BaseResponseListFundingRateResponse(BaseModel):
65
66
  were set at model initialization. Other fields with value `None`
66
67
  are ignored.
67
68
  """
68
- excluded_fields: Set[str] = set([
69
- ])
69
+ excluded_fields: Set[str] = set([])
70
70
 
71
71
  _dict = self.model_dump(
72
72
  by_alias=True,
@@ -79,16 +79,16 @@ class BaseResponseListFundingRateResponse(BaseModel):
79
79
  for _item_data in self.data:
80
80
  if _item_data:
81
81
  _items.append(_item_data.to_dict())
82
- _dict['data'] = _items
82
+ _dict["data"] = _items
83
83
  # set to None if message (nullable) is None
84
84
  # and model_fields_set contains the field
85
85
  if self.message is None and "message" in self.model_fields_set:
86
- _dict['message'] = None
86
+ _dict["message"] = None
87
87
 
88
88
  # set to None if data (nullable) is None
89
89
  # and model_fields_set contains the field
90
90
  if self.data is None and "data" in self.model_fields_set:
91
- _dict['data'] = None
91
+ _dict["data"] = None
92
92
 
93
93
  return _dict
94
94
 
@@ -101,12 +101,18 @@ class BaseResponseListFundingRateResponse(BaseModel):
101
101
  if not isinstance(obj, dict):
102
102
  return cls.model_validate(obj)
103
103
 
104
- _obj = cls.model_validate({
105
- "success": obj.get("success") if obj.get("success") is not None else True,
106
- "message": obj.get("message"),
107
- "data": [FundingRateResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None,
108
- "timestamp": obj.get("timestamp")
109
- })
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
+ )
110
118
  return _obj
111
-
112
-
@@ -23,10 +23,12 @@ from typing import Any, ClassVar, Dict, List, Optional
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
+
26
27
  class BaseResponseListStr(BaseModel):
27
28
  """
28
29
  BaseResponseListStr
29
- """ # noqa: E501
30
+ """ # noqa: E501
31
+
30
32
  success: Optional[StrictBool] = True
31
33
  message: Optional[StrictStr] = None
32
34
  data: Optional[List[StrictStr]] = None
@@ -39,7 +41,6 @@ class BaseResponseListStr(BaseModel):
39
41
  protected_namespaces=(),
40
42
  )
41
43
 
42
-
43
44
  def to_str(self) -> str:
44
45
  """Returns the string representation of the model using alias"""
45
46
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -64,8 +65,7 @@ class BaseResponseListStr(BaseModel):
64
65
  were set at model initialization. Other fields with value `None`
65
66
  are ignored.
66
67
  """
67
- excluded_fields: Set[str] = set([
68
- ])
68
+ excluded_fields: Set[str] = set([])
69
69
 
70
70
  _dict = self.model_dump(
71
71
  by_alias=True,
@@ -75,12 +75,12 @@ class BaseResponseListStr(BaseModel):
75
75
  # set to None if message (nullable) is None
76
76
  # and model_fields_set contains the field
77
77
  if self.message is None and "message" in self.model_fields_set:
78
- _dict['message'] = None
78
+ _dict["message"] = None
79
79
 
80
80
  # set to None if data (nullable) is None
81
81
  # and model_fields_set contains the field
82
82
  if self.data is None and "data" in self.model_fields_set:
83
- _dict['data'] = None
83
+ _dict["data"] = None
84
84
 
85
85
  return _dict
86
86
 
@@ -93,12 +93,14 @@ class BaseResponseListStr(BaseModel):
93
93
  if not isinstance(obj, dict):
94
94
  return cls.model_validate(obj)
95
95
 
96
- _obj = cls.model_validate({
97
- "success": obj.get("success") if obj.get("success") is not None else True,
98
- "message": obj.get("message"),
99
- "data": obj.get("data"),
100
- "timestamp": obj.get("timestamp")
101
- })
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
+ )
102
106
  return _obj
103
-
104
-
@@ -24,10 +24,12 @@ from crypticorn.klines.client.models.ohlcv_response import OHLCVResponse
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
 
27
+
27
28
  class BaseResponseOHLCVResponse(BaseModel):
28
29
  """
29
30
  BaseResponseOHLCVResponse
30
- """ # noqa: E501
31
+ """ # noqa: E501
32
+
31
33
  success: Optional[StrictBool] = True
32
34
  message: Optional[StrictStr] = None
33
35
  data: Optional[OHLCVResponse] = None
@@ -40,7 +42,6 @@ class BaseResponseOHLCVResponse(BaseModel):
40
42
  protected_namespaces=(),
41
43
  )
42
44
 
43
-
44
45
  def to_str(self) -> str:
45
46
  """Returns the string representation of the model using alias"""
46
47
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -65,8 +66,7 @@ class BaseResponseOHLCVResponse(BaseModel):
65
66
  were set at model initialization. Other fields with value `None`
66
67
  are ignored.
67
68
  """
68
- excluded_fields: Set[str] = set([
69
- ])
69
+ excluded_fields: Set[str] = set([])
70
70
 
71
71
  _dict = self.model_dump(
72
72
  by_alias=True,
@@ -75,16 +75,16 @@ class BaseResponseOHLCVResponse(BaseModel):
75
75
  )
76
76
  # override the default output from pydantic by calling `to_dict()` of data
77
77
  if self.data:
78
- _dict['data'] = self.data.to_dict()
78
+ _dict["data"] = self.data.to_dict()
79
79
  # set to None if message (nullable) is None
80
80
  # and model_fields_set contains the field
81
81
  if self.message is None and "message" in self.model_fields_set:
82
- _dict['message'] = None
82
+ _dict["message"] = None
83
83
 
84
84
  # set to None if data (nullable) is None
85
85
  # and model_fields_set contains the field
86
86
  if self.data is None and "data" in self.model_fields_set:
87
- _dict['data'] = None
87
+ _dict["data"] = None
88
88
 
89
89
  return _dict
90
90
 
@@ -97,12 +97,18 @@ class BaseResponseOHLCVResponse(BaseModel):
97
97
  if not isinstance(obj, dict):
98
98
  return cls.model_validate(obj)
99
99
 
100
- _obj = cls.model_validate({
101
- "success": obj.get("success") if obj.get("success") is not None else True,
102
- "message": obj.get("message"),
103
- "data": OHLCVResponse.from_dict(obj["data"]) if obj.get("data") is not None else None,
104
- "timestamp": obj.get("timestamp")
105
- })
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
+ )
106
114
  return _obj
107
-
108
-