forked from tgerring/hiveapp-bitstamptrader
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
227 lines (201 loc) · 10.4 KB
/
index.html
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE html>
<html>
<head>
<title>bitstamp-js</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- These are all styles. Customize to your liking -->
<link href="styles/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="styles/font-awesome.min.css" rel="stylesheet" type="text/css" />
<!-- To skin the app, modify or replace these files -->
<link href="styles/bootstrap-theme.min.css" rel="stylesheet" type="text/css" />
<link href="styles/styles.css" rel="stylesheet" type="text/css" />
<!-- Android workaround: Reload API if we are re-entering the index page -->
<script>if (!window.bitcoin && window.hive) window.eval(hive.init());</script>
<!-- Libraries and helper scripts -->
<script src="scripts/hmac-sha256.js" type="text/javascript"></script>
<script src="scripts/jquery-2.0.3.min.js" type="text/javascript"></script>
<script src="scripts/hiveapp-api-mock.js" type="text/javascript"></script>
<script src="scripts/numeral.min.js" type="text/javascript"></script>
<script src="scripts/bitstamp-js.js" type="text/javascript"></script>
<script src="scripts/bitstamptrader.js" type="text/javascript"></script>
<script src="scripts/bootstrap.min.js" type="text/javascript"></script>
</head>
<body>
<div class="alert alert-danger"></div>
<div class="container">
<a href="https://www.bitstamp.net" target="_blank">
<img src="images/[email protected]" alt="Bitstamp logo" width="262" height="95">
</a>
<div id="panel_public">
<table class="table table-condensed">
<!--<caption class="small">(Refreshing every <span id="refreshsecs">?</span> seconds)</caption>-->
<tbody>
<tr>
<th>Last</th>
<!--<th>Bid</th>
<th>Ask</th>-->
<th>High</th>
<th>Low</th>
<th>Volume</th>
</tr>
<tr>
<td><span class="data_ticker_last"></span></td>
<!--<td><span class="ticker_bid"></span></td>
<td><span class="ticker_ask"></span></td>-->
<td><span class="data_ticker_high"></span> </td>
<td><span class="data_ticker_low"></span></td>
<td><span class="data_ticker_volume nowrap"></span></td>
</tr>
</tbody>
</table>
<!-- Unimplemented functionality
<button id="toggle_orderbook" type="button">Show order book</button>
<button id="transactions" type="button">Transactions</button>
<button id="eurusd" type="button">EUR/USD Conversion Rate</button>-->
</div> <!-- /panel_public -->
<div id="panel_login">
<form id="login_form" role="form">
<div class="form-group">
<label for="clientid">Customer ID</label>
<input type="text" id="clientid" class="form-control" placeholder="Customer ID">
</div>
<div class="form-group">
<label for="apikey">API Key</label>
<input type="text" id="apikey" class="form-control" placeholder="API Key">
</div>
<div class="form-group">
<label for="apisecret">API Secret</label>
<input type="password" id="apisecret" class="form-control" placeholder="API Secret">
</div>
<button id="submit_login" type="button" class="btn btn-default btn-sm form-control"><i class="fa fa-sign-in"></i> Login</button>
</form>
<p id="loginmessage"><i class="fa fa-spinner fa-spin"></i> Credentials found. Now logging in… <button type="button" class="btn btn-danger btn-xs button_logout"><i class="fa fa-sign-out fa-fw"></i>Logout</button></p>
<span class="small">
<a href="tutorial.html" title="Bitstamp Account API Access Tutorial">Need help getting your API credentials?</a>
</span>
</div> <!-- /panel_login -->
<div id="panel_trade">
<p>
<strong><span class="data_available_btc"></span></strong> <span class="unit"></span> |
<strong><span class="data_available_usd"></span></strong> <span class="currency-unit">USD</span> |
<span class="data_user_fee"></span> <span>Fee</span>
<span class="pull-right">
<button id="button_refreshall" type="button" class="btn btn-default btn-xs"><i class="fa fa-refresh fa-fw"></i><span class="sr-only">Reload app</span></button>
<button id="button_collapse" type="button" class="btn btn-default btn-xs" data-toggle="collapse" data-target="#panel_account_details"><i class="fa fa-caret-down fa-fw"></i><span class="sr-only">Toggle account details</span></button>
</span>
</p>
<table class="table table-condensed collapse" id="panel_account_details">
<tbody>
<tr>
<th>Account:</th>
<td>
<span class="data_client_id"></span>
<button type="button" class="btn btn-danger btn-xs"><i class="fa fa-sign-out fa-fw button_logout"></i>Logout</button>
</td>
</tr>
<tr>
<th>Bitcoin Balance:</th>
<td>
<span class="unit"></span>
<span class="data_balance_btc"></span>
<span class="nowrap">(<span class="data_reserved_btc"></span> reserved)</span>
</td>
</tr>
<tr>
<th>USD Balance:</th>
<td>
<span class="data_balance_usd"></span>
<span class="nowrap">(<span class="data_reserved_usd"></span> reserved)</span>
</td>
</tr>
</tbody>
</table>
<ul class="nav nav-tabs">
<li id="tab_orders"><a href="#orders" data-toggle="tab">Orders</a></li>
<li id="tab_transfers" class="active"><a href="#transfers" data-toggle="tab">Transfers</a></li>
<li id="tab_transactions"><a href="#transactions" data-toggle="tab">Transactions</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane fade" id="orders">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="trade_price" class="col-xs-4 control-label">Price (<span class="currency-unit">USD</span>):</label>
<div class="col-xs-8"><input id="trade_price" class="form-control" type="number" min="0" step="0.0001"></div>
</div>
<div class="form-group">
<label for="trade_amount" class="col-xs-4 control-label">Amount (<span class="unit"></span>):</label>
<div class="col-xs-8"><input id="trade_amount" class="form-control" type="number" min="0" step="0.0001" required></div>
</div>
<div class="form-group">
<div class="col-xs-6"><button id="orderbuy" type="button" class="form-control btn btn-default btn-sm"><i class="fa fa-thumbs-up"></i> Buy</button></div>
<div class="col-xs-6"><button id="ordersell" type="button" class="form-control btn btn-default btn-sm"><i class="fa fa-thumbs-down"></i> Sell</button></div>
</div>
</form>
<select id="user_openorders" class="form-control" multiple size="6">
<option value="">Open orders not loaded</option>
</select>
<button id="btn_cancelorder" type="button" class="btn btn-default btn-sm form-control"><i class="fa fa-ban"></i> Cancel selected orders</button>
</div>
<div class="tab-pane fade in active" id="transfers">
<!--<p id="transfers_message"></p>-->
<form role="form">
<div class="input-group">
<span class="input-group-addon"><span class="unit"></span></span>
<input id="transferamount" type="number" class="form-control" placeholder="amount" min="0" step="0.1">
</div>
<div class="row">
<div class="col-xs-6">
<button id="btcdeposit" type="button" class="btn btn-default btn-sm form-control"><i class="fa fa-download"></i> Deposit <i class="fa fa-btc"></i></button>
</div>
<div class="col-xs-6">
<button id="btcwithdrawal" type="button" class="btn btn-default btn-sm form-control"><i class="fa fa-upload"></i> Withdrawal <i class="fa fa-btc"></i></button>
</div>
</div>
</form>
<select id="pending_transfers" class="form-control" multiple size="6">
<option class="pending_withdrawal pending_deposit">Transfers not loaded</option>
</select>
</div>
<div class="tab-pane fade" id="transactions">
<select id="usertransactionlist" class="form-control" multiple size="12">
<option>Transactions not loaded</option>
</select>
</div>
</div>
</div> <!-- /panel_trade -->
</div>
<script type="text/javascript">
$(document).ready(function() {
// Initialization
hideError()
bitcoin.getSystemInfo(function(info) {systemInfo = info;});
$('#panel_login').show();
$('#loginmessage').hide();
$('#panel_trade').hide();
$('#refreshsecs').text(refreshsecs.toString());
getTicker();
window.setInterval(function(){
getTicker();
}, refreshsecs * 1000);
checkLogin();
/// Initialization
// Event bindings
$('#button_refreshall').click( function(){location.reload(false);} );
$('#submit_login').click( function(){doLogin($('#clientid').val(), $('#apikey').val(), $('#apisecret').val());} );
$('.button_logout').click( doLogout );
$('#orderbuy').click( function(){orderBuy($('#trade_amount').val(), $('#trade_price').val());} );
$('#ordersell').click( function(){orderSell($('#trade_amount').val(), $('#trade_price').val());} );
$('#btn_cancelorder').click( cancelOrders );
$('#btcwithdrawal').click( function(){bitcoinWithdrawl($('#transferamount').val());} );
$('#btcdeposit').click( getBitcoinDepositAddress );
/// Event bindings
// Unimplemented functionality
//$('#orderbook').click( function(){getOrderBook(1);} );
//$('#transactions').click( function(){getTransactions('hour');} );
//$('#eurusd').click( function(){getEurUsdRate();} );
/// Unimplemented functionality
});
</script>
</body>
</html>