-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathindex.html
335 lines (304 loc) · 21.5 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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>FreeWallet</title>
<meta name="robots" content="index, follow">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="image/ico" rel="icon" href="images/favicon.ico">
<!-- CSS Includes -->
<link type="text/css" rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="node_modules/bootstrap-dialog/dist/css/bootstrap-dialog.min.css">
<link type="text/css" rel="stylesheet" href="node_modules/bootstrap-select/dist/css/bootstrap-select.min.css">
<link type="text/css" rel="stylesheet" href="node_modules/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css">
<link type="text/css" rel="stylesheet" href="node_modules/font-awesome/css/font-awesome.min.css">
<link type="text/css" rel="stylesheet" href="node_modules/highstock-release/css/highcharts.css">
<link type="text/css" rel="stylesheet" href="node_modules/jquery-ui-dist/jquery-ui.css">
<link type="text/css" rel="stylesheet" href="node_modules/jquery.rateit/scripts/rateit.css">
<link type="text/css" rel="stylesheet" href="css/jquery.dataTables.min.css">
<link type="text/css" rel="stylesheet" href="css/freewallet-desktop.css">
<link type="text/css" rel="stylesheet" href="css/freewallet-themes.css">
</head>
<body>
<div class="header navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<div class="navbar-brand">
<a href="#" id="action-about"><img src="images/header-logo.png" alt="FreeWallet" border="0"/></a>
</div>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#" id="balances"><i class="fa fa-lg fa-user"></i> Balances</a></li>
<li><a href="#" id="history"><i class="fa fa-lg fa-list"></i> History</a></li>
<li><a href="#" id="exchange"><i class="fa fa-lg fa-exchange"></i> Exchange</a></li>
<li><a href="#" id="dispensers"><i class="fa fa-lg fa-arrows-h"></i> Dispensers</a></li>
<li><a href="#" id="betting"><i class="fa fa-lg fa-bullseye"></i> Betting</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" id="actions-dropdown" data-toggle="dropdown" data-placement="bottom" title="Actions"><i class="fa fa-lg fa-list"></i></a>
<ul class="dropdown-menu" role="menu">
<div class="dropdown-menu-header">Actions</div>
<li><a href="#" id="action-send"><i class="fa fa-lg fa-send"></i> Send Funds</a></li>
<li><a href="#" id="action-sign-message"><i class="fa fa-lg fa-envelope"></i> Sign Message</a></li>
<li><a href="#" id="action-sign-transaction"><i class="fa fa-lg fa-file-text"></i> Sign Transaction</a></li>
<li><a href="#" id="action-dividend"><i class="fa fa-lg fa-sitemap"></i> Pay Dividends</a></li>
<li><a href="#" id="action-broadcast-message"><i class="fa fa-lg fa-bullhorn"></i> Broadcast Message</a></li>
<li><a href="#" id="action-burn"><i class="fa fa-lg fa-fire"></i> Burn Funds</a></li>
<li><a href="#" id="action-dispenser"><i class="fa fa-lg fa-arrows-h"></i> Create Dispenser</a></li>
<li><a href="#" id="action-close-dispenser"><i class="fa fa-lg fa-close"></i> Close Dispenser</a></li>
<li><a href="#" id="action-cancel-order"><i class="fa fa-lg fa-ban"></i> Cancel Order</a></li>
<div id="header-token-actions" class="dropdown-menu-header">Token Actions</div>
<li><a href="#" id="action-asset-create"><i class="fa fa-lg fa-plus-circle"></i> Create a Token</a></li>
<li><a href="#" id="action-asset-description"><i class="fa fa-lg fa-edit"></i> Change Description</a></li>
<li><a href="#" id="action-asset-supply"><i class="fa fa-lg fa-bank"></i> Issue Supply</a></li>
<li><a href="#" id="action-asset-reset"><i class="fa fa-lg fa-refresh"></i> Reset Supply</a></li>
<li><a href="#" id="action-asset-destroy"><i class="fa fa-lg fa-trash"></i> Destroy Supply</a></li>
<li><a href="#" id="action-asset-transfer"><i class="fa fa-lg fa-exchange"></i> Transfer Ownership</a></li>
<li><a href="#" id="action-asset-lock"><i class="fa fa-lg fa-lock"></i> Lock Token Supply</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" id="address-dropdown" data-toggle="dropdown" data-placement="bottom" title="Address"><i class="fa fa-lg fa-qrcode"></i></a>
<ul class="dropdown-menu" role="menu">
<div class="dropdown-menu-header">Address Actions</div>
<li><a href="#" id="action-change-address"><i class="fa fa-lg fa-edit"></i> Change Address</a></li>
<li><a href="#" id="action-add-address"><i class="fa fa-lg fa-plus-circle"></i> Add New Address</a></li>
<li><a href="#" id="action-import-privkey"><i class="fa fa-lg fa-key"></i> Import Private Keys</a></li>
<li><a href="#" id="action-sweep"><i class="fa fa-lg fa-truck"></i> Sweep Address</a></li>
<li><a href="#" id="action-view-address"><i class="fa fa-lg fa-qrcode"></i> View Address</a></li>
<li><a href="#" id="action-view-privkey"><i class="fa fa-lg fa-user-secret"></i> View Private Key</a></li>
</ul>
</li>
<li><a href="#" id="settings" data-toggle="tooltip" data-placement="bottom" title="Settings"><i class="fa fa-lg fa-cogs"></i></a></li>
<li><a href="#" id="lock" data-toggle="tooltip" data-placement="bottom" title="<div class='nowrap'>Lock Wallet</div>"><i class="fa fa-lg fa-unlock"></i></a></li>
<li><a href="#" id="logout" data-toggle="tooltip" data-placement="bottom" title="Logout"><i class="fa fa-lg fa-power-off"></i></a></li>
</ul>
</div>
</div>
</div>
<!-- Main content panel-->
<div id="main-content-panel">
</div>
<!-- Footer (block, last updated, last price -->
<div class="footer navbar-fixed-bottom">
<div class="container-fluid">
<div class="row" style="margin-top:5px">
<div class="col-xs-4">
<i class="fa fa-chain"></i> <span class="footer-current-block">NA</span>
</div>
<div class="col-xs-4 text-center footer-last-updated">
</div>
<div class="col-xs-4">
<div class="pull-right">1 XCP = <span class="footer-current-price">NA</span></div>
</div>
</div>
</div>
</div>
<!-- Javascript Includes -->
<!-- Load jquery first since a bunch of stuff depends on it -->
<script type="text/javascript" src="node_modules/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="node_modules/jquery-ui-dist/jquery-ui.min.js"></script>
<script type="text/javascript" src="node_modules/jquery.qrcode/jquery.qrcode.min.js"></script>
<script type="text/javascript" src="node_modules/jquery.rateit/scripts/jquery.rateit.min.js"></script>
<script type="text/javascript" src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="node_modules/bootstrap-3-typeahead/bootstrap3-typeahead.min.js"></script>
<script type="text/javascript" src="node_modules/bootstrap-dialog/dist/js/bootstrap-dialog.min.js"></script>
<script type="text/javascript" src="node_modules/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
<script type="text/javascript" src="node_modules/bootstrap-validator/dist/validator.min.js"></script>
<script type="text/javascript" src="node_modules/moment/moment.js"></script>
<script type="text/javascript" src="node_modules/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="node_modules/numeraljs/numeral.js"></script>
<script type="text/javascript" src="node_modules/@bassettsj/livestamp/livestamp.js"></script>
<script type="text/javascript" src="node_modules/async/dist/async.min.js"></script>
<script type="text/javascript" src="node_modules/crypto-js/crypto-js.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/highstock.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/indicators.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/accumulation-distribution.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/atr.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/bollinger-bands.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/cci.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/cmf.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/ema.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/ichimoku-kinko-hyo.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/macd.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/mfi.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/momentum.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/pivot-points.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/price-envelopes.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/psar.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/roc.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/rsi.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/stochastic.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/volume-by-price.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/vwap.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/wma.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/indicators/zigzag.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/modules/no-data-to-display.js"></script>
<script type="text/javascript" src="node_modules/highstock-release/modules/exporting.js"></script>
<script type="text/javascript" src="js/throttle-debounce-fn.min.js"></script>
<script type="text/javascript" src="js/jquery.base64.js"></script>
<script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="js/jquery.lazy.min.js"></script>
<script type="text/javascript" src="js/mnemonic.js"></script>
<script type="text/javascript" src="js/sanitizer.js"></script>
<script type="text/javascript" src="js/buffer.min.js"></script>
<script type="text/javascript" src="js/bip39.min.js"></script>
<!-- BTNS / XCP Transaction Decoder -->
<script type="text/javascript" src="js/BTNS-Decoder/sha256.js"></script>
<script type="text/javascript" src="js/BTNS-Decoder/xcp.js"></script>
<script type="text/javascript" src="js/BTNS-Decoder/btns.js"></script>
<script type="text/javascript" src="js/BTNS-Decoder/transaction.js"></script>
<!-- Bitcore includes -->
<script type="text/javascript" src="js/bitcoinjs-lib.min.js"></script>
<script type="text/javascript" src="js/bitcore-lib.min.js"></script>
<script type="text/javascript" src="js/bitcore-message.min.js"></script>
<script type="text/javascript" src="js/util.bitcore.js"></script>
<script type="text/javascript" src="js/util.generic.js"></script>
<!-- Include this last so that bitcore is already defined -->
<script type="text/javascript" src="js/freewallet-desktop.js"></script>
<!-- Include this last so that bitcore is already defined -->
<script>
$(document).ready(function(){
// Array of html pages used in app
var pages = [
'balances',
'history',
'betting',
'dispensers',
'exchange',
'settings'
];
// Load the theme
var theme = ls.getItem('theme') || 'theme-blue';
setTheme(theme);
// Load the homepage
loadPage('balances');
// Initialize any tooltips
$('[data-toggle="tooltip"]').tooltip({ html: true });
// Update the wallet options now that we have loaded the basic interface
// We do this here so that the wallet lock status is updated as soon as possible
updateWalletOptions();
// Setup listener on top toolbar buttons to load corresponding page
pages.forEach(function(page){
$('#' + page).click(function(){ loadPage(page); });
});
// Setup listener on 'qrcode/addresses' button
$('#addresses').click($.debounce(100,function(e){
dialogChangeAddress();
}));
// Setup listener on logout button
$('#logout').click($.debounce(100,function(e){
// dialogReset();
dialogLogout();
}));
// Setup listener on lock/unlock button
// buffer the click event by 100ms to prevent issues when users click item multiple times
$('#lock').click($.debounce(100,function(e){
if(parseInt(ls.getItem('walletEncrypted'))==1){
if(ss.getItem('wallet')){
// Lock wallet
lockWallet();
updateWalletOptions();
} else {
// Unlock wallet
dialogPassword();
}
} else {
dialogPassword(true);
}
}));
// Handle hiding/showing the tooltip when user hovers over the actions icon
$('#actions-dropdown').hover(function(){
$(this).tooltip('show');
},function(){
$(this).tooltip('hide');
});
// Handle hiding/showing the tooltip when user hovers over the actions icon
$('#address-dropdown').hover(function(){
$(this).tooltip('show');
},function(){
$(this).tooltip('hide');
});
// Handle clicks on items in the action menu
$('#action-change-address').click($.debounce(100,function(e){ dialogChangeAddress(); }));
$('#action-add-address').click($.debounce(100,function(e){ dialogAddAddress(); }));
$('#action-view-address').click($.debounce(100,function(e){ dialogViewAddress(); }));
$('#action-sweep').click($.debounce(100,function(e){ dialogSweep(); }));
$('#action-import-privkey').click($.debounce(100,function(e){ dialogImportPrivateKey(); }));
$('#action-view-privkey').click($.debounce(100,function(e){ dialogViewPrivateKey(); }));
$('#action-send').click($.debounce(100,function(e){ dialogSend(); }));
$('#action-asset-create').click($.debounce(100,function(e){ dialogCreateToken(); }));
$('#action-asset-description').click($.debounce(100,function(e){ dialogChangeDescription(); }));
$('#action-asset-supply').click($.debounce(100,function(e){ dialogIssueSupply(); }));
$('#action-asset-reset').click($.debounce(100,function(e){ dialogResetSupply(); }));
$('#action-asset-destroy').click($.debounce(100,function(e){ dialogDestroy(); }));
$('#action-asset-transfer').click($.debounce(100,function(e){ dialogTransferOwnership(); }));
$('#action-asset-lock').click($.debounce(100,function(e){ dialogLockSupply(); }));
$('#action-sign-message').click($.debounce(100,function(e){ dialogSignMessage(); }));
$('#action-sign-transaction').click($.debounce(100,function(e){ dialogSignTransaction(); }));
$('#action-dividend').click($.debounce(100,function(e){ dialogPayDividend(); }));
$('#action-broadcast-message').click($.debounce(100,function(e){ dialogBroadcastMessage() }));
$('#action-about').click($.debounce(100,function(e){ dialogAbout(); }));
$('#action-burn').click($.debounce(100,function(e){ dialogBurn(); }));
$('#action-dispenser').click($.debounce(100,function(e){ dialogDispenser(); }));
$('#action-cancel-order').click($.debounce(100,function(e){ dialogCancelOrder(); }));
$('#action-close-dispenser').click($.debounce(100,function(e){ dialogCloseDispenser(); }));
// Detect when running in nwjs and setup some additional listeners
if(is_nwjs()){
var nw = require('nw.gui');
// Toggle this to true if you want the debug console to open automatically
var debug = false;
if(debug)
nw.Window.get().showDevTools();
// Prevent default context menu and instead show custom menu
$('*').on('contextmenu', function(e){
displayContextMenu(e)
return false;
});
// Launch any links externally (even if they don't have target=_blank)
$(document).on("click", "a", function(e){
var re = /^chrome-extension/, // ignore requests for local files
url = String(this.href).toString();
if(url!='' && url!='#' && !re.test(url)){
nw.Shell.openExternal(url);
return false;
}
});
// Handle checking if there is a new version of the wallet available
checkWalletUpgrade(nw.App.manifest.version);
// loop through the arguments and process
var args = nw.App.argv;
args.forEach(function(item){
processURIData(item);
});
// Listen for events that open the app and process the last argument passed (if any)
nw.App.on('open', function(argString){
var args = String(argString).split(' ');
if(args.length)
processURIData(args[args.length-1]);
});
}
// Test strings to verify functionality
// var str = 'bitcoin:1Donatet2LrNpuWByAnH8gc9Wh9zSzZuLC?amount=1.23456789';
// var str = 'counterparty:1Donatet2LrNpuWByAnH8gc9Wh9zSzZuLC?amount=1.23456789&asset=XCP&memo=test';
// var str = 'https://coindaddy.io';
// var str = 'counterparty:?action=sign&message=test&icon=https%3A%2F%2Fcounterpartychain.io%2Fcontent%2Fimages%2Ficons%2Fstopthenuke.png&callback=http%3A%2F%2Fdev.authparty.io%2Fapi%2Fv1%2Fauthorize_login%3Fprovider%3D005f15c462fe3eb536c4bec5fef42c%26modal_id%3DbemghXSwNXxhqzd';
// var str = 'counterparty:?action=sign&message=Authparty%20Login%20BOhuLIDqbJjBMzh';
// var str = 'counterparty:?action=broadcast&message=Some%20Message';
// var str = 'counterparty:?action=signtx&tx=your-unsigned-transaction-here';
// var str = "freewallet:?action=import&device=trezor&network=mainnet&data=%7B%2244'/0'/0'/0'/0%22:%221EMV8Xz6odQrjzRExPiTZrLcFDZ3fr3Viu%22,%2244'/0'/0'/0'/1%22:%221PMRoTp11MLPmayCDSkpdhD9JqCp85ZLug%22,%2244'/0'/0'/0'/2%22:%221KV364dENq1j8ZjStevytHjzihAxkUQbwG%22,%2244'/0'/0'/0'/3%22:%221LSgyGwf6Tbj1GfgnbcaLMQ2K1sJ14hS5f%22%7D"
// processURIData(str);
});
</script>
</body>
</html>