Skip to content
This repository has been archived by the owner on Aug 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from dogecash/MigrationFromDev
Browse files Browse the repository at this point in the history
Migrated data from Dev repo
  • Loading branch information
Luke-Larsen authored Jun 21, 2020
2 parents 91dad51 + fa0f849 commit ab03176
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 39 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ Debug mode sets some things mainly for testing do not use this if you are using
This turns on and off the networking functions of the script. If you truly want privacy and security run this on a offline computer but this should be reasonably secure. With this turned off the script doesn't have access to any networking parts meaning anything that connects to a explorer or outside server doesn't work.

#### BETA **_PROCEED WITH CAUTION, DO STORE LARGE AMOUNTS OF FUNDS_**

115 changes: 107 additions & 8 deletions assets/style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,32 @@ html{
}

body {
background-color:#505050
background-color:#1e1d22
}
textarea,input{
background-color: #C0C0C0;
background-color: #c2c0bd;
}
button{
border-radius: 15px;
padding: 12px 25px 12px;
background-color: #ce9260;
background-color: #e89a37;
border: none;
text-align: center;
font-size: 16px;
}
button:hover{
background-color:#ce8500;
background-color:#A8633A;
}
#page-container {
position: relative;
min-height: 100vh;
}
#content-wrap {
padding-bottom: 3rem; /* Footer height */
}

.pullDown{
width:100%;
background-color: #C0C0C0;
}
/* Style the tab */
.tab {
Expand All @@ -33,7 +40,7 @@ button:hover{
/* Style the buttons inside the tab */
.tab button {
background-color: inherit;
color:#FFFFFF;
color:#ecd3af;
float: left;
border: none;
outline: none;
Expand All @@ -57,16 +64,108 @@ button:hover{
.tabcontent {
font-family:sans-serif;
display: none;
background-color:#888888;
background-color:#ecd3af;
padding: 6px 12px;
border: 1px solid #303030;
filter: drop-shadow(5px 5px 0px #776959);
border-top: none;
}
.footer {
left: 0;
position: absolute;
bottom: 0;
width: 100%;
background-color: #000;
color: white;
height: 3rem;
text-align: center;
}

.navbarSpecial{
background-color:#5e5d61;
}

/*Breakpoints */

@media screen and (min-width: 1025px) {
/* Network Data Settings */
#addrStr {
font-size: 20px;
}
#NetworkDataAddrs{
float:right;
}
/*Main Wallet page */
#PrivateTxt{
font-size: 25px;
}
#PublicTxt{
font-size: 25px;
}
}
@media screen and (max-width: 1024px) {
/* Network Data Settings */
#addrStr {
font-size: 20px;
}
#NetworkDataAddrs{
float:left;
}
/*Main Wallet page */
#PrivateTxt{
font-size: 18px;
}
#PublicTxt{
font-size: 25px;
}
}
@media screen and (max-width: 768px) {
/* Network Data Settings */
#addrStr {
font-size: 20px;
}
#NetworkDataAddrs{
float:left;
}
/*Main Wallet page */
#PrivateTxt{
font-size: 17px;
}
#PublicTxt{
font-size: 25px;
}

}
@media screen and (max-width: 600px) {
/* Network Data Settings */
#addrStr {
font-size: 13px;
}
#NetworkDataAddrs{
float:left;
}
/*Main Wallet page */
#PrivateTxt{
font-size: 13px;
}
#PublicTxt{
font-size: 17px;
}

}
@media screen and (max-width: 480px) {
/* Network Data Settings */
#addrStr {
font-size: 13px;
}
#NetworkDataAddrs{
float:left;
}
/*Main Wallet page */
#PrivateTxt{
font-size: 8px;
}
#PublicTxt{
font-size: 13px;
}

}
46 changes: 30 additions & 16 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,25 @@
<source src="assets/woof.mp3" type="audio/mpeg">
</audio>
<body>
<nav class="navbar navbar-expand-lg sticky-top navbar-dark bg-dark">
<div id="page-container">
<div id="content-wrap">
<nav class="navbar navbar-expand-lg sticky-top navbar-light navbarSpecial">
<img class="navbar-brand" src='assets/doge.png' onclick="document.getElementById('woof').play();" alt="Doge" style='vertical-align: middle;width:40px;display:inline'>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav mr-auto">
<div class="collapse navbar-collapse" id="navbarNav" >
<ul class="navbar-nav mr-auto" style='background-color:#ecd3af;filter: drop-shadow(5px 5px 3px #323232);'>
<li class="nav-item"><a id='start' class="nav-link" onclick="openTab(event, 'home')">Intro</a></li>
<li class="nav-item"><a class="nav-link" onclick="openTab(event, 'keypair')">Wallets</a></li>
<li class="nav-item"><a class="nav-link" onclick="openTab(event, 'Transaction')">Create Transaction</a></li>
<li class="nav-item"><a class="nav-link" onclick="startNetworkTest();openTab(event, 'WalletData');">Network Data</a></li>
<li class="nav-item"><a class="nav-link" onclick="openTab(event, 'Settings');">Settings</a></li>
<li class="nav-item"><a class="nav-link" style='color:black;' onclick="openTab(event, 'keypair')">Wallets</a></li>
<li class="nav-item"><a class="nav-link" style='color:black;' onclick="openTab(event, 'Transaction')">Create Transaction</a></li>
<li class="nav-item"><a class="nav-link" style='color:black;' onclick="startNetworkTest();openTab(event, 'WalletData');">Network Data</a></li>
<li class="nav-item"><a class="nav-link" style='color:black;' onclick="openTab(event, 'Settings');">Settings</a></li>
</ul>
</div>
</nav>
<br>
<div style='display:none;background-color:red' id='outdated'>Warning your version is outdated please update to the newest stable version at the <a href='https://github.com/Luke-Larsen/DogeCashWebWallet/releases'>Github</a></div>
<div style='display:none;background-color:red;margin-bottom:15px;' id='outdated'>Warning your version is outdated please update to the newest stable version at the <a href='https://github.com/dogecash/dogecash-web-wallet/releases'>Dogecash Github</a></div>

<div class="container-fluid">
<div class="row no-gutters">
Expand All @@ -51,6 +53,11 @@ <h5 style='text-indent: 30px;'>
We tryed to make the user interface as friendly as possible but in the event that you don't understand something feel free to check out the tutorials at the github
or create a issue on that github and we will get to it as fast as possible.
</h5>
<h4> Generate Paper wallets </h4>
<h5 style='text-indent: 30px;'>
This web wallet functions much like a paper wallet generator, but with features most normal wallets have. You can also generate transactions offline!
Head over to the wallet tab and generate your first wallet. Make sure to keep the key secure! otherwise you may lose all your coins.
</h5>
</div>
<div id="keypair" class="tabcontent">
<h3>Generate Dogec wallet</h3>
Expand All @@ -76,9 +83,10 @@ <h4 id='genKeyWarning' style='display:none;'><b>Warning: if you do not save your
<div id="PublicQR"></div>
</div>
<div id="Transaction" class="tabcontent">
<div id='errorNotice'></div>
<div class='pullDown' style='clear:both;'>
<div onclick='toggleDropDown("loadSimpleTransactions")'>Create Simple (Automated) Transactions<span style='float:right;'></span></div>
<div id='loadSimpleTransactions'>
<div onclick='toggleDropDown("loadSimpleTransactions")'>Create Simple Transactions<span style='float:right;'></span></div>
<div id='loadSimpleTransactions'style='display:none'>
In order to use simple transactions you must first load your wallet
<br>
<button onclick='loadUnspendInputs()'>Load Wallet</button>
Expand Down Expand Up @@ -142,7 +150,7 @@ <h4>Advanced Details: <br>locktime is set to 0, sequence is set to max. SIGHASH_
<option value="custom">custom (In Development)</option>
</select>
<br>
<input type="submit">
<input type="submit" style='background-color:#243646;color:#dddfe2;'>
</form>
<br>
<button type="submit" onclick='toggleDebug()'>Toggle Debug mode</button>
Expand All @@ -159,18 +167,22 @@ <h4>Advanced Details: <br>locktime is set to 0, sequence is set to max. SIGHASH_
<div class='pullDown' style='clear:both;'>
<div onclick='toggleDropDown("Transactions")'>Transactions:<span id='TransactionNumber'></span><span style='float:right;'></span></div>
<div style='background-color:#D0D0D0; width:100%'><span style='display:none;' id='Transactions'></span></div>
<br>
<br>
</div>
</div>
<!--Right -->
<div style='float:right;'>
Address Response
<div id='NetworkDataAddrs'>
<span style='margin-left:1px;'>Address Response</span>
<hr>
<span id='addrStr'></span><br>
<span id='addrStrQR'></span>
<span id='addrStr' style='margin-left:1px;'></span><br>
<span id='addrStrQR' style='margin-left:1px;'></span>
</div>
<div class='pullDown' style='clear:both;'>
<div onclick='toggleDropDown("NetworkingJson")'>Pure json:<span style='float:right;'></span></div>
<div style='background-color:#D0D0D0; width:100%'><textarea rows="15" cols="50" id="NetworkingJson" style='display:none;font-size:1vw;width:99%;overflow:hidden;background-color:#D0D0D0;'></textarea></div>
<div style='background-color:#D0D0D0; width:100%'>
<textarea rows="15" cols="50" id="NetworkingJson" style='display:none;font-size:4vw;width:99%;overflow:hidden;background-color:#D0D0D0;'></textarea>
</div>
</div>
</div>
</div>
Expand All @@ -179,9 +191,11 @@ <h4>Advanced Details: <br>locktime is set to 0, sequence is set to max. SIGHASH_
</div>
</div>
</div>
</div>
<div class="footer">
<div style='display:inline;' id='dcfooter'></div>
</div>
</div>
<script type="text/javascript" src="scripts/libs/crypto-min.js"></script>
<script type="text/javascript" src="scripts/libs/crypto-sha256.js"></script>
<script type="text/javascript" src="scripts/libs/crypto-sha256-hmac.js"></script>
Expand Down
27 changes: 14 additions & 13 deletions scripts/network.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if(networkEnabled){
var url = 'https://' + explorer
var githubRepo = 'https://api.github.com/repos/Luke-Larsen/DogeCashWebWallet/releases';
var githubRepo = 'https://api.github.com/repos/dogecash/dogecash-web-wallet/releases';
var checkPubKey = function(){
// Create a request variable and assign a new XMLHttpRequest object to it.
var request = new XMLHttpRequest()
Expand Down Expand Up @@ -66,24 +66,25 @@ if(networkEnabled){
data = JSON.parse(this.response)
if(JSON.stringify(data) === '[]'){
console.log('No unspent Transactions');
document.getElementById("errorNotice").innerHTML = '<h4>Error:</h4><h5>It seems there are no unspent inputs associated with your wallet. This means you have no funds! D:</h5>';
}else{
amountOfTransactions = JSON.stringify(data['length'])
var dataTransactions = JSON.stringify(data['0']['txid']);
if(amountOfTransactions <= 1000){
for(i = 0; i < amountOfTransactions; i++) {
if(i == 0){
balance = parseFloat(Number(data[i]['value'])/100000000);
}else{
balance = parseFloat(balance) + parseFloat(Number(data[i]['value'])/100000000);
}
var txid = JSON.stringify(data[i]['txid']).replace(/"/g,"");
var index = JSON.stringify(data[i]['vout']);
getScriptData(txid,index)
if(amountOfTransactions <= 1000){
for(i = 0; i < amountOfTransactions; i++) {
if(i == 0){
balance = parseFloat(Number(data[i]['value'])/100000000);
}else{
balance = parseFloat(balance) + parseFloat(Number(data[i]['value'])/100000000);
}
var txid = JSON.stringify(data[i]['txid']).replace(/"/g,"");
var index = JSON.stringify(data[i]['vout']);
getScriptData(txid,index)
}
}else{
//Temporary message for when there are alot of inputs
//Probably use change all of this to using websockets will work better
document.getElementById("NetworkingJson").innerHTML = '<h3 style="color:red">We are sorry but this address has over 1k inputs. In this version we do not support this. Please import your private key to a desktop wallet or use another option';
document.getElementById("errorNotice").innerHTML = '<h4>Error:</h4><h5>We are sorry but this address has over 1k inputs. In this version we do not support this. Please import your private key to a desktop wallet or wait for an update</h5>';
}
}
console.log('Total Balance:' + balance);
Expand Down Expand Up @@ -134,7 +135,7 @@ if(networkEnabled){
request.open('GET', githubRepo, true)
request.onload = function() {
data = JSON.parse(this.response)
var currentReleaseVersion = (data[0]['tag_name']).replace("v","")
var currentReleaseVersion = (data[0]['tag_name']).replace("V","")
if(parseFloat(currentReleaseVersion) > parseFloat(dogecashversion)){
console.log("out of date");
document.getElementById("outdated").style.display='block';
Expand Down
2 changes: 1 addition & 1 deletion scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var balance;
var fee;
var privateKeyForTransactions;
var walletAlreadyMade = 0;
var dogecashversion = '1.01';
var dogecashversion = '1.02';
var closeTheAlert = '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>'
function setExplorer(){
explorer = document.getElementById("explorer").value
Expand Down
2 changes: 1 addition & 1 deletion scripts/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var randArr = new Uint8Array(32) //create a typed array of 32 bytes (256 bits)
if(debug){
document.getElementById('Debug').innerHTML = "<b> DEBUG MODE </b>";
}
document.getElementById('dcfooter').innerHTML = '© 2020 DogeCash - All rights reserved. DogeCash webwallet version : '+dogecashversion +'<br><a href="https://github.com/Luke-Larsen/DogeCashWebWallet">Source code</a>';
document.getElementById('dcfooter').innerHTML = '© 2020 DogeCash - All rights reserved. <br><a href="https://github.com/Luke-Larsen/DogeCashWebWallet">DogeCash webwallet version : '+dogecashversion +'</a>';
//Wallet Import
importWallet= function(){
if(walletAlreadyMade != 0){
Expand Down

0 comments on commit ab03176

Please sign in to comment.