Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
saleh-mir committed Nov 21, 2024
1 parent 1b53e7f commit 42b9841
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
24 changes: 9 additions & 15 deletions jesse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,31 +242,25 @@ def run() -> None:


@fastapi_app.post('/general-info')
async def general_info(authorization: Optional[str] = Header(None)) -> JSONResponse:
# Validate authorization
def general_info(authorization: Optional[str] = Header(None)) -> JSONResponse:
if not authenticator.is_valid_token(authorization):
return authenticator.unauthorized_response()

from jesse.services.general_info import get_general_info

try:
# Get general info with proper typing
data: dict = await get_general_info(has_live=HAS_LIVE_TRADE_PLUGIN)

return JSONResponse(
content=data,
status_code=200
)

data = get_general_info(has_live=HAS_LIVE_TRADE_PLUGIN)
except Exception as e:
# Log the error and return a more detailed error response
jh.error(f"Failed to get general info: {str(e)}")
jh.error(str(e))
return JSONResponse({
'error': str(e),
'message': 'Failed to retrieve general information',
'status': 'error'
'error': str(e)
}, status_code=500)

return JSONResponse(
data,
status_code=200
)


@fastapi_app.post('/exchange-supported-symbols')
def exchange_supported_symbols(request_json: ExchangeSupportedSymbolsRequestJson, authorization: Optional[str] = Header(None)) -> JSONResponse:
Expand Down
2 changes: 1 addition & 1 deletion jesse/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.3.15'
__version__ = '1.3.16'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages

# also change in version.py
VERSION = '1.3.15'
VERSION = '1.3.16'
DESCRIPTION = "A trading framework for cryptocurrencies"
with open("requirements.txt", "r", encoding="utf-8") as f:
REQUIRED_PACKAGES = f.read().splitlines()
Expand Down

0 comments on commit 42b9841

Please sign in to comment.