crypticorn 1.0.0__py3-none-any.whl → 1.0.2rc1__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 (160) hide show
  1. crypticorn/__init__.py +3 -3
  2. crypticorn/client.py +722 -0
  3. crypticorn/{api.py → hive/main.py} +6 -6
  4. crypticorn/hive/requirements.txt +4 -0
  5. crypticorn/{utils.py → hive/utils.py} +2 -2
  6. crypticorn/klines/client/__init__.py +62 -0
  7. crypticorn/klines/client/api/__init__.py +9 -0
  8. crypticorn/klines/client/api/funding_rates_api.py +362 -0
  9. crypticorn/klines/client/api/health_check_api.py +281 -0
  10. crypticorn/klines/client/api/ohlcv_data_api.py +409 -0
  11. crypticorn/klines/client/api/symbols_api.py +308 -0
  12. crypticorn/klines/client/api/udf_api.py +1929 -0
  13. crypticorn/klines/client/api_client.py +797 -0
  14. crypticorn/klines/client/api_response.py +21 -0
  15. crypticorn/klines/client/configuration.py +565 -0
  16. crypticorn/klines/client/exceptions.py +216 -0
  17. crypticorn/klines/client/models/__init__.py +41 -0
  18. crypticorn/klines/client/models/base_response_health_check_response.py +108 -0
  19. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +112 -0
  20. crypticorn/klines/client/models/base_response_list_str.py +104 -0
  21. crypticorn/klines/client/models/base_response_ohlcv_response.py +108 -0
  22. crypticorn/klines/client/models/error_response.py +101 -0
  23. crypticorn/klines/client/models/exchange.py +91 -0
  24. crypticorn/klines/client/models/funding_rate_response.py +92 -0
  25. crypticorn/klines/client/models/health_check_response.py +89 -0
  26. crypticorn/klines/client/models/history_error_response.py +89 -0
  27. crypticorn/klines/client/models/history_no_data_response.py +99 -0
  28. crypticorn/klines/client/models/history_success_response.py +99 -0
  29. crypticorn/klines/client/models/http_validation_error.py +95 -0
  30. crypticorn/klines/client/models/market.py +37 -0
  31. crypticorn/klines/client/models/ohlcv_response.py +98 -0
  32. crypticorn/klines/client/models/resolution.py +40 -0
  33. crypticorn/klines/client/models/response_get_history_udf_history_get.py +149 -0
  34. crypticorn/klines/client/models/search_symbol_response.py +97 -0
  35. crypticorn/klines/client/models/sort_direction.py +37 -0
  36. crypticorn/klines/client/models/symbol_group_response.py +87 -0
  37. crypticorn/klines/client/models/symbol_info_response.py +115 -0
  38. crypticorn/klines/client/models/symbol_type.py +89 -0
  39. crypticorn/klines/client/models/timeframe.py +40 -0
  40. crypticorn/klines/client/models/udf_config_response.py +121 -0
  41. crypticorn/klines/client/models/validation_error.py +99 -0
  42. crypticorn/klines/client/models/validation_error_loc_inner.py +138 -0
  43. crypticorn/klines/client/py.typed +0 -0
  44. crypticorn/klines/client/rest.py +257 -0
  45. crypticorn/klines/main.py +42 -0
  46. crypticorn/klines/requirements.txt +4 -0
  47. crypticorn/klines/test/__init__.py +0 -0
  48. crypticorn/klines/test/test_base_response_health_check_response.py +56 -0
  49. crypticorn/klines/test/test_base_response_list_funding_rate_response.py +59 -0
  50. crypticorn/klines/test/test_base_response_list_str.py +56 -0
  51. crypticorn/klines/test/test_base_response_ohlcv_response.py +72 -0
  52. crypticorn/klines/test/test_error_response.py +57 -0
  53. crypticorn/klines/test/test_exchange.py +56 -0
  54. crypticorn/klines/test/test_funding_rate_response.py +56 -0
  55. crypticorn/klines/test/test_funding_rates_api.py +38 -0
  56. crypticorn/klines/test/test_health_check_api.py +38 -0
  57. crypticorn/klines/test/test_health_check_response.py +52 -0
  58. crypticorn/klines/test/test_history_error_response.py +53 -0
  59. crypticorn/klines/test/test_history_no_data_response.py +69 -0
  60. crypticorn/klines/test/test_history_success_response.py +87 -0
  61. crypticorn/klines/test/test_http_validation_error.py +58 -0
  62. crypticorn/klines/test/test_market.py +33 -0
  63. crypticorn/klines/test/test_ohlcv_data_api.py +38 -0
  64. crypticorn/klines/test/test_ohlcv_response.py +86 -0
  65. crypticorn/klines/test/test_resolution.py +33 -0
  66. crypticorn/klines/test/test_response_get_history_udf_history_get.py +89 -0
  67. crypticorn/klines/test/test_search_symbol_response.py +62 -0
  68. crypticorn/klines/test/test_sort_direction.py +33 -0
  69. crypticorn/klines/test/test_symbol_group_response.py +53 -0
  70. crypticorn/klines/test/test_symbol_info_response.py +84 -0
  71. crypticorn/klines/test/test_symbol_type.py +54 -0
  72. crypticorn/klines/test/test_symbols_api.py +38 -0
  73. crypticorn/klines/test/test_timeframe.py +33 -0
  74. crypticorn/klines/test/test_udf_api.py +80 -0
  75. crypticorn/klines/test/test_udf_config_response.py +95 -0
  76. crypticorn/klines/test/test_validation_error.py +60 -0
  77. crypticorn/klines/test/test_validation_error_loc_inner.py +50 -0
  78. crypticorn/trade/client/__init__.py +63 -0
  79. crypticorn/trade/client/api/__init__.py +13 -0
  80. crypticorn/trade/client/api/api_keys_api.py +1468 -0
  81. crypticorn/trade/client/api/bots_api.py +1211 -0
  82. crypticorn/trade/client/api/exchanges_api.py +297 -0
  83. crypticorn/trade/client/api/futures_trading_panel_api.py +1463 -0
  84. crypticorn/trade/client/api/notifications_api.py +1767 -0
  85. crypticorn/trade/client/api/orders_api.py +331 -0
  86. crypticorn/trade/client/api/status_api.py +278 -0
  87. crypticorn/trade/client/api/strategies_api.py +331 -0
  88. crypticorn/trade/client/api/trading_actions_api.py +898 -0
  89. crypticorn/trade/client/api_client.py +797 -0
  90. crypticorn/trade/client/api_response.py +21 -0
  91. crypticorn/trade/client/configuration.py +574 -0
  92. crypticorn/trade/client/exceptions.py +216 -0
  93. crypticorn/trade/client/models/__init__.py +38 -0
  94. crypticorn/trade/client/models/action_model.py +202 -0
  95. crypticorn/trade/client/models/api_error_identifier.py +83 -0
  96. crypticorn/trade/client/models/api_key_model.py +135 -0
  97. crypticorn/trade/client/models/bot_model.py +122 -0
  98. crypticorn/trade/client/models/exchange.py +37 -0
  99. crypticorn/trade/client/models/execution_ids.py +91 -0
  100. crypticorn/trade/client/models/futures_balance.py +109 -0
  101. crypticorn/trade/client/models/futures_trading_action.py +198 -0
  102. crypticorn/trade/client/models/http_validation_error.py +95 -0
  103. crypticorn/trade/client/models/margin_mode.py +37 -0
  104. crypticorn/trade/client/models/market_type.py +37 -0
  105. crypticorn/trade/client/models/notification_model.py +113 -0
  106. crypticorn/trade/client/models/notification_type.py +39 -0
  107. crypticorn/trade/client/models/order_model.py +263 -0
  108. crypticorn/trade/client/models/order_status.py +40 -0
  109. crypticorn/trade/client/models/post_futures_action.py +93 -0
  110. crypticorn/trade/client/models/strategy_exchange_info.py +90 -0
  111. crypticorn/trade/client/models/strategy_model.py +119 -0
  112. crypticorn/trade/client/models/tpsl.py +116 -0
  113. crypticorn/trade/client/models/trading_action_type.py +39 -0
  114. crypticorn/trade/client/models/update_notification.py +91 -0
  115. crypticorn/trade/client/models/validation_error.py +99 -0
  116. crypticorn/trade/client/models/validation_error_loc_inner.py +138 -0
  117. crypticorn/trade/client/py.typed +0 -0
  118. crypticorn/trade/client/rest.py +257 -0
  119. crypticorn/trade/main.py +38 -0
  120. crypticorn/trade/requirements.txt +4 -0
  121. crypticorn/trade/test/__init__.py +0 -0
  122. crypticorn/trade/test/test_action_model.py +87 -0
  123. crypticorn/trade/test/test_api_error_identifier.py +33 -0
  124. crypticorn/trade/test/test_api_key_model.py +61 -0
  125. crypticorn/trade/test/test_api_keys_api.py +66 -0
  126. crypticorn/trade/test/test_bot_model.py +64 -0
  127. crypticorn/trade/test/test_bots_api.py +59 -0
  128. crypticorn/trade/test/test_exchange.py +33 -0
  129. crypticorn/trade/test/test_exchanges_api.py +38 -0
  130. crypticorn/trade/test/test_execution_ids.py +68 -0
  131. crypticorn/trade/test/test_futures_balance.py +62 -0
  132. crypticorn/trade/test/test_futures_trading_action.py +86 -0
  133. crypticorn/trade/test/test_futures_trading_panel_api.py +66 -0
  134. crypticorn/trade/test/test_http_validation_error.py +58 -0
  135. crypticorn/trade/test/test_margin_mode.py +33 -0
  136. crypticorn/trade/test/test_market_type.py +33 -0
  137. crypticorn/trade/test/test_notification_model.py +59 -0
  138. crypticorn/trade/test/test_notification_type.py +33 -0
  139. crypticorn/trade/test/test_notifications_api.py +73 -0
  140. crypticorn/trade/test/test_order_model.py +75 -0
  141. crypticorn/trade/test/test_order_status.py +33 -0
  142. crypticorn/trade/test/test_orders_api.py +38 -0
  143. crypticorn/trade/test/test_post_futures_action.py +72 -0
  144. crypticorn/trade/test/test_status_api.py +38 -0
  145. crypticorn/trade/test/test_strategies_api.py +38 -0
  146. crypticorn/trade/test/test_strategy_exchange_info.py +54 -0
  147. crypticorn/trade/test/test_strategy_model.py +73 -0
  148. crypticorn/trade/test/test_tpsl.py +56 -0
  149. crypticorn/trade/test/test_trading_action_type.py +33 -0
  150. crypticorn/trade/test/test_trading_actions_api.py +52 -0
  151. crypticorn/trade/test/test_update_notification.py +54 -0
  152. crypticorn/trade/test/test_validation_error.py +60 -0
  153. crypticorn/trade/test/test_validation_error_loc_inner.py +50 -0
  154. crypticorn-1.0.2rc1.dist-info/METADATA +47 -0
  155. crypticorn-1.0.2rc1.dist-info/RECORD +158 -0
  156. {crypticorn-1.0.0.dist-info → crypticorn-1.0.2rc1.dist-info}/WHEEL +1 -1
  157. crypticorn-1.0.0.dist-info/METADATA +0 -34
  158. crypticorn-1.0.0.dist-info/RECORD +0 -8
  159. {crypticorn-1.0.0.dist-info → crypticorn-1.0.2rc1.dist-info}/LICENSE.md +0 -0
  160. {crypticorn-1.0.0.dist-info → crypticorn-1.0.2rc1.dist-info}/top_level.txt +0 -0
@@ -2,23 +2,23 @@ from typing import Any
2
2
  import pandas as pd
3
3
  import requests
4
4
  import os
5
- from .utils import download_file, SingleModel, ModelEvaluation, DataInfo
5
+ from crypticorn.hive.utils import download_file, SingleModel, ModelEvaluation, DataInfo
6
6
 
7
7
 
8
- class Crypticorn:
8
+ class HiveClient:
9
9
  """
10
- A client for interacting with the crypticorn API, offering functionality to create and evaluate models,
10
+ A client for interacting with the Crypticorn Hive API, offering functionality to create and evaluate models,
11
11
  download data, and retrieve information about available coins, targets, and features.
12
12
  """
13
13
 
14
- def __init__(self, api_key: str, headers: dict = None, base_url='https://api.crypticorn.com'):
14
+ def __init__(self, base_url='https://api.crypticorn.com', api_key: str = None, jwt: str = None):
15
15
  """@private
16
- Initializes the crypticorn API client with an API key.
16
+ Initializes the Crypticorn Hive API client with an API key.
17
17
 
18
18
  :param api_key: The API key required for authenticating requests.
19
19
  """
20
20
  self._base_url = base_url + "/v1/hive"
21
- self._headers = headers if headers else {"Authorization": f"ApiKey {api_key}"}
21
+ self._headers = {"Authorization": f"ApiKey {api_key}"}
22
22
 
23
23
  def create_model(self, coin_id: int, target: str) -> SingleModel:
24
24
  """
@@ -0,0 +1,4 @@
1
+ pandas >= 2.2.0, < 3.0.0
2
+ requests >= 2.32.0, < 3.0.0
3
+ tqdm >= 4.67.0, < 5.0.0
4
+ pydantic >= 2.0.0, < 3.0.0
@@ -37,7 +37,7 @@ def download_file(url: str, dest_path: str, show_progress_bars: bool = True):
37
37
 
38
38
  if file_size < total_size:
39
39
  # Download incomplete
40
- logger.info(f" resuming download")
40
+ logger.info(" resuming download")
41
41
  resume_header = {'Range': f'bytes={file_size}-'}
42
42
  req = requests.get(url, headers=resume_header, stream=True,
43
43
  verify=False, allow_redirects=True, timeout=600)
@@ -48,7 +48,7 @@ def download_file(url: str, dest_path: str, show_progress_bars: bool = True):
48
48
  file_size = 0
49
49
  else:
50
50
  # File does not exist, starting download
51
- logger.info(f" starting download")
51
+ logger.info(" starting download")
52
52
 
53
53
  # write dataset to file and show progress bar
54
54
  pbar = tqdm.tqdm(total=total_size, unit='B', unit_scale=True,
@@ -0,0 +1,62 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ Klines Service API
7
+
8
+ 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\" } ```
9
+
10
+ The version of the OpenAPI document: 1.0.0
11
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
+
13
+ Do not edit the class manually.
14
+ """ # noqa: E501
15
+
16
+
17
+ __version__ = "1.0.0"
18
+
19
+ # import apis into sdk package
20
+ from crypticorn.klines.client.api.funding_rates_api import FundingRatesApi
21
+ from crypticorn.klines.client.api.health_check_api import HealthCheckApi
22
+ from crypticorn.klines.client.api.ohlcv_data_api import OHLCVDataApi
23
+ from crypticorn.klines.client.api.symbols_api import SymbolsApi
24
+ from crypticorn.klines.client.api.udf_api import UDFApi
25
+
26
+ # import ApiClient
27
+ from crypticorn.klines.client.api_response import ApiResponse
28
+ from crypticorn.klines.client.api_client import ApiClient
29
+ from crypticorn.klines.client.configuration import Configuration
30
+ from crypticorn.klines.client.exceptions import OpenApiException
31
+ from crypticorn.klines.client.exceptions import ApiTypeError
32
+ from crypticorn.klines.client.exceptions import ApiValueError
33
+ from crypticorn.klines.client.exceptions import ApiKeyError
34
+ from crypticorn.klines.client.exceptions import ApiAttributeError
35
+ from crypticorn.klines.client.exceptions import ApiException
36
+
37
+ # import models into sdk package
38
+ from crypticorn.klines.client.models.base_response_health_check_response import BaseResponseHealthCheckResponse
39
+ from crypticorn.klines.client.models.base_response_list_funding_rate_response import BaseResponseListFundingRateResponse
40
+ from crypticorn.klines.client.models.base_response_list_str import BaseResponseListStr
41
+ from crypticorn.klines.client.models.base_response_ohlcv_response import BaseResponseOHLCVResponse
42
+ from crypticorn.klines.client.models.error_response import ErrorResponse
43
+ from crypticorn.klines.client.models.exchange import Exchange
44
+ from crypticorn.klines.client.models.funding_rate_response import FundingRateResponse
45
+ from crypticorn.klines.client.models.http_validation_error import HTTPValidationError
46
+ from crypticorn.klines.client.models.health_check_response import HealthCheckResponse
47
+ from crypticorn.klines.client.models.history_error_response import HistoryErrorResponse
48
+ from crypticorn.klines.client.models.history_no_data_response import HistoryNoDataResponse
49
+ from crypticorn.klines.client.models.history_success_response import HistorySuccessResponse
50
+ from crypticorn.klines.client.models.market import Market
51
+ from crypticorn.klines.client.models.ohlcv_response import OHLCVResponse
52
+ from crypticorn.klines.client.models.resolution import Resolution
53
+ from crypticorn.klines.client.models.response_get_history_udf_history_get import ResponseGetHistoryUdfHistoryGet
54
+ from crypticorn.klines.client.models.search_symbol_response import SearchSymbolResponse
55
+ from crypticorn.klines.client.models.sort_direction import SortDirection
56
+ from crypticorn.klines.client.models.symbol_group_response import SymbolGroupResponse
57
+ from crypticorn.klines.client.models.symbol_info_response import SymbolInfoResponse
58
+ from crypticorn.klines.client.models.symbol_type import SymbolType
59
+ from crypticorn.klines.client.models.timeframe import Timeframe
60
+ from crypticorn.klines.client.models.udf_config_response import UDFConfigResponse
61
+ from crypticorn.klines.client.models.validation_error import ValidationError
62
+ from crypticorn.klines.client.models.validation_error_loc_inner import ValidationErrorLocInner
@@ -0,0 +1,9 @@
1
+ # flake8: noqa
2
+
3
+ # import apis into api package
4
+ from crypticorn.klines.client.api.funding_rates_api import FundingRatesApi
5
+ from crypticorn.klines.client.api.health_check_api import HealthCheckApi
6
+ from crypticorn.klines.client.api.ohlcv_data_api import OHLCVDataApi
7
+ from crypticorn.klines.client.api.symbols_api import SymbolsApi
8
+ from crypticorn.klines.client.api.udf_api import UDFApi
9
+
@@ -0,0 +1,362 @@
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
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictInt, StrictStr
20
+ from typing import Optional
21
+ from typing_extensions import Annotated
22
+ from crypticorn.klines.client.models.base_response_list_funding_rate_response import BaseResponseListFundingRateResponse
23
+
24
+ from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
25
+ from crypticorn.klines.client.api_response import ApiResponse
26
+ from crypticorn.klines.client.rest import RESTResponseType
27
+
28
+
29
+ class FundingRatesApi:
30
+ """NOTE: This class is auto generated by OpenAPI Generator
31
+ Ref: https://openapi-generator.tech
32
+
33
+ Do not edit the class manually.
34
+ """
35
+
36
+ def __init__(self, api_client=None) -> None:
37
+ if api_client is None:
38
+ api_client = ApiClient.get_default()
39
+ self.api_client = api_client
40
+
41
+
42
+ @validate_call
43
+ def funding_rate_funding_rates_symbol_get(
44
+ self,
45
+ symbol: Annotated[StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")],
46
+ start: Annotated[Optional[StrictInt], Field(description="Start timestamp in milliseconds")] = None,
47
+ end: Annotated[Optional[StrictInt], Field(description="End timestamp in milliseconds")] = None,
48
+ limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of funding rates to return")] = None,
49
+ _request_timeout: Union[
50
+ None,
51
+ Annotated[StrictFloat, Field(gt=0)],
52
+ Tuple[
53
+ Annotated[StrictFloat, Field(gt=0)],
54
+ Annotated[StrictFloat, Field(gt=0)]
55
+ ]
56
+ ] = None,
57
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
58
+ _content_type: Optional[StrictStr] = None,
59
+ _headers: Optional[Dict[StrictStr, Any]] = None,
60
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
61
+ ) -> BaseResponseListFundingRateResponse:
62
+ """Funding Rate
63
+
64
+ Retrieve funding rate data for a specific symbol in the futures market.
65
+
66
+ :param symbol: Trading pair symbol (e.g., BTCUSDT) (required)
67
+ :type symbol: str
68
+ :param start: Start timestamp in milliseconds
69
+ :type start: int
70
+ :param end: End timestamp in milliseconds
71
+ :type end: int
72
+ :param limit: Number of funding rates to return
73
+ :type limit: int
74
+ :param _request_timeout: timeout setting for this request. If one
75
+ number provided, it will be total request
76
+ timeout. It can also be a pair (tuple) of
77
+ (connection, read) timeouts.
78
+ :type _request_timeout: int, tuple(int, int), optional
79
+ :param _request_auth: set to override the auth_settings for an a single
80
+ request; this effectively ignores the
81
+ authentication in the spec for a single request.
82
+ :type _request_auth: dict, optional
83
+ :param _content_type: force content-type for the request.
84
+ :type _content_type: str, Optional
85
+ :param _headers: set to override the headers for a single
86
+ request; this effectively ignores the headers
87
+ in the spec for a single request.
88
+ :type _headers: dict, optional
89
+ :param _host_index: set to override the host_index for a single
90
+ request; this effectively ignores the host_index
91
+ in the spec for a single request.
92
+ :type _host_index: int, optional
93
+ :return: Returns the result object.
94
+ """ # noqa: E501
95
+
96
+ _param = self._funding_rate_funding_rates_symbol_get_serialize(
97
+ symbol=symbol,
98
+ start=start,
99
+ end=end,
100
+ limit=limit,
101
+ _request_auth=_request_auth,
102
+ _content_type=_content_type,
103
+ _headers=_headers,
104
+ _host_index=_host_index
105
+ )
106
+
107
+ _response_types_map: Dict[str, Optional[str]] = {
108
+ '200': "BaseResponseListFundingRateResponse",
109
+ '400': "ErrorResponse",
110
+ '404': "ErrorResponse",
111
+ '500': "ErrorResponse",
112
+ '422': "HTTPValidationError",
113
+ }
114
+ response_data = self.api_client.call_api(
115
+ *_param,
116
+ _request_timeout=_request_timeout
117
+ )
118
+ response_data.read()
119
+ return self.api_client.response_deserialize(
120
+ response_data=response_data,
121
+ response_types_map=_response_types_map,
122
+ ).data
123
+
124
+
125
+ @validate_call
126
+ def funding_rate_funding_rates_symbol_get_with_http_info(
127
+ self,
128
+ symbol: Annotated[StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")],
129
+ start: Annotated[Optional[StrictInt], Field(description="Start timestamp in milliseconds")] = None,
130
+ end: Annotated[Optional[StrictInt], Field(description="End timestamp in milliseconds")] = None,
131
+ limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of funding rates to return")] = None,
132
+ _request_timeout: Union[
133
+ None,
134
+ Annotated[StrictFloat, Field(gt=0)],
135
+ Tuple[
136
+ Annotated[StrictFloat, Field(gt=0)],
137
+ Annotated[StrictFloat, Field(gt=0)]
138
+ ]
139
+ ] = None,
140
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
141
+ _content_type: Optional[StrictStr] = None,
142
+ _headers: Optional[Dict[StrictStr, Any]] = None,
143
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
144
+ ) -> ApiResponse[BaseResponseListFundingRateResponse]:
145
+ """Funding Rate
146
+
147
+ Retrieve funding rate data for a specific symbol in the futures market.
148
+
149
+ :param symbol: Trading pair symbol (e.g., BTCUSDT) (required)
150
+ :type symbol: str
151
+ :param start: Start timestamp in milliseconds
152
+ :type start: int
153
+ :param end: End timestamp in milliseconds
154
+ :type end: int
155
+ :param limit: Number of funding rates to return
156
+ :type limit: int
157
+ :param _request_timeout: timeout setting for this request. If one
158
+ number provided, it will be total request
159
+ timeout. It can also be a pair (tuple) of
160
+ (connection, read) timeouts.
161
+ :type _request_timeout: int, tuple(int, int), optional
162
+ :param _request_auth: set to override the auth_settings for an a single
163
+ request; this effectively ignores the
164
+ authentication in the spec for a single request.
165
+ :type _request_auth: dict, optional
166
+ :param _content_type: force content-type for the request.
167
+ :type _content_type: str, Optional
168
+ :param _headers: set to override the headers for a single
169
+ request; this effectively ignores the headers
170
+ in the spec for a single request.
171
+ :type _headers: dict, optional
172
+ :param _host_index: set to override the host_index for a single
173
+ request; this effectively ignores the host_index
174
+ in the spec for a single request.
175
+ :type _host_index: int, optional
176
+ :return: Returns the result object.
177
+ """ # noqa: E501
178
+
179
+ _param = self._funding_rate_funding_rates_symbol_get_serialize(
180
+ symbol=symbol,
181
+ start=start,
182
+ end=end,
183
+ limit=limit,
184
+ _request_auth=_request_auth,
185
+ _content_type=_content_type,
186
+ _headers=_headers,
187
+ _host_index=_host_index
188
+ )
189
+
190
+ _response_types_map: Dict[str, Optional[str]] = {
191
+ '200': "BaseResponseListFundingRateResponse",
192
+ '400': "ErrorResponse",
193
+ '404': "ErrorResponse",
194
+ '500': "ErrorResponse",
195
+ '422': "HTTPValidationError",
196
+ }
197
+ response_data = self.api_client.call_api(
198
+ *_param,
199
+ _request_timeout=_request_timeout
200
+ )
201
+ response_data.read()
202
+ return self.api_client.response_deserialize(
203
+ response_data=response_data,
204
+ response_types_map=_response_types_map,
205
+ )
206
+
207
+
208
+ @validate_call
209
+ def funding_rate_funding_rates_symbol_get_without_preload_content(
210
+ self,
211
+ symbol: Annotated[StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")],
212
+ start: Annotated[Optional[StrictInt], Field(description="Start timestamp in milliseconds")] = None,
213
+ end: Annotated[Optional[StrictInt], Field(description="End timestamp in milliseconds")] = None,
214
+ limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of funding rates to return")] = None,
215
+ _request_timeout: Union[
216
+ None,
217
+ Annotated[StrictFloat, Field(gt=0)],
218
+ Tuple[
219
+ Annotated[StrictFloat, Field(gt=0)],
220
+ Annotated[StrictFloat, Field(gt=0)]
221
+ ]
222
+ ] = None,
223
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
224
+ _content_type: Optional[StrictStr] = None,
225
+ _headers: Optional[Dict[StrictStr, Any]] = None,
226
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
227
+ ) -> RESTResponseType:
228
+ """Funding Rate
229
+
230
+ Retrieve funding rate data for a specific symbol in the futures market.
231
+
232
+ :param symbol: Trading pair symbol (e.g., BTCUSDT) (required)
233
+ :type symbol: str
234
+ :param start: Start timestamp in milliseconds
235
+ :type start: int
236
+ :param end: End timestamp in milliseconds
237
+ :type end: int
238
+ :param limit: Number of funding rates to return
239
+ :type limit: int
240
+ :param _request_timeout: timeout setting for this request. If one
241
+ number provided, it will be total request
242
+ timeout. It can also be a pair (tuple) of
243
+ (connection, read) timeouts.
244
+ :type _request_timeout: int, tuple(int, int), optional
245
+ :param _request_auth: set to override the auth_settings for an a single
246
+ request; this effectively ignores the
247
+ authentication in the spec for a single request.
248
+ :type _request_auth: dict, optional
249
+ :param _content_type: force content-type for the request.
250
+ :type _content_type: str, Optional
251
+ :param _headers: set to override the headers for a single
252
+ request; this effectively ignores the headers
253
+ in the spec for a single request.
254
+ :type _headers: dict, optional
255
+ :param _host_index: set to override the host_index for a single
256
+ request; this effectively ignores the host_index
257
+ in the spec for a single request.
258
+ :type _host_index: int, optional
259
+ :return: Returns the result object.
260
+ """ # noqa: E501
261
+
262
+ _param = self._funding_rate_funding_rates_symbol_get_serialize(
263
+ symbol=symbol,
264
+ start=start,
265
+ end=end,
266
+ limit=limit,
267
+ _request_auth=_request_auth,
268
+ _content_type=_content_type,
269
+ _headers=_headers,
270
+ _host_index=_host_index
271
+ )
272
+
273
+ _response_types_map: Dict[str, Optional[str]] = {
274
+ '200': "BaseResponseListFundingRateResponse",
275
+ '400': "ErrorResponse",
276
+ '404': "ErrorResponse",
277
+ '500': "ErrorResponse",
278
+ '422': "HTTPValidationError",
279
+ }
280
+ response_data = self.api_client.call_api(
281
+ *_param,
282
+ _request_timeout=_request_timeout
283
+ )
284
+ return response_data.response
285
+
286
+
287
+ def _funding_rate_funding_rates_symbol_get_serialize(
288
+ self,
289
+ symbol,
290
+ start,
291
+ end,
292
+ limit,
293
+ _request_auth,
294
+ _content_type,
295
+ _headers,
296
+ _host_index,
297
+ ) -> RequestSerialized:
298
+
299
+ _host = None
300
+
301
+ _collection_formats: Dict[str, str] = {
302
+ }
303
+
304
+ _path_params: Dict[str, str] = {}
305
+ _query_params: List[Tuple[str, str]] = []
306
+ _header_params: Dict[str, Optional[str]] = _headers or {}
307
+ _form_params: List[Tuple[str, str]] = []
308
+ _files: Dict[
309
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
310
+ ] = {}
311
+ _body_params: Optional[bytes] = None
312
+
313
+ # process the path parameters
314
+ if symbol is not None:
315
+ _path_params['symbol'] = symbol
316
+ # process the query parameters
317
+ if start is not None:
318
+
319
+ _query_params.append(('start', start))
320
+
321
+ if end is not None:
322
+
323
+ _query_params.append(('end', end))
324
+
325
+ if limit is not None:
326
+
327
+ _query_params.append(('limit', limit))
328
+
329
+ # process the header parameters
330
+ # process the form parameters
331
+ # process the body parameter
332
+
333
+
334
+ # set the HTTP header `Accept`
335
+ if 'Accept' not in _header_params:
336
+ _header_params['Accept'] = self.api_client.select_header_accept(
337
+ [
338
+ 'application/json'
339
+ ]
340
+ )
341
+
342
+
343
+ # authentication setting
344
+ _auth_settings: List[str] = [
345
+ ]
346
+
347
+ return self.api_client.param_serialize(
348
+ method='GET',
349
+ resource_path='/funding_rates/{symbol}',
350
+ path_params=_path_params,
351
+ query_params=_query_params,
352
+ header_params=_header_params,
353
+ body=_body_params,
354
+ post_params=_form_params,
355
+ files=_files,
356
+ auth_settings=_auth_settings,
357
+ collection_formats=_collection_formats,
358
+ _host=_host,
359
+ _request_auth=_request_auth
360
+ )
361
+
362
+