crypticorn 2.5.0rc4__py3-none-any.whl → 2.5.1__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/auth/main.py +2 -0
- crypticorn/client.py +60 -69
- crypticorn/common/__init__.py +2 -1
- crypticorn/common/auth.py +38 -20
- crypticorn/common/enums.py +5 -34
- crypticorn/common/errors.py +33 -14
- crypticorn/common/exceptions.py +42 -25
- crypticorn/common/mixins.py +36 -0
- crypticorn/common/urls.py +2 -1
- crypticorn/common/utils.py +4 -2
- crypticorn/hive/main.py +2 -0
- crypticorn/klines/client/__init__.py +14 -42
- crypticorn/klines/client/api/__init__.py +1 -1
- crypticorn/klines/client/api/change_in_timeframe_api.py +8 -22
- crypticorn/klines/client/api/funding_rates_api.py +8 -22
- crypticorn/klines/client/api/ohlcv_data_api.py +13 -33
- crypticorn/klines/client/api/status_api.py +260 -0
- crypticorn/klines/client/api/symbols_api.py +14 -29
- crypticorn/klines/client/api/udf_api.py +48 -59
- crypticorn/klines/client/api_client.py +1 -1
- crypticorn/klines/client/configuration.py +1 -1
- crypticorn/klines/client/exceptions.py +1 -1
- crypticorn/klines/client/models/__init__.py +13 -41
- crypticorn/klines/client/models/api_error_identifier.py +108 -0
- crypticorn/klines/client/models/api_error_level.py +37 -0
- crypticorn/klines/client/models/api_error_type.py +37 -0
- crypticorn/klines/client/models/change_in_timeframe.py +86 -0
- crypticorn/klines/client/models/exception_detail.py +117 -0
- crypticorn/klines/client/models/funding_rate.py +92 -0
- crypticorn/klines/client/models/internal_exchange.py +39 -0
- crypticorn/klines/client/models/market_type.py +1 -1
- crypticorn/klines/client/models/ohlcv_history.py +105 -0
- crypticorn/klines/client/models/resolution.py +1 -1
- crypticorn/klines/client/models/search_symbol.py +94 -0
- crypticorn/klines/client/models/sort_direction.py +1 -1
- crypticorn/klines/client/models/symbol_group.py +83 -0
- crypticorn/klines/client/models/symbol_info.py +131 -0
- crypticorn/klines/client/models/symbol_type.py +1 -1
- crypticorn/klines/client/models/timeframe.py +1 -1
- crypticorn/klines/client/models/udf_config.py +149 -0
- crypticorn/klines/client/rest.py +1 -1
- crypticorn/klines/main.py +40 -23
- crypticorn/metrics/client/__init__.py +7 -21
- crypticorn/metrics/client/api/__init__.py +1 -1
- crypticorn/metrics/client/api/exchanges_api.py +36 -78
- crypticorn/metrics/client/api/indicators_api.py +12 -37
- crypticorn/metrics/client/api/logs_api.py +8 -23
- crypticorn/metrics/client/api/marketcap_api.py +22 -73
- crypticorn/metrics/client/api/markets_api.py +12 -40
- crypticorn/metrics/client/api/status_api.py +260 -0
- crypticorn/metrics/client/api/tokens_api.py +7 -21
- crypticorn/metrics/client/api_client.py +1 -1
- crypticorn/metrics/client/configuration.py +5 -3
- crypticorn/metrics/client/exceptions.py +1 -1
- crypticorn/metrics/client/models/__init__.py +6 -20
- crypticorn/{trade → metrics}/client/models/api_error_identifier.py +6 -2
- crypticorn/{trade → metrics}/client/models/api_error_level.py +2 -2
- crypticorn/{trade → metrics}/client/models/api_error_type.py +2 -2
- crypticorn/metrics/client/models/exception_detail.py +117 -0
- crypticorn/metrics/client/models/internal_exchange.py +39 -0
- crypticorn/metrics/client/models/market_type.py +1 -1
- crypticorn/metrics/client/models/severity.py +1 -1
- crypticorn/metrics/client/models/time_interval.py +1 -1
- crypticorn/metrics/client/models/trading_status.py +1 -1
- crypticorn/metrics/client/rest.py +1 -1
- crypticorn/metrics/main.py +51 -43
- crypticorn/pay/main.py +2 -0
- crypticorn/trade/client/__init__.py +0 -3
- crypticorn/trade/client/configuration.py +2 -2
- crypticorn/trade/client/models/__init__.py +0 -3
- crypticorn/trade/client/models/bot_model.py +3 -7
- crypticorn/trade/client/models/execution_ids.py +1 -1
- crypticorn/trade/client/models/notification_model.py +3 -12
- crypticorn/trade/client/models/order_model.py +3 -7
- crypticorn/trade/client/models/spot_trading_action.py +231 -0
- crypticorn/trade/main.py +2 -0
- {crypticorn-2.5.0rc4.dist-info → crypticorn-2.5.1.dist-info}/METADATA +7 -5
- {crypticorn-2.5.0rc4.dist-info → crypticorn-2.5.1.dist-info}/RECORD +82 -65
- {crypticorn-2.5.0rc4.dist-info → crypticorn-2.5.1.dist-info}/WHEEL +1 -1
- crypticorn/common/sorter.py +0 -40
- /crypticorn/common/{pydantic.py → decorators.py} +0 -0
- {crypticorn-2.5.0rc4.dist-info → crypticorn-2.5.1.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.5.0rc4.dist-info → crypticorn-2.5.1.dist-info}/top_level.txt +0 -0
crypticorn/common/utils.py
CHANGED
@@ -2,7 +2,6 @@ from typing import Any, Union
|
|
2
2
|
from decimal import Decimal
|
3
3
|
import string
|
4
4
|
import random
|
5
|
-
|
6
5
|
from fastapi import HTTPException
|
7
6
|
from fastapi import status
|
8
7
|
from typing_extensions import deprecated
|
@@ -56,7 +55,10 @@ def is_equal(
|
|
56
55
|
)
|
57
56
|
|
58
57
|
|
59
|
-
def optional_import(module_name: str, extra_name: str):
|
58
|
+
def optional_import(module_name: str, extra_name: str) -> Any:
|
59
|
+
"""
|
60
|
+
Import a module optionally.
|
61
|
+
"""
|
60
62
|
try:
|
61
63
|
return __import__(module_name)
|
62
64
|
except ImportError as e:
|
crypticorn/hive/main.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
"""
|
6
6
|
Klines Service API
|
7
7
|
|
8
|
-
|
8
|
+
API for retrieving OHLCV data, funding rates, and symbol information from Binance.
|
9
9
|
|
10
10
|
The version of the OpenAPI document: 1.0.0
|
11
11
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
@@ -19,8 +19,8 @@ __version__ = "1.0.0"
|
|
19
19
|
# import apis into sdk package
|
20
20
|
from crypticorn.klines.client.api.change_in_timeframe_api import ChangeInTimeframeApi
|
21
21
|
from crypticorn.klines.client.api.funding_rates_api import FundingRatesApi
|
22
|
-
from crypticorn.klines.client.api.health_check_api import HealthCheckApi
|
23
22
|
from crypticorn.klines.client.api.ohlcv_data_api import OHLCVDataApi
|
23
|
+
from crypticorn.klines.client.api.status_api import StatusApi
|
24
24
|
from crypticorn.klines.client.api.symbols_api import SymbolsApi
|
25
25
|
from crypticorn.klines.client.api.udf_api import UDFApi
|
26
26
|
|
@@ -36,48 +36,20 @@ from crypticorn.klines.client.exceptions import ApiAttributeError
|
|
36
36
|
from crypticorn.klines.client.exceptions import ApiException
|
37
37
|
|
38
38
|
# import models into sdk package
|
39
|
-
from crypticorn.klines.client.models.
|
40
|
-
|
41
|
-
|
42
|
-
from crypticorn.klines.client.models.
|
43
|
-
|
44
|
-
|
45
|
-
from crypticorn.klines.client.models.
|
46
|
-
BaseResponseListFundingRateResponse,
|
47
|
-
)
|
48
|
-
from crypticorn.klines.client.models.base_response_list_str import BaseResponseListStr
|
49
|
-
from crypticorn.klines.client.models.base_response_ohlcv_response import (
|
50
|
-
BaseResponseOHLCVResponse,
|
51
|
-
)
|
52
|
-
from crypticorn.klines.client.models.change_in_timeframe_response import (
|
53
|
-
ChangeInTimeframeResponse,
|
54
|
-
)
|
55
|
-
from crypticorn.klines.client.models.error_response import ErrorResponse
|
56
|
-
from crypticorn.klines.client.models.exchange import Exchange
|
57
|
-
from crypticorn.klines.client.models.funding_rate_response import FundingRateResponse
|
58
|
-
from crypticorn.klines.client.models.http_validation_error import HTTPValidationError
|
59
|
-
from crypticorn.klines.client.models.health_check_response import HealthCheckResponse
|
60
|
-
from crypticorn.klines.client.models.history_error_response import HistoryErrorResponse
|
61
|
-
from crypticorn.klines.client.models.history_no_data_response import (
|
62
|
-
HistoryNoDataResponse,
|
63
|
-
)
|
64
|
-
from crypticorn.klines.client.models.history_success_response import (
|
65
|
-
HistorySuccessResponse,
|
66
|
-
)
|
39
|
+
from crypticorn.klines.client.models.api_error_identifier import ApiErrorIdentifier
|
40
|
+
from crypticorn.klines.client.models.api_error_level import ApiErrorLevel
|
41
|
+
from crypticorn.klines.client.models.api_error_type import ApiErrorType
|
42
|
+
from crypticorn.klines.client.models.change_in_timeframe import ChangeInTimeframe
|
43
|
+
from crypticorn.klines.client.models.exception_detail import ExceptionDetail
|
44
|
+
from crypticorn.klines.client.models.funding_rate import FundingRate
|
45
|
+
from crypticorn.klines.client.models.internal_exchange import InternalExchange
|
67
46
|
from crypticorn.klines.client.models.market_type import MarketType
|
68
|
-
from crypticorn.klines.client.models.
|
47
|
+
from crypticorn.klines.client.models.ohlcv_history import OHLCVHistory
|
69
48
|
from crypticorn.klines.client.models.resolution import Resolution
|
70
|
-
from crypticorn.klines.client.models.
|
71
|
-
ResponseGetUdfHistory,
|
72
|
-
)
|
73
|
-
from crypticorn.klines.client.models.search_symbol_response import SearchSymbolResponse
|
49
|
+
from crypticorn.klines.client.models.search_symbol import SearchSymbol
|
74
50
|
from crypticorn.klines.client.models.sort_direction import SortDirection
|
75
|
-
from crypticorn.klines.client.models.
|
76
|
-
from crypticorn.klines.client.models.
|
51
|
+
from crypticorn.klines.client.models.symbol_group import SymbolGroup
|
52
|
+
from crypticorn.klines.client.models.symbol_info import SymbolInfo
|
77
53
|
from crypticorn.klines.client.models.symbol_type import SymbolType
|
78
54
|
from crypticorn.klines.client.models.timeframe import Timeframe
|
79
|
-
from crypticorn.klines.client.models.
|
80
|
-
from crypticorn.klines.client.models.validation_error import ValidationError
|
81
|
-
from crypticorn.klines.client.models.validation_error_loc_inner import (
|
82
|
-
ValidationErrorLocInner,
|
83
|
-
)
|
55
|
+
from crypticorn.klines.client.models.udf_config import UDFConfig
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# import apis into api package
|
4
4
|
from crypticorn.klines.client.api.change_in_timeframe_api import ChangeInTimeframeApi
|
5
5
|
from crypticorn.klines.client.api.funding_rates_api import FundingRatesApi
|
6
|
-
from crypticorn.klines.client.api.health_check_api import HealthCheckApi
|
7
6
|
from crypticorn.klines.client.api.ohlcv_data_api import OHLCVDataApi
|
7
|
+
from crypticorn.klines.client.api.status_api import StatusApi
|
8
8
|
from crypticorn.klines.client.api.symbols_api import SymbolsApi
|
9
9
|
from crypticorn.klines.client.api.udf_api import UDFApi
|
@@ -3,7 +3,7 @@
|
|
3
3
|
"""
|
4
4
|
Klines Service API
|
5
5
|
|
6
|
-
|
6
|
+
API for retrieving OHLCV data, funding rates, and symbol information from Binance.
|
7
7
|
|
8
8
|
The version of the OpenAPI document: 1.0.0
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
@@ -17,11 +17,9 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
17
|
from typing_extensions import Annotated
|
18
18
|
|
19
19
|
from pydantic import Field
|
20
|
-
from typing import Optional
|
20
|
+
from typing import List, Optional
|
21
21
|
from typing_extensions import Annotated
|
22
|
-
from crypticorn.klines.client.models.
|
23
|
-
BaseResponseListChangeInTimeframeResponse,
|
24
|
-
)
|
22
|
+
from crypticorn.klines.client.models.change_in_timeframe import ChangeInTimeframe
|
25
23
|
from crypticorn.klines.client.models.market_type import MarketType
|
26
24
|
from crypticorn.klines.client.models.timeframe import Timeframe
|
27
25
|
|
@@ -63,7 +61,7 @@ class ChangeInTimeframeApi:
|
|
63
61
|
_content_type: Optional[StrictStr] = None,
|
64
62
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
65
63
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
66
|
-
) ->
|
64
|
+
) -> List[ChangeInTimeframe]:
|
67
65
|
"""Get Change In Timeframe
|
68
66
|
|
69
67
|
Retrieve price change percentage between last two completed timestamps for all pairs. Valid markets: spot, futures Valid timeframes: 15m, 30m, 1h, 4h, 1d
|
@@ -104,11 +102,7 @@ class ChangeInTimeframeApi:
|
|
104
102
|
)
|
105
103
|
|
106
104
|
_response_types_map: Dict[str, Optional[str]] = {
|
107
|
-
"200": "
|
108
|
-
"400": "ErrorResponse",
|
109
|
-
"404": "ErrorResponse",
|
110
|
-
"500": "ErrorResponse",
|
111
|
-
"422": "HTTPValidationError",
|
105
|
+
"200": "List[ChangeInTimeframe]",
|
112
106
|
}
|
113
107
|
response_data = await self.api_client.call_api(
|
114
108
|
*_param, _request_timeout=_request_timeout
|
@@ -140,7 +134,7 @@ class ChangeInTimeframeApi:
|
|
140
134
|
_content_type: Optional[StrictStr] = None,
|
141
135
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
142
136
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
143
|
-
) -> ApiResponse[
|
137
|
+
) -> ApiResponse[List[ChangeInTimeframe]]:
|
144
138
|
"""Get Change In Timeframe
|
145
139
|
|
146
140
|
Retrieve price change percentage between last two completed timestamps for all pairs. Valid markets: spot, futures Valid timeframes: 15m, 30m, 1h, 4h, 1d
|
@@ -181,11 +175,7 @@ class ChangeInTimeframeApi:
|
|
181
175
|
)
|
182
176
|
|
183
177
|
_response_types_map: Dict[str, Optional[str]] = {
|
184
|
-
"200": "
|
185
|
-
"400": "ErrorResponse",
|
186
|
-
"404": "ErrorResponse",
|
187
|
-
"500": "ErrorResponse",
|
188
|
-
"422": "HTTPValidationError",
|
178
|
+
"200": "List[ChangeInTimeframe]",
|
189
179
|
}
|
190
180
|
response_data = await self.api_client.call_api(
|
191
181
|
*_param, _request_timeout=_request_timeout
|
@@ -258,11 +248,7 @@ class ChangeInTimeframeApi:
|
|
258
248
|
)
|
259
249
|
|
260
250
|
_response_types_map: Dict[str, Optional[str]] = {
|
261
|
-
"200": "
|
262
|
-
"400": "ErrorResponse",
|
263
|
-
"404": "ErrorResponse",
|
264
|
-
"500": "ErrorResponse",
|
265
|
-
"422": "HTTPValidationError",
|
251
|
+
"200": "List[ChangeInTimeframe]",
|
266
252
|
}
|
267
253
|
response_data = await self.api_client.call_api(
|
268
254
|
*_param, _request_timeout=_request_timeout
|
@@ -3,7 +3,7 @@
|
|
3
3
|
"""
|
4
4
|
Klines Service API
|
5
5
|
|
6
|
-
|
6
|
+
API for retrieving OHLCV data, funding rates, and symbol information from Binance.
|
7
7
|
|
8
8
|
The version of the OpenAPI document: 1.0.0
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
@@ -17,11 +17,9 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
17
|
from typing_extensions import Annotated
|
18
18
|
|
19
19
|
from pydantic import Field, StrictInt, StrictStr
|
20
|
-
from typing import Optional
|
20
|
+
from typing import List, Optional
|
21
21
|
from typing_extensions import Annotated
|
22
|
-
from crypticorn.klines.client.models.
|
23
|
-
BaseResponseListFundingRateResponse,
|
24
|
-
)
|
22
|
+
from crypticorn.klines.client.models.funding_rate import FundingRate
|
25
23
|
|
26
24
|
from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
|
27
25
|
from crypticorn.klines.client.api_response import ApiResponse
|
@@ -67,7 +65,7 @@ class FundingRatesApi:
|
|
67
65
|
_content_type: Optional[StrictStr] = None,
|
68
66
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
69
67
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
70
|
-
) ->
|
68
|
+
) -> List[FundingRate]:
|
71
69
|
"""Funding Rate
|
72
70
|
|
73
71
|
Retrieve funding rate data for a specific symbol in the futures market.
|
@@ -114,11 +112,7 @@ class FundingRatesApi:
|
|
114
112
|
)
|
115
113
|
|
116
114
|
_response_types_map: Dict[str, Optional[str]] = {
|
117
|
-
"200": "
|
118
|
-
"400": "ErrorResponse",
|
119
|
-
"404": "ErrorResponse",
|
120
|
-
"500": "ErrorResponse",
|
121
|
-
"422": "HTTPValidationError",
|
115
|
+
"200": "List[FundingRate]",
|
122
116
|
}
|
123
117
|
response_data = await self.api_client.call_api(
|
124
118
|
*_param, _request_timeout=_request_timeout
|
@@ -156,7 +150,7 @@ class FundingRatesApi:
|
|
156
150
|
_content_type: Optional[StrictStr] = None,
|
157
151
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
158
152
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
159
|
-
) -> ApiResponse[
|
153
|
+
) -> ApiResponse[List[FundingRate]]:
|
160
154
|
"""Funding Rate
|
161
155
|
|
162
156
|
Retrieve funding rate data for a specific symbol in the futures market.
|
@@ -203,11 +197,7 @@ class FundingRatesApi:
|
|
203
197
|
)
|
204
198
|
|
205
199
|
_response_types_map: Dict[str, Optional[str]] = {
|
206
|
-
"200": "
|
207
|
-
"400": "ErrorResponse",
|
208
|
-
"404": "ErrorResponse",
|
209
|
-
"500": "ErrorResponse",
|
210
|
-
"422": "HTTPValidationError",
|
200
|
+
"200": "List[FundingRate]",
|
211
201
|
}
|
212
202
|
response_data = await self.api_client.call_api(
|
213
203
|
*_param, _request_timeout=_request_timeout
|
@@ -292,11 +282,7 @@ class FundingRatesApi:
|
|
292
282
|
)
|
293
283
|
|
294
284
|
_response_types_map: Dict[str, Optional[str]] = {
|
295
|
-
"200": "
|
296
|
-
"400": "ErrorResponse",
|
297
|
-
"404": "ErrorResponse",
|
298
|
-
"500": "ErrorResponse",
|
299
|
-
"422": "HTTPValidationError",
|
285
|
+
"200": "List[FundingRate]",
|
300
286
|
}
|
301
287
|
response_data = await self.api_client.call_api(
|
302
288
|
*_param, _request_timeout=_request_timeout
|
@@ -3,7 +3,7 @@
|
|
3
3
|
"""
|
4
4
|
Klines Service API
|
5
5
|
|
6
|
-
|
6
|
+
API for retrieving OHLCV data, funding rates, and symbol information from Binance.
|
7
7
|
|
8
8
|
The version of the OpenAPI document: 1.0.0
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
@@ -19,10 +19,8 @@ from typing_extensions import Annotated
|
|
19
19
|
from pydantic import Field, StrictInt, StrictStr
|
20
20
|
from typing import Optional
|
21
21
|
from typing_extensions import Annotated
|
22
|
-
from crypticorn.klines.client.models.base_response_ohlcv_response import (
|
23
|
-
BaseResponseOHLCVResponse,
|
24
|
-
)
|
25
22
|
from crypticorn.klines.client.models.market_type import MarketType
|
23
|
+
from crypticorn.klines.client.models.ohlcv_history import OHLCVHistory
|
26
24
|
from crypticorn.klines.client.models.sort_direction import SortDirection
|
27
25
|
from crypticorn.klines.client.models.timeframe import Timeframe
|
28
26
|
|
@@ -46,9 +44,7 @@ class OHLCVDataApi:
|
|
46
44
|
@validate_call
|
47
45
|
async def get_ohlcv(
|
48
46
|
self,
|
49
|
-
market: Annotated[
|
50
|
-
MarketType, Field(description="Market type (spot or futures)")
|
51
|
-
],
|
47
|
+
market: Annotated[MarketType, Field(description="Market type")],
|
52
48
|
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
53
49
|
symbol: Annotated[
|
54
50
|
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
@@ -78,12 +74,12 @@ class OHLCVDataApi:
|
|
78
74
|
_content_type: Optional[StrictStr] = None,
|
79
75
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
80
76
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
81
|
-
) ->
|
77
|
+
) -> OHLCVHistory:
|
82
78
|
"""Get Ohlcv
|
83
79
|
|
84
80
|
Retrieve OHLCV (Open, High, Low, Close, Volume) data for a specific market, timeframe, and symbol.
|
85
81
|
|
86
|
-
:param market: Market type (
|
82
|
+
:param market: Market type (required)
|
87
83
|
:type market: MarketType
|
88
84
|
:param timeframe: Timeframe for the candles (required)
|
89
85
|
:type timeframe: Timeframe
|
@@ -134,11 +130,7 @@ class OHLCVDataApi:
|
|
134
130
|
)
|
135
131
|
|
136
132
|
_response_types_map: Dict[str, Optional[str]] = {
|
137
|
-
"200": "
|
138
|
-
"400": "ErrorResponse",
|
139
|
-
"404": "ErrorResponse",
|
140
|
-
"500": "ErrorResponse",
|
141
|
-
"422": "HTTPValidationError",
|
133
|
+
"200": "OHLCVHistory",
|
142
134
|
}
|
143
135
|
response_data = await self.api_client.call_api(
|
144
136
|
*_param, _request_timeout=_request_timeout
|
@@ -152,9 +144,7 @@ class OHLCVDataApi:
|
|
152
144
|
@validate_call
|
153
145
|
async def get_ohlcv_with_http_info(
|
154
146
|
self,
|
155
|
-
market: Annotated[
|
156
|
-
MarketType, Field(description="Market type (spot or futures)")
|
157
|
-
],
|
147
|
+
market: Annotated[MarketType, Field(description="Market type")],
|
158
148
|
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
159
149
|
symbol: Annotated[
|
160
150
|
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
@@ -184,12 +174,12 @@ class OHLCVDataApi:
|
|
184
174
|
_content_type: Optional[StrictStr] = None,
|
185
175
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
186
176
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
187
|
-
) -> ApiResponse[
|
177
|
+
) -> ApiResponse[OHLCVHistory]:
|
188
178
|
"""Get Ohlcv
|
189
179
|
|
190
180
|
Retrieve OHLCV (Open, High, Low, Close, Volume) data for a specific market, timeframe, and symbol.
|
191
181
|
|
192
|
-
:param market: Market type (
|
182
|
+
:param market: Market type (required)
|
193
183
|
:type market: MarketType
|
194
184
|
:param timeframe: Timeframe for the candles (required)
|
195
185
|
:type timeframe: Timeframe
|
@@ -240,11 +230,7 @@ class OHLCVDataApi:
|
|
240
230
|
)
|
241
231
|
|
242
232
|
_response_types_map: Dict[str, Optional[str]] = {
|
243
|
-
"200": "
|
244
|
-
"400": "ErrorResponse",
|
245
|
-
"404": "ErrorResponse",
|
246
|
-
"500": "ErrorResponse",
|
247
|
-
"422": "HTTPValidationError",
|
233
|
+
"200": "OHLCVHistory",
|
248
234
|
}
|
249
235
|
response_data = await self.api_client.call_api(
|
250
236
|
*_param, _request_timeout=_request_timeout
|
@@ -258,9 +244,7 @@ class OHLCVDataApi:
|
|
258
244
|
@validate_call
|
259
245
|
async def get_ohlcv_without_preload_content(
|
260
246
|
self,
|
261
|
-
market: Annotated[
|
262
|
-
MarketType, Field(description="Market type (spot or futures)")
|
263
|
-
],
|
247
|
+
market: Annotated[MarketType, Field(description="Market type")],
|
264
248
|
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
265
249
|
symbol: Annotated[
|
266
250
|
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
@@ -295,7 +279,7 @@ class OHLCVDataApi:
|
|
295
279
|
|
296
280
|
Retrieve OHLCV (Open, High, Low, Close, Volume) data for a specific market, timeframe, and symbol.
|
297
281
|
|
298
|
-
:param market: Market type (
|
282
|
+
:param market: Market type (required)
|
299
283
|
:type market: MarketType
|
300
284
|
:param timeframe: Timeframe for the candles (required)
|
301
285
|
:type timeframe: Timeframe
|
@@ -346,11 +330,7 @@ class OHLCVDataApi:
|
|
346
330
|
)
|
347
331
|
|
348
332
|
_response_types_map: Dict[str, Optional[str]] = {
|
349
|
-
"200": "
|
350
|
-
"400": "ErrorResponse",
|
351
|
-
"404": "ErrorResponse",
|
352
|
-
"500": "ErrorResponse",
|
353
|
-
"422": "HTTPValidationError",
|
333
|
+
"200": "OHLCVHistory",
|
354
334
|
}
|
355
335
|
response_data = await self.api_client.call_api(
|
356
336
|
*_param, _request_timeout=_request_timeout
|
@@ -0,0 +1,260 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Klines Service API
|
5
|
+
|
6
|
+
API for retrieving OHLCV data, funding rates, and symbol information from Binance.
|
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 typing import Any
|
20
|
+
|
21
|
+
from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
|
22
|
+
from crypticorn.klines.client.api_response import ApiResponse
|
23
|
+
from crypticorn.klines.client.rest import RESTResponseType
|
24
|
+
|
25
|
+
|
26
|
+
class StatusApi:
|
27
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
28
|
+
Ref: https://openapi-generator.tech
|
29
|
+
|
30
|
+
Do not edit the class manually.
|
31
|
+
"""
|
32
|
+
|
33
|
+
def __init__(self, api_client=None) -> None:
|
34
|
+
if api_client is None:
|
35
|
+
api_client = ApiClient.get_default()
|
36
|
+
self.api_client = api_client
|
37
|
+
|
38
|
+
@validate_call
|
39
|
+
async def ping(
|
40
|
+
self,
|
41
|
+
_request_timeout: Union[
|
42
|
+
None,
|
43
|
+
Annotated[StrictFloat, Field(gt=0)],
|
44
|
+
Tuple[
|
45
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
46
|
+
],
|
47
|
+
] = None,
|
48
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
49
|
+
_content_type: Optional[StrictStr] = None,
|
50
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
51
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
52
|
+
) -> object:
|
53
|
+
"""Ping
|
54
|
+
|
55
|
+
|
56
|
+
:param _request_timeout: timeout setting for this request. If one
|
57
|
+
number provided, it will be total request
|
58
|
+
timeout. It can also be a pair (tuple) of
|
59
|
+
(connection, read) timeouts.
|
60
|
+
:type _request_timeout: int, tuple(int, int), optional
|
61
|
+
:param _request_auth: set to override the auth_settings for an a single
|
62
|
+
request; this effectively ignores the
|
63
|
+
authentication in the spec for a single request.
|
64
|
+
:type _request_auth: dict, optional
|
65
|
+
:param _content_type: force content-type for the request.
|
66
|
+
:type _content_type: str, Optional
|
67
|
+
:param _headers: set to override the headers for a single
|
68
|
+
request; this effectively ignores the headers
|
69
|
+
in the spec for a single request.
|
70
|
+
:type _headers: dict, optional
|
71
|
+
:param _host_index: set to override the host_index for a single
|
72
|
+
request; this effectively ignores the host_index
|
73
|
+
in the spec for a single request.
|
74
|
+
:type _host_index: int, optional
|
75
|
+
:return: Returns the result object.
|
76
|
+
""" # noqa: E501
|
77
|
+
|
78
|
+
_param = self._ping_serialize(
|
79
|
+
_request_auth=_request_auth,
|
80
|
+
_content_type=_content_type,
|
81
|
+
_headers=_headers,
|
82
|
+
_host_index=_host_index,
|
83
|
+
)
|
84
|
+
|
85
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
86
|
+
"200": "object",
|
87
|
+
}
|
88
|
+
response_data = await self.api_client.call_api(
|
89
|
+
*_param, _request_timeout=_request_timeout
|
90
|
+
)
|
91
|
+
await response_data.read()
|
92
|
+
return self.api_client.response_deserialize(
|
93
|
+
response_data=response_data,
|
94
|
+
response_types_map=_response_types_map,
|
95
|
+
).data
|
96
|
+
|
97
|
+
@validate_call
|
98
|
+
async def ping_with_http_info(
|
99
|
+
self,
|
100
|
+
_request_timeout: Union[
|
101
|
+
None,
|
102
|
+
Annotated[StrictFloat, Field(gt=0)],
|
103
|
+
Tuple[
|
104
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
105
|
+
],
|
106
|
+
] = None,
|
107
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
108
|
+
_content_type: Optional[StrictStr] = None,
|
109
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
110
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
111
|
+
) -> ApiResponse[object]:
|
112
|
+
"""Ping
|
113
|
+
|
114
|
+
|
115
|
+
:param _request_timeout: timeout setting for this request. If one
|
116
|
+
number provided, it will be total request
|
117
|
+
timeout. It can also be a pair (tuple) of
|
118
|
+
(connection, read) timeouts.
|
119
|
+
:type _request_timeout: int, tuple(int, int), optional
|
120
|
+
:param _request_auth: set to override the auth_settings for an a single
|
121
|
+
request; this effectively ignores the
|
122
|
+
authentication in the spec for a single request.
|
123
|
+
:type _request_auth: dict, optional
|
124
|
+
:param _content_type: force content-type for the request.
|
125
|
+
:type _content_type: str, Optional
|
126
|
+
:param _headers: set to override the headers for a single
|
127
|
+
request; this effectively ignores the headers
|
128
|
+
in the spec for a single request.
|
129
|
+
:type _headers: dict, optional
|
130
|
+
:param _host_index: set to override the host_index for a single
|
131
|
+
request; this effectively ignores the host_index
|
132
|
+
in the spec for a single request.
|
133
|
+
:type _host_index: int, optional
|
134
|
+
:return: Returns the result object.
|
135
|
+
""" # noqa: E501
|
136
|
+
|
137
|
+
_param = self._ping_serialize(
|
138
|
+
_request_auth=_request_auth,
|
139
|
+
_content_type=_content_type,
|
140
|
+
_headers=_headers,
|
141
|
+
_host_index=_host_index,
|
142
|
+
)
|
143
|
+
|
144
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
145
|
+
"200": "object",
|
146
|
+
}
|
147
|
+
response_data = await self.api_client.call_api(
|
148
|
+
*_param, _request_timeout=_request_timeout
|
149
|
+
)
|
150
|
+
await response_data.read()
|
151
|
+
return self.api_client.response_deserialize(
|
152
|
+
response_data=response_data,
|
153
|
+
response_types_map=_response_types_map,
|
154
|
+
)
|
155
|
+
|
156
|
+
@validate_call
|
157
|
+
async def ping_without_preload_content(
|
158
|
+
self,
|
159
|
+
_request_timeout: Union[
|
160
|
+
None,
|
161
|
+
Annotated[StrictFloat, Field(gt=0)],
|
162
|
+
Tuple[
|
163
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
164
|
+
],
|
165
|
+
] = None,
|
166
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
167
|
+
_content_type: Optional[StrictStr] = None,
|
168
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
169
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
170
|
+
) -> RESTResponseType:
|
171
|
+
"""Ping
|
172
|
+
|
173
|
+
|
174
|
+
:param _request_timeout: timeout setting for this request. If one
|
175
|
+
number provided, it will be total request
|
176
|
+
timeout. It can also be a pair (tuple) of
|
177
|
+
(connection, read) timeouts.
|
178
|
+
:type _request_timeout: int, tuple(int, int), optional
|
179
|
+
:param _request_auth: set to override the auth_settings for an a single
|
180
|
+
request; this effectively ignores the
|
181
|
+
authentication in the spec for a single request.
|
182
|
+
:type _request_auth: dict, optional
|
183
|
+
:param _content_type: force content-type for the request.
|
184
|
+
:type _content_type: str, Optional
|
185
|
+
:param _headers: set to override the headers for a single
|
186
|
+
request; this effectively ignores the headers
|
187
|
+
in the spec for a single request.
|
188
|
+
:type _headers: dict, optional
|
189
|
+
:param _host_index: set to override the host_index for a single
|
190
|
+
request; this effectively ignores the host_index
|
191
|
+
in the spec for a single request.
|
192
|
+
:type _host_index: int, optional
|
193
|
+
:return: Returns the result object.
|
194
|
+
""" # noqa: E501
|
195
|
+
|
196
|
+
_param = self._ping_serialize(
|
197
|
+
_request_auth=_request_auth,
|
198
|
+
_content_type=_content_type,
|
199
|
+
_headers=_headers,
|
200
|
+
_host_index=_host_index,
|
201
|
+
)
|
202
|
+
|
203
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
204
|
+
"200": "object",
|
205
|
+
}
|
206
|
+
response_data = await self.api_client.call_api(
|
207
|
+
*_param, _request_timeout=_request_timeout
|
208
|
+
)
|
209
|
+
return response_data.response
|
210
|
+
|
211
|
+
def _ping_serialize(
|
212
|
+
self,
|
213
|
+
_request_auth,
|
214
|
+
_content_type,
|
215
|
+
_headers,
|
216
|
+
_host_index,
|
217
|
+
) -> RequestSerialized:
|
218
|
+
|
219
|
+
_host = None
|
220
|
+
|
221
|
+
_collection_formats: Dict[str, str] = {}
|
222
|
+
|
223
|
+
_path_params: Dict[str, str] = {}
|
224
|
+
_query_params: List[Tuple[str, str]] = []
|
225
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
226
|
+
_form_params: List[Tuple[str, str]] = []
|
227
|
+
_files: Dict[
|
228
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
229
|
+
] = {}
|
230
|
+
_body_params: Optional[bytes] = None
|
231
|
+
|
232
|
+
# process the path parameters
|
233
|
+
# process the query parameters
|
234
|
+
# process the header parameters
|
235
|
+
# process the form parameters
|
236
|
+
# process the body parameter
|
237
|
+
|
238
|
+
# set the HTTP header `Accept`
|
239
|
+
if "Accept" not in _header_params:
|
240
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
241
|
+
["application/json"]
|
242
|
+
)
|
243
|
+
|
244
|
+
# authentication setting
|
245
|
+
_auth_settings: List[str] = []
|
246
|
+
|
247
|
+
return self.api_client.param_serialize(
|
248
|
+
method="GET",
|
249
|
+
resource_path="/",
|
250
|
+
path_params=_path_params,
|
251
|
+
query_params=_query_params,
|
252
|
+
header_params=_header_params,
|
253
|
+
body=_body_params,
|
254
|
+
post_params=_form_params,
|
255
|
+
files=_files,
|
256
|
+
auth_settings=_auth_settings,
|
257
|
+
collection_formats=_collection_formats,
|
258
|
+
_host=_host,
|
259
|
+
_request_auth=_request_auth,
|
260
|
+
)
|