-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_bybit_api.html
More file actions
163 lines (153 loc) · 6.69 KB
/
debug_bybit_api.html
File metadata and controls
163 lines (153 loc) · 6.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bybit API Debug</title>
<style>
body {
font-family: monospace;
background: #1a1a1a;
color: #fff;
padding: 20px;
}
.section {
margin: 20px 0;
padding: 15px;
border: 1px solid #333;
background: #222;
}
.endpoint {
background: #333;
padding: 10px;
margin: 5px 0;
border-left: 3px solid #0066cc;
}
.method {
color: #00cc66;
font-weight: bold;
}
.url {
color: #cccccc;
word-break: break-all;
}
.description {
color: #888;
font-size: 0.9em;
}
button {
background: #333;
color: #fff;
border: 1px solid #555;
padding: 10px 20px;
cursor: pointer;
margin: 10px 5px;
}
button:hover {
background: #444;
}
</style>
</head>
<body>
<h1>Bybit API Endpoints Debug</h1>
<p>Эти URL используются CCXT для получения данных с Bybit API:</p>
<div class="section">
<h2>🔍 Open Orders (fetchOpenOrders)</h2>
<div class="endpoint">
<div class="method">GET</div>
<div class="url">https://api.bybit.com/v5/order/realtime</div>
<div class="description">Получение открытых ордеров для UTA аккаунтов</div>
</div>
<div class="endpoint">
<div class="method">GET</div>
<div class="url">https://api.bybit.com/unified/v3/private/order/unfilled-orders</div>
<div class="description">Альтернативный эндпоинт для открытых ордеров</div>
</div>
</div>
<div class="section">
<h2>📈 My Trades (fetchMyTrades)</h2>
<div class="endpoint">
<div class="method">GET</div>
<div class="url">https://api.bybit.com/v5/execution/list</div>
<div class="description">Получение истории сделок для UTA аккаунтов</div>
</div>
<div class="endpoint">
<div class="method">GET</div>
<div class="url">https://api.bybit.com/unified/v3/private/execution/list</div>
<div class="description">Альтернативный эндпоинт для истории сделок</div>
</div>
</div>
<div class="section">
<h2>📋 All Orders (fetchOrders)</h2>
<div class="endpoint">
<div class="method">GET</div>
<div class="url">https://api.bybit.com/v5/order/history</div>
<div class="description">История ордеров (не поддерживается для UTA аккаунтов после 5/02)</div>
</div>
<div class="endpoint">
<div class="method">GET</div>
<div class="url">https://api.bybit.com/v5/order/realtime</div>
<div class="description">Открытые ордеры (fallback)</div>
</div>
</div>
<div class="section">
<h2>💰 Account Balance</h2>
<div class="endpoint">
<div class="method">GET</div>
<div class="url">https://api.bybit.com/v5/account/wallet-balance</div>
<div class="description">Баланс кошелька UTA аккаунта</div>
</div>
</div>
<div class="section">
<h2>🔧 Параметры запросов</h2>
<p><strong>Обязательные параметры:</strong></p>
<ul>
<li><code>category</code> - тип торговли (spot, linear, inverse, option)</li>
<li><code>symbol</code> - торговая пара (опционально для некоторых запросов)</li>
<li><code>limit</code> - количество записей (по умолчанию 20, максимум 50)</li>
</ul>
<p><strong>Аутентификация:</strong></p>
<ul>
<li><code>X-BAPI-API-KEY</code> - API ключ</li>
<li><code>X-BAPI-TIMESTAMP</code> - временная метка</li>
<li><code>X-BAPI-SIGN</code> - подпись запроса</li>
<li><code>X-BAPI-RECV-WINDOW</code> - окно получения (по умолчанию 5000ms)</li>
</ul>
</div>
<div class="section">
<h2>❌ Известные проблемы</h2>
<ul>
<li><strong>UTA аккаунты:</strong> fetchOrders() не поддерживается после 5/02/2024</li>
<li><strong>Символы:</strong> Некоторые методы требуют указания конкретного символа</li>
<li><strong>Категории:</strong> Нужно указывать правильную категорию (spot/linear/etc)</li>
<li><strong>Лимиты:</strong> API имеет ограничения по частоте запросов</li>
</ul>
</div>
<div>
<button onclick="window.location.href='http://localhost:8081'">Go to App</button>
<button onclick="window.location.href='debug_orders.html'">Orders Debug</button>
<button onclick="checkConsole()">Check Console</button>
</div>
<script>
function checkConsole() {
console.log('🔍 Bybit API Endpoints that CCXT uses:');
console.log('📋 Open Orders: https://api.bybit.com/v5/order/realtime');
console.log('📈 My Trades: https://api.bybit.com/v5/execution/list');
console.log('💰 Balance: https://api.bybit.com/v5/account/wallet-balance');
console.log('');
console.log('🔧 Required parameters:');
console.log('- category: spot|linear|inverse|option');
console.log('- symbol: BTC/USDT (optional for some endpoints)');
console.log('- limit: 20 (default), max 50');
console.log('');
console.log('🔐 Authentication headers:');
console.log('- X-BAPI-API-KEY: your API key');
console.log('- X-BAPI-TIMESTAMP: current timestamp');
console.log('- X-BAPI-SIGN: HMAC SHA256 signature');
console.log('- X-BAPI-RECV-WINDOW: 5000 (default)');
}
console.log('🚀 Bybit API Debug page loaded');
console.log('Check Network tab in DevTools to see actual API requests');
</script>
</body>
</html>