-
Notifications
You must be signed in to change notification settings - Fork 2
/
wallet.html
793 lines (674 loc) · 30.6 KB
/
wallet.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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
<html>
<head>
<title>wallet</title>
<style type="text/css">
#addr_tab {
width:35%;
display:inline-block;
vertical-align:top;
text-align:center;
}
.src_address {
font-size:1.2em;
font-weight:lighter;
}
.my_address {
font-weight:bold;
cursor:pointer;
}
.address {
font-weight:bold;
cursor:pointer;
}
#left_tab {
display:inline-block;
width:60%;
}
#left_tab h2{
display:inline-block;
cursor:pointer;
margin:8px;
padding:4px;
border:1px solid;
}
#left_tab h2.selected{
background-color:#AAA;
}
.addr_send {
color:#ff0000;
}
.addr_recv {
color:#4cff00;
}
#unspent_tab
{
width:45%;
display:inline-block;
vertical-align:top;
overflow:hidden;
border:1px solid;
margin:3px;
}
.addr_from {
font-size:1.0em;
font-weight:bold;
}
.unspent_tx,.spent_tx,.recv_tx{
font-size:1.0em;
font-weight:lighter;
font-family:monospace;
}
#spent_tab
{
width:45%;
display:inline-block;
vertical-align:top;
overflow:hidden;
border:1px solid;
margin:3px;
}
#nodeinfos {
margin:4px;
border:1px solid;
border-radius:2px;
}
#lastblock {
margin:4px;
border:1px solid;
border-radius:2px;
}
.lbl {
text-align:right;
}
#newaddr
{
display:none;
padding:8px;
border:1px solid;
text-align:left;
}
#newaddr div
{
text-align:left;
}
</style>
<script src="/ecdsa_bundle.js"></script>
<script src="/jsSHA-2.2.0/src/sha_dev.js"></script>
<script src="/jquery-3.1.1.min.js"></script>
<script language="javascript">
var ec = null;
var addrs = null;
var unspents = null;
var spents = null;
var moneysupply=null;
var my_addrs = null;
var txs= null;
var recvs = null;
var scanTimer = null;
var userTimer = null;
var blockTimer = null;
var pubkey = null;
var privkey = null;
var unit=1;
function rpc_call(in_method,in_params,in_success)
{
$.ajax({
url: '/jsonrpc',
data: JSON.stringify({ jsonrpc: '2.0', method: in_method, params: in_params, id: 1 }), // id is needed !!
type: "POST",
dataType: "json",
success: in_success,
error: function (err) { alert("Error"); }
});
}
var hexChar = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
function hex32(val) {
val &= 0xFFFFFFFF;
var hex = val.toString(16).toUpperCase();
return reverse(("00000000" + hex).slice(-8));
}
function sha256(s) { // Requires jsSHA
var shaObj = new jsSHA("SHA-256", "HEX");
shaObj.update(s);
return shaObj.getHash("HEX");
}
function toHexString(arr) {
var str = '';
for (var i = 0; i < arr.length ; i++) {
str += ((arr[i] < 16) ? "0" : "") + arr[i].toString(16);
}
return str;
}
function from_b58(S, //Base58 encoded string input
A //Base58 characters (i.e. "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
) {
var d = [], //the array for storing the stream of decoded bytes
b = [], //the result byte array that will be returned
i, //the iterator variable for the base58 string
j, //the iterator variable for the byte array (d)
c, //the carry amount variable that is used to overflow from the current byte to the next byte
n; //a temporary placeholder variable for the current byte
for (i in S) { //loop through each base58 character in the input string
j = 0, //reset the byte iterator
c = A.indexOf(S[i]); //set the initial carry amount equal to the current base58 digit
if (c < 0) //see if the base58 digit lookup is invalid (-1)
return undefined; //if invalid base58 digit, bail out and return undefined
c || b.length ^ i ? i : b.push(0); //prepend the result array with a zero if the base58 digit is zero and non-zero characters haven't been seen yet (to ensure correct decode length)
while (j in d || c) { //start looping through the bytes until there are no more bytes and no carry amount
n = d[j]; //set the placeholder for the current byte
n = n ? n * 58 + c : c; //shift the current byte 58 units and add the carry amount (or just add the carry amount if this is a new byte)
c = n >> 8; //find the new carry amount (1-byte shift of current byte value)
d[j] = n % 256; //reset the current byte to the remainder (the carry amount will pass on the overflow)
j++ //iterate to the next byte
}
}
while (j--) //since the byte array is backwards, loop through it in reverse order
b.push(d[j]); //append each byte to the result
return new Uint8Array(b) //return the final byte array in Uint8Array format
}
function timeConverter(UNIX_timestamp) {
var a = new Date(UNIX_timestamp * 1000);
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
var year = a.getFullYear();
var month = months[a.getMonth()];
var date = a.getDate();
var hour = a.getHours();
var min = a.getMinutes();
var sec = a.getSeconds();
var time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec;
return time;
}
function generateKeys() {
// Generate keys
var key = ec.genKeyPair();
$('#privkey').val(key.getPrivate('hex'));
pubkey = key.getPublic().encodeCompressed('hex');
privkey = key.getPrivate('hex');
pubkey_to_addr(pubkey);
}
function newkey() {
var addr, sk, hexk;
addr = $('#privkey').val();
data = from_b58(addr, "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");
crc = toHexString(data.slice(34, 38));
sk = data.slice(0, 34);
hexk = toHexString(sk);
h = sha256(hexk);
h2 = sha256(h);
if (crc != h2.slice(0, 8))
alert('bad key');
sk = data.slice(1, 33);
hexk = toHexString(sk);
keys = ec.keyPair({ priv: hexk, privEnc: 'hex' });
pubkey = keys.getPublic().encodeCompressed('hex');
privkey = hexk;
pubkey_to_addr(pubkey);
}
function pubkey_to_addr(pubkey) {
rpc_call('pubkeytoaddr', [pubkey], function (data) {
$('#pubaddr').html(data.result.addr);
});
}
function select_menu(id)
{
if (id == "tab_unspent")
$('#tab_unspent').addClass('selected');
else
$('#tab_unspent').removeClass('selected');
if (id == "tab_spent")
$('#tab_spent').addClass('selected');
else
$('#tab_spent').removeClass('selected');
if (id == "tab_received")
$('#tab_received').addClass('selected');
else
$('#tab_received').removeClass('selected');
if (id == "tab_txs")
$('#tab_txs').addClass('selected');
else
$('#tab_txs').removeClass('selected');
}
function update_unspent() {
var total;
if(unspents==null)return;
var num_unspents = unspents.length;
thead = document.getElementById("list_table").tHead;
thead.rows[0].cells[2].innerHTML = 'from';
old_tbody = document.getElementById("list_table").tBodies[0];
new_tbody = document.createElement('tbody');
total = 0;
for (n = 0; n < num_unspents; n++) {
var row = new_tbody.insertRow(n);
cell = row.insertCell(0);
cell.className = "time";
cell.innerHTML = timeConverter(unspents[n].time);
cell = row.insertCell(1);
cell.className = "unspent_tx";
cell.innerHTML = unspents[n].txid;
cell = row.insertCell(2);
cell.className = "addr_from";
naddr = unspents[n].addresses.length;
addresses = '';
while (naddr--) {
addresses += unspents[n].addresses[naddr] + '<br/>';
}
cell.innerHTML = addresses;
cell = row.insertCell(3);
cell.className = "addr_amount";
cell.innerHTML = unspents[n].amount / unit;
cell = row.insertCell(4);
cell.className = "tx_conf";
cell.innerHTML = unspents[n].confirmations;
total += unspents[n].amount;
}
$('#txtotal').html(total/unit);
old_tbody.parentNode.replaceChild(new_tbody, old_tbody);
}
function update_spent() {
if(spents==null)return;
var total;
var thead;
var num_spents = spents.length;
thead = document.getElementById("list_table").tHead;
thead.rows[0].cells[2].innerHTML = 'to';
old_tbody = document.getElementById("list_table").tBodies[0];
new_tbody = document.createElement('tbody');
total = 0;
for (n = 0; n < num_spents; n++) {
var row = new_tbody.insertRow(n);
cell = row.insertCell(0);
cell.className = "time";
cell.innerHTML = timeConverter(spents[n].time);
cell = row.insertCell(1);
cell.className = "spent_tx";
cell.innerHTML = spents[n].txid;
cell = row.insertCell(2);
cell.className = "addr_to";
naddr = spents[n].addresses.length;
addresses = '';
while (naddr--) {
addresses += spents[n].addresses[naddr] + '<br/>';
}
cell.innerHTML = addresses;
cell = row.insertCell(3);
cell.className = "addr_amount";
cell.innerHTML = spents[n].amount / unit;
cell = row.insertCell(4);
cell.className = "tx_conf";
cell.innerHTML = spents[n].confirmations;
total += spents[n].amount;
}
$('#txtotal').html(total / unit);
old_tbody.parentNode.replaceChild(new_tbody, old_tbody);
}
function update_recvs() {
if(recvs==null)return;
var total;
var thead;
var num_recvs = recvs.length;
thead = document.getElementById("list_table").tHead;
thead.rows[0].cells[2].innerHTML = 'from';
old_tbody = document.getElementById("list_table").tBodies[0];
new_tbody = document.createElement('tbody');
total = 0;
for (n = 0; n < num_recvs; n++) {
var row = new_tbody.insertRow(n);
var naddr;
var addresses;
cell = row.insertCell(0);
cell.className = "time";
cell.innerHTML = timeConverter(recvs[n].time);
cell = row.insertCell(1);
cell.className = "recv_tx";
cell.innerHTML = recvs[n].txid;
cell = row.insertCell(2);
cell.className = "addr_from";
naddr = recvs[n].addresses.length;
addresses = '';
while (naddr--) {
addresses += recvs[n].addresses[naddr]+'<br/>';
}
cell.innerHTML = addresses;
cell = row.insertCell(3);
cell.className = "addr_amount";
cell.innerHTML = recvs[n].amount / unit;
cell = row.insertCell(4);
cell.className = "tx_conf";
cell.innerHTML = recvs[n].confirmations;
total += recvs[n].amount;
}
$('#txtotal').html(total / unit);
old_tbody.parentNode.replaceChild(new_tbody, old_tbody);
}
function update_txs() {
if (txs == null) return;
var total;
var thead;
var num_txs = txs.length;
thead = document.getElementById("list_table").tHead;
thead.rows[0].cells[2].innerHTML = 'category';
old_tbody = document.getElementById("list_table").tBodies[0];
new_tbody = document.createElement('tbody');
total = 0;
for (n = 0; n < num_txs; n++) {
var row = new_tbody.insertRow(n);
cell = row.insertCell(0);
cell.className = "time";
cell.innerHTML = timeConverter(txs[n].time);
cell = row.insertCell(1);
cell.className = "recv_tx";
cell.innerHTML = txs[n].txid;
cell = row.insertCell(2);
cell.className = "recv_tx";
cell.innerHTML = txs[n].category;
cell = row.insertCell(3);
if (txs[n].category == "send") {
cell.className = "addr_send";
cell.innerHTML = "-" + txs[n].amount / unit;
total -= txs[n].amount;
}
else {
cell.className = "addr_recv";
cell.innerHTML = "+" + txs[n].amount / unit;
total += txs[n].amount;
}
}
$('#txtotal').html(total / unit);
old_tbody.parentNode.replaceChild(new_tbody, old_tbody);
}
function update_addr_list() {
if(addrs==null)return;
var num_addrs = addrs.length;
old_tbody = document.getElementById("address_list_table").tBodies[0];
new_tbody = document.createElement('tbody');
for (n = 0; n < num_addrs; n++) {
var row = new_tbody.insertRow(n);
cell = row.insertCell(0);
cell.className = "address";
cell.innerHTML = addrs[n].addr;
cell = row.insertCell(1);
cell.className = "addr_received";
cell.innerHTML = '<span>' + addrs[n].amount / unit + '</span>';
}
old_tbody.parentNode.replaceChild(new_tbody, old_tbody);
$('.address').click(function () { list_txs($(this).html()); if (scanTimer != null) { clearTimeout(scanTimer); scanTimer = null; } scan_status($(this).html()); });
}
function update_my_addrs() {
old_tbody = document.getElementById("my_address_list_table").tBodies[0];
new_tbody = document.createElement('tbody');
if ((my_addrs == null) || (my_addrs.length == 0))
{
document.getElementById("my_address_list_table").style.display='none';
$('#myaddrhdr').html('no addresses');
}
else
{
var num_addrs = my_addrs.length;
for (n = 0; n < num_addrs; n++) {
var row = new_tbody.insertRow(n);
cell = row.insertCell(0);
cell.className = "label";
cell.innerHTML = my_addrs[n].label;
cell = row.insertCell(1);
cell.className = "my_address";
cell.innerHTML = my_addrs[n].address;
cell = row.insertCell(2);
cell.className = "balance_confirmed";
cell.innerHTML = '<span>' + my_addrs[n].amount / unit + '</span>';
cell = row.insertCell(3);
cell.className = "balance_unconfirmed";
cell.innerHTML = '<span>' + my_addrs[n].unconf_amount / unit + '</span>';
}
document.getElementById("my_address_list_table").style.display='block';
$('#myaddrhdr').html(num_addrs + ' addresses');
}
old_tbody.parentNode.replaceChild(new_tbody, old_tbody);
$('.my_address').click(function () { list_txs($(this).html()); if (scanTimer != null) { clearTimeout(scanTimer); scanTimer = null; } scan_status($(this).html()); });
}
function list_unspent(address) {
var old_tbody = document.getElementById("list_table").tBodies[0];
var new_tbody = document.createElement('tbody');
old_tbody.parentNode.replaceChild(new_tbody, old_tbody);
rpc_call('listunspent', [0, 9999999, [address]], function (data) {
unspents = data.result.unspents;
unspents.sort(function (a, b) {return (b.time - a.time);});
$('#unspentaddr').html(address);
update_unspent();
select_menu("tab_unspent");
});
}
function list_spent(address) {
var old_tbody = document.getElementById("list_table").tBodies[0];
var new_tbody = document.createElement('tbody');
old_tbody.parentNode.replaceChild(new_tbody, old_tbody);
rpc_call('listspent', [0, 9999999, [address]], function (data) {
spents = data.result.spents;
spents.sort(function (a, b) { return (b.time - a.time); });
$('#unspentaddr').html(address);
update_spent();
select_menu("tab_spent");
});
}
function list_recvs(address) {
var old_tbody = document.getElementById("list_table").tBodies[0];
var new_tbody = document.createElement('tbody');
old_tbody.parentNode.replaceChild(new_tbody, old_tbody);
rpc_call('listreceived', [0, 9999999, [address]], function (data) {
recvs = data.result.received;
recvs.sort(function (a, b) { return (b.time - a.time); });
$('#unspentaddr').html(address);
update_recvs();
select_menu("tab_received");
});
}
function list_txs(address) {
var old_tbody = document.getElementById("list_table").tBodies[0];
var new_tbody = document.createElement('tbody');
old_tbody.parentNode.replaceChild(new_tbody, old_tbody);
rpc_call('listtransactions', [[address]], function (data) {
txs = data.result.txs;
txs.sort(function (a, b) { return (b.time - a.time); });
$('#unspentaddr').html(address);
update_txs();
select_menu("tab_txs");
});
}
function list_received() {
var old_tbody = document.getElementById("list_table").tBodies[0];
var new_tbody = document.createElement('tbody');
old_tbody.parentNode.replaceChild(new_tbody, old_tbody);
rpc_call('listreceivedbyaddress', [0, true], function (data) {
addrs = data.result.addrs;
update_addr_list();
});
}
function get_blockcount() {
rpc_call('getblockcount', [], function (data) {
blockcount = data.result.count;
$('#blockcount').html(blockcount);
blockTimer = setTimeout(get_blockcount, 60*1000);
});
}
function get_lastblock() {
rpc_call('getlastblock', [], function (data) {
var ntx;
lastblock = data.result;
$("#confirmations").html(data.result.confirmations);
$("#difficulty").html(data.result.difficulty);
$("#hash").html(data.result.hash);
$("#height").html(data.result.height);
$("#merkleroot").html(data.result.merkleroot);
$("#nextblockhash").html(data.result.nextblockhash);
$("#nonce").html(data.result.nonce);
$("#size").html(data.result.size);
$("#bits").html('0x' + data.result.bits.toString(16));
$("#diffhash").html(data.result.hbits);
$("#proofhash").html(data.result.proofhash);
$("#stakemodifier2").html(data.result.stakemodifier2);
$("#time").html(timeConverter(data.result.time));
$("#version").html(data.result.version);
$("#txs").empty();
if(data.result.txs)
{
ntx = data.result.txs.length;
for(n=0;n<ntx;n++)
{
$("#txs").append('<div>'+data.result.txs[n]+'</div>');
}
}
});
}
function get_infos() {
rpc_call('getinfo', [], function (data) {
moneysupply = data.result.moneysupply;
$('#node_ip').html(data.result.ip);
$('#node_port').html(data.result.p2pport);
$('#node_paytxfee').html(data.result.paytxfee);
$('#node_balance').html(data.result.balance);
$('#node_supply').html(moneysupply / unit);
$('#node_difficulty').html('pow difficulty:' + data.result.difficulty.pow + ' pos difficulty:' + data.result.difficulty.pos);
$('#node_version').html(data.result.version);
$('#protocol_version').html(data.result.protocolversion);
$('#protocol_walletversion').html(data.result.walletversion);
blockTimer = setTimeout(get_blockcount, 60 * 1000);
});
}
function scan_status(address) {
rpc_call('getaddressscanstatus', [address], function (data) {
if (data.error == 0) {
if (data.result.scanning == 1) {
$('#scanning').html('scanned up to block ' + data.result.block + ' on ' + blockcount + ' (scanning)');
scanTimer = setTimeout(scan_status, 1000, address);
}
else
$('#scanning').html('scanned up to block ' + data.result.block + ' on ' + blockcount + ' (not scanning)');
}
else {
$('#scanning').empty();
scanTimer = null;
}
});
}
function import_address(address) {
rpc_call('importaddress', [address], function (data) { });
}
function get_addrs(username) {
rpc_call('getpubaddrs', [username], function (data) {
$('#newaddr').css('display', 'block');
if ((typeof data.result.addrs === 'undefined') || (data.result.addrs.length == 0)) {
my_addrs = null;
}
else {
my_addrs = data.result.addrs;
}
update_my_addrs();
/*
list_unspent(addrs);
list_staking(addrs);
*/
});
}
function import_keys(username, label) {
rpc_call('importkeypair', [username, label, pubkey, privkey, 0], function (data) {
get_addrs(username);
});
}
$(document).ready(function () {
ec = new EC('secp256k1');
// Generate keys
var key = ec.genKeyPair();
// Sign message (must be an array, or it'll be treated as a hex sequence)
var msg = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
var signature = key.sign(msg);
// Export DER encoded signature in Array
var derSign = signature.toDER();
// Verify signature
if(!key.verify(msg, derSign))
alert('ecdsa signature test failed!');
get_blockcount();
get_lastblock();
get_infos();
list_received();
update_my_addrs();
});
</script>
</head>
<body>
<div><span>Units : </span><select onchange="unit = this.options[this.selectedIndex].value; $('#node_supply').html(moneysupply / unit); update_addr_list(); update_unspent(); update_spent(); update_recvs(); update_txs();" id="units" name="units"><option value="1">satoshis</option><option value="1000000">cents</option><option value="100000000">coin</option></select></div>
<div id="nodeinfos">
<div><h1>node info</h1></div>
<div>block height : <span id="blockcount"></span></div>
<div>
<div><span id="node_version"></span><span id="node_ip"></span>:<span id="node_port"></span> protocol : <span id="protocol_version"></span> wallet: <span id="protocol_walletversion"></span></div>
<div>tx fees:<span id="node_paytxfee"></span></div>
<div>supply:<span id="node_supply"></span><br/>balance:<span id="node_balance"></span></div>
<div><span id="node_difficulty"></span></div>
</div>
</div>
<div id="lastblock">
<div><h1>last block</h1></div>
<table id="tblblock">
<tr><td class="lbl">confirmations :</td> <td id="confirmations"></td></tr>
<tr><td class="lbl">difficulty :</td> <td id="difficulty"></td></tr>
<tr><td class="lbl">hash :</td> <td id="hash"></td></tr>
<tr><td class="lbl">height :</td> <td id="height"></td></tr>
<tr><td class="lbl">merkleroot :</td> <td id="merkleroot"></td></tr>
<tr><td class="lbl">nextblockhash :</td> <td id="nextblockhash"></td></tr>
<tr><td class="lbl">nonce :</td> <td id="nonce"></td></tr>
<tr><td class="lbl">bits : </td><td id="bits"></td></tr>
<tr><td class="lbl">difficulty hash :</td> <td id="diffhash"></td></tr>
<tr><td class="lbl">proofhash :</td> <td id="proofhash"></td></tr>
<tr><td class="lbl">size :</td> <td id="size"></td></tr>
<tr><td class="lbl">stakemodifier2 :</td> <td id="stakemodifier2"></td></tr>
<tr><td class="lbl">time :</td> <td id="time"></td></tr>
<tr><td class="lbl">version :</td> <td id="version"></td></tr>
<tr><td class="lbl">txs :</td> <td id="txs"></td></tr>
</table>
</div>
<div id="addr_tab">
<div id="all addresses">
<h2>all addresses</h2>
<table id="address_list_table">
<thead><tr><th>address</th><th>received</th></tr></thead>
<tbody></tbody>
</table>
</div>
<div id="myaccount">
<h1>my acount</h1>
<div><span class="lbl">username :</span><input type="text" id="username" name="username" value="" /><input type="button" onclick="get_addrs($('#username').val());" value="load addresses" /></div>
<div>
<h2>my addresses</h2>
<div><span id="myaddrhdr"></span></div>
<table id="my_address_list_table">
<thead><tr><th>label</th><th>address</th><th>balance</th><th>uncomfirmed balance</th></tr></thead>
<tbody></tbody>
</table>
</div>
<div id="newaddr">
<h3>import</h3>
<div>label : <input size="32" type="text" id="addrlabel" value="" /></div>
<div>privkey : <input size="64" type="text" id="privkey" oninput="newkey(this.value);" value="" /></div>
<div>address : <span id="pubaddr"></span></div>
<input type="button" value="create new" onclick="generateKeys();" />
<input type="button" value="import" onclick="import_keys($('#username').val(),$('#addrlabel').val());" />
<!-- new addr : <input id="address" type="text" size="34" /> <input type="button" onclick="import_address($('#address').val());" value="import" />-->
</div>
</div>
</div>
<div id="left_tab">
<h1 id="unspentaddr"></h1><div id="scanning"></div>
<h2 id="tab_txs" onclick="list_txs($('#unspentaddr').html());">txs</h2><h2 id="tab_unspent" onclick="list_unspent($('#unspentaddr').html());">unspent</h2><h2 id="tab_spent" onclick="list_spent($('#unspentaddr').html());">spent</h2><h2 id="tab_received" onclick="list_recvs($('#unspentaddr').html());">received</h2>
<div> total : <span id="txtotal"></span></div>
<table id="list_table">
<thead>
<th>time</th>
<th>tx</th>
<th>from</th>
<th>amount</th>
<th>nconf</th>
</thead>
<tbody></tbody>
</table>
</div>
</body>
</html>