Browse Source

Merge pull request #57 from pbca26/master

multilang update
master
Satinder Grewal 8 years ago
committed by GitHub
parent
commit
7b4ac0d0d9
  1. 6
      assets/scripts/atomicexplorer.js
  2. 43
      assets/scripts/coinwallets.js
  3. 550
      assets/scripts/dashboard.js
  4. 1376
      assets/scripts/iguana_api.js
  5. 81
      assets/scripts/kmd_wallet_dashboard.js
  6. 119
      assets/scripts/lang/en.js
  7. 79
      assets/scripts/login.js
  8. 12
      assets/scripts/sidebar.js
  9. 154
      assets/scripts/walletsettings.js
  10. 49
      index.html

6
assets/scripts/atomicexplorer.js

@ -11,7 +11,7 @@ var AtomicExplorer = function() {
'hideEasing': 'linear',
'showMethod': 'fadeIn',
'hideMethod': 'fadeOut'
}
};
var handleExplorer = function() {
$('#atomic_explorer_getcoinpeers_btn').click(function() {
@ -23,7 +23,7 @@ var AtomicExplorer = function() {
'</div>'
});
NProgress.start();
console.log("button pushed in atomic explorer");
console.log('button pushed in atomic explorer');
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(),
@ -326,7 +326,7 @@ var AtomicExplorer = function() {
}
if (ExplorerOutputData.error === 'less than required responses') {
toastr.error('Less than required responses. Please try again.', 'Basilisk Notification')
toastr.error(_lang[defaultLang].DASHBOARD.LESS_RESPONSES_REQ, _lang[defaultLang].DASHBOARD.BASILISC_NOTIFICATION)
}
NProgress.done();

43
assets/scripts/coinwallets.js

@ -46,6 +46,7 @@ function sendCurrency(val) {
'agent': 'bitcoinrpc',
'method': 'getinfo'
};
$.ajax({
type: 'POST',
data: JSON.stringify(getinfoValues),
@ -65,7 +66,6 @@ function sendCurrency(val) {
console.log(error);
}
});
}
function ReceiveCurrency(rec_val) {
@ -87,12 +87,12 @@ function ReceiveCurrency(rec_val) {
}
var clipboard = new Clipboard('.btn');
clipboard.on('success', function(e) {
console.log(e);
});
clipboard.on('error', function(e) {
console.log(e);
});
clipboard.on('success', function(e) {
console.log(e);
});
clipboard.on('error', function(e) {
console.log(e);
});
}
$('#mdl_currency_amount').keyup(function() {
@ -115,7 +115,7 @@ $('#mdl_currency_amount').keyup(function() {
//console.log($('#mdl_currency_amount').val());
//console.log(total_of_currency_fiat);
$('#mdl_currency_total_value').text(total_of_currency_fee.toFixed(8));
$('#mdl_currency_total_fiat_value').text(fiat_symbol+total_of_currency_fiat.toFixed(2));
$('#mdl_currency_total_fiat_value').text(fiat_symbol + total_of_currency_fiat.toFixed(2));
if ($('#mdl_currency_amount').val() != '' && $('#mdl_currency_sendto') != '' && $('#mdl_currency_fee') != '' ) {
mdl_send_btn.removeClass('disabled');
@ -225,17 +225,16 @@ function ExecuteSendCurrencyAPI() {
console.log('== Data OutPut ==');
console.log(SendToAddrData);
if ( SendToAddrData.error != 'couldnt create rawtx' ) {
SendToAddrTxDataTitle = 'Transaction Failed';
SendToAddrTxDataTitle = _lang[defaultLang].COIN_WALLETS.TX_FAILED;
}
if ( SendToAddrData.sendrawtransaction == 'success' ) {
SendToAddrTxDataTitle = 'Transaction Successful';
SendToAddrTxDataTitle = _lang[defaultLang].COIN_WALLETS.TX_SUCCESS;
}
var SentToAddrTxData = '<font style="font-size: 13px; font-family: Menlo,Monaco,Consolas,Courier New,monospace">' +
'<font style="font-weight: 800">' +
'<b>Transaction ID:</b>'
'<b>' + _lang[defaultLang].COIN_WALLETS.TX + ' ID:</b>'
'</font>' +
SendToAddrData.result +
'</font>';
@ -245,7 +244,7 @@ function ExecuteSendCurrencyAPI() {
});
if ( SendToAddrData.sendrawtransaction == 'success' ) {
toastr.success('Transaction Sent', 'Transaction Notification')
toastr.success(_lang[defaultLang].TOASTR.TX_SENT, _lang[defaultLang].TOASTR.TX_NOTIFICATION);
}
},
error: function(xhr, textStatus, error) {
@ -253,7 +252,7 @@ function ExecuteSendCurrencyAPI() {
console.log(xhr.statusText);
console.log(textStatus);
console.log(error);
toastr.error('Unable to complete transaction', 'Transaction Notification')
toastr.error(_lang[defaultLang].TOASTR.TX_SEND_ERR, _lang[defaultLang].TOASTR.TX_NOTIFICATION);
}
});
@ -288,14 +287,14 @@ function WalletFiatCurrency(fiat_currency_value) {
function Iguana_rmd160conv(rmd160conv_data) {
// comment
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'SuperNET',
'method': 'rmd160conv',
'rmd160': rmd160conv_data.rmd160,
'coin': rmd160conv_data.coin
};
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'SuperNET',
'method': 'rmd160conv',
'rmd160': rmd160conv_data.rmd160,
'coin': rmd160conv_data.coin
};
console.log(ajax_data);
$.ajax({

550
assets/scripts/dashboard.js

@ -154,12 +154,11 @@ var Dashboard = function() {
edexcoin_addr_list_with_balance = result
console.log(edexcoin_addr_list_with_balance);
var tmpoptions = '';
tmpoptions += '<option> <span data-lang="DASHBOARD.SELECT_ADDRESS"></span> </option>';
tmpoptions += '<option> ' + _lang[defaultLang].DASHBOARD.SELECT_ADDRESS +' </option>';
$.each(edexcoin_addr_list_with_balance, function(index) {
tmpoptions += '<option value="' + edexcoin_addr_list_with_balance[index].addr + '" data-total="' + edexcoin_addr_list_with_balance[index].total + '">[ ' + edexcoin_addr_list_with_balance[index].total + ' KMD ] &emsp;' + edexcoin_addr_list_with_balance[index].addr + '</option>';
$('#edexcoin_send_from').html(tmpoptions);
});
lang();
$('.showedexcoinaddrs').selectpicker({ style: 'btn-info' });
$('.showedexcoinaddrs').selectpicker('refresh');
@ -188,7 +187,7 @@ var Dashboard = function() {
});
$('#edexcoin_send_from').change(function() {
if ($('#edexcoin_send_from').val() !== '' || $('#edexcoin_send_from').val() !== '- Select Address -') {
if ($('#edexcoin_send_from').val() !== '' || $('#edexcoin_send_from').val() !== _lang[defaultLang].DASHBOARD.SELECT_ADDRESS) {
$('.edexcoin_send_coins_btn_step1').removeClass('disabled');
$('.edexcoin_send_coins_btn_step1').prop('disabled', false);
@ -201,16 +200,20 @@ var Dashboard = function() {
if (!('refresh' in query[active_edexcoin][coin_addr])) {
console.log(active_edexcoin + '>>>' + coin_addr + ' => refresh not found.')
var call_data = {"allcoins": false,"coin":active_edexcoin,"calls":"refresh"}
Shepherd_FetchBasiliskData(call_data).then(function(result){
console.log(result)
})
var call_data = {
'allcoins': false,
'coin': active_edexcoin,
'calls': 'refresh'
};
Shepherd_FetchBasiliskData(call_data).then(function(result) {
console.log(result);
});
} else {
console.log(query[active_edexcoin][coin_addr].refresh.status)
console.log(query[active_edexcoin][coin_addr].refresh.status);
}
})
}
if ($('#edexcoin_send_from').val() === '' || $('#edexcoin_send_from').val() === '- Select Address -') {
if ($('#edexcoin_send_from').val() === '' || $('#edexcoin_send_from').val() === _lang[defaultLang].DASHBOARD.SELECT_ADDRESS) {
$('.edexcoin_send_coins_btn_step1').addClass(' disabled');
$('.edexcoin_send_coins_btn_step1').prop('disabled', true);
}
@ -233,8 +236,6 @@ var Dashboard = function() {
//console.log($('#edexcoin_amount').val());
$('#edexcoin_total_value').text(total_minus_currency_fee.toFixed(8));
});
edexcoin_send_form_validator = $('.edexcoin-send-form').validate({
@ -261,19 +262,19 @@ var Dashboard = function() {
messages: {
edexcoin_send_from: {
required: 'From Address is required.'
required: _lang[defaultLang].DASHBOARD.SEND_FROMADDR_REQ
},
edexcoin_sendto: {
required: 'To Address is required.'
required: _lang[defaultLang].DASHBOARD.SEND_TOADDR_REQ
},
edexcoin_amount: {
required: 'Please enter amount to send.'
required: _lang[defaultLang].DASHBOARD.SEND_AMOUNT_REQ
},
edexcoin_fee: {
required: 'Make sure you have fee entered. Default value is 0.0001.'
required: _lang[defaultLang].DASHBOARD.SEND_FEE_REQ + ' 0.0001.'
},
edexcoin_total_value: {
required: 'Make sure you have both amount and fee entered to calculate final total.'
required: _lang[defaultLang].DASHBOARD.SEND_TOTAL_REQ
}
},
@ -318,6 +319,7 @@ var Dashboard = function() {
tmp_send_from_addr = $('#edexcoin_send_from').val()
tmp_send_to_addr = $('#edexcoin_sendto').val(),
tmp_send_total_amount = $('#edexcoin_total_value').text();
$('#edexcoin-send-screen').hide();
$('#edexcoin-send-confirm-screen').show();
$('#edexcoin_send_step_1').removeClass( 'current' ).addClass( '' );
@ -334,9 +336,10 @@ var Dashboard = function() {
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin'),
tmp_send_from_addr = $('#edexcoin_send_from').val()
tmp_send_to_addr = $('#edexcoin_sendto').val(),
tmp_send_total_amount = $('#edexcoin_total_value').text();
tmp_send_fee = $('#edexcoin_fee').val()
tmp_sendflag = $('#edexcoin_send_sig').is(":checked")
tmp_send_total_amount = $('#edexcoin_total_value').text(),
tmp_send_fee = $('#edexcoin_fee').val(),
tmp_sendflag = $('#edexcoin_send_sig').is(":checked");
console.log(active_edexcoin);
console.log(tmp_send_from_addr);
console.log(tmp_send_to_addr);
@ -346,8 +349,8 @@ var Dashboard = function() {
var edexcoin_sendto_result_tbl = '';
edexcoin_sendto_result_tbl += '<tr class="info">' +
'<td>Info</td>' +
'<td>The transaction submitted is processing. Once processed the transaction details will be displayed here.</td>' +
'<td>' + _lang[defaultLang].INDEX.INFO + '</td>' +
'<td>' + _lang[defaultLang].DASHBOARD.SEND_TX_PROGRESS + '</td>' +
'</tr>';
$('#edexcoin_sendto_result tbody').html(edexcoin_sendto_result_tbl);
$('#edexcoin_send_coins_anothertx_btn').hide();
@ -445,7 +448,7 @@ var Dashboard = function() {
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin');
console.log('get new T address button clicked...');
EdexListAllAddr(active_edexcoin);
toastr.info('Receiving Address list updated', 'Wallet Notification');
toastr.info(_lang[defaultLang].TOASTR.RECADDR_UPDATED, _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
});
};
@ -612,8 +615,8 @@ var Dashboard = function() {
walletDivContent += '<!-- End Wallet Widget ' + AllcoinsDataOutput[value][index] + ' -->';
$('.wallet-widgets-row').html(walletDivContent);
$('.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.
$('.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.
edexCoinBtnAction();
});
},
@ -626,7 +629,7 @@ var Dashboard = function() {
console.log(textStatus);
console.log(error);
if (xhr.readyState == '0' ) {
toastr.error('Unable to connect to Iguana', 'Account Notification');
toastr.error(_lang[defaultLang].TOASTR.IGUANA_CONN_ERR, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
}
}
});
@ -694,17 +697,21 @@ var Dashboard = function() {
$('.btn_edexcoin_dashboard_fetchdata').click(function() {
var selected_coin = $(this).data('edexcoin');
Shepherd_CheckBasiliskCacheData(selected_coin).then(function(result){
console.log(result)
console.log(result.coin)
var call_data = {"allcoins": false,"coin":selected_coin,"calls":"listtransactions:getbalance"}
console.log(call_data)
Shepherd_CheckBasiliskCacheData(selected_coin).then(function(result) {
console.log(result);
console.log(result.coin);
var call_data = {
'allcoins': false,
'coin': selected_coin,
'calls': 'listtransactions:getbalance'
};
console.log(call_data);
Shepherd_FetchBasiliskData(call_data).then(function(result){
console.log(result)
toastr.info('Fetching Data. Please wait for a minute to complete this task.', 'Basilisk Notification');
})
})
Shepherd_FetchBasiliskData(call_data).then(function(result) {
console.log(result);
toastr.info(_lang[defaultLang].TOASTR.FETCHING_DATA, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION);
});
});
});
$('.btn_edexcoin_dashboard_refresh_basilisk_conn').click(function() {
@ -789,19 +796,23 @@ var Dashboard = function() {
var FetchBasiliskData = setInterval(function() {
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin'),
active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode');
active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode');
// TODO: refactor
if ( sessionStorage.getItem('IguanaActiveAccount') === null ) {
//clearInterval(FetchBasiliskData);
//console.log('=> No wallet logged in, or Dashboard not ative. No need to Run History.');
} else {
if ( active_edexcoinmodecode == 'Basilisk') {
var call_data = {"allcoins": false,"coin":active_edexcoin,"calls":"listtransactions:getbalance"}
var call_data = {
'allcoins': false,
'coin': active_edexcoin,
'calls': 'listtransactions:getbalance'
};
//console.log(call_data)
if ( sessionStorage.getItem('edexTmpRefresh') === null || sessionStorage.getItem('edexTmpRefresh') === 'start') {
Shepherd_FetchBasiliskData(call_data).then(function(result){
console.log(result)
})
Shepherd_FetchBasiliskData(call_data).then(function(result) {
console.log(result);
});
}
}
}
@ -1381,7 +1392,7 @@ function getDEXGetBalance2(coin) {
ajax_call_2.done(function(data) {
console.log(data);
if (data.error === 'less than required responses') {
toastr.error('Less than required responses. Please try again.', 'Basilisk Notification');
toastr.error(_lang[defaultLang].TOASTR.LESS_RESPONSES_REQ, _lang[defaultLang].BASILISK_NOTIFICATION);
}
var tmpcalcnum = 0,
@ -1673,7 +1684,7 @@ function refreshEDEXCoinWalletList() {
console.log(error);
if (xhr.readyState == '0' ) {
toastr.error('Unable to connect to Iguana', 'Account Notification');
toastr.error(_lang[defaultLang].TOASTR.IGUANA_CONN_ERR, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
}
}
});
@ -1723,7 +1734,7 @@ function SwitchBasicliskFull(switch_data) {
if (SwitchCoinDataOutput.result === 'coin added') {
console.log('coin added');
toastr.success(switch_data.currency + ' switched to ' + mode_value + ' Mode', 'Coin Notification');
toastr.success(switch_data.currency + ' ' + _lang[defaultLang].TOASTR.SWITCHED_TO + ' ' + mode_value + ' ' + _lang[defaultLang].TOASTR.MODE, _lang[defaultLang].TOASTR.COIN_NOTIFICATION);
} else if (SwitchCoinDataOutput.result === 'coin already there') {
console.log('coin already there');
//toastr.info("Looks like" + switch_data.currency + "already running.", "Coin Notification");
@ -1741,7 +1752,7 @@ function SwitchBasicliskFull(switch_data) {
console.log(textStatus);
console.log(error);
if (xhr.readyState == '0' ) {
toastr.error('Unable to connect to Iguana', 'Account Notification');
toastr.error(_lang[defaultLang].TOASTR.IGUANA_CONN_ERR, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
}
}
});
@ -2015,12 +2026,12 @@ function EdexGetTxList(coin) {
tmp_amount = result_data[index].amount;
if (!('amount' in result_data[index])) {
tmp_amount = '<span class="label label-dark">Unknown</span>';
tmp_amount = '<span class="label label-dark">' + _lang[defaultLang].DASHBOARD.UNKNOWN + '</span>';
}
var tmp_addr = result_data[index].address;
if (!('address' in result_data[index])) {
tmp_addr = '<i class="icon fa-bullseye"></i> <span class="label label-dark">Z Address not listed by wallet!</span>';
tmp_addr = '<i class="icon fa-bullseye"></i> <span class="label label-dark">' + _lang[defaultLang].DASHBOARD.ZADDR_NOT_LISTED + '!</span>';
}
var tmp_secondsToString = secondsToString(result_data[index].blocktime);
@ -2071,12 +2082,12 @@ function EdexGetTxList(coin) {
tmp_amount = result_data[index].amount;
if (!('amount' in result_data[index])) {
tmp_amount = '<span class="label label-dark">Unknown</span>';
tmp_amount = '<span class="label label-dark">' + _lang[defaultLang].DASHBOARD.UNKNOWN + '</span>';
}
var tmp_addr = null
if (!('paid' in result_data[index])) {
tmp_addr = '<i class="icon fa-bullseye"></i> <span class="label label-dark">Z Address not listed by wallet!</span>';
tmp_addr = '<i class="icon fa-bullseye"></i> <span class="label label-dark">' + _lang[defaultLang].DASHBOARD.ZADDR_NOT_LISTED + '!</span>';
}
if (('paid' in result_data[index])) {
var first_addr = Object.keys(result_data[index].paid['vouts'][0]),
@ -2086,23 +2097,23 @@ function EdexGetTxList(coin) {
var tmp_secondsToString = secondsToString(result_data[index].timestamp);
if ( result_data[index].type == 'sent' ) {
tmp_category = '<span class="label label-danger"><i class="icon fa-arrow-circle-left"></i> OUT</span>';
tmp_category = '<span class="label label-danger"><i class="icon fa-arrow-circle-left"></i> ' + _lang[defaultLang].DASHBOARD.OUT + '</span>';
}
if ( result_data[index].type == 'received' ) {
tmp_category = '<span class="label label-success"><i class="icon fa-arrow-circle-right"></i> IN</span>';
tmp_category = '<span class="label label-success"><i class="icon fa-arrow-circle-right"></i> ' + _lang[defaultLang].DASHBOARD.IN + '</span>';
}
if ( result_data[index].type == 'generate' ) {
tmp_category = '<i class="icon fa-cogs"></i> Mined';
tmp_category = '<i class="icon fa-cogs"></i> ' + _lang[defaultLang].DASHBOARD.MINED;
}
if ( result_data[index].type == 'immature' ) {
tmp_category = '<i class="icon fa-clock-o"></i> Immature';
tmp_category = '<i class="icon fa-clock-o"></i> ' + _lang[defaultLang].DASHBOARD.IMMATURE;
}
if ( result_data[index].type == 'unknown' ) {
tmp_category = '<i class="icon fa-meh-o"></i> Unknown';
tmp_category = '<i class="icon fa-meh-o"></i> ' + _lang[defaultLang].DASHBOARD.UNKNOWN;
}
if (!('confirmations' in result_data[index])) {
tmp_confirms = '<i class="icon fa-meh-o"></i> Unknown';
tmp_confirms = '<i class="icon fa-meh-o"></i> ' + _lang[defaultLang].DASHBOARD.UNKNOWN;
}
if (('confirmations' in result_data[index])) {
tmp_confirms = result_data[index].confirmations;
@ -2114,7 +2125,7 @@ function EdexGetTxList(coin) {
tmp_amount,
tmp_secondsToString,
tmp_addr,
'<button type="button" class="btn btn-xs white btn-info waves-effect waves-light kmd-txid-details-btn" data-edexcoin="' + coin + '" data-txidtype="public" data-txid="'+result_data[index].txid+'">' +
'<button type="button" class="btn btn-xs white btn-info waves-effect waves-light kmd-txid-details-btn" data-edexcoin="' + coin + '" data-txidtype="public" data-txid="' + result_data[index].txid + '">' +
'<i class="icon fa-search"></i>' +
'</button>'
];
@ -2163,12 +2174,12 @@ function EdexGetTxList_cache(coin) {
tmp_amount = result_data[index].amount;
if (!('amount' in result_data[index])) {
tmp_amount = '<span class="label label-dark">Unknown</span>';
tmp_amount = '<span class="label label-dark">' + _lang[defaultLang].DASHBOARD.UNKNOWN + '</span>';
}
var tmp_addr = null
if (!('paid' in result_data[index])) {
tmp_addr = '<i class="icon fa-bullseye"></i> <span class="label label-dark">Z Address not listed by wallet!</span>';
tmp_addr = '<i class="icon fa-bullseye"></i> <span class="label label-dark">' + _lang[defaultLang].DASHBOARD.ZADDR_NOT_LISTED + '!</span>';
}
if (('paid' in result_data[index])) {
var first_addr = Object.keys(result_data[index].paid['vouts'][0]),
@ -2178,23 +2189,23 @@ function EdexGetTxList_cache(coin) {
var tmp_secondsToString = secondsToString(result_data[index].timestamp);
if ( result_data[index].type == 'sent' ) {
tmp_category = '<span class="label label-danger"><i class="icon fa-arrow-circle-left"></i> OUT</span>';
tmp_category = '<span class="label label-danger"><i class="icon fa-arrow-circle-left"></i> ' + _lang[defaultLang].DASHBOARD.OUT + '</span>';
}
if ( result_data[index].type == 'received' ) {
tmp_category = '<span class="label label-success"><i class="icon fa-arrow-circle-right"></i> IN</span>';
tmp_category = '<span class="label label-success"><i class="icon fa-arrow-circle-right"></i> ' + _lang[defaultLang].DASHBOARD.IN + '</span>';
}
if ( result_data[index].type == 'generate' ) {
tmp_category = '<i class="icon fa-cogs"></i> Mined';
tmp_category = '<i class="icon fa-cogs"></i> ' + _lang[defaultLang].DASHBOARD.MINED;
}
if ( result_data[index].type == 'immature' ) {
tmp_category = '<i class="icon fa-clock-o"></i> Immature';
tmp_category = '<i class="icon fa-clock-o"></i> ' + _lang[defaultLang].DASHBOARD.IMMATURE;
}
if ( result_data[index].type == 'unknown' ) {
tmp_category = '<i class="icon fa-meh-o"></i> Unknown';
tmp_category = '<i class="icon fa-meh-o"></i> ' + _lang[defaultLang].DASHBOARD.UNKNOWN;
}
if (!('confirmations' in result_data[index])) {
tmp_confirms = '<i class="icon fa-meh-o"></i> Unknown';
tmp_confirms = '<i class="icon fa-meh-o"></i> ' + _lang[defaultLang].DASHBOARD.UNKNOWN;
}
if (('confirmations' in result_data[index])) {
tmp_confirms = result_data[index].confirmations;
@ -2565,196 +2576,227 @@ function EdexListAllAddr(coin) {
}
function ShowBasiliskFetchDataProgress(coin) {
var active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode')
Shepherd_GetBasiliskCache().then(function(result){
var _data = JSON.parse(result)
var query = _data.result.basilisk
coin_exists = true
addresses_exists = true
getbalance_exists = true
listtransactions_exists = true
listunspent_exists = true
refresh_exists = true
getbalance_status = 'NOT FOUND'
listtransactions_status = 'NOT FOUND'
listunspent_status = 'NOT FOUND'
refresh_status = 'NOT FOUND'
//console.log(query)
if (!query) {
//console.log('data not found.')
res_data = {"coin":false, "addresses":false, "getbalance": false,"listtransactions": false,"listunspent": false,"refresh": false}
//console.log(res_data)
} else if (!query[coin]) {
//console.log(coin + ' not found.')
coin_exists = false
res_data = {"coin":coin_exists, "addresses":false, "getbalance": false,"listtransactions": false,"listunspent": false,"refresh": false}
//console.log(res_data)
} else if (!('addresses' in query[coin])) {
//console.log(coin + ' addresses not found.')
addresses_exists = false
res_data = {"coin":coin_exists, "addresses":false, "getbalance": false,"listtransactions": false,"listunspent": false,"refresh": false}
//console.log(res_data)
} else {
Promise.all(query[coin].addresses.map((coinaddr_value,coinaddr_index) => {
return new Promise((resolve, reject) => {
//console.log(coinaddr_index)
//console.log(coinaddr_value)
var data = query[coin][coinaddr_value].getbalance
//console.log(data)
if (!('getbalance' in query[coin][coinaddr_value])) {
//console.log(coin + '>>>' + coinaddr_value + ' => getbalance not found.')
getbalance_exists = false
} else {
//console.log(query[coin][coinaddr_value].getbalance.status)
getbalance_status = query[coin][coinaddr_value].getbalance.status
}
if (!('listtransactions' in query[coin][coinaddr_value])) {
//console.log(coin + '>>>' + coinaddr_value + ' => listtransactions not found.')
listtransactions_exists = false
} else {
//console.log(query[coin][coinaddr_value].listtransactions.status)
listtransactions_status = query[coin][coinaddr_value].listtransactions.status
}
if (!('listunspent' in query[coin][coinaddr_value])) {
//console.log(coin + '>>>' + coinaddr_value + ' => listunspent not found.')
listunspent_exists = false
} else {
//console.log(query[coin][coinaddr_value].listunspent.status)
listunspent_status = query[coin][coinaddr_value].listunspent.status
}
if (!('refresh' in query[coin][coinaddr_value])) {
//console.log(coin + '>>>' + coinaddr_value + ' => refresh not found.')
refresh_exists = false
} else {
//console.log(query[coin][coinaddr_value].refresh.status)
refresh_status = query[coin][coinaddr_value].refresh.status
}
pass_data = {
"addr_index":coinaddr_index,
"addr_value":coinaddr_value,
"getbalance": getbalance_exists,
"getbalance_status": getbalance_status,
"listtransactions": listtransactions_exists,
"listtransactions_status": listtransactions_status,
"listunspent": listunspent_exists,
"listunspent_status": listunspent_status,
"refresh": refresh_exists,
"refresh_status": refresh_status
}
resolve(pass_data)
})
})).then(result => {
//console.log(result)
//var res_data.coin = coin_exists
//var res_data.addresses = addresses_exists
var BasiliskFetchData = ''
$.each(result, function(result_index, result_val) {
//console.log(result_index)
//console.log(result_val)
var tmp_listunspent_lable_color = ''
var tmp_listtransactions_lable_color = ''
var tmp_getbalance_lable_color = ''
var tmp_refresh_lable_color = ''
switch (result_val.listunspent_status) {
case 'waiting':
tmp_listunspent_lable_color = 'dark'
break;
case 'in progress':
tmp_listunspent_lable_color = 'primary'
break;
case 'done':
tmp_listunspent_lable_color = 'success'
break;
case 'NOT FOUND':
tmp_listunspent_lable_color = 'danger'
break;
}
switch (result_val.listtransactions_status) {
case 'waiting':
tmp_listtransactions_lable_color = 'dark'
$('#edexcoin_dashboard_basilisk_refresh_status').show()
break;
case 'in progress':
tmp_listtransactions_lable_color = 'primary'
$('#edexcoin_dashboard_basilisk_refresh_status').show()
break;
case 'done':
tmp_listtransactions_lable_color = 'success'
$('#edexcoin_dashboard_basilisk_refresh_status').hide()
break;
case 'NOT FOUND':
tmp_listtransactions_lable_color = 'danger'
$('#edexcoin_dashboard_basilisk_refresh_status').show()
break;
}
switch (result_val.getbalance_status) {
case 'waiting':
tmp_getbalance_lable_color = 'dark'
$('#edexcoin_dashboard_basilisk_refresh_status').show()
break;
case 'in progress':
tmp_getbalance_lable_color = 'primary'
$('#edexcoin_dashboard_basilisk_refresh_status').show()
break;
case 'done':
tmp_getbalance_lable_color = 'success'
$('#edexcoin_dashboard_basilisk_refresh_status').hide()
break;
case 'NOT FOUND':
tmp_getbalance_lable_color = 'danger'
$('#edexcoin_dashboard_basilisk_refresh_status').show()
break;
}
switch (result_val.refresh_status) {
case 'waiting':
tmp_refresh_lable_color = 'dark'
$('#edexcoin_dashboard_basilisk_refresh_status').show()
break;
case 'in progress':
tmp_refresh_lable_color = 'primary'
$('#edexcoin_dashboard_basilisk_refresh_status').show()
break;
case 'done':
tmp_refresh_lable_color = 'success'
$('#edexcoin_dashboard_basilisk_refresh_status').hide()
break;
case 'NOT FOUND':
tmp_refresh_lable_color = 'danger'
//$('#edexcoin_dashboard_basilisk_refresh_status').show()
break;
}
BasiliskFetchData += '<tr>';
BasiliskFetchData += '<td>'+ result_val.addr_value.substring(0,5) +'...</td>';
BasiliskFetchData += '<td><span class="label label-'+tmp_listunspent_lable_color+' text-uppercase">'+result_val.listunspent_status+'</span></td>';
BasiliskFetchData += '<td><span class="label label-'+tmp_listtransactions_lable_color+' text-uppercase">'+result_val.listtransactions_status+'</span></td>';
BasiliskFetchData += '<td><span class="label label-'+tmp_getbalance_lable_color+' text-uppercase">'+result_val.getbalance_status+'</span></td>';
BasiliskFetchData += '<td><span class="label label-'+tmp_refresh_lable_color+' text-uppercase">'+result_val.refresh_status+'</span></td>';
BasiliskFetchData += '</tr>';
$('.tbl_edexcoin_dashboard_basilisk_refresh_status tbody').html(BasiliskFetchData);
//console.log(result_val.refresh_status)
/*if (result[result.length-1] == result_val && result_val.listtransactions_status !== 'done' && result_val.getbalance_status !== 'done' && result_val.refresh_status !== 'done' ) {
$('#edexcoin_dashboard_basilisk_refresh_status').show()
} else {
$('#edexcoin_dashboard_basilisk_refresh_status').hide()
}*/
})
})
}
var active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode');
Shepherd_GetBasiliskCache().then(function(result) {
var _data = JSON.parse(result),
query = _data.result.basilisk,
coin_exists = true,
addresses_exists = true,
getbalance_exists = true,
listtransactions_exists = true,
listunspent_exists = true,
refresh_exists = true,
getbalance_status = 'NOT FOUND',
listtransactions_status = 'NOT FOUND',
listunspent_status = 'NOT FOUND',
refresh_status = 'NOT FOUND',
res_data;
//console.log(query)
if (!query) {
//console.log('data not found.')
res_data = {
'coin': false,
'addresses': false,
'getbalance': false,
'listtransactions': false,
'listunspent': false,
'refresh': false
};
//console.log(res_data)
} else if (!query[coin]) {
//console.log(coin + ' not found.')
coin_exists = false;
res_data = {
'coin': coin_exists,
'addresses': false,
'getbalance': false,
'listtransactions': false,
'listunspent': false,
'refresh': false
};
//console.log(res_data)
} else if (!('addresses' in query[coin])) {
//console.log(coin + ' addresses not found.')
addresses_exists = false;
res_data = {
'coin': coin_exists,
'addresses': false,
'getbalance': false,
'listtransactions': false,
'listunspent': false,
'refresh': false
};
//console.log(res_data)
} else {
Promise.all(query[coin].addresses.map((coinaddr_value,coinaddr_index) => {
return new Promise((resolve, reject) => {
//console.log(coinaddr_index)
//console.log(coinaddr_value)
var data = query[coin][coinaddr_value].getbalance;
//console.log(data)
if (!('getbalance' in query[coin][coinaddr_value])) {
//console.log(coin + '>>>' + coinaddr_value + ' => getbalance not found.')
getbalance_exists = false;
} else {
//console.log(query[coin][coinaddr_value].getbalance.status)
getbalance_status = query[coin][coinaddr_value].getbalance.status;
}
if (!('listtransactions' in query[coin][coinaddr_value])) {
//console.log(coin + '>>>' + coinaddr_value + ' => listtransactions not found.')
listtransactions_exists = false;
} else {
//console.log(query[coin][coinaddr_value].listtransactions.status)
listtransactions_status = query[coin][coinaddr_value].listtransactions.status;
}
if (!('listunspent' in query[coin][coinaddr_value])) {
//console.log(coin + '>>>' + coinaddr_value + ' => listunspent not found.')
listunspent_exists = false;
} else {
//console.log(query[coin][coinaddr_value].listunspent.status)
listunspent_status = query[coin][coinaddr_value].listunspent.status;
}
if (!('refresh' in query[coin][coinaddr_value])) {
//console.log(coin + '>>>' + coinaddr_value + ' => refresh not found.')
refresh_exists = false;
} else {
//console.log(query[coin][coinaddr_value].refresh.status)
refresh_status = query[coin][coinaddr_value].refresh.status;
}
pass_data = {
'addr_index': coinaddr_index,
'addr_value': coinaddr_value,
'getbalance': getbalance_exists,
'getbalance_status': getbalance_status,
'listtransactions': listtransactions_exists,
'listtransactions_status': listtransactions_status,
'listunspent': listunspent_exists,
'listunspent_status': listunspent_status,
'refresh': refresh_exists,
'refresh_status': refresh_status
};
resolve(pass_data);
});
}))
.then(result => {
//console.log(result);
//var res_data.coin = coin_exists;
//var res_data.addresses = addresses_exists;
var BasiliskFetchData = '';
$.each(result, function(result_index, result_val) {
//console.log(result_index);
//console.log(result_val);
var tmp_listunspent_lable_color = '',
tmp_listtransactions_lable_color = '',
tmp_getbalance_lable_color = '',
tmp_refresh_lable_color = '';
switch (result_val.listunspent_status) {
case 'waiting':
tmp_listunspent_lable_color = 'dark';
break;
case 'in progress':
tmp_listunspent_lable_color = 'primary';
break;
case 'done':
tmp_listunspent_lable_color = 'success';
break;
case 'NOT FOUND':
tmp_listunspent_lable_color = 'danger';
break;
}
switch (result_val.listtransactions_status) {
case 'waiting':
tmp_listtransactions_lable_color = 'dark';
$('#edexcoin_dashboard_basilisk_refresh_status').show();
break;
case 'in progress':
tmp_listtransactions_lable_color = 'primary';
$('#edexcoin_dashboard_basilisk_refresh_status').show();
break;
case 'done':
tmp_listtransactions_lable_color = 'success';
$('#edexcoin_dashboard_basilisk_refresh_status').hide();
break;
case 'NOT FOUND':
tmp_listtransactions_lable_color = 'danger';
$('#edexcoin_dashboard_basilisk_refresh_status').show();
break;
}
switch (result_val.getbalance_status) {
case 'waiting':
tmp_getbalance_lable_color = 'dark';
$('#edexcoin_dashboard_basilisk_refresh_status').show();
break;
case 'in progress':
tmp_getbalance_lable_color = 'primary';
$('#edexcoin_dashboard_basilisk_refresh_status').show();
break;
case 'done':
tmp_getbalance_lable_color = 'success';
$('#edexcoin_dashboard_basilisk_refresh_status').hide();
break;
case 'NOT FOUND':
tmp_getbalance_lable_color = 'danger';
$('#edexcoin_dashboard_basilisk_refresh_status').show();
break;
}
switch (result_val.refresh_status) {
case 'waiting':
tmp_refresh_lable_color = 'dark';
$('#edexcoin_dashboard_basilisk_refresh_status').show();
break;
case 'in progress':
tmp_refresh_lable_color = 'primary';
$('#edexcoin_dashboard_basilisk_refresh_status').show();
break;
case 'done':
tmp_refresh_lable_color = 'success';
$('#edexcoin_dashboard_basilisk_refresh_status').hide();
break;
case 'NOT FOUND':
tmp_refresh_lable_color = 'danger';
//$('#edexcoin_dashboard_basilisk_refresh_status').show();
break;
}
BasiliskFetchData += '<tr>';
BasiliskFetchData += '<td>' + result_val.addr_value.substring(0,5) + '...</td>';
BasiliskFetchData += '<td>' +
'<span class="label label-' + tmp_listunspent_lable_color + ' text-uppercase">' + result_val.listunspent_status + '</span>' +
'</td>';
BasiliskFetchData += '<td>' +
'<span class="label label-' + tmp_listtransactions_lable_color + ' text-uppercase">' + result_val.listtransactions_status + '</span>' +
'</td>';
BasiliskFetchData += '<td>' +
'<span class="label label-' + tmp_getbalance_lable_color + ' text-uppercase">' + result_val.getbalance_status + '</span>' +
'</td>';
BasiliskFetchData += '<td>' +
'<span class="label label-' + tmp_refresh_lable_color + ' text-uppercase">' + result_val.refresh_status + '</span>' +
'</td>';
BasiliskFetchData += '</tr>';
$('.tbl_edexcoin_dashboard_basilisk_refresh_status tbody').html(BasiliskFetchData);
//console.log(result_val.refresh_status)
/*if (result[result.length-1] == result_val && result_val.listtransactions_status !== 'done' && result_val.getbalance_status !== 'done' && result_val.refresh_status !== 'done' ) {
$('#edexcoin_dashboard_basilisk_refresh_status').show()
} else {
$('#edexcoin_dashboard_basilisk_refresh_status').hide()
}*/
});
});
}
});
}

1376
assets/scripts/iguana_api.js

File diff suppressed because it is too large

81
assets/scripts/kmd_wallet_dashboard.js

@ -42,7 +42,6 @@ var KMDWalletDashboard = function() {
$('#kmd_txid_info_hex').val(kmd_addr_txid_info[0].hex);
clearSendManyFieldData();
});
}
var handle_KMD_Send = function() {
@ -61,7 +60,7 @@ var KMDWalletDashboard = function() {
var kmd_addr_list_with_balance = KMDlistunspentT();
tmpoptions += '<option> - Select Transparent or Private Address - </option>';
tmpoptions += '<option> - ' + _lang[defaultLang].KMD_NATIVE.SELECT_ADDRESS + ' - </option>';
$.each(kmd_addr_list_with_balance, function(index) {
tmpoptions += '<option value="' + kmd_addr_list_with_balance[index].addr + '" data-total="' + kmd_addr_list_with_balance[index].total.toFixed(8) + '">[ ' + kmd_addr_list_with_balance[index].total.toFixed(8) + ' KMD ] &emsp;' + kmd_addr_list_with_balance[index].addr + '</option>';
$('#kmd_wallet_send_from').html(tmpoptions);
@ -92,7 +91,7 @@ var KMDWalletDashboard = function() {
$('#kmd_wallet_total_value').text(total_minus_currency_fee.toFixed(8));
if ($('#kmd_wallet_send_from').val() != '- Select Transparent or Private KMD Address -' &&
if ($('#kmd_wallet_send_from').val() != '- ' + _lang[defaultLang].KMD_NATIVE.SELECT_ADDRESS_ALT + ' -' &&
$('#kmd_wallet_amount').val() != '' &&
$('#kmd_wallet_sendto') != '' &&
$('#kmd_wallet_fee') != '' ) {
@ -156,19 +155,19 @@ var KMDWalletDashboard = function() {
messages: {
kmd_wallet_send_from: {
required: 'From Address is required.'
required: _lang[defaultLang].DASHBOARD.SEND_FROMADDR_REQ
},
kmd_wallet_sendto: {
required: 'To Address is required.'
required: _lang[defaultLang].DASHBOARD.SEND_TOADDR_REQ
},
kmd_wallet_amount: {
required: 'Please enter KMD amount to send.'
required: _lang[defaultLang].DASHBOARD.SEND_AMOUNT_REQ
},
kmd_wallet_fee: {
required: 'Make sure you have fee entered. Default value is 0.0001 KMD.'
required: _lang[defaultLang].DASHBOARD.SEND_FEE_REQ + ' 0.0001 KMD.'
},
kmd_wallet_total_value: {
required: 'Make sure you have both amount and fee entered to calculate final total.'
required: _lang[defaultLang].DASHBOARD.SEND_TOTAL_REQ
}
},
@ -229,14 +228,14 @@ var KMDWalletDashboard = function() {
console.log('get new T address button clicked...');
KMDGetNewAddresses('public');
KMDListAllAddr();
toastr.info('Receiving Address list updated', 'Wallet Notification');
toastr.info(_lang[defaultLang].TOASTR.RECADDR_UPDATED, _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
});
$('#kmd_get_new_zaddr').click(function() {
console.log('get new Z address button clicked...');
KMDGetNewAddresses('private');
KMDListAllAddr();
toastr.info('Receiving Address list updated', 'Wallet Notification');
toastr.info(_lang[defaultLang].TOASTR.RECADDR_UPDATED, _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
});
};
@ -308,13 +307,13 @@ function RunKMDInitFunctions() {
console.log(check1[0]);
if ( check1[0] == 'not active' ) {
console.log('Could not connect to external wallet. Is external wallet running?');
toastr.error('Connection Error. Is external wallet running?', 'Wallet Notification');
toastr.error(_lang[defaultLang].TOASTR.KMD_NATIVE_CON_ERROR, _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
$('#extcoin-wallet').hide();
$('#extcoin-wallet-connection-alert').show();
}
if ( check1[0] == 'null return' ) {
console.log('Could not connect to external wallet. Is iguana connected to external wallet?');
toastr.error('Connection Error. Is iguana connected to external wallet?', 'Wallet Notification');
toastr.error(_lang[defaultLang].TOASTR.KMD_IGUANA_CON_ERROR, _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
$('#extcoin-wallet').hide();
$('#extcoin-wallet-connection-alert').show();
}
@ -564,7 +563,6 @@ function getKMDBalanceT() {
});
}
function getKMDBalanceZ() {
var passthru_agent = getPassthruAgent(),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
@ -738,9 +736,8 @@ function KMDlistunspentT() {
}
function KMDListaddrZ() {
var result = [];
var passthru_agent = getPassthruAgent(),
var result = [],
passthru_agent = getPassthruAgent(),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
@ -852,26 +849,26 @@ function KMDGetPublicTransactions() {
tmp_addr = AjaxOutputData[index].address;
if (!('address' in AjaxOutputData[index])) {
tmp_addr = '<i class="icon fa-bullseye"></i> <span class="label label-dark">Z Address not listed by wallet!</span>';
tmp_addr = '<i class="icon fa-bullseye"></i> <span class="label label-dark">' + _lang[defaultLang].TOASTR.ZADDR_NOT_LISTED + '!</span>';
}
var tmp_secondsToString = secondsToString(AjaxOutputData[index].time);
if ( AjaxOutputData[index].category == 'send' ) {
tmp_category = '<i class="icon fa-arrow-circle-left"></i> OUT';
tmp_category = '<i class="icon fa-arrow-circle-left"></i> '._lang[defaultLang].TOASTR.OUT;
}
if ( AjaxOutputData[index].category == 'receive' ) {
tmp_category = '<i class="icon fa-arrow-circle-right"></i> IN';
tmp_category = '<i class="icon fa-arrow-circle-right"></i> ' + _lang[defaultLang].TOASTR.IN;
}
if ( AjaxOutputData[index].category == 'generate' ) {
tmp_category = '<i class="icon fa-cogs"></i> Mined';
tmp_category = '<i class="icon fa-cogs"></i> ' + _lang[defaultLang].TOASTR.MINED;
}
if ( AjaxOutputData[index].category == 'immature' ) {
tmp_category = '<i class="icon fa-clock-o"></i> Immature';
tmp_category = '<i class="icon fa-clock-o"></i> ' + _lang[defaultLang].TOASTR.IMMATURE;
}
tmplisttransactions = [
'<span class="label label-default">' +
'<i class="icon fa-eye"></i> public' +
'<i class="icon fa-eye"></i> ' + _lang[defaultLang].IAPI.PUBLIC_SM +
'</span>',
tmp_category,
AjaxOutputData[index].confirmations,
@ -918,10 +915,10 @@ function KMDGetProtectedTransactions() {
tmpIguanaRPCAuth = 'tmpIgRPCUser@ '+ sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
"agent": passthru_agent,
"method": "passthru",
"function": "z_listreceivedbyaddress",
"hex": tmpzaddr_hex_input
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_listreceivedbyaddress',
'hex': tmpzaddr_hex_input
};
$.ajax({
@ -933,7 +930,7 @@ function KMDGetProtectedTransactions() {
var AjaxOutputData = JSON.parse(data); // Ajax output gets the whole list of unspent coin with addresses
$.each(AjaxOutputData, function(index, txidvalue) {
var tmp_category = '<i class="icon fa-arrow-circle-right"></i> IN';
var tmp_category = '<i class="icon fa-arrow-circle-right"></i> ' + _lang[defaultLang].TOASTR.IN;
var tmp_addr = value.addr.slice(0, 30) + '...';
if (!('amount' in txidvalue)) {
var tmp_amount = 0;
@ -946,7 +943,7 @@ function KMDGetProtectedTransactions() {
tmp_secondsToString = secondsToString(tmp_addr_txid_info[0].time),
tmplistZtransactions = [
'<span class="label label-dark">' +
'<i class="icon fa-eye-slash"></i> private' +
'<i class="icon fa-eye-slash"></i> ' + _lang[defaultLang].KMD_NATIVE.PRIVATE +
'</span>',
tmp_category,
tmp_confirmations,
@ -1075,7 +1072,6 @@ function KMDListAddresses(pubpriv) {
return result;
}
function KMDGetNewAddresses(pubpriv) {
NProgress.done(true);
NProgress.configure({
@ -1113,7 +1109,7 @@ function KMDGetNewAddresses(pubpriv) {
url: 'http://127.0.0.1:7778',
success: function(data, textStatus, jqXHR) {
result = data;
toastr.success('New address generated successfully', 'Wallet Notification');
toastr.success(_lang[defaultLang].KMD_NATIVE.NEW_ADDR_GENERATED, _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
@ -1133,7 +1129,10 @@ function KMDGetNewAddresses(pubpriv) {
function KMDListAllAddr() {
NProgress.done(true);
NProgress.configure({
template: '<div class="bar nprogress-bar-header nprogress-bar-info" role="bar"></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'
template: '<div class="bar nprogress-bar-header nprogress-bar-info" role="bar"></div>' +
'<div class="spinner" role="spinner">' +
'<div class="spinner-icon"></div>' +
'</div>'
});
NProgress.start();
@ -1144,11 +1143,11 @@ function KMDListAllAddr() {
$.each(listAlladdr, function(index, value) {
tmp_addr_label = '<span class="label label-default">' +
'<i class="icon fa-eye"></i> public' +
'<i class="icon fa-eye"></i> ' + _lang[defaultLang].IAPI.PUBLIC_SM +
'</span>';
if ( listAlladdr[index].slice(0, 2) == 'zc' || listAlladdr[index].slice(0, 2) == 'zt' ) {
tmp_addr_label = '<span class="label label-dark">' +
'<i class="icon fa-eye-slash"></i> private' +
'<i class="icon fa-eye-slash"></i> ' + _lang[defaultLang].KMD_NATIVE.PRIVATE +
'</span>';
}
//var tmp_addr_action_button = '<button></button>';
@ -1283,27 +1282,27 @@ function KMDListAllOPIDs() {
if (listOPIDs[0][index].status === 'queued') {
tmp_status_label = '<span class="label label-warning">' +
'<i class="icon fa-eye"></i> Queued' +
'<i class="icon fa-eye"></i> ' + _lang[defaultLang].KMD_NATIVE.QUEUED +
'</span>';
tmp_results = '<i>Please press refresh button in a minute or so to see updated status...</i>';
tmp_results = '<i>' + _lang[defaultLang].KMD_NATIVE.PLEASE_REFRESH + '...</i>';
}
if (listOPIDs[0][index].status === 'executing') {
tmp_status_label = '<span class="label label-info">' +
'<i class="icon fa-eye"></i> Executing' +
'<i class="icon fa-eye"></i> ' + _lang[defaultLang].KMD_NATIVE.EXECUTING +
'</span>';
tmp_results = '<i>Please press refresh button in a minute or so to see updated status...</i>';
tmp_results = '<i>' + _lang[defaultLang].KMD_NATIVE.PLEASE_REFRESH + '...</i>';
}
if (listOPIDs[0][index].status === 'failed') {
tmp_status_label = '<span class="label label-danger">' +
'<i class="icon fa-eye"></i> Failed' +
'<i class="icon fa-eye"></i> ' + _lang[defaultLang].KMD_NATIVE.FAILED +
'</span>';
tmp_results = '<b>Error Code:</b> ' + listOPIDs[0][index].error.code + '<br> <b>Message:</b> ' + listOPIDs[0][index].error.message;
tmp_results = '<b>Error Code:</b> ' + listOPIDs[0][index].error.code + '<br> <b>' + _lang[defaultLang].KMD_NATIVE.MESSAGE + ':</b> ' + listOPIDs[0][index].error.message;
}
if (listOPIDs[0][index].status === 'success') {
tmp_status_label = '<span class="label label-success">' +
'<i class="icon fa-eye"></i> Success' +
'<i class="icon fa-eye"></i> ' + _lang[defaultLang].KMD_NATIVE.SUCCESS +
'</span>';
tmp_results = '<b>txid:</b> ' + listOPIDs[0][index].result.txid + '<br> <b>Execution Seconds:</b> ' + listOPIDs[0][index].execution_secs;
tmp_results = '<b>txid:</b> ' + listOPIDs[0][index].result.txid + '<br> <b>' + _lang[defaultLang].KMD_NATIVE.EXECUTION_SECONDS + ':</b> ' + listOPIDs[0][index].execution_secs;
}
opids_statuses_data.push([

119
assets/scripts/lang/en.js

@ -60,7 +60,8 @@ const _lang = {
'ACTIVATING_WALLET_RT': 'Activating wallet once Real Time blocks starts syncing...',
'IGUANA_FULL_MODE_SYNC_P1': 'An Iguana Full Mode coin synchronizes the blockchain using an entirely different format than traditional blockchain software. Iguana\'s Full Mode uses Memory Mapped Files and stores data in bundles. That\'s why you see four different colored synchronizing progress bars.',
'IGUANA_FULL_MODE_SYNC_P2': 'Once all these progress bars reach 100%, the Real Time blocks start synchronizing. Only after the Real Time sync mode activates will you be able to see current data in your wallet and make any transactions.',
'IGUANA_FULL_MODE_SYNC_P3': 'Please wait for all other progress bars to disappear and the first blue bar turns to green.<br>That would mean the wallet is in Real Time Sync mode.',
'IGUANA_FULL_MODE_SYNC_P3': 'Please wait for all other progress bars to disappear and the first blue bar turns to green.',
'IGUANA_FULL_MODE_SYNC_P4': 'That would mean the wallet is in Real Time Sync mode.',
'FETCHING_COIN_DATA': 'Fetching coin data from network. Please wait...',
'INTEREST_EARNED': 'Interest Earned',
'TOTAL_BALANCE': 'Total Balance',
@ -146,12 +147,16 @@ const _lang = {
'WALLET_BACKUP': 'Wallet Backup',
'FIAT_CURRENCY': 'Fiat Currency',
'EXPORT_KEYS': 'Export Keys',
'ONLY_ACTIVE_WIF_KEYS': 'Only the active coin wallet wif keys will be shown here.<br>If you don\'t see a wif key for the coin you are looking for please active it by adding it from EasyDEX Dashboard.<br>You can use these wif keys to import to another coin wallets.',
'ONLY_ACTIVE_WIF_KEYS_P1': 'Only the active coin wallet wif keys will be shown here.',
'ONLY_ACTIVE_WIF_KEYS_P2': 'If you don\'t see a wif key for the coin you are looking for please active it by adding it from EasyDEX Dashboard.',
'ONLY_ACTIVE_WIF_KEYS_P3': 'You can use these wif keys to import to another coin wallets.',
'PLEASE_KEEP_KEYS_SAFE': 'Please keep these keys extra safe and secure.',
'PASSPHRASE': 'Passphrase',
'GET_WIF_KEYS': 'Get Wif Keys',
'IMPORT_KEYS': 'Import Keys',
'IMPORT_KEYS_DESC': 'This section allows you to import private key of all iguana supported coins, Assetchain, Geckochain, or PAXchain by the wallet.<br>It is not mandatory to have that coin active in the wallet for which you are executing import private key process.<br>You\'ll also notice the private key you imported for one coin or chain will also be showing a new address in all other coin wallets\' receiving address section. It is normal.',
'IMPORT_KEYS_DESC_P1': 'This section allows you to import private key of all iguana supported coins, Assetchain, Geckochain, or PAXchain by the wallet.',
'IMPORT_KEYS_DESC_P2': 'It is not mandatory to have that coin active in the wallet for which you are executing import private key process.',
'IMPORT_KEYS_DESC_P3': 'You\'ll also notice the private key you imported for one coin or chain will also be showing a new address in all other coin wallets\' receiving address section. It is normal.',
'INPUT_PRIV_KEY': 'Input Private Key',
'IMPORT_PRIV_KEY': 'Import Private Key',
'DEBUG_LOG': 'Debug Log',
@ -161,7 +166,113 @@ const _lang = {
'LOAD_DEBUG_LOG': 'Load debug log'
},
'DASHBOARD': {
'SELECT_ADDRESS': '- Select Address -'
'SELECT_ADDRESS': '- Select Address -',
'SEND_TOADDR_REQ': 'To Address is required.',
'SEND_FROMADDR_REQ': 'From Address is required.',
'SEND_AMOUNT_REQ': 'Please enter amount to send.',
'SEND_FEE_REQ': 'Make sure you have fee entered. Default value is',
'SEND_TOTAL_REQ': 'Make sure you have both amount and fee entered to calculate final total.',
'SEND_TX_PROGRESS': 'The transaction submitted is processing. Once processed the transaction details will be displayed here.'
},
'TOASTR': {
'WALLET_NOTIFICATION': 'Wallet Notification',
'ACCOUNT_NOTIFICATION': 'Account Notification',
'BASILISK_NOTIFICATION': 'Basilisk Notification',
'COIN_NOTIFICATION': 'Coin Notification',
'TX_NOTIFICATION': 'Transaction Notification',
'SERVICE_NOTIFICATION': 'Service Notification',
'LOGIN_NOTIFICATION': 'Login Notification',
'SETTINGS_NOTIFICATION': 'Settings Notification',
'RECADDR_UPDATED': 'Receiving Address list updated',
'IGUANA_CONN_ERR': 'Unable to connect to Iguana',
'FETCHING_DATA': 'Fetching Data. Please wait for a minute to complete this task.',
'LESS_RESPONSES_REQ': 'Less than required responses. Please try again.',
'SWITCHED_TO': 'switched to',
'MODE': 'Mode',
'UNKNOWN': 'Unknown',
'ZADDR_NOT_LISTED': 'Z Address not listed by wallet',
'IN': 'IN',
'OUT': 'OUT',
'MINED': 'Mined',
'IMMATURE': 'Immature',
'TX_SENT': 'Transaction Sent',
'TX_SEND_ERR': 'Unable to complete transaction',
'LOOKS_LIKE': 'Looks like',
'ALREADY_RUNNING': 'already running',
'STARTED_IN': 'started in',
'IGUANA_CONN_ERR_ALT': 'Unable to connect with iguana service. 127.0.0.1:7778',
'IGUANA_ARE_YOU_SURE': 'Are you sure Iguana is running?',
'SIGNED_TX_GENERATED': 'Signed transaction generated',
'SENDING_TX': 'Sending Transaction to Network',
'SIGNED_TX_SENT': 'Signed transaction sent successfully',
'GETTING_TXID_INFO': 'Getting txid info for updating funds data',
'REFRESHING_FUNDS': 'Refreshing Wallet Funds',
'TX_FAILED': 'Sent Transaction failed. Please check send Transaction page for details.',
'TX_SENT_ALT': 'Transaction sent successfully. Check send section for details.',
'COIN_STARTED': 'coin started',
'ADDR_ALREADY_REG': 'address already registered on network.',
'REG': 'Registered',
'REG_ADDR': 'address on network.',
'REG_ADDR_FAILED': 'address Registeration failed. Please try again.',
'INVALID_QUERY': 'Invalid query sent for',
'TRY_AGAIN': 'Please try again.',
'ADDR_ISNT_REG': 'Address isn\'t Registered on Network. Please Register',
'INVALID_QUERY_ALT': 'Invalid query sent. Please try again.',
'VALIDATION_SUCCESS': 'Validation Success on Network',
'KMD_NATIVE_CON_ERROR': 'Connection Error. Is external wallet running?',
'KMD_IGUANA_CON_ERROR': 'Connection Error. Is iguana connected to external wallet?',
'LOGIN_SUCCESSFULL': 'Login Successfull',
'NO_COIN_RUNNING': 'Seems like there\'s no coin running. Activating BTC.',
'OPPS': 'Opps... Something went wrong!',
'INVALID_PASSPHRASE': 'Invalid Passphrase. Make sure your passphrase is correct, or create new wallet.',
'WALLET_CREATED_SUCCESFULLY': 'Wallet created successfully',
'LOGOUT_SUCCESSFULL': 'Logout Successfull',
'WALLET_LOCKED': 'Wallet Locked Successfully',
'PRIV_KEY_IMPORTED': 'Private Key Imported Successfully!',
'PRIV_KEY_NOT_IMPORTED': 'Private Key is not imported.',
'NULL RETURN': 'null return from iguana_bitcoinRPC',
'ADDED_TO': 'added to',
'SUCCESSFULLY': 'Successfully'
},
'COIN_WALLETS': {
'TX_FAILED': 'Transaction Failed',
'TX_SUCCESS': 'Transaction Successful',
'TX': 'Transaction'
},
'IAPI': {
'PUBLIC_SM': 'public'
},
'KMD_NATIVE': {
'SELECT_ADDRESS': 'Select Transparent or Private Address',
'SELECT_ADDRESS_ALT': 'Select Transparent or Private KMD Address',
'PRIVATE': 'private',
'NEW_ADDR_GENERATED': 'New address generated successfully',
'QUEUED': 'Queued',
'PLEASE_REFRESH': 'Please press refresh button in a minute or so to see updated status',
'EXECUTING': 'Executing',
'FAILED': 'Failed',
'SUCCESS': 'Success',
'MESSAGE': 'Message',
'EXECUTION_SECONDS': 'Execution Seconds'
},
'LOGIN': {
'PWD_REQ': 'Password is required.',
'WALLET_SEED_REQ': 'Wallet seed is required.',
'SAVED_WALLET_SEED': 'Have you saved your wallet seed?',
'SEED_MAKE_SURE_BACKUP': 'Make sure you have it backed up. Without this seed you won\'t be able to access your wallet in the future!',
'YES_I_BACKUP': 'Yes, I have taken backup.',
'WALLET_LOCKED_LOGIN': 'Wallet Locked. Please login.',
'UNLOCK': 'Unlock',
'SIGN_IN': 'Sign In',
'WELCOME': 'Welcome'
},
'SIDEBAR': {
'EDEX_MOTTO': 'Most Secure, Easy and Native Decentralised Exchange',
'JUMBLR_MOTTO': 'Secure, Native and Decentralised Coin Shuffling'
},
'SETTINGS': {
'PASSPHRASE_REQ': 'Passphrase is required.',
}
}
};

79
assets/scripts/login.js

@ -26,7 +26,7 @@ var Login = function() {
messages: {
password: {
required: 'Password is required.'
required: _lang[defaultLang].LOGIN.PWD_REQ
}
},
@ -49,11 +49,12 @@ var Login = function() {
},
submitHandler: function(form) {
var jumblr_setpassphrase_val = 'jumblr '+$('#password').val()
console.log(jumblr_setpassphrase_val)
Iguana_Jumblr_SetPassphrase({'passphrase':jumblr_setpassphrase_val}).then(function(result){
console.log(result)
}).then(function(){
var jumblr_setpassphrase_val = 'jumblr ' + $('#password').val();
console.log(jumblr_setpassphrase_val);
Iguana_Jumblr_SetPassphrase({ 'passphrase': jumblr_setpassphrase_val }).then(function(result) {
console.log(result);
})
.then(function(){
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
@ -75,7 +76,7 @@ var Login = function() {
sessionStorage.setItem('IguanaActiveAccount', LoginDataToStore);
if (LoginOutput.result === 'success') {
console.log('Success');
toastr.success('Login Successfull', 'Account Notification')
toastr.success(_lang[defaultLang].TOASTR.LOGIN_SUCCESSFULL, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION)
$('#password').val('')
$('#wallet-login').hide();
@ -87,7 +88,7 @@ var Login = function() {
} else {
// If something goes wrong, alert the error message that our service returned
if (LoginOutput.error === 'bitcoinrpc needs coin that is active') {
toastr.info('Seems like there\'s no coin running. Activating BTC.', 'Coin Notification');
toastr.info(_lang[defaultLang].TOASTR.NO_COIN_RUNNING, _lang[defaultLang].TOASTR.COIN_NOTIFICATION);
var logincoinnames = [];
$('#logincoinslist input[type=checkbox]:checked').each(function() { logincoinnames.push(this.value); });
console.log(logincoinnames);
@ -119,9 +120,9 @@ var Login = function() {
}
});
} else if ( LoginOutput.error === 'invalid passphrase' ) {
toastr.info('Invalid Passphrase. Make sure your passphrase is correct, or create new wallet.', 'Login Notification');
toastr.info(_lang[defaultLang].TOASTR.INVALID_PASSPHRASE, _lang[defaultLang].TOASTR.LOGIN_NOTIFICATION);
} else {
toastr.warning('Opps... Something went wrong!', 'Account Notification');
toastr.warning(_lang[defaultLang].TOASTR.OPPS, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
}
console.log(data.statusText);
@ -193,7 +194,7 @@ var Login = function() {
messages: {
rwalletseed: {
required: 'Wallet seed is required.'
required: _lang[defaultLang].LOGIN.WALLET_SEED_REQ
}
},
@ -223,13 +224,13 @@ var Login = function() {
submitHandler: function(form) {
swal({
title: 'Have you saved your wallet seed?',
text: 'Make sure you have it backed up. Without this seed you won\'t be able to access your wallet in the future!',
title: _lang[defaultLang].LOGIN.SAVED_WALLET_SEED,
text: _lang[defaultLang].LOGIN.SEED_MAKE_SURE_BACKUP,
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, I have taken backup.'
confirmButtonText: _lang[defaultLang].LOGIN.YES_I_BACKUP
})
.then(function() {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
@ -250,18 +251,18 @@ var Login = function() {
if (CreateWalletOutput.result === 'success') {
console.log('Success');
toastr.success('Wallet created successfully', 'Account Notification');
toastr.success(_lang[defaultLang].TOASTR.WALLET_CREATED_SUCCESFULLY, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
// Iguana_DEXImportAll();
$('#wallet-handle').val('');
$('#password').val('');
} else {
// If something goes wrong, alert the error message that our service returned
toastr.warning('Opps... Something went wrong!', 'Account Notification');
toastr.warning(_lang[defaultLang].TOASTR.OPPS, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
console.log(CreateWalletOutput);
if (CreateWalletOutput.error === 'bitcoinrpc needs coin that is active') {
toastr.info('Seems like there\'s no coin running. Activating BTC.', 'Coin Notification');
toastr.info(_lang[defaultLang].TOASTR.NO_COIN_RUNNING, _lang[defaultLang].TOASTR.COIN_NOTIFICATION);
var logincoinnames = [];
$('#logincoinslist input[type=checkbox]:checked').each(function() { logincoinnames.push(this.value); });
console.log(logincoinnames);
@ -278,7 +279,7 @@ var Login = function() {
if (index == '0' ) {
console.log(value + ' ' + index);
$('.register-form').submit();
toastr.success('Wallet created successfully', 'Account Notification');
toastr.success(_lang[defaultLang].TOASTR.WALLET_CREATED_SUCCESFULLY, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
}
}
if ( value == 'BTCD' ) {
@ -292,12 +293,12 @@ var Login = function() {
if (index == '0' ) {
console.log(value + ' ' + index);
$('.register-form').submit();
toastr.success('Wallet created successfully', 'Account Notification');
toastr.success(_lang[defaultLang].TOASTR.WALLET_CREATED_SUCCESFULLY, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
}
}
});
} else {
toastr.warning('Opps... Something went wrong!', 'Account Notification');
toastr.warning(_lang[defaultLang].TOASTR.OPPS, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
}
console.log(data.statusText);
@ -318,7 +319,7 @@ var Login = function() {
}
console.log(textStatus);
console.log(error);
toastr.warning('Opps... Something went wrong!', 'Account Notification');
toastr.warning(_lang[defaultLang].TOASTR.OPPS, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
}
});
@ -381,7 +382,7 @@ var Login = function() {
if (LogoutOutput.result === 'success') {
console.log('Success');
toastr.success('Logout Successfull', 'Account Notification');
toastr.success(_lang[defaultLang].TOASTR.LOGOUT_SUCCESSFULL, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
$('#wallet-login').show();
$('body').removeClass( '' ).addClass( 'page-login layout-full page-dark' );
$('#wallet-core').hide();
@ -400,7 +401,7 @@ var Login = function() {
StopTotalFiatValue();
} else {
// If something goes wrong, alert the error message that our service returned
toastr.warning('Opps... Something went wrong!', 'Account Notification');
toastr.warning(_lang[defaultLang].TOASTR.OPPS, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
console.log(data.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
@ -417,7 +418,7 @@ var Login = function() {
}
console.log(textStatus);
console.log(error);
toastr.warning('Opps... Something went wrong!', 'Account Notification');
toastr.warning(_lang[defaultLang].TOASTR.OPPS, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
}
});
});
@ -464,22 +465,22 @@ var Login = function() {
if (ActiveHandleOutput.status === 'locked') {
console.log('Success');
toastr.success('Wallet Locked Successfully', 'Account Notification');
toastr.success(_lang[defaultLang].TOASTR.WALLET_LOCKED, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
$('#wallet-login').show();
$('body').removeClass( '' ).addClass( 'page-login layout-full page-dark' );
$('#wallet-core').hide();
$('link[id=loginStyle]')[0].disabled = false;
$("#loginbtn").text('Unlock');
$("#loginbtn").text(_lang[defaultLang].LOGIN.UNLOCK);
// Hide some login fields not needing at lock screen
console.log('Wallet is Locked.');
$('#login-welcome').text('Wallet Locked. Please login.');
$('#login-welcome').text(_lang[defaultLang].LOGIN.WALLET_LOCKED_LOGIN);
$('#register-btn').hide();
$('#logint-another-wallet').show();
$('#logincoinslist').hide();
} else {
// If something goes wrong, alert the error message that our service returned
toastr.warning('Opps... Something went wrong!', 'Account Notification');
toastr.warning(_lang[defaultLang].TOASTR.OPPS, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
console.log(data.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
@ -496,7 +497,7 @@ var Login = function() {
}
console.log(textStatus);
console.log(error);
toastr.warning('Opps... Something went wrong!', 'Account Notification');
toastr.warning(_lang[defaultLang].TOASTR.OPPS, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
}
});
// End Check Active Wallet's status
@ -511,7 +512,7 @@ var Login = function() {
}
console.log(textStatus);
console.log(error);
toastr.warning('Opps... Something went wrong!', 'Account Notification');
toastr.warning(_lang[defaultLang].TOASTR.OPPS, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
}
});
});
@ -545,9 +546,9 @@ var Login = function() {
$('#wallet-core').fadeIn();
} else if ( JSON.parse(CheckLoginData).status === 'locked' ) {
console.log('Wallet is Locked.');
$('#login-welcome').text('Wallet Locked. Please login');
$('#login-welcome').text(_lang[defaultLang].LOGIN.WALLET_LOCKED_LOGIN);
$('#register-btn').hide();
$("#loginbtn").text('Unlock');
$("#loginbtn").text(_lang[defaultLang].LOGIN.UNLOCK);
$('#section-login-addcoin-btn').hide();
$('#section-login').show();
}
@ -669,7 +670,7 @@ var Login = function() {
if (LogoutOutput.result === 'success') {
console.log('Success');
toastr.success('Logout Successfull', 'Account Notification');
toastr.success(_lang[defaultLang].TOASTR.LOGOUT_SUCCESSFULL, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
$('#wallet-login').show();
$('body').removeClass( '' ).addClass( 'page-login layout-full page-dark' );
@ -677,15 +678,15 @@ var Login = function() {
$('link[id=loginStyle]')[0].disabled = false;
// Make sure these fields are unhidden.
$('#login-welcome').text('Welcome. Please login.');
$('#login-welcome').text(_lang[defaultLang].INDEX.WELCOME_LOGIN);
$('.create-account').show();
$('#register-btn').show();
$('#logint-another-wallet').hide();
$("#loginbtn").text('Sign in');
$("#loginbtn").text(_lang[defaultLang].LOGIN.SIGN_IN);
$('#logincoinslist').show();
} else {
// If something goes wrong, alert the error message that our service returned
toastr.warning('Opps... Something went wrong!', 'Account Notification');
toastr.warning(_lang[defaultLang].TOASTR.OPPS, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
console.log(data.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
@ -702,7 +703,7 @@ var Login = function() {
}
console.log(textStatus);
console.log(error);
toastr.warning('Opps... Something went wrong!', 'Account Notification');
toastr.warning(_lang[defaultLang].TOASTR.OPPS, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
}
});
});
@ -820,10 +821,10 @@ function ClearOnLogout(cleardata, stopinterval) {
$('#logint-another-wallet').hide();
// Make sure these fields are unhidden.
$('#login-welcome').text('Welcome.');
$('#login-welcome').text(_lang[defaultLang].LOGIN.WELCOME);
$('#wallet-handle').show();
$('.create-account').show();
$('#register-btn').show();
$('#logint-another-wallet').hide();
$("#loginbtn").text('Sign in');
$("#loginbtn").text(_lang[defaultLang].LOGIN.SIGN_IN);
}

12
assets/scripts/sidebar.js

@ -16,7 +16,7 @@ $(document).ready(function() {
$('#nav-iguana-atomic-explorer').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-wallet-settings').removeClass( 'active open' ).addClass( '' );
$('#nav-about-iguana').removeClass( 'active open' ).addClass( '' );
$(".header-easydex-section").text('Dashboard');
$(".header-easydex-section").text(_lang[defaultLang].INDEX.DASHBOARD);
removeKMDWalletStyle();
removeZECWalletStyle();
@ -46,7 +46,7 @@ $('#nav-dashboard').on('click', function() {
$('#nav-iguana-atomic-explorer').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-wallet-settings').removeClass( 'active open' ).addClass( '' );
$('#nav-about-iguana').removeClass( 'active open' ).addClass( '' );
$(".header-easydex-section").text('Dashboard');
$(".header-easydex-section").text(_lang[defaultLang].INDEX.DASHBOARD);
$.each($('.nav-top-menu'), function(index, value) { $(value).removeClass('active'); });
$(this.parentElement).addClass('active');
removeKMDWalletStyle();
@ -73,8 +73,8 @@ $('#nav-easydex').on('click', function() {
$('#nav-iguana-atomic-explorer').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-wallet-settings').removeClass( 'active open' ).addClass( '' );
$('#nav-about-iguana').removeClass( 'active open' ).addClass( '' );
$('.page-header-bordered h1').text('EasyDEX')
$(".header-easydex-section").text('Most Secure, Easy and Native Decentralised Exchange');
$('.page-header-bordered h1').text('EasyDEX');
$(".header-easydex-section").text(_lang[defaultLang].SIDEBAR.EDEX_MOTTO);
$.each($('.nav-top-menu'), function(index, value) { $(value).removeClass('active'); });
$(this.parentElement).addClass('active')
removeKMDWalletStyle();
@ -180,7 +180,7 @@ $('#nav-zcash-wallet').on('click', function() {
$('#nav-iguana-atomic-explorer').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-wallet-settings').removeClass( 'active open' ).addClass( '' );
$('#nav-about-iguana').removeClass( 'active open' ).addClass( '' );
$(".header-easydex-section").text('Zcash Wallet');
$(".header-easydex-section").text(_lang[defaultLang].INDEX.ZC_WALLET);
$.each($('[data-extcoin]'), function(index, value) {
$('[data-extcoin]').attr('data-extcoin', 'ZEC');
@ -357,7 +357,7 @@ function removeZECWalletStyle() {
}
function applyJumblrStyle() {
$('.header-easydex-section').html('<img src="assets/images/jumblr_header_title_logo.png"><br>Secure, Native and Decentralised Coin Shuffling');
$('.header-easydex-section').html('<img src="assets/images/jumblr_header_title_logo.png"><br>' + _lang[defaultLang].SIDEBAR.JUMBLR_MOTTO);
$('.page-title').hide();
$('#easydex-header-div').css('background-image', 'url("assets/images/bg/jumblr_transparent_header_bg.png")');
$('#easydex-header-div').css('background-repeat', 'no-repeat');

154
assets/scripts/walletsettings.js

@ -11,7 +11,7 @@ var WalletSettings = function() {
},
messages: {
wifkeys_passphrase: {
required: 'Passphrase is required.'
required: _lang[defaultLang].SETTINGS.PASSPHRASE_REQ
}
},
submitHandler: function(form) {
@ -25,7 +25,7 @@ var WalletSettings = function() {
'native',
'basilisk',
'full'], function( index, value ) {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
allcoins_ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'InstantDEX',
@ -33,68 +33,52 @@ var WalletSettings = function() {
};
$.ajax({
type: 'POST',
data: JSON.stringify(allcoins_ajax_data),
url: 'http://127.0.0.1:7778',
success: function(data, textStatus, jqXHR) {
var AllcoinsDataOutput = JSON.parse(data);
// Only execute further code if that mode has any coins active it. if none, skill checking on them.
if (AllcoinsDataOutput[value].length !== 0 ) {
console.log('== AllCoins Data OutPut ==');
console.log(value);
console.log(AllcoinsDataOutput[value]);
type: 'POST',
data: JSON.stringify(allcoins_ajax_data),
url: 'http://127.0.0.1:7778',
success: function(data, textStatus, jqXHR) {
var AllcoinsDataOutput = JSON.parse(data);
// Only execute further code if that mode has any coins active it. if none, skill checking on them.
if (AllcoinsDataOutput[value].length !== 0 ) {
console.log('== AllCoins Data OutPut ==');
console.log(value);
console.log(AllcoinsDataOutput[value]);
// First Run Encryptwallet API to get wif keys for each active coin
$.each(AllcoinsDataOutput[value], function(index) {
// First Run Encryptwallet API to get wif keys for each active coin
$.each(AllcoinsDataOutput[value], function(index) {
console.log(AllcoinsDataOutput[value][index]);
var wifkey_coin_handle = AllcoinsDataOutput[value][index];
console.log(AllcoinsDataOutput[value][index]);
var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth');
var EncryptWallet_ajax_data = {'userpass':tmpIguanaRPCAuth,"agent":"bitcoinrpc","method":"encryptwallet","passphrase":Getwifkeys_passphrase}
$.ajax({
type: 'POST',
data: JSON.stringify(EncryptWallet_ajax_data),
url: 'http://127.0.0.1:7778',
//dataType: 'text',
success: function(data, textStatus, jqXHR) {
var EncryptWalletDataOutput = JSON.parse(data);
console.log(EncryptWalletDataOutput[wifkey_coin_handle+'wif']);
WifKeyDivContent += '<table class="table">';
WifKeyDivContent += '<tr><td style="width: 5%;"><b>'+wifkey_coin_handle+'</b></td><td>'+EncryptWalletDataOutput[wifkey_coin_handle]+'</td></tr>';
WifKeyDivContent += '<tr><td><b>'+wifkey_coin_handle+'Wif</b></td><td>'+EncryptWalletDataOutput[wifkey_coin_handle+'wif']+'</td></tr>';
WifKeyDivContent += '</table>';
$('#wif-priv-keys').html(WifKeyDivContent);
},
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);
}
});
});
//Second run walletpassphrase again to make sure wallet is unlocked as before login.
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
WalletPassphrase_ajax_data = {
var wifkey_coin_handle = AllcoinsDataOutput[value][index],
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
EncryptWallet_ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'bitcoinrpc',
'method': 'walletpassphrase',
'password': Getwifkeys_passphrase,
'timeout': '2592000'
'method': 'encryptwallet',
'passphrase': Getwifkeys_passphrase
};
$.ajax({
type: 'POST',
data: JSON.stringify(WalletPassphrase_ajax_data),
data: JSON.stringify(EncryptWallet_ajax_data),
url: 'http://127.0.0.1:7778',
success: function(data, textStatus, jqXHR) {
var WalletPassphraseDataOutput = JSON.parse(data);
console.log(WalletPassphraseDataOutput);
var EncryptWalletDataOutput = JSON.parse(data);
console.log(EncryptWalletDataOutput[wifkey_coin_handle + 'wif']);
WifKeyDivContent += '<table class="table">';
WifKeyDivContent += '<tr>' +
'<td style="width: 5%;">' +
'<b>' + wifkey_coin_handle + '</b>' +
'</td>' +
'<td>' + EncryptWalletDataOutput[wifkey_coin_handle] + '</td>' +
'</tr>';
WifKeyDivContent += '<tr>' +
'<td>' +
'<b>' + wifkey_coin_handle + 'Wif</b>' +
'</td>' +
'<td>' + EncryptWalletDataOutput[wifkey_coin_handle + 'wif'] + '</td>' +
'</tr>';
WifKeyDivContent += '</table>';
$('#wif-priv-keys').html(WifKeyDivContent);
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
@ -106,17 +90,47 @@ var WalletSettings = function() {
console.log(error);
}
});
}
},
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);
});
//Second run walletpassphrase again to make sure wallet is unlocked as before login.
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
WalletPassphrase_ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'bitcoinrpc',
'method': 'walletpassphrase',
'password': Getwifkeys_passphrase,
'timeout': '2592000'
};
$.ajax({
type: 'POST',
data: JSON.stringify(WalletPassphrase_ajax_data),
url: 'http://127.0.0.1:7778',
success: function(data, textStatus, jqXHR) {
var WalletPassphraseDataOutput = JSON.parse(data);
console.log(WalletPassphraseDataOutput);
},
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);
}
});
}
},
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);
}
});
});
}
@ -154,12 +168,12 @@ var WalletSettings = function() {
EDEXimportprivkey(Getimport_wifkey).then(function(result){
console.log(result)
if ( result.result !== undefined && result.result == 'success' ) {
toastr.success('Private Key Imported Successfully!', 'Settings Notification');
toastr.success(_lang[defaultLang].TOASTR.PRIV_KEY_IMPORTED, _lang[defaultLang].TOASTR.SETTINGS_NOTIFICATION);
$('#import_wifkey').val('');
}
if ( result.error !== undefined && result.error == 'null return from iguana_bitcoinRPC' ) {
toastr.info('Private Key is not imported.', 'Settings Notification');
toastr.error('null return from iguana_bitcoinRPC', 'Settings Notification');
toastr.info(_lang[defaultLang].TOASTR.PRIV_KEY_NOT_IMPORTED, _lang[defaultLang].TOASTR.SETTINGS_NOTIFICATION);
toastr.error(_lang[defaultLang].TOASTR.NULL_RETURN, _lang[defaultLang].TOASTR.SETTINGS_NOTIFICATION);
}
});
}
@ -208,8 +222,8 @@ function Settings_ShowCoinPeers() {
$('#coin_supernetpeers').text('');
$('#coin_rawpeers_h').text('');
$('#coin_rawpeers').text('');
var settings_selected_coinname_code_val = $('option:selected', '#settings_select_coin_options').val();
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
var settings_selected_coinname_code_val = $('option:selected', '#settings_select_coin_options').val(),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'SuperNET',
@ -290,7 +304,7 @@ function Settings_AddCoinPeers() {
var getAddCoinPeers = JSON.parse(data);
console.log(getAddCoinPeers);
if ( getAddCoinPeers.result == 'addnode submitted' ) {
toastr.success(settings_add_peer_ip_val + ' added to ' + settings_selected_coinname_code_val + ' Successfully', 'Coin Notification');
toastr.success(settings_add_peer_ip_val + ' ' + _lang[defaultLang].TOASTR.ADDED_TO + ' ' + settings_selected_coinname_code_val + ' ' + _lang[defaultLang].TOASTR.SUCCESSFULLY, _lang[defaultLang].TOASTR.COIN_NOTIFICATION);
$('#settings_add_peer_ip').val('');
}
},

49
index.html

@ -183,7 +183,7 @@
</div>
</div>
<div class="col-sm-12" style="color: #333">
<p><strong><span data-lang="INDEX.FULL_MODE"></span>:</strong> <span data-lang="INDEX.FULL_MODE_DESC"></span>></p>
<p><strong><span data-lang="INDEX.FULL_MODE"></span>:</strong> <span data-lang="INDEX.FULL_MODE_DESC"></span></p>
<p><strong><span data="INDEX.BASILISK_MODE"></span>:</strong> <span data-lang="INDEX.BASILISK_MODE_DESC"></span></p>
<p><strong><span data-lang="INDEX.NATIVE_MODE"></span>:</strong> <span data-lang="INDEX.NATIVE_MODE_DESC1"></span> <strong>Komodo Daemon</strong> <span data-lang="INDEX.NATIVE_MODE_DESC2"></span> <i>Iguana Daemon</i> <span data-lang="INDEX.NATIVE_MODE_DESC3"></span>.</p>
<div class="alert alert-icon alert-primary" role="alert">
@ -513,17 +513,17 @@
</a>
<ul class="dropdown-menu" role="menu">
<li role="presentation">
<a href="javascript:void(0)" role="menuitem" id="nav-iguana-wallet-settings"><i class="icon md-settings" aria-hidden="true"></i> <span data-lang="INDEX.SETTINGS"></span>></a>
<a href="javascript:void(0)" role="menuitem" id="nav-iguana-wallet-settings"><i class="icon md-settings" aria-hidden="true"></i> <span data-lang="INDEX.SETTINGS"></span></a>
</li>
<li role="presentation">
<a href="javascript:void(0)" role="menuitem" id="nav-about-iguana"><i class="icon md-settings" aria-hidden="true"></i> <span data-lang="INDEX.ABOUT_IGUANA"></span>></a>
<a href="javascript:void(0)" role="menuitem" id="nav-about-iguana"><i class="icon md-settings" aria-hidden="true"></i> <span data-lang="INDEX.ABOUT_IGUANA"></span></a>
</li>
<li class="divider" role="presentation"></li>
<!--<li role="presentation">
<a href="javascript:void(0)" role="menuitem" id="lock-screen"><i class="icon md-lock" aria-hidden="true"></i> Lock Screen</a>
</li>-->
<li role="presentation">
<a href="javascript:void(0)" role="menuitem" id="logout-account"><i class="icon md-power" aria-hidden="true"></i> <span data-lang="INDEX.LOGOUT"></span>></a>
<a href="javascript:void(0)" role="menuitem" id="logout-account"><i class="icon md-power" aria-hidden="true"></i> <span data-lang="INDEX.LOGOUT"></span></a>
</li>
</ul>
</li>
@ -757,16 +757,22 @@
<button aria-label="Close" data-dismiss="alert" class="close" type="button"><span aria-hidden="true">×</span></button>
<h4 data-lang="INDEX.ACTIVATING_WALLET_RT"></h4>
<p data-edexcoin="COIN" id="edexcoin-wallet-waitingrt-alert-text" data-lang="INDEX.IGUANA_FULL_MODE_SYNC_P1"></p>
<p data-lang="INDEX.IGUANA_FULL_MODE_SYNC_P1"></p>
<p style="font-weight: 600" data-lang="INDEX.IGUANA_FULL_MODE_SYNC_P1"></p>
<p data-lang="INDEX.IGUANA_FULL_MODE_SYNC_P2"></p>
<p style="font-weight: 600">
<div data-lang="INDEX.IGUANA_FULL_MODE_SYNC_P3"></div><br/>
<div data-lang="INDEX.IGUANA_FULL_MODE_SYNC_P4"></div>
</p>
</div>
<div role="alert" class="alert alert-info alert-dismissible" data-edexcoin="COIN" id="edexcoin-wallet-waitingcache-alert" style="display: none">
<button aria-label="Close" data-dismiss="alert" class="close" type="button"><span aria-hidden="true">×</span></button>
<h4 data-lang="INDEX.FETCHING_COIN_DATA"></h4>
<p data-edexcoin="COIN" id="edexcoin-wallet-waitingcache-alert-text" data-lang="INDEX.IGUANA_FULL_MODE_SYNC_P1"></p>
<p data-lang="INDEX.IGUANA_FULL_MODE_SYNC_P1"></p>
<p style="font-weight: 600" data-lang="INDEX.IGUANA_FULL_MODE_SYNC_P1"></p>
<p data-lang="INDEX.IGUANA_FULL_MODE_SYNC_P2"></p>
<p style="font-weight: 600">
<div data-lang="INDEX.IGUANA_FULL_MODE_SYNC_P3"></div><br/>
<div data-lang="INDEX.IGUANA_FULL_MODE_SYNC_P4"></div>
</p>
</div>
</div>
@ -2086,7 +2092,6 @@
</div>
</div>
<div class="panel">
<div class="panel-heading" id="ExportKeys" role="tab">
<a class="panel-title collapsed" data-toggle="collapse" href="#ExportKeysTab"
@ -2098,7 +2103,12 @@
<div class="panel-collapse collapse" id="ExportKeysTab" aria-labelledby="ExportKeys"
role="tabpanel">
<div class="panel-body">
<p><span data-lang="INDEX.ONLY_ACTIVE_WIF_KEYS"></span> <b><i data-lang="INDEX.PLEASE_KEEP_KEYS_SAFE"></i></b></p>
<p>
<div data-lang="INDEX.ONLY_ACTIVE_WIF_KEYS_P1"></div><br/>
<div data-lang="INDEX.ONLY_ACTIVE_WIF_KEYS_P2"></div><br/>
<div data-lang="INDEX.ONLY_ACTIVE_WIF_KEYS_P3"></div><br/>
<b><i data-lang="INDEX.PLEASE_KEEP_KEYS_SAFE"></i></b>
</p>
<div class="col-sm-12"></div>
<form class="wifkeys-form" method="post" action="javascript:" autocomplete="off" onsubmit="return false">
<div class="form-group form-material floating">
@ -2130,7 +2140,12 @@
<div class="panel-collapse collapse" id="ImportKeysTab" aria-labelledby="ImportKeys"
role="tabpanel">
<div class="panel-body">
<p><span data-lang="INDEX.IMPORT_KEYS_DESC"></span> <b><i data-lang="INDEX.PLEASE_KEEP_KEYS_SAFE"></i></b></p>
<p>
<div data-lang="INDEX.IMPORT_KEYS_DESC_P1"></div><br/>
<div data-lang="INDEX.IMPORT_KEYS_DESC_P2"></div><br/>
<div data-lang="INDEX.IMPORT_KEYS_DESC_P3"></div><br/>
<b><i data-lang="INDEX.PLEASE_KEEP_KEYS_SAFE"></i></b>
</p>
<div class="col-sm-12"></div>
<form class="wifkeys-import-form" method="post" action="javascript:" autocomplete="off" onsubmit="return false">
<div class="form-group form-material floating">
@ -2286,22 +2301,22 @@
<!-- Iguana API Scripts -->
<script src="assets/scripts/iguana_api.js"></script>
<script src="assets/scripts/iguana_api/IguanaUnused.js"></script>
<!--script src="assets/scripts/iguana_api/IguanaUnused.js"></script>
<script src="assets/scripts/iguana_api/IguanaHandle.js"></script>
<script src="assets/scripts/iguana_api/IguanaAddcoin.js"></script>
<script src="assets/scripts/iguana_api/IguanaEDEX.js"></script>
<script src="assets/scripts/iguana_api/IguanaDEX.js"></script>
<script src="assets/scripts/iguana_api/IguanaShepherd.js"></script>
<script src="assets/scripts/iguana_api/IguanaShepherd.js"></script-->
<!-- End Iguana API Scripts -->
<script src="assets/scripts/login.js"></script>
<!-- Dashboard Scripts -->
<script src="assets/scripts/dashboard.js"></script>
<script src="assets/scripts/dashboard/DashboardEDEX.js"></script>
<!--script src="assets/scripts/dashboard/DashboardEDEX.js"></script>
<script src="assets/scripts/dashboard/DashboardDEX.js"></script>
<script src="assets/scripts/dashboard/DashboardBasilisk.js"></script>
<script src="assets/scripts/dashboard/DashboardCoinFiat.js"></script>
<script src="assets/scripts/dashboard/DashboardCoinFiat.js"></script-->
<!-- End Dashboard Scripts -->
<!--<script src="assets/scripts/coinwallets.js"></script>-->
@ -2341,7 +2356,7 @@
});
lang();
});
});
})(document, window, jQuery);
jQuery(document).ready(function() {
@ -2349,4 +2364,4 @@
});
</script>
</body>
</html>
</html>

Loading…
Cancel
Save