crypticorn 2.17.0rc1__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 +0 -1
- crypticorn/common/metrics.py +4 -6
- crypticorn/common/middleware.py +10 -5
- crypticorn/common/pagination.py +137 -18
- crypticorn/common/router/admin_router.py +1 -1
- crypticorn/common/utils.py +2 -1
- crypticorn/common/warnings.py +1 -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.17.0rc1.dist-info → crypticorn-2.17.0rc2.dist-info}/METADATA +64 -20
- {crypticorn-2.17.0rc1.dist-info → crypticorn-2.17.0rc2.dist-info}/RECORD +85 -84
- crypticorn/trade/client/api/futures_trading_panel_api.py +0 -1285
- {crypticorn-2.17.0rc1.dist-info → crypticorn-2.17.0rc2.dist-info}/WHEEL +0 -0
- {crypticorn-2.17.0rc1.dist-info → crypticorn-2.17.0rc2.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.17.0rc1.dist-info → crypticorn-2.17.0rc2.dist-info}/licenses/LICENSE +0 -0
- {crypticorn-2.17.0rc1.dist-info → crypticorn-2.17.0rc2.dist-info}/top_level.txt +0 -0
@@ -22,6 +22,24 @@ from crypticorn.metrics.client.api_client import ApiClient, RequestSerialized
|
|
22
22
|
from crypticorn.metrics.client.api_response import ApiResponse
|
23
23
|
from crypticorn.metrics.client.rest import RESTResponseType
|
24
24
|
|
25
|
+
# Import async_to_sync for sync methods
|
26
|
+
try:
|
27
|
+
from asgiref.sync import async_to_sync
|
28
|
+
|
29
|
+
_HAS_ASGIREF = True
|
30
|
+
except ImportError:
|
31
|
+
_HAS_ASGIREF = False
|
32
|
+
|
33
|
+
def async_to_sync(async_func):
|
34
|
+
"""Fallback decorator that raises an error if asgiref is not available."""
|
35
|
+
|
36
|
+
def wrapper(*args, **kwargs):
|
37
|
+
raise ImportError(
|
38
|
+
"asgiref is required for sync methods. Install with: pip install asgiref"
|
39
|
+
)
|
40
|
+
|
41
|
+
return wrapper
|
42
|
+
|
25
43
|
|
26
44
|
class TokensApi:
|
27
45
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
@@ -30,13 +48,126 @@ class TokensApi:
|
|
30
48
|
Do not edit the class manually.
|
31
49
|
"""
|
32
50
|
|
33
|
-
def __init__(self, api_client=None) -> None:
|
51
|
+
def __init__(self, api_client=None, is_sync: bool = False) -> None:
|
34
52
|
if api_client is None:
|
35
53
|
api_client = ApiClient.get_default()
|
36
54
|
self.api_client = api_client
|
55
|
+
self.is_sync = is_sync
|
37
56
|
|
38
57
|
@validate_call
|
39
|
-
|
58
|
+
def get_stable_tokens(
|
59
|
+
self,
|
60
|
+
_request_timeout: Union[
|
61
|
+
None,
|
62
|
+
Annotated[StrictFloat, Field(gt=0)],
|
63
|
+
Tuple[
|
64
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
65
|
+
],
|
66
|
+
] = None,
|
67
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
68
|
+
_content_type: Optional[StrictStr] = None,
|
69
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
70
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
71
|
+
) -> List[Dict[str, object]]:
|
72
|
+
"""Get Stable Tokens
|
73
|
+
|
74
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
75
|
+
"""
|
76
|
+
if self.is_sync:
|
77
|
+
return self._get_stable_tokens_sync(
|
78
|
+
_request_timeout=_request_timeout,
|
79
|
+
_request_auth=_request_auth,
|
80
|
+
_content_type=_content_type,
|
81
|
+
_headers=_headers,
|
82
|
+
_host_index=_host_index,
|
83
|
+
)
|
84
|
+
|
85
|
+
else:
|
86
|
+
return self._get_stable_tokens_async(
|
87
|
+
_request_timeout=_request_timeout,
|
88
|
+
_request_auth=_request_auth,
|
89
|
+
_content_type=_content_type,
|
90
|
+
_headers=_headers,
|
91
|
+
_host_index=_host_index,
|
92
|
+
)
|
93
|
+
|
94
|
+
@validate_call
|
95
|
+
def get_stable_tokens_with_http_info(
|
96
|
+
self,
|
97
|
+
_request_timeout: Union[
|
98
|
+
None,
|
99
|
+
Annotated[StrictFloat, Field(gt=0)],
|
100
|
+
Tuple[
|
101
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
102
|
+
],
|
103
|
+
] = None,
|
104
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
105
|
+
_content_type: Optional[StrictStr] = None,
|
106
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
107
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
108
|
+
) -> ApiResponse[List[Dict[str, object]]]:
|
109
|
+
"""Get Stable Tokens with HTTP info
|
110
|
+
|
111
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
112
|
+
"""
|
113
|
+
if self.is_sync:
|
114
|
+
return self._get_stable_tokens_sync_with_http_info(
|
115
|
+
_request_timeout=_request_timeout,
|
116
|
+
_request_auth=_request_auth,
|
117
|
+
_content_type=_content_type,
|
118
|
+
_headers=_headers,
|
119
|
+
_host_index=_host_index,
|
120
|
+
)
|
121
|
+
|
122
|
+
else:
|
123
|
+
return self._get_stable_tokens_async_with_http_info(
|
124
|
+
_request_timeout=_request_timeout,
|
125
|
+
_request_auth=_request_auth,
|
126
|
+
_content_type=_content_type,
|
127
|
+
_headers=_headers,
|
128
|
+
_host_index=_host_index,
|
129
|
+
)
|
130
|
+
|
131
|
+
@validate_call
|
132
|
+
def get_stable_tokens_without_preload_content(
|
133
|
+
self,
|
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
|
+
) -> RESTResponseType:
|
146
|
+
"""Get Stable Tokens without preloading content
|
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_stable_tokens_sync_without_preload_content(
|
152
|
+
_request_timeout=_request_timeout,
|
153
|
+
_request_auth=_request_auth,
|
154
|
+
_content_type=_content_type,
|
155
|
+
_headers=_headers,
|
156
|
+
_host_index=_host_index,
|
157
|
+
)
|
158
|
+
|
159
|
+
else:
|
160
|
+
return self._get_stable_tokens_async_without_preload_content(
|
161
|
+
_request_timeout=_request_timeout,
|
162
|
+
_request_auth=_request_auth,
|
163
|
+
_content_type=_content_type,
|
164
|
+
_headers=_headers,
|
165
|
+
_host_index=_host_index,
|
166
|
+
)
|
167
|
+
|
168
|
+
# Private async implementation methods
|
169
|
+
@validate_call
|
170
|
+
async def _get_stable_tokens_async(
|
40
171
|
self,
|
41
172
|
_request_timeout: Union[
|
42
173
|
None,
|
@@ -96,7 +227,7 @@ class TokensApi:
|
|
96
227
|
).data
|
97
228
|
|
98
229
|
@validate_call
|
99
|
-
async def
|
230
|
+
async def _get_stable_tokens_async_with_http_info(
|
100
231
|
self,
|
101
232
|
_request_timeout: Union[
|
102
233
|
None,
|
@@ -151,12 +282,11 @@ class TokensApi:
|
|
151
282
|
)
|
152
283
|
await response_data.read()
|
153
284
|
return self.api_client.response_deserialize(
|
154
|
-
response_data=response_data,
|
155
|
-
response_types_map=_response_types_map,
|
285
|
+
response_data=response_data, response_types_map=_response_types_map
|
156
286
|
)
|
157
287
|
|
158
288
|
@validate_call
|
159
|
-
async def
|
289
|
+
async def _get_stable_tokens_async_without_preload_content(
|
160
290
|
self,
|
161
291
|
_request_timeout: Union[
|
162
292
|
None,
|
@@ -209,7 +339,80 @@ class TokensApi:
|
|
209
339
|
response_data = await self.api_client.call_api(
|
210
340
|
*_param, _request_timeout=_request_timeout
|
211
341
|
)
|
212
|
-
return response_data
|
342
|
+
return response_data
|
343
|
+
|
344
|
+
# Private sync implementation methods
|
345
|
+
@validate_call
|
346
|
+
def _get_stable_tokens_sync(
|
347
|
+
self,
|
348
|
+
_request_timeout: Union[
|
349
|
+
None,
|
350
|
+
Annotated[StrictFloat, Field(gt=0)],
|
351
|
+
Tuple[
|
352
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
353
|
+
],
|
354
|
+
] = None,
|
355
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
356
|
+
_content_type: Optional[StrictStr] = None,
|
357
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
358
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
359
|
+
) -> List[Dict[str, object]]:
|
360
|
+
"""Synchronous version of get_stable_tokens"""
|
361
|
+
return async_to_sync(self._get_stable_tokens_async)(
|
362
|
+
_request_timeout=_request_timeout,
|
363
|
+
_request_auth=_request_auth,
|
364
|
+
_content_type=_content_type,
|
365
|
+
_headers=_headers,
|
366
|
+
_host_index=_host_index,
|
367
|
+
)
|
368
|
+
|
369
|
+
@validate_call
|
370
|
+
def _get_stable_tokens_sync_with_http_info(
|
371
|
+
self,
|
372
|
+
_request_timeout: Union[
|
373
|
+
None,
|
374
|
+
Annotated[StrictFloat, Field(gt=0)],
|
375
|
+
Tuple[
|
376
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
377
|
+
],
|
378
|
+
] = None,
|
379
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
380
|
+
_content_type: Optional[StrictStr] = None,
|
381
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
382
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
383
|
+
) -> ApiResponse[List[Dict[str, object]]]:
|
384
|
+
"""Synchronous version of get_stable_tokens_with_http_info"""
|
385
|
+
return async_to_sync(self._get_stable_tokens_async_with_http_info)(
|
386
|
+
_request_timeout=_request_timeout,
|
387
|
+
_request_auth=_request_auth,
|
388
|
+
_content_type=_content_type,
|
389
|
+
_headers=_headers,
|
390
|
+
_host_index=_host_index,
|
391
|
+
)
|
392
|
+
|
393
|
+
@validate_call
|
394
|
+
def _get_stable_tokens_sync_without_preload_content(
|
395
|
+
self,
|
396
|
+
_request_timeout: Union[
|
397
|
+
None,
|
398
|
+
Annotated[StrictFloat, Field(gt=0)],
|
399
|
+
Tuple[
|
400
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
401
|
+
],
|
402
|
+
] = None,
|
403
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
404
|
+
_content_type: Optional[StrictStr] = None,
|
405
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
406
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
407
|
+
) -> RESTResponseType:
|
408
|
+
"""Synchronous version of get_stable_tokens_without_preload_content"""
|
409
|
+
return async_to_sync(self._get_stable_tokens_async_without_preload_content)(
|
410
|
+
_request_timeout=_request_timeout,
|
411
|
+
_request_auth=_request_auth,
|
412
|
+
_content_type=_content_type,
|
413
|
+
_headers=_headers,
|
414
|
+
_host_index=_host_index,
|
415
|
+
)
|
213
416
|
|
214
417
|
def _get_stable_tokens_serialize(
|
215
418
|
self,
|
@@ -263,7 +466,119 @@ class TokensApi:
|
|
263
466
|
)
|
264
467
|
|
265
468
|
@validate_call
|
266
|
-
|
469
|
+
def get_wrapped_tokens(
|
470
|
+
self,
|
471
|
+
_request_timeout: Union[
|
472
|
+
None,
|
473
|
+
Annotated[StrictFloat, Field(gt=0)],
|
474
|
+
Tuple[
|
475
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
476
|
+
],
|
477
|
+
] = None,
|
478
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
479
|
+
_content_type: Optional[StrictStr] = None,
|
480
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
481
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
482
|
+
) -> List[Dict[str, object]]:
|
483
|
+
"""Get Wrapped Tokens
|
484
|
+
|
485
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
486
|
+
"""
|
487
|
+
if self.is_sync:
|
488
|
+
return self._get_wrapped_tokens_sync(
|
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
|
+
else:
|
497
|
+
return self._get_wrapped_tokens_async(
|
498
|
+
_request_timeout=_request_timeout,
|
499
|
+
_request_auth=_request_auth,
|
500
|
+
_content_type=_content_type,
|
501
|
+
_headers=_headers,
|
502
|
+
_host_index=_host_index,
|
503
|
+
)
|
504
|
+
|
505
|
+
@validate_call
|
506
|
+
def get_wrapped_tokens_with_http_info(
|
507
|
+
self,
|
508
|
+
_request_timeout: Union[
|
509
|
+
None,
|
510
|
+
Annotated[StrictFloat, Field(gt=0)],
|
511
|
+
Tuple[
|
512
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
513
|
+
],
|
514
|
+
] = None,
|
515
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
516
|
+
_content_type: Optional[StrictStr] = None,
|
517
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
518
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
519
|
+
) -> ApiResponse[List[Dict[str, object]]]:
|
520
|
+
"""Get Wrapped Tokens with HTTP info
|
521
|
+
|
522
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
523
|
+
"""
|
524
|
+
if self.is_sync:
|
525
|
+
return self._get_wrapped_tokens_sync_with_http_info(
|
526
|
+
_request_timeout=_request_timeout,
|
527
|
+
_request_auth=_request_auth,
|
528
|
+
_content_type=_content_type,
|
529
|
+
_headers=_headers,
|
530
|
+
_host_index=_host_index,
|
531
|
+
)
|
532
|
+
|
533
|
+
else:
|
534
|
+
return self._get_wrapped_tokens_async_with_http_info(
|
535
|
+
_request_timeout=_request_timeout,
|
536
|
+
_request_auth=_request_auth,
|
537
|
+
_content_type=_content_type,
|
538
|
+
_headers=_headers,
|
539
|
+
_host_index=_host_index,
|
540
|
+
)
|
541
|
+
|
542
|
+
@validate_call
|
543
|
+
def get_wrapped_tokens_without_preload_content(
|
544
|
+
self,
|
545
|
+
_request_timeout: Union[
|
546
|
+
None,
|
547
|
+
Annotated[StrictFloat, Field(gt=0)],
|
548
|
+
Tuple[
|
549
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
550
|
+
],
|
551
|
+
] = None,
|
552
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
553
|
+
_content_type: Optional[StrictStr] = None,
|
554
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
555
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
556
|
+
) -> RESTResponseType:
|
557
|
+
"""Get Wrapped Tokens without preloading content
|
558
|
+
|
559
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
560
|
+
"""
|
561
|
+
if self.is_sync:
|
562
|
+
return self._get_wrapped_tokens_sync_without_preload_content(
|
563
|
+
_request_timeout=_request_timeout,
|
564
|
+
_request_auth=_request_auth,
|
565
|
+
_content_type=_content_type,
|
566
|
+
_headers=_headers,
|
567
|
+
_host_index=_host_index,
|
568
|
+
)
|
569
|
+
|
570
|
+
else:
|
571
|
+
return self._get_wrapped_tokens_async_without_preload_content(
|
572
|
+
_request_timeout=_request_timeout,
|
573
|
+
_request_auth=_request_auth,
|
574
|
+
_content_type=_content_type,
|
575
|
+
_headers=_headers,
|
576
|
+
_host_index=_host_index,
|
577
|
+
)
|
578
|
+
|
579
|
+
# Private async implementation methods
|
580
|
+
@validate_call
|
581
|
+
async def _get_wrapped_tokens_async(
|
267
582
|
self,
|
268
583
|
_request_timeout: Union[
|
269
584
|
None,
|
@@ -323,7 +638,7 @@ class TokensApi:
|
|
323
638
|
).data
|
324
639
|
|
325
640
|
@validate_call
|
326
|
-
async def
|
641
|
+
async def _get_wrapped_tokens_async_with_http_info(
|
327
642
|
self,
|
328
643
|
_request_timeout: Union[
|
329
644
|
None,
|
@@ -378,12 +693,11 @@ class TokensApi:
|
|
378
693
|
)
|
379
694
|
await response_data.read()
|
380
695
|
return self.api_client.response_deserialize(
|
381
|
-
response_data=response_data,
|
382
|
-
response_types_map=_response_types_map,
|
696
|
+
response_data=response_data, response_types_map=_response_types_map
|
383
697
|
)
|
384
698
|
|
385
699
|
@validate_call
|
386
|
-
async def
|
700
|
+
async def _get_wrapped_tokens_async_without_preload_content(
|
387
701
|
self,
|
388
702
|
_request_timeout: Union[
|
389
703
|
None,
|
@@ -436,7 +750,80 @@ class TokensApi:
|
|
436
750
|
response_data = await self.api_client.call_api(
|
437
751
|
*_param, _request_timeout=_request_timeout
|
438
752
|
)
|
439
|
-
return response_data
|
753
|
+
return response_data
|
754
|
+
|
755
|
+
# Private sync implementation methods
|
756
|
+
@validate_call
|
757
|
+
def _get_wrapped_tokens_sync(
|
758
|
+
self,
|
759
|
+
_request_timeout: Union[
|
760
|
+
None,
|
761
|
+
Annotated[StrictFloat, Field(gt=0)],
|
762
|
+
Tuple[
|
763
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
764
|
+
],
|
765
|
+
] = None,
|
766
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
767
|
+
_content_type: Optional[StrictStr] = None,
|
768
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
769
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
770
|
+
) -> List[Dict[str, object]]:
|
771
|
+
"""Synchronous version of get_wrapped_tokens"""
|
772
|
+
return async_to_sync(self._get_wrapped_tokens_async)(
|
773
|
+
_request_timeout=_request_timeout,
|
774
|
+
_request_auth=_request_auth,
|
775
|
+
_content_type=_content_type,
|
776
|
+
_headers=_headers,
|
777
|
+
_host_index=_host_index,
|
778
|
+
)
|
779
|
+
|
780
|
+
@validate_call
|
781
|
+
def _get_wrapped_tokens_sync_with_http_info(
|
782
|
+
self,
|
783
|
+
_request_timeout: Union[
|
784
|
+
None,
|
785
|
+
Annotated[StrictFloat, Field(gt=0)],
|
786
|
+
Tuple[
|
787
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
788
|
+
],
|
789
|
+
] = None,
|
790
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
791
|
+
_content_type: Optional[StrictStr] = None,
|
792
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
793
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
794
|
+
) -> ApiResponse[List[Dict[str, object]]]:
|
795
|
+
"""Synchronous version of get_wrapped_tokens_with_http_info"""
|
796
|
+
return async_to_sync(self._get_wrapped_tokens_async_with_http_info)(
|
797
|
+
_request_timeout=_request_timeout,
|
798
|
+
_request_auth=_request_auth,
|
799
|
+
_content_type=_content_type,
|
800
|
+
_headers=_headers,
|
801
|
+
_host_index=_host_index,
|
802
|
+
)
|
803
|
+
|
804
|
+
@validate_call
|
805
|
+
def _get_wrapped_tokens_sync_without_preload_content(
|
806
|
+
self,
|
807
|
+
_request_timeout: Union[
|
808
|
+
None,
|
809
|
+
Annotated[StrictFloat, Field(gt=0)],
|
810
|
+
Tuple[
|
811
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
812
|
+
],
|
813
|
+
] = None,
|
814
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
815
|
+
_content_type: Optional[StrictStr] = None,
|
816
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
817
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
818
|
+
) -> RESTResponseType:
|
819
|
+
"""Synchronous version of get_wrapped_tokens_without_preload_content"""
|
820
|
+
return async_to_sync(self._get_wrapped_tokens_async_without_preload_content)(
|
821
|
+
_request_timeout=_request_timeout,
|
822
|
+
_request_auth=_request_auth,
|
823
|
+
_content_type=_content_type,
|
824
|
+
_headers=_headers,
|
825
|
+
_host_index=_host_index,
|
826
|
+
)
|
440
827
|
|
441
828
|
def _get_wrapped_tokens_serialize(
|
442
829
|
self,
|
@@ -215,7 +215,9 @@ class Configuration:
|
|
215
215
|
debug: Optional[bool] = None,
|
216
216
|
) -> None:
|
217
217
|
"""Constructor"""
|
218
|
-
self._base_path =
|
218
|
+
self._base_path = (
|
219
|
+
"https://api.crypticorn.dev/v1/metrics" if host is None else host
|
220
|
+
)
|
219
221
|
"""Default Base url
|
220
222
|
"""
|
221
223
|
self.server_index = 0 if server_index is None and host is None else server_index
|
@@ -557,7 +559,7 @@ class Configuration:
|
|
557
559
|
"""
|
558
560
|
return [
|
559
561
|
{
|
560
|
-
"url": "
|
562
|
+
"url": "https://api.crypticorn.dev/v1/metrics",
|
561
563
|
"description": "No description provided",
|
562
564
|
}
|
563
565
|
]
|
@@ -77,6 +77,7 @@ class RESTClientObject:
|
|
77
77
|
|
78
78
|
self.pool_manager: Optional[aiohttp.ClientSession] = None
|
79
79
|
self.retry_client: Optional[aiohttp_retry.RetryClient] = None
|
80
|
+
self.is_sync: bool = False # Track whether this is sync or async mode
|
80
81
|
|
81
82
|
async def close(self) -> None:
|
82
83
|
if self.pool_manager:
|
@@ -170,7 +171,9 @@ class RESTClientObject:
|
|
170
171
|
|
171
172
|
pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient]
|
172
173
|
|
173
|
-
#
|
174
|
+
# For sync operations, always use a fresh session
|
175
|
+
should_close_session = False
|
176
|
+
|
174
177
|
if self.pool_manager is None:
|
175
178
|
self.pool_manager = aiohttp.ClientSession(
|
176
179
|
connector=aiohttp.TCPConnector(
|
@@ -178,6 +181,9 @@ class RESTClientObject:
|
|
178
181
|
),
|
179
182
|
trust_env=True,
|
180
183
|
)
|
184
|
+
# Only close session automatically in sync mode
|
185
|
+
should_close_session = self.is_sync
|
186
|
+
|
181
187
|
pool_manager = self.pool_manager
|
182
188
|
|
183
189
|
if self.retries is not None and method in ALLOW_RETRY_METHODS:
|
@@ -193,6 +199,19 @@ class RESTClientObject:
|
|
193
199
|
)
|
194
200
|
pool_manager = self.retry_client
|
195
201
|
|
196
|
-
|
197
|
-
|
198
|
-
|
202
|
+
try:
|
203
|
+
r = await pool_manager.request(**args)
|
204
|
+
# For sessions we're about to close, read the data immediately
|
205
|
+
if should_close_session:
|
206
|
+
response = RESTResponse(r)
|
207
|
+
await response.read() # Read data before closing session
|
208
|
+
return response
|
209
|
+
else:
|
210
|
+
return RESTResponse(r)
|
211
|
+
finally:
|
212
|
+
if should_close_session:
|
213
|
+
if self.retry_client is not None:
|
214
|
+
await self.retry_client.close()
|
215
|
+
self.retry_client = None
|
216
|
+
await self.pool_manager.close()
|
217
|
+
self.pool_manager = None
|