Skip to content

Commit 9677062

Browse files
committed
Initial commit
0 parents  commit 9677062

133 files changed

Lines changed: 29813 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude/commands/add-callback.md‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
description: Create a new Telegram callback handler
3+
allowed-tools: Read, Write, Edit, Grep
4+
argument-hint: <callback_name>
5+
---
6+
7+
# Add Callback Handler
8+
9+
Create a new Grammy callback handler named: $ARGUMENTS
10+
11+
## Reference Patterns
12+
13+
Review existing callback implementations:
14+
- @src/bot/callbacks/buyCallback.ts
15+
- @src/bot/callbacks/sellCallback.ts
16+
- @src/bot/callbacks/walletCallback.ts
17+
18+
## Requirements
19+
20+
1. Follow the existing callback structure
21+
2. Use TypeScript with proper typing
22+
3. Include i18n support for all user messages
23+
4. Handle errors gracefully with user-friendly messages
24+
5. Add to the callback index at @src/bot/callbacks/index.ts
25+
26+
## Checklist
27+
28+
- [ ] Create callback file at `src/bot/callbacks/{name}Callback.ts`
29+
- [ ] Export handler function
30+
- [ ] Add i18n keys to locales if needed
31+
- [ ] Register in index.ts
32+
- [ ] Add any required types to `src/types/`

‎.claude/commands/check-i18n.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
description: Verify translation completeness across all locales
3+
allowed-tools: Read, Grep
4+
---
5+
6+
# Check i18n Translations
7+
8+
Verify all translation keys are complete and consistent across locales.
9+
10+
## Supported Locales
11+
12+
- English (primary): @locales/en/
13+
- Russian: @locales/ru/
14+
- Spanish: @locales/es/
15+
- German: @locales/de/
16+
17+
## i18n Service
18+
19+
Configuration: @src/services/i18n/i18n.ts
20+
21+
## Find Translation Usages
22+
23+
Search for i18n function calls in the codebase to identify all required keys.
24+
25+
## Verification Steps
26+
27+
1. List all keys used in the English locale (source of truth)
28+
2. Compare with other locales for missing translations
29+
3. Check for unused translation keys
30+
4. Verify placeholder consistency (e.g., `{amount}`, `{token}`)
31+
32+
## Common Issues
33+
34+
- Missing keys in non-English locales
35+
- Inconsistent placeholder names
36+
- Hardcoded strings that should use i18n

‎.claude/commands/debug-trade.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
description: Debug trading execution issues in the Telegram Trading bot
3+
allowed-tools: Read, Grep, Bash(make test:*)
4+
---
5+
6+
# Debug Trading Issue
7+
8+
Investigate the trading issue described: $ARGUMENTS
9+
10+
## Investigation Steps
11+
12+
1. Check the main trading service for the issue pattern
13+
2. Review the OpenOcean DEX integration
14+
3. Verify blockchain RPC interactions
15+
4. Look for error handling gaps
16+
17+
## Key Files to Review
18+
19+
- Trading engine: @src/services/engine/neurodex.ts
20+
- DEX aggregator: @src/services/engine/openocean.ts
21+
- Blockchain client: @src/services/engine/viem.ts
22+
- Buy callback: @src/bot/callbacks/buyCallback.ts
23+
- Sell callback: @src/bot/callbacks/sellCallback.ts
24+
25+
## Current Test Status
26+
27+
```
28+
!`pnpm test 2>&1 | tail -30`
29+
```
30+
31+
## Common Issues
32+
33+
- Slippage too low for volatile tokens
34+
- Insufficient gas estimation
35+
- RPC rate limiting
36+
- Token approval not completed

‎.claude/settings.json‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(make:*)",
5+
"Bash(pnpm add:*)",
6+
"Bash(pnpm run lint:fix:*)",
7+
"Bash(pnpm run typecheck:*)",
8+
"Bash(pnpm test:*)",
9+
"Bash(git add:*)",
10+
"Bash(git commit:*)",
11+
"Bash(git push:*)",
12+
"Bash(git status:*)",
13+
"Bash(git diff:*)",
14+
"Bash(git log:*)",
15+
"Bash(gh pr list:*)"
16+
],
17+
"deny": [
18+
"Read(.env)",
19+
"Read(.env.*)",
20+
"Read(keys/**)",
21+
"Read(wallets/**)",
22+
"Bash(rm -rf:*)"
23+
]
24+
},
25+
"env": {
26+
"NODE_ENV": "development"
27+
}
28+
}

‎.dockerignore‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Git and GitHub
2+
.github
3+
.git
4+
.gitignore
5+
.gitattributes
6+
7+
# Environment files
8+
.env
9+
.env.*
10+
11+
# Dependencies and build output
12+
node_modules
13+
generated
14+
dist
15+
16+
# Documentation (not needed in container)
17+
README.md
18+
CONTRIBUTING.md
19+
SECURITY.md
20+
CLAUDE.md
21+
docs/
22+
23+
# Development tools config
24+
.claude/
25+
.eslintrc.json
26+
.prettierrc
27+
.prettierignore
28+
tsconfig.dev.json
29+
typedoc.json
30+
jest.config.js
31+
32+
# Logs
33+
*.log
34+
combined.log
35+
error.log
36+
37+
# Scripts (development only)
38+
scripts/
39+
40+
# Tests
41+
tests/
42+
43+
# Editor files
44+
.DS_Store
45+
*.swp
46+
*.swo

‎.env.example‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
ENVIRONMENT=development
2+
# Include as described here: https://nodejs.org/en/learn/getting-started/nodejs-the-difference-between-development-and-production
3+
NODE_ENV=production
4+
5+
# Telegram Bot Token
6+
TELEGRAM_BOT_TOKEN=
7+
8+
# Telegram Bot Username (without @)
9+
TELEGRAM_BOT_USERNAME=
10+
11+
# RPC URLs (replace with your provider URLs)
12+
ETHEREUM_MAINNET_RPC=https://your-ethereum-mainnet-rpc-url
13+
BASE_MAINNET_RPC=https://your-base-mainnet-rpc-url
14+
BASE_SEPOLIA_RPC=https://your-base-sepolia-rpc-url
15+
BNC_RPC=https://your-bnc-rpc-url
16+
17+
DEFAULT_SLIPPAGE=1 # Default Slippage (percentage)
18+
DEFAULT_FEE=1 # Default free (percentage)
19+
DEFAULT_FEE_WALLET=
20+
DEFAULT_GAS_PRIORITY=medium # Default Gas Priority 'standard' | 'fast' | 'instant'
21+
22+
# Prisma Database URI
23+
# For more info: https://www.prisma.io/docs/getting-started/quickstart-prismaPostgres
24+
DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key="
25+
# Database Encryption key. Must be generated with cloak!
26+
PRISMA_FIELD_ENCRYPTION_KEY=""
27+
28+
COVALENTHQ_API_KEY=""
29+
30+
BETTERSTACK_SOURCE_TOKEN=""
31+
BETTERSTACK_ENDPOINT=""
32+
33+
# Supabase (for secure private key storage)
34+
# Get these from your Supabase project settings: https://app.supabase.com/
35+
SUPABASE_URL=https://your-project.supabase.co
36+
SUPABASE_ANON_KEY=your-anon-key
37+
SUPABASE_SERVICE_KEY=your-service-key
38+
39+
# Encryption keys
40+
MASTER_ENCRYPTION_PASSWORD=
41+
WALLET_ENCRYPTION_KEY=
42+
43+
# Rate Limiting (optional - defaults shown)
44+
# Protects against abuse by limiting requests per user
45+
RATE_LIMIT_PER_SECOND=3
46+
RATE_LIMIT_PER_MINUTE=50
47+
RATE_LIMIT_PER_15MIN=300

‎.eslintrc.json‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"env": {
3+
"node": true,
4+
"es2022": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:prettier/recommended"
10+
],
11+
"parser": "@typescript-eslint/parser",
12+
"parserOptions": {
13+
"ecmaVersion": "latest",
14+
"sourceType": "module",
15+
"project": ["./tsconfig.json", "./tsconfig.dev.json"]
16+
},
17+
"plugins": ["@typescript-eslint", "prettier"],
18+
"rules": {
19+
"@typescript-eslint/explicit-function-return-type": "warn",
20+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
21+
"@typescript-eslint/no-explicit-any": "error",
22+
"prettier/prettier": "error",
23+
"no-console": "error"
24+
},
25+
"overrides": [
26+
{
27+
"files": ["scripts/**/*.ts", "tests/**/*.ts"],
28+
"rules": {
29+
"no-console": "off"
30+
}
31+
}
32+
],
33+
"ignorePatterns": ["prisma/generated/**/*", "dist/**/*"]
34+
}

‎.gitattributes‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm-lock.yaml binary
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
14+
**To Reproduce**
15+
Steps to reproduce the behavior:
16+
1. Go to '...'
17+
2. Click on '....'
18+
3. Scroll down to '....'
19+
4. Encounter issue
20+
21+
22+
**Expected behavior**
23+
A clear and concise description of what you expected to happen.
24+
25+
26+
**Screenshots**
27+
If applicable, add screenshots to help explain your problem.
28+
29+
30+
**Additional context**
31+
Add any other context about the problem here.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
14+
**Describe the solution you'd like**
15+
A clear and concise description of what you want to happen.
16+
17+
18+
**Describe alternatives you've considered**
19+
A clear and concise description of any alternative solutions or features you've considered.
20+
21+
22+
**Additional context**
23+
Add any other context or screenshots about the feature request here.

0 commit comments

Comments
 (0)