diff --git a/index.html b/index.html index d4c5e3759e..eb4d2415b8 100644 --- a/index.html +++ b/index.html @@ -244,6 +244,8 @@
'+t+"
").fadeIn(50).fadeOut(3e3)})}),$("#decryptdata").click(function(){$("#decryptStatus").html('Please Wait...
').fadeIn(10),setTimeout(function(){decryptFormData()},100)}),$("input[type=radio][name=typeOfKeyRadio]").change(function(){PrivKey="",$("#fuploadStatus").empty(),$("#walletfilepassword").val(""),$("#privkeypassword").val(""),$(".btn-file :file").val(""),$("#manualprivkey").val(""),$("#walletuploadbutton").hide(),$("#walletPasdiv").hide(),$("#divprikeypassword").hide(),$("#wallettransactions").hide(),$("#decryptStatus").hide(),"fileupload"==this.value?($("#selectedTypeKey").hide(),$("#selectedUploadKey").show(),decryptType="fupload"):"pasteprivkey"==this.value&&($("#selectedUploadKey").hide(),$("#selectedTypeKey").show(),decryptType="privkey")}),$("input[type=radio][name=currencyRadio]").change(function(){$("#sendtxamount").trigger("keyup")}),$("#walletfilepassword").on("paste, keyup",function(){""!=$("#walletfilepassword").val()?($("#uploadbtntxt-wallet").show(),$("#uploadbtntxt-privkey").hide(),$("#walletuploadbutton").show()):$("#walletuploadbutton").hide()}),$("#sendtxamount").on("paste, keyup",function(){var t=$("#sendtxamount").val();if(""!=$("#sendtxamount").val()&&$.isNumeric(t)&&t>0){var e=$("input[type=radio][name=currencyRadio]:checked").val();$("#weiamount").html(''+toWei(t,e)+" wei ( approximately "+toFiat(t,e,usdval)+" USD/"+toFiat(t,e,eurval)+" EUR )
")}else $("#weiamount").html(""==$("#sendtxamount").val()||$.isNumeric(t)?"":'Invalid amount
')}),$("#sendtxaddress").on("paste, keyup",function(){validateEtherAddress($("#sendtxaddress").val())?$("#addressvalidate").html('Address is valid
').fadeIn(50):""==$("#sendtxaddress").val()?$("#addressvalidate").html(""):$("#addressvalidate").html('Invalid address
').fadeIn(50)}),$("#privkeypassword").on("paste, keyup",function(){$("#privkeypassword").val().length>6?($("#uploadbtntxt-wallet").hide(),$("#uploadbtntxt-privkey").show(),$("#walletuploadbutton").show()):$("#walletuploadbutton").hide()}),$("#manualprivkey").on("paste, keyup",function(){$("#divprikeypassword").hide(),$("#walletuploadbutton").hide(),$("#uploadbtntxt-wallet").hide(),$("#uploadbtntxt-privkey").hide(),$("#manualprivkey").val($("#manualprivkey").val().replace(/(?:\r\n|\r|\n| )/g,"")),128==$("#manualprivkey").val().length||132==$("#manualprivkey").val().length?$("#divprikeypassword").show():64==$("#manualprivkey").val().length&&($("#uploadbtntxt-wallet").hide(),$("#uploadbtntxt-privkey").show(),$("#walletuploadbutton").show())}),$(".btn-file :file").change(function(){if(!(window.File&&window.FileReader&&window.FileList&&window.Blob))return void alert("The File APIs are not fully supported in this browser. Please use a modern browser");var t=$(this),e=t.get(0).files?t.get(0).files.length:1,a=t.val().replace(/\\/g,"/").replace(/.*\//,"");t.trigger("fileselect",[e,a])}),$(".btn-file :file").on("fileselect",function(t,e,a){$("#fuploadStatus").empty(),$("#walletfilepassword").val(""),PrivKey="",file=$(".btn-file :file")[0].files[0];var n=new FileReader;n.onload=function(){try{walletRequirePass(n.result)?($("#walletPasdiv").show(),$("#walletuploadbutton").hide()):($("#walletPasdiv").hide(),$("#walletuploadbutton").show(),$("#uploadbtntxt-wallet").show(),$("#uploadbtntxt-privkey").hide())}catch(t){$("#fuploadStatus").append(''+t+"
")}},n.readAsText(file);var r=$(this).parents(".input-group").find(":text"),i=e>1?e+" files selected":a;r.length?r.val(i):i&&$("#fuploadStatus").append('File Selected: '+i+"
")})}function preSendTransaction(){sendTransaction($("#tasignedtx").val(),function(t){$("#txsendstatus").html('Transaction submitted. TX ID: '+t+"
"),setWalletBalance()},function(t){$("#txsendstatus").html(''+t+"
")}),$("#sendTransaction").modal("hide")}function preCreateTransaction(){try{$("#tarawtx").val(""),$("#tasignedtx").val(""),$("#txsendstatus").html("");var t=$("#sendtxaddress").val();if(64!=PrivKey.length)throw"Invalid Private key, try again";if(!validateEtherAddress(t))throw"Invalid to Address, try again";if(!$.isNumeric($("#sendtxamount").val())||$("#sendtxamount").val()<=0)throw"Invalid amount, try again";var e=$("input[type=radio][name=currencyRadio]:checked").val(),a=toWei($("#sendtxamount").val(),e);createTransaction(PrivKey,t,a,function(a){$("#tarawtx").val(a.raw),$("#tasignedtx").val(a.signed),$("#txcreatestatus").html('Transaction generated
').fadeIn(50),$("#divtransactionTAs").show(),$("#divsendtranaction").show(),$("#confirmAmount").html($("#sendtxamount").val()),$("#confirmCurrancy").html(e),$("#confirmAddress").html(t)},function(t){$("#txcreatestatus").html(''+t+"
").fadeIn(50).fadeOut(3e3),$("#divtransactionTAs").hide(),$("#divsendtranaction").hide()})}catch(n){$("#txcreatestatus").html(''+n+"
").fadeIn(50).fadeOut(3e3),$("#divtransactionTAs").hide(),$("#divsendtranaction").hide()}}function setWalletBalance(){getBalance($("#accountAddress").html(),function(t){if(t.error)alert(t.msg);else{var e=getBestEtherKnownUnit(t.data.balance);$("#accountBalance").html(e.amount+" "+e.unit),getETHvalue("USD",function(t){usdval=toFiat(e.amount,e.unit,t),$("#accountBalanceUsd").html(usdval+" USD")}),getETHvalue("EUR",function(t){eurval=toFiat(e.amount,e.unit,t),$("#accountBalanceEur").html(eurval+" EUR")})}})}function walletDecryptSuccess(){$("#accountAddress").html(formatAddress(strPrivateKeyToAddress(PrivKey),"hex")),setWalletBalance(),$("#decryptStatus").html('Wallet successfully decrypted
').fadeIn(2e3),$("#wallettransactions").show()}function walletDecryptFailed(t){$("#decryptStatus").html(''+t+"
").fadeIn(50).fadeOut(3e3),$("#wallettransactions").hide()}function decryptFormData(){if(PrivKey="","fupload"==decryptType){file=$(".btn-file :file")[0].files[0];var t=new FileReader;t.onload=function(){try{PrivKey=getWalletFilePrivKey(t.result,$("#walletfilepassword").val()),walletDecryptSuccess()}catch(e){walletDecryptFailed(e)}},t.readAsText(file)}else if("privkey"==decryptType)try{PrivKey=decryptTxtPrivKey($("#manualprivkey").val(),$("#privkeypassword").val()),walletDecryptSuccess()}catch(e){walletDecryptFailed("Invalid password")}}function hideAllMainContainers(){$("#paneWalgen").hide(),$("#paneBulkgen").hide(),$("#paneSendTrans").hide(),$("#panePopContracts").hide(),$("#paneHelp").hide(),$("#paneContact").hide(),$("#panePrint").hide(),$("#bulk-generate").parent().removeClass("active"),$("#generate-wallet").parent().removeClass("active"),$("#send-transaction").parent().removeClass("active"),$("#popular-contracts").parent().removeClass("active"),$("#help").parent().removeClass("active"),$("#contact").parent().removeClass("active")}function generateSingleWallet(){var t=$("#ethgenpassword").val();if(""==t)return void alert("Please enter a password.");if(t.length<7)return void alert("Your password must be at least 7 characters");$("#generatedWallet").show();var e=new Accounts,a=e["new"](t);$("#address").val(a.address);var n=cryptoJSToHex(CryptoJS.SHA3(a.address));n=n.substr(n.length-4);var r=e.get(a.address,t);$("#privkey").val(r["private"]),a["private"]=a["private"]+n,$("#privkeyenc").val(a["private"]),$("#qrcodeAdd").empty(),new QRCode($("#qrcodeAdd")[0],{text:a.address,width:$("#qrcode").width(),height:$("#qrcode").width(),colorDark:"#000000",colorLight:"#ffffff",correctLevel:QRCode.CorrectLevel.H}),$("#qrcode").empty(),new QRCode($("#qrcode")[0],{text:r["private"],width:$("#qrcode").width(),height:$("#qrcode").width(),colorDark:"#000000",colorLight:"#ffffff",correctLevel:QRCode.CorrectLevel.H});var i="text/json;charset=UTF-8",o=new Blob([JSON.stringify(a)],{type:i}),s=new Blob([JSON.stringify(r)],{type:i});$("#encdownload").attr("href",window.URL.createObjectURL(o)),$("#encdownload").attr("download",a.address+"-Encrypted.json"),$("#unencdownload").attr("href",window.URL.createObjectURL(s)),$("#unencdownload").attr("download",a.address+"-Unencrypted.json"),e.clear()}function generateBulkWallets(){var t=$("#bulkgenpassword").val(),e=$("#numberwallets").val();if(""==e)return void alert("Please enter the amount of wallets you want to generate.");if(e!=parseInt(e,10))return void alert("Digits only please");var a=!1;if(""!=t&&t.length<7)return void alert("Your password must be at least 7 characters.");""!=t&&t.length>=7&&(a=!0),$("#bulkIsEnc").html(a?" (Encrypted)":" (Unencrypted)"),$("#generatedbulkwallets").show(),$("#bulkgentable tr:not(:first)").remove();for(var n=new Accounts,r="",i=[],o=[],s="",l=0;e>l;l++){if(a){var d=n["new"](t),c=cryptoJSToHex(CryptoJS.SHA3(d.address));c=c.substr(c.length-4),d["private"]=d["private"]+c}else var d=n["new"]();$("#bulkgentable tr:last").after(''+t+"
").fadeIn(50).fadeOut(3e3),$("#divtransactionTAs").hide(),$("#divsendtranaction").hide()})}catch(n){$("#txcreatestatus").html(''+n+"
").fadeIn(50).fadeOut(3e3),$("#divtransactionTAs").hide(),$("#divsendtranaction").hide()}}var PrivKey="",decryptType="",usdval,eurval,web3=new Web3;$(document).ready(function(){bindElements(),checkAndLoadPageHash(),checkAndRedirectHTTPS()});var SERVERURL="https://rpc.myetherwallet.com/api.php",KRAKENAPI="https://api.kraken.com/0/public/",stdTransactionGas=21e3,knownUnitMap={wei:"1",kwei:"1000",gwei:"1000000000",szabo:"1000000000000",finney:"1000000000000000",ether:"1000000000000000000"},unitMap={wei:"1",kwei:"1000",ada:"1000",femtoether:"1000",mwei:"1000000",babbage:"1000000",picoether:"1000000",gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",einstein:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};$(document).ready(function(){bindAugurElements()});var augurContract=web3.eth.contract([{name:"addrToFunder(int256)",type:"function",inputs:[{name:"address",type:"int256"}],outputs:[{name:"out",type:"int256"}]},{name:"buyRep()",type:"function",inputs:[],outputs:[{name:"out",type:"int256"}]},{name:"getAddrByIndex(int256)",type:"function",inputs:[{name:"index",type:"int256"}],outputs:[{name:"out",type:"int256"}]},{name:"getAmountSent(int256)",type:"function",inputs:[{name:"address",type:"int256"}],outputs:[{name:"out",type:"int256"}]},{name:"getAmtByIndex(int256)",type:"function",inputs:[{name:"index",type:"int256"}],outputs:[{name:"out",type:"int256"}]},{name:"getBlockNumByIndex(int256)",type:"function",inputs:[{name:"index",type:"int256"}],outputs:[{name:"out",type:"int256"}]},{name:"getBlockNumSent(int256)",type:"function",inputs:[{name:"address",type:"int256"}],outputs:[{name:"out",type:"int256"}]},{name:"getFunderNum()",type:"function",inputs:[],outputs:[{name:"out",type:"int256"}]},{name:"getFundsRaised()",type:"function",inputs:[],outputs:[{name:"out",type:"int256"}]}]).at("0xe28e72fcf78647adce1f1252f240bbfaebd63bcc"); \ No newline at end of file +function checkAndRedirectHTTPS(){var t="myetherwallet.com",e="kvhnuke.github.io",a="www.kvhnuke.github.io",n="www.myetherwallet.com";t!=window.location.host&&e!=window.location.host&&n!=window.location.host&&a!=window.location.host||"https:"==window.location.protocol||(window.location.protocol="https")}function checkAndLoadPageHash(){if(window.location.hash){var t=window.location.hash.substr(1);$(".ptabs").each(function(e){return $(this).attr("id")==t?($(this).click(),void setTimeout(function(){$("html,body").scrollTop(0)},50)):void 0})}}function paneNavigate(t,e){hideAllMainContainers(),$("#"+t).show(),$("#"+e).parent().addClass("active"),location.hash=e,$("html,body").scrollTop(0)}function bindElements(){$(".ptabs").each(function(t){$(this).click(function(){paneNavigate($(this).attr("showId"),this.id)})}),$("#privkeyenc,#address,#privkey").click(function(){this.focus(),this.select()}),$("#btndonate").click(function(){$("#sendtxaddress").val("0x7cb57b5a97eabe94205c07890be4c1ad31e486a8"),$("#donateThanks").show(),$("#sendtxaddress").trigger("keyup")}),$("#generatewallet").click(function(){generateSingleWallet()}),$("#btngeneratetranaction").click(function(){preCreateTransaction()}),$("#printqr").click(function(){printQRcode()}),$("#btnapprovesend").click(function(){preSendTransaction()}),$("#bulkgenerate").click(function(){generateBulkWallets()}),$("#transferAllBalance").click(function(){getMaxSendAmount($("#accountAddress").html(),function(t){$("#sendtxamount").val(t),$("input[type=radio][name=currencyRadio][value=ether]").prop("checked",!0),$("#sendtxamount").trigger("keyup")},function(t){$("#txcreatestatus").html(''+t+"
").fadeIn(50).fadeOut(3e3)})}),$("#decryptdata").click(function(){$("#decryptStatus").html('Please Wait...
').fadeIn(10),setTimeout(function(){decryptFormData()},100)}),$("input[type=radio][name=typeOfKeyRadio]").change(function(){PrivKey="",$("#fuploadStatus").empty(),$("#walletfilepassword").val(""),$("#privkeypassword").val(""),$(".btn-file :file").val(""),$("#manualprivkey").val(""),$("#walletuploadbutton").hide(),$("#walletPasdiv").hide(),$("#divprikeypassword").hide(),$("#wallettransactions").hide(),$("#decryptStatus").hide(),"fileupload"==this.value?($("#selectedTypeKey").hide(),$("#selectedUploadKey").show(),decryptType="fupload"):"pasteprivkey"==this.value&&($("#selectedUploadKey").hide(),$("#selectedTypeKey").show(),decryptType="privkey")}),$("input[type=radio][name=currencyRadio]").change(function(){$("#sendtxamount").trigger("keyup")}),$("#walletfilepassword").on("paste, keyup",function(){""!=$("#walletfilepassword").val()?($("#uploadbtntxt-wallet").show(),$("#uploadbtntxt-privkey").hide(),$("#walletuploadbutton").show()):$("#walletuploadbutton").hide()}),$("#sendtxamount").on("paste, keyup",function(){var t=$("#sendtxamount").val();if(""!=$("#sendtxamount").val()&&$.isNumeric(t)&&t>0){var e=$("input[type=radio][name=currencyRadio]:checked").val();$("#weiamount").html(''+toWei(t,e)+" wei ( approximately "+toFiat(t,e,usdval)+" USD/"+toFiat(t,e,eurval)+" EUR )
")}else $("#weiamount").html(""==$("#sendtxamount").val()||$.isNumeric(t)?"":'Invalid amount
')}),$("#sendtxaddress").on("paste, keyup",function(){validateEtherAddress($("#sendtxaddress").val())?$("#addressvalidate").html('Address is valid
').fadeIn(50):""==$("#sendtxaddress").val()?$("#addressvalidate").html(""):$("#addressvalidate").html('Invalid address
').fadeIn(50)}),$("#privkeypassword").on("paste, keyup",function(){$("#privkeypassword").val().length>6?($("#uploadbtntxt-wallet").hide(),$("#uploadbtntxt-privkey").show(),$("#walletuploadbutton").show()):$("#walletuploadbutton").hide()}),$("#manualprivkey").on("paste, keyup",function(){$("#divprikeypassword").hide(),$("#walletuploadbutton").hide(),$("#uploadbtntxt-wallet").hide(),$("#uploadbtntxt-privkey").hide(),$("#manualprivkey").val($("#manualprivkey").val().replace(/(?:\r\n|\r|\n| )/g,"")),128==$("#manualprivkey").val().length||132==$("#manualprivkey").val().length?$("#divprikeypassword").show():64==$("#manualprivkey").val().length&&($("#uploadbtntxt-wallet").hide(),$("#uploadbtntxt-privkey").show(),$("#walletuploadbutton").show())}),$(".btn-file :file").change(function(){if(!(window.File&&window.FileReader&&window.FileList&&window.Blob))return void alert("The File APIs are not fully supported in this browser. Please use a modern browser");var t=$(this),e=t.get(0).files?t.get(0).files.length:1,a=t.val().replace(/\\/g,"/").replace(/.*\//,"");t.trigger("fileselect",[e,a])}),$(".btn-file :file").on("fileselect",function(t,e,a){$("#fuploadStatus").empty(),$("#walletfilepassword").val(""),PrivKey="",file=$(".btn-file :file")[0].files[0];var n=new FileReader;n.onload=function(){try{walletRequirePass(n.result)?($("#walletPasdiv").show(),$("#walletuploadbutton").hide()):($("#walletPasdiv").hide(),$("#walletuploadbutton").show(),$("#uploadbtntxt-wallet").show(),$("#uploadbtntxt-privkey").hide())}catch(t){$("#fuploadStatus").append(''+t+"
")}},n.readAsText(file);var r=$(this).parents(".input-group").find(":text"),i=e>1?e+" files selected":a;r.length?r.val(i):i&&$("#fuploadStatus").append('File Selected: '+i+"
")})}function preSendTransaction(){sendTransaction($("#tasignedtx").val(),function(t){$("#txsendstatus").html('Transaction submitted. TX ID: '+t+"
"),setWalletBalance()},function(t){$("#txsendstatus").html(''+t+"
")}),$("#sendTransaction").modal("hide")}function preCreateTransaction(){try{$("#tarawtx").val(""),$("#tasignedtx").val(""),$("#txsendstatus").html("");var t=$("#sendtxaddress").val();if(64!=PrivKey.length)throw"Invalid Private key, try again";if(!validateEtherAddress(t))throw"Invalid to Address, try again";if(!$.isNumeric($("#sendtxamount").val())||$("#sendtxamount").val()<=0)throw"Invalid amount, try again";var e=$("input[type=radio][name=currencyRadio]:checked").val(),a=toWei($("#sendtxamount").val(),e);createTransaction(PrivKey,t,a,function(a){$("#tarawtx").val(a.raw),$("#tasignedtx").val(a.signed),$("#txcreatestatus").html('Transaction generated
').fadeIn(50),$("#divtransactionTAs").show(),$("#divsendtranaction").show(),$("#confirmAmount").html($("#sendtxamount").val()),$("#confirmCurrancy").html(e),$("#confirmAddress").html(t)},function(t){$("#txcreatestatus").html(''+t+"
").fadeIn(50).fadeOut(3e3),$("#divtransactionTAs").hide(),$("#divsendtranaction").hide()})}catch(n){$("#txcreatestatus").html(''+n+"
").fadeIn(50).fadeOut(3e3),$("#divtransactionTAs").hide(),$("#divsendtranaction").hide()}}function setWalletBalance(){getBalance($("#accountAddress").html(),function(t){if(t.error)alert(t.msg);else{var e=getBestEtherKnownUnit(t.data.balance);$("#accountBalance").html(e.amount+" "+e.unit),getETHvalue("ZUSD",function(t){usdval=toFiat(e.amount,e.unit,t),$("#accountBalanceUsd").html(formatCurrency(usdval,"$")+" USD")}),getETHvalue("ZEUR",function(t){eurval=toFiat(e.amount,e.unit,t),$("#accountBalanceEur").html(formatCurrency(eurval,"�")+" EUR")}),getETHvalue("XXBT",function(t){btcval=toFiat(e.amount,e.unit,t),$("#accountBalanceBtc").html(btcval+" BTC")})}})}function walletDecryptSuccess(){$("#accountAddress").html(formatAddress(strPrivateKeyToAddress(PrivKey),"hex")),setWalletBalance(),$("#decryptStatus").html('Wallet successfully decrypted
').fadeIn(2e3),$("#wallettransactions").show()}function walletDecryptFailed(t){$("#decryptStatus").html(''+t+"
").fadeIn(50).fadeOut(3e3),$("#wallettransactions").hide()}function formatCurrency(t,e){return e+" "+t.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g,"$1,")}function decryptFormData(){if(PrivKey="","fupload"==decryptType){file=$(".btn-file :file")[0].files[0];var t=new FileReader;t.onload=function(){try{PrivKey=getWalletFilePrivKey(t.result,$("#walletfilepassword").val()),walletDecryptSuccess()}catch(e){walletDecryptFailed(e)}},t.readAsText(file)}else if("privkey"==decryptType)try{PrivKey=decryptTxtPrivKey($("#manualprivkey").val(),$("#privkeypassword").val()),walletDecryptSuccess()}catch(e){walletDecryptFailed("Invalid password")}}function hideAllMainContainers(){$("#paneWalgen").hide(),$("#paneBulkgen").hide(),$("#paneSendTrans").hide(),$("#panePopContracts").hide(),$("#paneHelp").hide(),$("#paneContact").hide(),$("#panePrint").hide(),$("#bulk-generate").parent().removeClass("active"),$("#generate-wallet").parent().removeClass("active"),$("#send-transaction").parent().removeClass("active"),$("#popular-contracts").parent().removeClass("active"),$("#help").parent().removeClass("active"),$("#contact").parent().removeClass("active")}function generateSingleWallet(){var t=$("#ethgenpassword").val();if(""==t)return void alert("Please enter a password.");if(t.length<7)return void alert("Your password must be at least 7 characters");$("#generatedWallet").show();var e=new Accounts,a=e["new"](t);$("#address").val(a.address);var n=cryptoJSToHex(CryptoJS.SHA3(a.address));n=n.substr(n.length-4);var r=e.get(a.address,t);$("#privkey").val(r["private"]),a["private"]=a["private"]+n,$("#privkeyenc").val(a["private"]),$("#qrcodeAdd").empty(),new QRCode($("#qrcodeAdd")[0],{text:a.address,width:$("#qrcode").width(),height:$("#qrcode").width(),colorDark:"#000000",colorLight:"#ffffff",correctLevel:QRCode.CorrectLevel.H}),$("#qrcode").empty(),new QRCode($("#qrcode")[0],{text:r["private"],width:$("#qrcode").width(),height:$("#qrcode").width(),colorDark:"#000000",colorLight:"#ffffff",correctLevel:QRCode.CorrectLevel.H});var i="text/json;charset=UTF-8",o=new Blob([JSON.stringify(a)],{type:i}),s=new Blob([JSON.stringify(r)],{type:i});$("#encdownload").attr("href",window.URL.createObjectURL(o)),$("#encdownload").attr("download",a.address+"-Encrypted.json"),$("#unencdownload").attr("href",window.URL.createObjectURL(s)),$("#unencdownload").attr("download",a.address+"-Unencrypted.json"),e.clear()}function generateBulkWallets(){var t=$("#bulkgenpassword").val(),e=$("#numberwallets").val();if(""==e)return void alert("Please enter the amount of wallets you want to generate.");if(e!=parseInt(e,10))return void alert("Digits only please");var a=!1;if(""!=t&&t.length<7)return void alert("Your password must be at least 7 characters.");""!=t&&t.length>=7&&(a=!0),$("#bulkIsEnc").html(a?" (Encrypted)":" (Unencrypted)"),$("#generatedbulkwallets").show(),$("#bulkgentable tr:not(:first)").remove();for(var n=new Accounts,r="",i=[],o=[],s="",l=0;e>l;l++){if(a){var d=n["new"](t),c=cryptoJSToHex(CryptoJS.SHA3(d.address));c=c.substr(c.length-4),d["private"]=d["private"]+c}else var d=n["new"]();$("#bulkgentable tr:last").after(''+t+"
").fadeIn(50).fadeOut(3e3),$("#divtransactionTAs").hide(),$("#divsendtranaction").hide()})}catch(n){$("#txcreatestatus").html(''+n+"
").fadeIn(50).fadeOut(3e3),$("#divtransactionTAs").hide(),$("#divsendtranaction").hide()}}var PrivKey="",decryptType="",usdval,eurval,btcval,web3=new Web3;$(document).ready(function(){bindElements(),checkAndLoadPageHash(),checkAndRedirectHTTPS()});var SERVERURL="https://rpc.myetherwallet.com/api.php",KRAKENAPI="https://api.kraken.com/0/public/",stdTransactionGas=21e3,knownUnitMap={wei:"1",kwei:"1000",gwei:"1000000000",szabo:"1000000000000",finney:"1000000000000000",ether:"1000000000000000000"},unitMap={wei:"1",kwei:"1000",ada:"1000",femtoether:"1000",mwei:"1000000",babbage:"1000000",picoether:"1000000",gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",einstein:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};$(document).ready(function(){bindAugurElements()});var augurContract=web3.eth.contract([{name:"addrToFunder(int256)",type:"function",inputs:[{name:"address",type:"int256"}],outputs:[{name:"out",type:"int256"}]},{name:"buyRep()",type:"function",inputs:[],outputs:[{name:"out",type:"int256"}]},{name:"getAddrByIndex(int256)",type:"function",inputs:[{name:"index",type:"int256"}],outputs:[{name:"out",type:"int256"}]},{name:"getAmountSent(int256)",type:"function",inputs:[{name:"address",type:"int256"}],outputs:[{name:"out",type:"int256"}]},{name:"getAmtByIndex(int256)",type:"function",inputs:[{name:"index",type:"int256"}],outputs:[{name:"out",type:"int256"}]},{name:"getBlockNumByIndex(int256)",type:"function",inputs:[{name:"index",type:"int256"}],outputs:[{name:"out",type:"int256"}]},{name:"getBlockNumSent(int256)",type:"function",inputs:[{name:"address",type:"int256"}],outputs:[{name:"out",type:"int256"}]},{name:"getFunderNum()",type:"function",inputs:[],outputs:[{name:"out",type:"int256"}]},{name:"getFundsRaised()",type:"function",inputs:[],outputs:[{name:"out",type:"int256"}]}]).at("0xe28e72fcf78647adce1f1252f240bbfaebd63bcc"); \ No newline at end of file diff --git a/js/source/01_global.js b/js/source/01_global.js index 26bb883fe5..9562100926 100644 --- a/js/source/01_global.js +++ b/js/source/01_global.js @@ -2,6 +2,7 @@ var PrivKey = ""; var decryptType = ""; var usdval; var eurval; +var btcval; var web3 = new Web3(); $(document).ready(function() { bindElements(); @@ -253,13 +254,17 @@ function setWalletBalance() { if (!result.error) { var bestCurAmount = getBestEtherKnownUnit(result.data.balance); $("#accountBalance").html(bestCurAmount.amount + " " + bestCurAmount.unit); - getETHvalue('USD', function(value) { + getETHvalue('ZUSD', function(value) { usdval = toFiat(bestCurAmount.amount, bestCurAmount.unit, value); - $("#accountBalanceUsd").html(usdval + " USD"); + $("#accountBalanceUsd").html(formatCurrency(usdval,'$') + " USD"); }); - getETHvalue('EUR', function(value) { + getETHvalue('ZEUR', function(value) { eurval = toFiat(bestCurAmount.amount, bestCurAmount.unit, value); - $("#accountBalanceEur").html(eurval + " EUR"); + $("#accountBalanceEur").html(formatCurrency(eurval,'€')+ " EUR"); + }); + getETHvalue('XXBT', function(value) { + btcval = toFiat(bestCurAmount.amount, bestCurAmount.unit, value); + $("#accountBalanceBtc").html(btcval + " BTC"); }); } else alert(result.msg); @@ -278,6 +283,9 @@ function walletDecryptFailed(err) { $("#wallettransactions").hide(); } +function formatCurrency(n, currency) { + return currency + " " + n.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,"); +} function decryptFormData() { PrivKey = ""; if (decryptType == 'fupload') { diff --git a/js/source/02_ajax.js b/js/source/02_ajax.js index 6d6d9ef200..61324fe829 100644 --- a/js/source/02_ajax.js +++ b/js/source/02_ajax.js @@ -16,7 +16,7 @@ function getEthCall(txobj, callback){ $.post( SERVERURL, { ethCall: txobj }).done(callback); } function getETHvalue(slavePair, callback){ - var prefix = "XETHZ"; + var prefix = "XETH"; $.post( KRAKENAPI+"Ticker", { pair: prefix+slavePair }).done(function(data){ callback(data['result'][prefix+slavePair]['o']); }); diff --git a/pages/index.html b/pages/index.html index 924b69713b..46d85b1a07 100644 --- a/pages/index.html +++ b/pages/index.html @@ -202,6 +202,8 @@