This repository has been archived by the owner on May 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
wallet.php
344 lines (301 loc) · 13.7 KB
/
wallet.php
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
336
337
338
339
340
341
342
343
344
<script src="js/dash/wallet.js?<?php echo $CONFIG['dashversion']; ?>"></script>
<script src="js/dash/wallettx.js?<?php echo $CONFIG['dashversion']; ?>"></script>
<div class="row row-offcanvas row-offcanvas-left">
<div class="col-sm-3 col-md-2 sidebar-offcanvas" id="sidebar" role="navigation">
<ul class="nav nav-sidebar">
<li><a href="?">Overview</a></li>
<li><a href="?page=guldend">GuldenD</a></li>
<li><a href="?page=node">Node</a></li>
<li class="active"><a href="?page=wallet">Wallet</a></li>
<li><a href="?page=witness">Witness</a></li>
</ul>
</div><!--/span-->
<div class="col-sm-9 col-md-10 main">
<!--toggle sidebar button-->
<p class="visible-xs">
<button type="button" class="btn btn-primary btn-xs" data-toggle="offcanvas"><i class="glyphicon glyphicon-chevron-left"></i></button>
</p>
<h1 class="page-header">
Wallet
<p class="lead">Wallet information</p>
</h1>
<div id="errordiv"></div>
<!-- Add account modal content-->
<div id="newaccount" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content" name="newaccountmodal" id="newaccountmodal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Create a new account</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="newaccountname"><small>Account name (Normal letters only and no * allowed)</small></label><br>
<input id="newaccountname" name="newaccountname" type="text" class="form-control">
</div>
<div class="form-group">
<label for="createaccpass"><small>Unlock your wallet with your password</small></label><br>
<input id="createaccpass" name="createaccpass" type="password" class="form-control" autocomplete='off'>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="addAccount()">Create account</button>
</div>
</div>
</div>
</div>
<!-- End add account modal content-->
<!-- Rename account modal content-->
<div id="renameaccount" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content" name="renameaccountmodal" id="renameaccountmodal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<div id="renameaccounttitle"><h4 class="modal-title">Rename account</h4></div>
</div>
<div class="modal-body">
<div class="form-group">
<label for="renameaccountname"><small>Account name (Normal letters only and no * allowed)</small></label><br>
<input id="renameaccountname" name="renameaccountname" type="text" class="form-control">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="renameAccount()">Rename account</button>
</div>
</div>
</div>
</div>
<!-- End rename account modal content-->
<!-- Import Recovery Phrase modal content-->
<div id="importrecoveryphrase" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content" name="importrecoveryphrasemodal" id="importrecoveryphrasemodal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Import wallet using Recovery Phrase</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="therecphrase"><small>Recovery Phrase</small></label><br>
<input id="therecphrase" name="therecphrase" type="password" class="form-control" autocomplete='off'>
</div>
<div id="importrecstatus" name="importrecstatus"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="impRecovery();">Import Recovery Phrase</button>
</div>
</div>
</div>
</div>
<!-- End import recovery phrase modal content-->
<!-- Show Recovery Phrase modal content-->
<div id="showrecoveryphrase" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content" name="recoveryphrasemodal" id="recoveryphrasemodal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Show the Recovery Phrase for this wallet</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="rppass"><small>Unlock your wallet with your password</small></label><br>
<input id="rppass" name="rppass" type="password" class="form-control" autocomplete='off'>
</div>
<div id="showrp" name="showrp"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="showRecoveryPhrase();">Show Recovery Phrase</button>
</div>
</div>
</div>
</div>
<!-- End show recovery phrase modal content-->
<!-- Set up passphrase modal content-->
<div id="setuppassphrase" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content" name="setuppassphrasemodal" id="setuppassphrasemodal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Create a password for this wallet</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="rpnewpass"><small>Normal letters only and no * allowed</small></label><br>
<input id="rpnewpass" name="rpnewpass" type="password" class="form-control" autocomplete='off'>
</div>
<div class="form-group">
<label for="rpnewpasstwo"><small>Repeat password</small></label><br>
<input id="rpnewpasstwo" name="rpnewpasstwo" type="password" class="form-control" autocomplete='off'>
</div>
<div id="passerror" name="passerror"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="setPassPhrase();">Set password</button>
</div>
</div>
</div>
</div>
<!-- End set up passphrase modal content-->
<!-- Change passphrase modal content-->
<div id="changepassphrase" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content" name="changepassphrasemodal" id="changepassphrasemodal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Change password for this wallet</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="oldrpnewpass"><small>Current password</small></label><br>
<input id="oldrpnewpass" name="oldrpnewpass" type="password" class="form-control" autocomplete='off'>
</div>
<div class="form-group">
<label for="changedrpnewpass"><small>New password (normal letters only and no * allowed)</small></label><br>
<input id="changedrpnewpass" name="changedrpnewpass" type="password" class="form-control" autocomplete='off'>
</div>
<div class="form-group">
<label for="changedrpnewpasstwo"><small>Repeat password</small></label><br>
<input id="changedrpnewpasstwo" name="changedrpnewpasstwo" type="password" class="form-control" autocomplete='off'>
</div>
<div id="changepasserror" name="changepasserror"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="changePassPhrase();">Change password</button>
</div>
</div>
</div>
</div>
<!-- End change passphrase modal content-->
<!-- Create a transaction modal content-->
<div id="createtransaction" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content" name="createtransactionmodal" id="createtransactionmodal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Create a transaction</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="transactionaddress"><small>Gulden receiving address</small></label><br>
<input id="transactionaddress" name="transactionaddress" type="text" class="form-control">
</div>
<div class="form-group">
<label for="transactionamount"><small>Amount of Gulden to send</small></label><br>
<input id="transactionamount" name="transactionamount" type="text" class="form-control bfh-number" data-min="1" data-max="999999">
</div>
<div id="transactionmessage" name="transactionmessage"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="createTransactionDetails();">Send</button>
</div>
</div>
</div>
</div>
<!-- End create a transaction modal content-->
<!-- Create a transaction confirmation dialog-->
<div id="transactionpopup" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content" name="transactionpopupmodal" id="transactionpopupmodal">
<div class="modal-header">
<h4 class="modal-title">Transaction confirmation</h4>
</div>
<div class="modal-body">
<h3>Are you sure you want to send Gulden?</h3>
<p>This action cannot be undone.</p>
<p>
<label for="confirmaddress"><small>Gulden receiving address</small></label><br>
<div id="confirmaddress"></div>
</p>
<p>
<label for="confirmamount"><small>Amount of Gulden to send</small></label><br>
<div id="confirmamount"></div>
</p>
<p>
<label for="confirmtransactionpass"><small>Pass Phrase</small></label><br>
<div><input type="password" id="confirmtransactionpass" name="confirmtransactionpass" autocomplete='off'></div>
</p>
<div id="conftransmes" name="conftransmes"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="confirmTransactionDetails()">Cancel</button>
<button type="button" class="btn btn-default" id="confirmedsubmit" name="confirmedsubmit" onclick="confirmTransactionDetails('true')">Send</button>
</div>
</div>
</div>
</div>
<!-- End create a transaction confirmation dialog-->
<div class="row">
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-heading" id="accountlistheader">Account list</div>
<div class="panel-body" id="accountlistpanel">
<img src="images/loading.gif" border="0" height="64" width="64"> Loading....
</div>
</div>
</div>
<div class="col-md-9">
<div class="panel panel-default">
<div class="panel-heading" id="currentaccountname">Current account</div>
<div class="panel-body" id="walletinfopanel">
<img src="images/loading.gif" border="0" height="64" width="64"> Loading....
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-9">
<div class="panel panel-default">
<div class="panel-heading">Account actions</div>
<div class="panel-body" id="accountactions">
<div id="unencryptedwallet" name="unencryptedwallet" style="display: none;">
<b>You have not configured your wallet yet. Choose one of the options below.</b><br><br>
This is a new wallet. To recover another wallet, import your wallet using the Recovery Phrase.<br>
<ul>
<li><a data-toggle="modal" href="#importrecoveryphrase">Import existing Recovery Phrase</a></li>
</ul>
Your wallet is not encrypted. No transactions can be made until you encrypt your wallet.
<ul>
<li><a data-toggle="modal" href="#setuppassphrase">Set a password to encrypt this wallet</a></li>
</ul>
</div>
<div id="encryptedwallet" name="encryptedwallet" style="display: none;">
<ul>
<li><a data-toggle="modal" href="#changepassphrase">Change wallet password</a></li>
<li><a data-toggle="modal" href="#showrecoveryphrase">Show the Recovery Phrase</a></li>
<li><a data-toggle="modal" href="#importrecoveryphrase">Import existing Recovery Phrase</a></li>
<!--<li>Backup wallet</li>-->
<li><a data-toggle="modal" href="#createtransaction">Create a transaction</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-9">
<div class="panel panel-default">
<div class="panel-heading">Last 30 transactions</div>
<div class="panel-body" id="accounttransactions">
<div class="table-responsive">
<table class="table table-striped" id="tabletransactions">
<thead>
<tr>
<th>Date</th>
<th>Amount</th>
<th>TransactionID</th>
</tr>
</thead>
<tbody>
<tr><td colspan="3"><img src='images/loading.gif' border='0' height='64' width='64'> Loading....</td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<hr>
</div><!--/row-->
</div>