Organization: - Created docs/ with setup/, guides/, history/ subdirectories - Created workflows/ with trading/, analytics/, telegram/, archive/ subdirectories - Created scripts/ with docker/, setup/, testing/ subdirectories - Created tests/ for TypeScript test files - Created archive/ for unused reference files Moved files: - 17 documentation files → docs/ - 16 workflow JSON files → workflows/ - 10 shell scripts → scripts/ - 4 test files → tests/ - 5 unused files → archive/ Updated: - README.md with new file structure and documentation paths Deleted: - data/ (empty directory) - screenshots/ (empty directory) Critical files remain in root: - telegram_command_bot.py (active bot - used by Dockerfile) - watch-restart.sh (systemd service dependency) - All Dockerfiles and docker-compose files - All environment files Validation: Containers running (trading-bot-v4, telegram-trade-bot, postgres) API responding (positions endpoint tested) Telegram bot functional (/status command tested) All critical files present in root No code changes - purely organizational. System continues running without interruption. Recovery: git revert HEAD or git reset --hard cleanup-before
121 lines
4.1 KiB
HTML
121 lines
4.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
|
<script src="https://telegram.org/js/telegram-web-app.js"></script>
|
|
<title>Quick Trade</title>
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
padding: 20px;
|
|
background: var(--tg-theme-bg-color, #1a1a1a);
|
|
color: var(--tg-theme-text-color, #fff);
|
|
min-height: 100vh;
|
|
}
|
|
h2 {
|
|
text-align: center;
|
|
margin-bottom: 30px;
|
|
color: var(--tg-theme-accent-text-color, #10b981);
|
|
}
|
|
button {
|
|
width: 48%;
|
|
padding: 40px 10px;
|
|
margin: 5px 1%;
|
|
font-size: 18px;
|
|
border: none;
|
|
border-radius: 12px;
|
|
cursor: pointer;
|
|
font-weight: bold;
|
|
transition: transform 0.1s;
|
|
}
|
|
button:active { transform: scale(0.95); }
|
|
.buy { background: #10b981; color: white; }
|
|
.sell { background: #ef4444; color: white; }
|
|
.row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
margin: 15px 0;
|
|
}
|
|
#status {
|
|
margin-top: 30px;
|
|
padding: 20px;
|
|
border-radius: 12px;
|
|
display: none;
|
|
text-align: center;
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
}
|
|
.success { background: #10b981; color: white; }
|
|
.error { background: #ef4444; color: white; }
|
|
.loading { background: #3b82f6; color: white; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h2>📊 Quick Trade</h2>
|
|
|
|
<div class="row">
|
|
<button class="buy" onclick="trade('buy', 'SOL')">🟢 BUY<br>SOL</button>
|
|
<button class="sell" onclick="trade('sell', 'SOL')">🔴 SELL<br>SOL</button>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<button class="buy" onclick="trade('buy', 'BTC')">🟢 BUY<br>BTC</button>
|
|
<button class="sell" onclick="trade('sell', 'BTC')">🔴 SELL<br>BTC</button>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<button class="buy" onclick="trade('buy', 'ETH')">🟢 BUY<br>ETH</button>
|
|
<button class="sell" onclick="trade('sell', 'ETH')">🔴 SELL<br>ETH</button>
|
|
</div>
|
|
|
|
<div id="status"></div>
|
|
|
|
<script>
|
|
let tg = window.Telegram.WebApp;
|
|
tg.ready();
|
|
tg.expand();
|
|
|
|
async function trade(action, symbol) {
|
|
const status = document.getElementById('status');
|
|
status.style.display = 'block';
|
|
status.className = 'loading';
|
|
status.textContent = '⏳ Sending trade...';
|
|
|
|
// Haptic feedback
|
|
if (tg.HapticFeedback) {
|
|
tg.HapticFeedback.impactOccurred('medium');
|
|
}
|
|
|
|
try {
|
|
const response = await fetch('http://10.0.0.48:8098/webhook/3371ad7c-0866-4161-90a4-f251de4aceb8', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({ body: `${action} ${symbol}` })
|
|
});
|
|
|
|
if (response.ok) {
|
|
status.className = 'success';
|
|
status.textContent = `✅ ${action.toUpperCase()} ${symbol} executed!`;
|
|
if (tg.HapticFeedback) {
|
|
tg.HapticFeedback.notificationOccurred('success');
|
|
}
|
|
} else {
|
|
throw new Error(`HTTP ${response.status}`);
|
|
}
|
|
} catch (error) {
|
|
status.className = 'error';
|
|
status.textContent = `❌ Error: ${error.message}`;
|
|
if (tg.HapticFeedback) {
|
|
tg.HapticFeedback.notificationOccurred('error');
|
|
}
|
|
}
|
|
|
|
setTimeout(() => {
|
|
status.style.display = 'none';
|
|
}, 3000);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|