You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.4 KiB

8 years ago
function Iguana_rmd160conv(rmd160conv_data) {
// comment
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'SuperNET',
'method': 'rmd160conv',
'rmd160': rmd160conv_data.rmd160,
'coin': rmd160conv_data.coin
};
console.log(ajax_data);
$.ajax({
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:7778',
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data);
console.log('== Data OutPut ==');
console.log(AjaxOutputData);
return AjaxOutputData;
},
error: function(xhr, textStatus, error) {
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
}
});
}
function Iguana_activehandle(callback) {
return new Promise((resolve) => {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'SuperNET',
'method': 'activehandle'
},
AjaxOutputData = IguanaAJAX('http://127.0.0.1:7778', ajax_data).done(function(data) {
AjaxOutputData = AjaxOutputData && AjaxOutputData.responseText ? JSON.parse(AjaxOutputData.responseText) : '';
resolve(AjaxOutputData);
}).fail(function(xhr, textStatus, error) {
// handle request failures
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
});
});
}
function Iguana_Setactivehandle() {
//comment
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': 'SuperNET',
'method': 'activehandle'
};
$.ajax({
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:7778',
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data),
AjaxOutputDataToStore = JSON.stringify(data);
sessionStorage.setItem('IguanaActiveAccount', AjaxOutputDataToStore);
},
error: function(xhr, textStatus, error) {
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
}
});
return 'Executed Iguana_activehandle. Check Iguana_activehandle_output var value.';
}