Browse Source

Basilisk Mode troubleshooting buttons added to wallet

master
Satinder Grewal 8 years ago
parent
commit
7da8be7a35
  1. 3
      assets/scripts/atomicexplorer.js
  2. 65
      assets/scripts/dashboard.js
  3. 80
      assets/scripts/iguana_api.js
  4. 20
      index.html

3
assets/scripts/atomicexplorer.js

@ -125,6 +125,9 @@ var AtomicExplorer = function() {
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) {

65
assets/scripts/dashboard.js

@ -47,8 +47,25 @@ var Dashboard = function() {
$('#edexcoin_recieve').hide();
$('#edexcoin_recieve_section').hide();
$('#edexcoin_settings').hide();
getCoinBalance(active_edexcoin);
EdexfillTxHistory(active_edexcoin);
var selected_coinmode = sessionStorage.getItem('edexTmpMode')
if ( selected_coinmode == 'Basilisk' ) {
var coinwalletbalance = getDEXCoinBalance(active_edexcoin)
//console.log(coinwalletbalance.total)
coinwalletbalance = coinwalletbalance.total
$('#edex_total_balance').text(coinwalletbalance);
} else {
var tmp_get_coin_balance = EDEXlistunspent(active_edexcoin)
if (tmp_get_coin_balance[0] != undefined) {
//console.log(tmp_get_coin_balance[0])
$('#edex_total_balance').text(tmp_get_coin_balance[0].total);
//console.log(tmp_get_coin_balance[0].total)
} else {
$('#edex_total_balance').text('0');
}
}
//getCoinBalance(active_edexcoin);
//EdexfillTxHistory(active_edexcoin);
clearEdexSendFieldData();
});
}
@ -350,6 +367,30 @@ var Dashboard = function() {
});
}
var handleBasiliskWalletActions = function() {
$(".btn_edexcoin_dashboard_getnotaries").click(function() {
var selected_coin = $(this).data('edexcoin')
$( "#nav-iguana-atomic-explorer" ).trigger( "click" );
$('#atomic_explorer_select_coin_options option[value=' + selected_coin + ']').attr('selected','selected');
$('#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')
var coinmainaddr = EDEXMainAddr(selected_coin);
Iguana_DEXImportAddr(selected_coin,coinmainaddr[0]);
})
$(".btn_edexcoin_dashboard_validate").click(function() {
var selected_coin = $(this).data('edexcoin')
var coinmainaddr = EDEXMainAddr(selected_coin);
Iguana_DEXValidateAddr(selected_coin,coinmainaddr[0])
})
}
var handleEdexWalletInfo = function() {
//Get coin history and pupulate balance and other info to wallet widget
@ -428,6 +469,7 @@ var Dashboard = function() {
handleWalletWidgets();
handleWalletWidgetBtns();
handleEdexWalletInfo();
handleBasiliskWalletActions();
//TotalFiatValue();
}
@ -475,8 +517,17 @@ function edexCoinBtnAction() {
var selected_coinmode = $(this).data('edexcoinmodecode')
var selected_coinname = $(this).data('edexcoinname')
sessionStorage.setItem('edexTmpMode', selected_coinmode);
if ( selected_coinmode == 'Basilisk' ) { $('#edex-footer').hide(); StopShowCoinHistory(); sessionStorage.setItem('edexTmpRefresh', "stop"); }
if ( selected_coinmode == 'Full' ) { $('#edex-footer').show(); sessionStorage.setItem('edexTmpRefresh', "start");}
if ( selected_coinmode == 'Basilisk' ) {
$('#edex-footer').hide();
$('#btn_edexcoin_basilisk').show();
StopShowCoinHistory();
sessionStorage.setItem('edexTmpRefresh', "stop");
}
if ( selected_coinmode == 'Full' ) {
$('#edex-footer').show();
$('#btn_edexcoin_basilisk').hide();
sessionStorage.setItem('edexTmpRefresh', "start");
}
if ( selected_coinmode !== 'Native' ) {
$('#edexcoin_dashoard_section').show();
$('#header-dashboard').show();
@ -504,7 +555,7 @@ function edexCoinBtnAction() {
if ( selected_coinmode == 'Basilisk' ) {
var coinwalletbalance = getDEXCoinBalance(coincode)
console.log(coinwalletbalance.total)
//console.log(coinwalletbalance.total)
coinwalletbalance = coinwalletbalance.total
$('#edex_total_balance').text(coinwalletbalance);
} else {
@ -772,6 +823,10 @@ function getDEXCoinBalance(coin) {
//console.log('== getDEXCoinBalance Data OutPut ==');
//console.log(AjaxOutputData);
if (AjaxOutputData.error === 'less than required responses') {
toastr.error("Less than required responses. Please try again.", "Basilisk Notification")
}
var tmpcalcnum = 0;
$.each(AjaxOutputData, function(index) {
tmpcalcnum = tmpcalcnum + AjaxOutputData[index].amount;

80
assets/scripts/iguana_api.js

@ -840,6 +840,9 @@ function Iguana_DEXgetNotaries(coin) {
//console.log('== Data OutPut ==');
//console.log(AjaxOutputData);
result.push(AjaxOutputData);
if (AjaxOutputData.error === 'less than required responses') {
toastr.error("Less than required responses. Please try again.", "Basilisk Notification")
}
},
error: function(xhr, textStatus, error) {
@ -870,9 +873,21 @@ function Iguana_DEXImportAddr(coin,addr) {
//dataType: 'text',
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data);
//console.log('== Data OutPut ==');
//console.log(AjaxOutputData);
console.log('== Data OutPut ==');
console.log(AjaxOutputData);
if (AjaxOutputData.iswatchonly == true) {
toastr.success("Address Registered on Network", "Basilisk Notification")
}
if (AjaxOutputData.iswatchonly == false) {
toastr.success("Address Registeration failed. Please try again.", "Basilisk Notification")
}
if (AjaxOutputData.iswatchonly == undefined) {
toastr.error("Invalid query sent. Please try again.", "Basilisk Notification")
}
result.push(AjaxOutputData);
if (AjaxOutputData.error === 'less than required responses') {
toastr.error("Less than required responses. Please try again.", "Basilisk Notification")
}
},
error: function(xhr, textStatus, error) {
@ -900,15 +915,15 @@ function Iguana_DEXImportAll() {
//dataType: 'text',
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data);
console.log('== Iguana_DEXImportOnLogin Data OutPut ==');
console.log(AjaxOutputData['basilisk']);
//console.log('== Iguana_DEXImportOnLogin Data OutPut ==');
//console.log(AjaxOutputData['basilisk']);
$.each(AjaxOutputData['basilisk'], function(basilisk_index) {
console.log(AjaxOutputData['basilisk'][basilisk_index]);
//console.log(AjaxOutputData['basilisk'][basilisk_index]);
tmp_coinaddr = EDEXMainAddr(AjaxOutputData['basilisk'][basilisk_index])
console.log(tmp_coinaddr[index]);
//console.log(tmp_coinaddr[index]);
tmp_deximport_output = Iguana_DEXImportAddr(AjaxOutputData['basilisk'][basilisk_index], tmp_coinaddr[index])
console.log(tmp_deximport_output[0]);
//console.log(tmp_deximport_output[0]);
});
},
@ -942,6 +957,54 @@ function Iguana_DEXCheckAddr(coin,addr) {
//console.log('== Data OutPut ==');
//console.log(AjaxOutputData);
result.push(AjaxOutputData);
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);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
}
});
return result;
}
function Iguana_DEXValidateAddr(coin,addr) {
var result = [];
//Get parameters values from confirm dialog and send currency
var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth');
var ajax_data = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"validateaddress","address":addr,"symbol":coin};
console.log(ajax_data);
$.ajax({
async: false,
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:7778',
//dataType: 'text',
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data);
//console.log('== Data OutPut ==');
//console.log(AjaxOutputData);
if (AjaxOutputData.iswatchonly == true) {
toastr.success("Validation Success on Network", "Basilisk Notification")
}
if (AjaxOutputData.iswatchonly == false) {
toastr.info("Address isn't Registered on Network. Please Register", "Basilisk Notification")
}
if (AjaxOutputData.iswatchonly == undefined) {
toastr.error("Invalid query sent. Please try again.", "Basilisk Notification")
}
result.push(AjaxOutputData);
if (AjaxOutputData.error === 'less than required responses') {
toastr.error("Less than required responses. Please try again.", "Basilisk Notification")
}
},
error: function(xhr, textStatus, error) {
@ -982,6 +1045,9 @@ function EDEX_DEXlistunspent(coin,addr) {
result.push([{"amount":0}]);
}
result.push(AjaxOutputData);
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);

20
index.html

@ -183,7 +183,7 @@
<form class="login-form" method="post" action="javascript:;" autocomplete="off" onsubmit="return false;">
<div class="form-group form-material floating">
<input type="password" class="form-control" name="password" id="password">
<label class="floating-label" for="inputPassword">Passphrase</label>
<label class="floating-label" for="inputPassword">Wallet Seed</label>
</div>
<button type="submit" class="btn btn-primary btn-block" id="loginbtn">Sign in</button>
<div class="form-group form-material floating">
@ -724,12 +724,26 @@
<div class="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
<!-- Panel FixedHeader -->
<div class="panel">
<header class="panel-heading">
<header class="panel-heading" style="z-index: 10">
<div class="panel-actions">
<a href="javascript:void(0)" class="dropdown-toggle white btn-xs btn-info btn_refresh_edexcoin_dashboard" data-edexcoin="COIN" aria-expanded="false" role="button"><i class="icon fa-refresh margin-right-10" aria-hidden="true"></i> Refresh</a>
<div class="dropdown">
<a href="javascript:void(0)" class="dropdown-toggle white btn-xs btn-warning btn_refresh_edexcoin_dashboard" data-edexcoin="COIN" aria-expanded="false" role="button"><i class="icon fa-refresh margin-right-10" aria-hidden="true"></i> Refresh</a>
<a class="dropdown-toggle btn-xs btn-default" data-edexcoin="COIN" id="btn_edexcoin_basilisk" data-toggle="dropdown" href="javascript:void(0)"
aria-expanded="false" role="button" style="display: none;"><i class="icon fa-magic margin-right-10" aria-hidden="true"></i> Basilisk Actions <span class="caret"></span></a>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="btn_edexcoin_basilisk"
role="menu">
<li role="presentation"><a href="javascript:void(0)" class="btn_edexcoin_dashboard_getnotaries" data-edexcoin="COIN" id="btn_edexcoin_dashboard_getnotaries" role="menuitem"><i class="icon fa-sitemap" aria-hidden="true"></i> Get Notary Nodes List</a></li>
<li data-edexcoin="COIN" role="presentation"><a href="javascript:void(0)" class="btn_edexcoin_dashboard_register" data-edexcoin="COIN" id="btn_edexcoin_dashboard_register" role="menuitem"><i class="icon fa-sign-in" aria-hidden="true"></i> Register Address on Network</a></li>
<li data-edexcoin="COIN" role="presentation"><a href="javascript:void(0)" class="btn_edexcoin_dashboard_validate" data-edexcoin="COIN" id="btn_edexcoin_dashboard_validate" role="menuitem"><i class="icon fa-check" aria-hidden="true"></i> Validate Address on Network</a></li>
</ul>
</div>
</div>
<h3 class="panel-title">
Transactions History
</h3>

Loading…
Cancel
Save