Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,13 @@ SPOT_WALLET_ADDRESS_1=
SPOT_ACCOUNT_ID_2=
SPOT_PRIVATE_KEY_2=
SPOT_WALLET_ADDRESS_2=

# -----------------------------------------------------------------------
# Telegram Trading Bot
# -----------------------------------------------------------------------
# Bot token from @BotFather on Telegram
TELEGRAM_BOT_TOKEN=

# (Optional) Comma-separated Telegram user IDs allowed to use the bot.
# Leave blank to allow all users (not recommended for production).
ALLOWED_USER_IDS=
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ dependencies = [
"tomli>=2.0.1,<3.0.0",
"types-requests>=2.31.0,<2.32.0",
"python-dateutil>=2.8.0,<3.0.0",
"aiohttp-retry>=2.8.3,<3.0.0"
"aiohttp-retry>=2.8.3,<3.0.0",
"python-telegram-bot>=21.0,<22.0"
Comment on lines +38 to +39
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Read pyproject.toml to check the dependencies and optional-dependencies sections
cat -n pyproject.toml | head -100

Repository: Reya-Labs/reya-python-sdk

Length of output: 3603


🏁 Script executed:

# Find the telegram_bot module mentioned in the comment
find . -type f -name "*telegram*" | head -20

Repository: Reya-Labs/reya-python-sdk

Length of output: 51


🏁 Script executed:

# Check git diff or recent changes to see what was actually added
git diff HEAD~1 pyproject.toml 2>/dev/null || echo "Git diff not available, showing current state"

Repository: Reya-Labs/reya-python-sdk

Length of output: 114


🏁 Script executed:

# Check if telegram_bot directory exists and what it contains
find . -type d -name "telegram_bot" -o -type f -name "telegram_bot*"

Repository: Reya-Labs/reya-python-sdk

Length of output: 83


🏁 Script executed:

# If telegram_bot exists, examine its structure
ls -la telegram_bot/ 2>/dev/null && find telegram_bot -type f | head -20

Repository: Reya-Labs/reya-python-sdk

Length of output: 608


🏁 Script executed:

# Search for any imports of telegram_bot in the main SDK
rg "from telegram_bot|import telegram_bot" --type py

Repository: Reya-Labs/reya-python-sdk

Length of output: 329


🏁 Script executed:

# Also check if python-telegram-bot is imported anywhere in core SDK
rg "from telegram_bot|import telegram" --type py | grep -v "telegram_bot/" | head -20

Repository: Reya-Labs/reya-python-sdk

Length of output: 51


🏁 Script executed:

# Check the main SDK structure and what's exposed in __init__.py
find . -type f -name "__init__.py" | grep -E "^\./(sdk/)?__init__\.py$" | xargs cat -n

Repository: Reya-Labs/reya-python-sdk

Length of output: 51


🏁 Script executed:

# Search for any use of python-telegram-bot package in the SDK core
rg "python.telegram.bot|from telegram|import telegram" sdk/ --type py 2>/dev/null | head -20

Repository: Reya-Labs/reya-python-sdk

Length of output: 51


🏁 Script executed:

# Check if telegram_bot is imported or referenced in the main package __init__
cat -n sdk/__init__.py 2>/dev/null || cat -n __init__.py 2>/dev/null || echo "No main __init__ found"

Repository: Reya-Labs/reya-python-sdk

Length of output: 51


🏁 Script executed:

# List all Python files in sdk/ to understand core SDK structure
find sdk -name "*.py" -type f | head -30

Repository: Reya-Labs/reya-python-sdk

Length of output: 1123


🏁 Script executed:

# Read sdk/__init__.py to see what's exported
cat -n sdk/__init__.py

Repository: Reya-Labs/reya-python-sdk

Length of output: 51


🏁 Script executed:

# Search for any imports from telegram in the entire SDK (not telegram_bot package)
rg "from telegram|import telegram" . --type py -g "!telegram_bot/" 2>/dev/null

Repository: Reya-Labs/reya-python-sdk

Length of output: 51


🏁 Script executed:

# Check if telegram_bot is referenced in any SDK code, examples, or documentation
rg "telegram_bot" sdk/ examples/ --type py 2>/dev/null | head -20

Repository: Reya-Labs/reya-python-sdk

Length of output: 51


🏁 Script executed:

# Check examples directory to understand how telegram_bot is meant to be used
find examples -type f -name "*.py" 2>/dev/null | xargs ls -la

Repository: Reya-Labs/reya-python-sdk

Length of output: 2660


🏁 Script executed:

# Look at the telegram_bot/__init__.py to see what's exported
cat -n telegram_bot/__init__.py

Repository: Reya-Labs/reya-python-sdk

Length of output: 121


🏁 Script executed:

# Check the README to see if telegram bot is documented as a core feature or optional feature
head -50 README.md

Repository: Reya-Labs/reya-python-sdk

Length of output: 2224


Move python-telegram-bot to an optional extra.

The python-telegram-bot>=21.0,<22.0 dependency is currently in the core SDK dependencies but is only used by the self-contained telegram_bot module. The core SDK and its examples have zero dependency on this library. Including it in base installations forces every consumer to download and maintain an unnecessary dependency, even those who never use the bot. Move python-telegram-bot behind an optional extra (e.g., telegram) so only users who explicitly use the bot feature install it.

Proposed packaging change
 dependencies = [
     "web3>=7.12.1,<8.0.0",
     "eth-account>=0.13.7,<1.0.0",
     "eth-abi>=5.2.0,<6.0.0",
     "typing-extensions>=4.14.1,<5.0.0",
     "python-dotenv>=1.1.1,<2.0.0",
     "requests>=2.32.4,<3.0.0",
     "httpx>=0.28.1,<1.0.0",
     "websocket-client>=1.8.0,<2.0.0",
     "tomli>=2.0.1,<3.0.0",
     "types-requests>=2.31.0,<2.32.0",
     "python-dateutil>=2.8.0,<3.0.0",
     "aiohttp-retry>=2.8.3,<3.0.0",
-    "python-telegram-bot>=21.0,<22.0"
 ]

 [project.optional-dependencies]
 dev = [
     ...
 ]
+telegram = [
+    "python-telegram-bot>=21.0,<22.0",
+]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"aiohttp-retry>=2.8.3,<3.0.0",
"python-telegram-bot>=21.0,<22.0"
"aiohttp-retry>=2.8.3,<3.0.0",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pyproject.toml` around lines 38 - 39, Remove the
"python-telegram-bot>=21.0,<22.0" entry from the core dependencies list and add
it as an optional extra so only consumers who opt into the bot feature install
it; specifically, locate the dependency string "python-telegram-bot>=21.0,<22.0"
in pyproject.toml and delete it from the main dependencies, then add it under
the PEP-621 optional dependencies section (e.g., add an entry under
[project.optional-dependencies] with a key like "telegram" whose value is
["python-telegram-bot>=21.0,<22.0"]); ensure the extras key name ("telegram")
matches any docs or usage in the repo that reference installing the telegram
feature.

]

[project.optional-dependencies]
Expand All @@ -60,7 +61,8 @@ dev = [
[tool.poetry]
packages = [
{include = "examples"},
{include = "sdk"}
{include = "sdk"},
{include = "telegram_bot"}
]

[build-system]
Expand Down
1 change: 1 addition & 0 deletions telegram_bot/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Telegram trading bot for Reya exchange."""
Loading