Browse Source

code cleanup p2 #3

master
pbca26 8 years ago
parent
commit
f82bc38844
  1. 8
      assets/pages/login.css
  2. 89
      assets/scripts/coinwallets.js
  3. 500
      assets/scripts/dashboard.js
  4. 16
      assets/scripts/dashboard/DashboardEDEX.js
  5. 9
      assets/scripts/iguana_api.js
  6. 2
      assets/scripts/iguana_api/IguanaAddcoin.js
  7. 8
      assets/scripts/iguana_api/IguanaDEX.js
  8. 190
      assets/scripts/iguana_api/IguanaEDEX.js
  9. 10
      assets/scripts/iguana_api/IguanaHandle.js
  10. 6
      assets/scripts/iguana_api/IguanaJumblr.js
  11. 40
      assets/scripts/iguana_api/IguanaShepherd.js
  12. 20
      assets/scripts/jumblr.js
  13. 30
      assets/scripts/kmd_wallet/KMDBalance.js
  14. 7
      assets/scripts/kmd_wallet/KMDInit.js
  15. 7
      assets/scripts/kmd_wallet/KMDSendTx.js
  16. 47
      assets/scripts/kmd_wallet/KMDWalletDashboard.js
  17. 193
      assets/scripts/kmd_wallet_dashboard.js
  18. 9
      assets/scripts/lang/en.js
  19. 286
      assets/scripts/login.js
  20. 40
      assets/scripts/walletsettings.js

8
assets/pages/login.css

@ -8,6 +8,14 @@
.page-login form a {
margin-left: 20px;
}
.page-login .form-control,
.page-login .floating-label,
.page-login .form-control:focus + .floating-label {
color: #bdbdbd;
}
.page-login #addcoin_select_coin_mdl_options-login {
color: #757575;
}
.page-login a {
color: #9fa8da;
}

89
assets/scripts/coinwallets.js

@ -32,12 +32,15 @@ function getCurrency() {
function sendCurrency(val) {
console.log(val);
$('#mdl_currency_coin').text(val.currency);
$('#mdl_currency_balance').text($('span[data-currency="' + val.currency + '"][id="currency-balance"]').text());
//console.log($('span[data-currency="' + val.currency + '"][id="currency-balance"]').text());
$('#mdl_currency_sendto').attr('placeholder', 'Enter ' + val.currency + ' address');
$('#mdl_currency_amount_label').text(val.currency);
$('#mdl_currency_total_coinname').text(val.currency);
$('#mdl_currency_sendto').attr('placeholder', _lang[defaultLang].INDEX.ENTER + ' ' + val.currency + ' ' + _lang[defaultLang].INDEX.ADDR_SM);
$(
'#mdl_currency_amount_label,' +
'#mdl_currency_coin,' +
'#mdl_currency_total_coinname'
)
.text(val.currency);
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
getinfoValues = {
@ -121,7 +124,7 @@ $('#mdl_currency_amount').keyup(function() {
mdl_send_btn.removeClass('disabled');
mdl_send_btn.attr('data-dismiss', 'modal');
mdl_send_btn.attr('data-target', '#SendCoinModelStep2');
mdl_send_btn.attr('onclick', 'ConfirmsendCurrency($(this).data())')
mdl_send_btn.attr('onclick', 'ConfirmsendCurrency($(this).data())');
} else {
mdl_send_btn.addClass('disabled');
mdl_send_btn.removeAttr('data-dismiss');
@ -131,11 +134,11 @@ $('#mdl_currency_amount').keyup(function() {
});
$('#mdl_currency_fee').keyup(function() {
var sum_val1 = parseFloat($('#mdl_currency_amount').val())
var sum_val2 = parseFloat($('#mdl_currency_fee').val())
var total_of_currency_fee = sum_val1 + sum_val2;
var currency_fiat_value = '';
var fiat_symbol = '';
var sum_val1 = parseFloat($('#mdl_currency_amount').val()),
sum_val2 = parseFloat($('#mdl_currency_fee').val()),
total_of_currency_fee = sum_val1 + sum_val2,
currency_fiat_value = '',
fiat_symbol = '';
if ( $('#mdl_currency_total_coinname').text() == 'BTCD' ) {
currency_fiat_value = localStorage.getItem('EasyDEX_BTCD_Fiat_pair_value');
@ -152,15 +155,24 @@ $('#mdl_currency_fee').keyup(function() {
});
function CurrencyMdlBtnClean() {
$('#mdl_currency_sendto').val('');
$('#mdl_currency_amount').val('');
$('#mdl_currency_total_value').text('0.00');
$('#mdl_currency_total_fiat_value').text('0.00');
$(
'#mdl_currency_sendto,' +
'#mdl_currency_amount'
)
.val('');
$(
'#mdl_currency_total_value,' +
'#mdl_currency_total_fiat_value'
)
.text('0.00');
}
function ReceiveCoinMdlBtnClean() {
$('#mdl_receive_coin_addr').text('');
$('#mdl_receive_coin_addr_qr_code').text('');
$(
'#mdl_receive_coin_addr,' +
'#mdl_receive_coin_addr_qr_code'
)
.text('');
}
function ConfirmsendCurrency(confirm_val) {
@ -182,14 +194,17 @@ function ConfirmsendCurrency(confirm_val) {
$('#mdl_confirm_currency_sendto_addr').text($('#mdl_currency_sendto').val());
$('#mdl_confirm_currency_send_amount').text($('#mdl_currency_amount').val());
$('#mdl_confirm_currency_coinname').text(confirm_coinname);
$(
'#mdl_confirm_currency_coinname,' +
'#mdl_confirm_currency_coinname_total,' +
'#mdl_confirm_currency_coinname_fee'
)
.text(confirm_coinname);
$('#mdl_confirm_currency_send_amount_fiat').text(fiat_symbol + ($('#mdl_confirm_currency_send_amount').text() * currency_fiat_value).toFixed(2));
$('#mdl_confirm_currency_send_fee').text($('#mdl_currency_fee').val());
$('#mdl_confirm_currency_coinname_fee').text(confirm_coinname);
$('#mdl_confirm_currency_send_fee_fiat').text(fiat_symbol + ($('#mdl_confirm_currency_send_fee').text() * currency_fiat_value).toFixed(2));
$('#mdl_confirm_currency_sendfrom_addr').text(confirm_selected_from_addr);
$('#mdl_confirm_currency_sendfrom_total_dedcut').text($('#mdl_currency_total_value').text());
$('#mdl_confirm_currency_coinname_total').text(confirm_coinname);
$('#mdl_confirm_currency_sendfrom_total_deduct_fiat').text($('#mdl_currency_total_fiat_value').text());
}
@ -257,23 +272,29 @@ function ExecuteSendCurrencyAPI() {
});
// Clear Send Dialog values and set them to blank
$('#mdl_currency_coin').text('');
$('#mdl_currency_balance').text('');
$('#mdl_currency_amount_label').text('');
$('#mdl_currency_total_coinname').text('');
$(
'#mdl_currency_coin,' +
'#mdl_currency_balance,' +
'#mdl_currency_amount_label,' +
'#mdl_currency_total_coinname'
)
.text('');
// Clear Confirm Dialog values and set them to blank
$('#mdl_confirm_currency_sendto_addr').text('');
$('#mdl_confirm_currency_send_amount').text('');
$('#mdl_confirm_currency_coinname').text('');
$('#mdl_confirm_currency_send_amount_fiat').text('');
$('#mdl_confirm_currency_send_fee').text('');
$('#mdl_confirm_currency_coinname_fee').text('');
$('#mdl_confirm_currency_send_fee_fiat').text('');
$('#mdl_confirm_currency_sendfrom_addr').text('');
$('#mdl_confirm_currency_sendfrom_total_dedcut').text('');
$('#mdl_confirm_currency_coinname_total').text('');
$('#mdl_confirm_currency_sendfrom_total_deduct_fiat').text('');
$(
'#mdl_confirm_currency_sendto_addr,' +
'#mdl_confirm_currency_send_amount,' +
'#mdl_confirm_currency_coinname,' +
'#mdl_confirm_currency_send_amount_fiat,' +
'#mdl_confirm_currency_send_fee,' +
'#mdl_confirm_currency_coinname_fee,' +
'#mdl_confirm_currency_send_fee_fiat,' +
'#mdl_confirm_currency_sendfrom_addr,' +
'#mdl_confirm_currency_sendfrom_total_dedcut,' +
'#mdl_confirm_currency_coinname_total,' +
'#mdl_confirm_currency_sendfrom_total_deduct_fiat'
)
.text('');
// Clean send dialog button fields
CurrencyMdlBtnClean();

500
assets/scripts/dashboard.js

@ -34,17 +34,28 @@ var Dashboard = function() {
$('#btn_edexcoin_dashboard').click(function() {
$('#btn_edexcoin_dashboard').hide();
$('#btn_edexcoin_send').show();
$('#btn_edexcoin_recieve').show();
$(
'#btn_edexcoin_send,' +
'#btn_edexcoin_recieve'
)
.show();
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin');
$('#edexcoin_getbalance_interest').hide();
$('#edexcoin_getbalance_total_interest').hide();
$('#edexcoin_getbalance_t').removeClass( 'col-lg-4' ).addClass( 'col-lg-12' );
$('#edex_interest_balance').text('-');
$('#edex_total_balance_interest').text('-');
$('#edex_total_balance').text('-');
$(
'#edexcoin_getbalance_interest,' +
'#edexcoin_getbalance_total_interest'
)
.hide();
$('#edexcoin_getbalance_t')
.removeClass( 'col-lg-4' )
.addClass( 'col-lg-12' );
$(
'#edex_interest_balance,' +
'#edex_total_balance_interest,' +
'#edex_total_balance'
)
.text('-');
$('#edex_total_balance_coincode').text(active_edexcoin);
if ( sessionStorage.getItem('edexTmpMode') === 'Full') {
@ -53,59 +64,100 @@ var Dashboard = function() {
if ( /*sessionStorage.getItem('edexTmpMode') === 'Basilisk' ||*/ sessionStorage.getItem('edexTmpMode') === 'Native' ) {
sessionStorage.setItem('edexTmpRefresh', 'stop');
}
$('#edexcoin_dashoard_section').show();
$('#edexcoin_dashboardinfo').show();
$('#edexcoin_send').hide();
$('#edexcoin_recieve').hide();
$('#edexcoin_recieve_section').hide();
$('#edexcoin_settings').hide();
$(
'#edexcoin_dashoard_section,' +
'#edexcoin_dashboardinfo'
)
.show();
$(
'#edexcoin_send,' +
'#edexcoin_recieve,' +
'#edexcoin_recieve_section,' +
'#edexcoin_settings'
)
.hide();
var selected_coinmode = sessionStorage.getItem('edexTmpMode');
if ( selected_coinmode == 'Basilisk' ) {
getDEXGetBalance_cache(active_edexcoin).then(function(result) {
getDEXGetBalance_cache(active_edexcoin)
.then(function(result) {
//console.log(result)
if ( result.interest !== undefined && active_edexcoin == 'KMD') {
$('#edexcoin_getbalance_interest').show();
$('#edexcoin_getbalance_total_interest').show();
$('#edexcoin_getbalance_t').removeClass( 'col-lg-12' ).addClass( 'col-lg-4' );
$(
'#edexcoin_getbalance_interest,' +
'#edexcoin_getbalance_total_interest'
)
.show();
$('#edexcoin_getbalance_t')
.removeClass( 'col-lg-12' )
.addClass( 'col-lg-4' );
$('#edex_interest_balance').text(result.interest);
$('#edex_total_balance_interest').text(result.totalbalance);
$('#edex_total_interest_coincode').text(active_edexcoin);
$('#edex_total_balance_interest_coincode').text(active_edexcoin);
$(
'#edex_total_interest_coincode,' +
'#edex_total_balance_interest_coincode'
)
.text(active_edexcoin);
}
if ( result.interest === undefined ) {
$('#edexcoin_getbalance_interest').hide();
$('#edexcoin_getbalance_total_interest').hide();
$('#edexcoin_getbalance_t').removeClass( 'col-lg-4' ).addClass( 'col-lg-12' );
$('#edex_interest_balance').text('-');
$('#edex_total_balance_interest').text('-');
$(
'#edexcoin_getbalance_interest,' +
'#edexcoin_getbalance_total_interest'
)
.hide();
$('#edexcoin_getbalance_t')
.removeClass( 'col-lg-4' )
.addClass( 'col-lg-12' );
$(
'#edex_interest_balance,' +
'#edex_total_balance_interest'
)
.text('-');
}
$('#edex_total_balance').text(result.total);
$('#edex_total_balance_coincode').text(active_edexcoin);
});
} else {
EDEXlistunspent(active_edexcoin).then(function(result) {
EDEXlistunspent(active_edexcoin)
.then(function(result) {
//console.log(result)
if (result[0] != undefined) {
//console.log(result[0])
if ( result[0].interest !== undefined ) {
$('#edexcoin_getbalance_interest').show();
$('#edexcoin_getbalance_total_interest').show();
$('#edexcoin_getbalance_t').removeClass( 'col-lg-12' ).addClass( 'col-lg-4' );
$(
'#edexcoin_getbalance_interest,' +
'#edexcoin_getbalance_total_interest'
)
.show();
$('#edexcoin_getbalance_t')
.removeClass( 'col-lg-12' )
.addClass( 'col-lg-4' );
$('#edex_interest_balance').text(result[0].interest);
$('#edex_total_balance_interest').text(result[0].totalbalance);
$('#edex_total_interest_coincode').text(active_edexcoin);
$('#edex_total_balance_interest_coincode').text(active_edexcoin);
$(
'#edex_total_interest_coincode,' +
'#edex_total_balance_interest_coincode'
)
.text(active_edexcoin);
}
if ( result[0].interest === undefined ) {
$('#edexcoin_getbalance_interest').hide();
$('#edexcoin_getbalance_total_interest').hide();
$('#edexcoin_getbalance_t').removeClass( 'col-lg-4' ).addClass( 'col-lg-12' );
$('#edex_interest_balance').text('-');
$('#edex_total_balance_interest').text('-');
$(
'#edexcoin_getbalance_interest,' +
'#edexcoin_getbalance_total_interest'
)
.hide();
$('#edexcoin_getbalance_t')
.removeClass( 'col-lg-4' )
.addClass( 'col-lg-12' );
$(
'#edex_interest_balance,' +
'#edex_total_balance_interest'
)
.text('-');
}
$('#edex_total_balance').text(result[0].total);
@ -123,59 +175,76 @@ var Dashboard = function() {
var handle_edex_send = function() {
$('.btn_refresh_edexcoin_send').click(function() {
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin');
var call_data = {"allcoins": false,"coin":'KMD',"calls":"refresh"}
console.log(call_data)
Shepherd_FetchBasiliskData(call_data).then(function(result){
console.log(result)
toastr.info('Refreshing Wallet Funds.', 'Wallet Notification');
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin'),
call_data = {
'allcoins': false,
'coin': 'KMD',
'calls': 'refresh'
};
console.log(call_data);
Shepherd_FetchBasiliskData(call_data)
.then(function(result) {
console.log(result);
toastr.info(_lang[defaultLang].TOASTR.REFRESHING_FUNDS, _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
})
});
$('#btn_edexcoin_send').click(function() {
$('#btn_edexcoin_dashboard').show();
$(
'#btn_edexcoin_dashboard,' +
'#btn_edexcoin_recieve'
)
.show();
$('#btn_edexcoin_send').hide();
$('#btn_edexcoin_recieve').show();
$('#edexcoin_dashboardinfo').hide();
$('#edexcoin_send').show();
$('#edexcoin_recieve').hide();
$('#edexcoin_recieve_section').hide();
$('#edexcoin_settings').hide();
$(
'#edexcoin_dashboardinfo,' +
'#edexcoin_recieve,' +
'#edexcoin_recieve_section,' +
'#edexcoin_settings'
)
.hide();
sessionStorage.setItem('edexTmpRefresh', 'stop');
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin');
var selected_coinmode = sessionStorage.getItem('edexTmpMode')
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin'),
selected_coinmode = sessionStorage.getItem('edexTmpMode')
// This send from part is only enabled now for Basilisk coins except BTC and SYS.
if (selected_coinmode == 'Basilisk' && active_edexcoin !== 'BTC' && active_edexcoin !== 'SYS' ) {
$('.edexcoin_send_from_for_basilisk').show()
EDEXgetaddrbyaccount_cache(active_edexcoin).then(function(result){
//console.log(result)
edexcoin_addr_list_with_balance = result
console.log(edexcoin_addr_list_with_balance);
$('.edexcoin_send_from_for_basilisk').show();
EDEXgetaddrbyaccount_cache(active_edexcoin)
.then(function(result){
var tmpoptions = '';
tmpoptions += '<option> ' + _lang[defaultLang].DASHBOARD.SELECT_ADDRESS +' </option>';
//console.log(result);
edexcoin_addr_list_with_balance = result;
console.log(edexcoin_addr_list_with_balance);
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);
});
$('.showedexcoinaddrs').selectpicker({ style: 'btn-info' });
$('.showedexcoinaddrs').selectpicker('refresh');
$('.showedexcoinaddrs')
.selectpicker({ style: 'btn-info' })
.selectpicker('refresh');
$('.edexcoin_send_coins_btn_step1').addClass('disabled');
$('.edexcoin_send_coins_btn_step1').attr('disabled','disabled');
$('.edexcoin_send_coins_btn_step1')
.addClass('disabled')
.attr('disabled','disabled');
})
} else {
$('.edexcoin_send_from_for_basilisk').hide()
$('.edexcoin_send_coins_btn_step1').removeClass('disabled');
$('.edexcoin_send_coins_btn_step1').removeAttr('disabled');
$('.edexcoin_send_from_for_basilisk').hide();
$('.edexcoin_send_coins_btn_step1')
.removeClass('disabled')
.removeAttr('disabled');
}
//clearEdexSendFieldData();
$('.edexcoin-send-form')[0].reset();
if ( selected_coinmode == 'Full' ) {
EDEXgetinfo(active_edexcoin).then(function(result) {
EDEXgetinfo(active_edexcoin)
.then(function(result) {
$('#edexcoin_fee').val(result.kbfee);
});
}
@ -188,24 +257,27 @@ var Dashboard = function() {
$('#edexcoin_send_from').change(function() {
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);
$('.edexcoin_send_coins_btn_step1')
.removeClass('disabled')
.prop('disabled', false);
Shepherd_GetBasiliskCache().then(function(result){
Shepherd_GetBasiliskCache()
.then(function(result) {
var _data = JSON.parse(result),
query = _data.result.basilisk,
active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin'),
coin_addr = $('#edexcoin_send_from').val();
if (!('refresh' in query[active_edexcoin][coin_addr])) {
console.log(active_edexcoin + '>>>' + coin_addr + ' => refresh not found.')
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) {
Shepherd_FetchBasiliskData(call_data)
.then(function(result) {
console.log(result);
});
} else {
@ -214,8 +286,9 @@ var Dashboard = function() {
})
}
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);
$('.edexcoin_send_coins_btn_step1')
.addClass(' disabled')
.prop('disabled', true);
}
})
@ -288,15 +361,16 @@ var Dashboard = function() {
});
NProgress.start();
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin');
var selected_coinmode = sessionStorage.getItem('edexTmpMode')
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin'),
selected_coinmode = sessionStorage.getItem('edexTmpMode');
console.log('Sent control here after clicked in form...');
if (selected_coinmode == 'Basilisk' && active_edexcoin !== 'BTC' && active_edexcoin !== 'SYS' ) {
$('#mdl_confirm_currency_sendfrom_addr').text($('#edexcoin_send_from').val());
} else {
EDEXMainAddr($('[data-edexcoin]').attr('data-edexcoin')).then(function(result) {
EDEXMainAddr($('[data-edexcoin]').attr('data-edexcoin'))
.then(function(result) {
$('#mdl_confirm_currency_sendfrom_addr').text(result);
});
}
@ -322,9 +396,15 @@ var Dashboard = function() {
$('#edexcoin-send-screen').hide();
$('#edexcoin-send-confirm-screen').show();
$('#edexcoin_send_step_1').removeClass( 'current' ).addClass( '' );
$('#edexcoin_send_step_2').removeClass( '' ).addClass( 'current' );
$('#edexcoin_send_step_3').removeClass( 'current' ).addClass( '' );
$(
'#edexcoin_send_step_1,' +
'#edexcoin_send_step_3'
)
.removeClass( 'current' )
.addClass( '' );
$('#edexcoin_send_step_2')
.removeClass( '' )
.addClass( 'current' );
NProgress.done();
}
@ -334,11 +414,11 @@ var Dashboard = function() {
//$('#edexcoin_send_coins_btn').prop('disabled', true);
console.log('==> After confirming tx to send')
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin'),
tmp_send_from_addr = $('#edexcoin_send_from').val()
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_sendflag = $('#edexcoin_send_sig').is(':checked');
console.log(active_edexcoin);
console.log(tmp_send_from_addr);
@ -355,8 +435,8 @@ var Dashboard = function() {
$('#edexcoin_sendto_result tbody').html(edexcoin_sendto_result_tbl);
$('#edexcoin_send_coins_anothertx_btn').hide();
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin');
var selected_coinmode = sessionStorage.getItem('edexTmpMode')
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin'),
selected_coinmode = sessionStorage.getItem('edexTmpMode');
if (selected_coinmode == 'Basilisk' && active_edexcoin !== 'BTC' && active_edexcoin !== 'SYS' ) {
var tmp_json_data = {
@ -368,7 +448,7 @@ var Dashboard = function() {
'sendsig': tmp_sendflag
};
console.log(tmp_json_data);
EDEXSendutxoRawTx(tmp_json_data)
EDEXSendutxoRawTx(tmp_json_data);
} else {
var tmp_json_data = {
'coin': active_edexcoin,
@ -381,25 +461,42 @@ var Dashboard = function() {
$('.edexcoin-send-form')[0].reset();
$('#edexcoin_total_value').text('0.000');
$('#edexcoin-send-confirm-screen').hide();
$('#edexcoin-send-txdetails-screen').show();
$('#edexcoin-send-txdetails-screen').data('panel-api').load();
$('#edexcoin-send-txdetails-screen')
.show()
.data('panel-api')
.load();
edexcoin_send_form_validator.resetForm();
$('#edexcoin_send_step_1').removeClass( 'current' ).addClass( '' );
$('#edexcoin_send_step_2').removeClass( 'current' ).addClass( '' );
$('#edexcoin_send_step_3').removeClass( '' ).addClass( 'current' );
$(
'#edexcoin_send_step_1,' +
'#edexcoin_send_step_2'
)
.removeClass( 'current' )
.addClass( '' );
$('#edexcoin_send_step_3')
.removeClass( '' )
.addClass( 'current' );
});
$('#edexcoin_send_coins_back_btn').click(function() {
$('#edexcoin-send-confirm-screen').hide();
$('#edexcoin-send-txdetails-screen').hide();
$(
'#edexcoin-send-confirm-screen,' +
'#edexcoin-send-txdetails-screen'
)
.hide();
$('#edexcoin-send-screen').show();
var active_edexcoin = '',
tmp_send_to_addr = '',
tmp_send_total_amount = '';
edexcoin_send_form_validator.resetForm();
$('#edexcoin_send_step_1').removeClass( '' ).addClass( 'current' );
$('#edexcoin_send_step_2').removeClass( 'current' ).addClass( '' );
$('#edexcoin_send_step_3').removeClass( 'current' ).addClass( '' );
$('#edexcoin_send_step_1')
.removeClass( '' )
.addClass( 'current' );
$(
'#edexcoin_send_step_2,' +
'#edexcoin_send_step_3'
)
.removeClass( 'current' )
.addClass( '' );
});
$('#edexcoin_send_coins_anothertx_btn').click(function() {
@ -429,17 +526,26 @@ var Dashboard = function() {
var handle_edex_recieve = function() {
$('#btn_edexcoin_recieve').click(function() {
$('#btn_edexcoin_dashboard').show();
$('#btn_edexcoin_send').show();
$(
'#btn_edexcoin_dashboard,' +
'#btn_edexcoin_send'
)
.show();
$('#btn_edexcoin_recieve').hide();
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin');
sessionStorage.setItem('edexTmpRefresh', 'stop');
$('#edexcoin_dashboardinfo').hide();
$('#edexcoin_dashoard_section').hide();
$('#edexcoin_send').hide();
$('#edexcoin_recieve').show();
$('#edexcoin_recieve_section').show();
$('#edexcoin_settings').hide();
$(
'#edexcoin_dashboardinfo,' +
'#edexcoin_dashoard_section,' +
'#edexcoin_send,' +
'#edexcoin_settings'
)
.hide();
$(
'#edexcoin_recieve,' +
'#edexcoin_recieve_section'
)
.show();
EdexListAllAddr(active_edexcoin);
$('.edexcoin-send-form')[0].reset();
});
@ -772,19 +878,19 @@ var Dashboard = function() {
break;
}
walletDivContent += '<!-- Wallet Widget ' + AllcoinsDataOutput[value][index] + ' -->';
walletDivContent += '<div class="list-group-item col-xlg-6 col-lg-12 wallet-widgets-info" data-edexcoincode="' + AllcoinsDataOutput[value][index] + '">';
walletDivContent += '<div class="widget widget-shadow">';
walletDivContent += '<div class="widget-content text-center bg-white padding-20 edexcoin-logo" data-edexcoincode="' + AllcoinsDataOutput[value][index] + '" data-edexcoinmodecode="' + modecode + '" data-edexcoinname="' + coinname + '">';
walletDivContent += '<a class="avatar margin-bottom-5" href="javascript:void(0)" id="edexcoin-logo">';
walletDivContent += '<img class="img-responsive" src="assets/images/cryptologo/' + coinlogo + '.png" alt="' + coinname + '"/>';
walletDivContent += '<span class="badge up badge-' + modecolor + '" id="basfull" data-edexcoincode="' + AllcoinsDataOutput[value][index] + '" data-toggle="tooltip" data-placement="top" data-original-title="' + modetip + '">' + modecode + '</span>';
walletDivContent += '</a>';
walletDivContent += '<div class="coin-name">' + coinname + '</div>';
walletDivContent += '</div>';
walletDivContent += '</div>';
walletDivContent += '</div>';
walletDivContent += '<!-- End Wallet Widget ' + AllcoinsDataOutput[value][index] + ' -->';
walletDivContent += '<!-- Wallet Widget ' + AllcoinsDataOutput[value][index] + ' -->' +
'<div class="list-group-item col-xlg-6 col-lg-12 wallet-widgets-info" data-edexcoincode="' + AllcoinsDataOutput[value][index] + '">' +
'<div class="widget widget-shadow">' +
'<div class="widget-content text-center bg-white padding-20 edexcoin-logo" data-edexcoincode="' + AllcoinsDataOutput[value][index] + '" data-edexcoinmodecode="' + modecode + '" data-edexcoinname="' + coinname + '">' +
'<a class="avatar margin-bottom-5" href="javascript:void(0)" id="edexcoin-logo">' +
'<img class="img-responsive" src="assets/images/cryptologo/' + coinlogo + '.png" alt="' + coinname + '"/>' +
'<span class="badge up badge-' + modecolor + '" id="basfull" data-edexcoincode="' + AllcoinsDataOutput[value][index] + '" data-toggle="tooltip" data-placement="top" data-original-title="' + modetip + '">' + modecode + '</span>' +
'</a>' +
'<div class="coin-name">' + coinname + '</div>' +
'</div>' +
'</div>' +
'</div>' +
'<!-- End Wallet Widget ' + AllcoinsDataOutput[value][index] + ' -->';
$('.wallet-widgets-row').html(walletDivContent);
$('.scrollbar-dynamic').scrollbar(); // Make sure widget-body has scrollbar for transactions history
@ -811,8 +917,9 @@ var Dashboard = function() {
var handleWalletWidgetBtns = function() {
$('#addcoin_mdl_native_mode').prop('disabled', true);
$('#addcoin_mdl_basilisk_mode').prop('disabled', true);
$('#addcoin_mdl_full_mode').prop('disabled', true);
$('#addcoin_mdl_full_mode').prop('checked', false);
$('#addcoin_mdl_full_mode')
.prop('disabled', true)
.prop('checked', false);
$('.mdl_addcoin_done_btn').click(function(){
ExecuteAddCoinFn();
@ -824,73 +931,78 @@ var Dashboard = function() {
if (tmp_coin_val !== 'KMD' || tmp_coin_val !== 'KMD' ) {
$('#addcoin_mdl_native_mode').prop('disabled', true);
$('#addcoin_mdl_basilisk_mode').prop('disabled', true);
$('#addcoin_mdl_full_mode').prop('disabled', false);
$('#addcoin_mdl_full_mode').prop('checked', true);
$('#addcoin_mdl_full_mode')
.prop('disabled', false)
.prop('checked', true);
}
if (tmp_coin_val == 'KMD') {
$('#addcoin_mdl_native_mode').prop('disabled', false);
$('#addcoin_mdl_basilisk_mode').prop('disabled', false);
$('#addcoin_mdl_basilisk_mode')
.prop('disabled', false)
.prop('checked', true);
$('#addcoin_mdl_full_mode').prop('disabled', false);
$('#addcoin_mdl_basilisk_mode').prop('checked', true);
}
if (tmp_coin_val == 'SUPERNET'
|| tmp_coin_val == 'REVS'
|| tmp_coin_val == 'WIRELESS'
|| tmp_coin_val == 'DEX'
|| tmp_coin_val == 'PANGEA'
|| tmp_coin_val == 'JUMBLR'
|| tmp_coin_val == 'BET'
|| tmp_coin_val == 'CRYPTO'
|| tmp_coin_val == 'HODL'
|| tmp_coin_val == 'SHARK'
|| tmp_coin_val == 'BOTS'
|| tmp_coin_val == 'MGW'
|| tmp_coin_val == 'MVP'
|| tmp_coin_val == 'KV'
|| tmp_coin_val == 'CEAL'
|| tmp_coin_val == 'MESH'
|| tmp_coin_val == 'USD'
|| tmp_coin_val == 'RON'
|| tmp_coin_val == 'EUR'
|| tmp_coin_val == 'JPY'
|| tmp_coin_val == 'GBP'
|| tmp_coin_val == 'AUD'
|| tmp_coin_val == 'CAD'
|| tmp_coin_val == 'CHF'
|| tmp_coin_val == 'NZD'
|| tmp_coin_val == 'CNY'
|| tmp_coin_val == 'RUB'
|| tmp_coin_val == 'MXN'
|| tmp_coin_val == 'BRL'
|| tmp_coin_val == 'INR'
|| tmp_coin_val == 'HKD'
|| tmp_coin_val == 'TRY'
|| tmp_coin_val == 'ZAR'
|| tmp_coin_val == 'PLN'
|| tmp_coin_val == 'NOK'
|| tmp_coin_val == 'SEK'
|| tmp_coin_val == 'DKK'
|| tmp_coin_val == 'CZK'
|| tmp_coin_val == 'HUF'
|| tmp_coin_val == 'ILS'
|| tmp_coin_val == 'KRW'
|| tmp_coin_val == 'MYR'
|| tmp_coin_val == 'PHP'
|| tmp_coin_val == 'SGD'
|| tmp_coin_val == 'THB'
|| tmp_coin_val == 'BGN'
|| tmp_coin_val == 'IDR'
|| tmp_coin_val == 'HRK' ) {
if (tmp_coin_val == 'SUPERNET' ||
tmp_coin_val == 'REVS' ||
tmp_coin_val == 'WIRELESS' ||
tmp_coin_val == 'DEX' ||
tmp_coin_val == 'PANGEA' ||
tmp_coin_val == 'JUMBLR' ||
tmp_coin_val == 'BET' ||
tmp_coin_val == 'CRYPTO' ||
tmp_coin_val == 'HODL' ||
tmp_coin_val == 'SHARK' ||
tmp_coin_val == 'BOTS' ||
tmp_coin_val == 'MGW' ||
tmp_coin_val == 'MVP' ||
tmp_coin_val == 'KV' ||
tmp_coin_val == 'CEAL' ||
tmp_coin_val == 'MESH' ||
tmp_coin_val == 'USD' ||
tmp_coin_val == 'RON' ||
tmp_coin_val == 'EUR' ||
tmp_coin_val == 'JPY' ||
tmp_coin_val == 'GBP' ||
tmp_coin_val == 'AUD' ||
tmp_coin_val == 'CAD' ||
tmp_coin_val == 'CHF' ||
tmp_coin_val == 'NZD' ||
tmp_coin_val == 'CNY' ||
tmp_coin_val == 'RUB' ||
tmp_coin_val == 'MXN' ||
tmp_coin_val == 'BRL' ||
tmp_coin_val == 'INR' ||
tmp_coin_val == 'HKD' ||
tmp_coin_val == 'TRY' ||
tmp_coin_val == 'ZAR' ||
tmp_coin_val == 'PLN' ||
tmp_coin_val == 'NOK' ||
tmp_coin_val == 'SEK' ||
tmp_coin_val == 'DKK' ||
tmp_coin_val == 'CZK' ||
tmp_coin_val == 'HUF' ||
tmp_coin_val == 'ILS' ||
tmp_coin_val == 'KRW' ||
tmp_coin_val == 'MYR' ||
tmp_coin_val == 'PHP' ||
tmp_coin_val == 'SGD' ||
tmp_coin_val == 'THB' ||
tmp_coin_val == 'BGN' ||
tmp_coin_val == 'IDR' ||
tmp_coin_val == 'HRK') {
$('#addcoin_mdl_native_mode').prop('disabled', false);
$('#addcoin_mdl_basilisk_mode').prop('disabled', false);
$('#addcoin_mdl_basilisk_mode')
.prop('disabled', false)
.prop('checked', true);
$('#addcoin_mdl_full_mode').prop('disabled', true);
$('#addcoin_mdl_basilisk_mode').prop('checked', true);
}
if (tmp_coin_val == 'BTC') {
$('#addcoin_mdl_basilisk_mode').prop('disabled', false);
$('#addcoin_mdl_basilisk_mode')
.prop('disabled', false)
.prop('checked', true);
$('#addcoin_mdl_native_mode').prop('disabled', true);
$('#addcoin_mdl_full_mode').prop('disabled', false);
$('#addcoin_mdl_basilisk_mode').prop('checked', true);
}
});
}
@ -906,24 +1018,28 @@ var Dashboard = function() {
$('.btn_edexcoin_dashboard_register').click(function() {
var selected_coin = $(this).data('edexcoin');
EDEXMainAddr(selected_coin).then(function(result){
EDEXMainAddr(selected_coin)
.then(function(result){
Iguana_DEXImportAllWalletAddr(selected_coin);
});
});
$('.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);
Shepherd_CheckBasiliskCacheData(selected_coin)
.then(function(result) {
var call_data = {
'allcoins': false,
'coin': selected_coin,
'calls': 'listtransactions:getbalance'
};
console.log(result);
console.log(result.coin);
console.log(call_data);
Shepherd_FetchBasiliskData(call_data).then(function(result) {
Shepherd_FetchBasiliskData(call_data)
.then(function(result) {
console.log(result);
toastr.info(_lang[defaultLang].TOASTR.FETCHING_DATA, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION);
});
@ -932,7 +1048,9 @@ var Dashboard = function() {
$('.btn_edexcoin_dashboard_refetchdata').click(function() {
var selected_coin = $(this).data('edexcoin');
Shepherd_GroomData_Delete().then(function(result) {
Shepherd_GroomData_Delete()
.then(function(result) {
var call_data = {
'allcoins': false,
'coin': selected_coin,
@ -940,7 +1058,8 @@ var Dashboard = function() {
};
console.log(call_data);
Shepherd_FetchBasiliskData(call_data).then(function(result) {
Shepherd_FetchBasiliskData(call_data)
.then(function(result) {
console.log(result);
toastr.info(_lang[defaultLang].TOASTR.FETCHING_DATA, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION);
});
@ -951,19 +1070,22 @@ var Dashboard = function() {
var show_mdl = setTimeout(function() {
var selected_coin = $(this).data('edexcoin');
$('#RefreshBasiliskConnectionsMdl').modal('show');
}, 0)
var start_refresh = setTimeout(function() {
}, 0),
start_refresh = setTimeout(function() {
EDEX_DEXgetinfoAll();
}, 3000)
}, 3000);
Promise.all([show_mdl, start_refresh]).then(function() {
Promise.all([show_mdl, start_refresh])
.then(function() {
console.log('all promises executed!!!');
});
});
$('.btn_edexcoin_dashboard_validate').click(function() {
var selected_coin = $(this).data('edexcoin');
EDEXMainAddr(selected_coin).then(function(result) {
EDEXMainAddr(selected_coin)
.then(function(result) {
Iguana_DEXValidateAddr(selected_coin, result);
});
});
@ -1001,7 +1123,6 @@ var Dashboard = function() {
active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode');
// TODO: refactor
if ( active_edexcoinmodecode == 'Basilisk' || active_edexcoinmodecode == 'Native' ) {
//console.log(active_edexcoinmodecode)
//console.log('No need to show Progress bar for Native or Basilisk mode.')
@ -1019,14 +1140,14 @@ var Dashboard = function() {
//clearInterval(CheckIfIguanaRunning);
//console.log('=> No wallet logged in, or Dashboard not ative. No need to Run History.');
} else {
Iguana_activehandle().then(function(result){
Iguana_activehandle()
.then(function(result){
//console.log(result)
//console.log("Iguana is running");
});
}
}, 1000);
var FetchBasiliskData = setInterval(function() {
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin'),
active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode');
@ -1043,7 +1164,8 @@ var Dashboard = function() {
};
//console.log(call_data)
if ( sessionStorage.getItem('edexTmpRefresh') === null || sessionStorage.getItem('edexTmpRefresh') === 'start') {
Shepherd_FetchBasiliskData(call_data).then(function(result) {
Shepherd_FetchBasiliskData(call_data)
.then(function(result) {
console.log(result);
});
}
@ -1074,8 +1196,8 @@ var Dashboard = function() {
if ( $('[data-edexcoin]').attr('data-edexcoin') !== 'COIN' ) {
if ( sessionStorage.getItem('edexTmpMode') !== null || sessionStorage.getItem('edexTmpMode') === 'Basilisk') {
if ( sessionStorage.getItem('edexTmpRefresh') === null || sessionStorage.getItem('edexTmpRefresh') === 'start') {
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin')
var active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode');
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin'),
active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode');
if (active_edexcoinmodecode === 'Basilisk') {
ShowBasiliskFetchDataProgress(active_edexcoin);
}

16
assets/scripts/dashboard/DashboardEDEX.js

@ -74,7 +74,7 @@ function refreshEDEXCoinWalletList() {
'native',
'basilisk',
'full'
], function( index, value ) {
],function( index, value ) {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
@ -522,7 +522,8 @@ function EdexGetTxList(coin) {
url: 'http://127.0.0.1:' + config.iguanaPort,
type: 'POST',
dataType: 'json'
}).then(data => {
})
.then(data => {
if ( active_edexcoinmodecode == 'Full' ) {
data = data.result;
}
@ -996,9 +997,9 @@ function EdexListAllAddr(coin) {
if (active_edexcoinmodecode == 'Basilisk' && coin !== 'BTC' && coin !== 'SYS') {
EDEXgetaddrbyaccount_cache(coin)
.then(function(result) {
console.log(result);
var only_reciving_addr_data = [];
console.log(result);
$.each(result, function(index, value) {
if (value.interest == undefined || coin !== 'KMD') {
console.log('interest is undefined');
@ -1036,9 +1037,9 @@ function EdexListAllAddr(coin) {
} else if (active_edexcoinmodecode == 'Basilisk' ) {
EDEXgetaddrbyaccount(coin)
.then(function(result){
console.log(result);
var only_reciving_addr_data = [];
console.log(result);
$.each(result, function(index, value) {
if (value.interest == undefined || coin !== 'KMD') {
console.log('interest is undefined');
@ -1078,9 +1079,9 @@ function EdexListAllAddr(coin) {
if (active_edexcoinmodecode == 'Full') {
EDEXgetaddrbyaccount(coin)
.then(function(result) {
console.log(result);
var only_reciving_addr_data = [];
console.log(result);
$.each(result, function(index, value) {
if (value.interest == undefined || coin !== 'KMD') {
console.log('interest is undefined');
@ -1324,7 +1325,8 @@ function edexCoinBtnAction() {
$(
'#edexcoin_getbalance_interest,' +
'#edexcoin_getbalance_total_interest'
).show();
)
.show();
$('#edexcoin_getbalance_t')
.removeClass( 'col-lg-12' )
.addClass( 'col-lg-4' );
@ -1422,7 +1424,7 @@ function edexCoinBtnAction() {
selected_coin == 'HRK') {
sessionStorage.setItem('edexTmpMode', selected_coinmode);
sessionStorage.setItem('edexTmpRefresh', 'start');
assetchain_pax_menu_actions(selected_coin)
assetchain_pax_menu_actions(selected_coin);
}
}
});

9
assets/scripts/iguana_api.js

@ -129,11 +129,12 @@ function Iguana_HashHex(data) {
console.log(error);
}
});
return result;
}
function Iguana_SetRPCAuth() {
var tmpPass = 1234; // md5(PassPhraseGenerator.generatePassPhrase(128));
var tmpPass = md5(PassPhraseGenerator.generatePassPhrase(128));
sessionStorage.setItem('IguanaRPCAuth', tmpPass);
}
@ -159,7 +160,8 @@ function Iguana_CheckActiveCoins() {
}
});
resolve(result);
}).fail(function(xhr, textStatus, error) {
})
.fail(function(xhr, textStatus, error) {
// handle request failures
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
@ -195,7 +197,8 @@ function Iguana_utxorawtx(data) {
url: 'http://127.0.0.1:' + config.iguanaPort,
type: 'POST',
dataType: 'json'
}).then(result => {
})
.then(result => {
//console.log(result);
resolve(result);
});

2
assets/scripts/iguana_api/IguanaAddcoin.js

@ -198,6 +198,8 @@
}, tmpinternval);
}*/
// TODO: refactor
function Iguana_addcoin(addcoin_data) {
var tmpinternval = 0,
logincoinfullname = '',

8
assets/scripts/iguana_api/IguanaDEX.js

@ -428,7 +428,7 @@ function EDEX_DEXlistunspent(coin, addr) {
result.push([{ 'amount': 0 }]);
}
if (AjaxOutputData.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].TOASTR.BASILISK_NOTIFICATION);
}
resolve(AjaxOutputData);
})
@ -530,7 +530,7 @@ function EDEX_DEXgetinfoAll() {
refresh_percent = parseFloat(parseInt(coin_index, 10) * 100) / parseInt(get_dex_notarychains.length, 10);
console.log(refresh_percent);
$('#basilisk-connections-refresh-title').text('Connection status... ' + tmp_index + '/' + get_dex_notarychains.length + ': ' + coin_value);
$('#basilisk-connections-refresh-title').text(_lang[defaultLang].IAPI.CON_STATUS + '... ' + tmp_index + '/' + get_dex_notarychains.length + ': ' + coin_value);
$('#basilisk-connections-refresh-percent').text(refresh_percent + '%');
$('#basilisk-connections-refresh-progress-bar').width(refresh_percent + '%');
@ -539,7 +539,7 @@ function EDEX_DEXgetinfoAll() {
}
result.push(getinfo_each_chain);
if (getinfo_each_chain.error === 'less than required responses') {
toastr.info('Less than required responses for ' + coin_value + '.', 'Basilisk Notification');
toastr.info(_lang[defaultLang].TOASTR.LESS_RESPONSES_REQ_FOR + ' ' + coin_value + '.', _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION);
$('#basilisk-connections-refresh-status-output').text('Output: ' + getinfo_each_chain.error);
} else {
$('#basilisk-connections-refresh-status-output').text('Output: Connected');
@ -547,7 +547,7 @@ function EDEX_DEXgetinfoAll() {
if ( tmp_index == get_dex_notarychains.length-1 ) {
$('#basilisk-connections-refresh-progress-bar').width('100%');
$('#RefreshBasiliskConnectionsMdl').modal('hide');
toastr.success('Basilsk nodes connections refreshed.', 'Basilisk Notification');
toastr.success(_lang[defaultLang].TOASTR.BASILISK_CON_REFRESHED + '.', _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION);
}
});
}

190
assets/scripts/iguana_api/IguanaEDEX.js

@ -105,7 +105,8 @@ function EDEXlistunspent(coin, addr) {
});
resolve(result);
}).fail(function(xhr, textStatus, error) {
})
.fail(function(xhr, textStatus, error) {
// handle request failures
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
@ -121,9 +122,12 @@ function EDEXlistunspent(coin, addr) {
function clearEdexSendFieldData() {
$('.showedexcoinaddrs').selectpicker('refresh');
$('#edexcoin_sendto').val('');
$(
'#edexcoin_sendto,' +
'#edexcoin_amount'
)
.val('');
$('#edexcoin_total_value').text('');
$('#edexcoin_amount').val('');
}
function EDEXMainAddr(coin) {
@ -155,7 +159,8 @@ function EDEXMainAddr(coin) {
tmp_coin_addr = data[coin];
resolve(tmp_coin_addr);
NProgress.done();
}).fail(function(xhr, textStatus, error) {
})
.fail(function(xhr, textStatus, error) {
// handle request failures
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
@ -201,7 +206,8 @@ function EDEXgetBalance(coin) {
}
function EDEXSendutxoRawTx(data) {
Shepherd_GetBasiliskCache().then(function(result) {
Shepherd_GetBasiliskCache()
.then(function(result) {
var _data = JSON.parse(result),
query = _data.result.basilisk,
utxos_set = query[data.coin][data.sendfrom].refresh.data,
@ -216,22 +222,25 @@ function EDEXSendutxoRawTx(data) {
};
// console.log(send_data)
Iguana_utxorawtx(send_data).then(function(result) {
console.log(result);
Iguana_utxorawtx(send_data)
.then(function(result) {
var edexcoin_sendto_result_tbl = '';
console.log(result);
if (result.result == 'success') {
console.log(send_data)
console.log(send_data);
toastr.success(_lang[defaultLang].TOASTR.SIGNED_TX_GENERATED + '.', _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
}
if (send_data.sendsig == 1) {
console.log(send_data)
console.log(send_data);
toastr.info(_lang[defaultLang].TOASTR.SENDING_TX + '.', _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
ajax_data_dexrawtx = {
'signedtx': result.signedtx,
'coin': send_data.coin
};
Iguana_DEXsendrawtx(ajax_data_dexrawtx).then(function(dexrwatx_result) {
Iguana_DEXsendrawtx(ajax_data_dexrawtx)
.then(function(dexrwatx_result) {
console.log(dexrwatx_result);
if (dexrwatx_result.error == undefined) {
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin');
@ -242,26 +251,26 @@ function EDEXSendutxoRawTx(data) {
'<td>' +
'<span class="label label-success">' + result.result + '</span>' +
'</td>' +
'</tr>';
edexcoin_sendto_result_tbl += '<tr class="">' +
'</tr>' +
'<tr class="">' +
'<td>completed</td>' +
'<td>' +
'<span class="label label-primary">' + result.completed + '</span>' +
'</td>' +
'</tr>';
edexcoin_sendto_result_tbl += '<tr class="">' +
'</tr>' +
'<tr class="">' +
'<td>rawtx</td>' +
'<td>' +
'<span style="display: block; width: 400px;word-wrap: break-word;">' + result.rawtx + '</span>' +
'</td>' +
'</tr>';
edexcoin_sendto_result_tbl += '<tr>' +
'</tr>' +
'<tr>' +
'<td>txid</td>' +
'<td>' +
'<a href="javascript:void(0)" data-edexcoin="' + active_edexcoin + '" data-sendtotxresult="' + dexrwatx_result + '" class="edexcoin_sendto_output_result">' + dexrwatx_result + '</a>' +
'</td>' +
'</tr>';
edexcoin_sendto_result_tbl += '<tr class="">' +
'</tr>' +
'<tr class="">' +
'<td>signedtx</td>' +
'<td>' +
'<span style="display: block; width: 400px;word-wrap: break-word;">' + result.signedtx + '</span>' +
@ -274,7 +283,9 @@ function EDEXSendutxoRawTx(data) {
var gettxiddata = function() {
return new Promise(function(resolve, reject) {
toastr.info(_lang[defaultLang].TOASTR.GETTING_TXID_INFO + '.', _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
EDEXgettransaction(ajax_data_dexrawtx.coin,dexrwatx_result).then(function(result) {
EDEXgettransaction(ajax_data_dexrawtx.coin,dexrwatx_result)
.then(function(result) {
//console.log(result);
resolve(result);
});
@ -285,7 +296,8 @@ function EDEXSendutxoRawTx(data) {
return new Promise(function(resolve, reject) {
//console.log(gettxdata)
//console.log(utxos_set)
EDEX_GetTxIDList(gettxdata).then(function(get_txid_list) {
EDEX_GetTxIDList(gettxdata)
.then(function(get_txid_list) {
console.log(get_txid_list)
resolve(get_txid_list);
});
@ -301,7 +313,8 @@ function EDEXSendutxoRawTx(data) {
console.log(get_txid_list);
//console.log(send_data)
//console.log(send_data.sendfrom)
Shepherd_GroomData_Get().then(function(result) {
Shepherd_GroomData_Get()
.then(function(result) {
console.log(result);
/*console.log(result.basilisk.KMD[send_data.sendfrom].refresh);
delete result.basilisk.KMD[send_data.sendfrom].refresh.data;
@ -320,7 +333,9 @@ function EDEXSendutxoRawTx(data) {
var save_new_cache_data = function(save_this_data) {
return new Promise(function(resolve, reject) {
console.log(save_this_data);
Shepherd_GroomData_Post(save_this_data).then(function(result) {
Shepherd_GroomData_Post(save_this_data)
.then(function(result) {
console.log(result);
resolve(result);
});
@ -353,17 +368,17 @@ function EDEXSendutxoRawTx(data) {
'<td>' +
'<span class="label label-dark">' + dexrwatx_result.result + '</span>' +
'</td>' +
'</tr>';
edexcoin_sendto_result_tbl += '<tr class="">' +
'</tr>' +
'<tr class="">' +
'<td>error</td>' +
'<td>' +
'<span class="label label-danger">' + dexrwatx_result.error + '</span>' +
'</td>' +
'</tr>';
edexcoin_sendto_result_tbl += '<tr class="">' +
'</tr>' +
'<tr class="">' +
'<td>signedtx</td>' +
'<td>' +
'<span style="display: block; width: 400px;word-wrap: break-word;">' + ajax_data_dexrawtx.signedtx + '</span>' +
'<span style="display: block; width: 400px; word-wrap: break-word">' + ajax_data_dexrawtx.signedtx + '</span>' +
'</td>' +
'</tr>';
$('#edexcoin_sendto_result tbody').html(edexcoin_sendto_result_tbl);
@ -376,7 +391,9 @@ function EDEXSendutxoRawTx(data) {
'calls': 'refresh'
};
console.log(call_data);
Shepherd_FetchBasiliskData(call_data).then(function(result) {
Shepherd_FetchBasiliskData(call_data)
.then(function(result) {
console.log(result);
toastr.info(_lang[defaultLang].TOASTR.REFRESHING_FUNDS + '.', _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
});
@ -384,38 +401,39 @@ function EDEXSendutxoRawTx(data) {
});
}
if (send_data.sendsig == 0) {
console.log(send_data);
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin');
console.log(send_data);
//toastr.success('Signed Transaction Generated.', 'Wallet Notification');
edexcoin_sendto_result_tbl += '<tr class="">' +
'<td>result</td>' +
'<td>' +
'<span class="label label-success">' + result.result + '</span>' +
'</td>' +
'</tr>';
edexcoin_sendto_result_tbl += '<tr class="">' +
'</tr>' +
'<tr class="">' +
'<td>completed</td>' +
'<td>' +
'<span class="label label-primary">' + result.completed + '</span>' +
'</td>' +
'</tr>';
edexcoin_sendto_result_tbl += '<tr class="">' +
'</tr>' +
'<tr class="">' +
'<td>rawtx</td>' +
'<td>' +
'<span style="display: block; width: 400px;word-wrap: break-word;">' + result.rawtx + '</span>' +
'<span style="display: block; width: 400px; word-wrap: break-word">' + result.rawtx + '</span>' +
'</td>' +
'</tr>';
edexcoin_sendto_result_tbl += '<tr>' +
'</tr>' +
'<tr>' +
'<td>txid</td>' +
'<td>' +
'<a href="javascript:void(0)" data-edexcoin="' + active_edexcoin + '" data-sendtotxresult="' + result.txid + '" class="edexcoin_sendto_output_result">' + result.txid + '</a>' +
'</td>' +
'</tr>';
edexcoin_sendto_result_tbl += '<tr class="">' +
'</tr>' +
'<tr class="">' +
'<td>signedtx</td>' +
'<td>' +
'<span style="display: block; width: 400px;word-wrap: break-word;">' + result.signedtx + '</span>' +
'<span style="display: block; width: 400px; word-wrap: break-word">' + result.signedtx + '</span>' +
'</td>' +
'</tr>';
$('#edexcoin_sendto_result tbody').html(edexcoin_sendto_result_tbl);
@ -427,8 +445,10 @@ function EDEXSendutxoRawTx(data) {
'coin': 'KMD',
'calls': 'refresh'
};
console.log(call_data)
Shepherd_FetchBasiliskData(call_data).then(function(result) {
console.log(call_data);
Shepherd_FetchBasiliskData(call_data)
.then(function(result) {
console.log(result);
toastr.info(_lang[defaultLang].TOASTR.REFRESHING_FUNDS, _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
});
@ -491,20 +511,20 @@ function EDEXSendToAddr(data) {
'<td>' +
'<span class="label label-info">' + SendToAddrData.complete + '</span>' +
'</td>' +
'</tr>';
edexcoin_sendto_result_tbl += '<tr>' +
'</tr>' +
'<tr>' +
'<td>result</td>' +
'<td>' +
'<a href="javascript:void(0)" data-edexcoin="' + active_edexcoin + '" data-sendtotxresult="' + SendToAddrData.result + '" class="edexcoin_sendto_output_result">' + SendToAddrData.result + '</a>' +
'</td>' +
'</tr>';
edexcoin_sendto_result_tbl += '<tr class="">' +
'</tr>' +
'<tr class="">' +
'<td>sendrawtransaction</td>' +
'<td>' +
'<span class="label label-primary">' + SendToAddrData.sendrawtransaction + '</span>' +
'</td>' +
'</tr>';
edexcoin_sendto_result_tbl += '<tr class="">' +
'</tr>' +
'<tr class="">' +
'<td>signedtx</td>' +
'<td>' +
'<span style="display: block; width: 400px;word-wrap: break-word;">' + SendToAddrData.signedtx + '</span>' +
@ -518,7 +538,9 @@ function EDEXSendToAddr(data) {
var selected_coinmode = sessionStorage.getItem('edexTmpMode');
if ( selected_coinmode == 'Basilisk' ) {
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin');
getDEXGetBalance(active_edexcoin).then(function(result) {
getDEXGetBalance(active_edexcoin)
.then(function(result) {
$('#edex_total_balance').text(result.total);
});
} else {
@ -562,7 +584,8 @@ function EDEXgetinfo(coin) {
AjaxOutputData = IguanaAJAX('http://127.0.0.1:' + config.iguanaPort, ajax_data).done(function(data) {
AjaxOutputData = JSON.parse(AjaxOutputData.responseText);
resolve(AjaxOutputData);
}).fail(function(xhr, textStatus, error) {
})
.fail(function(xhr, textStatus, error) {
// handle request failures
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
@ -570,7 +593,7 @@ function EDEXgetinfo(coin) {
console.log(textStatus);
console.log(error);
});
})
});
}
function EDEXgettransaction(coin,txid) {
@ -581,7 +604,7 @@ function EDEXgettransaction(coin,txid) {
'symbol': coin,
'agent': 'dex',
'method': 'gettransaction',
'vout':1,
'vout': 1,
'txid': txid
};
@ -590,12 +613,14 @@ function EDEXgettransaction(coin,txid) {
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort
}).then(function(data) {
})
.then(function(data) {
//console.log(data);
res_data = JSON.parse(data);
//console.log(res_data);
resolve(res_data);
}).fail(function(xhr, textStatus, error) {
})
.fail(function(xhr, textStatus, error) {
// handle request failures
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
@ -620,7 +645,8 @@ function EDEXgettransaction(coin,txid) {
function EDEXgetaddrbyaccount_cache(coin) {
return new Promise((resolve) => {
Shepherd_GetBasiliskCache().then(function(result) {
Shepherd_GetBasiliskCache()
.then(function(result) {
var _data = JSON.parse(result),
query = _data.result.basilisk,
tmp_addr_label = '<span class="label label-default">' +
@ -713,7 +739,8 @@ function EDEXgetaddrbyaccount(coin) {
url: 'http://127.0.0.1:' + config.iguanaPort,
type: 'POST',
dataType: 'json'
}).then(data => {
})
.then(data => {
if (data.interest !== undefined) {
var pass_data = {
'label': tmp_addr_label,
@ -734,7 +761,8 @@ function EDEXgetaddrbyaccount(coin) {
});
});
})).then(result => {
}))
.then(result => {
resolve(result);
NProgress.done();
});
@ -748,7 +776,7 @@ function EDEXgetaddrbyaccount(coin) {
'symbol': coin
};
console.log(params)
console.log(params);
return new Promise((resolve, reject) => {
$.ajax({
data: JSON.stringify(params),
@ -776,7 +804,7 @@ function EDEXgetaddrbyaccount(coin) {
};
console.log(tmp_addr_total_balance_output);
if (data == '' ) {
if (data == '') {
tmp_addr_total_balance_output = {
'label': tmp_addr_label,
'addr': coinaddr_value,
@ -787,8 +815,8 @@ function EDEXgetaddrbyaccount(coin) {
resolve(tmp_addr_total_balance_output);
});
});
})).then(result => {
}))
.then(result => {
resolve(result);
NProgress.done();
});
@ -810,7 +838,8 @@ function EDEXgetaddrbyaccount(coin) {
coin !== 'FRK' ) {
Promise.all(data.result.map((coinaddr_value, coinaddr_index) => {
return new Promise((resolve, reject) => {
EDEXlistunspent(coin, coinaddr_value).then(function(data) {
EDEXlistunspent(coin, coinaddr_value)
.then(function(data) {
var pass_data;
console.log(data);
@ -842,20 +871,22 @@ function EDEXgetaddrbyaccount(coin) {
resolve(pass_data);
});
});
})).then(result => {
}))
.then(result => {
console.log(result);
resolve(result);
NProgress.done();
});
}
}).fail(function(xhr, textStatus, error) {
})
.fail(function(xhr, textStatus, error) {
// handle request failures
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
}
console.log(textStatus);
console.log(error);
})
});
});
}
@ -872,7 +903,8 @@ function EDEXgetnewaddress(coin) {
AjaxOutputData = IguanaAJAX('http://127.0.0.1:' + config.iguanaPort, ajax_data).done(function(data) {
AjaxOutputData = JSON.parse(AjaxOutputData.responseText);
resolve(AjaxOutputData.result);
}).fail(function(xhr, textStatus, error) {
})
.fail(function(xhr, textStatus, error) {
// handle request failures
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
@ -897,7 +929,8 @@ function EDEXimportprivkey(params_data) {
AjaxOutputData = IguanaAJAX('http://127.0.0.1:' + config.iguanaPort, ajax_data).done(function(data) {
AjaxOutputData = JSON.parse(AjaxOutputData.responseText);
resolve(AjaxOutputData);
}).fail(function(xhr, textStatus, error) {
})
.fail(function(xhr, textStatus, error) {
// handle request failures
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
@ -905,20 +938,20 @@ function EDEXimportprivkey(params_data) {
console.log(textStatus);
console.log(error);
});
})
});
}
function EDEX_ProcessRefreshData(gettxdata,refreshdata){
function EDEX_ProcessRefreshData(gettxdata, refreshdata){
//console.log(gettxdata);
//console.log(refreshdata);
return new Promise((resolve, reject) => {
Promise.all(gettxdata.vin.map((vin_value,vin_index) => {
Promise.all(gettxdata.vin.map((vin_value, vin_index) => {
//console.log(vin_index);
//console.log(vin_value);
return new Promise((resolve, reject) => {
Promise.all(refreshdata.map((refresh_value,refresh_index) => {
Promise.all(refreshdata.map((refresh_value, refresh_index) => {
//console.log(refresh_index);
//console.log(refresh_value);
@ -930,39 +963,38 @@ function EDEX_ProcessRefreshData(gettxdata,refreshdata){
}));
});
}))
.then(result=>{
.then(result=> {
var res_data = result[result.length - 1],
refresh_final = [];
//console.log(res_data);
$.each(res_data,function(index){
$.each(res_data,function(index) {
if(res_data[index] !== undefined) {
refresh_final.push(res_data[index]);
}
})
});
//console.log(refresh_final)
resolve(refresh_final);
});
})
});
}
function EDEX_GetTxIDList(gettxdata) {
return new Promise((resolve, reject) => {
get_txid_list = []
get_txid_list = [];
$.each(gettxdata.vin, function(vin_index, vin_value) {
//console.log(vin_index)
//console.log(vin_value)
get_txid_list.push(vin_value.txid)
get_txid_list.push(vin_value.txid);
})
//console.log(get_txid_list)
resolve(get_txid_list);
})
});
}
function EDEX_RemoveTXID(_obj, txidArray) {
var txidToStr = txidArray.join(':');
console.log(txidToStr);
if (_obj, _obj.basilisk) {
if (Object.keys(_obj.basilisk).length === 0) {

10
assets/scripts/iguana_api/IguanaHandle.js

@ -33,7 +33,7 @@ function Iguana_rmd160conv(rmd160conv_data) {
function Iguana_activehandle(callback) {
return new Promise((resolve) => {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'SuperNET',
@ -45,10 +45,12 @@ function Iguana_activehandle(callback) {
url: 'http://127.0.0.1:' + config.iguanaPort,
type: 'POST',
dataType: 'json'
}).then(result => {
})
.then(result => {
//console.log(result);
resolve(result);
}).fail(function(xhr, textStatus, error) {
})
.fail(function(xhr, textStatus, error) {
// handle request failures
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
@ -62,7 +64,7 @@ function Iguana_activehandle(callback) {
function Iguana_Setactivehandle() {
//comment
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'SuperNET',

6
assets/scripts/iguana_api/IguanaJumblr.js

@ -13,7 +13,8 @@ function Iguana_Jumblr_SetPassphrase(data) {
url: 'http://127.0.0.1:' + config.iguanaPort,
type: 'POST',
dataType: 'json'
}).done(function(data) {
})
.done(function(data) {
resolve(data);
});
});
@ -33,7 +34,8 @@ function Iguana_Jumblr_Status() {
url: 'http://127.0.0.1:' + config.iguanaPort,
type: 'POST',
dataType: 'json'
}).done(function(data) {
})
.done(function(data) {
resolve(data);
});
});

40
assets/scripts/iguana_api/IguanaShepherd.js

@ -11,8 +11,8 @@ function Shepherd_getConf(coin) {
contentType: 'application/json', // send as JSON
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data);
console.log(AjaxOutputData['result']);
result.push({ 'path': AjaxOutputData['result'] });
console.log(AjaxOutputData.result);
result.push({ 'path': AjaxOutputData.result });
},
error: function(xhr, textStatus, error) {
//console.log(xhr.statusText);
@ -40,7 +40,7 @@ function Shepherd_setConf(coin) {
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data);
console.log(AjaxOutputData);
result.push({ 'result': AjaxOutputData['msg'] });
result.push({ 'result': AjaxOutputData.msg });
},
error: function(xhr, textStatus, error) {
//console.log(xhr.statusText);
@ -71,7 +71,7 @@ function Shepherd_herd(coin,herd_data) {
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data);
console.log(AjaxOutputData);
result.push({ 'result': AjaxOutputData['msg'] });
result.push({ 'result': AjaxOutputData.msg });
},
error: function(xhr, textStatus, error) {
//console.log(xhr.statusText);
@ -114,7 +114,7 @@ function Shepherd_FetchBasiliskData(req_data) {
'pubkey': session_pubkey
};
console.log(req_data)
console.log(req_data);
if (req_data.allcoins !== false ) {
var req_url = 'http://127.0.0.1:17777/shepherd/cache-all';
} else {
@ -123,14 +123,15 @@ function Shepherd_FetchBasiliskData(req_data) {
ajax_data.calls = req_data.calls;
}
console.log(ajax_data)
console.log(ajax_data);
$.ajax({
type: 'GET',
data: ajax_data,
url: req_url,
contentType: 'application/json', // send as JSON
}).done(function(data) {
})
.done(function(data) {
resolve(data);
});
});
@ -140,6 +141,7 @@ function Shepherd_GroomData_Get() {
return new Promise((resolve) => {
var parse_session_data = sessionStorage.getItem('IguanaActiveAccount');
parse_session_data = JSON.parse(JSON.parse(parse_session_data));
var request_method = '',
session_pubkey = parse_session_data.pubkey,
ajax_data = { 'filename': session_pubkey },
@ -151,7 +153,8 @@ function Shepherd_GroomData_Get() {
data: ajax_data,
url: req_url,
contentType: 'application/json', // send as JSON
}).done(function(data) {
})
.done(function(data) {
var res_data = JSON.parse(data);
resolve(res_data.result);
});
@ -162,6 +165,7 @@ function Shepherd_GroomData_Post(req_data) {
return new Promise((resolve) => {
var parse_session_data = sessionStorage.getItem('IguanaActiveAccount');
parse_session_data = JSON.parse(JSON.parse(parse_session_data));
var request_method = '',
session_pubkey = parse_session_data.pubkey,
ajax_data = {
@ -178,7 +182,8 @@ function Shepherd_GroomData_Post(req_data) {
data: ajax_data,
url: req_url,
dataType: 'json'
}).done(function(data) {
})
.done(function(data) {
var res_data = data;
resolve(res_data);
});
@ -189,6 +194,7 @@ function Shepherd_GroomData_Delete() {
return new Promise((resolve) => {
var parse_session_data = sessionStorage.getItem('IguanaActiveAccount');
parse_session_data = JSON.parse(JSON.parse(parse_session_data));
var request_method = '',
session_pubkey = parse_session_data.pubkey,
ajax_data = {
@ -212,6 +218,7 @@ function Shepherd_GetBasiliskCache() {
return new Promise((resolve) => {
var parse_session_data = sessionStorage.getItem('IguanaActiveAccount');
parse_session_data = JSON.parse(JSON.parse(parse_session_data));
var session_pubkey = parse_session_data.pubkey,
ajax_data = { 'pubkey': session_pubkey };
@ -220,11 +227,14 @@ function Shepherd_GetBasiliskCache() {
data: ajax_data,
url: 'http://127.0.0.1:17777/shepherd/cache',
contentType: 'application/json' // send as JSON
}).done(function(data) {
})
.done(function(data) {
resolve(data);
data = JSON.parse(data);
if (data.result === 'JSON parse error') {
Shepherd_GroomData_Delete().then(function(result) {
Shepherd_GroomData_Delete()
.then(function(result) {
console.log('error reading cache, flushing...');
});
}
@ -234,7 +244,8 @@ function Shepherd_GetBasiliskCache() {
function Shepherd_CheckBasiliskCacheData(coin) {
return new Promise((resolve) => {
Shepherd_GetBasiliskCache().then(function(result) {
Shepherd_GetBasiliskCache()
.then(function(result) {
var _data = JSON.parse(result),
query = _data.result.basilisk,
coin_exists = true,
@ -277,7 +288,7 @@ function Shepherd_CheckBasiliskCacheData(coin) {
'listunspent': false,
'refresh': false
};
resolve(res_data)
resolve(res_data);
} else {
Promise.all(query[coin].addresses.map((coinaddr_value,coinaddr_index) => {
return new Promise((resolve, reject) => {
@ -311,7 +322,8 @@ function Shepherd_CheckBasiliskCacheData(coin) {
};
resolve(pass_data);
});
})).then(result => {
}))
.then(result => {
var res_data = result[result.length - 1];
res_data.coin = coin_exists;
res_data.addresses = addresses_exists;

20
assets/scripts/jumblr.js

@ -14,7 +14,8 @@ var Jumblr = function() {
// clearInterval(CheckIfIguanaRunning);
// console.log('=> No wallet logged in, or Dashboard not ative. No need to Run History.');
} else {
Jumblr_CheckIfConnected().then(function(result) {
Jumblr_CheckIfConnected()
.then(function(result) {
console.log(result);
if (result == 'connected') {
Jumblr_DisplayAddresses();
@ -25,7 +26,8 @@ var Jumblr = function() {
}
$('#jumblr_actions_header').click(function() {
Jumblr_CheckIfConnected().then(function(result) {
Jumblr_CheckIfConnected()
.then(function(result) {
console.log(result);
if (result == 'connected') {
Jumblr_DisplayAddresses();
@ -45,7 +47,8 @@ var Jumblr = function() {
}();
function Jumblr_ShowHideAlert() {
Jumblr_LookforNativeKomodo().then(function(result) {
Jumblr_LookforNativeKomodo()
.then(function(result) {
// console.log(result)
if (result === 'isnative') {
$('#jumblr_no_native_kmd_alert').hide();
@ -65,7 +68,8 @@ function Jumblr_DisplayAddresses() {
}
function Jumblr_DisplayStatus() {
Iguana_Jumblr_Status().then(function(result) {
Iguana_Jumblr_Status()
.then(function(result) {
//console.log(result)
/*$('#jumblr_status_BTCdeposit').text(result.BTCdeposit)
$('#jumblr_status_BTCjumblr').text(result.BTCjumblr)
@ -87,7 +91,7 @@ function Jumblr_DisplayStatus() {
$('#jumblr_status_z_to_t').text(result.z_to_t);
$('#jumblr_status_finished').text(result.finished);
$('#jumblr_status_pending').text(result.pending);
})
});
}
function Jumblr_LookforNativeKomodo() {
@ -115,7 +119,8 @@ function Jumblr_LookforNativeKomodo() {
} else {
resolve('notnative');
}
}).fail(function(xhr, textStatus, error) {
})
.fail(function(xhr, textStatus, error) {
// handle request failures
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
@ -144,7 +149,8 @@ function Jumblr_CheckIfConnected() {
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort
}).done(function(data){
})
.done(function(data) {
data = JSON.parse(data);
if ( data.errors != undefined ) {
resolve('connected');

30
assets/scripts/kmd_wallet/KMDBalance.js

@ -41,21 +41,27 @@ function getTotalKMDBalance() {
console.log('show interest..');
$('#kmd_total_interest_balance').text(parseFloat(AjaxOutputData.interest).toFixed(8) + ' ' + extcoin);
$('#kmd_widget_get_total_balance_i').show();
$('#kmd_widget_get_total_balance_t').addClass(' col-lg-3');
$('#kmd_widget_get_total_balance_t').removeClass('col-lg-4');
$('#kmd_widget_get_total_balance_z').addClass(' col-lg-3');
$('#kmd_widget_get_total_balance_z').removeClass(' col-lg-4');
$('#kmd_widget_get_total_balance_tzi').addClass(' col-lg-3');
$('#kmd_widget_get_total_balance_tzi').removeClass(' col-lg-4');
$('#kmd_widget_get_total_balance_t')
.addClass(' col-lg-3')
.removeClass('col-lg-4');
$('#kmd_widget_get_total_balance_z')
.addClass(' col-lg-3')
.removeClass(' col-lg-4');
$('#kmd_widget_get_total_balance_tzi')
.addClass(' col-lg-3')
.removeClass(' col-lg-4');
} else {
console.log('do not show interest...');
$('#kmd_widget_get_total_balance_i').hide();
$('#kmd_widget_get_total_balance_t').addClass(' col-lg-4');
$('#kmd_widget_get_total_balance_t').removeClass(' col-lg-3');
$('#kmd_widget_get_total_balance_z').addClass(' col-lg-4');
$('#kmd_widget_get_total_balance_z').removeClass(' col-lg-3');
$('#kmd_widget_get_total_balance_tzi').addClass(' col-lg-4');
$('#kmd_widget_get_total_balance_tzi').removeClass(' col-lg-3');
$('#kmd_widget_get_total_balance_t')
.addClass(' col-lg-4')
.removeClass(' col-lg-3');
$('#kmd_widget_get_total_balance_z')
.addClass(' col-lg-4')
.removeClass(' col-lg-3');
$('#kmd_widget_get_total_balance_tzi')
.addClass(' col-lg-4')
.removeClass(' col-lg-3');
}
$('#kmd_transparent_balance').text((AjaxOutputData.transparent ? parseFloat(AjaxOutputData.transparent).toFixed(8) : 0) + ' ' + extcoin);
$('#kmd_private_balance').text((AjaxOutputData.private ? parseFloat(AjaxOutputData.private).toFixed(8) : 0) + ' ' + extcoin);

7
assets/scripts/kmd_wallet/KMDInit.js

@ -79,7 +79,7 @@ function RunKMDInitFunctions() {
$.ajax({
type: 'GET',
url: 'http://localhost:' + config.iguanaPort + '/api/dex/getinfo?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth') + '&symbol='+extcoin,
url: 'http://localhost:' + config.iguanaPort + '/api/dex/getinfo?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth') + '&symbol=' + extcoin,
success: function(data, textStatus, jqXHR) {
data = JSON.parse(data);
@ -136,6 +136,7 @@ function RunKMDInitFunctions() {
}, 2000);
}
if (sessionStorage.getItem('edexTmpMode') === 'Native') {
getRemoteCurrentHeight();
var totalBlocksInExplorer = 0,
@ -143,6 +144,10 @@ function RunKMDInitFunctions() {
getRemoteCurrentHeight();
_getKMDInfo();
}, 60000);
} else {
clearInterval(totalBlocksInExplorerInterval);
clearInterval(currentBestBlockInterval);
}
$('#kmd_wallet_dashoard_section').show();
$('#kmd_wallet_dashboardinfo').show();

7
assets/scripts/kmd_wallet/KMDSendTx.js

@ -55,7 +55,10 @@ function KMDZSendManyTransaction() {
function clearSendManyFieldData() {
$('.showkmdwalletaddrs').selectpicker('refresh');
$('#kmd_wallet_sendto').val('');
$(
'#kmd_wallet_sendto,' +
'#kmd_wallet_amount'
)
.val('');
$('#kmd_wallet_total_value').text('');
$('#kmd_wallet_amount').val('');
}

47
assets/scripts/kmd_wallet/KMDWalletDashboard.js

@ -10,11 +10,17 @@ var KMDWalletDashboard = function() {
if ( sessionStorage.getItem('edexTmpMode') === 'Basilisk' || sessionStorage.getItem('edexTmpMode') === 'Full' ) {
sessionStorage.setItem('edexTmpRefresh', 'stop');
}
$('#kmd_wallet_dashoard_section').show();
$('#kmd_wallet_dashboardinfo').show();
$('#kmd_wallet_send').hide();
$('#kmd_wallet_recieve_section').hide();
$('#kmd_wallet_settings').hide();
$(
'#kmd_wallet_dashoard_section,' +
'#kmd_wallet_dashboardinfo'
)
.show();
$(
'#kmd_wallet_send,' +
'#kmd_wallet_recieve_section,' +
'#kmd_wallet_settings'
)
.hide();
getTotalKMDBalance();
KMDfillTxHistoryT();
clearSendManyFieldData();
@ -53,10 +59,13 @@ var KMDWalletDashboard = function() {
KMDListAllOPIDs();
sessionStorage.setItem('edexTmpRefresh', 'stop');
$('#kmd_wallet_dashboardinfo').hide();
$('#kmd_wallet_send').show();
$('#kmd_wallet_recieve_section').hide();
$('#kmd_wallet_settings').hide();
$(
'#kmd_wallet_dashboardinfo,' +
'#kmd_wallet_recieve_section,' +
'#kmd_wallet_settings'
)
.hide();
var kmd_addr_list_with_balance = KMDlistunspentT();
@ -199,10 +208,13 @@ var KMDWalletDashboard = function() {
$('#btn_' + action_btn_code + '_wallet_settings').click(function() {
console.log('wallet settings button clicked...');
sessionStorage.setItem('edexTmpRefresh', 'stop');
$('#kmd_wallet_dashboardinfo').hide();
$('#kmd_wallet_dashoard_section').hide();
$('#kmd_wallet_send').hide();
$('#kmd_wallet_recieve_section').hide();
$(
'#kmd_wallet_dashboardinfo,' +
'#kmd_wallet_dashoard_section,' +
'#kmd_wallet_send,' +
'#kmd_wallet_recieve_section'
)
.hide();
$('#kmd_wallet_settings').show();
getKMDWalletInfo();
getKMDInfo();
@ -215,11 +227,14 @@ var KMDWalletDashboard = function() {
$('#btn_' + action_btn_code + '_wallet_recieve').click(function() {
sessionStorage.setItem('edexTmpRefresh', 'stop');
$('#kmd_wallet_dashboardinfo').hide();
$('#kmd_wallet_dashoard_section').hide();
$('#kmd_wallet_send').hide();
$(
'#kmd_wallet_dashboardinfo,' +
'#kmd_wallet_dashoard_section,' +
'#kmd_wallet_send,' +
'#kmd_wallet_settings'
)
.hide();
$('#kmd_wallet_recieve_section').show();
$('#kmd_wallet_settings').hide();
KMDListAllAddr();
clearSendManyFieldData();
});

193
assets/scripts/kmd_wallet_dashboard.js

@ -39,55 +39,54 @@ function getHeaderActionMenuButtonCoinCode() {
if ( extcoin == 'KMD') { action_menu_button_code = 'kmd'; };
if ( extcoin == 'ZEC') { action_menu_button_code = 'zec'; };
if ( extcoin == 'SUPERNET'
|| extcoin == 'REVS'
|| extcoin == 'DEX'
|| extcoin == 'PANGEA'
|| extcoin == 'JUMBLR'
|| extcoin == 'BET'
|| extcoin == 'CRYPTO'
|| extcoin == 'HODL'
|| extcoin == 'SHARK'
|| extcoin == 'BOTS'
|| extcoin == 'MGW'
|| extcoin == 'MVP'
|| extcoin == 'WIRELESS'
|| extcoin == 'KV'
|| extcoin == 'CEAL'
|| extcoin == 'MESH'
|| extcoin == 'USD'
|| extcoin == 'RON'
|| extcoin == 'EUR'
|| extcoin == 'JPY'
|| extcoin == 'GBP'
|| extcoin == 'AUD'
|| extcoin == 'CAD'
|| extcoin == 'CHF'
|| extcoin == 'NZD'
|| extcoin == 'CNY'
|| extcoin == 'RUB'
|| extcoin == 'MXN'
|| extcoin == 'BRL'
|| extcoin == 'INR'
|| extcoin == 'HKD'
|| extcoin == 'TRY'
|| extcoin == 'ZAR'
|| extcoin == 'PLN'
|| extcoin == 'NOK'
|| extcoin == 'SEK'
|| extcoin == 'DKK'
|| extcoin == 'CZK'
|| extcoin == 'HUF'
|| extcoin == 'ILS'
|| extcoin == 'KRW'
|| extcoin == 'MYR'
|| extcoin == 'PHP'
|| extcoin == 'SGD'
|| extcoin == 'THB'
|| extcoin == 'BGN'
|| extcoin == 'IDR'
|| extcoin == 'HRK' ) { action_menu_button_code = 'acpax'; };
if (extcoin == 'SUPERNET' ||
extcoin == 'REVS' ||
extcoin == 'DEX' ||
extcoin == 'PANGEA' ||
extcoin == 'JUMBLR' ||
extcoin == 'BET' ||
extcoin == 'CRYPTO' ||
extcoin == 'HODL' ||
extcoin == 'SHARK' ||
extcoin == 'BOTS' ||
extcoin == 'MGW' ||
extcoin == 'MVP' ||
extcoin == 'WIRELESS' ||
extcoin == 'KV' ||
extcoin == 'CEAL' ||
extcoin == 'MESH' ||
extcoin == 'USD' ||
extcoin == 'RON' ||
extcoin == 'EUR' ||
extcoin == 'JPY' ||
extcoin == 'GBP' ||
extcoin == 'AUD' ||
extcoin == 'CAD' ||
extcoin == 'CHF' ||
extcoin == 'NZD' ||
extcoin == 'CNY' ||
extcoin == 'RUB' ||
extcoin == 'MXN' ||
extcoin == 'BRL' ||
extcoin == 'INR' ||
extcoin == 'HKD' ||
extcoin == 'TRY' ||
extcoin == 'ZAR' ||
extcoin == 'PLN' ||
extcoin == 'NOK' ||
extcoin == 'SEK' ||
extcoin == 'DKK' ||
extcoin == 'CZK' ||
extcoin == 'HUF' ||
extcoin == 'ILS' ||
extcoin == 'KRW' ||
extcoin == 'MYR' ||
extcoin == 'PHP' ||
extcoin == 'SGD' ||
extcoin == 'THB' ||
extcoin == 'BGN' ||
extcoin == 'IDR' ||
extcoin == 'HRK') { action_menu_button_code = 'acpax'; };
return action_menu_button_code;
}
@ -100,55 +99,55 @@ function getPassthruAgent() {
if ( extcoin == 'KMD') { passthru_agent = 'komodo'; };
if ( extcoin == 'ZEC') { passthru_agent = 'zcash'; };
if ( extcoin == 'SUPERNET'
|| extcoin == 'REVS'
|| extcoin == 'DEX'
|| extcoin == 'PANGEA'
|| extcoin == 'JUMBLR'
|| extcoin == 'BET'
|| extcoin == 'CRYPTO'
|| extcoin == 'HODL'
|| extcoin == 'SHARK'
|| extcoin == 'BOTS'
|| extcoin == 'MGW'
|| extcoin == 'MVP'
|| extcoin == 'WIRELESS'
|| extcoin == 'KV'
|| extcoin == 'CEAL'
|| extcoin == 'MESH'
|| extcoin == 'USD'
|| extcoin == 'RON'
|| extcoin == 'EUR'
|| extcoin == 'JPY'
|| extcoin == 'GBP'
|| extcoin == 'AUD'
|| extcoin == 'CAD'
|| extcoin == 'CHF'
|| extcoin == 'NZD'
|| extcoin == 'CNY'
|| extcoin == 'RUB'
|| extcoin == 'MXN'
|| extcoin == 'BRL'
|| extcoin == 'INR'
|| extcoin == 'HKD'
|| extcoin == 'TRY'
|| extcoin == 'ZAR'
|| extcoin == 'PLN'
|| extcoin == 'NOK'
|| extcoin == 'SEK'
|| extcoin == 'DKK'
|| extcoin == 'CZK'
|| extcoin == 'HUF'
|| extcoin == 'ILS'
|| extcoin == 'KRW'
|| extcoin == 'MYR'
|| extcoin == 'PHP'
|| extcoin == 'SGD'
|| extcoin == 'THB'
|| extcoin == 'BGN'
|| extcoin == 'IDR'
|| extcoin == 'HRK' ) { passthru_agent = 'iguana'; };
if (extcoin == 'SUPERNET' ||
extcoin == 'REVS' ||
extcoin == 'DEX' ||
extcoin == 'PANGEA' ||
extcoin == 'JUMBLR' ||
extcoin == 'BET' ||
extcoin == 'CRYPTO' ||
extcoin == 'HODL' ||
extcoin == 'SHARK' ||
extcoin == 'BOTS' ||
extcoin == 'MGW' ||
extcoin == 'MVP' ||
extcoin == 'WIRELESS' ||
extcoin == 'KV' ||
extcoin == 'CEAL' ||
extcoin == 'MESH' ||
extcoin == 'USD' ||
extcoin == 'RON' ||
extcoin == 'EUR' ||
extcoin == 'JPY' ||
extcoin == 'GBP' ||
extcoin == 'AUD' ||
extcoin == 'CAD' ||
extcoin == 'CHF' ||
extcoin == 'NZD' ||
extcoin == 'CNY' ||
extcoin == 'RUB' ||
extcoin == 'MXN' ||
extcoin == 'BRL' ||
extcoin == 'INR' ||
extcoin == 'HKD' ||
extcoin == 'TRY' ||
extcoin == 'ZAR' ||
extcoin == 'PLN' ||
extcoin == 'NOK' ||
extcoin == 'SEK' ||
extcoin == 'DKK' ||
extcoin == 'CZK' ||
extcoin == 'HUF' ||
extcoin == 'ILS' ||
extcoin == 'KRW' ||
extcoin == 'MYR' ||
extcoin == 'PHP' ||
extcoin == 'SGD' ||
extcoin == 'THB' ||
extcoin == 'BGN' ||
extcoin == 'IDR' ||
extcoin == 'HRK') { passthru_agent = 'iguana'; };
return passthru_agent;
}

9
assets/scripts/lang/en.js

@ -174,7 +174,9 @@ const _lang = {
'TARGET': 'Target',
'LOAD_DEBUG_LOG': 'Load debug log',
'REFRESH_FUNDS': 'Refresh Funds',
'INFO': 'Info'
'INFO': 'Info',
'ENTER': 'Enter',
'ADDR_SM': 'address'
},
'JUMBLR': {
'NOTICE': 'EXPERIMENTAL TEST VERSION ONLY',
@ -263,6 +265,8 @@ const _lang = {
'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.',
'LESS_RESPONSES_REQ_FOR': 'Less than required responses for',
'BASILISK_CON_REFRESHED': 'Basilisk nodes connections refreshed',
'SWITCHED_TO': 'switched to',
'MODE': 'Mode',
'TX_SENT': 'Transaction Sent',
@ -310,7 +314,8 @@ const _lang = {
'TX': 'Transaction'
},
'IAPI': {
'PUBLIC_SM': 'public'
'PUBLIC_SM': 'public',
'CON_STATUS': 'Connection status'
},
'KMD_NATIVE': {
'SELECT_ADDRESS': 'Select Transparent or Private Address',

286
assets/scripts/login.js

@ -36,12 +36,15 @@ var Login = function() {
highlight: function(element) { // hightlight error inputs
$(element)
.closest('.form-group').addClass('has-error'); // set error class to the control group
.closest('.form-group')
.addClass('has-error'); // set error class to the control group
},
success: function(label) {
label.closest('.form-group').removeClass('has-error');
label.remove();
label
.closest('.form-group')
.removeClass('has-error')
.remove();
},
errorPlacement: function(error, element) {
@ -51,10 +54,11 @@ 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) {
Iguana_Jumblr_SetPassphrase({ 'passphrase': jumblr_setpassphrase_val })
.then(function(result) {
console.log(result);
})
.then(function(){
.then(function() {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
@ -76,12 +80,14 @@ var Login = function() {
sessionStorage.setItem('IguanaActiveAccount', LoginDataToStore);
if (LoginOutput.result === 'success') {
console.log('Success');
toastr.success(_lang[defaultLang].TOASTR.LOGIN_SUCCESSFULL, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION)
toastr.success(_lang[defaultLang].TOASTR.LOGIN_SUCCESSFULL, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
$('#password').val('')
$('#wallet-login').hide();
$('#wallet-core').fadeIn();
$('body').removeClass( 'page-login layout-full page-dark' ).addClass( '' );
$('body')
.removeClass( 'page-login layout-full page-dark' )
.addClass( '' );
$('link[id=loginStyle]')[0].disabled = true;
location.reload();
@ -143,11 +149,20 @@ var Login = function() {
})
$('#section-dashboard').show();
$('#section-easydex').hide();
$('#section-about-iguana').hide();
$('#nav-dashboard').removeClass( '' ).addClass( 'active open' );
$('#nav-easydex').removeClass( 'active open' ).addClass( '' );
$('#nav-about-iguana').removeClass( 'active open' ).addClass( '' );
$(
'#section-easydex,' +
'#section-about-iguana'
)
.hide();
$('#nav-dashboard')
.removeClass( '' )
.addClass( 'active open' );
$(
'#nav-easydex,' +
'#nav-about-iguana'
)
.removeClass( 'active open' )
.addClass( '' );
}
});
@ -164,15 +179,15 @@ var Login = function() {
$('input[name=PassPhraseOptions]').on('change', function() {
if ( $('input[name=PassPhraseOptions]:checked', '.register-form').val() === 'PassPhraseOptionsIguana' ) {
console.log('PassPhraseOptionsIguana');
$('#walletseed').text(PassPhraseGenerator.generatePassPhrase(256))
$('#walletseed').text(PassPhraseGenerator.generatePassPhrase(256));
}
if ( $('input[name=PassPhraseOptions]:checked', '.register-form').val() === 'PassPhraseOptionsWaves' ) {
console.log('PassPhraseOptionsWaves');
$('#walletseed').text(PassPhraseGenerator.generatePassPhrase(160))
$('#walletseed').text(PassPhraseGenerator.generatePassPhrase(160));
}
if ( $('input[name=PassPhraseOptions]:checked', '.register-form').val() === 'PassPhraseOptionsNXT' ) {
console.log('PassPhraseOptionsNXT');
$('#walletseed').text(PassPhraseGenerator.generatePassPhrase(128))
$('#walletseed').text(PassPhraseGenerator.generatePassPhrase(128));
}
});
}
@ -204,12 +219,15 @@ var Login = function() {
highlight: function(element) { // hightlight error inputs
$(element)
.closest('.form-group').addClass('has-error'); // set error class to the control group
.closest('.form-group')
.addClass('has-error'); // set error class to the control group
},
success: function(label) {
label.closest('.form-group').removeClass('has-error');
label.remove();
label
.closest('.form-group')
.removeClass('has-error')
.remove();
},
errorPlacement: function(error, element) {
@ -262,8 +280,9 @@ var Login = function() {
console.log(CreateWalletOutput);
if (CreateWalletOutput.error === 'bitcoinrpc needs coin that is active') {
toastr.info(_lang[defaultLang].TOASTR.NO_COIN_RUNNING, _lang[defaultLang].TOASTR.COIN_NOTIFICATION);
var logincoinnames = [];
toastr.info(_lang[defaultLang].TOASTR.NO_COIN_RUNNING, _lang[defaultLang].TOASTR.COIN_NOTIFICATION);
$('#logincoinslist input[type=checkbox]:checked').each(function() { logincoinnames.push(this.value); });
console.log(logincoinnames);
@ -326,9 +345,12 @@ var Login = function() {
$('#section-login').fadeIn();
$('#section-register').hide();
$('#walletseed').text(PassPhraseGenerator.generatePassPhrase(256));
$('#rwalletseed').val('');
$('#register_password').val('');
$('#rpassword').val('');
$(
'#rwalletseed,' +
'#register_password,' +
'#rpassword'
)
.val('');
});
}
});
@ -384,17 +406,22 @@ var Login = function() {
console.log('Success');
toastr.success(_lang[defaultLang].TOASTR.LOGOUT_SUCCESSFULL, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
$('#wallet-login').show();
$('body').removeClass( '' ).addClass( 'page-login layout-full page-dark' );
$('body')
.removeClass( '' )
.addClass( 'page-login layout-full page-dark' );
$('#wallet-core').hide();
$('link[id=loginStyle]')[0].disabled = false;
// Make sure these fields are unhidden.
$('#login-welcome').text('Welcome.');
$('#wallet-handle').show();
$('.create-account').show();
$('#register-btn').show();
$('#login-welcome').text(_lang[defaultLang].LOGIN.WELCOME + '.');
$(
'#wallet-handle,' +
'.create-account,' +
'#register-btn'
)
.show();
$('#logint-another-wallet').hide();
$("#loginbtn").text('Sign in');
$("#loginbtn").text(_lang[defaultLang].LOGIN.SIGN_IN);
//Stop SetInterval Calls
StopShowCoinHistory();
@ -468,16 +495,21 @@ var Login = function() {
toastr.success(_lang[defaultLang].TOASTR.WALLET_LOCKED, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
$('#wallet-login').show();
$('body').removeClass( '' ).addClass( 'page-login layout-full page-dark' );
$('body')
.removeClass( '' )
.addClass( 'page-login layout-full page-dark' );
$('#wallet-core').hide();
$('link[id=loginStyle]')[0].disabled = false;
$("#loginbtn").text(_lang[defaultLang].LOGIN.UNLOCK);
// Hide some login fields not needing at lock screen
console.log('Wallet is Locked.');
$('#login-welcome').text(_lang[defaultLang].LOGIN.WALLET_LOCKED_LOGIN);
$('#register-btn').hide();
$(
'#register-btn,' +
'#logincoinslist'
)
.hide();
$('#logint-another-wallet').show();
$('#logincoinslist').hide();
} else {
// If something goes wrong, alert the error message that our service returned
toastr.warning(_lang[defaultLang].TOASTR.OPPS, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
@ -523,7 +555,8 @@ var Login = function() {
if ( sessionStorage.getItem('IguanaActiveAccount') === null ) {
console.log('There\'s no active wallet logged in. Please Login.');
$('#logint-another-wallet').hide();
Iguana_CheckActiveCoins().then(function(result) {
Iguana_CheckActiveCoins()
.then(function(result) {
if (result.length !== 0 ) {
$('#section-login-addcoin-btn').hide();
$('#section-login').show();
@ -532,7 +565,8 @@ var Login = function() {
} else {
var CheckLoginData = JSON.parse(sessionStorage.getItem('IguanaActiveAccount'));
Iguana_activehandle().then(function(result) {
Iguana_activehandle()
.then(function(result) {
if ( JSON.parse(CheckLoginData).pubkey != result.pubkey ) {
ClearOnLogout(false, false);
}
@ -542,14 +576,19 @@ var Login = function() {
console.log(JSON.parse(CheckLoginData).status);
$('#password').val('')
$('#wallet-login').hide();
$('body').removeClass( 'page-login layout-full page-dark' ).addClass( '' );
$('body')
.removeClass( 'page-login layout-full page-dark' )
.addClass( '' );
$('#wallet-core').fadeIn();
} else if ( JSON.parse(CheckLoginData).status === 'locked' ) {
console.log('Wallet is Locked.');
$('#login-welcome').text(_lang[defaultLang].LOGIN.WALLET_LOCKED_LOGIN);
$('#register-btn').hide();
$(
'#register-btn,' +
'#section-login-addcoin-btn'
)
.hide();
$("#loginbtn").text(_lang[defaultLang].LOGIN.UNLOCK);
$('#section-login-addcoin-btn').hide();
$('#section-login').show();
}
}
@ -563,7 +602,8 @@ var Login = function() {
};
var handleCoinsRunningCheck = function() {
Iguana_CheckActiveCoins().then(function(result) {
Iguana_CheckActiveCoins()
.then(function(result) {
if (result.length !== 0 ) {
$('#section-login-addcoin-btn').hide();
$('#section-login').show();
@ -673,17 +713,22 @@ var Login = function() {
toastr.success(_lang[defaultLang].TOASTR.LOGOUT_SUCCESSFULL, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
$('#wallet-login').show();
$('body').removeClass( '' ).addClass( 'page-login layout-full page-dark' );
$('body')
.removeClass( '' )
.addClass( 'page-login layout-full page-dark' );
$('#wallet-core').hide();
$('link[id=loginStyle]')[0].disabled = false;
// Make sure these fields are unhidden.
$('#login-welcome').text(_lang[defaultLang].INDEX.WELCOME_LOGIN);
$('.create-account').show();
$('#register-btn').show();
$(
'.create-account,' +
'#register-btn,' +
'#logincoinslist'
)
.show();
$('#logint-another-wallet').hide();
$("#loginbtn").text(_lang[defaultLang].LOGIN.SIGN_IN);
$('#logincoinslist').show();
} else {
// If something goes wrong, alert the error message that our service returned
toastr.warning(_lang[defaultLang].TOASTR.OPPS, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION);
@ -712,92 +757,99 @@ var Login = function() {
var handleAddCoinLoginBtn = function() {
$('#addcoin_mdl_native_mode_login').prop('disabled', true);
$('#addcoin_mdl_basilisk_mode_login').prop('disabled', true);
$('#addcoin_mdl_full_mode_login').prop('disabled', true);
$('#addcoin_mdl_full_mode_login').prop('checked', false);
$('#addcoin_mdl_full_mode_login')
.prop('disabled', true)
.prop('checked', false);
$('.mdl_addcoin_done_btn-login').click(function() {
ExecuteAddCoinLoginFn();
});
$( "#addcoin_select_coin_mdl_options-login" ).change(function() {
$( "#addcoin_select_coin_mdl_options-login" )
.change(function() {
var tmp_coin_val = $('#addcoin_select_coin_mdl_options-login').val();
if (tmp_coin_val !== 'KMD' || tmp_coin_val !== 'KMD' ) {
$('#addcoin_mdl_native_mode_login').prop('disabled', true);
$('#addcoin_mdl_basilisk_mode_login').prop('disabled', true);
$('#addcoin_mdl_full_mode_login').prop('disabled', false);
$('#addcoin_mdl_full_mode_login').prop('checked', true);
$('#addcoin_mdl_full_mode_login')
.prop('disabled', false)
.prop('checked', true);
}
if (tmp_coin_val == 'KMD') {
$('#addcoin_mdl_native_mode_login').prop('disabled', false);
$('#addcoin_mdl_basilisk_mode_login').prop('disabled', false);
$('#addcoin_mdl_basilisk_mode_login')
.prop('disabled', false)
.prop('checked', true);
$('#addcoin_mdl_full_mode_login').prop('disabled', false);
$('#addcoin_mdl_basilisk_mode_login').prop('checked', true);
}
if (tmp_coin_val == 'SUPERNET'
|| tmp_coin_val == 'REVS'
|| tmp_coin_val == 'WIRELESS'
|| tmp_coin_val == 'DEX'
|| tmp_coin_val == 'PANGEA'
|| tmp_coin_val == 'JUMBLR'
|| tmp_coin_val == 'BET'
|| tmp_coin_val == 'CRYPTO'
|| tmp_coin_val == 'HODL'
|| tmp_coin_val == 'SHARK'
|| tmp_coin_val == 'BOTS'
|| tmp_coin_val == 'MGW'
|| tmp_coin_val == 'MVP'
|| tmp_coin_val == 'KV'
|| tmp_coin_val == 'CEAL'
|| tmp_coin_val == 'MESH'
|| tmp_coin_val == 'USD'
|| tmp_coin_val == 'RON'
|| tmp_coin_val == 'EUR'
|| tmp_coin_val == 'JPY'
|| tmp_coin_val == 'GBP'
|| tmp_coin_val == 'AUD'
|| tmp_coin_val == 'CAD'
|| tmp_coin_val == 'CHF'
|| tmp_coin_val == 'NZD'
|| tmp_coin_val == 'CNY'
|| tmp_coin_val == 'RUB'
|| tmp_coin_val == 'MXN'
|| tmp_coin_val == 'BRL'
|| tmp_coin_val == 'INR'
|| tmp_coin_val == 'HKD'
|| tmp_coin_val == 'TRY'
|| tmp_coin_val == 'ZAR'
|| tmp_coin_val == 'PLN'
|| tmp_coin_val == 'NOK'
|| tmp_coin_val == 'SEK'
|| tmp_coin_val == 'DKK'
|| tmp_coin_val == 'CZK'
|| tmp_coin_val == 'HUF'
|| tmp_coin_val == 'ILS'
|| tmp_coin_val == 'KRW'
|| tmp_coin_val == 'MYR'
|| tmp_coin_val == 'PHP'
|| tmp_coin_val == 'SGD'
|| tmp_coin_val == 'THB'
|| tmp_coin_val == 'BGN'
|| tmp_coin_val == 'IDR'
|| tmp_coin_val == 'HRK' ) {
}
if (tmp_coin_val == 'SUPERNET' ||
tmp_coin_val == 'REVS' ||
tmp_coin_val == 'WIRELESS' ||
tmp_coin_val == 'DEX' ||
tmp_coin_val == 'PANGEA' ||
tmp_coin_val == 'JUMBLR' ||
tmp_coin_val == 'BET' ||
tmp_coin_val == 'CRYPTO' ||
tmp_coin_val == 'HODL' ||
tmp_coin_val == 'SHARK' ||
tmp_coin_val == 'BOTS' ||
tmp_coin_val == 'MGW' ||
tmp_coin_val == 'MVP' ||
tmp_coin_val == 'KV' ||
tmp_coin_val == 'CEAL' ||
tmp_coin_val == 'MESH' ||
tmp_coin_val == 'USD' ||
tmp_coin_val == 'RON' ||
tmp_coin_val == 'EUR' ||
tmp_coin_val == 'JPY' ||
tmp_coin_val == 'GBP' ||
tmp_coin_val == 'AUD' ||
tmp_coin_val == 'CAD' ||
tmp_coin_val == 'CHF' ||
tmp_coin_val == 'NZD' ||
tmp_coin_val == 'CNY' ||
tmp_coin_val == 'RUB' ||
tmp_coin_val == 'MXN' ||
tmp_coin_val == 'BRL' ||
tmp_coin_val == 'INR' ||
tmp_coin_val == 'HKD' ||
tmp_coin_val == 'TRY' ||
tmp_coin_val == 'ZAR' ||
tmp_coin_val == 'PLN' ||
tmp_coin_val == 'NOK' ||
tmp_coin_val == 'SEK' ||
tmp_coin_val == 'DKK' ||
tmp_coin_val == 'CZK' ||
tmp_coin_val == 'HUF' ||
tmp_coin_val == 'ILS' ||
tmp_coin_val == 'KRW' ||
tmp_coin_val == 'MYR' ||
tmp_coin_val == 'PHP' ||
tmp_coin_val == 'SGD' ||
tmp_coin_val == 'THB' ||
tmp_coin_val == 'BGN' ||
tmp_coin_val == 'IDR' ||
tmp_coin_val == 'HRK' ) {
$('#addcoin_mdl_native_mode_login').prop('disabled', false);
$('#addcoin_mdl_basilisk_mode_login').prop('disabled', false);
$('#addcoin_mdl_basilisk_mode_login')
.prop('disabled', false)
.prop('checked', true);
$('#addcoin_mdl_full_mode_login').prop('disabled', true);
$('#addcoin_mdl_basilisk_mode_login').prop('checked', true);
}
if (tmp_coin_val == 'BTC') {
$('#addcoin_mdl_basilisk_mode_login').prop('disabled', true);
$('#addcoin_mdl_native_mode_login').prop('disabled', true);
$('#addcoin_mdl_full_mode_login').prop('disabled', false);
$('#addcoin_mdl_full_mode_login').prop('checked', true);
$('#addcoin_mdl_full_mode_login')
.prop('disabled', false)
.prop('checked', true);
}
if (tmp_coin_val == 'ZEC') {
$('#addcoin_mdl_basilisk_mode_login').prop('disabled', true);
$('#addcoin_mdl_native_mode_login').prop('disabled', false);
$('#addcoin_mdl_native_mode_login')
.prop('disabled', false)
.prop('checked', true);
$('#addcoin_mdl_full_mode_login').prop('disabled', true);
$('#addcoin_mdl_native_mode_login').prop('checked', true);
}
});
}
@ -810,7 +862,9 @@ var Login = function() {
// Conditions for Login Add Coin Dialog
$.each($('.style-addcoin-lbl-mdl-login'), function(index, value) {
if ( index == 0 || index == 1 ) {
$(value).removeClass('col-lg-4 col-md-4').addClass('col-lg-6 col-md-6');
$(value)
.removeClass('col-lg-4 col-md-4')
.addClass('col-lg-6 col-md-6');
}
if ( index == 2 ) {
$(value).hide();
@ -820,7 +874,9 @@ var Login = function() {
// Conditions for Dashboard Add Coin Dialog
$.each($('.style-addcoin-lbl-mdl'), function(index, value) {
if ( index == 0 || index == 1 ) {
$(value).removeClass('col-lg-4 col-md-4').addClass('col-lg-6 col-md-6');
$(value)
.removeClass('col-lg-4 col-md-4')
.addClass('col-lg-6 col-md-6');
}
if ( index == 2 ) {
$(value).hide();
@ -865,16 +921,24 @@ function ClearOnLogout(cleardata, stopinterval) {
console.log('SetInterval data not cleared.');
}
$('#wallet-login').show();
$('body').removeClass( '' ).addClass( 'page-login layout-full page-dark' );
$('#wallet-core').hide();
$('body')
.removeClass( '' )
.addClass( 'page-login layout-full page-dark' );
$(
'#wallet-core,' +
'#logint-another-wallet'
)
.hide();
$('link[id=loginStyle]')[0].disabled = false;
$('#logint-another-wallet').hide();
// Make sure these fields are unhidden.
$('#login-welcome').text(_lang[defaultLang].LOGIN.WELCOME);
$('#wallet-handle').show();
$('.create-account').show();
$('#register-btn').show();
$(
'#wallet-handle,' +
'.create-account,' +
'#register-btn'
)
.show();
$('#logint-another-wallet').hide();
$("#loginbtn").text(_lang[defaultLang].LOGIN.SIGN_IN);
}

40
assets/scripts/walletsettings.js

@ -15,7 +15,7 @@ var WalletSettings = function() {
}
},
submitHandler: function(form) {
console.log('wait till peer ip added to selected coin...')
console.log('wait till peer ip added to selected coin...');
var Getwifkeys_passphrase = $('#wifkeys_passphrase').val(),
WifKeyDivContent = '';
@ -24,7 +24,8 @@ var WalletSettings = function() {
$.each([
'native',
'basilisk',
'full'], function( index, value ) {
'full'
], function( index, value ) {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
allcoins_ajax_data = {
'userpass': tmpIguanaRPCAuth,
@ -63,21 +64,22 @@ var WalletSettings = function() {
url: 'http://127.0.0.1:' + config.iguanaPort,
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%;">' +
'<tr>' +
'<td style="width: 5%">' +
'<b>' + wifkey_coin_handle + '</b>' +
'</td>' +
'<td>' + EncryptWalletDataOutput[wifkey_coin_handle] + '</td>' +
'</tr>';
WifKeyDivContent += '<tr>' +
'</tr>' +
'<tr>' +
'<td>' +
'<b>' + wifkey_coin_handle + 'Wif</b>' +
'</td>' +
'<td>' + EncryptWalletDataOutput[wifkey_coin_handle + 'wif'] + '</td>' +
'</tr>';
WifKeyDivContent += '</table>';
'</tr>' +
'</table>';
$('#wif-priv-keys').html(WifKeyDivContent);
},
error: function(xhr, textStatus, error) {
@ -165,8 +167,9 @@ var WalletSettings = function() {
submitHandler: function(form) {
var Getimport_wifkey = $('#import_wifkey').val();
// console.log(Getimport_wifkey);
EDEXimportprivkey(Getimport_wifkey).then(function(result){
console.log(result)
EDEXimportprivkey(Getimport_wifkey)
.then(function(result) {
console.log(result);
if ( result.result !== undefined && result.result == 'success' ) {
toastr.success(_lang[defaultLang].TOASTR.PRIV_KEY_IMPORTED, _lang[defaultLang].TOASTR.SETTINGS_NOTIFICATION);
$('#import_wifkey').val('');
@ -207,6 +210,7 @@ $(document).ready(function() {
// Functions =============================================================
function Settings_ShowWalletInfo() {
var CheckLoginData = JSON.parse(sessionStorage.getItem('IguanaActiveAccount'));
console.log(JSON.parse(CheckLoginData));
$('#winfo_pubkey_value').text(JSON.parse(CheckLoginData).pubkey);
$('#winfo_btcpubkey_value').text(JSON.parse(CheckLoginData).btcpubkey);
@ -218,10 +222,13 @@ function Settings_ShowWalletInfo() {
function Settings_ShowCoinPeers() {
console.log('waiting getpeers api to complete...');
$('#coin_supernetpeers_h').text('');
$('#coin_supernetpeers').text('');
$('#coin_rawpeers_h').text('');
$('#coin_rawpeers').text('');
$(
'#coin_supernetpeers_h,' +
'#coin_supernetpeers,' +
'#coin_rawpeers_h,' +
'#coin_rawpeers'
)
.text('');
var settings_selected_coinname_code_val = $('option:selected', '#settings_select_coin_options').val(),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
@ -241,6 +248,7 @@ function Settings_ShowCoinPeers() {
if (getCoinPeers.supernet[0].peers !== undefined ) {
var supernet_peers_list = getCoinPeers.supernet[0].peers;
if (supernet_peers_list != 0 ) {
$('#coin_supernetpeers_h').text(getCoinPeers.supernet[0].coin);
$.each(supernet_peers_list, function( index, value ) {
@ -257,6 +265,7 @@ function Settings_ShowCoinPeers() {
if (getCoinPeers.rawpeers[0].peers !== undefined ) {
var raw_peers_list = getCoinPeers.rawpeers[0].peers;
if (raw_peers_list != 0 ) {
$('#coin_rawpeers_h').text(getCoinPeers.supernet[0].coin);
$.each(raw_peers_list, function( index, value ) {
@ -284,7 +293,7 @@ function Settings_ShowCoinPeers() {
}
function Settings_AddCoinPeers() {
console.log('wait till peer ip added to selected coin...')
console.log('wait till peer ip added to selected coin...');
var settings_selected_coinname_code_val = $('option:selected', '#settings_select_coin_addpeer_options').val(),
settings_add_peer_ip_val = $('#settings_add_peer_ip').val(),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
@ -302,6 +311,7 @@ function Settings_AddCoinPeers() {
url: 'http://127.0.0.1:' + config.iguanaPort,
success: function(data, textStatus, jqXHR) {
var getAddCoinPeers = JSON.parse(data);
console.log(getAddCoinPeers);
if ( getAddCoinPeers.result == 'addnode submitted' ) {
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);

Loading…
Cancel
Save