From b7193f99f3786ad78933f63c438f74301c0592f5 Mon Sep 17 00:00:00 2001 From: Satinder Grewal Date: Thu, 26 Jan 2017 20:12:27 +1300 Subject: [PATCH] Basilisk Mode Balance query conditioned to sue DEX listunspent --- assets/scripts/dashboard.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/assets/scripts/dashboard.js b/assets/scripts/dashboard.js index 77b7597..54d66aa 100644 --- a/assets/scripts/dashboard.js +++ b/assets/scripts/dashboard.js @@ -279,6 +279,10 @@ var Dashboard = function() { walletDivContent += ''; $('.wallet-widgets-row').html(walletDivContent); + if ( modecode == 'Basilisk' ) { + $('span[data-edexcoincode="' + AllcoinsDataOutput[value][index] + '"][id="edexcoin-balance"]').parent().hide(); + //getBasiliskCoinBalance(AllcoinsDataOutput[value][index]) + } getCoinBalance(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. @@ -459,8 +463,15 @@ function edexCoinBtnAction() { $('#edexcoin_active_addr').text(coinmainaddr[0]); //populate selected coin's balance - var coinwalletbalance = EDEXgetBalance(coincode); - $('#edex_total_balance').text(coinwalletbalance[0]); + if ( selected_coinmode == 'Basilisk' ) { + var coinwalletbalance = EDEX_DEXlistunspent(coincode, coinmainaddr[0]); + console.log(coinwalletbalance[0].amount) + coinwalletbalance = coinwalletbalance[0].amount + $('#edex_total_balance').text(coinwalletbalance); + } else { + var coinwalletbalance = EDEXgetBalance(coincode); + $('#edex_total_balance').text(coinwalletbalance[0]); + } //getCoinBalance(active_edexcoin); EdexfillTxHistory(coincode); @@ -689,6 +700,14 @@ function getCoinBalance(coin) { }); } +function getBasiliskCoinBalance(coin) { + var coinmainaddr = EDEXMainAddr(coin); + var coinwalletbalance = EDEX_DEXlistunspent(coin, coinmainaddr); + console.log(coinwalletbalance[0].amount) + coinwalletbalance = coinwalletbalance[0].amount + $('span[data-edexcoincode="' + coin + '"][id="edexcoin-balance"]').text(coinwalletbalance); +} + function StopShowCoinHistory() { clearInterval(ExecuteShowCoinHistory); console.log('Stopped executing History and ProgressBar API.');