Akademics commited on
Commit
f79162c
·
verified ·
1 Parent(s): 71ee9cb

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +293 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Binance Api
3
- emoji: 🏃
4
- colorFrom: purple
5
- colorTo: red
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: binance-api
3
+ emoji: 🐳
4
+ colorFrom: green
5
+ colorTo: yellow
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,293 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Connect to Binance</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .gradient-bg {
11
+ background: linear-gradient(135deg, #f0b90b 0%, #f8d12f 100%);
12
+ }
13
+ .card-hover {
14
+ transition: all 0.3s ease;
15
+ }
16
+ .card-hover:hover {
17
+ transform: translateY(-5px);
18
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
19
+ }
20
+ .api-key-input {
21
+ letter-spacing: 1px;
22
+ font-family: monospace;
23
+ }
24
+ .glow {
25
+ animation: glow 2s infinite alternate;
26
+ }
27
+ @keyframes glow {
28
+ from {
29
+ box-shadow: 0 0 5px rgba(240, 185, 11, 0.5);
30
+ }
31
+ to {
32
+ box-shadow: 0 0 20px rgba(240, 185, 11, 0.8);
33
+ }
34
+ }
35
+ </style>
36
+ </head>
37
+ <body class="bg-gray-900 text-white min-h-screen">
38
+ <div class="container mx-auto px-4 py-12">
39
+ <!-- Header -->
40
+ <header class="flex justify-between items-center mb-12">
41
+ <div class="flex items-center">
42
+ <img src="https://bin.bnbstatic.com/static/images/common/logo_binance.svg" alt="Binance Logo" class="h-10 mr-3">
43
+ <h1 class="text-2xl font-bold">Binance API Connector</h1>
44
+ </div>
45
+ <div class="flex items-center space-x-4">
46
+ <button class="px-4 py-2 bg-gray-800 rounded-lg hover:bg-gray-700 transition">
47
+ <i class="fas fa-question-circle mr-2"></i> Help
48
+ </button>
49
+ <button class="px-4 py-2 bg-gray-800 rounded-lg hover:bg-gray-700 transition">
50
+ <i class="fas fa-cog mr-2"></i> Settings
51
+ </button>
52
+ </div>
53
+ </header>
54
+
55
+ <!-- Main Content -->
56
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
57
+ <!-- Connection Panel -->
58
+ <div class="lg:col-span-2">
59
+ <div class="bg-gray-800 rounded-xl p-6 shadow-lg card-hover">
60
+ <div class="flex items-center mb-6">
61
+ <div class="gradient-bg rounded-full p-2 mr-4">
62
+ <i class="fas fa-plug text-white text-xl"></i>
63
+ </div>
64
+ <h2 class="text-xl font-bold">API Connection</h2>
65
+ </div>
66
+
67
+ <div class="mb-8">
68
+ <div class="flex items-center mb-4">
69
+ <div class="w-8 h-8 rounded-full bg-gray-700 flex items-center justify-center mr-3">1</div>
70
+ <h3 class="font-medium">Generate API Keys</h3>
71
+ </div>
72
+ <p class="text-gray-400 mb-4 ml-11">Log in to your Binance account and generate API keys with appropriate permissions.</p>
73
+ <a href="https://www.binance.com/en/my/settings/api-management" target="_blank" class="ml-11 px-4 py-2 gradient-bg rounded-lg inline-flex items-center hover:opacity-90 transition">
74
+ <i class="fas fa-external-link-alt mr-2"></i> Go to Binance API Management
75
+ </a>
76
+ </div>
77
+
78
+ <div class="mb-8">
79
+ <div class="flex items-center mb-4">
80
+ <div class="w-8 h-8 rounded-full bg-gray-700 flex items-center justify-center mr-3">2</div>
81
+ <h3 class="font-medium">Enter API Details</h3>
82
+ </div>
83
+
84
+ <div class="ml-11 space-y-4">
85
+ <div>
86
+ <label class="block text-gray-400 mb-1">API Key</label>
87
+ <div class="relative">
88
+ <input type="text" id="apiKey" class="w-full bg-gray-700 rounded-lg px-4 py-3 api-key-input focus:outline-none focus:ring-2 focus:ring-yellow-500" placeholder="Paste your API key here">
89
+ <button onclick="toggleVisibility('apiKey')" class="absolute right-3 top-3 text-gray-400 hover:text-white">
90
+ <i class="fas fa-eye"></i>
91
+ </button>
92
+ </div>
93
+ </div>
94
+
95
+ <div>
96
+ <label class="block text-gray-400 mb-1">Secret Key</label>
97
+ <div class="relative">
98
+ <input type="password" id="secretKey" class="w-full bg-gray-700 rounded-lg px-4 py-3 api-key-input focus:outline-none focus:ring-2 focus:ring-yellow-500" placeholder="Paste your secret key here">
99
+ <button onclick="toggleVisibility('secretKey')" class="absolute right-3 top-3 text-gray-400 hover:text-white">
100
+ <i class="fas fa-eye"></i>
101
+ </button>
102
+ </div>
103
+ </div>
104
+
105
+ <div class="flex items-center">
106
+ <input type="checkbox" id="readOnly" class="mr-2">
107
+ <label for="readOnly" class="text-gray-400">Read-only permissions</label>
108
+ </div>
109
+ </div>
110
+ </div>
111
+
112
+ <div>
113
+ <div class="flex items-center mb-4">
114
+ <div class="w-8 h-8 rounded-full bg-gray-700 flex items-center justify-center mr-3">3</div>
115
+ <h3 class="font-medium">Connect to Binance</h3>
116
+ </div>
117
+ <div class="ml-11">
118
+ <button onclick="connectToBinance()" class="w-full gradient-bg rounded-lg px-6 py-3 font-bold hover:opacity-90 transition flex items-center justify-center glow">
119
+ <i class="fas fa-link mr-2"></i> Connect to Binance
120
+ </button>
121
+ </div>
122
+ </div>
123
+ </div>
124
+ </div>
125
+
126
+ <!-- Information Panel -->
127
+ <div>
128
+ <div class="bg-gray-800 rounded-xl p-6 shadow-lg card-hover h-full">
129
+ <div class="flex items-center mb-6">
130
+ <div class="gradient-bg rounded-full p-2 mr-4">
131
+ <i class="fas fa-info-circle text-white text-xl"></i>
132
+ </div>
133
+ <h2 class="text-xl font-bold">Security Information</h2>
134
+ </div>
135
+
136
+ <div class="space-y-4">
137
+ <div class="bg-gray-700 rounded-lg p-4">
138
+ <div class="flex items-start">
139
+ <i class="fas fa-shield-alt text-yellow-500 mt-1 mr-3"></i>
140
+ <div>
141
+ <h3 class="font-medium mb-1">API Key Safety</h3>
142
+ <p class="text-gray-400 text-sm">Never share your Secret Key with anyone. This application doesn't store your keys.</p>
143
+ </div>
144
+ </div>
145
+ </div>
146
+
147
+ <div class="bg-gray-700 rounded-lg p-4">
148
+ <div class="flex items-start">
149
+ <i class="fas fa-user-lock text-yellow-500 mt-1 mr-3"></i>
150
+ <div>
151
+ <h3 class="font-medium mb-1">Recommended Permissions</h3>
152
+ <p class="text-gray-400 text-sm">For security, enable only the permissions you need (e.g., Read-Only for portfolio tracking).</p>
153
+ </div>
154
+ </div>
155
+ </div>
156
+
157
+ <div class="bg-gray-700 rounded-lg p-4">
158
+ <div class="flex items-start">
159
+ <i class="fas fa-ip-address text-yellow-500 mt-1 mr-3"></i>
160
+ <div>
161
+ <h3 class="font-medium mb-1">IP Restrictions</h3>
162
+ <p class="text-gray-400 text-sm">Consider restricting API key usage to specific IP addresses in your Binance account settings.</p>
163
+ </div>
164
+ </div>
165
+ </div>
166
+
167
+ <div class="border border-yellow-500 rounded-lg p-4 mt-6">
168
+ <div class="flex items-start">
169
+ <i class="fas fa-exclamation-triangle text-yellow-500 mt-1 mr-3"></i>
170
+ <div>
171
+ <h3 class="font-medium mb-1">Important Notice</h3>
172
+ <p class="text-gray-400 text-sm">This is a demo interface. For actual Binance API integration, you would need to implement proper authentication and security measures.</p>
173
+ </div>
174
+ </div>
175
+ </div>
176
+ </div>
177
+ </div>
178
+ </div>
179
+ </div>
180
+
181
+ <!-- Connection Status -->
182
+ <div id="connectionStatus" class="hidden mt-8 bg-gray-800 rounded-xl p-6 shadow-lg">
183
+ <div class="flex items-center">
184
+ <div id="statusIcon" class="w-12 h-12 rounded-full flex items-center justify-center mr-4">
185
+ <i class="fas fa-spinner fa-spin text-gray-400 text-2xl"></i>
186
+ </div>
187
+ <div>
188
+ <h2 id="statusTitle" class="text-xl font-bold">Connecting to Binance...</h2>
189
+ <p id="statusMessage" class="text-gray-400">Please wait while we establish a secure connection.</p>
190
+ </div>
191
+ </div>
192
+ <div id="statusDetails" class="mt-4 hidden">
193
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
194
+ <div class="bg-gray-700 rounded-lg p-4">
195
+ <h3 class="text-gray-400 mb-1">Account</h3>
196
+ <p id="accountInfo" class="font-medium">Loading...</p>
197
+ </div>
198
+ <div class="bg-gray-700 rounded-lg p-4">
199
+ <h3 class="text-gray-400 mb-1">Permissions</h3>
200
+ <p id="permissionsInfo" class="font-medium">Loading...</p>
201
+ </div>
202
+ <div class="bg-gray-700 rounded-lg p-4">
203
+ <h3 class="text-gray-400 mb-1">Server Time</h3>
204
+ <p id="serverTime" class="font-medium">Loading...</p>
205
+ </div>
206
+ </div>
207
+ <div class="mt-4 flex justify-end">
208
+ <button onclick="disconnect()" class="px-4 py-2 bg-red-600 rounded-lg hover:bg-red-700 transition">
209
+ <i class="fas fa-unlink mr-2"></i> Disconnect
210
+ </button>
211
+ </div>
212
+ </div>
213
+ </div>
214
+ </div>
215
+
216
+ <script>
217
+ // Toggle API key visibility
218
+ function toggleVisibility(inputId) {
219
+ const input = document.getElementById(inputId);
220
+ const icon = input.nextElementSibling.querySelector('i');
221
+
222
+ if (input.type === 'password') {
223
+ input.type = 'text';
224
+ icon.classList.remove('fa-eye');
225
+ icon.classList.add('fa-eye-slash');
226
+ } else {
227
+ input.type = 'password';
228
+ icon.classList.remove('fa-eye-slash');
229
+ icon.classList.add('fa-eye');
230
+ }
231
+ }
232
+
233
+ // Simulate connection to Binance
234
+ function connectToBinance() {
235
+ const apiKey = document.getElementById('apiKey').value;
236
+ const secretKey = document.getElementById('secretKey').value;
237
+
238
+ if (!apiKey || !secretKey) {
239
+ alert('Please enter both API Key and Secret Key');
240
+ return;
241
+ }
242
+
243
+ // Show connection status
244
+ const statusPanel = document.getElementById('connectionStatus');
245
+ statusPanel.classList.remove('hidden');
246
+
247
+ // Simulate API call with timeout
248
+ setTimeout(() => {
249
+ // Update status to connected
250
+ const statusIcon = document.getElementById('statusIcon');
251
+ statusIcon.innerHTML = '<i class="fas fa-check-circle text-green-500 text-2xl"></i>';
252
+ statusIcon.classList.add('bg-green-900');
253
+
254
+ document.getElementById('statusTitle').textContent = 'Connected to Binance';
255
+ document.getElementById('statusMessage').textContent = 'Secure connection established successfully';
256
+
257
+ // Show connection details
258
+ document.getElementById('statusDetails').classList.remove('hidden');
259
+ document.getElementById('accountInfo').textContent = 'Demo Account (UID: 123456)';
260
+ document.getElementById('permissionsInfo').textContent = document.getElementById('readOnly').checked ? 'Read-Only' : 'Full Access';
261
+
262
+ // Update server time
263
+ const now = new Date();
264
+ document.getElementById('serverTime').textContent = now.toLocaleString();
265
+
266
+ // Update every second
267
+ setInterval(() => {
268
+ const now = new Date();
269
+ document.getElementById('serverTime').textContent = now.toLocaleString();
270
+ }, 1000);
271
+ }, 2000);
272
+ }
273
+
274
+ // Disconnect function
275
+ function disconnect() {
276
+ const statusPanel = document.getElementById('connectionStatus');
277
+ const statusIcon = document.getElementById('statusIcon');
278
+
279
+ statusIcon.innerHTML = '<i class="fas fa-times-circle text-red-500 text-2xl"></i>';
280
+ statusIcon.classList.remove('bg-green-900');
281
+ statusIcon.classList.add('bg-red-900');
282
+
283
+ document.getElementById('statusTitle').textContent = 'Disconnected';
284
+ document.getElementById('statusMessage').textContent = 'Connection to Binance has been terminated';
285
+ document.getElementById('statusDetails').classList.add('hidden');
286
+
287
+ setTimeout(() => {
288
+ statusPanel.classList.add('hidden');
289
+ }, 3000);
290
+ }
291
+ </script>
292
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Akademics/binance-api" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
293
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ connect Binance