Browse Source

disable log store update in prod

all-modes
pbca26 8 years ago
parent
commit
dbddf5110a
  1. 42
      react/src/actions/actions/addCoin.js
  2. 182
      react/src/actions/actions/addressBalance.js
  3. 42
      react/src/actions/actions/atomic.js
  4. 84
      react/src/actions/actions/basiliskProcessAddress.js
  5. 42
      react/src/actions/actions/createWallet.js
  6. 42
      react/src/actions/actions/dexCoins.js
  7. 72
      react/src/actions/actions/edexBalance.js
  8. 42
      react/src/actions/actions/edexGetTx.js
  9. 42
      react/src/actions/actions/fullTxHistory.js
  10. 42
      react/src/actions/actions/getAddrByAccount.js
  11. 42
      react/src/actions/actions/iguanaHelpers.js
  12. 42
      react/src/actions/actions/logout.js
  13. 42
      react/src/actions/actions/nativeBalance.js
  14. 42
      react/src/actions/actions/nativeNewAddress.js
  15. 84
      react/src/actions/actions/nativeSend.js
  16. 84
      react/src/actions/actions/nativeSyncInfo.js
  17. 42
      react/src/actions/actions/nativeTxHistory.js
  18. 84
      react/src/actions/actions/notary.js
  19. 168
      react/src/actions/actions/sendFullBasilisk.js
  20. 126
      react/src/actions/actions/settings.js
  21. 42
      react/src/actions/actions/syncInfo.js
  22. 168
      react/src/actions/actions/walletAuth.js

42
react/src/actions/actions/addCoin.js

@ -97,14 +97,16 @@ export function addCoin(coin, mode, syncOnly, port, startupParams) {
export function iguanaAddCoin(coin, mode, acData, port) {
function _iguanaAddCoin(dispatch) {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'iguanaAddCoin',
'type': 'post',
'url': `http://127.0.0.1:${(port ? port : Config.iguanaCorePort)}`,
'payload': acData,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'iguanaAddCoin',
'type': 'post',
'url': `http://127.0.0.1:${(port ? port : Config.iguanaCorePort)}`,
'payload': acData,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${(port ? port : Config.iguanaCorePort)}`, {
method: 'POST',
@ -112,11 +114,13 @@ export function iguanaAddCoin(coin, mode, acData, port) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
translate('TOASTR.FAILED_TO_ADDCOIN'),
@ -127,11 +131,13 @@ export function iguanaAddCoin(coin, mode, acData, port) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(
addCoinResult(
coin,

182
react/src/actions/actions/addressBalance.js

@ -106,14 +106,16 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
}
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDAddressesNative',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDAddressesNative',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
@ -137,11 +139,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getKMDAddressesNative',
@ -152,11 +156,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
resolve(Config.cli.default && mode === 'native' ? json.result : json);
})
}
@ -279,7 +285,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
Promise.all(result[1].map((_address, index) => {
return new Promise((resolve, reject) => {
const _timestamp = Date.now();
let ajaxDataToHex = `[\"${_address}\"]`;
let ajaxDataToHex = '["' + _address + '"]';
iguanaHashHex(ajaxDataToHex, dispatch)
.then((hashHexJson) => {
@ -301,14 +307,16 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'hex': hashHexJson,
};
}
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDAddressesNative+ZBalance',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDAddressesNative+ZBalance',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
@ -341,11 +349,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getKMDAddressesNative+ZBalance',
@ -359,11 +369,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
if (json &&
json.error) {
resolve(0);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': json,
}));
}
dispatch(
triggerToaster(
'getKMDAddressesNative+ZBalance',
@ -382,11 +394,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
amount: json,
type: 'private',
};
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
}
});
});
@ -435,14 +449,16 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
calcBalance(result, json[coin][currentAddress].refresh.data, dispatch, mode);
} else {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDAddressesNative+Balance',
'type': 'post',
'url': `http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDAddressesNative+Balance',
'type': 'post',
'url': `http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`,
'payload': payload,
'status': 'pending',
}));
}
fetch(`http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, {
method: 'POST',
@ -450,11 +466,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getKMDAddressesNative+Balance',
@ -465,11 +483,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
})
.then(response => response.json())
.then(function(json) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
updatedCache.basilisk[coin][currentAddress].refresh = {
'data': json,
'status': 'done',
@ -487,14 +507,16 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
})
} else {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDAddressesNative+Balance',
'type': 'post',
'url': `http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDAddressesNative+Balance',
'type': 'post',
'url': `http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`,
'payload': payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
@ -525,11 +547,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getKMDAddressesNative+Balance',
@ -544,11 +568,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
mode === 'native') {
json = json.result;
}
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
calcBalance(
result,
json,

42
react/src/actions/actions/atomic.js

@ -9,14 +9,16 @@ import Config from '../../config';
export function atomic(payload) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'atomic',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'atomic',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -24,11 +26,13 @@ export function atomic(payload) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
payload.method,
@ -39,11 +43,13 @@ export function atomic(payload) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(atomicState(json));
});
}

84
react/src/actions/actions/basiliskProcessAddress.js

@ -17,14 +17,16 @@ export function checkAddressBasilisk(coin, address) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'checkAddressBasilisk',
'type': 'post',
'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'checkAddressBasilisk',
'type': 'post',
'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, {
method: 'POST',
@ -32,11 +34,13 @@ export function checkAddressBasilisk(coin, address) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'checkAddressBasilisk',
@ -47,11 +51,13 @@ export function checkAddressBasilisk(coin, address) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(checkAddressBasiliskHandle(json));
})
}
@ -97,14 +103,16 @@ export function validateAddressBasilisk(coin, address) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'validateAddressBasilisk',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'validateAddressBasilisk',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, {
method: 'POST',
@ -112,11 +120,13 @@ export function validateAddressBasilisk(coin, address) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'validateAddressBasilisk',
@ -127,11 +137,13 @@ export function validateAddressBasilisk(coin, address) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(validateAddressBasiliskHandle(json));
})
}

42
react/src/actions/actions/createWallet.js

@ -42,14 +42,16 @@ export function createNewWallet(_passphrase) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'createNewWallet',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'createNewWallet',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -57,11 +59,13 @@ export function createNewWallet(_passphrase) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'createNewWallet',
@ -72,11 +76,13 @@ export function createNewWallet(_passphrase) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(createNewWalletState(json));
})
}

42
react/src/actions/actions/dexCoins.js

@ -17,14 +17,16 @@ export function getDexCoins() {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getDexCoins',
'type': 'post',
'url': Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/InstantDEX/allcoins` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getDexCoins',
'type': 'post',
'url': Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/InstantDEX/allcoins` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
@ -46,11 +48,13 @@ export function getDexCoins() {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'Error getDexCoins',
@ -61,11 +65,13 @@ export function getDexCoins() {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(dashboardCoinsState(json));
});
}

72
react/src/actions/actions/edexBalance.js

@ -17,14 +17,16 @@ export function iguanaEdexBalance(coin) {
return dispatch => {
if (coin) {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'iguanaEdexBalance',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'iguanaEdexBalance',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -32,11 +34,13 @@ export function iguanaEdexBalance(coin) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'Error iguanaEdexBalance',
@ -70,14 +74,16 @@ export function getDexBalance(coin, mode, addr) {
return new Promise((resolve, reject) => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getDexBalance',
'type': 'post',
'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getDexBalance',
'type': 'post',
'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, {
method: 'POST',
@ -85,11 +91,13 @@ export function getDexBalance(coin, mode, addr) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getDexBalance',
@ -101,11 +109,13 @@ export function getDexBalance(coin, mode, addr) {
.then(response => response.json())
.then(json => {
console.log(json);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
})
resolve(index);

42
react/src/actions/actions/edexGetTx.js

@ -17,14 +17,16 @@ export function edexGetTransaction(data, dispatch) {
return new Promise((resolve, reject) => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'edexGetTransaction',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'edexGetTransaction',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -32,11 +34,13 @@ export function edexGetTransaction(data, dispatch) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'edexGetTransaction',
@ -47,11 +51,13 @@ export function edexGetTransaction(data, dispatch) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
resolve(json);
})
});

42
react/src/actions/actions/fullTxHistory.js

@ -22,14 +22,16 @@ export function getFullTransactionsList(coin) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getFullTransactionsList',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getFullTransactionsList',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -37,11 +39,13 @@ export function getFullTransactionsList(coin) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getFullTransactionsList',
@ -52,11 +56,13 @@ export function getFullTransactionsList(coin) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(getNativeTxHistoryState(json));
})
}

42
react/src/actions/actions/getAddrByAccount.js

@ -37,14 +37,16 @@ export function getAddressesByAccount(coin, mode) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getAddressesByAccount',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getAddressesByAccount',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -52,11 +54,13 @@ export function getAddressesByAccount(coin, mode) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(updateErrosStack('activeHandle'));
dispatch(
triggerToaster(
@ -68,11 +72,13 @@ export function getAddressesByAccount(coin, mode) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(
getAddressesByAccountState(
json,

42
react/src/actions/actions/iguanaHelpers.js

@ -30,14 +30,16 @@ export function iguanaHashHex(data, dispatch) {
resolve(true);
} else {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'iguanaHashHex',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'iguanaHashHex',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -45,11 +47,13 @@ export function iguanaHashHex(data, dispatch) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'iguanaHashHex',
@ -60,11 +64,13 @@ export function iguanaHashHex(data, dispatch) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
resolve(json.hex);
})
}

42
react/src/actions/actions/logout.js

@ -39,14 +39,16 @@ function walletLock() {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'walletLock',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'walletLock',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -54,11 +56,13 @@ function walletLock() {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'walletLock',
@ -69,11 +73,13 @@ function walletLock() {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(logoutState(json));
dispatch(logoutResetAppState());
})

42
react/src/actions/actions/nativeBalance.js

@ -42,14 +42,16 @@ export function getKMDBalanceTotal(coin) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDBalanceTotal',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDBalanceTotal',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
@ -72,11 +74,13 @@ export function getKMDBalanceTotal(coin) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getKMDBalanceTotal',
@ -87,11 +91,13 @@ export function getKMDBalanceTotal(coin) {
})
.then(response => response.json())
.then(function(json) { // TODO: figure out why komodod spits out "parse error"
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
if (json &&
!json.error) {
dispatch(getNativeBalancesState(json));

42
react/src/actions/actions/nativeNewAddress.js

@ -49,14 +49,16 @@ export function getNewKMDAddresses(coin, pubpriv) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getNewKMDAddresses',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getNewKMDAddresses',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
@ -85,11 +87,13 @@ export function getNewKMDAddresses(coin, pubpriv) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getNewKMDAddresses',
@ -103,11 +107,13 @@ export function getNewKMDAddresses(coin, pubpriv) {
if (Config.cli.default) {
json = json.result;
}
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(
handleGetNewKMDAddresses(
pubpriv,

84
react/src/actions/actions/nativeSend.js

@ -48,14 +48,16 @@ export function sendNativeTx(coin, _payload) {
}
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'sendNativeTx',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'sendNativeTx',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
@ -98,11 +100,13 @@ export function sendNativeTx(coin, _payload) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'sendNativeTx',
@ -116,11 +120,13 @@ export function sendNativeTx(coin, _payload) {
return _response;
})
.then(function(json) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
if (json.indexOf('"code":') > -1) {
const _message = json.substring(
@ -209,14 +215,16 @@ export function getKMDOPID(opid, coin) {
}
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDOPID',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDOPID',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
@ -245,11 +253,13 @@ export function getKMDOPID(opid, coin) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getKMDOPID',
@ -263,11 +273,13 @@ export function getKMDOPID(opid, coin) {
if (Config.cli.default) {
json = json.result;
}
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(getKMDOPIDState(json));
})
})

84
react/src/actions/actions/nativeSyncInfo.js

@ -16,14 +16,16 @@ export function getSyncInfoNativeKMD(skipDebug) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getSyncInfoNativeKMD',
'type': 'post',
'url': Config.iguanaLessMode ? 'http://kmd.explorer.supernet.org/api/status?q=getInfo' : `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`,
'payload': '',
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getSyncInfoNativeKMD',
'type': 'post',
'url': Config.iguanaLessMode ? 'http://kmd.explorer.supernet.org/api/status?q=getInfo' : `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`,
'payload': '',
'status': 'pending',
}));
}
return fetch(
Config.iguanaLessMode ? 'http://kmd.explorer.supernet.org/api/status?q=getInfo' : `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`, {
@ -31,11 +33,13 @@ export function getSyncInfoNativeKMD(skipDebug) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getSyncInfoNativeKMD',
@ -46,11 +50,13 @@ export function getSyncInfoNativeKMD(skipDebug) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': Config.iguanaLessMode ? json.info : json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': Config.iguanaLessMode ? json.info : json,
}));
}
dispatch(getSyncInfoNativeState({ 'remoteKMDNode': Config.iguanaLessMode ? json.info : json }));
})
.then(function() {
@ -104,14 +110,16 @@ export function getSyncInfoNative(coin, skipDebug) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getSyncInfo',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getSyncInfo',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
body: JSON.stringify(payload),
@ -133,11 +141,13 @@ export function getSyncInfoNative(coin, skipDebug) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getSyncInfo',
@ -172,11 +182,13 @@ export function getSyncInfoNative(coin, skipDebug) {
dispatch(getDebugLog('komodo', 1));
}
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(
getSyncInfoNativeState(
json,

42
react/src/actions/actions/nativeTxHistory.js

@ -33,14 +33,16 @@ export function getNativeTxHistory(coin) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getNativeTxHistory',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getNativeTxHistory',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
@ -69,11 +71,13 @@ export function getNativeTxHistory(coin) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getNativeTxHistory',
@ -84,11 +88,13 @@ export function getNativeTxHistory(coin) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(getNativeTxHistoryState(json));
})
}

84
react/src/actions/actions/notary.js

@ -23,25 +23,29 @@ function initNotaryNodesConSequence(nodes) {
return new Promise((resolve, reject) => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': `initNotaryNodesConSequence+${node}`,
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': `initNotaryNodesConSequence+${node}`,
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
fetch(`http://127.0.0.1:${(Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}/api/dex/getinfo?userpass=${('tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'))}&symbol=${node}`, {
method: 'GET',
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
`getInfoDexNode+${node}`,
@ -52,11 +56,13 @@ function initNotaryNodesConSequence(nodes) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(
updateNotaryNodeConState(
json,
@ -171,25 +177,29 @@ export function getDexNotaries(coin) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getDexNotaries',
'type': 'post',
'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getDexNotaries',
'type': 'post',
'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getDexNotaries',
@ -200,11 +210,13 @@ export function getDexNotaries(coin) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(getDexNotariesState(json));
})
}

168
react/src/actions/actions/sendFullBasilisk.js

@ -25,14 +25,16 @@ export function sendToAddress(coin, _payload) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'sendToAddress',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'sendToAddress',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -40,11 +42,13 @@ export function sendToAddress(coin, _payload) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'sendToAddress',
@ -55,11 +59,13 @@ export function sendToAddress(coin, _payload) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(sendToAddressState(json, dispatch));
})
}
@ -81,14 +87,16 @@ export function sendFromAddress(coin, _payload) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'sendFromAddress',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'sendFromAddress',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -96,11 +104,13 @@ export function sendFromAddress(coin, _payload) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'sendFromAddress',
@ -111,11 +121,13 @@ export function sendFromAddress(coin, _payload) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(sendToAddressState(json, dispatch));
})
}
@ -140,14 +152,16 @@ export function iguanaUTXORawTX(data, dispatch) {
return new Promise((resolve, reject) => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'iguanaUTXORawTX',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'iguanaUTXORawTX',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -155,11 +169,13 @@ export function iguanaUTXORawTX(data, dispatch) {
})
.catch(function(error) {
console.log(error);
dispatch => dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch => dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'iguanaUTXORawTX',
@ -170,11 +186,13 @@ export function iguanaUTXORawTX(data, dispatch) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
resolve(json);
})
});
@ -191,14 +209,16 @@ export function dexSendRawTX(data, dispatch) {
return new Promise((resolve, reject) => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'dexSendRawTX',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'dexSendRawTX',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
@ -206,11 +226,13 @@ export function dexSendRawTX(data, dispatch) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'dexSendRawTX',
@ -225,11 +247,13 @@ export function dexSendRawTX(data, dispatch) {
return _response;
})
.then(function(json) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
resolve(json);
})
});

126
react/src/actions/actions/settings.js

@ -101,14 +101,16 @@ export function importPrivKey(wifKey) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'importPrivKey',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'importPrivKey',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -116,11 +118,13 @@ export function importPrivKey(wifKey) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'importPrivKey',
@ -131,11 +135,13 @@ export function importPrivKey(wifKey) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(
parseImportPrivKeyResponse(
json,
@ -200,14 +206,16 @@ export function getPeersList(coin) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getPeersList',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getPeersList',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -215,11 +223,13 @@ export function getPeersList(coin) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getPeersList',
@ -230,11 +240,13 @@ export function getPeersList(coin) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(getPeersListState(json, dispatch));
})
}
@ -316,14 +328,16 @@ export function addPeerNode(coin, ip) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'addPeerNode',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'addPeerNode',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -331,11 +345,13 @@ export function addPeerNode(coin, ip) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'addPeerNode',
@ -346,11 +362,13 @@ export function addPeerNode(coin, ip) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(addPeerNodeState(json, dispatch));
})
}

42
react/src/actions/actions/syncInfo.js

@ -31,14 +31,16 @@ export function getSyncInfo(coin) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getSyncInfo',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getSyncInfo',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -46,11 +48,13 @@ export function getSyncInfo(coin) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getSyncInfo',
@ -65,11 +69,13 @@ export function getSyncInfo(coin) {
return _response;
})
.then(function(json) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
if (json.indexOf('coin is busy processing') === -1) {
dispatch(getSyncInfoState(json, dispatch));
}

168
react/src/actions/actions/walletAuth.js

@ -24,14 +24,16 @@ export function encryptWallet(_passphrase, cb, coin) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'encryptWallet',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'encryptWallet',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -39,11 +41,13 @@ export function encryptWallet(_passphrase, cb, coin) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'encryptWallet',
@ -55,11 +59,13 @@ export function encryptWallet(_passphrase, cb, coin) {
.then(dispatch(walletPassphrase(_passphrase)))
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(
cb.call(
this,
@ -82,14 +88,16 @@ export function walletPassphrase(_passphrase) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'walletpassphrase',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'walletpassphrase',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -97,11 +105,13 @@ export function walletPassphrase(_passphrase) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'walletPassphrase',
@ -111,11 +121,13 @@ export function walletPassphrase(_passphrase) {
);
})
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
})
}
}
@ -132,14 +144,16 @@ export function iguanaWalletPassphrase(_passphrase) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'iguanaWalletPassphrase',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'iguanaWalletPassphrase',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -147,11 +161,13 @@ export function iguanaWalletPassphrase(_passphrase) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'Error iguanaWalletPassphrase',
@ -162,11 +178,13 @@ export function iguanaWalletPassphrase(_passphrase) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(iguanaWalletPassphraseState(json, dispatch));
});
}
@ -181,14 +199,16 @@ export function iguanaActiveHandle(getMainAddress) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'iguanaActiveHandle',
'type': 'post',
'url': Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/SuperNET/activehandle` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'iguanaActiveHandle',
'type': 'post',
'url': Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/SuperNET/activehandle` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
@ -210,11 +230,13 @@ export function iguanaActiveHandle(getMainAddress) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(updateErrosStack('activeHandle'));
dispatch(
triggerToaster(
@ -226,11 +248,13 @@ export function iguanaActiveHandle(getMainAddress) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(getMainAddress ? getMainAddressState(json) : iguanaActiveHandleState(json));
});
}

Loading…
Cancel
Save