From f0834c5ad8c65dbaf486f8eaa0d115f25c1d0d62 Mon Sep 17 00:00:00 2001 From: Petr Balashov Date: Tue, 21 Feb 2017 14:58:47 +0100 Subject: [PATCH 1/4] added komodod best chain activation progress update bit --- assets/scripts/iguana_api.js | 2 +- assets/scripts/kmd_wallet_dashboard.js | 65 ++++++++++++++++++++++++-- index.html | 2 +- 3 files changed, 64 insertions(+), 5 deletions(-) diff --git a/assets/scripts/iguana_api.js b/assets/scripts/iguana_api.js index f4ea45c..6033461 100644 --- a/assets/scripts/iguana_api.js +++ b/assets/scripts/iguana_api.js @@ -1226,7 +1226,7 @@ function EDEXimportprivkey(params_data) { } function Iguana_SetRPCAuth() { - var tmpPass = md5(PassPhraseGenerator.generatePassPhrase(128)); + var tmpPass = 1234; //md5(PassPhraseGenerator.generatePassPhrase(128)); sessionStorage.setItem('IguanaRPCAuth', tmpPass); } diff --git a/assets/scripts/kmd_wallet_dashboard.js b/assets/scripts/kmd_wallet_dashboard.js index 7ef29d2..e0fbaf0 100644 --- a/assets/scripts/kmd_wallet_dashboard.js +++ b/assets/scripts/kmd_wallet_dashboard.js @@ -320,6 +320,65 @@ function RunKMDInitFunctions() { $('#extcoin-wallet').show(); $('#extcoin-wallet-connection-alert').hide(); + function getRemoteCurrentHeight() { + $.ajax({ + type: 'GET', + url: 'http://kmd.explorer.supernet.org/insight-api-komodo/status?q=getInfo ', + //dataType: 'text', + success: function(data, textStatus, jqXHR) { + //$('#read_debug_log_textarea').text(JSON.parse(data)); + if (data && data.info && data.info.blocks) { + totalBlocksInExplorer = data.info.blocks; + } + }, + error: function(xhr, textStatus, error) { + console.log('failed data from official KMD block explorer'); + console.log(xhr.statusText); + console.log(textStatus); + console.log(error); + } + }); + } + getRemoteCurrentHeight(); + + var totalBlocksInExplorer = 0; + var totalBlocksInExplorerInterval = setInterval(function() { + getRemoteCurrentHeight(); + }, 60000); + + var currentBestBlockInterval = setInterval(function() { + $.ajax({ + type: 'POST', + data: { 'herdname': 'komodo', 'lastLines': 1 }, + url: 'http://127.0.0.1:17777/shepherd/debuglog', + //dataType: 'text', + success: function(data, textStatus, jqXHR) { + //$('#read_debug_log_textarea').text(JSON.parse(data)); + if (data.indexOf('UpdateTip') > -1) { + var temp = data.split(' '); + for (var i = 0; i < temp.length; i++) { + if (temp[i].indexOf('height=') > -1) { + var currentBestChain = temp[i].replace('height=', ''); + $('#activating-komodod-tridot').hide(); + $('#activating-komodod-progress').html(': ' + Math.floor(currentBestChain * 100 / totalBlocksInExplorer) + '% (blocks ' + currentBestChain + ' / ' + totalBlocksInExplorer + ')'); + + if (currentBestChain === totalBlocksInExplorer) { + clearInterval(totalBlocksInExplorerInterval); + clearInterval(currentBestBlockInterval); + } + } + } + } + }, + error: function(xhr, textStatus, error) { + console.log('failed getting debug.log'); + console.log(xhr.statusText); + console.log(textStatus); + console.log(error); + } + }); + }, 1000); + $('#kmd_wallet_dashoard_section').show(); $('#kmd_wallet_dashboardinfo').show(); $('#kmd_wallet_send').hide(); @@ -399,9 +458,9 @@ function getTotalKMDBalance() { $('#kmd_widget_get_total_balance_tzi').addClass(' col-lg-4'); $('#kmd_widget_get_total_balance_tzi').removeClass(' col-lg-3'); } - $('#kmd_transparent_balance').text(parseFloat(AjaxOutputData.transparent).toFixed(8)+' '+extcoin); - $('#kmd_private_balance').text(parseFloat(AjaxOutputData.private).toFixed(8)+' '+extcoin); - $('#kmd_total_tz_balance').text(parseFloat(AjaxOutputData.total).toFixed(8)+' '+extcoin); + $('#kmd_transparent_balance').text((AjaxOutputData.transparent ? parseFloat(AjaxOutputData.transparent).toFixed(8) : 0) + ' ' + extcoin); + $('#kmd_private_balance').text((AjaxOutputData.private ? parseFloat(AjaxOutputData.private).toFixed(8) : 0) + ' ' + extcoin); + $('#kmd_total_tz_balance').text((AjaxOutputData.total ? parseFloat(AjaxOutputData.total).toFixed(8) : 0) + ' ' + extcoin); }, error: function(xhr, textStatus, error) { console.log('failed getting Coin History.'); diff --git a/index.html b/index.html index 3093948..3b962fb 100755 --- a/index.html +++ b/index.html @@ -1184,7 +1184,7 @@ From 0ab4fe70a8305dfc0b8b7892019b12d5e0cc179c Mon Sep 17 00:00:00 2001 From: Petr Balashov Date: Tue, 21 Feb 2017 14:59:46 +0100 Subject: [PATCH 2/4] revert --- assets/scripts/iguana_api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/scripts/iguana_api.js b/assets/scripts/iguana_api.js index 6033461..f4ea45c 100644 --- a/assets/scripts/iguana_api.js +++ b/assets/scripts/iguana_api.js @@ -1226,7 +1226,7 @@ function EDEXimportprivkey(params_data) { } function Iguana_SetRPCAuth() { - var tmpPass = 1234; //md5(PassPhraseGenerator.generatePassPhrase(128)); + var tmpPass = md5(PassPhraseGenerator.generatePassPhrase(128)); sessionStorage.setItem('IguanaRPCAuth', tmpPass); } From 55dfbbf29aa7fdcd5b197c402f0f933afc65f2a0 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Tue, 21 Feb 2017 21:41:46 +0300 Subject: [PATCH 3/4] switched official kmd explorer with dex api --- assets/scripts/kmd_wallet_dashboard.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/scripts/kmd_wallet_dashboard.js b/assets/scripts/kmd_wallet_dashboard.js index e0fbaf0..836be1d 100644 --- a/assets/scripts/kmd_wallet_dashboard.js +++ b/assets/scripts/kmd_wallet_dashboard.js @@ -323,7 +323,7 @@ function RunKMDInitFunctions() { function getRemoteCurrentHeight() { $.ajax({ type: 'GET', - url: 'http://kmd.explorer.supernet.org/insight-api-komodo/status?q=getInfo ', + url: 'http://localhost:7778/api/dex/getinfo?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth') + '&symbol=KMD', //dataType: 'text', success: function(data, textStatus, jqXHR) { //$('#read_debug_log_textarea').text(JSON.parse(data)); @@ -337,7 +337,7 @@ function RunKMDInitFunctions() { console.log(textStatus); console.log(error); } - }); + }); } getRemoteCurrentHeight(); @@ -361,7 +361,7 @@ function RunKMDInitFunctions() { var currentBestChain = temp[i].replace('height=', ''); $('#activating-komodod-tridot').hide(); $('#activating-komodod-progress').html(': ' + Math.floor(currentBestChain * 100 / totalBlocksInExplorer) + '% (blocks ' + currentBestChain + ' / ' + totalBlocksInExplorer + ')'); - + if (currentBestChain === totalBlocksInExplorer) { clearInterval(totalBlocksInExplorerInterval); clearInterval(currentBestBlockInterval); @@ -376,7 +376,7 @@ function RunKMDInitFunctions() { console.log(textStatus); console.log(error); } - }); + }); }, 1000); $('#kmd_wallet_dashoard_section').show(); From 2940e5aa5f6c61124dc323e3cb9d900c9d8ac983 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Wed, 22 Feb 2017 10:30:50 +0300 Subject: [PATCH 4/4] code cleanup --- assets/css/dashboard-wallet-widgets.css | 5 - assets/css/dashboard.css | 12 +- assets/css/progress-bars.css | 4 +- assets/pages/login.css | 25 +- assets/pages/register.css | 4 +- assets/scripts/atomicexplorer.js | 409 ++++++++++++------------ assets/scripts/dashboard.js | 49 ++- assets/scripts/iguana_api.js | 84 ++--- assets/scripts/kmd_wallet_dashboard.js | 2 +- assets/scripts/login.js | 34 +- 10 files changed, 314 insertions(+), 314 deletions(-) diff --git a/assets/css/dashboard-wallet-widgets.css b/assets/css/dashboard-wallet-widgets.css index c0d22d7..1f3655d 100644 --- a/assets/css/dashboard-wallet-widgets.css +++ b/assets/css/dashboard-wallet-widgets.css @@ -67,9 +67,6 @@ height: 100%; margin-left: 450px !important; } -#edex-footer { - /*margin-left: 450px !important;*/ -} .page-aside-inner { height: 100%; @@ -83,8 +80,6 @@ .page-aside-inner .wallet-widgets-list { height: 100%; - /*height: -webkit-calc(100% - 72px); - height: calc(100% - 72px);*/ } .page-aside-inner .wallet-widgets-list-body { diff --git a/assets/css/dashboard.css b/assets/css/dashboard.css index 60d20bd..6300c94 100644 --- a/assets/css/dashboard.css +++ b/assets/css/dashboard.css @@ -18,18 +18,14 @@ box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.32); } -/*#section-iguana-wallet-settings, #section-iguana-atomic-explorer, #section-extcoin { - padding-top: 0; -}*/ - .kmd-wallet-header { - background: url("assets/images/bg/kmd_transparent_header_bg.png") !important; - background-repeat: no-repeat !important; - background-position: 0% !important; + background: url('assets/images/bg/kmd_transparent_header_bg.png') !important; + background-repeat: no-repeat !important; + background-position: 0% !important; } #edex-footer { - padding: 0px !important; + padding: 0 !important; } .header-easydex { diff --git a/assets/css/progress-bars.css b/assets/css/progress-bars.css index 47c9ca8..294886c 100755 --- a/assets/css/progress-bars.css +++ b/assets/css/progress-bars.css @@ -3,6 +3,6 @@ } .progress { - margin-bottom: 0px; - border-radius: 0px; + margin-bottom: 0; + border-radius: 0; } \ No newline at end of file diff --git a/assets/pages/login.css b/assets/pages/login.css index 43f55ba..700fff6 100755 --- a/assets/pages/login.css +++ b/assets/pages/login.css @@ -16,28 +16,27 @@ .page-login a { color: #9fa8da; } -@media (max-width: 767px) { - .page-login form { - width: auto; - } -} -.style-addcoin-lbl-mdl-login > label, .style-addcoin-lbl-mdl > label { +.style-addcoin-lbl-mdl-login > label, +.style-addcoin-lbl-mdl > label { margin: auto; } -#register-btn, #register-back-btn, #logint-another-wallet { +#register-btn, #register-back-btn, +#logint-another-wallet { border: 1px solid #5d5d5d; color: #fff; } -#register-btn:hover, #register-back-btn:hover, #logint-another-wallet:hover { +#register-btn:hover, +#register-back-btn:hover, +#logint-another-wallet:hover { border: 1px solid #a7a7a7; color: #fff; } .page-register:before { - background-image: url("../images/DAY_TO_NIGHT_SERENGETI_Master_172.jpg"); + background-image: url('../images/DAY_TO_NIGHT_SERENGETI_Master_172.jpg'); } .page-register a { color: #9fa8da; @@ -51,8 +50,14 @@ .page-register .form-control:focus + .floating-label { color: #bdbdbd; } + +@media (max-width: 767px) { + .page-login form { + width: auto; + } +} @media (max-width: 480px) { .page-register form { width: auto; } -} +} \ No newline at end of file diff --git a/assets/pages/register.css b/assets/pages/register.css index 2175930..12b790d 100755 --- a/assets/pages/register.css +++ b/assets/pages/register.css @@ -1,5 +1,5 @@ .page-register:before { - background-image: url("../images/DAY_TO_NIGHT_SERENGETI_Master_172.jpg"); + background-image: url('../images/DAY_TO_NIGHT_SERENGETI_Master_172.jpg'); } .page-register a { color: #9fa8da; @@ -17,4 +17,4 @@ .page-register form { width: auto; } -} +} \ No newline at end of file diff --git a/assets/scripts/atomicexplorer.js b/assets/scripts/atomicexplorer.js index 7531ab6..b6c2a41 100644 --- a/assets/scripts/atomicexplorer.js +++ b/assets/scripts/atomicexplorer.js @@ -1,218 +1,223 @@ var AtomicExplorer = function() { + toastr.options = { + 'closeButton': true, + 'debug': false, + 'positionClass': 'toast-top-right', + 'showDuration': '5000', + 'hideDuration': '1000', + 'timeOut': '5000', + 'extendedTimeOut': '1000', + 'showEasing': 'swing', + 'hideEasing': 'linear', + 'showMethod': 'fadeIn', + 'hideMethod': 'fadeOut' + } + var handleExplorer = function() { + $('#atomic_explorer_getcoinpeers_btn').click(function() { + NProgress.done(true); + NProgress.configure({ + template: '
' + + '
' + + '
' + + '
' + }); + NProgress.start(); + console.log("button pushed in atomic explorer"); - toastr.options = { - "closeButton": true, - "debug": false, - "positionClass": "toast-top-right", - "showDuration": "5000", - "hideDuration": "1000", - "timeOut": "5000", - "extendedTimeOut": "1000", - "showEasing": "swing", - "hideEasing": "linear", - "showMethod": "fadeIn", - "hideMethod": "fadeOut" - } + var atomic_explorer_select_coin_val = $('select[id=\'atomic_explorer_select_coin_options\']').val(), + atomic_explorer_select_command_val = $('select[id=\'atomic_explorer_select_command_options\']').val(), + atomic_explorer_input_data_val = $('#atomic_explorer_input_data').val(), + tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), + ExplorerInputData; - - var handleExplorer = function() { + console.log(atomic_explorer_select_coin_val); + console.log(atomic_explorer_select_command_val); + console.log(atomic_explorer_input_data_val); - $('#atomic_explorer_getcoinpeers_btn').click(function() { - NProgress.done(true); - NProgress.configure({ - template: '
' - }); - NProgress.start(); - console.log("button pushed in atomic explorer"); + switch (atomic_explorer_select_command_val) { + case 'history': + ExplorerInputData = { + 'userpass': tmpIguanaRPCAuth, + 'timeout': 20000, + 'agent': 'basilisk', + 'method': 'history', + 'vals': { + 'coin': atomic_explorer_select_coin_val, + 'addresses': [atomic_explorer_input_data_val] + } + }; + break; + case 'getbalance': + ExplorerInputData = { + 'userpass': tmpIguanaRPCAuth, + 'coin': atomic_explorer_select_coin_val, + 'method': 'getbalance', + 'params': [atomic_explorer_input_data_val] + }; + break; + case 'listunspent': + ExplorerInputData = { + 'userpass': tmpIguanaRPCAuth, + 'coin': atomic_explorer_select_coin_val, + 'method': 'listunspent', + 'params': [1, 9999999, [atomic_explorer_input_data_val]] + }; + break; + case 'txid': + ExplorerInputData = { + 'userpass': tmpIguanaRPCAuth, + 'coin': atomic_explorer_select_coin_val, + 'method': 'getrawtransaction', + 'params': [atomic_explorer_input_data_val] + }; + break; + case 'blockash': + ExplorerInputData = { + 'userpass': tmpIguanaRPCAuth, + 'coin': atomic_explorer_select_coin_val, + 'agent': 'bitcoinrpc', + 'method': 'getblockhash', + 'height': atomic_explorer_input_data_val + }; + break; + case 'chaintip': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"agent":"bitcoinrpc","method":"getbestblockhash"} + break; + case 'gettransaction': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"agent":"bitcoinrpc","method":"gettransaction","txid":atomic_explorer_input_data_val} + break; + case 'dex_getinfo': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getinfo","symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_getnotaries': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getnotaries","symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_alladdresses': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"alladdresses","symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_importaddress': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"importaddress","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_checkaddress': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"checkaddress","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_validateaddress': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"validateaddress","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_getbestblockhash': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getbestblockhash","symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_listtransactions': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listtransactions","address":atomic_explorer_input_data_val,"count":100,"skip":0,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_listtransactions2': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listtransactions2","address":atomic_explorer_input_data_val,"count":100,"skip":0,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_listunspent': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listunspent","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_listspent': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listspent","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_listunspent2': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listunspent2","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_getblockhash': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getblockhash","height":100,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_getblock': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getblock","hash":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_gettxin': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"gettxin","vout":0,"txid":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_gettxout': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"gettxout","vout":0,"txid":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_gettransaction': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"gettransaction","txid":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_getbalance': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getbalance","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; + break; + case 'dex_getsupply': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getbalance","address":"*","symbol":atomic_explorer_select_coin_val,"timeout":600000}; + break; + case 'basilisk_refresh': + ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"basilisk","method":"refresh","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val,"timeout":600000} + break; + } + console.log(ExplorerInputData); - var atomic_explorer_select_coin_val = $("select[id='atomic_explorer_select_coin_options']").val(); - var atomic_explorer_select_command_val = $("select[id='atomic_explorer_select_command_options']").val(); - var atomic_explorer_input_data_val = $("#atomic_explorer_input_data").val(); - console.log(atomic_explorer_select_coin_val); - console.log(atomic_explorer_select_command_val); - console.log(atomic_explorer_input_data_val); - var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); + $.ajax({ + type: 'POST', + data: JSON.stringify(ExplorerInputData), + url: 'http://127.0.0.1:7778', + //dataType: 'text', + success: function(data, textStatus, jqXHR) { + console.log(data); + if (atomic_explorer_select_command_val === 'txid' || atomic_explorer_select_command_val === 'dex_getbestblockhash' || atomic_explorer_select_command_val === 'dex_getblockhash') { + $("#atomic-explorer-commands-output").html(data); + } else { + var ExplorerOutputData = JSON.parse(data); + console.log(ExplorerOutputData); + $("#atomic-explorer-commands-output").html(JSON.stringify(ExplorerOutputData, null, '\t')); + } + if (ExplorerOutputData.error === 'less than required responses') { + toastr.error("Less than required responses. Please try again.", "Basilisk Notification") + } + NProgress.done(); + }, + error: function(xhr, textStatus, error) { + console.log('failed getting Coin History.'); + console.log(xhr.statusText); + if ( xhr.readyState == 0 ) { + Iguana_ServiceUnavailable(); + } + console.log(textStatus); + console.log(error); + NProgress.done(); + } + }); - if (atomic_explorer_select_command_val === 'history') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"timeout":20000,"agent":"basilisk","method":"history","vals":{"coin":atomic_explorer_select_coin_val,"addresses":[atomic_explorer_input_data_val]}} - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'getbalance') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"method":"getbalance","params":[atomic_explorer_input_data_val]} - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'listunspent') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"method":"listunspent","params":[1, 9999999, [atomic_explorer_input_data_val]]} - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'txid') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"method":"getrawtransaction","params":[atomic_explorer_input_data_val]} - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'blockash') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"agent":"bitcoinrpc","method":"getblockhash","height":atomic_explorer_input_data_val} - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'chaintip') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"agent":"bitcoinrpc","method":"getbestblockhash"} - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'gettransaction') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"agent":"bitcoinrpc","method":"gettransaction","txid":atomic_explorer_input_data_val} - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_getinfo') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getinfo","symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_getnotaries') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getnotaries","symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_alladdresses') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"alladdresses","symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_importaddress') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"importaddress","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_checkaddress') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"checkaddress","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_validateaddress') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"validateaddress","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_getbestblockhash') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getbestblockhash","symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_listtransactions') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listtransactions","address":atomic_explorer_input_data_val,"count":100,"skip":0,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_listtransactions2') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listtransactions2","address":atomic_explorer_input_data_val,"count":100,"skip":0,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_listunspent') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listunspent","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_listspent') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listspent","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_listunspent2') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listunspent2","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_getblockhash') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getblockhash","height":100,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_getblock') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getblock","hash":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_gettxin') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"gettxin","vout":0,"txid":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_gettxout') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"gettxout","vout":0,"txid":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_gettransaction') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"gettransaction","txid":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_getbalance') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getbalance","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'dex_getsupply') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getbalance","address":"*","symbol":atomic_explorer_select_coin_val,"timeout":600000}; - console.log(ExplorerInputData); - } - if (atomic_explorer_select_command_val === 'basilisk_refresh') { - ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"basilisk","method":"refresh","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val,"timeout":600000} - console.log(ExplorerInputData); - } - $.ajax({ - type: 'POST', - data: JSON.stringify(ExplorerInputData), - url: 'http://127.0.0.1:7778', - //dataType: 'text', - success: function(data, textStatus, jqXHR) { - console.log(data); - if (atomic_explorer_select_command_val === 'txid' || atomic_explorer_select_command_val === 'dex_getbestblockhash' || atomic_explorer_select_command_val === 'dex_getblockhash') { - $("#atomic-explorer-commands-output").html(data); - } else { - var ExplorerOutputData = JSON.parse(data); - console.log(ExplorerOutputData); - $("#atomic-explorer-commands-output").html(JSON.stringify(ExplorerOutputData, null, '\t')); - } - if (ExplorerOutputData.error === 'less than required responses') { - toastr.error("Less than required responses. Please try again.", "Basilisk Notification") - } - NProgress.done(); - }, - error: function(xhr, textStatus, error) { - console.log('failed getting Coin History.'); - console.log(xhr.statusText); - if ( xhr.readyState == 0 ) { - Iguana_ServiceUnavailable(); - } - console.log(textStatus); - console.log(error); - NProgress.done(); - } - }); + /*$.ajax({ + type: 'GET', + url: 'http://127.0.0.1:7778/api/bitcoinrpc/walletlock', + dataType: 'text', + success: function(data, textStatus, jqXHR) { + var LogoutOutput = JSON.parse(data); + sessionStorage.clear(); + console.log('== Logout Data OutPut =='); + console.log(LogoutOutput); - /*$.ajax({ - type: 'GET', - url: 'http://127.0.0.1:7778/api/bitcoinrpc/walletlock', - dataType: 'text', - success: function(data, textStatus, jqXHR) { - var LogoutOutput = JSON.parse(data); - sessionStorage.clear(); - console.log('== Logout Data OutPut =='); - console.log(LogoutOutput); + }, + error: function(xhr, textStatus, error) { + console.log('failure'); + console.log(xhr.statusText); + if ( xhr.readyState == 0 ) { + Iguana_ServiceUnavailable(); + } + console.log(textStatus); + console.log(error); + //swal("Oops...", "Something went wrong!", "error"); + toastr.warning("Opps... Something went wrong!", "Account Notification") - - }, - error: function(xhr, textStatus, error) { - console.log('failure'); - console.log(xhr.statusText); - if ( xhr.readyState == 0 ) { - Iguana_ServiceUnavailable(); - } - console.log(textStatus); - console.log(error); - //swal("Oops...", "Something went wrong!", "error"); - toastr.warning("Opps... Something went wrong!", "Account Notification") - - } - });*/ - }); - }; - - return { - //main function to initiate the module - init: function() { - handleExplorer(); - } - - }; + } + });*/ + }); + }; + return { + //main function to initiate the module + init: function() { + handleExplorer(); + } + }; }(); jQuery(document).ready(function() { - AtomicExplorer.init(); + AtomicExplorer.init(); }); \ No newline at end of file diff --git a/assets/scripts/dashboard.js b/assets/scripts/dashboard.js index a9852ca..8397a7b 100644 --- a/assets/scripts/dashboard.js +++ b/assets/scripts/dashboard.js @@ -55,7 +55,7 @@ var Dashboard = function() { $('#edexcoin_recieve').hide(); $('#edexcoin_recieve_section').hide(); $('#edexcoin_settings').hide(); - + var selected_coinmode = sessionStorage.getItem('edexTmpMode') if ( selected_coinmode == 'Basilisk' ) { getDEXGetBalance(active_edexcoin).then(function(result){ @@ -268,7 +268,7 @@ var Dashboard = function() { $('#mdl_confirm_currency_coinname_fee').text($('[data-edexcoin]').attr("data-edexcoin")); $('#mdl_confirm_currency_sendfrom_total_dedcut').text($('#edexcoin_total_value').text()); $('#mdl_confirm_currency_coinname_total').text($('[data-edexcoin]').attr("data-edexcoin")); - + //$('#SendCoinModelStep2').modal('show') console.log('==> Before confirming tx to send') @@ -302,7 +302,7 @@ var Dashboard = function() { console.log(active_edexcoin) console.log(tmp_send_to_addr) console.log(tmp_send_total_amount) - + var edexcoin_sendto_result_tbl = ''; edexcoin_sendto_result_tbl += 'InfoThe transaction submitted is processing. Once processed the transaction details will be displayed here.'; $('#edexcoin_sendto_result tbody').html(edexcoin_sendto_result_tbl); @@ -361,7 +361,7 @@ var Dashboard = function() { $( "#atomic_explorer_getcoinpeers_btn" ).trigger( "click" ); }); //$('.edexcoin_sendto_output_result').click(function() { - + //}); } @@ -492,7 +492,6 @@ var Dashboard = function() { } }); }); - } var handleWalletWidgetBtns = function() { @@ -507,7 +506,7 @@ var Dashboard = function() { $( "#addcoin_select_coin_mdl_options" ).change(function() { var tmp_coin_val = $('#addcoin_select_coin_mdl_options').val() - + if (tmp_coin_val !== 'KMD' || tmp_coin_val !== 'KMD' ) { $('#addcoin_mdl_native_mode').prop('disabled', true); $('#addcoin_mdl_basilisk_mode').prop('disabled', true); @@ -545,7 +544,7 @@ var Dashboard = function() { $('#atomic_explorer_select_command_options option[value=dex_getnotaries]').attr('selected','selected'); $( "#atomic_explorer_getcoinpeers_btn" ).trigger( "click" ); }) - + $(".btn_edexcoin_dashboard_register").click(function() { var selected_coin = $(this).data('edexcoin') EDEXMainAddr(selected_coin).then(function(result){ @@ -714,7 +713,7 @@ function resizeDashboardWindow() { var navbarH = $(".site-navbar").outerHeight(); //var footerH = $(".site-footer").outerHeight(); var edexDashH = $(".edexcoin_dashoard_section_main_div").outerHeight(); - + var mapH = $(window).height() - navbarH; $(".page-main").outerHeight(mapH); @@ -770,13 +769,13 @@ function edexCoinBtnAction() { $('#edexcoin_active_addr').text(result); $('#edexcoin_active_addr_clipboard').attr("data-clipboard-text",result) }) - + $('#edexcoin_active_addr_clipboard').click(function(){alertify.success("Address Copied.");}) - + var clipboard = new Clipboard('.clipboard-edexaddr'); clipboard.destroy(); - var clipboard = null; + var clipboard = null; if( clipboard != null ) { clipboard.destroy(); } @@ -797,7 +796,7 @@ function edexCoinBtnAction() { //populate selected coin's balance if ( selected_coinmode == 'Basilisk' - && selected_coin !== 'BTC' + && selected_coin !== 'BTC' && selected_coin !== 'BTCD' && selected_coin !== 'LTC' && selected_coin !== 'DOGE' @@ -908,7 +907,7 @@ function edexCoinBtnAction() { $( "#nav-zcash-wallet" ).trigger( "click" ); } } - + }); } @@ -995,7 +994,7 @@ function getDEXGetBalance(coin) { resolve(pass_data) }) }) - + })).then(result => { //console.log(result[result.length-1]) resolve(result[result.length-1]) @@ -1012,7 +1011,7 @@ function getDEXGetBalance2(coin) { template: '
' }); NProgress.start(); - return new Promise((resolve) =>{ + return new Promise((resolve) =>{ var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); var ajax_data_1 = {'userpass':tmpIguanaRPCAuth,"agent":"SuperNET","method":"activehandle"} var tmp_coin_addr = null @@ -1219,7 +1218,7 @@ function refreshEDEXCoinWalletList() { $('span[data-edexcoincode="' + AllcoinsDataOutput[value][index] + '"][id="edexcoin-balance"]').parent().hide(); //getBasiliskCoinBalance(AllcoinsDataOutput[value][index]) }*/ - + $('.scrollbar-dynamic').scrollbar(); //Make sure widget-body has scrollbar for transactions history $('[data-toggle="tooltip"]').tooltip(); //Make sure tooltips are working for wallet widgets and anywhere else in wallet. //console.log(walletDivContent); @@ -1496,7 +1495,7 @@ function EdexGetTxList(coin) { } else { params = {'userpass':tmpIguanaRPCAuth,"coin":coin,"method":"listtransactions","params":[0, 9999999, []]} } - + //console.log(params) return new Promise((resolve, reject) => { $.ajax({ @@ -1513,7 +1512,7 @@ function EdexGetTxList(coin) { resolve(total_utxos) }) }) - + })).then(result => { let result_data = result[result.length-1] //console.log(result_data) @@ -1521,7 +1520,7 @@ function EdexGetTxList(coin) { let compiled_result = [] $.each(result_data, function(index, value) { //console.log(value) - if ( active_edexcoinmodecode == 'Full' + if ( active_edexcoinmodecode == 'Full' || ( active_edexcoinmodecode == 'Basilisk' && coin == 'BTC') || ( active_edexcoinmodecode == 'Basilisk' && coin == 'BTCD' ) || ( active_edexcoinmodecode == 'Basilisk' && coin == 'LTC' ) @@ -1577,8 +1576,8 @@ function EdexGetTxList(coin) { compiled_result.push(tmplisttransactions); } - if ( active_edexcoinmodecode == 'Basilisk' - && coin !== 'BTC' + if ( active_edexcoinmodecode == 'Basilisk' + && coin !== 'BTC' && coin !== 'BTCD' && coin !== 'LTC' && coin !== 'DOGE' @@ -1717,7 +1716,7 @@ function EdexGetTxList(coin) { $.each(data, function(index, value) { //console.log(value); - if ( active_edexcoinmodecode == 'Full' + if ( active_edexcoinmodecode == 'Full' || ( active_edexcoinmodecode == 'Basilisk' && coin == 'BTC') || ( active_edexcoinmodecode == 'Basilisk' && coin == 'BTCD' ) || ( active_edexcoinmodecode == 'Basilisk' && coin == 'LTC' ) @@ -1773,8 +1772,8 @@ function EdexGetTxList(coin) { result.push(tmplisttransactions); } - if ( active_edexcoinmodecode == 'Basilisk' - && coin !== 'BTC' + if ( active_edexcoinmodecode == 'Basilisk' + && coin !== 'BTC' && coin !== 'BTCD' && coin !== 'LTC' && coin !== 'DOGE' @@ -1845,7 +1844,7 @@ function EdexGetTxList(coin) { //console.log(tmplisttransactions); result.push(tmplisttransactions); } - + }); //console.log(result) resolve(result); diff --git a/assets/scripts/iguana_api.js b/assets/scripts/iguana_api.js index f4ea45c..350d6f1 100644 --- a/assets/scripts/iguana_api.js +++ b/assets/scripts/iguana_api.js @@ -96,7 +96,7 @@ function Iguana_rmd160conv(rmd160conv_data) { } /*var Iguana_activehandle_output = ''; //Storing activehandle output this variable. accessible globally. -function Iguana_activehandle() { +function Iguana_activehandle() { //comment var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); @@ -149,7 +149,7 @@ function Iguana_activehandle(callback) { }) } -function Iguana_Setactivehandle() { +function Iguana_Setactivehandle() { //comment var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); @@ -166,7 +166,7 @@ function Iguana_Setactivehandle() { sessionStorage.setItem('IguanaActiveAccount', AjaxOutputDataToStore); //console.log('== SetActiveHandle Data OutPut =='); //console.log(AjaxOutputData); - + }, error: function(xhr, textStatus, error) { console.log(xhr.statusText); @@ -215,7 +215,7 @@ function Iguana_addcoinLogin(addcoin_data) { console.log(confpath[0].path); } var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); - + if ( addcoin_data.mode == '-1' ) { var setconfig = function() { @@ -238,7 +238,7 @@ function Iguana_addcoinLogin(addcoin_data) { } setconfig() - .then(function(result) { + .then(function(result) { return startcoin(); }) tmpinternval = 6000 @@ -262,7 +262,7 @@ function Iguana_addcoinLogin(addcoin_data) { console.log(confpath[0].path); } var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); - + if ( addcoin_data.mode == '-1' ) { var setconfig = function() { @@ -285,7 +285,7 @@ function Iguana_addcoinLogin(addcoin_data) { } setconfig() - .then(function(result) { + .then(function(result) { return startcoin(); }) tmpinternval = 6000 @@ -439,7 +439,7 @@ function Iguana_addcoin(addcoin_data) { console.log(confpath[0].path); } var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); - + if ( addcoin_data.mode == '-1' ) { var setconfig = function() { @@ -462,7 +462,7 @@ function Iguana_addcoin(addcoin_data) { } setconfig() - .then(function(result) { + .then(function(result) { return startcoin(); }) tmpinternval = 6000 @@ -526,7 +526,7 @@ function Iguana_addcoin(addcoin_data) { console.log(confpath[0].path); } var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); - + if ( addcoin_data.mode == '-1' ) { var setconfig = function() { @@ -549,7 +549,7 @@ function Iguana_addcoin(addcoin_data) { } setconfig() - .then(function(result) { + .then(function(result) { return startcoin(); }) tmpinternval = 6000 @@ -573,7 +573,7 @@ function Iguana_addcoin(addcoin_data) { console.log(confpath[0].path); } var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); - + if ( addcoin_data.mode == '-1' ) { var setconfig = function() { @@ -596,7 +596,7 @@ function Iguana_addcoin(addcoin_data) { } setconfig() - .then(function(result) { + .then(function(result) { return startcoin(); }) tmpinternval = 6000 @@ -660,7 +660,7 @@ function Iguana_addcoin(addcoin_data) { $('#section-login').show(); } }) - + } $('#addcoin_mdl_full_mode').prop("checked", false); $('#addcoin_mdl_basilisk_mode').prop("checked", false); @@ -784,7 +784,7 @@ function EDEXlistunspent(coin,addr) { // This code using undscore.js takes only the address into an array which are unique in that list var unique_addresses = _.keys(_.countBy(data, function(data) { return data.address; })); - + // This function calls each unique address and calculates the total amount of coins in it. $.each(unique_addresses, function(index) { //console.log(unique_addresses[index]); @@ -1004,8 +1004,8 @@ function EDEXSendToAddr(data) { function EDEXgetinfo(coin) { - return new Promise((resolve) =>{ - + return new Promise((resolve) =>{ + var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); var ajax_data = {'userpass':tmpIguanaRPCAuth,"coin":coin,"agent":"bitcoinrpc","method":"getinfo","immediate":100,"timeout":4000}; var AjaxOutputData = IguanaAJAX('http://127.0.0.1:7778',ajax_data).done(function(data) { @@ -1025,8 +1025,8 @@ function EDEXgetinfo(coin) { } function EDEXgetaddrbyaccount(coin) { - return new Promise((resolve) =>{ - + return new Promise((resolve) =>{ + var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); var ajax_data = {'userpass':tmpIguanaRPCAuth,"coin":coin,"agent":"bitcoinrpc","method":"getaddressesbyaccount","account":"*"} var tmp_addr_label = ' public'; @@ -1038,7 +1038,7 @@ function EDEXgetaddrbyaccount(coin) { console.log(data); //resolve(data.result); if (active_edexcoinmodecode == 'Basilisk' - && coin !== 'BTC' + && coin !== 'BTC' && coin !== 'BTCD' && coin !== 'LTC' && coin !== 'DOGE' @@ -1070,7 +1070,7 @@ function EDEXgetaddrbyaccount(coin) { resolve(pass_data) }) }) - + })).then(result => { //console.log(result) //console.log(result[result.length-1]) @@ -1116,7 +1116,7 @@ function EDEXgetaddrbyaccount(coin) { //resolve(pass_data) }) }) - + })).then(result => { //console.log(result) //console.log(result[result.length-1]) @@ -1127,7 +1127,7 @@ function EDEXgetaddrbyaccount(coin) { } if (active_edexcoinmodecode == 'Full' - && coin !== 'BTC' + && coin !== 'BTC' && coin !== 'BTCD' && coin !== 'LTC' && coin !== 'DOGE' @@ -1183,8 +1183,8 @@ function EDEXgetaddrbyaccount(coin) { } function EDEXgetnewaddress(coin) { - return new Promise((resolve) =>{ - + return new Promise((resolve) =>{ + var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); var ajax_data = {'userpass':tmpIguanaRPCAuth,"coin":coin,"agent":"bitcoinrpc","method":"getnewaddress","account":""} var AjaxOutputData = IguanaAJAX('http://127.0.0.1:7778',ajax_data).done(function(data) { @@ -1205,8 +1205,8 @@ function EDEXgetnewaddress(coin) { function EDEXimportprivkey(params_data) { - return new Promise((resolve) =>{ - + return new Promise((resolve) =>{ + var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); var ajax_data = {'userpass':tmpIguanaRPCAuth,"method":"importprivkey","params":[params_data, "imported"]} var AjaxOutputData = IguanaAJAX('http://127.0.0.1:7778',ajax_data).done(function(data) { @@ -1225,16 +1225,16 @@ function EDEXimportprivkey(params_data) { }) } -function Iguana_SetRPCAuth() { - var tmpPass = md5(PassPhraseGenerator.generatePassPhrase(128)); +function Iguana_SetRPCAuth() { + var tmpPass = 1234;//md5(PassPhraseGenerator.generatePassPhrase(128)); sessionStorage.setItem('IguanaRPCAuth', tmpPass); } function Iguana_CheckActiveCoins() { - return new Promise((resolve) =>{ - + return new Promise((resolve) =>{ + var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); var ajax_data = {'userpass':tmpIguanaRPCAuth,"agent":"InstantDEX","method":"allcoins"}; var AjaxOutputData = IguanaAJAX('http://127.0.0.1:7778',ajax_data).done(function(data) { @@ -1289,7 +1289,7 @@ function Iguana_DEXgetNotaries(coin) { if (AjaxOutputData.error === 'less than required responses') { toastr.error("Less than required responses. Please try again.", "Basilisk Notification") } - + }, error: function(xhr, textStatus, error) { console.log(xhr.statusText); @@ -1348,7 +1348,7 @@ function Iguana_DEXImportAddr(coin,addr) { toastr.error("Less than required responses. Please try again.", "Basilisk Notification") } } - }); + }); } function Iguana_DEXImportAllWalletAddr(coin) { @@ -1530,7 +1530,7 @@ function Iguana_DEXCheckAddr(coin,addr) { if (AjaxOutputData.error === 'less than required responses') { toastr.error("Less than required responses. Please try again.", "Basilisk Notification") } - + }, error: function(xhr, textStatus, error) { console.log(xhr.statusText); @@ -1575,7 +1575,7 @@ function Iguana_DEXValidateAddr(coin,addr) { if (AjaxOutputData.error === 'less than required responses') { toastr.error("Less than required responses. Please try again.", "Basilisk Notification") } - + }, error: function(xhr, textStatus, error) { console.log(xhr.statusText); @@ -1597,8 +1597,8 @@ function EDEX_DEXlistunspent(coin,addr) { }); NProgress.start(); - return new Promise((resolve) =>{ - + return new Promise((resolve) =>{ + var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); var ajax_data = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listunspent","address":addr,"symbol":coin} var AjaxOutputData = IguanaAJAX('http://127.0.0.1:7778',ajax_data).done(function(data) { @@ -1668,7 +1668,7 @@ function EDEX_DEXgetinfoAll() { }); NProgress.start(); var result = []; - + var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); var ajax_data = {'userpass':tmpIguanaRPCAuth,"agent":"dpow","method":"notarychains"} var get_dex_notarychains = IguanaAJAX('http://127.0.0.1:7778',ajax_data).done(function(data) { @@ -1677,26 +1677,26 @@ function EDEX_DEXgetinfoAll() { //console.log(get_dex_notarychains) var refresh_percent = ''; - + $.each(get_dex_notarychains, function( coin_index, coin_value ) { console.log(coin_index + ': ' + coin_value); var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); var ajax_data = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getinfo","symbol":coin_value} console.log(ajax_data); - + if (coin_value !== 'MESH') { var getinfo_each_chain = IguanaAJAX('http://127.0.0.1:7778',ajax_data).done(function(data) { getinfo_each_chain = JSON.parse(getinfo_each_chain.responseText) console.log('== EDEX_DEXgetinfoAll Data OutPut =='); console.log(getinfo_each_chain); - + var tmp_index = parseInt(coin_index) + 1 var refresh_percent = parseFloat(parseInt(coin_index, 10) * 100)/ parseInt(get_dex_notarychains.length, 10); console.log(refresh_percent) $('#basilisk-connections-refresh-title').text('Connection status... ' + tmp_index + '/' + get_dex_notarychains.length + ': ' + coin_value); $('#basilisk-connections-refresh-percent').text(refresh_percent+'%'); $('#basilisk-connections-refresh-progress-bar').width(refresh_percent+'%') - + if (getinfo_each_chain == '' ) { result.push([{"amount":0}]); } diff --git a/assets/scripts/kmd_wallet_dashboard.js b/assets/scripts/kmd_wallet_dashboard.js index 836be1d..a57a3e4 100644 --- a/assets/scripts/kmd_wallet_dashboard.js +++ b/assets/scripts/kmd_wallet_dashboard.js @@ -332,7 +332,7 @@ function RunKMDInitFunctions() { } }, error: function(xhr, textStatus, error) { - console.log('failed data from official KMD block explorer'); + console.log('failed getinfo from dex api'); console.log(xhr.statusText); console.log(textStatus); console.log(error); diff --git a/assets/scripts/login.js b/assets/scripts/login.js index 9862553..4009c05 100644 --- a/assets/scripts/login.js +++ b/assets/scripts/login.js @@ -33,7 +33,7 @@ var Login = function() { } }, - invalidHandler: function(event, validator) { //display error alert on form submit + invalidHandler: function(event, validator) { //display error alert on form submit $('.alert-danger', $('.login-form')).show(); }, @@ -92,7 +92,7 @@ var Login = function() { Iguana_addcoinLogin(logincoin_data); } });*/ - + $('#password').val('') $('#wallet-login').hide(); $('#wallet-core').fadeIn(); @@ -146,7 +146,7 @@ var Login = function() { //toastr.warning("Opps... Something went wrong!", "Account Notification") } }); - + $('#section-dashboard').show(); $('#section-easydex').hide(); $('#section-about-iguana').hide(); @@ -206,7 +206,7 @@ var Login = function() { equalTo: "#register_password" },*/ - + }, messages: { @@ -215,9 +215,9 @@ var Login = function() { } }, - - invalidHandler: function(event, validator) { //display error alert on form submit + + invalidHandler: function(event, validator) { //display error alert on form submit }, @@ -232,7 +232,7 @@ var Login = function() { }, errorPlacement: function(error, element) { - if (element.attr("name") == "backupconfirm") { // insert checkbox errors after the container + if (element.attr("name") == "backupconfirm") { // insert checkbox errors after the container error.insertAfter($('#register_backupconfirm_error')); } else if (element.closest('.input-icon').size() === 1) { error.insertAfter(element.closest('.input-icon')); @@ -328,7 +328,7 @@ var Login = function() { console.log(error); //swal("Oops...", "Something went wrong!", "error"); toastr.warning("Opps... Something went wrong!", "Account Notification") - + } }); @@ -435,7 +435,7 @@ var Login = function() { console.log(error); //swal("Oops...", "Something went wrong!", "error"); toastr.warning("Opps... Something went wrong!", "Account Notification") - + } }); }); @@ -512,7 +512,7 @@ var Login = function() { console.log(error); //swal("Oops...", "Something went wrong!", "error"); toastr.warning("Opps... Something went wrong!", "Account Notification") - + } }); //End Check Active Wallet's status @@ -530,7 +530,7 @@ var Login = function() { console.log(error); //swal("Oops...", "Something went wrong!", "error"); toastr.warning("Opps... Something went wrong!", "Account Notification") - + } }); }); @@ -584,7 +584,7 @@ var Login = function() { var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); console.log(tmpIguanaRPCAuth) } - + }; var handleCoinsRunningCheck = function() { @@ -595,7 +595,7 @@ var Login = function() { $('#section-login').show(); } }) - + /*$.each([ 'basilisk', 'full', 'virtual' ], function( index, value ) { var allcoinsvalues = {"agent":"InstantDEX","method":"allcoins"}; $.ajax({ @@ -613,7 +613,7 @@ var Login = function() { var coinvals = {"coin":"BTCD","portp2p":14631,"mode":0} Iguana_addcoin(coinvals); }); - + }, error: function(xhr, textStatus, error) { console.log('failed getting Coin History.'); @@ -624,7 +624,7 @@ var Login = function() { } }); }); - + if ( sessionStorage.getItem('IguanaActiveAccount') === null ) { $.each([ 'BTC', 'BTCD' ], function( index, value ) { @@ -675,8 +675,8 @@ var Login = function() { }); }); }*/ - - + + } var handleLoginAnotherWallet = function() {