crypticorn 2.5.1__py3-none-any.whl → 2.5.2__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/common/__init__.py +1 -0
- crypticorn/common/enums.py +3 -1
- crypticorn/common/errors.py +40 -4
- crypticorn/common/mixins.py +1 -0
- crypticorn/common/status_router.py +42 -0
- crypticorn/common/utils.py +5 -12
- crypticorn/klines/client/__init__.py +0 -5
- crypticorn/klines/client/api/change_in_timeframe_api.py +8 -9
- crypticorn/klines/client/api/ohlcv_data_api.py +7 -8
- crypticorn/klines/client/api/symbols_api.py +7 -8
- crypticorn/klines/client/models/__init__.py +0 -5
- crypticorn/klines/client/models/exception_detail.py +3 -6
- crypticorn/klines/client/models/search_symbol.py +4 -3
- crypticorn/klines/client/models/udf_config.py +1 -2
- crypticorn/metrics/client/__init__.py +1 -6
- crypticorn/metrics/client/api/exchanges_api.py +29 -31
- crypticorn/metrics/client/api/indicators_api.py +15 -16
- crypticorn/metrics/client/api/logs_api.py +1 -1
- crypticorn/metrics/client/api/marketcap_api.py +15 -16
- crypticorn/metrics/client/api/markets_api.py +15 -16
- crypticorn/metrics/client/api/status_api.py +1 -1
- crypticorn/metrics/client/api/tokens_api.py +1 -1
- crypticorn/metrics/client/api_client.py +1 -1
- crypticorn/metrics/client/configuration.py +3 -5
- crypticorn/metrics/client/exceptions.py +1 -1
- crypticorn/metrics/client/models/__init__.py +1 -6
- crypticorn/metrics/client/models/exception_detail.py +4 -7
- 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/trade/client/__init__.py +1 -2
- crypticorn/trade/client/api/exchanges_api.py +6 -6
- crypticorn/trade/client/api/trading_actions_api.py +16 -15
- crypticorn/trade/client/configuration.py +2 -2
- crypticorn/trade/client/models/__init__.py +1 -2
- crypticorn/trade/client/models/action_model.py +1 -2
- crypticorn/trade/client/models/exchange_key_model.py +2 -11
- crypticorn/trade/client/models/futures_trading_action.py +1 -2
- crypticorn/trade/client/models/order_model.py +4 -14
- crypticorn/trade/client/models/spot_trading_action.py +1 -2
- crypticorn/trade/client/models/strategy_exchange_info.py +2 -3
- crypticorn/trade/client/models/strategy_model_input.py +1 -2
- crypticorn/trade/client/models/strategy_model_output.py +1 -2
- crypticorn/trade/client/models/tpsl.py +3 -1
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/METADATA +1 -1
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/RECORD +50 -127
- crypticorn/klines/client/api/health_check_api.py +0 -265
- crypticorn/klines/client/models/api_error_identifier.py +0 -108
- crypticorn/klines/client/models/api_error_level.py +0 -37
- crypticorn/klines/client/models/api_error_type.py +0 -37
- crypticorn/klines/client/models/base_response_health_check_response.py +0 -114
- crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +0 -123
- crypticorn/klines/client/models/base_response_list_funding_rate_response.py +0 -118
- crypticorn/klines/client/models/base_response_list_str.py +0 -106
- crypticorn/klines/client/models/base_response_ohlcv_response.py +0 -114
- crypticorn/klines/client/models/change_in_timeframe_response.py +0 -86
- crypticorn/klines/client/models/error_response.py +0 -109
- crypticorn/klines/client/models/exchange.py +0 -91
- crypticorn/klines/client/models/funding_rate_response.py +0 -92
- crypticorn/klines/client/models/health_check_response.py +0 -91
- crypticorn/klines/client/models/history_error_response.py +0 -89
- crypticorn/klines/client/models/history_no_data_response.py +0 -99
- crypticorn/klines/client/models/history_success_response.py +0 -99
- crypticorn/klines/client/models/http_validation_error.py +0 -99
- crypticorn/klines/client/models/internal_exchange.py +0 -39
- crypticorn/klines/client/models/market.py +0 -35
- crypticorn/klines/client/models/market_type.py +0 -35
- crypticorn/klines/client/models/ohlcv_response.py +0 -105
- crypticorn/klines/client/models/response_get_history_udf_history_get.py +0 -198
- crypticorn/klines/client/models/response_get_udf_history.py +0 -198
- crypticorn/klines/client/models/search_symbol_response.py +0 -104
- crypticorn/klines/client/models/symbol_group_response.py +0 -83
- crypticorn/klines/client/models/symbol_info_response.py +0 -131
- crypticorn/klines/client/models/udf_config_response.py +0 -160
- crypticorn/klines/client/models/validation_error.py +0 -105
- crypticorn/klines/client/models/validation_error_loc_inner.py +0 -159
- crypticorn/metrics/client/api/health_check_api.py +0 -265
- crypticorn/metrics/client/models/api_error_identifier.py +0 -108
- crypticorn/metrics/client/models/api_error_level.py +0 -37
- crypticorn/metrics/client/models/api_error_type.py +0 -37
- crypticorn/metrics/client/models/base_response_dict.py +0 -106
- crypticorn/metrics/client/models/base_response_health_check_response.py +0 -114
- crypticorn/metrics/client/models/base_response_list_dict.py +0 -106
- crypticorn/metrics/client/models/base_response_list_exchange_mapping.py +0 -118
- crypticorn/metrics/client/models/base_response_list_str.py +0 -106
- crypticorn/metrics/client/models/error_response.py +0 -109
- crypticorn/metrics/client/models/exchange_mapping.py +0 -134
- crypticorn/metrics/client/models/health_check_response.py +0 -91
- crypticorn/metrics/client/models/http_validation_error.py +0 -99
- crypticorn/metrics/client/models/internal_exchange.py +0 -39
- crypticorn/metrics/client/models/market.py +0 -35
- crypticorn/metrics/client/models/market_type.py +0 -35
- crypticorn/metrics/client/models/validation_error.py +0 -105
- crypticorn/metrics/client/models/validation_error_loc_inner.py +0 -159
- crypticorn/pay/client/models/api_status_res.py +0 -83
- crypticorn/pay/client/models/body_create_now_invoice.py +0 -98
- crypticorn/pay/client/models/body_create_product.py +0 -98
- crypticorn/pay/client/models/body_get_products.py +0 -87
- crypticorn/pay/client/models/body_handle_now_webhook.py +0 -98
- crypticorn/pay/client/models/body_update_product.py +0 -98
- crypticorn/pay/client/models/combined_payment_history.py +0 -101
- crypticorn/pay/client/models/create_invoice_req.py +0 -188
- crypticorn/pay/client/models/create_invoice_res.py +0 -188
- crypticorn/pay/client/models/currency.py +0 -165
- crypticorn/pay/client/models/estimate_price_req.py +0 -91
- crypticorn/pay/client/models/estimate_price_res.py +0 -102
- crypticorn/pay/client/models/get_currencies_res.py +0 -99
- crypticorn/pay/client/models/get_payment_status_res.py +0 -222
- crypticorn/pay/client/models/get_payments_list_res.py +0 -109
- crypticorn/pay/client/models/min_amount_req.py +0 -124
- crypticorn/pay/client/models/min_amount_res.py +0 -105
- crypticorn/pay/client/models/now_fee_structure.py +0 -104
- crypticorn/pay/client/models/now_payment_model.py +0 -124
- crypticorn/pay/client/models/now_payment_status.py +0 -42
- crypticorn/pay/client/models/now_webhook_payload.py +0 -181
- crypticorn/pay/client/models/partial_product_update_model.py +0 -150
- crypticorn/pay/client/models/product.py +0 -87
- crypticorn/pay/client/models/product_model.py +0 -128
- crypticorn/pay/client/models/product_subs_model.py +0 -108
- crypticorn/pay/client/models/product_update_model.py +0 -150
- crypticorn/pay/client/models/unified_payment_model.py +0 -112
- crypticorn/trade/client/models/api_key_model.py +0 -156
- crypticorn/trade/client/models/exchange.py +0 -35
- crypticorn/trade/client/models/market_type.py +0 -35
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/WHEEL +0 -0
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/top_level.txt +0 -0
crypticorn/common/__init__.py
CHANGED
crypticorn/common/enums.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
from enum import StrEnum
|
2
2
|
from crypticorn.common.mixins import ValidateEnumMixin, ExcludeEnumMixin
|
3
|
+
|
4
|
+
|
3
5
|
class Exchange(ValidateEnumMixin, ExcludeEnumMixin, StrEnum):
|
4
6
|
"""Supported exchanges for trading"""
|
5
7
|
|
@@ -24,4 +26,4 @@ class MarketType(ValidateEnumMixin, ExcludeEnumMixin, StrEnum):
|
|
24
26
|
"""
|
25
27
|
|
26
28
|
SPOT = "spot"
|
27
|
-
FUTURES = "futures"
|
29
|
+
FUTURES = "futures"
|
crypticorn/common/errors.py
CHANGED
@@ -42,6 +42,7 @@ class ApiErrorIdentifier(ExcludeEnumMixin, StrEnum):
|
|
42
42
|
BOT_ALREADY_DELETED = "bot_already_deleted"
|
43
43
|
BOT_DISABLED = "bot_disabled"
|
44
44
|
BOT_STOPPING_COMPLETED = "bot_stopping_completed"
|
45
|
+
BOT_STOPPING_STARTED = "bot_stopping_started"
|
45
46
|
CLIENT_ORDER_ID_REPEATED = "client_order_id_already_exists"
|
46
47
|
CONTENT_TYPE_ERROR = "invalid_content_type"
|
47
48
|
DELETE_BOT_ERROR = "delete_bot_error"
|
@@ -77,8 +78,11 @@ class ApiErrorIdentifier(ExcludeEnumMixin, StrEnum):
|
|
77
78
|
LIQUIDATION_PRICE_VIOLATION = "order_violates_liquidation_price_constraints"
|
78
79
|
NO_CREDENTIALS = "no_credentials"
|
79
80
|
NOW_API_DOWN = "now_api_down"
|
80
|
-
OBJECT_NOT_FOUND = "object_not_found"
|
81
81
|
OBJECT_ALREADY_EXISTS = "object_already_exists"
|
82
|
+
OBJECT_CREATED = "object_created"
|
83
|
+
OBJECT_DELETED = "object_deleted"
|
84
|
+
OBJECT_NOT_FOUND = "object_not_found"
|
85
|
+
OBJECT_UPDATED = "object_updated"
|
82
86
|
ORDER_ALREADY_FILLED = "order_is_already_filled"
|
83
87
|
ORDER_IN_PROCESS = "order_is_being_processed"
|
84
88
|
ORDER_LIMIT_EXCEEDED = "order_quantity_limit_exceeded"
|
@@ -94,6 +98,7 @@ class ApiErrorIdentifier(ExcludeEnumMixin, StrEnum):
|
|
94
98
|
RISK_LIMIT_EXCEEDED = "risk_limit_exceeded"
|
95
99
|
RPC_TIMEOUT = "rpc_timeout"
|
96
100
|
SETTLEMENT_IN_PROGRESS = "system_settlement_in_process"
|
101
|
+
STRATEGY_ALREADY_EXISTS = "strategy_already_exists"
|
97
102
|
STRATEGY_DISABLED = "strategy_disabled"
|
98
103
|
STRATEGY_LEVERAGE_MISMATCH = "strategy_leverage_mismatch"
|
99
104
|
STRATEGY_NOT_SUPPORTING_EXCHANGE = "strategy_not_supporting_exchange"
|
@@ -159,6 +164,11 @@ class ApiError(ExcludeEnumMixin, Enum, metaclass=Fallback):
|
|
159
164
|
ApiErrorType.NO_ERROR,
|
160
165
|
ApiErrorLevel.INFO,
|
161
166
|
)
|
167
|
+
BOT_STOPPING_STARTED = (
|
168
|
+
ApiErrorIdentifier.BOT_STOPPING_STARTED,
|
169
|
+
ApiErrorType.NO_ERROR,
|
170
|
+
ApiErrorLevel.INFO,
|
171
|
+
)
|
162
172
|
CLIENT_ORDER_ID_REPEATED = (
|
163
173
|
ApiErrorIdentifier.CLIENT_ORDER_ID_REPEATED,
|
164
174
|
ApiErrorType.SERVER_ERROR,
|
@@ -334,15 +344,30 @@ class ApiError(ExcludeEnumMixin, Enum, metaclass=Fallback):
|
|
334
344
|
ApiErrorType.SERVER_ERROR,
|
335
345
|
ApiErrorLevel.ERROR,
|
336
346
|
)
|
347
|
+
OBJECT_ALREADY_EXISTS = (
|
348
|
+
ApiErrorIdentifier.OBJECT_ALREADY_EXISTS,
|
349
|
+
ApiErrorType.SERVER_ERROR,
|
350
|
+
ApiErrorLevel.ERROR,
|
351
|
+
)
|
352
|
+
OBJECT_CREATED = (
|
353
|
+
ApiErrorIdentifier.OBJECT_CREATED,
|
354
|
+
ApiErrorType.SERVER_ERROR,
|
355
|
+
ApiErrorLevel.INFO,
|
356
|
+
)
|
357
|
+
OBJECT_DELETED = (
|
358
|
+
ApiErrorIdentifier.OBJECT_DELETED,
|
359
|
+
ApiErrorType.SERVER_ERROR,
|
360
|
+
ApiErrorLevel.INFO,
|
361
|
+
)
|
337
362
|
OBJECT_NOT_FOUND = (
|
338
363
|
ApiErrorIdentifier.OBJECT_NOT_FOUND,
|
339
364
|
ApiErrorType.SERVER_ERROR,
|
340
365
|
ApiErrorLevel.ERROR,
|
341
366
|
)
|
342
|
-
|
343
|
-
ApiErrorIdentifier.
|
367
|
+
OBJECT_UPDATED = (
|
368
|
+
ApiErrorIdentifier.OBJECT_UPDATED,
|
344
369
|
ApiErrorType.SERVER_ERROR,
|
345
|
-
ApiErrorLevel.
|
370
|
+
ApiErrorLevel.INFO,
|
346
371
|
)
|
347
372
|
ORDER_ALREADY_FILLED = (
|
348
373
|
ApiErrorIdentifier.ORDER_ALREADY_FILLED,
|
@@ -419,6 +444,11 @@ class ApiError(ExcludeEnumMixin, Enum, metaclass=Fallback):
|
|
419
444
|
ApiErrorType.EXCHANGE_ERROR,
|
420
445
|
ApiErrorLevel.ERROR,
|
421
446
|
)
|
447
|
+
STRATEGY_ALREADY_EXISTS = (
|
448
|
+
ApiErrorIdentifier.STRATEGY_ALREADY_EXISTS,
|
449
|
+
ApiErrorType.USER_ERROR,
|
450
|
+
ApiErrorLevel.ERROR,
|
451
|
+
)
|
422
452
|
STRATEGY_DISABLED = (
|
423
453
|
ApiErrorIdentifier.STRATEGY_DISABLED,
|
424
454
|
ApiErrorType.USER_ERROR,
|
@@ -494,6 +524,7 @@ class ApiError(ExcludeEnumMixin, Enum, metaclass=Fallback):
|
|
494
524
|
|
495
525
|
class HttpStatusMapper:
|
496
526
|
"""Map API errors to HTTP status codes."""
|
527
|
+
|
497
528
|
_mapping = {
|
498
529
|
# Authentication/Authorization
|
499
530
|
ApiError.EXPIRED_BEARER: status.HTTP_401_UNAUTHORIZED,
|
@@ -517,6 +548,7 @@ class HttpStatusMapper:
|
|
517
548
|
ApiError.OBJECT_ALREADY_EXISTS: status.HTTP_409_CONFLICT,
|
518
549
|
ApiError.EXCHANGE_KEY_ALREADY_EXISTS: status.HTTP_409_CONFLICT,
|
519
550
|
ApiError.BOT_ALREADY_DELETED: status.HTTP_409_CONFLICT,
|
551
|
+
ApiError.STRATEGY_ALREADY_EXISTS: status.HTTP_409_CONFLICT,
|
520
552
|
# Invalid Content
|
521
553
|
ApiError.CONTENT_TYPE_ERROR: status.HTTP_415_UNSUPPORTED_MEDIA_TYPE,
|
522
554
|
ApiError.INVALID_DATA_REQUEST: status.HTTP_422_UNPROCESSABLE_ENTITY,
|
@@ -574,6 +606,10 @@ class HttpStatusMapper:
|
|
574
606
|
# Success cases
|
575
607
|
ApiError.SUCCESS: status.HTTP_200_OK,
|
576
608
|
ApiError.BOT_STOPPING_COMPLETED: status.HTTP_200_OK,
|
609
|
+
ApiError.BOT_STOPPING_STARTED: status.HTTP_200_OK,
|
610
|
+
ApiError.OBJECT_CREATED: status.HTTP_201_CREATED,
|
611
|
+
ApiError.OBJECT_UPDATED: status.HTTP_200_OK,
|
612
|
+
ApiError.OBJECT_DELETED: status.HTTP_204_NO_CONTENT,
|
577
613
|
}
|
578
614
|
|
579
615
|
@classmethod
|
crypticorn/common/mixins.py
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
from datetime import datetime
|
2
|
+
from typing import Literal
|
3
|
+
from fastapi import APIRouter
|
4
|
+
|
5
|
+
router = APIRouter(tags=["Status"], prefix="")
|
6
|
+
|
7
|
+
@router.get("/", operation_id="ping")
|
8
|
+
async def ping() -> str:
|
9
|
+
"""
|
10
|
+
Returns 'OK' if the API is running.
|
11
|
+
"""
|
12
|
+
return "OK"
|
13
|
+
|
14
|
+
@router.get("/time", operation_id="getTime")
|
15
|
+
async def time(
|
16
|
+
type: Literal["iso", "unix"] = "iso"
|
17
|
+
) -> str:
|
18
|
+
"""
|
19
|
+
Returns the current time in the specified format.
|
20
|
+
"""
|
21
|
+
if type == "iso":
|
22
|
+
return datetime.now().isoformat()
|
23
|
+
else:
|
24
|
+
return str(int(datetime.now().timestamp()))
|
25
|
+
|
26
|
+
@router.get("/config", operation_id="getConfig")
|
27
|
+
async def config() -> dict:
|
28
|
+
"""
|
29
|
+
Returns the version of the crypticorn library and the environment.
|
30
|
+
"""
|
31
|
+
import importlib.metadata
|
32
|
+
import os
|
33
|
+
from dotenv import load_dotenv
|
34
|
+
load_dotenv()
|
35
|
+
try:
|
36
|
+
crypticorn_version = importlib.metadata.version("flask")
|
37
|
+
except importlib.metadata.PackageNotFoundError:
|
38
|
+
crypticorn_version = "not installed"
|
39
|
+
return {
|
40
|
+
"crypticorn": crypticorn_version,
|
41
|
+
"environment": os.getenv("API_ENV", "not set"),
|
42
|
+
}
|
crypticorn/common/utils.py
CHANGED
@@ -2,29 +2,22 @@ from typing import Any, Union
|
|
2
2
|
from decimal import Decimal
|
3
3
|
import string
|
4
4
|
import random
|
5
|
-
from fastapi import HTTPException
|
6
5
|
from fastapi import status
|
7
6
|
from typing_extensions import deprecated
|
8
7
|
|
9
|
-
from crypticorn.common import ApiError
|
8
|
+
from crypticorn.common import ApiError, HTTPException, ExceptionContent
|
10
9
|
|
11
10
|
|
12
|
-
def throw_if_none(value: Any,
|
11
|
+
def throw_if_none(value: Any, error: ApiError = ApiError.OBJECT_NOT_FOUND) -> None:
|
13
12
|
"""Throws an FastAPI HTTPException if the value is None."""
|
14
13
|
if value is None:
|
15
|
-
raise HTTPException(
|
16
|
-
status_code=status.HTTP_404_NOT_FOUND,
|
17
|
-
detail=message.identifier if isinstance(message, ApiError) else message,
|
18
|
-
)
|
14
|
+
raise HTTPException(content=ExceptionContent(error=error))
|
19
15
|
|
20
16
|
|
21
|
-
def throw_if_falsy(value: Any,
|
17
|
+
def throw_if_falsy(value: Any, error: ApiError = ApiError.OBJECT_NOT_FOUND) -> None:
|
22
18
|
"""Throws an FastAPI HTTPException if the value is False."""
|
23
19
|
if not value:
|
24
|
-
raise HTTPException(
|
25
|
-
status_code=status.HTTP_400_BAD_REQUEST,
|
26
|
-
detail=message.identifier if isinstance(message, ApiError) else message,
|
27
|
-
)
|
20
|
+
raise HTTPException(content=ExceptionContent(error=error))
|
28
21
|
|
29
22
|
|
30
23
|
def gen_random_id(length: int = 20) -> str:
|
@@ -36,14 +36,9 @@ 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.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
39
|
from crypticorn.klines.client.models.change_in_timeframe import ChangeInTimeframe
|
43
40
|
from crypticorn.klines.client.models.exception_detail import ExceptionDetail
|
44
41
|
from crypticorn.klines.client.models.funding_rate import FundingRate
|
45
|
-
from crypticorn.klines.client.models.internal_exchange import InternalExchange
|
46
|
-
from crypticorn.klines.client.models.market_type import MarketType
|
47
42
|
from crypticorn.klines.client.models.ohlcv_history import OHLCVHistory
|
48
43
|
from crypticorn.klines.client.models.resolution import Resolution
|
49
44
|
from crypticorn.klines.client.models.search_symbol import SearchSymbol
|
@@ -16,11 +16,10 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
16
16
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
17
17
|
from typing_extensions import Annotated
|
18
18
|
|
19
|
-
from pydantic import Field
|
19
|
+
from pydantic import Field, StrictStr
|
20
20
|
from typing import List, Optional
|
21
21
|
from typing_extensions import Annotated
|
22
22
|
from crypticorn.klines.client.models.change_in_timeframe import ChangeInTimeframe
|
23
|
-
from crypticorn.klines.client.models.market_type import MarketType
|
24
23
|
from crypticorn.klines.client.models.timeframe import Timeframe
|
25
24
|
|
26
25
|
from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
|
@@ -44,7 +43,7 @@ class ChangeInTimeframeApi:
|
|
44
43
|
async def get_change_in_timeframe(
|
45
44
|
self,
|
46
45
|
market: Annotated[
|
47
|
-
Optional[
|
46
|
+
Optional[StrictStr], Field(description="Market type: 'spot' or 'futures'")
|
48
47
|
] = None,
|
49
48
|
timeframe: Annotated[
|
50
49
|
Optional[Timeframe],
|
@@ -67,7 +66,7 @@ class ChangeInTimeframeApi:
|
|
67
66
|
Retrieve price change percentage between last two completed timestamps for all pairs. Valid markets: spot, futures Valid timeframes: 15m, 30m, 1h, 4h, 1d
|
68
67
|
|
69
68
|
:param market: Market type: 'spot' or 'futures'
|
70
|
-
:type market:
|
69
|
+
:type market: str
|
71
70
|
:param timeframe: Timeframe: '15m', '30m', '1h', '4h', '1d'
|
72
71
|
:type timeframe: Timeframe
|
73
72
|
:param _request_timeout: timeout setting for this request. If one
|
@@ -117,7 +116,7 @@ class ChangeInTimeframeApi:
|
|
117
116
|
async def get_change_in_timeframe_with_http_info(
|
118
117
|
self,
|
119
118
|
market: Annotated[
|
120
|
-
Optional[
|
119
|
+
Optional[StrictStr], Field(description="Market type: 'spot' or 'futures'")
|
121
120
|
] = None,
|
122
121
|
timeframe: Annotated[
|
123
122
|
Optional[Timeframe],
|
@@ -140,7 +139,7 @@ class ChangeInTimeframeApi:
|
|
140
139
|
Retrieve price change percentage between last two completed timestamps for all pairs. Valid markets: spot, futures Valid timeframes: 15m, 30m, 1h, 4h, 1d
|
141
140
|
|
142
141
|
:param market: Market type: 'spot' or 'futures'
|
143
|
-
:type market:
|
142
|
+
:type market: str
|
144
143
|
:param timeframe: Timeframe: '15m', '30m', '1h', '4h', '1d'
|
145
144
|
:type timeframe: Timeframe
|
146
145
|
:param _request_timeout: timeout setting for this request. If one
|
@@ -190,7 +189,7 @@ class ChangeInTimeframeApi:
|
|
190
189
|
async def get_change_in_timeframe_without_preload_content(
|
191
190
|
self,
|
192
191
|
market: Annotated[
|
193
|
-
Optional[
|
192
|
+
Optional[StrictStr], Field(description="Market type: 'spot' or 'futures'")
|
194
193
|
] = None,
|
195
194
|
timeframe: Annotated[
|
196
195
|
Optional[Timeframe],
|
@@ -213,7 +212,7 @@ class ChangeInTimeframeApi:
|
|
213
212
|
Retrieve price change percentage between last two completed timestamps for all pairs. Valid markets: spot, futures Valid timeframes: 15m, 30m, 1h, 4h, 1d
|
214
213
|
|
215
214
|
:param market: Market type: 'spot' or 'futures'
|
216
|
-
:type market:
|
215
|
+
:type market: str
|
217
216
|
:param timeframe: Timeframe: '15m', '30m', '1h', '4h', '1d'
|
218
217
|
:type timeframe: Timeframe
|
219
218
|
:param _request_timeout: timeout setting for this request. If one
|
@@ -282,7 +281,7 @@ class ChangeInTimeframeApi:
|
|
282
281
|
# process the query parameters
|
283
282
|
if market is not None:
|
284
283
|
|
285
|
-
_query_params.append(("market", market
|
284
|
+
_query_params.append(("market", market))
|
286
285
|
|
287
286
|
if timeframe is not None:
|
288
287
|
|
@@ -19,7 +19,6 @@ 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.market_type import MarketType
|
23
22
|
from crypticorn.klines.client.models.ohlcv_history import OHLCVHistory
|
24
23
|
from crypticorn.klines.client.models.sort_direction import SortDirection
|
25
24
|
from crypticorn.klines.client.models.timeframe import Timeframe
|
@@ -44,7 +43,7 @@ class OHLCVDataApi:
|
|
44
43
|
@validate_call
|
45
44
|
async def get_ohlcv(
|
46
45
|
self,
|
47
|
-
market: Annotated[
|
46
|
+
market: Annotated[StrictStr, Field(description="Market type")],
|
48
47
|
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
49
48
|
symbol: Annotated[
|
50
49
|
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
@@ -80,7 +79,7 @@ class OHLCVDataApi:
|
|
80
79
|
Retrieve OHLCV (Open, High, Low, Close, Volume) data for a specific market, timeframe, and symbol.
|
81
80
|
|
82
81
|
:param market: Market type (required)
|
83
|
-
:type market:
|
82
|
+
:type market: str
|
84
83
|
:param timeframe: Timeframe for the candles (required)
|
85
84
|
:type timeframe: Timeframe
|
86
85
|
:param symbol: Trading pair symbol (e.g., BTCUSDT) (required)
|
@@ -144,7 +143,7 @@ class OHLCVDataApi:
|
|
144
143
|
@validate_call
|
145
144
|
async def get_ohlcv_with_http_info(
|
146
145
|
self,
|
147
|
-
market: Annotated[
|
146
|
+
market: Annotated[StrictStr, Field(description="Market type")],
|
148
147
|
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
149
148
|
symbol: Annotated[
|
150
149
|
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
@@ -180,7 +179,7 @@ class OHLCVDataApi:
|
|
180
179
|
Retrieve OHLCV (Open, High, Low, Close, Volume) data for a specific market, timeframe, and symbol.
|
181
180
|
|
182
181
|
:param market: Market type (required)
|
183
|
-
:type market:
|
182
|
+
:type market: str
|
184
183
|
:param timeframe: Timeframe for the candles (required)
|
185
184
|
:type timeframe: Timeframe
|
186
185
|
:param symbol: Trading pair symbol (e.g., BTCUSDT) (required)
|
@@ -244,7 +243,7 @@ class OHLCVDataApi:
|
|
244
243
|
@validate_call
|
245
244
|
async def get_ohlcv_without_preload_content(
|
246
245
|
self,
|
247
|
-
market: Annotated[
|
246
|
+
market: Annotated[StrictStr, Field(description="Market type")],
|
248
247
|
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
249
248
|
symbol: Annotated[
|
250
249
|
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
@@ -280,7 +279,7 @@ class OHLCVDataApi:
|
|
280
279
|
Retrieve OHLCV (Open, High, Low, Close, Volume) data for a specific market, timeframe, and symbol.
|
281
280
|
|
282
281
|
:param market: Market type (required)
|
283
|
-
:type market:
|
282
|
+
:type market: str
|
284
283
|
:param timeframe: Timeframe for the candles (required)
|
285
284
|
:type timeframe: Timeframe
|
286
285
|
:param symbol: Trading pair symbol (e.g., BTCUSDT) (required)
|
@@ -367,7 +366,7 @@ class OHLCVDataApi:
|
|
367
366
|
|
368
367
|
# process the path parameters
|
369
368
|
if market is not None:
|
370
|
-
_path_params["market"] = market
|
369
|
+
_path_params["market"] = market
|
371
370
|
if timeframe is not None:
|
372
371
|
_path_params["timeframe"] = timeframe.value
|
373
372
|
if symbol is not None:
|
@@ -19,7 +19,6 @@ from typing_extensions import Annotated
|
|
19
19
|
from pydantic import Field, StrictStr
|
20
20
|
from typing import List
|
21
21
|
from typing_extensions import Annotated
|
22
|
-
from crypticorn.klines.client.models.market_type import MarketType
|
23
22
|
|
24
23
|
from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
|
25
24
|
from crypticorn.klines.client.api_response import ApiResponse
|
@@ -41,7 +40,7 @@ class SymbolsApi:
|
|
41
40
|
@validate_call
|
42
41
|
async def get_klines_symbols(
|
43
42
|
self,
|
44
|
-
market: Annotated[
|
43
|
+
market: Annotated[StrictStr, Field(description="Market type")],
|
45
44
|
_request_timeout: Union[
|
46
45
|
None,
|
47
46
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -59,7 +58,7 @@ class SymbolsApi:
|
|
59
58
|
Retrieve a list of whitelisted symbols for a specific market.
|
60
59
|
|
61
60
|
:param market: Market type (required)
|
62
|
-
:type market:
|
61
|
+
:type market: str
|
63
62
|
:param _request_timeout: timeout setting for this request. If one
|
64
63
|
number provided, it will be total request
|
65
64
|
timeout. It can also be a pair (tuple) of
|
@@ -105,7 +104,7 @@ class SymbolsApi:
|
|
105
104
|
@validate_call
|
106
105
|
async def get_klines_symbols_with_http_info(
|
107
106
|
self,
|
108
|
-
market: Annotated[
|
107
|
+
market: Annotated[StrictStr, Field(description="Market type")],
|
109
108
|
_request_timeout: Union[
|
110
109
|
None,
|
111
110
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -123,7 +122,7 @@ class SymbolsApi:
|
|
123
122
|
Retrieve a list of whitelisted symbols for a specific market.
|
124
123
|
|
125
124
|
:param market: Market type (required)
|
126
|
-
:type market:
|
125
|
+
:type market: str
|
127
126
|
:param _request_timeout: timeout setting for this request. If one
|
128
127
|
number provided, it will be total request
|
129
128
|
timeout. It can also be a pair (tuple) of
|
@@ -169,7 +168,7 @@ class SymbolsApi:
|
|
169
168
|
@validate_call
|
170
169
|
async def get_klines_symbols_without_preload_content(
|
171
170
|
self,
|
172
|
-
market: Annotated[
|
171
|
+
market: Annotated[StrictStr, Field(description="Market type")],
|
173
172
|
_request_timeout: Union[
|
174
173
|
None,
|
175
174
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -187,7 +186,7 @@ class SymbolsApi:
|
|
187
186
|
Retrieve a list of whitelisted symbols for a specific market.
|
188
187
|
|
189
188
|
:param market: Market type (required)
|
190
|
-
:type market:
|
189
|
+
:type market: str
|
191
190
|
:param _request_timeout: timeout setting for this request. If one
|
192
191
|
number provided, it will be total request
|
193
192
|
timeout. It can also be a pair (tuple) of
|
@@ -250,7 +249,7 @@ class SymbolsApi:
|
|
250
249
|
|
251
250
|
# process the path parameters
|
252
251
|
if market is not None:
|
253
|
-
_path_params["market"] = market
|
252
|
+
_path_params["market"] = market
|
254
253
|
# process the query parameters
|
255
254
|
# process the header parameters
|
256
255
|
# process the form parameters
|
@@ -14,14 +14,9 @@ Do not edit the class manually.
|
|
14
14
|
|
15
15
|
|
16
16
|
# import models into model package
|
17
|
-
from crypticorn.klines.client.models.api_error_identifier import ApiErrorIdentifier
|
18
|
-
from crypticorn.klines.client.models.api_error_level import ApiErrorLevel
|
19
|
-
from crypticorn.klines.client.models.api_error_type import ApiErrorType
|
20
17
|
from crypticorn.klines.client.models.change_in_timeframe import ChangeInTimeframe
|
21
18
|
from crypticorn.klines.client.models.exception_detail import ExceptionDetail
|
22
19
|
from crypticorn.klines.client.models.funding_rate import FundingRate
|
23
|
-
from crypticorn.klines.client.models.internal_exchange import InternalExchange
|
24
|
-
from crypticorn.klines.client.models.market_type import MarketType
|
25
20
|
from crypticorn.klines.client.models.ohlcv_history import OHLCVHistory
|
26
21
|
from crypticorn.klines.client.models.resolution import Resolution
|
27
22
|
from crypticorn.klines.client.models.search_symbol import SearchSymbol
|
@@ -19,9 +19,6 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from crypticorn.klines.client.models.api_error_identifier import ApiErrorIdentifier
|
23
|
-
from crypticorn.klines.client.models.api_error_level import ApiErrorLevel
|
24
|
-
from crypticorn.klines.client.models.api_error_type import ApiErrorType
|
25
22
|
from typing import Optional, Set
|
26
23
|
from typing_extensions import Self
|
27
24
|
|
@@ -32,9 +29,9 @@ class ExceptionDetail(BaseModel):
|
|
32
29
|
""" # noqa: E501
|
33
30
|
|
34
31
|
message: Optional[StrictStr] = None
|
35
|
-
code:
|
36
|
-
type:
|
37
|
-
level:
|
32
|
+
code: StrictStr = Field(description="API error identifiers")
|
33
|
+
type: StrictStr = Field(description="Type of API error")
|
34
|
+
level: StrictStr = Field(description="API error levels")
|
38
35
|
status_code: StrictInt = Field(description="The HTTP status code")
|
39
36
|
details: Optional[Any] = None
|
40
37
|
__properties: ClassVar[List[str]] = [
|
@@ -17,9 +17,8 @@ import pprint
|
|
17
17
|
import re # noqa: F401
|
18
18
|
import json
|
19
19
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictStr
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
22
|
-
from crypticorn.klines.client.models.internal_exchange import InternalExchange
|
23
22
|
from typing import Optional, Set
|
24
23
|
from typing_extensions import Self
|
25
24
|
|
@@ -31,7 +30,9 @@ class SearchSymbol(BaseModel):
|
|
31
30
|
|
32
31
|
symbol: StrictStr
|
33
32
|
description: StrictStr
|
34
|
-
exchange:
|
33
|
+
exchange: StrictStr = Field(
|
34
|
+
description="All exchanges we are using, including public (Exchange)"
|
35
|
+
)
|
35
36
|
type: StrictStr
|
36
37
|
__properties: ClassVar[List[str]] = ["symbol", "description", "exchange", "type"]
|
37
38
|
|
@@ -19,7 +19,6 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from crypticorn.klines.client.models.internal_exchange import InternalExchange
|
23
22
|
from crypticorn.klines.client.models.symbol_type import SymbolType
|
24
23
|
from typing import Optional, Set
|
25
24
|
from typing_extensions import Self
|
@@ -36,7 +35,7 @@ class UDFConfig(BaseModel):
|
|
36
35
|
supports_search: Optional[StrictBool] = True
|
37
36
|
supports_timescale_marks: Optional[StrictBool] = False
|
38
37
|
supports_time: Optional[StrictBool] = True
|
39
|
-
exchanges: List[
|
38
|
+
exchanges: List[StrictStr]
|
40
39
|
symbols_types: List[SymbolType]
|
41
40
|
currency_codes: List[StrictStr]
|
42
41
|
supported_markets: List[StrictStr]
|
@@ -5,7 +5,7 @@
|
|
5
5
|
"""
|
6
6
|
Marketcap Service API
|
7
7
|
|
8
|
-
|
8
|
+
API for retrieving historical marketcap data, available exchanges, and indicators.
|
9
9
|
|
10
10
|
The version of the OpenAPI document: 1.0.0
|
11
11
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
@@ -37,12 +37,7 @@ from crypticorn.metrics.client.exceptions import ApiAttributeError
|
|
37
37
|
from crypticorn.metrics.client.exceptions import ApiException
|
38
38
|
|
39
39
|
# import models into sdk package
|
40
|
-
from crypticorn.metrics.client.models.api_error_identifier import ApiErrorIdentifier
|
41
|
-
from crypticorn.metrics.client.models.api_error_level import ApiErrorLevel
|
42
|
-
from crypticorn.metrics.client.models.api_error_type import ApiErrorType
|
43
40
|
from crypticorn.metrics.client.models.exception_detail import ExceptionDetail
|
44
|
-
from crypticorn.metrics.client.models.internal_exchange import InternalExchange
|
45
|
-
from crypticorn.metrics.client.models.market_type import MarketType
|
46
41
|
from crypticorn.metrics.client.models.severity import Severity
|
47
42
|
from crypticorn.metrics.client.models.time_interval import TimeInterval
|
48
43
|
from crypticorn.metrics.client.models.trading_status import TradingStatus
|