crypticorn 1.0.1__py3-none-any.whl → 1.0.2rc2__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.
- crypticorn/__init__.py +3 -3
- crypticorn/client.py +722 -0
- crypticorn/hive/__init__.py +1 -0
- crypticorn/{api.py → hive/main.py} +6 -6
- crypticorn/hive/requirements.txt +4 -0
- crypticorn/{utils.py → hive/utils.py} +2 -2
- crypticorn/klines/__init__.py +2 -0
- crypticorn/klines/client/__init__.py +62 -0
- crypticorn/klines/client/api/__init__.py +9 -0
- crypticorn/klines/client/api/funding_rates_api.py +362 -0
- crypticorn/klines/client/api/health_check_api.py +281 -0
- crypticorn/klines/client/api/ohlcv_data_api.py +409 -0
- crypticorn/klines/client/api/symbols_api.py +308 -0
- crypticorn/klines/client/api/udf_api.py +1929 -0
- crypticorn/klines/client/api_client.py +797 -0
- crypticorn/klines/client/api_response.py +21 -0
- crypticorn/klines/client/configuration.py +565 -0
- crypticorn/klines/client/exceptions.py +216 -0
- crypticorn/klines/client/models/__init__.py +41 -0
- crypticorn/klines/client/models/base_response_health_check_response.py +108 -0
- crypticorn/klines/client/models/base_response_list_funding_rate_response.py +112 -0
- crypticorn/klines/client/models/base_response_list_str.py +104 -0
- crypticorn/klines/client/models/base_response_ohlcv_response.py +108 -0
- crypticorn/klines/client/models/error_response.py +101 -0
- crypticorn/{models/deleted.py → klines/client/models/exchange.py} +15 -11
- crypticorn/klines/client/models/funding_rate_response.py +92 -0
- crypticorn/klines/client/models/health_check_response.py +89 -0
- crypticorn/{models/create_api_key_response.py → klines/client/models/history_error_response.py} +12 -22
- crypticorn/klines/client/models/history_no_data_response.py +99 -0
- crypticorn/klines/client/models/history_success_response.py +99 -0
- crypticorn/klines/client/models/http_validation_error.py +95 -0
- crypticorn/klines/client/models/market.py +37 -0
- crypticorn/klines/client/models/ohlcv_response.py +98 -0
- crypticorn/klines/client/models/resolution.py +40 -0
- crypticorn/klines/client/models/response_get_history_udf_history_get.py +149 -0
- crypticorn/klines/client/models/search_symbol_response.py +97 -0
- crypticorn/klines/client/models/sort_direction.py +37 -0
- crypticorn/{models/futures_balance_error.py → klines/client/models/symbol_group_response.py} +12 -14
- crypticorn/klines/client/models/symbol_info_response.py +115 -0
- crypticorn/{models/id.py → klines/client/models/symbol_type.py} +13 -11
- crypticorn/klines/client/models/timeframe.py +40 -0
- crypticorn/klines/client/models/udf_config_response.py +121 -0
- crypticorn/klines/client/models/validation_error.py +99 -0
- crypticorn/{models/get_futures_balance200_response_inner.py → klines/client/models/validation_error_loc_inner.py} +39 -35
- crypticorn/klines/client/py.typed +0 -0
- crypticorn/klines/client/rest.py +257 -0
- crypticorn/klines/main.py +42 -0
- crypticorn/klines/requirements.txt +4 -0
- crypticorn/klines/test/__init__.py +0 -0
- crypticorn/klines/test/test_base_response_health_check_response.py +56 -0
- crypticorn/klines/test/test_base_response_list_funding_rate_response.py +59 -0
- crypticorn/klines/test/test_base_response_list_str.py +56 -0
- crypticorn/klines/test/test_base_response_ohlcv_response.py +72 -0
- crypticorn/klines/test/test_error_response.py +57 -0
- crypticorn/klines/test/test_exchange.py +56 -0
- crypticorn/klines/test/test_funding_rate_response.py +56 -0
- crypticorn/klines/test/test_funding_rates_api.py +38 -0
- crypticorn/klines/test/test_health_check_api.py +38 -0
- crypticorn/klines/test/test_health_check_response.py +52 -0
- crypticorn/klines/test/test_history_error_response.py +53 -0
- crypticorn/klines/test/test_history_no_data_response.py +69 -0
- crypticorn/klines/test/test_history_success_response.py +87 -0
- crypticorn/klines/test/test_http_validation_error.py +58 -0
- crypticorn/klines/test/test_market.py +33 -0
- crypticorn/klines/test/test_ohlcv_data_api.py +38 -0
- crypticorn/klines/test/test_ohlcv_response.py +86 -0
- crypticorn/klines/test/test_resolution.py +33 -0
- crypticorn/klines/test/test_response_get_history_udf_history_get.py +89 -0
- crypticorn/klines/test/test_search_symbol_response.py +62 -0
- crypticorn/klines/test/test_sort_direction.py +33 -0
- crypticorn/klines/test/test_symbol_group_response.py +53 -0
- crypticorn/klines/test/test_symbol_info_response.py +84 -0
- crypticorn/klines/test/test_symbol_type.py +54 -0
- crypticorn/klines/test/test_symbols_api.py +38 -0
- crypticorn/klines/test/test_timeframe.py +33 -0
- crypticorn/klines/test/test_udf_api.py +80 -0
- crypticorn/klines/test/test_udf_config_response.py +95 -0
- crypticorn/klines/test/test_validation_error.py +60 -0
- crypticorn/klines/test/test_validation_error_loc_inner.py +50 -0
- crypticorn/trade/__init__.py +2 -0
- crypticorn/trade/client/__init__.py +63 -0
- crypticorn/trade/client/api/__init__.py +13 -0
- crypticorn/trade/client/api/api_keys_api.py +1468 -0
- crypticorn/trade/client/api/bots_api.py +1211 -0
- crypticorn/trade/client/api/exchanges_api.py +297 -0
- crypticorn/trade/client/api/futures_trading_panel_api.py +1463 -0
- crypticorn/trade/client/api/notifications_api.py +1767 -0
- crypticorn/trade/client/api/orders_api.py +331 -0
- crypticorn/trade/client/api/status_api.py +278 -0
- crypticorn/trade/client/api/strategies_api.py +331 -0
- crypticorn/trade/client/api/trading_actions_api.py +898 -0
- crypticorn/trade/client/api_client.py +797 -0
- crypticorn/trade/client/api_response.py +21 -0
- crypticorn/trade/client/configuration.py +574 -0
- crypticorn/trade/client/exceptions.py +216 -0
- crypticorn/trade/client/models/__init__.py +38 -0
- crypticorn/{models → trade/client/models}/action_model.py +17 -20
- crypticorn/{models → trade/client/models}/api_error_identifier.py +3 -1
- crypticorn/{models → trade/client/models}/api_key_model.py +5 -8
- crypticorn/{models → trade/client/models}/bot_model.py +15 -11
- crypticorn/{models → trade/client/models}/futures_trading_action.py +12 -12
- crypticorn/{models → trade/client/models}/http_validation_error.py +1 -1
- crypticorn/{models → trade/client/models}/notification_model.py +8 -6
- crypticorn/{models → trade/client/models}/order_model.py +12 -15
- crypticorn/{models → trade/client/models}/post_futures_action.py +1 -1
- crypticorn/{models → trade/client/models}/strategy_exchange_info.py +1 -1
- crypticorn/{models → trade/client/models}/strategy_model.py +6 -2
- crypticorn/{models → trade/client/models}/validation_error.py +1 -1
- crypticorn/trade/client/py.typed +0 -0
- crypticorn/trade/client/rest.py +257 -0
- crypticorn/trade/main.py +39 -0
- crypticorn/trade/requirements.txt +4 -0
- crypticorn-1.0.2rc2.dist-info/METADATA +47 -0
- crypticorn-1.0.2rc2.dist-info/RECORD +128 -0
- {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/WHEEL +1 -1
- crypticorn/models/__init__.py +0 -31
- crypticorn/models/modified.py +0 -87
- crypticorn-1.0.1.dist-info/METADATA +0 -40
- crypticorn-1.0.1.dist-info/RECORD +0 -38
- /crypticorn/{models → trade/client/models}/exchange.py +0 -0
- /crypticorn/{models → trade/client/models}/execution_ids.py +0 -0
- /crypticorn/{models → trade/client/models}/futures_balance.py +0 -0
- /crypticorn/{models → trade/client/models}/margin_mode.py +0 -0
- /crypticorn/{models → trade/client/models}/market_type.py +0 -0
- /crypticorn/{models → trade/client/models}/notification_type.py +0 -0
- /crypticorn/{models → trade/client/models}/order_status.py +0 -0
- /crypticorn/{models → trade/client/models}/tpsl.py +0 -0
- /crypticorn/{models → trade/client/models}/trading_action_type.py +0 -0
- /crypticorn/{models → trade/client/models}/update_notification.py +0 -0
- /crypticorn/{models → trade/client/models}/validation_error_loc_inner.py +0 -0
- {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/LICENSE.md +0 -0
- {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
from crypticorn.hive.main import HiveClient
|
@@ -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
|
8
|
+
class HiveClient:
|
9
9
|
"""
|
10
|
-
A client for interacting with the
|
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,
|
14
|
+
def __init__(self, base_url='https://api.crypticorn.com', api_key: str = None, jwt: str = None):
|
15
15
|
"""@private
|
16
|
-
Initializes the
|
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 =
|
21
|
+
self._headers = {"Authorization": f"ApiKey {api_key}"}
|
22
22
|
|
23
23
|
def create_model(self, coin_id: int, target: str) -> SingleModel:
|
24
24
|
"""
|
@@ -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(
|
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(
|
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
|
+
|