Browse Source

code cleanup p2 #3

master
pbca26 8 years ago
parent
commit
f82bc38844
  1. 16
      assets/pages/login.css
  2. 89
      assets/scripts/coinwallets.js
  3. 1114
      assets/scripts/dashboard.js
  4. 16
      assets/scripts/dashboard/DashboardEDEX.js
  5. 11
      assets/scripts/iguana_api.js
  6. 2
      assets/scripts/iguana_api/IguanaAddcoin.js
  7. 84
      assets/scripts/iguana_api/IguanaDEX.js
  8. 204
      assets/scripts/iguana_api/IguanaEDEX.js
  9. 12
      assets/scripts/iguana_api/IguanaHandle.js
  10. 30
      assets/scripts/iguana_api/IguanaJumblr.js
  11. 42
      assets/scripts/iguana_api/IguanaShepherd.js
  12. 20
      assets/scripts/jumblr.js
  13. 104
      assets/scripts/kmd_wallet/KMDAddress.js
  14. 108
      assets/scripts/kmd_wallet/KMDBalance.js
  15. 52
      assets/scripts/kmd_wallet/KMDGetinfo.js
  16. 19
      assets/scripts/kmd_wallet/KMDInit.js
  17. 33
      assets/scripts/kmd_wallet/KMDSendTx.js
  18. 52
      assets/scripts/kmd_wallet/KMDTransaction.js
  19. 78
      assets/scripts/kmd_wallet/KMDTransactionInfo.js
  20. 47
      assets/scripts/kmd_wallet/KMDWalletDashboard.js
  21. 273
      assets/scripts/kmd_wallet_dashboard.js
  22. 9
      assets/scripts/lang/en.js
  23. 286
      assets/scripts/login.js
  24. 200
      assets/scripts/walletsettings.js

16
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;
}
@ -19,15 +27,15 @@
#register-btn, #register-back-btn,
#logint-another-wallet {
border: 1px solid #5d5d5d;
color: #fff;
border: 1px solid #5d5d5d;
color: #fff;
}
#register-btn:hover,
#register-back-btn:hover,
#logint-another-wallet:hover {
border: 1px solid #a7a7a7;
color: #fff;
border: 1px solid #a7a7a7;
color: #fff;
}
.page-register:before {

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();

1114
assets/scripts/dashboard.js

File diff suppressed because it is too large

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);
}
}
});

11
assets/scripts/iguana_api.js

@ -112,7 +112,7 @@ function Iguana_HashHex(data) {
};
$.ajax({
async: false,
async: false,
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort,
@ -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 = '',

84
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);
})
@ -510,47 +510,47 @@ function EDEX_DEXgetinfoAll() {
var refresh_percent = '';
$.each(get_dex_notarychains, function( coin_index, coin_value ) {
console.log(coin_index + ': ' + coin_value);
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'dex',
'method': 'getinfo',
'symbol': coin_value
};
console.log(ajax_data);
if (coin_value !== 'MESH') {
var getinfo_each_chain = IguanaAJAX('http://127.0.0.1:' + config.iguanaPort, ajax_data).done(function(data) {
getinfo_each_chain = JSON.parse(getinfo_each_chain.responseText);
console.log('== EDEX_DEXgetinfoAll Data OutPut ==');
console.log(getinfo_each_chain);
var tmp_index = parseInt(coin_index) + 1,
refresh_percent = parseFloat(parseInt(coin_index, 10) * 100) / parseInt(get_dex_notarychains.length, 10);
console.log(refresh_percent);
$('#basilisk-connections-refresh-title').text('Connection status... ' + tmp_index + '/' + get_dex_notarychains.length + ': ' + coin_value);
$('#basilisk-connections-refresh-percent').text(refresh_percent + '%');
$('#basilisk-connections-refresh-progress-bar').width(refresh_percent + '%');
if (getinfo_each_chain == '' ) {
result.push([{ 'amount': 0 }]);
}
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');
$('#basilisk-connections-refresh-status-output').text('Output: ' + getinfo_each_chain.error);
} else {
$('#basilisk-connections-refresh-status-output').text('Output: Connected');
}
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');
}
});
}
console.log(coin_index + ': ' + coin_value);
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'dex',
'method': 'getinfo',
'symbol': coin_value
};
console.log(ajax_data);
if (coin_value !== 'MESH') {
var getinfo_each_chain = IguanaAJAX('http://127.0.0.1:' + config.iguanaPort, ajax_data).done(function(data) {
getinfo_each_chain = JSON.parse(getinfo_each_chain.responseText);
console.log('== EDEX_DEXgetinfoAll Data OutPut ==');
console.log(getinfo_each_chain);
var tmp_index = parseInt(coin_index) + 1,
refresh_percent = parseFloat(parseInt(coin_index, 10) * 100) / parseInt(get_dex_notarychains.length, 10);
console.log(refresh_percent);
$('#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 + '%');
if (getinfo_each_chain == '' ) {
result.push([{ 'amount': 0 }]);
}
result.push(getinfo_each_chain);
if (getinfo_each_chain.error === 'less than required responses') {
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');
}
if ( tmp_index == get_dex_notarychains.length-1 ) {
$('#basilisk-connections-refresh-progress-bar').width('100%');
$('#RefreshBasiliskConnectionsMdl').modal('hide');
toastr.success(_lang[defaultLang].TOASTR.BASILISK_CON_REFRESHED + '.', _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION);
}
});
}
});
});

204
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">' +
@ -637,12 +663,12 @@ function EDEXgetaddrbyaccount_cache(coin) {
coinaddr_balances = query[coin][coinaddr_value].getbalance.data;
if (coinaddr_balances.interest !== undefined) {
var pass_data = {
'label': tmp_addr_label,
'addr': coinaddr_value,
'total': coinaddr_balances.balance.toFixed(8),
'interest': coinaddr_balances.interest.toFixed(8)
};
var pass_data = {
'label': tmp_addr_label,
'addr': coinaddr_value,
'total': coinaddr_balances.balance.toFixed(8),
'interest': coinaddr_balances.interest.toFixed(8)
};
}
if (coinaddr_balances.interest == undefined) {
var pass_data = {
@ -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,40 +963,39 @@ 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);
console.log(txidToStr);
if (_obj, _obj.basilisk) {
if (Object.keys(_obj.basilisk).length === 0) {
console.log('no coin nodes to parse');

12
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,14 +45,16 @@ 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 ) {
Iguana_ServiceUnavailable();
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
@ -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',

30
assets/scripts/iguana_api/IguanaJumblr.js

@ -2,19 +2,20 @@ function Iguana_Jumblr_SetPassphrase(data) {
return new Promise((resolve) => {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'jumblr',
'method': 'setpassphrase',
'passphrase': data.passphrase
'userpass': tmpIguanaRPCAuth,
'agent': 'jumblr',
'method': 'setpassphrase',
'passphrase': data.passphrase
};
$.ajax({
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort,
type: 'POST',
dataType: 'json'
}).done(function(data) {
resolve(data);
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort,
type: 'POST',
dataType: 'json'
})
.done(function(data) {
resolve(data);
});
});
}
@ -23,9 +24,9 @@ function Iguana_Jumblr_Status() {
return new Promise((resolve) => {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'jumblr',
'method': 'status'
'userpass': tmpIguanaRPCAuth,
'agent': 'jumblr',
'method': 'status'
};
$.ajax({
@ -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);
});
});

42
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,7 +218,8 @@ 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,
var session_pubkey = parse_session_data.pubkey,
ajax_data = { 'pubkey': session_pubkey };
$.ajax({
@ -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');

104
assets/scripts/kmd_wallet/KMDAddress.js

@ -5,21 +5,21 @@ function KMDListaddrZ() {
if (passthru_agent == 'iguana') {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_listaddresses',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_listaddresses',
'hex': ''
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_listaddresses',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_listaddresses',
'hex': ''
};
}
$.ajax({
@ -39,21 +39,21 @@ function KMDListaddrZ() {
if (passthru_agent == 'iguana') {
var ajax_data_zaddrbalance = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_getbalance',
'hex': tmpZaddrs_output
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_getbalance',
'hex': tmpZaddrs_output
};
} else {
var ajax_data_zaddrbalance = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_getbalance',
'hex': tmpZaddrs_output
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_getbalance',
'hex': tmpZaddrs_output
};
}
$.ajax({
@ -129,21 +129,21 @@ function KMDListAddresses(pubpriv) {
if (passthru_agent == 'iguana') {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': ajax_function_input,
'hex': tmplistaddr_hex_input
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': ajax_function_input,
'hex': tmplistaddr_hex_input
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': ajax_function_input,
'hex': tmplistaddr_hex_input
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': ajax_function_input,
'hex': tmplistaddr_hex_input
};
}
$.ajax({
@ -195,21 +195,21 @@ function KMDGetNewAddresses(pubpriv) {
if (passthru_agent == 'iguana') {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': ajax_function_input,
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': ajax_function_input,
'hex': ''
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': ajax_function_input,
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': ajax_function_input,
'hex': ''
};
}
$.ajax({

108
assets/scripts/kmd_wallet/KMDBalance.js

@ -11,21 +11,21 @@ function getTotalKMDBalance() {
if ( extcoin !== 'KMD' && extcoin !== 'ZEC' ) {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'iguana',
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_gettotalbalance',
'hex': '3000'
};
'userpass': tmpIguanaRPCAuth,
'agent': 'iguana',
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_gettotalbalance',
'hex': '3000'
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_gettotalbalance',
'hex': '3000'
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_gettotalbalance',
'hex': '3000'
};
}
//console.log(ajax_data);
@ -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);
@ -79,21 +85,21 @@ function getKMDBalanceT() {
if (passthru_agent == 'iguana') {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'getbalance',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'getbalance',
'hex': ''
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'getbalance',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'getbalance',
'hex': ''
};
}
console.log(ajax_data);
@ -122,21 +128,21 @@ function getKMDBalanceZ() {
if (passthru_agent == 'iguana') {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_getbalance',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_getbalance',
'hex': ''
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_getbalance',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_getbalance',
'hex': ''
};
}
console.log(ajax_data);

52
assets/scripts/kmd_wallet/KMDGetinfo.js

@ -4,21 +4,21 @@ function getKMDWalletInfo() {
if (passthru_agent == 'iguana') {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'getwalletinfo',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'getwalletinfo',
'hex': ''
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'getwalletinfo',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'getwalletinfo',
'hex': ''
};
}
console.log(ajax_data);
@ -52,21 +52,21 @@ function getKMDInfo() {
if (passthru_agent == 'iguana') {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'getinfo',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'getinfo',
'hex': ''
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'getinfo',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'getinfo',
'hex': ''
};
}
console.log(ajax_data);

19
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,13 +136,18 @@ function RunKMDInitFunctions() {
}, 2000);
}
getRemoteCurrentHeight();
var totalBlocksInExplorer = 0,
totalBlocksInExplorerInterval = setInterval(function() {
if (sessionStorage.getItem('edexTmpMode') === 'Native') {
getRemoteCurrentHeight();
_getKMDInfo();
}, 60000);
var totalBlocksInExplorer = 0,
totalBlocksInExplorerInterval = setInterval(function() {
getRemoteCurrentHeight();
_getKMDInfo();
}, 60000);
} else {
clearInterval(totalBlocksInExplorerInterval);
clearInterval(currentBestBlockInterval);
}
$('#kmd_wallet_dashoard_section').show();
$('#kmd_wallet_dashboardinfo').show();

33
assets/scripts/kmd_wallet/KMDSendTx.js

@ -11,21 +11,21 @@ function KMDZSendManyTransaction() {
if (passthru_agent == 'iguana') {
var ajax_data_txid_input = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_sendmany',
'hex': zsendmoney_output
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_sendmany',
'hex': zsendmoney_output
};
} else {
var ajax_data_txid_input = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_sendmany',
'hex': zsendmoney_output
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_sendmany',
'hex': zsendmoney_output
};
}
$.ajax({
@ -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('');
}

52
assets/scripts/kmd_wallet/KMDTransaction.js

@ -14,21 +14,21 @@ function KMDGetPublicTransactions() {
if (passthru_agent == 'iguana') {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'listtransactions',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'listtransactions',
'hex': ''
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'listtransactions',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'listtransactions',
'hex': ''
};
}
$.ajax({
@ -112,21 +112,21 @@ function KMDGetProtectedTransactions() {
if (passthru_agent == 'iguana') {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_listreceivedbyaddress',
'hex': tmpzaddr_hex_input
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_listreceivedbyaddress',
'hex': tmpzaddr_hex_input
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_listreceivedbyaddress',
'hex': tmpzaddr_hex_input
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_listreceivedbyaddress',
'hex': tmpzaddr_hex_input
};
}
$.ajax({

78
assets/scripts/kmd_wallet/KMDTransactionInfo.js

@ -14,21 +14,21 @@ function KMDlistunspentT() {
if (passthru_agent == 'iguana') {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'listunspent',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'listunspent',
'hex': ''
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'listunspent',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'listunspent',
'hex': ''
};
}
$.ajax({
@ -80,21 +80,21 @@ function KMDGetTransactionIDInfo(txid) {
if (passthru_agent == 'iguana') {
var ajax_data_txid_input = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'gettransaction',
'hex': tmptxid_output
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'gettransaction',
'hex': tmptxid_output
};
} else {
var ajax_data_txid_input = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'gettransaction',
'hex': tmptxid_output
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'gettransaction',
'hex': tmptxid_output
};
}
$.ajax({
@ -136,21 +136,21 @@ function KMDGetOPIDInfo(opid) {
if (passthru_agent == 'iguana') {
var ajax_data_txid_input = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_getoperationstatus',
'hex': tmpopid_output
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'z_getoperationstatus',
'hex': tmpopid_output
};
} else {
var ajax_data_txid_input = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_getoperationstatus',
'hex': tmpopid_output
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'z_getoperationstatus',
'hex': tmpopid_output
};
}
$.ajax({

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();
});

273
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;
}
@ -161,21 +160,21 @@ function CheckIfConnected() {
if (passthru_agent == 'iguana') {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'getinfo',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'getinfo',
'hex': ''
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'getinfo',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'getinfo',
'hex': ''
};
}
console.log(ajax_data);
@ -221,21 +220,21 @@ function CheckIfWalletEncrypted() {
if (passthru_agent == 'iguana') {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'walletlock',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'walletlock',
'hex': ''
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'walletlock',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'walletlock',
'hex': ''
};
}
console.log(ajax_data);
@ -277,22 +276,22 @@ function KMD_getInfo_rtrn() {
if (passthru_agent == 'iguana') {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'getinfo',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'getinfo',
'hex': ''
};
} else {
var ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'getinfo',
'hex': ''
};
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'asset': $('[data-extcoin]').attr('data-extcoin'),
'function': 'getinfo',
'hex': ''
};
}
$.ajax({

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();
@ -840,7 +896,7 @@ var Login = function() {
handleCheckLogin();
handleLoginAnotherWallet();
handleAddCoinLoginBtn();
handleAddCoinOSOptions();
handleAddCoinOSOptions();
}
};
}();
@ -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);
}

200
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,91 +24,63 @@ var WalletSettings = function() {
$.each([
'native',
'basilisk',
'full'], function( index, value ) {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
allcoins_ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'InstantDEX',
'method': 'allcoins'
};
$.ajax({
type: 'POST',
data: JSON.stringify(allcoins_ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort,
success: function(data, textStatus, jqXHR) {
var AllcoinsDataOutput = JSON.parse(data);
// Only execute further code if that mode has any coins active it. if none, skill checking on them.
if (AllcoinsDataOutput[value].length !== 0 ) {
console.log('== AllCoins Data OutPut ==');
console.log(value);
console.log(AllcoinsDataOutput[value]);
// First Run Encryptwallet API to get wif keys for each active coin
$.each(AllcoinsDataOutput[value], function(index) {
console.log(AllcoinsDataOutput[value][index]);
var wifkey_coin_handle = AllcoinsDataOutput[value][index],
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
EncryptWallet_ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'bitcoinrpc',
'method': 'encryptwallet',
'passphrase': Getwifkeys_passphrase
};
$.ajax({
type: 'POST',
data: JSON.stringify(EncryptWallet_ajax_data),
url: 'http://127.0.0.1:' + 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%;">' +
'<b>' + wifkey_coin_handle + '</b>' +
'</td>' +
'<td>' + EncryptWalletDataOutput[wifkey_coin_handle] + '</td>' +
'</tr>';
WifKeyDivContent += '<tr>' +
'<td>' +
'<b>' + wifkey_coin_handle + 'Wif</b>' +
'</td>' +
'<td>' + EncryptWalletDataOutput[wifkey_coin_handle + 'wif'] + '</td>' +
'</tr>';
WifKeyDivContent += '</table>';
$('#wif-priv-keys').html(WifKeyDivContent);
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
}
});
});
'full'
], function( index, value ) {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
allcoins_ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'InstantDEX',
'method': 'allcoins'
};
$.ajax({
type: 'POST',
data: JSON.stringify(allcoins_ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort,
success: function(data, textStatus, jqXHR) {
var AllcoinsDataOutput = JSON.parse(data);
// Only execute further code if that mode has any coins active it. if none, skill checking on them.
if (AllcoinsDataOutput[value].length !== 0 ) {
console.log('== AllCoins Data OutPut ==');
console.log(value);
console.log(AllcoinsDataOutput[value]);
//Second run walletpassphrase again to make sure wallet is unlocked as before login.
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
WalletPassphrase_ajax_data = {
// First Run Encryptwallet API to get wif keys for each active coin
$.each(AllcoinsDataOutput[value], function(index) {
console.log(AllcoinsDataOutput[value][index]);
var wifkey_coin_handle = AllcoinsDataOutput[value][index],
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
EncryptWallet_ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'bitcoinrpc',
'method': 'walletpassphrase',
'password': Getwifkeys_passphrase,
'timeout': '2592000'
'method': 'encryptwallet',
'passphrase': Getwifkeys_passphrase
};
$.ajax({
type: 'POST',
data: JSON.stringify(WalletPassphrase_ajax_data),
data: JSON.stringify(EncryptWallet_ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort,
success: function(data, textStatus, jqXHR) {
var WalletPassphraseDataOutput = JSON.parse(data);
console.log(WalletPassphraseDataOutput);
var EncryptWalletDataOutput = JSON.parse(data);
console.log(EncryptWalletDataOutput[wifkey_coin_handle + 'wif']);
WifKeyDivContent += '<table class="table">';
'<tr>' +
'<td style="width: 5%">' +
'<b>' + wifkey_coin_handle + '</b>' +
'</td>' +
'<td>' + EncryptWalletDataOutput[wifkey_coin_handle] + '</td>' +
'</tr>' +
'<tr>' +
'<td>' +
'<b>' + wifkey_coin_handle + 'Wif</b>' +
'</td>' +
'<td>' + EncryptWalletDataOutput[wifkey_coin_handle + 'wif'] + '</td>' +
'</tr>' +
'</table>';
$('#wif-priv-keys').html(WifKeyDivContent);
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
@ -120,18 +92,48 @@ var WalletSettings = function() {
console.log(error);
}
});
}
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
});
//Second run walletpassphrase again to make sure wallet is unlocked as before login.
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
WalletPassphrase_ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'bitcoinrpc',
'method': 'walletpassphrase',
'password': Getwifkeys_passphrase,
'timeout': '2592000'
};
$.ajax({
type: 'POST',
data: JSON.stringify(WalletPassphrase_ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort,
success: function(data, textStatus, jqXHR) {
var WalletPassphraseDataOutput = JSON.parse(data);
console.log(WalletPassphraseDataOutput);
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
}
});
}
});
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
}
});
});
}
});
@ -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