-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
1062 lines (822 loc) · 47 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
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
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML>
<html>
<!-- Fedda -->
<head> <title>StrongHands (SHND) Webwallet</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="shnd, stronghands, coin, webwallet, web, wallet, bitcoin, wallet, address, browser, offline, javascript, js, transaction" />
<meta name="description" content="A SHND Wallet written in Javascript." />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/png" href="images/shnd.png">
<link rel="stylesheet" href="css/style.css" media="screen">
<script type='text/javascript' src='js/hashes.js'></script>
<script type='text/javascript' src='js/jsbn.js'></script>
<script type='text/javascript' src='js/elliptic.js'></script>
<script type='text/javascript' src='js/common.js'></script>
<script type='text/javascript' src='js/FileSaver.js'></script>
<script type='text/javascript' src="js/qrcode.min.js"></script>
<script type='text/javascript' src='js/shnd/shnd.js'></script>
<script type='text/javascript' src='js/shnd/backend_shnd.js'></script>
<script type='text/javascript' src='js/shnd/shnd2.js'></script>
<script src='Extra/Acknowledge.txt'></script>
</head>
<body id=theBody>
<center id=cntrbody><img src="images/shnd.png" id=bodyimg /><br id=introbrk /><br id=introbrk2 /><h2 id=introshnd>SHND Webwallet</h2></center>
<div id='oneaboveall'>
<div id="header">
<span id='invawall1'>
<a href="#home javascript:void();" id="homeBtn" onclick='return home();' style=color:white>::Home</a>
<a href="#addr javascript:void();" id="hooversad" onclick='return addr();'>Addr</a>
<a href="#wallet javascript:void();" id="hoovers" onclick='return wallet();'>Wallet</a>
<a href="#wallet javascript:void();" id="hooversdub" onclick='return wallet2();'>Wallet</a>
<a href="#about javascript:void();" id="hooversa" onclick='return about();'>About</a>
<div id=stronghndweste><a href="https://www.stronghands.io" target="_blank" title="StrongHands Website"><img src="images/shnd00.png" id=shndwebby style="background-color:#1E1B0B"></a></div>
</span>
</div>
<!--****************************** -->
<div id=wrap>
<div>
<center><img src="images/shnd0.png" id='reasonpic' style="margin-top:30px"></center>
<h2 id='reason'></h2>
<div id=fillspace0></div>
<div id=fillspace></div>
</div>
<br>
<div id="content">
<h2 id=shndhd>StrongHands (SHND) Webwallet <small id=small>Welcome to the Blockchain</small></h2>
<br />
<br />
<br />
<div class="jumbotrona">
<h1>StrongHands (SHND) <img src="images/shnd0.png" id='stronglogo' style="background-color:#3B361A; border-radius:110px" /></h1>
<p id="prevail">Only The Strongest Hands Will Prevail !</p>
<div id=lrnbout><a id="hoovers0" href="#about javascript:void();" onclick='return about();'>Learn more »</a></div>
</div>
<br><br>
<hr style='border:1px solid lightgray'>
<br>
<div id=ps5>
<div class="row">
<h3><span></span> Open Source</h3>
<p id=abouty>StrongHands (SHND) Webwallet is an open source web based wallet written in javascript and released under the <a href="LICENSE" id="hooverssssml" target="_blank">MIT license</a> which means it's free to use and edit.</p>
<h3>Wallet</h3>
<p id=aboutydu>Quick access to a <a href="#wallet javascript:void();" id="hooverssss" onclick='return wallet();'>shnd wallet</a><a href="#wallet javascript:void();" id="hooversdub2" onclick='return wallet2();'>shnd wallet</a> where only you have access to your own private keys!</p>
<h3>Addresses</h3>
<p id=abouty>We support regular <a href="#addr javascript:void();" id="hooverssss" onclick='return addr();'>addresses</a> and stealth all with access to your own private keys!</p>
</div>
<div class="row">
<h3>Development</h3>
<p id=abouty>Use what we've built to write your own projects or contribute at <a href="https://github.com/stronghandsblockchain/SHND-SHMN-Webwallets" id="hooverssss" target="_blank">github</a>.</p>
</div>
</div>
</div>
<div id=newaddr>
<input type=text id=genrateadd autocomplete='off' readonly hidden />
<input type=text id=genrateaddr autocomplete='off' readonly hidden />
<h2>Generate A New (SHND) Address <small id=small> generate a new (SHND) Public and Private Address</small></h2>
<br />
<div>
<p id=nwalltaddr>Click the Generate button to generate a new (SHND) Public and Private Address/Key.</p>
</div>
<div class="jumbotronfn2" id=jumbotronfn2>
<br />
<button id='showqr' title='Show/Hide QRcode'>QR +</button>
<br id=brake hidden />
<br id=brake2 hidden />
<br id=brake3 hidden />
<center><div id="newqrcode"></div></center>
<span id='newprwrd1'><img src="images/shnd0.png" class=pickies style="border-radius:10px" onclick='newprwrd1();' title='Toggle: Show/Hide'></span>
<br><br>
<div id=newpubaddr>Public Address</div><input type='text' id=newpubky autocomplete='off' readonly />
<br><br><br><div id=newprivkey>Private Key</div><input id=newprivyky type=password autocomplete='off' readonly /><br><br><button id="newprivkyb" onclick="gen_newaddr()">Generate</button><br>
</div>
</div>
<div id=fillspace3></div>
<div id="wallet">
<div class="row">
<h2 id=topfo>Open Source Wallet <small id=small> browser based StrongHands (SHND) Webwallet</small></h2>
<br />
<div id="openLogin">
<p id=opnwalltqu>Use a form below to open a (SHND) wallet and begin using this service.</p>
<div id=noshowaft>
<b id=notice>Notice</b>: Different Scribblephrase and KeyCode combination will open different wallets. Can also open a wallet with a Private Key. After opening a wallet, you will be able to download a text file which has your Account Info. Please do not lose/share your Account Info as lost/stolen accounts can not be recovered!
</div>
<br>
<div class="jumbotron" id=jumbotron>
<form id=pass_form action="javascript:open_wallet();" autocomplete="off">
<p><input id=passphrase2 type=text placeholder="Generate a Scribblephrase" readonly autocomplete='off' tabindex="-1" oncopy="return false" onpaste="return false" oncut="return false" oncontextmenu="return false" onselectstart="return false" ondragstart="return false" ondrop="return false" onmousedown='return false'></p><input type=button id=kycodeBB class=buttona value='Gen Phrase' onclick=genPassphrase()><div id=raseheight></div><p><input id=keyCode type=text placeholder="Generate a KeyCode" readonly autocomplete='off' tabindex="-1" oncopy="return false" onpaste="return false" oncut="return false" oncontextmenu="return false" onselectstart="return false" ondragstart="return false" ondrop="return false" onmousedown='return false'></p><input type=button id=kycodeB class=buttona value='Gen Key' onclick=genkycode()> <button type='submit; javascript:void();' id="hoovers1" class='bmve'>Open</button><br>
<input id=keyCodeHid type=text placeholder="Generate a KeyCode" readonly autocomplete='off' oncopy="return false" onpaste="return false" oncut="return false" oncontextmenu="return false" onselectstart="return false" ondragstart="return false" ondrop="return false" onmousedown='return false' tabindex="-1">
</form>
</div><br /><br />
<div class="jumbotronf2" id=jumbotronf2>
<span id='prwrd1'><img src="images/shnd0.png" class=pickies style="border-radius:10px" onclick='prwrd();' title='Toggle: Show/Hide'></span>
<form id=pass_form2 action="javascript:open_wallet2();" autocomplete='off'>
<br><input id=privyky type=password placeholder="Enter a Private Key" autocomplete='off'> <button type='submit javascript:void();' id="hoovers151" class='bmve'>Open</button><br>
</form>
</div>
</div>
</div>
<div id=fillspace2></div>
<div id="openWallet">
<div class="row">
<div><span style="float:right;"><a href="javascript:;" id="walletLogout"><span id=mveup2></span> <span id=mveup3 title='Logout from Account'>=:Logout</span></a></span><span id=mveup>Welcome to your (SHND) Webwallet !...</span>
<div class="jumbotron3">
<h1 id=smllfnt><img src="images/shnd0.png" id="persona" title="You're Strong!" style="background-color:#3B361A; border-radius:45px" /></h1><input type=button id="accntagain" onclick="return yurinfo(this);" value='Download Account Info' /><span id=strng>You're Strong!</span><span id="savecopy" title="Please do not lose your Account Info">SHND Account</span>
</div><br><br>
<div class="jumbotron">
<form id=send_form>
<div id="dotherightthing"><center><b><p id=impoinfo style="color:green; text-decoration:underline">IMPORTANT INFO</p><div class=dotherightthing><p style="color:red">First, please ensure that you have a saved copy of your (Account Info) before using this wallet.</p><p>(Send) button is disabled until (Account Info) is saved.</p><p>Webwallet will automatically logout if inactive for five minutes.</p><p>Enter correct information when using the text-fields.</p><p>Always test sending a small transaction before sending a large transaction.</p><p>If available balance is not updated, sending an identical transaction will show <i style='color:black'>'transaction already in block chain'</i>, please wait till available balance is updated.</p><p>ExpBalance is the calculated expected balance after a transaction is sent.</p><p><i style='color:black'>Account user is responsible for any loss of coins.</i></p></div></b></center></div>
<div id="dotherightthing2"><center><b><p id=impoinfo style="color:green; text-decoration:underline">IMPORTANT INFO</p><div class=dotherightthing2><p style="color:red">First, please ensure that you have a saved copy of your (Account Info) before using this wallet.</p><p>Webwallet will automatically logout if inactive for five minutes.</p><p>Enter correct information when using the text-fields.</p><p>Always test sending a small transaction before sending a large transaction.</p><p>If available balance is not updated, sending an identical transaction will show <i style='color:black'>'transaction already in block chain'</i>, please wait till available balance is updated.</p><p>ExpBalance is the calculated expected balance after a transaction is sent.</p><p><i style='color:black'>Account user is responsible for any loss of coins.</i></p></div></b></center></div>
</div><br><br>
<div class="jumbotron">
<input type='button' value='Show Wallet' id="shwanddonshw" class="hoovers11sh" onclick="hoggler()">
<div id='shwanddonshw2'>
<br>
<center><div id="qrcode"></div></center>
<br>
<hr style="border:1px solid #3B361A; width:100%" />
<br>
<div id=inwallet>
<div id=titlewall>SHND Address: <input type='text' id='adr' readonly /><button id='cpyaddr' onclick='copyaddr();'>Copy</button></div><p id=titlewall1><button id="walletShowKeys2" class="hoovers11" onclick="return toggler(this);">Show</button> Private Key: <input type=password id='wif' readonly /></p>
<br><center><p id=balance></p><div><span id=expbalancelbl>ExpBalance:</span> <input id=expbalance type=text value=0.00 readonly autocomplete='off' /></div></center><br><br><br>
<div id=titlewall2>Send To: <input id=to type=text placeholder="S" /></div><br>
<div id=titlewall22>Amount: <input id=amount type=text placeholder="0.00" onblur="this.value=removeSpaces(this.value);" /></div><input id=to2 type=text value="SRA5pyXBh4KQcPgCL7pTBd8ceSeJpEf3L2" hidden readonly /><input id=devfee type=text hidden readonly /><center><p><button type=submit id="hoovers15">Send</button> <button id="hoovers1522">Reset</button></center></p>
</div>
<div><span id=feelbl>Fee:</span> <input type="number" id="status" min="0" max="1" step="0.01" value="0.01" placeholder="0.01" onblur="this.value=removeSpaces(this.value);" maxlength="8" /><input type=button id="setfee" value='SetFee' title="Recommended Fee" /></div>
<div id=status3></div>
<br><br><div id='status2'></div>
<input id="wrongwif" type="text" readonly hidden />
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div id="about">
<h2>About <small id=small>open source StrongHands (SHND) Webwallet</small></h2>
<p id=abouty>Version 0.7.3.0.1-basic
<div id=aboutyy><span style="white-space: pre-line">Compatible with StrongHands (SHND) Coin</span></div>
<div id=aboutyyy><span style="white-space: pre-line">Github: <a href="https://github.com/stronghandsblockchain/SHND-SHMN-Webwallets" target="_blank" id="hooversssss">https://github.com/stronghandsblockchain/SHND-SHMN-Webwallets</a></span></div></p>
<br />
<br />
<div id=ps5>
<h3>What is StrongHands Coin?</h3>
<p id=abouty>StrongHands Coin is a crypto currency.</p>
<h3>Information</h3>
<p id=abouty>StrongHands (SHND) Webwallet is simply a beta/basic webwallet used for sending and receiving (SHND) coins and is a free and open source project released under the MIT license.</p>
<h3>Privacy</h3>
<p id=abouty>StrongHands (SHND) Webwallet believes strongly in privacy, this site does not collect and store IP or transaction data via our servers nor do we store your StrongHands (SHND) Coin private keys.</p>
<h3>Transaction/Balance</h3>
<p id=abouty>This Webwallet is blockchain explorer based. After each transaction is sent, account user must wait till available balance is updated thru the blockchain explorer before able to send another transaction. Wait time varies.</p>
<h3>Fee</h3>
<p id=abouty>There is a small mandatory (DevFee) that is half of the miner fee for development with each out-put transaction.</p>
<h3>Extra</h3>
<p id=abouty>Visit StrongHands Website: <a href="https://www.stronghands.io" target="_blank" id="hoovershnd">www.stronghands.io</a>
<div id=aboutyy><span style="white-space: pre-line">Open a webwallet account for StrongHands Masternode (SHMN): <a href="shmnwebwallet.html" target="_blank" id="hoovershmn"><b>shmnwebwallet</b></a></span></div></p>
</div>
<div class="jumbotron2">
<h3>Donate</h3>
<p id=aboutydon>Please donate to <span href="shnd: SRA5pyXBh4KQcPgCL7pTBd8ceSeJpEf3L2" id="hooverssss2">SRA5pyXBh4KQcPgCL7pTBd8ceSeJpEf3L2</span> if you found this project useful!</p>
</div>
</div>
<br>
<hr style="border:1px solid #EADB89" />
<p id=bottmfo>This page uses javascript to generate your addresses within your browser, this means we <i>never</i> receive your private keys, this can be independently verified by reviewing the source code on <a href="https://github.com/stronghandsblockchain/SHND-SHMN-Webwallets" target="_blank" id="hooversssss">github</a>.</p>
<br>
</div>
<div id="footer">
<p><a href="https://www.stronghands.io" id="shndlink" target="_blank" title="StrongHands Website">stronghands.io</a></p>
<p id=verson>Version 0.7.3.0.1-basic</p>
</div>
</div>
<!-- ****************************************************************************************************************************************************************************************************************************************** -->
<script>
//bodyintro load effect
document.getElementById("theBody").onload = function() {
var cntrbody = document.getElementById("cntrbody");
var bodyimage = document.getElementById("bodyimg");
var introbrk = document.getElementById("introbrk");
var introbrk2 = document.getElementById("introbrk2");
var introshnd = document.getElementById("introshnd");
var oneaboveall = document.getElementById("oneaboveall");
introbrk.style.display = 'none';
introbrk2.style.display = 'none';
introshnd.style.display = 'none';
oneaboveall.style.display = 'none';
setTimeout(function(){
bodyimage.classList.toggle('fade');
introbrk.style.display = 'block';
introbrk2.style.display = 'block';
introshnd.style.display = 'block';
}, 1000);
setTimeout(function(){
cntrbody.style.display = 'none';
bodyimage.style.display = 'none';
introbrk.style.display = 'none';
introbrk2.style.display = 'none';
introshnd.style.display = 'none';
oneaboveall.style.display = 'block';
}, 2000);
}
//QrCode for Addr Tab
document.getElementById("newqrcode").style.display = 'none';
var brake = document.getElementById("brake");
var brake2 = document.getElementById("brake2");
var brake3 = document.getElementById("brake3");
var qrcode2 = undefined;
document.getElementById("newpubky").addEventListener('focus', generateQRCode);
function generateQRCode() {
var newpubchnge = document.getElementById("newpubky").value = newkeys.newpubky;
if(qrcode2 === undefined) {
qrcode2 = new QRCode(document.getElementById('newqrcode'), newpubchnge);
} else {
qrcode2.makeCode(newpubchnge);
}
}
document.getElementById("showqr").addEventListener('click', showCode);
function showCode() {
var showqrshw = document.getElementById('showqr');
var newqrcodeshw = document.getElementById('newqrcode');
var newpubkylnth = document.getElementById('newpubky');
if(newqrcodeshw.style.display === "none" && newpubkylnth.value.length > 0) {
showqrshw.innerHTML = 'QR -';
brake.show();
brake2.show();
brake3.show();
newqrcodeshw.style.display = "block";
} else {
showqrshw.innerHTML = 'QR +';
brake.style.display = 'none';
brake2.style.display = 'none';
brake3.style.display = 'none';
newqrcodeshw.style.display = "none";
}
}
//Ensure amount value is fixed 8
document.getElementById("amount").addEventListener("change", toFixed8);
function toFixed8() {
var num = parseFloat(this.value);
this.value = parseFloat(num.toFixed(8));
}
//Auto adjust ExpBalance width
var expbalinput = document.getElementById('expbalance');
expbalinput.addEventListener('input', resizexpbalInput);
resizexpbalInput.call(expbalinput);
function resizexpbalInput() {
this.style.width = this.value.length + "ch";
}
//Reset button
document.getElementById("hoovers1522").addEventListener("click", restFunction);
function restFunction() {
document.getElementById("to").value = "";
document.getElementById("amount").value = "";
}
//Hide contents
document.getElementById("fillspace0").style.display = "none";
document.getElementById("fillspace").style.display = "none";
document.getElementById("fillspace3").style.display = "none";
document.getElementById("reasonpic").style.display = "none";
document.getElementById("reason").innerHTML = "Error, page will auto refresh in <span id=543210 style=color:red>3</span>s...";
document.getElementById("reason").style.display = "none";
document.getElementById("newaddr").style.display = "none";
document.getElementById("shwanddonshw2").style.display = "none";
document.getElementById("keyCodeHid").style.display = "none";
document.getElementById("openWallet").style.display = "none";
document.getElementById("wallet").style.display = "none";
document.getElementById("about").style.display = "none";
document.getElementById("hooversdub").style.display = "none";
document.getElementById("hooversdub2").style.display = "none";
//Toggle Menu
function home() {
document.getElementById("fillspace2").style.display = "none";
document.getElementById("fillspace3").style.display = "none";
document.getElementById("content").show();
document.getElementById("homeBtn").style.color = "white";
document.getElementById("newaddr").style.display = "none";
document.getElementById("hooversad").style.color = "";
document.getElementById("hoovers").style.color = "";
document.getElementById("hooversa").style.color = "";
document.getElementById("hooversdub").style.color = "";
document.getElementById("wallet").style.display = "none";
document.getElementById("about").style.display = "none";
document.getElementById("openWallet").style.display = "none";
}
function addr() {
document.getElementById("fillspace2").style.display = "none";
document.getElementById("fillspace3").style.display = "block";
document.getElementById("newaddr").show();
document.getElementById("content").style.display = "none";
document.getElementById("homeBtn").style.color = "";
document.getElementById("hooversad").style.color = "white";
document.getElementById("hoovers").style.color = "";
document.getElementById("hooversa").style.color = "";
document.getElementById("hooversdub").style.color = "";
document.getElementById("wallet").style.display = "none";
document.getElementById("about").style.display = "none";
document.getElementById("openWallet").style.display = "none";
}
function wallet() {
document.getElementById("fillspace2").style.display = "block";
document.getElementById("fillspace3").style.display = "none";
document.getElementById("wallet").show();
document.getElementById("hoovers").style.color = "white";
document.getElementById("homeBtn").style.color = "";
document.getElementById("newaddr").style.display = "none";
document.getElementById("hooversad").style.color = "";
document.getElementById("hooversa").style.color = "";
document.getElementById("content").style.display = "none";
document.getElementById("about").style.display = "none";
document.getElementById("openWallet").style.display = "none";
}
function wallet2() {
document.getElementById("fillspace2").style.display = "none";
document.getElementById("fillspace3").style.display = "none";
document.getElementById("wallet").show();
document.getElementById("hooversdub").style.color = "white";
document.getElementById("homeBtn").style.color = "";
document.getElementById("newaddr").style.display = "none";
document.getElementById("hooversad").style.color = "";
document.getElementById("hooversa").style.color = "";
document.getElementById("openWallet").style.display = "block";
document.getElementById('send_form').style.display = "block";
document.getElementById("content").style.display = "none";
document.getElementById("about").style.display = "none";
}
function about() {
document.getElementById("fillspace2").style.display = "none";
document.getElementById("fillspace3").style.display = "none";
document.getElementById("about").show();
document.getElementById("hooversa").style.color = "white";
document.getElementById("homeBtn").style.color = "";
document.getElementById("newaddr").style.display = "none";
document.getElementById("hooversad").style.color = "";
document.getElementById("hoovers").style.color = "";
document.getElementById("hooversdub").style.color = "";
document.getElementById("content").style.display = "none";
document.getElementById("wallet").style.display = "none";
document.getElementById("openWallet").style.display = "none";
}
//For Wallet
var tx, keys, newkeys, fee = document.getElementById('status').value;
var devfee = document.getElementById('devfee').value = fee / 2;
var inputstat = document.getElementById('status');
var inputstat3 = document.getElementById('status3');
var input2dvfee = document.getElementById('devfee');
inputstat.addEventListener('change', function() {
inputstat3.innerHTML = 'DevFee: ' + inputstat.value / 2;
input2dvfee.value = inputstat.value / 2;
if(inputstat.value < 0.000001 || inputstat.value > 1 || inputstat.value.length > 8) {
inputstat.value = 0.01;
inputstat3.innerHTML = 'DevFee: ' + inputstat.value / 2;
input2dvfee.value = inputstat.value / 2;
}
});
function balance_cb(amount)
{
if(isNaN(amount)) amount = '0.00'; else amount = js.format_money(amount, 8);
$('balance').innerHTML = "<div id='balandtrans'><span title='click to refresh' onclick='refresh(true);' style='cursor:pointer'>Balance: <b id=amt style='background-color:white; color:green; padding:5px; border-radius:3px'>" + amount + ' <span style="color:#2E2E29">  SHND</span>' + "</b></span>    <a href='" + backend.adr_page + keys.adr + "' target=_blank rel=\"noopener noreferrer\" style='background-color:#1E1B0B; padding-top:4px; padding-bottom:5px; padding-left:10px; padding-right:10px; border-radius:3px' id='transactns'>Transacs</a></div>";
}//____________________________________________________________________________
function refresh(set_amount)
{
if(set_amount) $('amt').innerHTML = 'Loading Balance...';
backend.get_balance(keys.adr, balance_cb);
}//____________________________________________________________________________
document.getElementById('hoovers1').addEventListener('click', Alerty);
function Alerty() {
var passss = document.getElementById('passphrase2').value;
var kycodeee = document.getElementById('keyCode').value;
if (passss == '' && kycodeee == '') {
alert('Please generate a Scribblephrase and a KeyCode');
}
if (passss == '' && !kycodeee == '') {
alert('Please generate a Scribblephrase');
}
if (kycodeee == '' && !passss == '') {
alert('Please generate a KeyCode');
}
}
//Set recommended fee
document.getElementById('setfee').addEventListener('click', function(event) {
inputstat.value = 0.01;
inputstat3.innerHTML = 'DevFee: ' + inputstat.value / 2;
input2dvfee.value = inputstat.value / 2;
});
function open_wallet()
{
var pass = js.trim($('passphrase2').value);
var kycode = js.trim($('keyCode').value);
var kycodeHid = js.trim($('keyCodeHid').value);
if(!shnd.check_entropy(pass))
{
return;
}
if(!shnd.check_entropy1(pass))
{
return;
}
if(!shnd.check_entropy2(kycode))
{
return;
}
var three = pass + kycode + kycodeHid;
keys = btc.get_keys(three);
document.getElementById("fillspace2").style.display = "none";
document.getElementById("fillspace3").style.display = "none";
document.getElementById("dotherightthing2").style.display = "none";
document.getElementById("newaddr").style.display = "none";
document.getElementById("pass_form").style.display = "none";
document.getElementById("pass_form2").style.display = "none";
document.getElementById("opnwalltqu").style.display = "none";
document.getElementById("noshowaft").style.display = "none";
document.getElementById("jumbotron").style.display = "none";
document.getElementById("jumbotronf2").style.display = "none";
document.getElementById("hoovers").style.display = "none";
document.getElementById("hooverssss").style.display = "none";
document.getElementById("hooversdub").style.display = "inline-block";
document.getElementById("hooversdub").style.color = "white";
$("openWallet").show();
$('send_form').show();
document.getElementById("hooversdub2").style.display = "inline-block";
//QrCode
var qrcode = new QRCode("qrcode");
function makeCode () {
var adrvalu = document.getElementById("adr").innerHTML = keys.adr;
qrcode.makeCode(adrvalu);
}
makeCode();
///////////////////////////////////////////////////////////////////////
$('adr').value = keys.adr;
$('wif').value = keys.wif;
$('status').innerHTML = 'Fee: ' + fee;
$('status3').innerHTML = 'DevFee: ' + devfee;
refresh(); setInterval(refresh, 45000);
alert("IMPORTANT MESSAGE: Before using this wallet, please click the (Download Account Info) button and save your (Account Info)!");
//Account button blinks and (Send) button is disabled until Account button is clicked
var ofs = 0;
var ignoreClickOnMeElement = document.getElementById('accntagain');
var ignoreClickOnMeElement2 = document.getElementById('hoovers15');
var youtg = window.setInterval(function(){
ignoreClickOnMeElement.style.background = 'rgba(255,0,0,'+Math.abs(Math.sin(ofs))+')';
ofs += 0.03;
}, 1);
ignoreClickOnMeElement2.disabled = true;
document.addEventListener('click', function(event) {
var isClickInsideElement = ignoreClickOnMeElement.contains(event.target);
var isClickInsideElement2 = ignoreClickOnMeElement2.contains(event.target);
if (isClickInsideElement) {
ignoreClickOnMeElement2.disabled = false;
clearInterval(youtg);
ignoreClickOnMeElement.style.background = '';
}
});
//Prompt message for refreshing Web page
window.onbeforeunload = function() {
return "Before this page refreshes, ensure you have a backup of your (Account Info)!";
}
document.getElementById("mveup3").addEventListener("click", s_beforeunload);
function s_beforeunload(e) {
if (confirm("Are you sure you want to logout?")) {
window.onbeforeunload = null;
location.reload();
}
window.onbeforeunload = function() {
return "Before this page refreshes, ensure you have a backup of your (Account Info)!";
}
}
//Refresh page, inactive for 5 minutes
function inactivityTime() {
var timer;
window.onload = timerReset;
document.onkeypress = timerReset;
document.onmousemove = timerReset;
document.onmousedown = timerReset;
document.ontouchstart = timerReset;
document.onclick = timerReset;
document.onscroll = timerReset;
document.onkeypress = timerReset;
function reload() {
window.onbeforeunload = null;
location.reload();
}
function timerReset() {
clearTimeout(timer);
timer = setTimeout(reload, 300000);
}
}
inactivityTime();
}//____________________________________________________________________________
function open_wallet2()
{
var prrivky = js.trim($('privyky').value);
var prrivky2 = document.getElementById("privyky");
var checkprrivky = btc.decode_adr(prrivky2.value);
if(!shnd.check_entropy3(prrivky))
{
if(confirm('Enter a Private Key')){return;} return;
}
if(!shnd.check_entropy4(prrivky))
{
if(confirm('Invalid Private Key!')){return;} return;
}
if(checkprrivky === false) {
alert('Invalid Private Key!');
prrivky2.value = '';
return;
}
keys = btc.get_keys(prrivky); if(keys === false){ alert('Invalid Private Key!'); return; }
document.getElementById("fillspace2").style.display = "none";
document.getElementById("fillspace3").style.display = "none";
document.getElementById("dotherightthing").style.display = "none";
document.getElementById("newaddr").style.display = "none";
document.getElementById("pass_form").style.display = "none";
document.getElementById("pass_form2").style.display = "none";
document.getElementById("opnwalltqu").style.display = "none";
document.getElementById("noshowaft").style.display = "none";
document.getElementById("jumbotron").style.display = "none";
document.getElementById("jumbotronf2").style.display = "none";
document.getElementById("hoovers").style.display = "none";
document.getElementById("hooverssss").style.display = "none";
document.getElementById("hooversdub").style.display = "inline-block";
document.getElementById("hooversdub").style.color = "white";
$("openWallet").show();
$('send_form').show();
document.getElementById("hooversdub2").style.display = "inline-block";
//QrCode
var qrcode = new QRCode("qrcode");
function makeCode () {
var adrvalu = document.getElementById("adr").innerHTML = keys.adr;
qrcode.makeCode(adrvalu);
}
makeCode();
///////////////////////////////////////////////////////////////////////
$('adr').value = keys.adr;
$('wif').value = keys.wif;
$('status').innerHTML = 'Fee: ' + fee;
$('status3').innerHTML = 'DevFee: ' + devfee;
refresh(); setInterval(refresh, 45000);
//Prompt message for refreshing Web page
window.onbeforeunload = function() {
return "Before this page refreshes, ensure you have a backup of your (Account Info)!";
}
document.getElementById("mveup3").addEventListener("click", s_beforeunload);
function s_beforeunload(e) {
if (confirm("Are you sure you want to logout?")) {
window.onbeforeunload = null;
location.reload();
}
window.onbeforeunload = function() {
return "Before this page refreshes, ensure you have a backup of your (Account Info)!";
}
}
var privatekyi = document.getElementById("privyky").value;
var wiffer = document.getElementById("wif").value;
var wrngwif = document.getElementById("wrongwif").value = privatekyi;
if(wiffer !== wrngwif) {
document.getElementById("oneaboveall").style.backgroundColor = '#2F2F2C';
document.getElementById("openWallet").style.display = 'none';
document.getElementById("invawall1").style.display = 'none';
document.getElementById("topfo").style.display = 'none';
document.getElementById("bottmfo").style.display = 'none';
$('adr').value = '';
$('adr').innerHTML = '';
document.getElementById("reasonpic").style.display = 'block';
document.getElementById("reason").style.display = 'block';
document.getElementById("fillspace0").style.display = "block";
document.getElementById("fillspace").style.display = "block";
document.getElementById("fillspace2").style.display = "block";
document.getElementById("fillspace3").style.display = "none";
//Three second countdown with text
(function countdown(remaining) {
if(remaining <= 0)
location.reload(true);
document.getElementById('543210').innerHTML = remaining;
setTimeout(function(){ countdown(remaining - 1); }, 1000);
})(3);
window.onbeforeunload = null;
}
//Refresh page, inactive for 5 minutes
function inactivityTime() {
var timer;
window.onload = timerReset;
document.onkeypress = timerReset;
document.onmousemove = timerReset;
document.onmousedown = timerReset;
document.ontouchstart = timerReset;
document.onclick = timerReset;
document.onscroll = timerReset;
document.onkeypress = timerReset;
function reload() {
window.onbeforeunload = null;
location.reload();
}
function timerReset() {
clearTimeout(timer);
timer = setTimeout(reload, 300000);
}
}
inactivityTime();
}//____________________________________________________________________________
function broadcast_cb(res)
{
if(res == '')
{
$('to' ).value = '';
$('amount').value = '';
$('status2').innerHTML = '<input type="text" id="fltoget" readonly value="Transaction sent successfully." style="background-color:black; color:#51C40B; text-align:center; width:100%; padding:5px; outline:none" /> <a type="button" id="vwtoget" href="'+ backend.tx_page + tx.txid() + '" target=_blank rel="noopener noreferrer" style="background-color:#1E1B0B; color:#777777; text-align:center; padding-bottom:5px; padding-top:4px; padding-left:12px; padding-right:12px; margin-top:5px; cursor:pointer; border:1px solid #1E1B0B">View</a>      <input type=button id="clrtoget" value="Clear" style="background-color:#1E1B0B; color:#777777; text-align:center; padding-bottom:12px; padding-top:4px; padding-left:12px; padding-right:12px; margin-top:5px; cursor:pointer" />';
//Hover color change
document.getElementById("vwtoget").addEventListener("mouseover", function() {
document.getElementById("vwtoget").style.color = "gold";
document.getElementById("vwtoget").style.backgroundColor = "#1E1B0B";
});
document.getElementById("vwtoget").addEventListener("mouseout", function() {
document.getElementById("vwtoget").style.color = "#777777";
document.getElementById("vwtoget").style.backgroundColor = "#1E1B0B";
});
document.getElementById("clrtoget").addEventListener("mouseover", function() {
document.getElementById("clrtoget").style.color = "gold";
document.getElementById("clrtoget").style.backgroundColor = "#1E1B0B";
});
document.getElementById("clrtoget").addEventListener("mouseout", function() {
document.getElementById("clrtoget").style.color = "#777777";
document.getElementById("clrtoget").style.backgroundColor = "#1E1B0B";
});
//Clear button
document.getElementById("clrtoget").addEventListener("click", clrFunction);
function clrFunction() {
document.getElementById("fltoget").style.display = "none";
document.getElementById("vwtoget").style.display = "none";
document.getElementById("clrtoget").style.display = "none";
}
}
else $('status2').innerHTML = "<input type=text value='Result: " + res + "' id='fltoget' readonly style='background-color:black; color:#EDE9E8; text-align:center; width:100%; padding:5px; outline:none' /> <br /> <a type='button' id='vwtoget' href='"+ backend.tx_page + tx.txid() + "' target=_blank rel='noopener noreferrer' style='background-color:#1E1B0B; color:#777777; text-align:center; padding-bottom:5px; padding-top:4px; padding-left:12px; padding-right:12px; margin-top:5px; cursor:pointer; border:1px solid #1E1B0B'>View</a>      <input type=button id='clrtoget' value='Clear' style='background-color:#1E1B0B; color:#777777; text-align:center; padding-bottom:12px; padding-top:4px; padding-left:12px; padding-right:12px; margin-top:5px; cursor:pointer' />";
//Convert and update balance for expbalance
var getadr = document.getElementById("adr");
var getbalhtml = document.getElementById("amt");
var getbalhtml2 = document.getElementById("expbalance");
var getamount = document.getElementById("amount").value;
var getto = document.getElementById("to");
var getto2 = document.getElementById("to2");
var getfee = document.getElementById("status").value;
var getdevfee = document.getElementById("devfee").value;
var amountmfee = parseFloat(getfee);
var amountpfee = parseFloat(getamount) + parseFloat(getfee);
var amountfeedevfee = parseFloat(getamount) + parseFloat(getfee) + parseFloat(getdevfee);
if(isNaN(getbalhtml2.value)) getbalhtml2.value = '0.00';
if(getadr.value == 'SRA5pyXBh4KQcPgCL7pTBd8ceSeJpEf3L2' && getto.value != 'SRA5pyXBh4KQcPgCL7pTBd8ceSeJpEf3L2' && getto2.value == 'SRA5pyXBh4KQcPgCL7pTBd8ceSeJpEf3L2') {
getbalhtml2.value = (parseFloat(getbalhtml.innerHTML.replace(/,/g, '')) - parseFloat(amountpfee)).toFixed(8).replace(/\B(?=(\d{3})+\.\d\d)/g, ",");
} else if(getadr.value == 'SRA5pyXBh4KQcPgCL7pTBd8ceSeJpEf3L2' && getto.value == 'SRA5pyXBh4KQcPgCL7pTBd8ceSeJpEf3L2' && getto2.value == 'SRA5pyXBh4KQcPgCL7pTBd8ceSeJpEf3L2') {
getbalhtml2.value = (parseFloat(getbalhtml.innerHTML.replace(/,/g, '')) - parseFloat(amountmfee)).toFixed(8).replace(/\B(?=(\d{3})+\.\d\d)/g, ",");
} else {
getbalhtml2.value = (parseFloat(getbalhtml.innerHTML.replace(/,/g, '')) - parseFloat(amountfeedevfee)).toFixed(8).replace(/\B(?=(\d{3})+\.\d\d)/g, ",");
}
//Wait for updated balance alerts
var waitstats = document.getElementById('fltoget').value;
var waitstats2 = document.getElementById('status2');
//LocalStorage usage for identical TXID
if (typeof(Storage) !== "undefined") {
var alrdysntTX = waitstats;
let getalrdysntTX = localStorage.getItem("TXinStorage") || '[]';
localStorage.setItem('alrdysntTX', alrdysntTX);
if(alrdysntTX.startsWith('Result: {"txid')) localStorage.setItem("TXinStorage", alrdysntTX);
if(getalrdysntTX.startsWith('Result: {"txid') && getalrdysntTX == alrdysntTX) {
document.getElementById("fltoget").value = 'Result: transaction already in block chain (code -27)';
}
console.log('getalrdysntTX:', getalrdysntTX);
} else {
alert('Your browser does not support localStorage!');
}
//Wait for updated balance alert
if(waitstats.startsWith('Result: Gen') || waitstats.startsWith('Result: Transaction rejected by network (code -26). Reason: 18: bad-txns-inputs-spen')) {alert('Please wait till available balance is updated thru the blockchain explorer before sending another transaction.'); getbalhtml2.value = 'Null'; waitstats2.style.display = 'none';} else waitstats2.style.display = 'block';
//Fee is too low alert
if(waitstats.startsWith('Result: Transaction rejected by network (code -26). Reason: 64: dus')) {alert('Fee is too low!'); getbalhtml2.value = 'Null';}
//Need to refresh balance
if(waitstats.startsWith('Transaction sent successfull')) {alert('Please refresh your balance till available amount is shown.'); getbalhtml2.value = 'Null'; waitstats2.style.display = 'none';}
//Auto adjust ExpBalance width
var expbalinput = document.getElementById('expbalance');
expbalinput.addEventListener('input', resizexpbalInput);
resizexpbalInput.call(expbalinput);
function resizexpbalInput() {
this.style.width = this.value.length + "ch";
}
//Hover color change
document.getElementById("vwtoget").addEventListener("mouseover", function() {
document.getElementById("vwtoget").style.color = "gold";
document.getElementById("vwtoget").style.backgroundColor = "#1E1B0B";
});
document.getElementById("vwtoget").addEventListener("mouseout", function() {
document.getElementById("vwtoget").style.color = "#777777";
document.getElementById("vwtoget").style.backgroundColor = "#1E1B0B";
});
document.getElementById("clrtoget").addEventListener("mouseover", function() {
document.getElementById("clrtoget").style.color = "gold";
document.getElementById("clrtoget").style.backgroundColor = "#1E1B0B";
});
document.getElementById("clrtoget").addEventListener("mouseout", function() {
document.getElementById("clrtoget").style.color = "#777777";
document.getElementById("clrtoget").style.backgroundColor = "#1E1B0B";
});
//Clear button
document.getElementById("clrtoget").addEventListener("click", clrFunction);
function clrFunction() {
document.getElementById("fltoget").style.display = "none";
document.getElementById("vwtoget").style.display = "none";
document.getElementById("clrtoget").style.display = "none";
}
tx = null; js.enable_form('send_form', true); setTimeout(refresh, 1000);
}//____________________________________________________________________________
function broadcast()
{
$('status2').innerHTML = "<input id=statss type=text value='Signing tx...' readonly style='background-color:black; color:#D3D3C3; text-align:center; width:100%; padding:5px; outline:none' />";
var signed = tx.sign(keys);
$('status2').innerHTML = "<input id=statss type=text value='Broadcasting...' readonly style='background-color:black; color:#D3D3C3; text-align:center; width:100%; padding:5px; outline:none' />";
console.log('TX: ', signed);
backend.send(signed, broadcast_cb);
}//____________________________________________________________________________
function unspent_cb(utxo)
{
if(utxo !== false)
{
var total = tx.add_unspent(utxo), err = '';
var eef = parseFloat(js.trim($('status').value));
var fee = eef;
var tx_total = tx.amount + fee;
if(total >= tx_total)
{
var change = total - tx_total;
if(change > 0.000001) tx.add_output(keys.adr, change);
setTimeout(broadcast, 300);
return;
}
else err = "<input type=text value='Not enough, need: " + js.format_money(tx_total - total, 8) + " SHND more.' id='fltoget' readonly style='background-color:black; color:red; text-align:center; width:100%; padding:5px; outline:none' /> <input type=button id='clrtoget' value='Clear' style='background-color:#1E1B0B; color:#777777; text-align:center; padding-bottom:12px; padding-top:4px; padding-left:12px; padding-right:12px; margin-top:5px; cursor:pointer'; />";
}
else err = "<input type=text value='Failed to get unspent outputs!' id='fltoget' readonly style='background-color:black; color:red; text-align:center; width:100%; padding:5px; outline:none' /> <input type=button id='clrtoget' value='Clear' style='background-color:#1E1B0B; color:#777777; text-align:center; padding-bottom:12px; padding-top:4px; padding-left:12px; padding-right:12px; margin-top:5px; cursor:pointer'; />";
tx = null; js.enable_form('send_form', true); $('status2').innerHTML = err;
//Hover color change
document.getElementById("clrtoget").addEventListener("mouseover", function() {
document.getElementById("clrtoget").style.color = "gold";
document.getElementById("clrtoget").style.backgroundColor = "#1E1B0B";
});
document.getElementById("clrtoget").addEventListener("mouseout", function() {
document.getElementById("clrtoget").style.color = "#777777";
document.getElementById("clrtoget").style.backgroundColor = "#1E1B0B";
});
//Clear button
document.getElementById("clrtoget").addEventListener("click", clrFunction);
function clrFunction() {
document.getElementById("fltoget").style.display = "none";
document.getElementById("clrtoget").style.display = "none";
}
}//____________________________________________________________________________
document.getElementById("hoovers15").addEventListener("click", send_tx);
function send_tx()
{
var dst = js.trim($('to').value), amount = parseFloat(js.trim($('amount').value));
var dst2 = js.trim($('to2').value), devfee = parseFloat(js.trim($('devfee').value));
if(dst == '' && isNaN(amount)) {alert('Both (Address) and (Amount) text-fields can not be empty!'); $('to').focus();};
if(btc.decode_adr(dst) === false && dst !== '') {alert('Invalid SHND address!'); $('to').focus();};
if(dst == '' && !isNaN(amount)) {alert('(Address) text-field can not be empty!'); $('to').focus();};