|
|
@ -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'); |
|
|
|