crypticorn 2.16.0__py3-none-any.whl → 2.17.0rc2__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 +2 -2
- crypticorn/auth/client/api/admin_api.py +415 -13
- crypticorn/auth/client/api/auth_api.py +2622 -113
- crypticorn/auth/client/api/service_api.py +258 -7
- crypticorn/auth/client/api/user_api.py +2485 -270
- crypticorn/auth/client/api/wallet_api.py +1518 -77
- crypticorn/auth/client/models/create_api_key_request.py +2 -1
- crypticorn/auth/client/models/get_api_keys200_response_inner.py +2 -1
- crypticorn/auth/client/rest.py +23 -4
- crypticorn/auth/main.py +8 -5
- crypticorn/client.py +227 -59
- crypticorn/common/__init__.py +1 -0
- crypticorn/common/metrics.py +18 -0
- crypticorn/common/middleware.py +46 -0
- crypticorn/common/pagination.py +137 -18
- crypticorn/common/router/admin_router.py +12 -2
- crypticorn/common/utils.py +2 -1
- crypticorn/common/warnings.py +7 -0
- crypticorn/hive/client/api/admin_api.py +1234 -51
- crypticorn/hive/client/api/data_api.py +517 -13
- crypticorn/hive/client/api/models_api.py +1657 -83
- crypticorn/hive/client/api/status_api.py +415 -13
- crypticorn/hive/client/models/api_error_identifier.py +1 -1
- crypticorn/hive/client/rest.py +23 -4
- crypticorn/hive/main.py +99 -25
- crypticorn/klines/client/api/admin_api.py +1234 -51
- crypticorn/klines/client/api/change_in_timeframe_api.py +278 -7
- crypticorn/klines/client/api/funding_rates_api.py +324 -7
- crypticorn/klines/client/api/ohlcv_data_api.py +399 -7
- crypticorn/klines/client/api/status_api.py +415 -13
- crypticorn/klines/client/api/symbols_api.py +225 -7
- crypticorn/klines/client/api/udf_api.py +1393 -120
- crypticorn/klines/client/models/api_error_identifier.py +3 -1
- crypticorn/klines/client/rest.py +23 -4
- crypticorn/klines/main.py +89 -12
- crypticorn/metrics/client/api/admin_api.py +1234 -51
- crypticorn/metrics/client/api/exchanges_api.py +1405 -140
- crypticorn/metrics/client/api/indicators_api.py +640 -13
- crypticorn/metrics/client/api/logs_api.py +305 -7
- crypticorn/metrics/client/api/marketcap_api.py +1240 -60
- crypticorn/metrics/client/api/markets_api.py +352 -7
- crypticorn/metrics/client/api/quote_currencies_api.py +237 -7
- crypticorn/metrics/client/api/status_api.py +415 -13
- crypticorn/metrics/client/api/tokens_api.py +400 -13
- crypticorn/metrics/client/configuration.py +4 -2
- crypticorn/metrics/client/rest.py +23 -4
- crypticorn/metrics/main.py +113 -19
- crypticorn/pay/client/api/admin_api.py +1720 -126
- crypticorn/pay/client/api/now_payments_api.py +1013 -42
- crypticorn/pay/client/api/payments_api.py +580 -13
- crypticorn/pay/client/api/products_api.py +915 -25
- crypticorn/pay/client/api/status_api.py +415 -13
- crypticorn/pay/client/configuration.py +2 -2
- crypticorn/pay/client/models/api_error_identifier.py +7 -7
- crypticorn/pay/client/models/scope.py +1 -0
- crypticorn/pay/client/rest.py +23 -4
- crypticorn/pay/main.py +10 -6
- crypticorn/trade/client/__init__.py +2 -1
- crypticorn/trade/client/api/__init__.py +0 -1
- crypticorn/trade/client/api/admin_api.py +1718 -123
- crypticorn/trade/client/api/api_keys_api.py +1596 -103
- crypticorn/trade/client/api/bots_api.py +1106 -47
- crypticorn/trade/client/api/exchanges_api.py +592 -19
- crypticorn/trade/client/api/notifications_api.py +1340 -112
- crypticorn/trade/client/api/orders_api.py +240 -7
- crypticorn/trade/client/api/status_api.py +415 -13
- crypticorn/trade/client/api/strategies_api.py +1170 -69
- crypticorn/trade/client/api/trading_actions_api.py +650 -19
- crypticorn/trade/client/models/__init__.py +2 -0
- crypticorn/trade/client/models/exchange.py +6 -1
- crypticorn/trade/client/models/exchange_key_balance.py +111 -0
- crypticorn/trade/client/models/futures_balance.py +27 -25
- crypticorn/trade/client/models/spot_balance.py +110 -0
- crypticorn/trade/client/models/strategy.py +5 -3
- crypticorn/trade/client/models/strategy_create.py +6 -4
- crypticorn/trade/client/models/strategy_exchange_info.py +16 -4
- crypticorn/trade/client/models/strategy_update.py +2 -2
- crypticorn/trade/client/rest.py +23 -4
- crypticorn/trade/main.py +15 -12
- {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/METADATA +65 -20
- {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/RECORD +85 -83
- crypticorn/trade/client/api/futures_trading_panel_api.py +0 -1285
- {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/WHEEL +0 -0
- {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/licenses/LICENSE +0 -0
- {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/top_level.txt +0 -0
@@ -27,6 +27,24 @@ from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
|
|
27
27
|
from crypticorn.klines.client.api_response import ApiResponse
|
28
28
|
from crypticorn.klines.client.rest import RESTResponseType
|
29
29
|
|
30
|
+
# Import async_to_sync for sync methods
|
31
|
+
try:
|
32
|
+
from asgiref.sync import async_to_sync
|
33
|
+
|
34
|
+
_HAS_ASGIREF = True
|
35
|
+
except ImportError:
|
36
|
+
_HAS_ASGIREF = False
|
37
|
+
|
38
|
+
def async_to_sync(async_func):
|
39
|
+
"""Fallback decorator that raises an error if asgiref is not available."""
|
40
|
+
|
41
|
+
def wrapper(*args, **kwargs):
|
42
|
+
raise ImportError(
|
43
|
+
"asgiref is required for sync methods. Install with: pip install asgiref"
|
44
|
+
)
|
45
|
+
|
46
|
+
return wrapper
|
47
|
+
|
30
48
|
|
31
49
|
class ChangeInTimeframeApi:
|
32
50
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
@@ -35,13 +53,162 @@ class ChangeInTimeframeApi:
|
|
35
53
|
Do not edit the class manually.
|
36
54
|
"""
|
37
55
|
|
38
|
-
def __init__(self, api_client=None) -> None:
|
56
|
+
def __init__(self, api_client=None, is_sync: bool = False) -> None:
|
39
57
|
if api_client is None:
|
40
58
|
api_client = ApiClient.get_default()
|
41
59
|
self.api_client = api_client
|
60
|
+
self.is_sync = is_sync
|
42
61
|
|
43
62
|
@validate_call
|
44
|
-
|
63
|
+
def get_change_in_timeframe(
|
64
|
+
self,
|
65
|
+
market: Annotated[
|
66
|
+
Optional[MarketType],
|
67
|
+
Field(description="The market to calculate the change in"),
|
68
|
+
] = None,
|
69
|
+
timeframe: Annotated[
|
70
|
+
Optional[Timeframe],
|
71
|
+
Field(description="The timeframe to calculate the change in"),
|
72
|
+
] = None,
|
73
|
+
_request_timeout: Union[
|
74
|
+
None,
|
75
|
+
Annotated[StrictFloat, Field(gt=0)],
|
76
|
+
Tuple[
|
77
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
78
|
+
],
|
79
|
+
] = None,
|
80
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
81
|
+
_content_type: Optional[StrictStr] = None,
|
82
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
83
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
84
|
+
) -> List[ChangeInTimeframe]:
|
85
|
+
"""Get Change In Timeframe
|
86
|
+
|
87
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
88
|
+
"""
|
89
|
+
if self.is_sync:
|
90
|
+
return self._get_change_in_timeframe_sync(
|
91
|
+
market=market,
|
92
|
+
timeframe=timeframe,
|
93
|
+
_request_timeout=_request_timeout,
|
94
|
+
_request_auth=_request_auth,
|
95
|
+
_content_type=_content_type,
|
96
|
+
_headers=_headers,
|
97
|
+
_host_index=_host_index,
|
98
|
+
)
|
99
|
+
|
100
|
+
else:
|
101
|
+
return self._get_change_in_timeframe_async(
|
102
|
+
market=market,
|
103
|
+
timeframe=timeframe,
|
104
|
+
_request_timeout=_request_timeout,
|
105
|
+
_request_auth=_request_auth,
|
106
|
+
_content_type=_content_type,
|
107
|
+
_headers=_headers,
|
108
|
+
_host_index=_host_index,
|
109
|
+
)
|
110
|
+
|
111
|
+
@validate_call
|
112
|
+
def get_change_in_timeframe_with_http_info(
|
113
|
+
self,
|
114
|
+
market: Annotated[
|
115
|
+
Optional[MarketType],
|
116
|
+
Field(description="The market to calculate the change in"),
|
117
|
+
] = None,
|
118
|
+
timeframe: Annotated[
|
119
|
+
Optional[Timeframe],
|
120
|
+
Field(description="The timeframe to calculate the change in"),
|
121
|
+
] = None,
|
122
|
+
_request_timeout: Union[
|
123
|
+
None,
|
124
|
+
Annotated[StrictFloat, Field(gt=0)],
|
125
|
+
Tuple[
|
126
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
127
|
+
],
|
128
|
+
] = None,
|
129
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
130
|
+
_content_type: Optional[StrictStr] = None,
|
131
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
132
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
133
|
+
) -> ApiResponse[List[ChangeInTimeframe]]:
|
134
|
+
"""Get Change In Timeframe with HTTP info
|
135
|
+
|
136
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
137
|
+
"""
|
138
|
+
if self.is_sync:
|
139
|
+
return self._get_change_in_timeframe_sync_with_http_info(
|
140
|
+
market=market,
|
141
|
+
timeframe=timeframe,
|
142
|
+
_request_timeout=_request_timeout,
|
143
|
+
_request_auth=_request_auth,
|
144
|
+
_content_type=_content_type,
|
145
|
+
_headers=_headers,
|
146
|
+
_host_index=_host_index,
|
147
|
+
)
|
148
|
+
|
149
|
+
else:
|
150
|
+
return self._get_change_in_timeframe_async_with_http_info(
|
151
|
+
market=market,
|
152
|
+
timeframe=timeframe,
|
153
|
+
_request_timeout=_request_timeout,
|
154
|
+
_request_auth=_request_auth,
|
155
|
+
_content_type=_content_type,
|
156
|
+
_headers=_headers,
|
157
|
+
_host_index=_host_index,
|
158
|
+
)
|
159
|
+
|
160
|
+
@validate_call
|
161
|
+
def get_change_in_timeframe_without_preload_content(
|
162
|
+
self,
|
163
|
+
market: Annotated[
|
164
|
+
Optional[MarketType],
|
165
|
+
Field(description="The market to calculate the change in"),
|
166
|
+
] = None,
|
167
|
+
timeframe: Annotated[
|
168
|
+
Optional[Timeframe],
|
169
|
+
Field(description="The timeframe to calculate the change in"),
|
170
|
+
] = None,
|
171
|
+
_request_timeout: Union[
|
172
|
+
None,
|
173
|
+
Annotated[StrictFloat, Field(gt=0)],
|
174
|
+
Tuple[
|
175
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
176
|
+
],
|
177
|
+
] = None,
|
178
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
179
|
+
_content_type: Optional[StrictStr] = None,
|
180
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
181
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
182
|
+
) -> RESTResponseType:
|
183
|
+
"""Get Change In Timeframe without preloading content
|
184
|
+
|
185
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
186
|
+
"""
|
187
|
+
if self.is_sync:
|
188
|
+
return self._get_change_in_timeframe_sync_without_preload_content(
|
189
|
+
market=market,
|
190
|
+
timeframe=timeframe,
|
191
|
+
_request_timeout=_request_timeout,
|
192
|
+
_request_auth=_request_auth,
|
193
|
+
_content_type=_content_type,
|
194
|
+
_headers=_headers,
|
195
|
+
_host_index=_host_index,
|
196
|
+
)
|
197
|
+
|
198
|
+
else:
|
199
|
+
return self._get_change_in_timeframe_async_without_preload_content(
|
200
|
+
market=market,
|
201
|
+
timeframe=timeframe,
|
202
|
+
_request_timeout=_request_timeout,
|
203
|
+
_request_auth=_request_auth,
|
204
|
+
_content_type=_content_type,
|
205
|
+
_headers=_headers,
|
206
|
+
_host_index=_host_index,
|
207
|
+
)
|
208
|
+
|
209
|
+
# Private async implementation methods
|
210
|
+
@validate_call
|
211
|
+
async def _get_change_in_timeframe_async(
|
45
212
|
self,
|
46
213
|
market: Annotated[
|
47
214
|
Optional[MarketType],
|
@@ -115,7 +282,7 @@ class ChangeInTimeframeApi:
|
|
115
282
|
).data
|
116
283
|
|
117
284
|
@validate_call
|
118
|
-
async def
|
285
|
+
async def _get_change_in_timeframe_async_with_http_info(
|
119
286
|
self,
|
120
287
|
market: Annotated[
|
121
288
|
Optional[MarketType],
|
@@ -184,12 +351,11 @@ class ChangeInTimeframeApi:
|
|
184
351
|
)
|
185
352
|
await response_data.read()
|
186
353
|
return self.api_client.response_deserialize(
|
187
|
-
response_data=response_data,
|
188
|
-
response_types_map=_response_types_map,
|
354
|
+
response_data=response_data, response_types_map=_response_types_map
|
189
355
|
)
|
190
356
|
|
191
357
|
@validate_call
|
192
|
-
async def
|
358
|
+
async def _get_change_in_timeframe_async_without_preload_content(
|
193
359
|
self,
|
194
360
|
market: Annotated[
|
195
361
|
Optional[MarketType],
|
@@ -256,7 +422,112 @@ class ChangeInTimeframeApi:
|
|
256
422
|
response_data = await self.api_client.call_api(
|
257
423
|
*_param, _request_timeout=_request_timeout
|
258
424
|
)
|
259
|
-
return response_data
|
425
|
+
return response_data
|
426
|
+
|
427
|
+
# Private sync implementation methods
|
428
|
+
@validate_call
|
429
|
+
def _get_change_in_timeframe_sync(
|
430
|
+
self,
|
431
|
+
market: Annotated[
|
432
|
+
Optional[MarketType],
|
433
|
+
Field(description="The market to calculate the change in"),
|
434
|
+
] = None,
|
435
|
+
timeframe: Annotated[
|
436
|
+
Optional[Timeframe],
|
437
|
+
Field(description="The timeframe to calculate the change in"),
|
438
|
+
] = None,
|
439
|
+
_request_timeout: Union[
|
440
|
+
None,
|
441
|
+
Annotated[StrictFloat, Field(gt=0)],
|
442
|
+
Tuple[
|
443
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
444
|
+
],
|
445
|
+
] = None,
|
446
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
447
|
+
_content_type: Optional[StrictStr] = None,
|
448
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
449
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
450
|
+
) -> List[ChangeInTimeframe]:
|
451
|
+
"""Synchronous version of get_change_in_timeframe"""
|
452
|
+
return async_to_sync(self._get_change_in_timeframe_async)(
|
453
|
+
market=market,
|
454
|
+
timeframe=timeframe,
|
455
|
+
_request_timeout=_request_timeout,
|
456
|
+
_request_auth=_request_auth,
|
457
|
+
_content_type=_content_type,
|
458
|
+
_headers=_headers,
|
459
|
+
_host_index=_host_index,
|
460
|
+
)
|
461
|
+
|
462
|
+
@validate_call
|
463
|
+
def _get_change_in_timeframe_sync_with_http_info(
|
464
|
+
self,
|
465
|
+
market: Annotated[
|
466
|
+
Optional[MarketType],
|
467
|
+
Field(description="The market to calculate the change in"),
|
468
|
+
] = None,
|
469
|
+
timeframe: Annotated[
|
470
|
+
Optional[Timeframe],
|
471
|
+
Field(description="The timeframe to calculate the change in"),
|
472
|
+
] = None,
|
473
|
+
_request_timeout: Union[
|
474
|
+
None,
|
475
|
+
Annotated[StrictFloat, Field(gt=0)],
|
476
|
+
Tuple[
|
477
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
478
|
+
],
|
479
|
+
] = None,
|
480
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
481
|
+
_content_type: Optional[StrictStr] = None,
|
482
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
483
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
484
|
+
) -> ApiResponse[List[ChangeInTimeframe]]:
|
485
|
+
"""Synchronous version of get_change_in_timeframe_with_http_info"""
|
486
|
+
return async_to_sync(self._get_change_in_timeframe_async_with_http_info)(
|
487
|
+
market=market,
|
488
|
+
timeframe=timeframe,
|
489
|
+
_request_timeout=_request_timeout,
|
490
|
+
_request_auth=_request_auth,
|
491
|
+
_content_type=_content_type,
|
492
|
+
_headers=_headers,
|
493
|
+
_host_index=_host_index,
|
494
|
+
)
|
495
|
+
|
496
|
+
@validate_call
|
497
|
+
def _get_change_in_timeframe_sync_without_preload_content(
|
498
|
+
self,
|
499
|
+
market: Annotated[
|
500
|
+
Optional[MarketType],
|
501
|
+
Field(description="The market to calculate the change in"),
|
502
|
+
] = None,
|
503
|
+
timeframe: Annotated[
|
504
|
+
Optional[Timeframe],
|
505
|
+
Field(description="The timeframe to calculate the change in"),
|
506
|
+
] = None,
|
507
|
+
_request_timeout: Union[
|
508
|
+
None,
|
509
|
+
Annotated[StrictFloat, Field(gt=0)],
|
510
|
+
Tuple[
|
511
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
512
|
+
],
|
513
|
+
] = None,
|
514
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
515
|
+
_content_type: Optional[StrictStr] = None,
|
516
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
517
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
518
|
+
) -> RESTResponseType:
|
519
|
+
"""Synchronous version of get_change_in_timeframe_without_preload_content"""
|
520
|
+
return async_to_sync(
|
521
|
+
self._get_change_in_timeframe_async_without_preload_content
|
522
|
+
)(
|
523
|
+
market=market,
|
524
|
+
timeframe=timeframe,
|
525
|
+
_request_timeout=_request_timeout,
|
526
|
+
_request_auth=_request_auth,
|
527
|
+
_content_type=_content_type,
|
528
|
+
_headers=_headers,
|
529
|
+
_host_index=_host_index,
|
530
|
+
)
|
260
531
|
|
261
532
|
def _get_change_in_timeframe_serialize(
|
262
533
|
self,
|
@@ -25,6 +25,24 @@ from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
|
|
25
25
|
from crypticorn.klines.client.api_response import ApiResponse
|
26
26
|
from crypticorn.klines.client.rest import RESTResponseType
|
27
27
|
|
28
|
+
# Import async_to_sync for sync methods
|
29
|
+
try:
|
30
|
+
from asgiref.sync import async_to_sync
|
31
|
+
|
32
|
+
_HAS_ASGIREF = True
|
33
|
+
except ImportError:
|
34
|
+
_HAS_ASGIREF = False
|
35
|
+
|
36
|
+
def async_to_sync(async_func):
|
37
|
+
"""Fallback decorator that raises an error if asgiref is not available."""
|
38
|
+
|
39
|
+
def wrapper(*args, **kwargs):
|
40
|
+
raise ImportError(
|
41
|
+
"asgiref is required for sync methods. Install with: pip install asgiref"
|
42
|
+
)
|
43
|
+
|
44
|
+
return wrapper
|
45
|
+
|
28
46
|
|
29
47
|
class FundingRatesApi:
|
30
48
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
@@ -33,13 +51,189 @@ class FundingRatesApi:
|
|
33
51
|
Do not edit the class manually.
|
34
52
|
"""
|
35
53
|
|
36
|
-
def __init__(self, api_client=None) -> None:
|
54
|
+
def __init__(self, api_client=None, is_sync: bool = False) -> None:
|
37
55
|
if api_client is None:
|
38
56
|
api_client = ApiClient.get_default()
|
39
57
|
self.api_client = api_client
|
58
|
+
self.is_sync = is_sync
|
40
59
|
|
41
60
|
@validate_call
|
42
|
-
|
61
|
+
def get_funding_rates(
|
62
|
+
self,
|
63
|
+
symbol: Annotated[
|
64
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
65
|
+
],
|
66
|
+
start: Annotated[
|
67
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
68
|
+
] = None,
|
69
|
+
end: Annotated[
|
70
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
71
|
+
] = None,
|
72
|
+
limit: Annotated[
|
73
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
74
|
+
Field(description="Number of funding rates to return"),
|
75
|
+
] = None,
|
76
|
+
_request_timeout: Union[
|
77
|
+
None,
|
78
|
+
Annotated[StrictFloat, Field(gt=0)],
|
79
|
+
Tuple[
|
80
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
81
|
+
],
|
82
|
+
] = None,
|
83
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
84
|
+
_content_type: Optional[StrictStr] = None,
|
85
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
86
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
87
|
+
) -> FundingRateResponse:
|
88
|
+
"""Funding Rate
|
89
|
+
|
90
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
91
|
+
"""
|
92
|
+
if self.is_sync:
|
93
|
+
return self._get_funding_rates_sync(
|
94
|
+
symbol=symbol,
|
95
|
+
start=start,
|
96
|
+
end=end,
|
97
|
+
limit=limit,
|
98
|
+
_request_timeout=_request_timeout,
|
99
|
+
_request_auth=_request_auth,
|
100
|
+
_content_type=_content_type,
|
101
|
+
_headers=_headers,
|
102
|
+
_host_index=_host_index,
|
103
|
+
)
|
104
|
+
|
105
|
+
else:
|
106
|
+
return self._get_funding_rates_async(
|
107
|
+
symbol=symbol,
|
108
|
+
start=start,
|
109
|
+
end=end,
|
110
|
+
limit=limit,
|
111
|
+
_request_timeout=_request_timeout,
|
112
|
+
_request_auth=_request_auth,
|
113
|
+
_content_type=_content_type,
|
114
|
+
_headers=_headers,
|
115
|
+
_host_index=_host_index,
|
116
|
+
)
|
117
|
+
|
118
|
+
@validate_call
|
119
|
+
def get_funding_rates_with_http_info(
|
120
|
+
self,
|
121
|
+
symbol: Annotated[
|
122
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
123
|
+
],
|
124
|
+
start: Annotated[
|
125
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
126
|
+
] = None,
|
127
|
+
end: Annotated[
|
128
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
129
|
+
] = None,
|
130
|
+
limit: Annotated[
|
131
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
132
|
+
Field(description="Number of funding rates to return"),
|
133
|
+
] = None,
|
134
|
+
_request_timeout: Union[
|
135
|
+
None,
|
136
|
+
Annotated[StrictFloat, Field(gt=0)],
|
137
|
+
Tuple[
|
138
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
139
|
+
],
|
140
|
+
] = None,
|
141
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
142
|
+
_content_type: Optional[StrictStr] = None,
|
143
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
144
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
145
|
+
) -> ApiResponse[FundingRateResponse]:
|
146
|
+
"""Funding Rate with HTTP info
|
147
|
+
|
148
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
149
|
+
"""
|
150
|
+
if self.is_sync:
|
151
|
+
return self._get_funding_rates_sync_with_http_info(
|
152
|
+
symbol=symbol,
|
153
|
+
start=start,
|
154
|
+
end=end,
|
155
|
+
limit=limit,
|
156
|
+
_request_timeout=_request_timeout,
|
157
|
+
_request_auth=_request_auth,
|
158
|
+
_content_type=_content_type,
|
159
|
+
_headers=_headers,
|
160
|
+
_host_index=_host_index,
|
161
|
+
)
|
162
|
+
|
163
|
+
else:
|
164
|
+
return self._get_funding_rates_async_with_http_info(
|
165
|
+
symbol=symbol,
|
166
|
+
start=start,
|
167
|
+
end=end,
|
168
|
+
limit=limit,
|
169
|
+
_request_timeout=_request_timeout,
|
170
|
+
_request_auth=_request_auth,
|
171
|
+
_content_type=_content_type,
|
172
|
+
_headers=_headers,
|
173
|
+
_host_index=_host_index,
|
174
|
+
)
|
175
|
+
|
176
|
+
@validate_call
|
177
|
+
def get_funding_rates_without_preload_content(
|
178
|
+
self,
|
179
|
+
symbol: Annotated[
|
180
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
181
|
+
],
|
182
|
+
start: Annotated[
|
183
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
184
|
+
] = None,
|
185
|
+
end: Annotated[
|
186
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
187
|
+
] = None,
|
188
|
+
limit: Annotated[
|
189
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
190
|
+
Field(description="Number of funding rates to return"),
|
191
|
+
] = None,
|
192
|
+
_request_timeout: Union[
|
193
|
+
None,
|
194
|
+
Annotated[StrictFloat, Field(gt=0)],
|
195
|
+
Tuple[
|
196
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
197
|
+
],
|
198
|
+
] = None,
|
199
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
200
|
+
_content_type: Optional[StrictStr] = None,
|
201
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
202
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
203
|
+
) -> RESTResponseType:
|
204
|
+
"""Funding Rate without preloading content
|
205
|
+
|
206
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
207
|
+
"""
|
208
|
+
if self.is_sync:
|
209
|
+
return self._get_funding_rates_sync_without_preload_content(
|
210
|
+
symbol=symbol,
|
211
|
+
start=start,
|
212
|
+
end=end,
|
213
|
+
limit=limit,
|
214
|
+
_request_timeout=_request_timeout,
|
215
|
+
_request_auth=_request_auth,
|
216
|
+
_content_type=_content_type,
|
217
|
+
_headers=_headers,
|
218
|
+
_host_index=_host_index,
|
219
|
+
)
|
220
|
+
|
221
|
+
else:
|
222
|
+
return self._get_funding_rates_async_without_preload_content(
|
223
|
+
symbol=symbol,
|
224
|
+
start=start,
|
225
|
+
end=end,
|
226
|
+
limit=limit,
|
227
|
+
_request_timeout=_request_timeout,
|
228
|
+
_request_auth=_request_auth,
|
229
|
+
_content_type=_content_type,
|
230
|
+
_headers=_headers,
|
231
|
+
_host_index=_host_index,
|
232
|
+
)
|
233
|
+
|
234
|
+
# Private async implementation methods
|
235
|
+
@validate_call
|
236
|
+
async def _get_funding_rates_async(
|
43
237
|
self,
|
44
238
|
symbol: Annotated[
|
45
239
|
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
@@ -124,7 +318,7 @@ class FundingRatesApi:
|
|
124
318
|
).data
|
125
319
|
|
126
320
|
@validate_call
|
127
|
-
async def
|
321
|
+
async def _get_funding_rates_async_with_http_info(
|
128
322
|
self,
|
129
323
|
symbol: Annotated[
|
130
324
|
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
@@ -204,12 +398,11 @@ class FundingRatesApi:
|
|
204
398
|
)
|
205
399
|
await response_data.read()
|
206
400
|
return self.api_client.response_deserialize(
|
207
|
-
response_data=response_data,
|
208
|
-
response_types_map=_response_types_map,
|
401
|
+
response_data=response_data, response_types_map=_response_types_map
|
209
402
|
)
|
210
403
|
|
211
404
|
@validate_call
|
212
|
-
async def
|
405
|
+
async def _get_funding_rates_async_without_preload_content(
|
213
406
|
self,
|
214
407
|
symbol: Annotated[
|
215
408
|
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
@@ -287,7 +480,131 @@ class FundingRatesApi:
|
|
287
480
|
response_data = await self.api_client.call_api(
|
288
481
|
*_param, _request_timeout=_request_timeout
|
289
482
|
)
|
290
|
-
return response_data
|
483
|
+
return response_data
|
484
|
+
|
485
|
+
# Private sync implementation methods
|
486
|
+
@validate_call
|
487
|
+
def _get_funding_rates_sync(
|
488
|
+
self,
|
489
|
+
symbol: Annotated[
|
490
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
491
|
+
],
|
492
|
+
start: Annotated[
|
493
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
494
|
+
] = None,
|
495
|
+
end: Annotated[
|
496
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
497
|
+
] = None,
|
498
|
+
limit: Annotated[
|
499
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
500
|
+
Field(description="Number of funding rates to return"),
|
501
|
+
] = None,
|
502
|
+
_request_timeout: Union[
|
503
|
+
None,
|
504
|
+
Annotated[StrictFloat, Field(gt=0)],
|
505
|
+
Tuple[
|
506
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
507
|
+
],
|
508
|
+
] = None,
|
509
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
510
|
+
_content_type: Optional[StrictStr] = None,
|
511
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
512
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
513
|
+
) -> FundingRateResponse:
|
514
|
+
"""Synchronous version of get_funding_rates"""
|
515
|
+
return async_to_sync(self._get_funding_rates_async)(
|
516
|
+
symbol=symbol,
|
517
|
+
start=start,
|
518
|
+
end=end,
|
519
|
+
limit=limit,
|
520
|
+
_request_timeout=_request_timeout,
|
521
|
+
_request_auth=_request_auth,
|
522
|
+
_content_type=_content_type,
|
523
|
+
_headers=_headers,
|
524
|
+
_host_index=_host_index,
|
525
|
+
)
|
526
|
+
|
527
|
+
@validate_call
|
528
|
+
def _get_funding_rates_sync_with_http_info(
|
529
|
+
self,
|
530
|
+
symbol: Annotated[
|
531
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
532
|
+
],
|
533
|
+
start: Annotated[
|
534
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
535
|
+
] = None,
|
536
|
+
end: Annotated[
|
537
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
538
|
+
] = None,
|
539
|
+
limit: Annotated[
|
540
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
541
|
+
Field(description="Number of funding rates to return"),
|
542
|
+
] = None,
|
543
|
+
_request_timeout: Union[
|
544
|
+
None,
|
545
|
+
Annotated[StrictFloat, Field(gt=0)],
|
546
|
+
Tuple[
|
547
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
548
|
+
],
|
549
|
+
] = None,
|
550
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
551
|
+
_content_type: Optional[StrictStr] = None,
|
552
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
553
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
554
|
+
) -> ApiResponse[FundingRateResponse]:
|
555
|
+
"""Synchronous version of get_funding_rates_with_http_info"""
|
556
|
+
return async_to_sync(self._get_funding_rates_async_with_http_info)(
|
557
|
+
symbol=symbol,
|
558
|
+
start=start,
|
559
|
+
end=end,
|
560
|
+
limit=limit,
|
561
|
+
_request_timeout=_request_timeout,
|
562
|
+
_request_auth=_request_auth,
|
563
|
+
_content_type=_content_type,
|
564
|
+
_headers=_headers,
|
565
|
+
_host_index=_host_index,
|
566
|
+
)
|
567
|
+
|
568
|
+
@validate_call
|
569
|
+
def _get_funding_rates_sync_without_preload_content(
|
570
|
+
self,
|
571
|
+
symbol: Annotated[
|
572
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
573
|
+
],
|
574
|
+
start: Annotated[
|
575
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
576
|
+
] = None,
|
577
|
+
end: Annotated[
|
578
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
579
|
+
] = None,
|
580
|
+
limit: Annotated[
|
581
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
582
|
+
Field(description="Number of funding rates to return"),
|
583
|
+
] = None,
|
584
|
+
_request_timeout: Union[
|
585
|
+
None,
|
586
|
+
Annotated[StrictFloat, Field(gt=0)],
|
587
|
+
Tuple[
|
588
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
589
|
+
],
|
590
|
+
] = None,
|
591
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
592
|
+
_content_type: Optional[StrictStr] = None,
|
593
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
594
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
595
|
+
) -> RESTResponseType:
|
596
|
+
"""Synchronous version of get_funding_rates_without_preload_content"""
|
597
|
+
return async_to_sync(self._get_funding_rates_async_without_preload_content)(
|
598
|
+
symbol=symbol,
|
599
|
+
start=start,
|
600
|
+
end=end,
|
601
|
+
limit=limit,
|
602
|
+
_request_timeout=_request_timeout,
|
603
|
+
_request_auth=_request_auth,
|
604
|
+
_content_type=_content_type,
|
605
|
+
_headers=_headers,
|
606
|
+
_host_index=_host_index,
|
607
|
+
)
|
291
608
|
|
292
609
|
def _get_funding_rates_serialize(
|
293
610
|
self,
|