Browse Source

Merge branch 'redux' of https://github.com/SuperNETorg/EasyDEX-GUI into redux

all-modes
pbca26 8 years ago
parent
commit
507615725a
  1. BIN
      assets/images/bg/btc_transparent_header_bg.png
  2. BIN
      assets/images/cryptologo/GAME.png
  3. 0
      assets/images/cryptologo/WLC.png
  4. BIN
      assets/images/cryptologo/gamerscoin.png
  5. BIN
      assets/images/native/btc_header_title_logo.png
  6. 126
      assets/js/kmdcli.js
  7. 19
      assets/scripts/dashboard.js
  8. 3
      assets/scripts/iguana_api.js
  9. 16
      assets/scripts/iguana_api/IguanaAddcoin.js
  10. 274
      assets/scripts/kmd_wallet/KMDInit.js
  11. 59
      assets/scripts/kmd_wallet_dashboard.js
  12. 2
      assets/scripts/login.js
  13. 15
      assets/scripts/sidebar.js
  14. 4
      assets/scripts/templates/addCoinOptions.js
  15. 7
      assets/scripts/templates/bottomIncludes.js
  16. 28
      assets/scripts/walletsettings.js
  17. 4
      index.html

BIN
assets/images/bg/btc_transparent_header_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
assets/images/cryptologo/GAME.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

0
assets/images/cryptologo/WIRELESS.png → assets/images/cryptologo/WLC.png

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

BIN
assets/images/cryptologo/gamerscoin.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

BIN
assets/images/native/btc_header_title_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

126
assets/js/kmdcli.js

@ -0,0 +1,126 @@
/*
* Copyright (c) 2015 Satinderjit Singh
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
/*
* Agama komodo-cli paths
*
*/
var child_process = require('child_process'),
path = require('path'),
os = require('os');
if (os.platform() === 'darwin') {
var komodocliBin = path.join(__dirname, '../../../../../../../../assets/bin/osx/komodo-cli'),
zcashcliBin = '/Applications/ZCashSwingWalletUI.app/Contents/MacOS/zcash-cli';
}
if (os.platform() === 'linux') {
var komodocliBin = path.join(__dirname, '../../../../../../../../assets/bin/linux64/komodo-cli');
}
if (os.platform() === 'win32') {
var komodocliBin = path.join(__dirname, '../../../../../../../../assets/bin/win64/komodo-cli.exe'),
komodocliBin = path.normalize(komodocliBin);
}
console.log(komodocliBin)
/**
* The **komodo-cli** command is used to get komodo api calls answer.
*
* @private
* @category kmdcli
*
*/
var kmdcli = module.exports = {
exec: child_process.exec,
command: command
};
/**
* Parses komodo-cli commands.
*
* @private
* @static
* @category kmdcli
* @param {function} callback The callback function.
*
*/
function parse_kmdcli_commands(callback) {
return function(error, stdout, stderr) {
if (error) callback(error, stderr);
else callback(error, stdout);
//console.log(stdout)
};
}
/**
* Parses komodo-cli commands.
*
* @private
* @static
* @category kmdcli
* @param {function} callback The callback function.
* @example
*
* var kmdcli = require('./kmdcli');
*
* kmdcli.command('getinfo', function(err, command) {
* console.log(command);
* });
*
* // =>
* {
* "version" : 1000550,
* "protocolversion" : 170002,
* "notarized" : 254740,
* "notarizedhash" : "01f4f1c46662ccca2e7fa9e7e38d4d2e4ced4402fa0f4fc116b8f004bb8cf272",
* "notarizedtxid" : "2b16e47a176f8c1886ca0268243f9b96f8b2db466ea26ae99873d5224bbf80b6",
* "walletversion" : 60000,
* "balance" : 32632.46167742,
* "interest" : 0.00478671,
* "blocks" : 254791,
* "longestchain" : 254791,
* "timeoffset" : 0,
* "tiptime" : 1490815616,
* "connections" : 8,
* "proxy" : "",
* "difficulty" : 707836.56791394,
* "testnet" : false,
* "keypoololdest" : 1482746526,
* "keypoolsize" : 101,
* "paytxfee" : 0.00000000,
* "relayfee" : 0.00001000,
* "errors" : "WARNING: check your network connection, 157 blocks received in the last 4 hours (240 expected)",
* "notaryid" : -1,
* "pubkey" : "000000000000000000000000000000000000000000000000000000000000000000"
* }
*
*/
function command(kmd_command, callback) {
if (callback) {
return this.exec(komodocliBin + " " + kmd_command,
parse_kmdcli_commands(callback));
}
}

19
assets/scripts/dashboard.js

@ -665,9 +665,9 @@ var Dashboard = function() {
coinlogo = 'franko';
coinname = 'Franko';
break;
case 'GMC':
coinlogo = 'gamerscoin';
coinname = 'Gamerscoin';
case 'GAME':
coinlogo = 'GAME';
coinname = 'GameCredits';
break;
case 'SUPERNET':
coinlogo = 'SUPERNET';
@ -677,8 +677,8 @@ var Dashboard = function() {
coinlogo = 'REVS';
coinname = 'REVS';
break;
case 'WIRELESS':
coinlogo = 'WIRELESS';
case 'WLC':
coinlogo = 'WLC';
coinname = 'WIRELESS';
break;
case 'PANGEA':
@ -939,6 +939,13 @@ var Dashboard = function() {
$('#addcoin_mdl_native_mode').prop('disabled', true);
$('#addcoin_mdl_full_mode').prop('disabled', false);
}
if (tmp_coin_val == 'ZEC') {
$('#addcoin_mdl_basilisk_mode').prop('disabled', true);
$('#addcoin_mdl_native_mode')
.prop('disabled', false)
.prop('checked', true);
$('#addcoin_mdl_full_mode').prop('disabled', true);
}
});
}
@ -1078,7 +1085,7 @@ var Dashboard = function() {
});
}
}, 1000);
}, 5000);
var FetchBasiliskData = setInterval(function() {
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin'),

3
assets/scripts/iguana_api.js

@ -185,7 +185,7 @@ function Iguana_utxorawtx(data) {
function checkAC(coinVal) {
if (coinVal == 'SUPERNET' ||
coinVal == 'REVS' ||
coinVal == 'WIRELESS' ||
coinVal == 'WLC' ||
coinVal == 'DEX' ||
coinVal == 'PANGEA' ||
coinVal == 'JUMBLR' ||
@ -199,6 +199,7 @@ function checkAC(coinVal) {
coinVal == 'KV' ||
coinVal == 'CEAL' ||
coinVal == 'MESH' ||
coinVal == 'BTC' ||
coinVal == 'USD' ||
coinVal == 'RON' ||
coinVal == 'EUR' ||

16
assets/scripts/iguana_api/IguanaAddcoin.js

@ -268,8 +268,8 @@ function Iguana_addcoin(addcoin_data) {
AddCoinData = {'userpass':tmpIguanaRPCAuth,"RELAY":addcoin_data.mode,"VALIDATE":addcoin_data.mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"prefetchlag":-1,"poll":10,"active":1,"agent":"iguana","method":"addcoin","maxpeers":256,"newcoin":"FRK","name":"Franko","netmagic":"7defaced","p2p":7912,"rpc":7913,"pubval":35,"p2shval":5,"wifval":163,"txfee_satoshis":"0","minconfirms":2,"genesishash":"19225ae90d538561217b5949e98ca4964ac91af39090d1a4407c892293e4f44f","genesis":{"hashalgo":"scrypt","version":1,"timestamp":1368144664,"nBits":"1e0ffff0","nonce":731837,"merkle_root":"b78f79f1d10029cc45ed3d5a1db7bd423d4ee170c03baf110a62565d16a21dca"},"alertpubkey":"04d4da7a5dae4db797d9b0644d57a5cd50e05a70f36091cd62e2fc41c98ded06340be5a43a35e185690cd9cde5d72da8f6d065b499b06f51dcfba14aad859f443a"}
}
if ( addcoin_data.coin == 'GMC' ) {
logincoinfullname = 'Gamerscoin';
if ( addcoin_data.coin == 'GAME' ) {
logincoinfullname = 'GameCredits';
if ( addcoin_data.mode == '1' ) {
logincoinmodeinfo = 'Full';
@ -278,7 +278,7 @@ function Iguana_addcoin(addcoin_data) {
}
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
AddCoinData = {'userpass':tmpIguanaRPCAuth,"RELAY":addcoin_data.mode,"VALIDATE":addcoin_data.mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"services":129,"prefetchlag":-1,"poll":10,"active":1,"agent":"iguana","method":"addcoin","maxpeers":256,"newcoin":"GMC","name":"GameCredits","netmagic":"fbc0b6db","p2p":40002,"rpc":40001,"pubval":38,"p2shval":5,"wifval":166,"txfee_satoshis":"100000","minconfirms":2,"genesishash":"91ec5f25ee9a0ffa1af7d4da4db9a552228dd2dc77cdb15b738be4e1f55f30ee","genesis":{"hashalgo":"scrypt","version":1,"timestamp":1392757140,"nBits":"1e0ffff0","nonce":2084565393,"merkle_root":"d849db99a14164f4b4c8ad6d2d8d7e2b1ba7f89963e9f4bf9fad5ff1a4754429"},"alertpubkey":"04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284","auxpow":1,"protover":80006,"isPoS":0}
AddCoinData = {'userpass':tmpIguanaRPCAuth,"RELAY":addcoin_data.mode,"VALIDATE":addcoin_data.mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"services":129,"prefetchlag":-1,"poll":10,"active":1,"agent":"iguana","method":"addcoin","maxpeers":256,"newcoin":"GAME","name":"GameCredits","netmagic":"fbc0b6db","p2p":40002,"rpc":40001,"pubval":38,"p2shval":5,"wifval":166,"txfee_satoshis":"100000","minconfirms":2,"genesishash":"91ec5f25ee9a0ffa1af7d4da4db9a552228dd2dc77cdb15b738be4e1f55f30ee","genesis":{"hashalgo":"scrypt","version":1,"timestamp":1392757140,"nBits":"1e0ffff0","nonce":2084565393,"merkle_root":"d849db99a14164f4b4c8ad6d2d8d7e2b1ba7f89963e9f4bf9fad5ff1a4754429"},"alertpubkey":"04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284","auxpow":1,"protover":80006,"isPoS":0}
}
if ( checkCoinType() === 'ac' ) {
@ -331,11 +331,11 @@ function Iguana_addcoin(addcoin_data) {
'AddCoinData': confpath ? Object.assign({}, _acPayloadOrigin, {"coin":"REVS","conf":"REVS.conf","path":confpath[0].path,"RELAY":-1,"VALIDATE":0,"startpend":4,"endpend":4,"maxpeers":8,"newcoin":"REVS","name":"REVS","netmagic":"905c3498","p2p":10195,"rpc":10196}) : {},
'AddCoinDataVar': Object.assign({}, _acPayloadOrigin, {'userpass':tmpIguanaRPCAuth,"RELAY":addcoin_data.mode,"VALIDATE":addcoin_data.mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"maxpeers":8,"newcoin":"REVS","name":"REVS","netmagic":"905c3498","p2p":10195,"rpc":10196})
},
'WIRELESS': {
'WLC': {
'name': 'WIRELESS',
'supply': 21000000,
'AddCoinData': confpath ? Object.assign({}, _acPayloadOrigin, {"coin":"WIRELESS","conf":"WIRELESS.conf","path":confpath[0].path,"RELAY":-1,"VALIDATE":0,"startpend":4,"endpend":4,"maxpeers":8,"newcoin":"WIRELESS","name":"WIRELESS","netmagic":"62071ed3","p2p":11666,"rpc":11667}) : {},
'AddCoinDataVar': Object.assign({}, _acPayloadOrigin, {'userpass':tmpIguanaRPCAuth,"RELAY":addcoin_data.mode,"VALIDATE":addcoin_data.mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"maxpeers":8,"newcoin":"WIRELESS","name":"WIRELESS","netmagic":"62071ed3","p2p":11666,"rpc":11667})
'supply': 210000000,
'AddCoinData': confpath ? Object.assign({}, _acPayloadOrigin, {"coin":"WLC","conf":"WLC.conf","path":confpath[0].path,"RELAY":-1,"VALIDATE":0,"startpend":4,"endpend":4,"maxpeers":8,"newcoin":"WLC","name":"WIRELESS","netmagic":"62071ed3","p2p":11666,"rpc":11667}) : {},
'AddCoinDataVar': Object.assign({}, _acPayloadOrigin, {'userpass':tmpIguanaRPCAuth,"RELAY":addcoin_data.mode,"VALIDATE":addcoin_data.mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"maxpeers":8,"newcoin":"WLC","name":"WIRELESS","netmagic":"62071ed3","p2p":11666,"rpc":11667})
},
'PANGEA': {
'name': 'PANGEA',
@ -508,7 +508,7 @@ function Iguana_addcoin(addcoin_data) {
addcoin_data.coin === 'KV' ||
addcoin_data.coin === 'CEAL' ||
addcoin_data.coin === 'MESH' ||
addcoin_data.coin === 'WIRELESS') {
addcoin_data.coin === 'WLC') {
return 'ac';
}
}

274
assets/scripts/kmd_wallet/KMDInit.js

@ -15,155 +15,157 @@ function RunKMDInitFunctions() {
});
NProgress.start();
var check1 = CheckIfConnected();
console.log(check1[0]);
if ( check1[0] == 'not active' ) {
console.log('Could not connect to external wallet. Is external wallet running?');
toastr.error(_lang[defaultLang].TOASTR.KMD_NATIVE_CON_ERROR, _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
$('#extcoin-wallet').hide();
$('#extcoin-wallet-connection-alert').show();
}
if ( check1[0] == 'null return' ) {
console.log('Could not connect to external wallet. Is iguana connected to external wallet?');
toastr.error(_lang[defaultLang].TOASTR.KMD_IGUANA_CON_ERROR, _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
$('#extcoin-wallet').hide();
$('#extcoin-wallet-connection-alert').show();
}
if ( check1[0] == 'activating' ) {
$('#extcoin-wallet-activating-alert').show();
$('#extcoin-wallet').show();
$('#extcoin-wallet-connection-alert').hide();
function _getKMDInfo() {
var passthru_agent = getPassthruAgent(),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'getinfo',
'hex': ''
};
console.log(ajax_data);
$.ajax({
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort,
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data);
if (AjaxOutputData && !AjaxOutputData.blocks) {
startBestBlockInterval();
} else {
clearInterval(currentBestBlockInterval);
}
},
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);
}
});
function _RunKMDInitFunctions(check1) {
console.log(check1[0]);
if ( check1[0] == 'not active' ) {
console.log('Could not connect to external wallet. Is external wallet running?');
toastr.error(_lang[defaultLang].TOASTR.KMD_NATIVE_CON_ERROR, _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
$('#extcoin-wallet').hide();
$('#extcoin-wallet-connection-alert').show();
}
if ( check1[0] == 'null return' ) {
console.log('Could not connect to external wallet. Is iguana connected to external wallet?');
toastr.error(_lang[defaultLang].TOASTR.KMD_IGUANA_CON_ERROR, _lang[defaultLang].TOASTR.WALLET_NOTIFICATION);
$('#extcoin-wallet').hide();
$('#extcoin-wallet-connection-alert').show();
}
if ( check1[0] == 'activating' ) {
$('#extcoin-wallet-activating-alert').show();
$('#extcoin-wallet').show();
$('#extcoin-wallet-connection-alert').hide();
function _getKMDInfo() {
var passthru_agent = getPassthruAgent(),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'method': 'passthru',
'function': 'getinfo',
'hex': ''
};
console.log(ajax_data);
$.ajax({
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort,
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data);
if (AjaxOutputData && !AjaxOutputData.blocks) {
startBestBlockInterval();
} else {
clearInterval(currentBestBlockInterval);
}
},
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);
}
});
}
function getRemoteCurrentHeight() {
var extcoin = $('[data-extcoin]').attr('data-extcoin');
function getRemoteCurrentHeight() {
var extcoin = $('[data-extcoin]').attr('data-extcoin');
$.ajax({
type: 'GET',
url: 'http://localhost:' + config.iguanaPort + '/api/dex/getinfo?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth') + '&symbol=' + extcoin,
success: function(data, textStatus, jqXHR) {
data = JSON.parse(data);
$.ajax({
type: 'GET',
url: 'http://localhost:' + config.iguanaPort + '/api/dex/getinfo?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth') + '&symbol=' + extcoin,
success: function(data, textStatus, jqXHR) {
data = JSON.parse(data);
if (data && data.blocks) {
totalBlocksInExplorer = data.blocks;
if (data && data.blocks) {
totalBlocksInExplorer = data.blocks;
}
},
error: function(xhr, textStatus, error) {
console.log('failed getinfo from dex api');
console.log(xhr.statusText);
console.log(textStatus);
console.log(error);
}
},
error: function(xhr, textStatus, error) {
console.log('failed getinfo from dex api');
console.log(xhr.statusText);
console.log(textStatus);
console.log(error);
}
});
}
var currentBestBlockInterval;
function startBestBlockInterval() {
currentBestBlockInterval = setInterval(function() {
if (!chainActivationLastUpdate || checkTimestamp(chainActivationLastUpdate) > chainActivationLastUpdateTimeout) {
$.ajax({
type: 'POST',
data: {
'herdname': 'komodo',
'lastLines': 1
},
url: 'http://127.0.0.1:17777/shepherd/debuglog',
success: function(data, textStatus, jqXHR) {
if (data.indexOf('UpdateTip') > -1) {
var temp = data.split(' ');
for (var i = 0; i < temp.length; i++) {
if (temp[i].indexOf('height=') > -1) {
var currentBestChain = temp[i].replace('height=', '');
$('#activating-komodod-tridot').hide();
$('#activating-komodod-progress').html(': ' + Math.floor(currentBestChain * 100 / totalBlocksInExplorer) + '% (blocks ' + currentBestChain + ' / ' + totalBlocksInExplorer + ')');
chainActivationLastUpdate = Date.now();
if (currentBestChain === totalBlocksInExplorer) {
clearInterval(currentBestBlockInterval);
});
}
var currentBestBlockInterval;
function startBestBlockInterval() {
currentBestBlockInterval = setInterval(function() {
if (!chainActivationLastUpdate || checkTimestamp(chainActivationLastUpdate) > chainActivationLastUpdateTimeout) {
$.ajax({
type: 'POST',
data: {
'herdname': 'komodo',
'lastLines': 1
},
url: 'http://127.0.0.1:17777/shepherd/debuglog',
success: function(data, textStatus, jqXHR) {
if (data.indexOf('UpdateTip') > -1) {
var temp = data.split(' ');
for (var i = 0; i < temp.length; i++) {
if (temp[i].indexOf('height=') > -1) {
var currentBestChain = temp[i].replace('height=', '');
$('#activating-komodod-tridot').hide();
$('#activating-komodod-progress').html(': ' + Math.floor(currentBestChain * 100 / totalBlocksInExplorer) + '% (blocks ' + currentBestChain + ' / ' + totalBlocksInExplorer + ')');
chainActivationLastUpdate = Date.now();
if (currentBestChain === totalBlocksInExplorer) {
clearInterval(currentBestBlockInterval);
}
}
}
}
},
error: function(xhr, textStatus, error) {
console.log('failed getting debug.log');
console.log(xhr.statusText);
console.log(textStatus);
console.log(error);
}
},
error: function(xhr, textStatus, error) {
console.log('failed getting debug.log');
console.log(xhr.statusText);
console.log(textStatus);
console.log(error);
}
});
}
}, 2000);
}
if (sessionStorage.getItem('edexTmpMode') === 'Native') {
getRemoteCurrentHeight();
});
}
}, 5000);
}
var totalBlocksInExplorer = 0,
totalBlocksInExplorerInterval = setInterval(function() {
if (sessionStorage.getItem('edexTmpMode') === 'Native') {
getRemoteCurrentHeight();
_getKMDInfo();
}, 60000);
} else {
clearInterval(totalBlocksInExplorerInterval);
clearInterval(currentBestBlockInterval);
var totalBlocksInExplorer = 0,
totalBlocksInExplorerInterval = setInterval(function() {
getRemoteCurrentHeight();
_getKMDInfo();
}, 60000);
} else {
clearInterval(totalBlocksInExplorerInterval);
clearInterval(currentBestBlockInterval);
}
$('#kmd_wallet_dashoard_section').show();
$('#kmd_wallet_dashboardinfo').show();
$('#kmd_wallet_send').hide();
$('#kmd_wallet_recieve_section').hide();
$('#kmd_wallet_settings').hide();
}
if ( check1[0] == 'connected') {
getTotalKMDBalance();
KMDfillTxHistoryT();
$('#extcoin-wallet').show();
$('#extcoin-wallet-connection-alert').hide();
$('#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').show();
$('#kmd_wallet_dashboardinfo').show();
$('#kmd_wallet_send').hide();
$('#kmd_wallet_recieve_section').hide();
$('#kmd_wallet_settings').hide();
NProgress.done();
}
if ( check1[0] == 'connected') {
getTotalKMDBalance();
KMDfillTxHistoryT();
$('#extcoin-wallet').show();
$('#extcoin-wallet-connection-alert').hide();
$('#kmd_wallet_dashoard_section').show();
$('#kmd_wallet_dashboardinfo').show();
$('#kmd_wallet_send').hide();
$('#kmd_wallet_recieve_section').hide();
$('#kmd_wallet_settings').hide();
}
$('#kmd_wallet_recieve_section').hide();
NProgress.done();
CheckIfConnected(_RunKMDInitFunctions);
}

59
assets/scripts/kmd_wallet_dashboard.js

@ -55,7 +55,7 @@ function getPassthruAgent() {
return passthru_agent;
}
function CheckIfConnected() {
function CheckIfConnected(cb) {
var result = [],
extcoin = $('[data-extcoin]').attr('data-extcoin'),
passthru_agent = getPassthruAgent(),
@ -82,7 +82,6 @@ function CheckIfConnected() {
console.log(ajax_data);
$.ajax({
async: false,
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort,
@ -98,6 +97,8 @@ function CheckIfConnected() {
} else {
result.push(AjaxOutputData.errors);
}
cb.call(this, result);
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
@ -107,12 +108,15 @@ function CheckIfConnected() {
}
console.log(textStatus);
console.log(error);
cb.call(this, result);
}
});
return result;
}
// TODO: this func is not used anywhere
function CheckIfWalletEncrypted() {
var result = [],
passthru_agent = getPassthruAgent(),
@ -168,7 +172,7 @@ function CheckIfWalletEncrypted() {
return result;
}
function KMD_getInfo_rtrn() {
function KMD_getInfo_rtrn(cb) {
var result = [],
extcoin = $('[data-extcoin]').attr('data-extcoin'),
passthru_agent = getPassthruAgent(),
@ -195,7 +199,6 @@ function KMD_getInfo_rtrn() {
}
$.ajax({
async: false,
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort,
@ -211,6 +214,8 @@ function KMD_getInfo_rtrn() {
} else {
result.push(AjaxOutputData.errors);
}
cb.call(this, result[0]);
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
@ -220,6 +225,7 @@ function KMD_getInfo_rtrn() {
}
console.log(textStatus);
console.log(error);
cb.call(this, result);
}
});
@ -228,29 +234,32 @@ function KMD_getInfo_rtrn() {
function KMD_ProgressBar() {
var result = [],
extcoin = $('[data-extcoin]').attr('data-extcoin'),
getinfotmp = KMD_getInfo_rtrn();
if (extcoin !== 'ZEC') {
if ( getinfotmp == 'activating') {
$('span[data-extcoin="' + extcoin + '"][id="extcoin-sync-percent"]').text(_lang[defaultLang].INDEX.ACTIVATING + '...');
} else {
if (getinfotmp.blocks === 0) {
$('span[data-extcoin="' + extcoin + '"][id="extcoin-sync-percent"]').text('No blocks');
$('#extcoin-progressbars .progress-bar').css({ 'width': '100%' });
} else if (getinfotmp.blocks > 0 && getinfotmp.longestchain === 0) {
$('span[data-extcoin="' + extcoin + '"][id="extcoin-sync-percent"]').text('No longestchain');
$('#extcoin-progressbars .progress-bar').css({ 'width': '100%' });
extcoin = $('[data-extcoin]').attr('data-extcoin');
KMD_getInfo_rtrn(_KMD_ProgressBar);
function _KMD_ProgressBar(getinfotmp) {
if (extcoin !== 'ZEC') {
if ( getinfotmp == 'activating') {
$('span[data-extcoin="' + extcoin + '"][id="extcoin-sync-percent"]').text(_lang[defaultLang].INDEX.ACTIVATING + '...');
} else {
var sync_percent = parseFloat(parseInt(getinfotmp.blocks, 10) * 100) / parseInt(getinfotmp.longestchain, 10);
console.log('getinfotmp', getinfotmp);
$('div[data-extcoin="' + extcoin + '"][id="extcoin-sync"]').width(parseFloat(sync_percent).toFixed(2) + '%');
$('span[data-extcoin="' + extcoin + '"][id="extcoin-sync-percent"]').text(parseFloat(sync_percent).toFixed(2) + '%');
$('span[data-extcoin="' + extcoin + '"][id="extcoin-synced-blocks"]').text(getinfotmp.blocks);
$('span[data-extcoin="' + extcoin + '"][id="extcoin-longestchain"]').text(getinfotmp.longestchain);
$('span[data-extcoin="' + extcoin + '"][id="extcoin-connections"]').text(getinfotmp.connections);
if (getinfotmp.blocks === 0) {
$('span[data-extcoin="' + extcoin + '"][id="extcoin-sync-percent"]').text('No blocks');
$('#extcoin-progressbars .progress-bar').css({ 'width': '100%' });
} else if (getinfotmp.blocks > 0 && getinfotmp.longestchain === 0) {
$('span[data-extcoin="' + extcoin + '"][id="extcoin-sync-percent"]').text('No longestchain');
$('#extcoin-progressbars .progress-bar').css({ 'width': '100%' });
} else {
var sync_percent = parseFloat(parseInt(getinfotmp.blocks, 10) * 100) / parseInt(getinfotmp.longestchain, 10);
console.log('getinfotmp', getinfotmp);
$('div[data-extcoin="' + extcoin + '"][id="extcoin-sync"]').width(parseFloat(sync_percent).toFixed(2) + '%');
$('span[data-extcoin="' + extcoin + '"][id="extcoin-sync-percent"]').text(parseFloat(sync_percent).toFixed(2) + '%');
$('span[data-extcoin="' + extcoin + '"][id="extcoin-synced-blocks"]').text(getinfotmp.blocks);
$('span[data-extcoin="' + extcoin + '"][id="extcoin-longestchain"]').text(getinfotmp.longestchain);
$('span[data-extcoin="' + extcoin + '"][id="extcoin-connections"]').text(getinfotmp.connections);
}
$('#extcoin-wallet-activating-alert').hide();
}
$('#extcoin-wallet-activating-alert').hide();
}
}
}

2
assets/scripts/login.js

@ -706,7 +706,7 @@ var Login = function() {
}
if (tmp_coin_val == 'SUPERNET' ||
tmp_coin_val == 'REVS' ||
tmp_coin_val == 'WIRELESS' ||
tmp_coin_val == 'WLC' ||
tmp_coin_val == 'DEX' ||
tmp_coin_val == 'PANGEA' ||
tmp_coin_val == 'JUMBLR' ||

15
assets/scripts/sidebar.js

@ -436,8 +436,8 @@ function assetchain_pax_menu_actions(coin) {
case 'REVS':
renderAssetGFX('supernet', 'jumblr', coin);
break;
case 'WIRELESS':
renderAssetGFX('wireless', 'wireless', coin);
case 'WLC':
renderAssetGFX('wireless', 'wireless', 'Wireless (WLC)');
break;
case 'PANGEA':
renderAssetGFX('pangea', 'jumblr', coin);
@ -449,7 +449,7 @@ function assetchain_pax_menu_actions(coin) {
renderAssetGFX('supernet', 'jumblr', coin);
break;
case 'BET':
renderAssetGFX('wireless', 'wireless', coin);
renderAssetGFX('bet', 'bet', coin);
break;
case 'CRYPTO':
renderAssetGFX('supernet', 'jumblr', coin);
@ -458,7 +458,7 @@ function assetchain_pax_menu_actions(coin) {
renderAssetGFX('supernet', 'jumblr', coin);
break;
case 'SHARK':
renderAssetGFX('wireless', 'wireless', coin);
renderAssetGFX('shark', 'shark', coin);
break;
case 'BOTS':
renderAssetGFX('supernet', 'jumblr', coin);
@ -476,7 +476,10 @@ function assetchain_pax_menu_actions(coin) {
renderAssetGFX('ceal', 'ceal', coin);
break;
case 'MESH':
renderAssetGFX('mesh', 'mesh', coin);
renderAssetGFX('mesh', 'mesh', 'SuperMesh (MESH)');
break;
case 'BTC':
renderAssetGFX('btc', 'btc', '(BTC)');
break;
case 'USD':
renderAssetGFX('usd', 'usd', 'US Dollar (USD)');
@ -610,9 +613,9 @@ function applyKMDWalletStyle() {
'background-repeat': 'no-repeat',
'background-position': '0%'
});
$('#easydex_kmd_wallet_actions_header').show();
$(
'#easydex_acpax_wallet_actions_header,' +
'#easydex_kmd_wallet_actions_header,' +
'#easydex_zec_wallet_actions_header,' +
'#jumblr_actions_header,' +
'#easydex_btc_btcd_balances_header'

4
assets/scripts/templates/addCoinOptions.js

@ -9,7 +9,7 @@ templates.addCoinOptions =
<option value="DGB">Digibyte (DGB)</option>
<option value="DOGE">Dogecoin (DOGE)</option>
<option value="FRK">Franko (FRK)</option>
<option value="GMC">Gamerscoin (GMC)</option>
<option value="GAME">GameCredits (GAME)</option>
<option value="KMD">Komodo (KMD)</option>
<option value="LTC">Litecoin (LTC)</option>
<option value="MZC">MazaCoin (MZC)</option>
@ -34,7 +34,7 @@ templates.addCoinOptions =
<option value="SHARK">SHARK (SHARK)</option>
<option value="MESH">SpaceMesh (MESH)</option>
<option value="SUPERNET">SUPERNET (SUPERNET)</option>
<option value="WIRELESS">WIRELESS (WIRELESS)</option>
<option value="WLC">WIRELESS (WLC)</option>
</optgroup>
<optgroup label="Fiat Currencies">
<option value="AUD">Australian Dollar (AUD)</option>

7
assets/scripts/templates/bottomIncludes.js

@ -126,7 +126,12 @@ templates.bottomIncludes =
socket.on('messages', function(data) {
console.log(data);
});
socket.on('service', function(data) {
console.log('service', data);
if (data.komodod && data.komodod.error === 'start error') {
toastr.error(_lang[defaultLang].TOASTR.KOMODO_ERR, _lang[defaultLang].TOASTR.SERVICE_NOTIFICATION + '.');
}
});
lang();
});
})(document, window, jQuery);

28
assets/scripts/walletsettings.js

@ -66,20 +66,20 @@ var WalletSettings = function() {
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>';
var 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) {

4
index.html

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
<meta name="description" content="bootstrap admin template">
<meta name="author" content="">
<title>Agama - EasyDEX (v0.1.6.0e-beta)</title>
<title>Agama - EasyDEX (v0.1.6.1e-beta)</title>
<link rel="apple-touch-icon" href="assets/images/android-chrome-192x192.png">
<link rel="icon" type="image/png" href="assets/images/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="assets/images/favicon-194x194.png" sizes="194x194">
@ -58,6 +58,8 @@
<![endif]-->
<!-- Scripts -->
<script>window.kmdcli = require('../../private/kmdcli');</script>
<script src="assets/js/kmdcli.js"></script>
<script>
if (typeof module === 'object') {
window.module = module;

Loading…
Cancel
Save