Browse Source

Merge branch 'redux' into tx-history-improvements

# Conflicts:
#	react/src/components/dashboard/walletsData/walletsData.js
#	react/src/components/dashboard/walletsData/walletsData.render.js
#	react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js
all-modes
Ivana Trajanovska 8 years ago
parent
commit
e775f76693
  1. 3
      react/change.log
  2. 4
      react/src/actions/actionCreators.js
  3. 6
      react/src/actions/actions/addCoin.js
  4. 30
      react/src/actions/actions/addressBalance.js
  5. 6
      react/src/actions/actions/atomic.js
  6. 12
      react/src/actions/actions/basiliskProcessAddress.js
  7. 6
      react/src/actions/actions/createWallet.js
  8. 6
      react/src/actions/actions/dexCoins.js
  9. 10
      react/src/actions/actions/edexBalance.js
  10. 6
      react/src/actions/actions/edexGetTx.js
  11. 6
      react/src/actions/actions/fullTxHistory.js
  12. 6
      react/src/actions/actions/getAddrByAccount.js
  13. 6
      react/src/actions/actions/iguanaHelpers.js
  14. 6
      react/src/actions/actions/logout.js
  15. 6
      react/src/actions/actions/nativeBalance.js
  16. 6
      react/src/actions/actions/nativeNewAddress.js
  17. 21
      react/src/actions/actions/nativeSend.js
  18. 12
      react/src/actions/actions/nativeSyncInfo.js
  19. 6
      react/src/actions/actions/nativeTxHistory.js
  20. 12
      react/src/actions/actions/notary.js
  21. 24
      react/src/actions/actions/sendFullBasilisk.js
  22. 18
      react/src/actions/actions/settings.js
  23. 6
      react/src/actions/actions/syncInfo.js
  24. 24
      react/src/actions/actions/walletAuth.js
  25. 10
      react/src/components/dashboard/coinTile/coinTileItem.js
  26. 20
      react/src/components/dashboard/main/dashboard.render.js
  27. 16
      react/src/components/dashboard/qrModal/qrModal.js
  28. 8
      react/src/components/dashboard/qrModal/qrModal.render.js
  29. 14
      react/src/components/dashboard/receiveCoin/receiveCoin.js
  30. 8
      react/src/components/dashboard/receiveCoin/receiveCoin.render.js
  31. 36
      react/src/components/dashboard/sendCoin/sendCoin.js
  32. 24
      react/src/components/dashboard/sendCoin/sendCoin.render.js
  33. 29
      react/src/components/dashboard/settings/settings.js
  34. 12
      react/src/components/dashboard/settings/settings.render.js
  35. 31
      react/src/components/dashboard/walletsBalance/walletsBalance.js
  36. 39
      react/src/components/dashboard/walletsBalance/walletsBalance.render.js
  37. 70
      react/src/components/dashboard/walletsData/walletsData.js
  38. 12
      react/src/components/dashboard/walletsData/walletsData.render.js
  39. 77
      react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js
  40. 44
      react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js
  41. 46
      react/src/components/dashboard/walletsNav/walletsNav.js
  42. 16
      react/src/components/dashboard/walletsNav/walletsNav.render.js
  43. 16
      react/src/components/dashboard/walletsProgress/walletsProgress.js
  44. 4
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js
  45. 36
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js
  46. 2
      react/src/components/login/login.js
  47. 10
      react/src/components/main/main.js
  48. 1
      react/src/components/main/walletMain.js
  49. 36
      react/src/components/overrides.scss
  50. 4
      react/src/translate/en.js
  51. 8
      react/src/translate/translate.js
  52. 13
      react/src/util/formatValue.js
  53. 15
      react/src/util/sort.js
  54. 6
      react/src/util/time.js
  55. 3
      react/www/index.html

3
react/change.log

@ -13,6 +13,9 @@ UI:
- reset app setting to default - reset app setting to default
- manual balance / transactions list refresh - manual balance / transactions list refresh
- quick access dropdown on login to open settings / about / sync only modals - quick access dropdown on login to open settings / about / sync only modals
- qr code generator / scan
- basilisk send form reset fix
- added native wallet info button
v0.2.0.21a-beta v0.2.0.21a-beta
-------------- --------------

4
react/src/actions/actionCreators.js

@ -325,9 +325,9 @@ export function getNativeTxHistoryState(json) {
if (json && if (json &&
json.error) { json.error) {
json = null; json = null;
} else if (json && json.result) { } else if (json && json.result && json.result.length) {
json = json.result; json = json.result;
} else if (!json.length) { } else if (!json || !json.result.length) {
json = 'no data'; json = 'no data';
} }

6
react/src/actions/actions/addCoin.js

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

30
react/src/actions/actions/addressBalance.js

@ -106,6 +106,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
} }
const _timestamp = Date.now(); const _timestamp = Date.now();
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': 'getKMDAddressesNative', 'function': 'getKMDAddressesNative',
@ -114,6 +115,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'payload': payload, 'payload': payload,
'status': 'pending', 'status': 'pending',
})); }));
}
let _fetchConfig = { let _fetchConfig = {
method: 'POST', method: 'POST',
@ -137,11 +139,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
) )
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'getKMDAddressesNative', 'getKMDAddressesNative',
@ -152,11 +156,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
}
resolve(Config.cli.default && mode === 'native' ? json.result : json); resolve(Config.cli.default && mode === 'native' ? json.result : json);
}) })
} }
@ -249,6 +255,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
for (let a = 0; a < result.length; a++) { for (let a = 0; a < result.length; a++) {
newAddressArray[a] = []; newAddressArray[a] = [];
if (result[a]) {
for (let b = 0; b < result[a].length; b++) { for (let b = 0; b < result[a].length; b++) {
let filteredArray; let filteredArray;
@ -270,6 +277,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
}; };
} }
} }
}
// get zaddr balance // get zaddr balance
if (result[1] && if (result[1] &&
@ -277,7 +285,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
Promise.all(result[1].map((_address, index) => { Promise.all(result[1].map((_address, index) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const _timestamp = Date.now(); const _timestamp = Date.now();
let ajaxDataToHex = `[\"${_address}\"]`; let ajaxDataToHex = '["' + _address + '"]';
iguanaHashHex(ajaxDataToHex, dispatch) iguanaHashHex(ajaxDataToHex, dispatch)
.then((hashHexJson) => { .then((hashHexJson) => {
@ -299,6 +307,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'hex': hashHexJson, 'hex': hashHexJson,
}; };
} }
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': 'getKMDAddressesNative+ZBalance', 'function': 'getKMDAddressesNative+ZBalance',
@ -307,6 +316,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'payload': payload, 'payload': payload,
'status': 'pending', 'status': 'pending',
})); }));
}
let _fetchConfig = { let _fetchConfig = {
method: 'POST', method: 'POST',
@ -339,11 +349,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
) )
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'getKMDAddressesNative+ZBalance', 'getKMDAddressesNative+ZBalance',
@ -357,11 +369,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
if (json && if (json &&
json.error) { json.error) {
resolve(0); resolve(0);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': json, 'response': json,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'getKMDAddressesNative+ZBalance', 'getKMDAddressesNative+ZBalance',
@ -380,12 +394,14 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
amount: json, amount: json,
type: 'private', type: 'private',
}; };
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
} }
}
}); });
}); });
}); });
@ -433,6 +449,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
calcBalance(result, json[coin][currentAddress].refresh.data, dispatch, mode); calcBalance(result, json[coin][currentAddress].refresh.data, dispatch, mode);
} else { } else {
const _timestamp = Date.now(); const _timestamp = Date.now();
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': 'getKMDAddressesNative+Balance', 'function': 'getKMDAddressesNative+Balance',
@ -441,6 +458,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'payload': payload, 'payload': payload,
'status': 'pending', 'status': 'pending',
})); }));
}
fetch(`http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, { fetch(`http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, {
method: 'POST', method: 'POST',
@ -448,11 +466,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
}) })
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'getKMDAddressesNative+Balance', 'getKMDAddressesNative+Balance',
@ -463,11 +483,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
}) })
.then(response => response.json()) .then(response => response.json())
.then(function(json) { .then(function(json) {
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
}
updatedCache.basilisk[coin][currentAddress].refresh = { updatedCache.basilisk[coin][currentAddress].refresh = {
'data': json, 'data': json,
'status': 'done', 'status': 'done',
@ -485,6 +507,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
}) })
} else { } else {
const _timestamp = Date.now(); const _timestamp = Date.now();
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': 'getKMDAddressesNative+Balance', 'function': 'getKMDAddressesNative+Balance',
@ -493,6 +516,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'payload': payload, 'payload': payload,
'status': 'pending', 'status': 'pending',
})); }));
}
let _fetchConfig = { let _fetchConfig = {
method: 'POST', method: 'POST',
@ -523,11 +547,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
) )
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'getKMDAddressesNative+Balance', 'getKMDAddressesNative+Balance',
@ -542,11 +568,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
mode === 'native') { mode === 'native') {
json = json.result; json = json.result;
} }
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
}
calcBalance( calcBalance(
result, result,
json, json,

6
react/src/actions/actions/atomic.js

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

12
react/src/actions/actions/basiliskProcessAddress.js

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

6
react/src/actions/actions/createWallet.js

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

6
react/src/actions/actions/dexCoins.js

@ -17,6 +17,7 @@ export function getDexCoins() {
return dispatch => { return dispatch => {
const _timestamp = Date.now(); const _timestamp = Date.now();
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': 'getDexCoins', 'function': 'getDexCoins',
@ -25,6 +26,7 @@ export function getDexCoins() {
'payload': _payload, 'payload': _payload,
'status': 'pending', 'status': 'pending',
})); }));
}
let _fetchConfig = { let _fetchConfig = {
method: 'POST', method: 'POST',
@ -46,11 +48,13 @@ export function getDexCoins() {
) )
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'Error getDexCoins', 'Error getDexCoins',
@ -61,11 +65,13 @@ export function getDexCoins() {
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
}
dispatch(dashboardCoinsState(json)); dispatch(dashboardCoinsState(json));
}); });
} }

10
react/src/actions/actions/edexBalance.js

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

6
react/src/actions/actions/edexGetTx.js

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

6
react/src/actions/actions/fullTxHistory.js

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

6
react/src/actions/actions/getAddrByAccount.js

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

6
react/src/actions/actions/iguanaHelpers.js

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

6
react/src/actions/actions/logout.js

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

6
react/src/actions/actions/nativeBalance.js

@ -42,6 +42,7 @@ export function getKMDBalanceTotal(coin) {
return dispatch => { return dispatch => {
const _timestamp = Date.now(); const _timestamp = Date.now();
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': 'getKMDBalanceTotal', 'function': 'getKMDBalanceTotal',
@ -50,6 +51,7 @@ export function getKMDBalanceTotal(coin) {
'payload': payload, 'payload': payload,
'status': 'pending', 'status': 'pending',
})); }));
}
let _fetchConfig = { let _fetchConfig = {
method: 'POST', method: 'POST',
@ -72,11 +74,13 @@ export function getKMDBalanceTotal(coin) {
) )
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'getKMDBalanceTotal', 'getKMDBalanceTotal',
@ -87,11 +91,13 @@ export function getKMDBalanceTotal(coin) {
}) })
.then(response => response.json()) .then(response => response.json())
.then(function(json) { // TODO: figure out why komodod spits out "parse error" .then(function(json) { // TODO: figure out why komodod spits out "parse error"
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
}
if (json && if (json &&
!json.error) { !json.error) {
dispatch(getNativeBalancesState(json)); dispatch(getNativeBalancesState(json));

6
react/src/actions/actions/nativeNewAddress.js

@ -49,6 +49,7 @@ export function getNewKMDAddresses(coin, pubpriv) {
return dispatch => { return dispatch => {
const _timestamp = Date.now(); const _timestamp = Date.now();
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': 'getNewKMDAddresses', 'function': 'getNewKMDAddresses',
@ -57,6 +58,7 @@ export function getNewKMDAddresses(coin, pubpriv) {
'payload': payload, 'payload': payload,
'status': 'pending', 'status': 'pending',
})); }));
}
let _fetchConfig = { let _fetchConfig = {
method: 'POST', method: 'POST',
@ -85,11 +87,13 @@ export function getNewKMDAddresses(coin, pubpriv) {
) )
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'getNewKMDAddresses', 'getNewKMDAddresses',
@ -103,11 +107,13 @@ export function getNewKMDAddresses(coin, pubpriv) {
if (Config.cli.default) { if (Config.cli.default) {
json = json.result; json = json.result;
} }
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
}
dispatch( dispatch(
handleGetNewKMDAddresses( handleGetNewKMDAddresses(
pubpriv, pubpriv,

21
react/src/actions/actions/nativeSend.js

@ -16,8 +16,9 @@ export function sendNativeTx(coin, _payload) {
let payload; let payload;
let _apiMethod; let _apiMethod;
if (_payload.addressType === 'public' && // transparent // iguana core
_payload.sendTo.length !== 95) { if ((_payload.addressType === 'public' && // transparent
_payload.sendTo.length !== 95) || !_payload.sendFrom) {
_apiMethod = 'sendtoaddress'; _apiMethod = 'sendtoaddress';
ajaxDataToHex = `["${_payload.sendTo}", ${Number(_payload.amount) - Number(_payload.fee)}]`; ajaxDataToHex = `["${_payload.sendTo}", ${Number(_payload.amount) - Number(_payload.fee)}]`;
} else { // private } else { // private
@ -47,6 +48,7 @@ export function sendNativeTx(coin, _payload) {
} }
const _timestamp = Date.now(); const _timestamp = Date.now();
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': 'sendNativeTx', 'function': 'sendNativeTx',
@ -55,19 +57,20 @@ export function sendNativeTx(coin, _payload) {
'payload': payload, 'payload': payload,
'status': 'pending', 'status': 'pending',
})); }));
}
let _fetchConfig = { let _fetchConfig = {
method: 'POST', method: 'POST',
body: JSON.stringify(payload), body: JSON.stringify(payload),
}; };
if (Config.cli.default) { if (Config.cli.default) { // rpc
payload = { payload = {
mode: null, mode: null,
chain: coin, chain: coin,
cmd: payload.function, cmd: payload.function,
params: params:
_payload.addressType === 'public' && _payload.sendTo.length !== 95 ? (_payload.addressType === 'public' && _payload.sendTo.length !== 95) || !_payload.sendFrom ?
[ [
_payload.sendTo, _payload.sendTo,
_payload.amount _payload.amount
@ -97,11 +100,13 @@ export function sendNativeTx(coin, _payload) {
) )
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'sendNativeTx', 'sendNativeTx',
@ -115,11 +120,13 @@ export function sendNativeTx(coin, _payload) {
return _response; return _response;
}) })
.then(function(json) { .then(function(json) {
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
}
if (json.indexOf('"code":') > -1) { if (json.indexOf('"code":') > -1) {
const _message = json.substring( const _message = json.substring(
@ -208,6 +215,7 @@ export function getKMDOPID(opid, coin) {
} }
const _timestamp = Date.now(); const _timestamp = Date.now();
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': 'getKMDOPID', 'function': 'getKMDOPID',
@ -216,6 +224,7 @@ export function getKMDOPID(opid, coin) {
'payload': payload, 'payload': payload,
'status': 'pending', 'status': 'pending',
})); }));
}
let _fetchConfig = { let _fetchConfig = {
method: 'POST', method: 'POST',
@ -244,11 +253,13 @@ export function getKMDOPID(opid, coin) {
) )
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'getKMDOPID', 'getKMDOPID',
@ -262,11 +273,13 @@ export function getKMDOPID(opid, coin) {
if (Config.cli.default) { if (Config.cli.default) {
json = json.result; json = json.result;
} }
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
}
dispatch(getKMDOPIDState(json)); dispatch(getKMDOPIDState(json));
}) })
}) })

12
react/src/actions/actions/nativeSyncInfo.js

@ -16,6 +16,7 @@ export function getSyncInfoNativeKMD(skipDebug) {
return dispatch => { return dispatch => {
const _timestamp = Date.now(); const _timestamp = Date.now();
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': 'getSyncInfoNativeKMD', 'function': 'getSyncInfoNativeKMD',
@ -24,6 +25,7 @@ export function getSyncInfoNativeKMD(skipDebug) {
'payload': '', 'payload': '',
'status': 'pending', 'status': 'pending',
})); }));
}
return fetch( 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}`, { 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) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'getSyncInfoNativeKMD', 'getSyncInfoNativeKMD',
@ -46,11 +50,13 @@ export function getSyncInfoNativeKMD(skipDebug) {
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': Config.iguanaLessMode ? json.info : json, 'response': Config.iguanaLessMode ? json.info : json,
})); }));
}
dispatch(getSyncInfoNativeState({ 'remoteKMDNode': Config.iguanaLessMode ? json.info : json })); dispatch(getSyncInfoNativeState({ 'remoteKMDNode': Config.iguanaLessMode ? json.info : json }));
}) })
.then(function() { .then(function() {
@ -104,6 +110,7 @@ export function getSyncInfoNative(coin, skipDebug) {
return dispatch => { return dispatch => {
const _timestamp = Date.now(); const _timestamp = Date.now();
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': 'getSyncInfo', 'function': 'getSyncInfo',
@ -112,6 +119,7 @@ export function getSyncInfoNative(coin, skipDebug) {
'payload': payload, 'payload': payload,
'status': 'pending', 'status': 'pending',
})); }));
}
let _fetchConfig = { let _fetchConfig = {
method: 'POST', method: 'POST',
body: JSON.stringify(payload), body: JSON.stringify(payload),
@ -133,11 +141,13 @@ export function getSyncInfoNative(coin, skipDebug) {
) )
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'getSyncInfo', 'getSyncInfo',
@ -172,11 +182,13 @@ export function getSyncInfoNative(coin, skipDebug) {
dispatch(getDebugLog('komodo', 1)); dispatch(getDebugLog('komodo', 1));
} }
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
}
dispatch( dispatch(
getSyncInfoNativeState( getSyncInfoNativeState(
json, json,

6
react/src/actions/actions/nativeTxHistory.js

@ -33,6 +33,7 @@ export function getNativeTxHistory(coin) {
return dispatch => { return dispatch => {
const _timestamp = Date.now(); const _timestamp = Date.now();
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': 'getNativeTxHistory', 'function': 'getNativeTxHistory',
@ -41,6 +42,7 @@ export function getNativeTxHistory(coin) {
'payload': payload, 'payload': payload,
'status': 'pending', 'status': 'pending',
})); }));
}
let _fetchConfig = { let _fetchConfig = {
method: 'POST', method: 'POST',
@ -69,11 +71,13 @@ export function getNativeTxHistory(coin) {
) )
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'getNativeTxHistory', 'getNativeTxHistory',
@ -84,11 +88,13 @@ export function getNativeTxHistory(coin) {
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
}
dispatch(getNativeTxHistoryState(json)); dispatch(getNativeTxHistoryState(json));
}) })
} }

12
react/src/actions/actions/notary.js

@ -23,6 +23,7 @@ function initNotaryNodesConSequence(nodes) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const _timestamp = Date.now(); const _timestamp = Date.now();
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': `initNotaryNodesConSequence+${node}`, 'function': `initNotaryNodesConSequence+${node}`,
@ -31,17 +32,20 @@ function initNotaryNodesConSequence(nodes) {
'payload': payload, 'payload': payload,
'status': 'pending', '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}`, { 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', method: 'GET',
}) })
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
`getInfoDexNode+${node}`, `getInfoDexNode+${node}`,
@ -52,11 +56,13 @@ function initNotaryNodesConSequence(nodes) {
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
}
dispatch( dispatch(
updateNotaryNodeConState( updateNotaryNodeConState(
json, json,
@ -171,6 +177,7 @@ export function getDexNotaries(coin) {
return dispatch => { return dispatch => {
const _timestamp = Date.now(); const _timestamp = Date.now();
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'function': 'getDexNotaries', 'function': 'getDexNotaries',
@ -179,17 +186,20 @@ export function getDexNotaries(coin) {
'payload': payload, 'payload': payload,
'status': 'pending', 'status': 'pending',
})); }));
}
return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, { return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, {
method: 'POST', method: 'POST',
body: JSON.stringify(payload), body: JSON.stringify(payload),
}) })
.catch(function(error) { .catch(function(error) {
console.log(error); console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'error', 'status': 'error',
'response': error, 'response': error,
})); }));
}
dispatch( dispatch(
triggerToaster( triggerToaster(
'getDexNotaries', 'getDexNotaries',
@ -200,11 +210,13 @@ export function getDexNotaries(coin) {
}) })
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
if (Config.debug) {
dispatch(logGuiHttp({ dispatch(logGuiHttp({
'timestamp': _timestamp, 'timestamp': _timestamp,
'status': 'success', 'status': 'success',
'response': json, 'response': json,
})); }));
}
dispatch(getDexNotariesState(json)); dispatch(getDexNotariesState(json));
}) })
} }

24
react/src/actions/actions/sendFullBasilisk.js

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

18
react/src/actions/actions/settings.js

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

6
react/src/actions/actions/syncInfo.js

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

24
react/src/actions/actions/walletAuth.js

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

10
react/src/components/dashboard/coinTile/coinTileItem.js

@ -107,6 +107,11 @@ class CoinTileItem extends React.Component {
dashboardChangeActiveCoin(coin, mode) { dashboardChangeActiveCoin(coin, mode) {
if (coin !== this.props.ActiveCoin.coin) { if (coin !== this.props.ActiveCoin.coin) {
Store.dispatch(dashboardChangeActiveCoin(coin, mode));
setTimeout(() => {
this.dispatchCoinActions(coin, mode);
}, 100);
Store.dispatch( Store.dispatch(
stopInterval( stopInterval(
'sync', 'sync',
@ -121,10 +126,6 @@ class CoinTileItem extends React.Component {
) )
); );
Store.dispatch(dashboardChangeActiveCoin(coin, mode));
this.dispatchCoinActions(coin, mode);
if (mode === 'full') { if (mode === 'full') {
const _iguanaActiveHandle = setInterval(() => { const _iguanaActiveHandle = setInterval(() => {
this.dispatchCoinActions(coin, mode); this.dispatchCoinActions(coin, mode);
@ -147,6 +148,7 @@ class CoinTileItem extends React.Component {
if (mode === 'basilisk') { if (mode === 'basilisk') {
const _activeHandle = this.props.Dashboard.activeHandle; const _activeHandle = this.props.Dashboard.activeHandle;
const _basiliskMainAddress = _activeHandle[coin] || JSON.parse(sessionStorage.getItem('IguanaActiveAccount'))[coin]; const _basiliskMainAddress = _activeHandle[coin] || JSON.parse(sessionStorage.getItem('IguanaActiveAccount'))[coin];
Store.dispatch(changeActiveAddress(_basiliskMainAddress)); Store.dispatch(changeActiveAddress(_basiliskMainAddress));
if (_basiliskMainAddress) { if (_basiliskMainAddress) {

20
react/src/components/dashboard/main/dashboard.render.js

@ -36,21 +36,21 @@ const DashboardRender = function() {
<WalletsTxInfo {...this.props} /> <WalletsTxInfo {...this.props} />
<WalletsNative {...this.props} /> <WalletsNative {...this.props} />
</div> </div>
<div className={ this.isSectionActive('edex') ? 'show' : 'hide' }> { this.isSectionActive('edex') &&
<EDEX {...this.props} /> <EDEX {...this.props} />
</div> }
<div className={ this.isSectionActive('atomic') ? 'show full-height' : 'hide' }> { this.isSectionActive('atomic') &&
<Atomic {...this.props} /> <Atomic {...this.props} />
</div> }
<div className={ this.isSectionActive('jumblr') ? 'show' : 'hide' }> { this.isSectionActive('jumblr') &&
<Jumblr {...this.props} /> <Jumblr {...this.props} />
</div> }
<div className={ this.isSectionActive('settings') ? 'show' : 'hide' }> { this.isSectionActive('settings') &&
<Settings {...this.props} /> <Settings {...this.props} />
</div> }
<div className={ this.isSectionActive('about') ? 'show' : 'hide' }> { this.isSectionActive('about') &&
<About {...this.props} /> <About {...this.props} />
</div> }
</div> </div>
</div> </div>
); );

16
react/src/components/dashboard/qrModal/qrModal.js

@ -19,23 +19,29 @@ class QRModal extends React.Component {
this.closeModal = this.closeModal.bind(this); this.closeModal = this.closeModal.bind(this);
this.handleScan = this.handleScan.bind(this); this.handleScan = this.handleScan.bind(this);
this.handleError = this.handleError.bind(this); this.handleError = this.handleError.bind(this);
document.body.addEventListener('click', this.closeModal);
} }
handleScan(data) { handleScan(data) {
if (data !== null) { if (data !== null) {
if (this.props.mode === 'scan') { if (this.props.mode === 'scan') {
this.props.setRecieverFromScan(data) this.props.setRecieverFromScan(data);
} }
this.closeModal(); this.closeModal();
} }
} }
handleError(err) { handleError(err) {
if (err.name === 'NoVideoInputDevicesError') {
this.setState({
error: 'Error: No video input devices found!',
});
} else {
this.setState({ this.setState({
error: err, error: 'Error: unknown error!',
}); });
} }
}
openModal() { openModal() {
this.setState({ this.setState({
@ -60,10 +66,6 @@ class QRModal extends React.Component {
this.setState({ this.setState({
modalIsOpen: false, modalIsOpen: false,
}); });
if (this.props.mode === 'scan') {
ReactDOM.unmountComponentAtNode(document.getElementById('webcam'));
}
} }
render() { render() {

8
react/src/components/dashboard/qrModal/qrModal.render.js

@ -66,7 +66,13 @@ export const QRModalReaderRender = function () {
</div> </div>
<div className="modal-body"> <div className="modal-body">
<div className="animsition vertical-align fade-in"> <div className="animsition vertical-align fade-in">
<div className="page-content vertical-align-middle"> <div
className="page-content vertical-align-middle"
style={{
width: '100%',
textAlign: 'center',
fontSize: '16px'
}}>
<div id="webcam"> <div id="webcam">
{ this.state.error } { this.state.error }
</div> </div>

14
react/src/components/dashboard/receiveCoin/receiveCoin.js

@ -167,15 +167,17 @@ class ReceiveCoin extends React.Component {
if (this.isBasiliskMode() && if (this.isBasiliskMode() &&
this.hasNoAmount(address)) { this.hasNoAmount(address)) {
address.amount = _cache && _cache[_coin][address.address] address.amount = _cache && _cache[_coin][address.address] &&
&& _cache[_coin][address.address].getbalance.data _cache[_coin][address.address].getbalance &&
&& _cache[_coin][address.address].getbalance.data.balance ? _cache[_coin][address.address].getbalance.data.balance : 'N/A'; _cache[_coin][address.address].getbalance.data &&
_cache[_coin][address.address].getbalance.data.balance ? _cache[_coin][address.address].getbalance.data.balance : 'N/A';
} }
if (this.isBasiliskMode() && if (this.isBasiliskMode() &&
this.hasNoInterest(address)) { this.hasNoInterest(address)) {
address.interest = _cache && _cache[_coin][address.address] address.interest = _cache && _cache[_coin][address.address] &&
&& _cache[_coin][address.address].getbalance.data _cache[_coin][address.address].getbalance &&
&& _cache[_coin][address.address].getbalance.data.interest ? _cache[_coin][address.address].getbalance.data.interest : 'N/A'; _cache[_coin][address.address].getbalance.data &&
_cache[_coin][address.address].getbalance.data.interest ? _cache[_coin][address.address].getbalance.data.interest : 'N/A';
} }
if (this.state.hideZeroAddresses) { if (this.state.hideZeroAddresses) {

8
react/src/components/dashboard/receiveCoin/receiveCoin.render.js

@ -26,9 +26,7 @@ export const AddressActionsBasiliskModeRender = function(address) {
onClick={ () => this._validateAddressBasilisk(address) }> onClick={ () => this._validateAddressBasilisk(address) }>
<i className="icon fa-info-circle"></i> <i className="icon fa-info-circle"></i>
</span> </span>
<QRModal <QRModal content={ address } />
content={address}
/>
</td> </td>
); );
}; };
@ -45,9 +43,7 @@ export const AddressActionsNonBasiliskModeRender = function(address, type) {
onClick={ () => this._copyCoinAddress(address) }> onClick={ () => this._copyCoinAddress(address) }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') } <i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button> </button>
<QRModal <QRModal content={ address } />
content={address}
/>
</td> </td>
); );
}; };

36
react/src/components/dashboard/sendCoin/sendCoin.js

@ -1,9 +1,7 @@
import React from 'react'; import React from 'react';
import Config from '../../../config'; import Config from '../../../config';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { import { checkTimestamp } from '../../../util/time';
checkTimestamp
} from '../../../util/time';
import { import {
edexGetTxIDList, edexGetTxIDList,
edexRemoveTXID edexRemoveTXID
@ -55,7 +53,6 @@ class SendCoin extends React.Component {
currentStackLength: 0, currentStackLength: 0,
totalStackLength: 0, totalStackLength: 0,
utxoMethodInProgress: false, utxoMethodInProgress: false,
isCameraFeatureDetected: false,
}; };
this.updateInput = this.updateInput.bind(this); this.updateInput = this.updateInput.bind(this);
this.handleBasiliskSend = this.handleBasiliskSend.bind(this); this.handleBasiliskSend = this.handleBasiliskSend.bind(this);
@ -66,27 +63,9 @@ class SendCoin extends React.Component {
this._fetchNewUTXOData = this._fetchNewUTXOData.bind(this); this._fetchNewUTXOData = this._fetchNewUTXOData.bind(this);
this.handleClickOutside = this.handleClickOutside.bind(this); this.handleClickOutside = this.handleClickOutside.bind(this);
this.setRecieverFromScan = this.setRecieverFromScan.bind(this); this.setRecieverFromScan = this.setRecieverFromScan.bind(this);
this.detectCamera = this.detectCamera.bind(this);
socket.on('messages', msg => this.updateSocketsData(msg)); socket.on('messages', msg => this.updateSocketsData(msg));
} }
// test device camera capabilities
detectCamera() {
const _getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
_getUserMedia(
{ 'video': true },
function() {
this.setState({
isCameraFeatureDetected: true,
});
},
function() {
console.warn('this device doesn\'t have camera!');
}
);
}
setRecieverFromScan(receiver) { setRecieverFromScan(receiver) {
this.setState({ this.setState({
sendTo: receiver sendTo: receiver
@ -101,8 +80,6 @@ class SendCoin extends React.Component {
this.handleClickOutside, this.handleClickOutside,
false false
); );
this.detectCamera();
} }
componentWillUnmount() { componentWillUnmount() {
@ -323,7 +300,7 @@ class SendCoin extends React.Component {
); );
} else { } else {
return ( return (
<span>- { translate('SEND.SELECT_T_OR_Z_ADDR') } -</span> <span>{ translate('SEND.SELECT_T_OR_Z_ADDR') }</span>
); );
} }
} }
@ -347,7 +324,7 @@ class SendCoin extends React.Component {
<ul className="dropdown-menu inner"> <ul className="dropdown-menu inner">
<li className="selected"> <li className="selected">
<a> <a>
<span className="text"> - { translate('SEND.SELECT_T_OR_Z_ADDR') } - </span> <span className="text">{ translate('SEND.SELECT_T_OR_Z_ADDR') }</span>
<span className="glyphicon glyphicon-ok check-mark"></span> <span className="glyphicon glyphicon-ok check-mark"></span>
</a> </a>
</li> </li>
@ -395,7 +372,7 @@ class SendCoin extends React.Component {
amount: 0, amount: 0,
fee: 0.0001, fee: 0.0001,
sendSig: false, sendSig: false,
sendApiType: false, sendApiType: true,
addressSelectorOpen: false, addressSelectorOpen: false,
currentStackLength: 0, currentStackLength: 0,
totalStackLength: 0, totalStackLength: 0,
@ -697,6 +674,8 @@ class SendCoin extends React.Component {
); );
} }
} else if (key === 'sendrawtransaction') { } else if (key === 'sendrawtransaction') {
const _lastSendToResponse = this.props.ActiveCoin.lastSendToResponse;
if (_lastSendToResponse[key] === 'success') { if (_lastSendToResponse[key] === 'success') {
return ( return (
<span className="label label-success">true</span> <span className="label label-success">true</span>
@ -707,6 +686,8 @@ class SendCoin extends React.Component {
); );
} }
} else if (key === 'txid' || key === 'sent') { } else if (key === 'txid' || key === 'sent') {
const _lastSendToResponse = this.props.ActiveCoin.lastSendToResponse;
return ( return (
<span>{ _lastSendToResponse[key] }</span> <span>{ _lastSendToResponse[key] }</span>
); );
@ -775,6 +756,7 @@ class SendCoin extends React.Component {
return null; return null;
} }
render() { render() {
if (this.props.ActiveCoin && if (this.props.ActiveCoin &&
this.props.ActiveCoin.send && this.props.ActiveCoin.send &&

24
react/src/components/dashboard/sendCoin/sendCoin.render.js

@ -8,6 +8,8 @@ import {
import QRModal from '../qrModal/qrModal'; import QRModal from '../qrModal/qrModal';
export const UTXOCacheInfoRender = function(refreshCacheData, isReadyToUpdate, waitUntilCallIsFinished, timestamp) { export const UTXOCacheInfoRender = function(refreshCacheData, isReadyToUpdate, waitUntilCallIsFinished, timestamp) {
const _progress = 100 - this.state.currentStackLength * 100 / this.state.totalStackLength;
return ( return (
<div className="col-lg-12"> <div className="col-lg-12">
<hr /> <hr />
@ -25,7 +27,7 @@ export const UTXOCacheInfoRender = function(refreshCacheData, isReadyToUpdate, w
<div className={ 'full-width margin-bottom-10 margin-top-10 ' + (this.state.currentStackLength === 1 || (this.state.currentStackLength === 0 && this.state.totalStackLength === 0) ? 'hide' : 'progress progress-sm') }> <div className={ 'full-width margin-bottom-10 margin-top-10 ' + (this.state.currentStackLength === 1 || (this.state.currentStackLength === 0 && this.state.totalStackLength === 0) ? 'hide' : 'progress progress-sm') }>
<div <div
className="progress-bar progress-bar-striped active progress-bar-indicating progress-bar-success font-size-80-percent" className="progress-bar progress-bar-striped active progress-bar-indicating progress-bar-success font-size-80-percent"
style={{ width: 100 - `${(this.state.currentStackLength * 100 / this.state.totalStackLength)}%` }}> style={{ width: `${_progress}%` }}>
{ translate('SEND.PROCESSING_REQ') }: { this.state.currentStackLength } / { this.state.totalStackLength } { translate('SEND.PROCESSING_REQ') }: { this.state.currentStackLength } / { this.state.totalStackLength }
</div> </div>
</div> </div>
@ -59,6 +61,8 @@ export const SendCoinResponseRender = function () {
return items; return items;
} else { } else {
return ( return (
<tr className="hover--none">
<td colSpan="2">
<div className="padding-20 text-align-center"> <div className="padding-20 text-align-center">
<div className="vertical-padding-10 horizontal-padding-0"> <div className="vertical-padding-10 horizontal-padding-0">
{ translate('SEND.PROCESSING_TRANSACTION') }...<br /> { translate('SEND.PROCESSING_TRANSACTION') }...<br />
@ -103,6 +107,8 @@ export const SendCoinResponseRender = function () {
</div> </div>
</div> </div>
</div> </div>
</td>
</tr>
); );
} }
} }
@ -144,7 +150,8 @@ export const SendApiTypeSelectorRender = function () {
<label className="switch"> <label className="switch">
<input <input
type="checkbox" type="checkbox"
checked={ this.state.sendApiType } /> checked={ this.state.sendApiType }
readOnly />
<div <div
className="slider" className="slider"
onClick={ this.toggleSendAPIType }></div> onClick={ this.toggleSendAPIType }></div>
@ -156,13 +163,11 @@ export const SendApiTypeSelectorRender = function () {
</div> </div>
</span> </span>
</div> </div>
{ this.stateisCameraFeatureDetected &&
<div className="col-lg-4 text-right"> <div className="col-lg-4 text-right">
<QRModal <QRModal
mode="scan" mode="scan"
setRecieverFromScan={ this.setRecieverFromScan } /> setRecieverFromScan={ this.setRecieverFromScan } />
</div> </div>
}
</div> </div>
); );
}; };
@ -247,9 +252,8 @@ export const SendCoinRender = function () {
className="form-control" className="form-control"
id="edexcoinAmount" id="edexcoinAmount"
name="amount" name="amount"
placeholder="0.000" placeholder="0.001"
autoComplete="off" autoComplete="off"
defaultValue={ this.state.amount }
value={ this.state.amount } value={ this.state.amount }
onChange={ this.updateInput } /> onChange={ this.updateInput } />
</div> </div>
@ -264,16 +268,15 @@ export const SendCoinRender = function () {
className="form-control" className="form-control"
id="edexcoinFee" id="edexcoinFee"
name="fee" name="fee"
defaultValue={ this.state.fee }
value={ this.state.fee } value={ this.state.fee }
placeholder="0.000" placeholder="0.001"
autoComplete="off" autoComplete="off"
onChange={ this.updateInput } /> onChange={ this.updateInput } />
</div> </div>
<div className="col-lg-12"> <div className="col-lg-12">
<strong> <strong>
{ translate('INDEX.TOTAL') }&nbsp; { translate('INDEX.TOTAL') }&nbsp;
({ translate('INDEX.AMOUNT_SM') } - txfee): ({ translate('INDEX.AMOUNT_SM') } - fee):
</strong>&nbsp; </strong>&nbsp;
{ Number(this.state.amount) - Number(this.state.fee) } { this.props.ActiveCoin.coin } { Number(this.state.amount) - Number(this.state.fee) } { this.props.ActiveCoin.coin }
</div> </div>
@ -282,7 +285,8 @@ export const SendCoinRender = function () {
<label className="switch"> <label className="switch">
<input <input
type="checkbox" type="checkbox"
checked={ this.state.sendSig } /> checked={ this.state.sendSig }
readOnly />
<div <div
className="slider" className="slider"
onClick={ this.toggleSendSig }></div> onClick={ this.toggleSendSig }></div>

29
react/src/components/dashboard/settings/settings.js

@ -79,9 +79,21 @@ class Settings extends React.Component {
this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this); this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this);
this._checkForUpdateUIPromise = this._checkForUpdateUIPromise.bind(this); this._checkForUpdateUIPromise = this._checkForUpdateUIPromise.bind(this);
this._updateUIPromise = this._updateUIPromise.bind(this); this._updateUIPromise = this._updateUIPromise.bind(this);
}
componentWillMount() {
socket.on('patch', msg => this.updateSocketsData(msg)); socket.on('patch', msg => this.updateSocketsData(msg));
} }
componentWillUnmount() {
socket.removeAllListeners('patch', msg => this.updateSocketsData(msg));
if (!this.state.disableWalletSpecificUI) {
document.documentElement.style.height = '100%';
document.body.style.height = '100%';
}
}
componentDidMount() { componentDidMount() {
if (!this.props.disableWalletSpecificUI) { if (!this.props.disableWalletSpecificUI) {
Store.dispatch(iguanaActiveHandle()); Store.dispatch(iguanaActiveHandle());
@ -207,10 +219,11 @@ class Settings extends React.Component {
for (let i = 0; i < this.state.updateLog.length; i++) { for (let i = 0; i < this.state.updateLog.length; i++) {
items.push( items.push(
<div>{ this.state.updateLog[i] }</div> <div key={ `settings-update-log-${i}` }>{ this.state.updateLog[i] }</div>
); );
} }
if (this.state.updateLog.length) {
return ( return (
<div style={{ minHeight: '200px' }}> <div style={{ minHeight: '200px' }}>
<hr /> <hr />
@ -224,6 +237,9 @@ class Settings extends React.Component {
</div> </div>
</div> </div>
); );
} else {
return null;
}
} }
toggleSeedInputVisibility() { toggleSeedInputVisibility() {
@ -251,6 +267,17 @@ class Settings extends React.Component {
activeTabHeight: _height, activeTabHeight: _height,
tabElId: elemId, tabElId: elemId,
})); }));
// body size hack
if (!this.state.disableWalletSpecificUI) {
document.documentElement.style.height = '100%';
document.body.style.height = '100%';
setTimeout(() => {
document.documentElement.style.height = _height <= 200 ? '100%' : 'inherit';
document.body.style.height = _height <= 200 ? '100%' : 'inherit';
}, 100);
}
}, 100); }, 100);
} }

12
react/src/components/dashboard/settings/settings.render.js

@ -24,7 +24,7 @@ export const AppUpdateTabRender = function() {
<div className="padding-top-15"> <div className="padding-top-15">
<button <button
type="button" type="button"
className="btn btn-primary waves-effect waves-light" className="btn btn-info waves-effect waves-light"
onClick={ this._checkForUpdateUIPromise }>{ translate('INDEX.CHECK_FOR_UPDATE') }</button> onClick={ this._checkForUpdateUIPromise }>{ translate('INDEX.CHECK_FOR_UPDATE') }</button>
<button <button
type="button" type="button"
@ -38,7 +38,7 @@ export const AppUpdateTabRender = function() {
<div className="padding-top-15"> <div className="padding-top-15">
<button <button
type="button" type="button"
className="btn btn-primary waves-effect waves-light" className="btn btn-info waves-effect waves-light"
onClick={ this._checkForUpdateUIPromise }>{ translate('INDEX.CHECK_FOR_UPDATE') }</button> onClick={ this._checkForUpdateUIPromise }>{ translate('INDEX.CHECK_FOR_UPDATE') }</button>
<button <button
type="button" type="button"
@ -77,7 +77,7 @@ export const AppInfoTabRender = function() {
{ translate('SETTINGS.NAME') }: { this.props.Settings.appInfo.releaseInfo.name } { translate('SETTINGS.NAME') }: { this.props.Settings.appInfo.releaseInfo.name }
</div> </div>
<div> <div>
{ translate('SETTINGS.VERSION') }: { this.props.Settings.appInfo.releaseInfo.version } { translate('SETTINGS.VERSION') }: { `${this.props.Settings.appInfo.releaseInfo.version.replace('version=', '')}-beta` }
</div> </div>
<div> <div>
{ translate('SETTINGS.APP_SESSION') }: { this.props.Settings.appInfo.appSession } { translate('SETTINGS.APP_SESSION') }: { this.props.Settings.appInfo.appSession }
@ -144,9 +144,9 @@ export const AppInfoTabRender = function() {
export const SettingsRender = function() { export const SettingsRender = function() {
return ( return (
<div className="margin-left-0"> <div className="margin-left-0 full-height">
<div <div
className="page-content" className="page-content full-height"
id="section-iguana-wallet-settings"> id="section-iguana-wallet-settings">
<div className="row"> <div className="row">
<div className="col-xlg-12 col-md-12"> <div className="col-xlg-12 col-md-12">
@ -593,7 +593,7 @@ export const SettingsRender = function() {
<textarea <textarea
type="text" type="text"
className="form-control" className="form-control"
name="cliCmd" name="cliCmdString"
id="cliCmd" id="cliCmd"
value={ this.state.cliCmdString } value={ this.state.cliCmdString }
onChange={ this.updateInput }></textarea> onChange={ this.updateInput }></textarea>

31
react/src/components/dashboard/walletsBalance/walletsBalance.js

@ -70,14 +70,13 @@ class WalletsBalance extends React.Component {
if (_mode === 'full') { if (_mode === 'full') {
_balance = this.props.ActiveCoin.balance || 0; _balance = this.props.ActiveCoin.balance || 0;
} else { } else if (_mode === 'basilisk') {
if (this.props.ActiveCoin.cache) { if (this.props.ActiveCoin.cache) {
const _cache = this.props.ActiveCoin.cache; const _cache = this.props.ActiveCoin.cache;
const _coin = this.props.ActiveCoin.coin; const _coin = this.props.ActiveCoin.coin;
const _address = this.props.ActiveCoin.activeAddress; const _address = this.props.ActiveCoin.activeAddress;
if (type === 'main' && if (type === 'transparent' &&
_mode === 'basilisk' &&
_address && _address &&
_cache[_coin] && _cache[_coin] &&
_cache[_coin][_address] && _cache[_coin][_address] &&
@ -88,7 +87,6 @@ class WalletsBalance extends React.Component {
} }
if (type === 'interest' && if (type === 'interest' &&
_mode === 'basilisk' &&
_address && _address &&
_cache[_coin] && _cache[_coin] &&
_cache[_coin][_address] && _cache[_coin][_address] &&
@ -99,7 +97,6 @@ class WalletsBalance extends React.Component {
} }
if (type === 'total' && if (type === 'total' &&
_mode === 'basilisk' &&
_address && _address &&
_cache[_coin] && _cache[_coin] &&
_cache[_coin][_address] && _cache[_coin][_address] &&
@ -113,6 +110,30 @@ class WalletsBalance extends React.Component {
_balance = _regBalance + _regInterest; _balance = _regBalance + _regInterest;
} }
} }
} else if (_mode === 'native') {
if (type === 'total' &&
this.props.ActiveCoin.balance &&
this.props.ActiveCoin.balance.total) {
_balance = this.props.ActiveCoin.balance.total;
}
if (type === 'interest' &&
this.props.Dashboard.progress &&
this.props.Dashboard.progress.interest) {
_balance = this.props.Dashboard.progress.interest;
}
if (type === 'private' &&
this.props.ActiveCoin.balance &&
this.props.ActiveCoin.balance.private) {
_balance = this.props.ActiveCoin.balance.private;
}
if (type === 'transparent' &&
this.props.ActiveCoin.balance &&
this.props.ActiveCoin.balance.transparent) {
_balance = this.props.ActiveCoin.balance.transparent;
}
} }
return _balance; return _balance;

39
react/src/components/dashboard/walletsBalance/walletsBalance.render.js

@ -5,8 +5,8 @@ import Config from '../../../config';
const WalletsBalanceRender = function() { const WalletsBalanceRender = function() {
return ( return (
<div id="wallet-widgets"> <div id="wallet-widgets" className="wallet-widgets">
<div className="col-xs-12"> <div className="col-xs-12 flex">
<div className={ this.isFullMode() && !this.isFullySynced() ? 'col-xs-12' : 'col-xs-12 hide' }> <div className={ this.isFullMode() && !this.isFullySynced() ? 'col-xs-12' : 'col-xs-12 hide' }>
<div className="alert alert-info alert-dismissible"> <div className="alert alert-info alert-dismissible">
<h4>{ translate('INDEX.ACTIVATING_WALLET_RT') }</h4> <h4>{ translate('INDEX.ACTIVATING_WALLET_RT') }</h4>
@ -37,14 +37,8 @@ const WalletsBalanceRender = function() {
</div> </div>
<span <span
className="pull-right padding-top-10 font-size-22" className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? this.renderBalance('main') : null }> title={ this.renderBalance('transparent') }>
{ this.isNativeMode() ? { Config.roundValues ? formatValue('round', this.renderBalance('transparent'), -6) : this.renderBalance('transparent') }
this.props.ActiveCoin.balance.transparent ? this.props.ActiveCoin.balance.transparent : '-'
:
<span>
{ Config.roundValues ? formatValue('round', this.renderBalance('main'), -6) : this.renderBalance('main') } { this.props.ActiveCoin.coin }
</span>
}
</span> </span>
</div> </div>
</div> </div>
@ -63,8 +57,8 @@ const WalletsBalanceRender = function() {
</div> </div>
<span <span
className="pull-right padding-top-10 font-size-22" className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? this.props.ActiveCoin.balance.private : null }> title={ this.renderBalance('private') }>
{ this.props.ActiveCoin.balance.private ? (Config.roundValues ? formatValue('round', this.props.ActiveCoin.balance.private, -6) : this.props.ActiveCoin.balance.private) : '-' } { Config.roundValues ? formatValue('round', this.renderBalance('private'), -6) : this.renderBalance('private') }
</span> </span>
</div> </div>
</div> </div>
@ -84,15 +78,8 @@ const WalletsBalanceRender = function() {
</div> </div>
<span <span
className="pull-right padding-top-10 font-size-22" className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? this.renderBalance('interest') : null }> title={ this.renderBalance('interest') }>
{ this.isNativeMode() ? { Config.roundValues ? formatValue('round', this.renderBalance('interest'), -6) : this.renderBalance('interest') }
this.props.Dashboard.progress
&& this.props.Dashboard.progress.interest ? this.props.Dashboard.progress.interest : '-'
:
<span>
{ Config.roundValues ? formatValue('round', this.renderBalance('interest'), -6) : this.renderBalance('interest') } { this.props.ActiveCoin.coin }
</span>
}
</span> </span>
</div> </div>
</div> </div>
@ -112,14 +99,8 @@ const WalletsBalanceRender = function() {
</div> </div>
<span <span
className="pull-right padding-top-10 font-size-22" className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? this.renderBalance('total') : null }> title={ this.renderBalance('total') }>
{ this.isNativeMode() ? { Config.roundValues ? formatValue('round', this.renderBalance('total'), -6) : this.renderBalance('total') }
this.props.ActiveCoin.balance.total ? this.props.ActiveCoin.balance.total : '-'
:
<span>
{ Config.roundValues ? formatValue('round', this.renderBalance('total'), -6) : this.renderBalance('total') } { this.props.ActiveCoin.coin }
</span>
}
</span> </span>
</div> </div>
</div> </div>

70
react/src/components/dashboard/walletsData/walletsData.js

@ -56,6 +56,8 @@ class WalletsData extends React.Component {
pageSize: 20, pageSize: 20,
showPagination: false, showPagination: false,
searchTerm: null searchTerm: null
coin: null,
txhistory: null,
}; };
this.toggleBasiliskActionsMenu = this.toggleBasiliskActionsMenu.bind(this); this.toggleBasiliskActionsMenu = this.toggleBasiliskActionsMenu.bind(this);
@ -71,7 +73,6 @@ class WalletsData extends React.Component {
this.basiliskRefreshActionOne = this.basiliskRefreshActionOne.bind(this); this.basiliskRefreshActionOne = this.basiliskRefreshActionOne.bind(this);
this.handleClickOutside = this.handleClickOutside.bind(this); this.handleClickOutside = this.handleClickOutside.bind(this);
this.refreshTxHistory = this.refreshTxHistory.bind(this); this.refreshTxHistory = this.refreshTxHistory.bind(this);
socket.on('messages', msg => this.updateSocketsData(msg));
} }
componentWillMount() { componentWillMount() {
@ -80,6 +81,14 @@ class WalletsData extends React.Component {
this.handleClickOutside, this.handleClickOutside,
false false
); );
setTimeout(() => {
if (this.props.ActiveCoin.mode === 'basilisk' || (Object.keys(this.props.Main.coins.basilisk).length && (Object.keys(this.props.Main.coins.native).length || Object.keys(this.props.Main.coins.full).length)) || Object.keys(this.props.Main.coins.basilisk).length) {
socket.on('messages', msg => this.updateSocketsData(msg));
} else {
socket.removeAllListeners('messages');
}
}, 100);
} }
componentWillUnmount() { componentWillUnmount() {
@ -88,7 +97,8 @@ class WalletsData extends React.Component {
this.handleClickOutside, this.handleClickOutside,
false false
); );
socket.off('messages');
socket.removeAllListeners('messages');
} }
generateItemsListColumns() { generateItemsListColumns() {
@ -195,21 +205,24 @@ class WalletsData extends React.Component {
} }
updateSocketsData(data) { updateSocketsData(data) {
let stateObj = {};
if (this.props.ActiveCoin.mode === 'basilisk') {
if (data && if (data &&
data.message && data.message &&
data.message.shepherd.iguanaAPI && data.message.shepherd.iguanaAPI &&
data.message.shepherd.iguanaAPI.totalStackLength) { data.message.shepherd.iguanaAPI.totalStackLength) {
this.setState(Object.assign({}, this.state, { stateObj = Object.assign(stateObj, {
totalStackLength: data.message.shepherd.iguanaAPI.totalStackLength, totalStackLength: data.message.shepherd.iguanaAPI.totalStackLength,
})); });
} }
if (data && if (data &&
data.message && data.message &&
data.message.shepherd.iguanaAPI && data.message.shepherd.iguanaAPI &&
data.message.shepherd.iguanaAPI.currentStackLength) { data.message.shepherd.iguanaAPI.currentStackLength) {
this.setState(Object.assign({}, this.state, { stateObj = Object.assign(stateObj, {
currentStackLength: data.message.shepherd.iguanaAPI.currentStackLength, currentStackLength: data.message.shepherd.iguanaAPI.currentStackLength,
})); });
} }
if (data && if (data &&
data.message && data.message &&
@ -218,6 +231,11 @@ class WalletsData extends React.Component {
data.message.shepherd.status === 'done') { data.message.shepherd.status === 'done') {
Store.dispatch(basiliskRefresh(false)); Store.dispatch(basiliskRefresh(false));
} }
if (Object.keys(stateObj).length) {
this.setState(Object.assign({}, this.state, stateObj));
}
}
} }
refreshTxHistory() { refreshTxHistory() {
@ -305,6 +323,16 @@ class WalletsData extends React.Component {
Store.dispatch(toggleDashboardTxInfoModal(display, txIndex)); Store.dispatch(toggleDashboardTxInfoModal(display, txIndex));
} }
indexTxHistory(txhistoryArr) {
if (txhistoryArr.length > 1) {
for (let i = 0; i < txhistoryArr.length; i++) {
this.props.ActiveCoin.txhistory[i]['index'] = i + 1;
}
}
return this.props.ActiveCoin.txhistory;
}
componentWillReceiveProps(props) { componentWillReceiveProps(props) {
if (!this.state.currentAddress && if (!this.state.currentAddress &&
this.props.ActiveCoin.activeAddress) { this.props.ActiveCoin.activeAddress) {
@ -362,15 +390,15 @@ class WalletsData extends React.Component {
if (this.state.itemsList === 'loading') { if (this.state.itemsList === 'loading') {
if (!this.isNativeMode() || this.isFullySynced()) { if (!this.isNativeMode() || this.isFullySynced()) {
return ( return (
<tr> <tr className="hover--none">
<td colSpan="6">{ translate('INDEX.LOADING_HISTORY') }...</td> <td colSpan="7">{ translate('INDEX.LOADING_HISTORY') }...</td>
</tr> </tr>
); );
} }
} else if (this.state.itemsList === 'no data' || this.state.itemsList.length == 0) { } else if (this.state.itemsList === 'no data' || this.state.itemsList.length == 0) {
return ( return (
<tr> <tr className="hover--none">
<td colSpan="6">{ translate('INDEX.NO_DATA') }</td> <td colSpan="7">{ translate('INDEX.NO_DATA') }</td>
</tr> </tr>
); );
} else if (this.state.itemsList) { } else if (this.state.itemsList) {
@ -437,10 +465,12 @@ class WalletsData extends React.Component {
let _amount = address.amount; let _amount = address.amount;
if (this.props.ActiveCoin.mode === 'basilisk') { if (this.props.ActiveCoin.mode === 'basilisk') {
_amount = _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A'; _amount = _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A';
} }
if (_amount !== 'N/A') {
_amount = formatValue('round', _amount, -6); _amount = formatValue('round', _amount, -6);
}
items.push( items.push(
AddressItemRender.call(this, address, type, _amount, _coin) AddressItemRender.call(this, address, type, _amount, _coin)
@ -472,12 +502,20 @@ class WalletsData extends React.Component {
if (_addresses.public[i].address === this.state.currentAddress) { if (_addresses.public[i].address === this.state.currentAddress) {
if (_addresses.public[i].amount && if (_addresses.public[i].amount &&
_addresses.public[i].amount !== 'N/A') { _addresses.public[i].amount !== 'N/A') {
return _addresses.public[i].amount; let _amount = _addresses.public[i].amount;
if (_amount !== 'N/A') {
_amount = formatValue('round', _amount, -6);
}
return _amount;
} else { } else {
const address = _addresses.public[i].address; const address = _addresses.public[i].address;
let _amount = _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A'; let _amount = _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A';
if (_amount !== 'N/A') {
_amount = formatValue('round', _amount, -6); _amount = formatValue('round', _amount, -6);
}
return _amount; return _amount;
} }
@ -567,8 +605,14 @@ class WalletsData extends React.Component {
if (this.props && if (this.props &&
this.props.ActiveCoin && this.props.ActiveCoin &&
this.props.ActiveCoin.coin && this.props.ActiveCoin.coin &&
(
this.props.ActiveCoin.mode !== 'native' &&
!this.props.ActiveCoin.send && !this.props.ActiveCoin.send &&
!this.props.ActiveCoin.receive) { !this.props.ActiveCoin.receive
) || (
this.props.ActiveCoin.mode === 'native' &&
this.props.ActiveCoin.nativeActiveSection === 'default'
)) {
return WalletsDataRender.call(this); return WalletsDataRender.call(this);
} else { } else {
return null; return null;

12
react/src/components/dashboard/walletsData/walletsData.render.js

@ -66,7 +66,7 @@ export const AddressListRender = function() {
if (isMultiPublicAddress || if (isMultiPublicAddress ||
isMultiPrivateAddress) { isMultiPrivateAddress) {
return ( return (
<div className={ `btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ${(this.state.addressSelectorOpen ? 'open' : '')}` }> <div className={ `btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ${(this.state.addressSelectorOpen ? 'open margin-bottom-10' : 'margin-bottom-10')}` }>
<button <button
type="button" type="button"
className="btn dropdown-toggle btn-info" className="btn dropdown-toggle btn-info"
@ -80,7 +80,7 @@ export const AddressListRender = function() {
<div className="dropdown-menu open"> <div className="dropdown-menu open">
<ul className="dropdown-menu inner"> <ul className="dropdown-menu inner">
<li className="selected"> <li className="selected">
<a><span className="text"> - { translate('KMD_NATIVE.SELECT_ADDRESS') } - </span><span className="glyphicon glyphicon-ok check-mark"></span></a> <a><span className="text"> - { translate('KMD_NATIVE.SELECT_ADDRESS') } - </span></a>
</li> </li>
{ this.renderAddressByType('public') } { this.renderAddressByType('public') }
</ul> </ul>
@ -196,19 +196,19 @@ export const WalletsDataRender = function() {
<span className="caret"></span> <span className="caret"></span>
</a> </a>
<ul className="dropdown-menu dropdown-menu-right"> <ul className="dropdown-menu dropdown-menu-right">
<li> <li className="hide">
<a onClick={ this.getDexNotariesAction }> <a onClick={ this.getDexNotariesAction }>
<i className="icon fa-sitemap"></i> { translate('INDEX.GET_NOTARY_NODES_LIST') } <i className="icon fa-sitemap"></i> { translate('INDEX.GET_NOTARY_NODES_LIST') }
</a> </a>
</li> </li>
<li> <li className="hide">
<a onClick={ this.basiliskConnectionAction }> <a onClick={ this.basiliskConnectionAction }>
<i className="icon wb-refresh"></i> { translate('INDEX.REFRESH_BASILISK_CONNECTIONS') } <i className="icon wb-refresh"></i> { translate('INDEX.REFRESH_BASILISK_CONNECTIONS') }
</a> </a>
</li> </li>
<li className={ !this.state.useCache ? 'hide' : '' }> <li className={ !this.state.useCache ? 'hide' : '' }>
<a onClick={ this.basiliskRefreshActionOne }> <a onClick={ this.basiliskRefreshActionOne }>
<i className="icon fa-cloud-download"></i> { translate('INDEX.FETCH_WALLET_DATA') } <i className="icon fa-cloud-download"></i> { translate('INDEX.FETCH_WALLET_DATA') }&nbsp;
({ translate('INDEX.ACTIVE_ADDRESS') }) ({ translate('INDEX.ACTIVE_ADDRESS') })
</a> </a>
</li> </li>
@ -228,7 +228,7 @@ export const WalletsDataRender = function() {
<i className="icon fa-refresh"></i> Restart Basilisk Instance (unsafe!) <i className="icon fa-refresh"></i> Restart Basilisk Instance (unsafe!)
</a> </a>
</li> </li>
<li className={ !this.state.useCache ? 'hide' : '' }> <li className="hide">
<a onClick={ this._toggleViewCacheModal }> <a onClick={ this._toggleViewCacheModal }>
<i className="icon fa-list-alt"></i> { translate('INDEX.VIEW_CACHE_DATA') } <i className="icon fa-list-alt"></i> { translate('INDEX.VIEW_CACHE_DATA') }
</a> </a>

77
react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js

@ -25,14 +25,18 @@ class WalletsNativeSend extends React.Component {
sendTo: '', sendTo: '',
sendToOA: null, sendToOA: null,
amount: 0, amount: 0,
fee: 0.0001, fee: 0,
addressSelectorOpen: false, addressSelectorOpen: false,
renderAddressDropdown: true,
}; };
this.updateInput = this.updateInput.bind(this); this.updateInput = this.updateInput.bind(this);
this.handleSubmit = this.handleSubmit.bind(this); this.handleSubmit = this.handleSubmit.bind(this);
this.openDropMenu = this.openDropMenu.bind(this); this.openDropMenu = this.openDropMenu.bind(this);
this.getOAdress = this.getOAdress.bind(this); this.getOAdress = this.getOAdress.bind(this);
this.handleClickOutside = this.handleClickOutside.bind(this); this.handleClickOutside = this.handleClickOutside.bind(this);
this.checkZAddressCount = this.checkZAddressCount.bind(this);
this.setRecieverFromScan = this.setRecieverFromScan.bind(this);
this.renderOPIDListCheck = this.renderOPIDListCheck.bind(this);
} }
componentWillMount() { componentWillMount() {
@ -51,6 +55,18 @@ class WalletsNativeSend extends React.Component {
); );
} }
componentWillReceiveProps() {
this.checkZAddressCount();
}
setRecieverFromScan(receiver) {
this.setState({
sendTo: receiver
});
document.getElementById('kmdWalletSendTo').focus();
}
handleClickOutside(e) { handleClickOutside(e) {
if (e.srcElement.className !== 'btn dropdown-toggle btn-info' && if (e.srcElement.className !== 'btn dropdown-toggle btn-info' &&
(e.srcElement.offsetParent && e.srcElement.offsetParent.className !== 'btn dropdown-toggle btn-info') && (e.srcElement.offsetParent && e.srcElement.offsetParent.className !== 'btn dropdown-toggle btn-info') &&
@ -61,27 +77,61 @@ class WalletsNativeSend extends React.Component {
} }
} }
checkZAddressCount() {
if (this.props.ActiveCoin.addresses &&
(!this.props.ActiveCoin.addresses.private ||
this.props.ActiveCoin.addresses.private.length === 0)) {
this.setState({
renderAddressDropdown: false,
});
} else {
this.setState({
renderAddressDropdown: true,
});
}
}
renderAddressByType(type) { renderAddressByType(type) {
let _items = [];
if (this.props.ActiveCoin.addresses && if (this.props.ActiveCoin.addresses &&
this.props.ActiveCoin.addresses[type] && this.props.ActiveCoin.addresses[type] &&
this.props.ActiveCoin.addresses[type].length) { this.props.ActiveCoin.addresses[type].length) {
return this.props.ActiveCoin.addresses[type].map((address) => this.props.ActiveCoin.addresses[type].map((address) => {
<li key={ address.address } className={ address.amount <= 0 ? 'hide' : '' }> if (address.amount > 0) {
_items.push(
<li
className="selected"
key={ address.address }>
<a onClick={ () => this.updateAddressSelection(address.address, type, address.amount) }> <a onClick={ () => this.updateAddressSelection(address.address, type, address.amount) }>
<i className={ 'icon fa-eye' + (type === 'public' ? '' : '-slash') }></i>&nbsp;&nbsp; <i className={ 'icon fa-eye' + (type === 'public' ? '' : '-slash') }></i>&nbsp;&nbsp;
<span className="text"> <span className="text">
[ { address.amount } { this.props.ActiveCoin.coin } ]&nbsp;&nbsp; [ { address.amount } { this.props.ActiveCoin.coin } ]&nbsp;&nbsp;
{ type === 'public' ? address.address : address.address.substring(0, 34) + '...' } { type === 'public' ? address.address : address.address.substring(0, 34) + '...' }
</span> </span>
<span className="glyphicon glyphicon-ok check-mark"></span> <span
className="glyphicon glyphicon-ok check-mark pull-right"
style={{ display: this.state.sendFrom === address.address ? 'inline-block' : 'none' }}></span>
</a> </a>
</li> </li>
); );
}
});
return _items;
} else { } else {
return null; return null;
} }
} }
renderOPIDListCheck() {
if (this.state.renderAddressDropdown &&
this.props.ActiveCoin.opids &&
this.props.ActiveCoin.opids.length) {
return true;
}
}
renderSelectorCurrentLabel() { renderSelectorCurrentLabel() {
if (this.state.sendFrom) { if (this.state.sendFrom) {
return ( return (
@ -89,13 +139,13 @@ class WalletsNativeSend extends React.Component {
<i className={ 'icon fa-eye' + this.state.addressType === 'public' ? '' : '-slash' }></i> <i className={ 'icon fa-eye' + this.state.addressType === 'public' ? '' : '-slash' }></i>
<span className="text"> <span className="text">
[ { this.state.sendFromAmount } { this.props.ActiveCoin.coin } ] [ { this.state.sendFromAmount } { this.props.ActiveCoin.coin } ]
{ this.state.sendFrom } { this.state.addressType === 'public' ? this.state.sendFrom : this.state.sendFrom.substring(0, 34) + '...' }
</span> </span>
</span> </span>
); );
} else { } else {
return ( return (
<span>- { translate('SEND.SELECT_T_OR_Z_ADDR') } -</span> <span>Transparent funds</span>
); );
} }
} }
@ -218,6 +268,8 @@ class WalletsNativeSend extends React.Component {
this.state this.state
) )
); );
if (this.state.addressType === 'private') {
setTimeout(() => { setTimeout(() => {
Store.dispatch( Store.dispatch(
getKMDOPID( getKMDOPID(
@ -228,6 +280,19 @@ class WalletsNativeSend extends React.Component {
}, 1000); }, 1000);
} }
this.setState({
addressType: null,
sendFrom: null,
sendFromAmount: 0,
sendTo: '',
sendToOA: null,
amount: 0,
fee: 0,
addressSelectorOpen: false,
renderAddressDropdown: true,
});
}
getOAdress() { getOAdress() {
resolveOpenAliasAddress(this.state.sendToOA) resolveOpenAliasAddress(this.state.sendToOA)
.then((json) => { .then((json) => {

44
react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import QRModal from '../qrModal/qrModal';
export const AddressListRender = function() { export const AddressListRender = function() {
return ( return (
@ -7,7 +8,7 @@ export const AddressListRender = function() {
<button <button
type="button" type="button"
className="btn dropdown-toggle btn-info" className="btn dropdown-toggle btn-info"
title="- { translate('SEND.SELECT_T_OR_Z_ADDR') } -" title="Select private address"
onClick={ this.openDropMenu }> onClick={ this.openDropMenu }>
<span className="filter-option pull-left">{ this.renderSelectorCurrentLabel() } </span> <span className="filter-option pull-left">{ this.renderSelectorCurrentLabel() } </span>
<span className="bs-caret"> <span className="bs-caret">
@ -16,11 +17,16 @@ export const AddressListRender = function() {
</button> </button>
<div className="dropdown-menu open"> <div className="dropdown-menu open">
<ul className="dropdown-menu inner"> <ul className="dropdown-menu inner">
<li className="selected"> <li
<a><span className="text"> - { translate('SEND.SELECT_T_OR_Z_ADDR') } - </span> className="selected"
<span className="glyphicon glyphicon-ok check-mark"></span></a> onClick={ () => this.updateAddressSelection(null, 'public', null) }>
<a>
<span className="text">Transparent funds</span>
<span
className="glyphicon glyphicon-ok check-mark pull-right"
style={{ display: this.state.sendFrom === null ? 'inline-block' : 'none' }}></span>
</a>
</li> </li>
{ this.renderAddressByType('public') }
{ this.renderAddressByType('private') } { this.renderAddressByType('private') }
</ul> </ul>
</div> </div>
@ -28,6 +34,8 @@ export const AddressListRender = function() {
); );
}; };
// { this.renderAddressByType('public') }
export const OASendUIRender = function() { export const OASendUIRender = function() {
return ( return (
<div className="row"> <div className="row">
@ -69,17 +77,24 @@ export const WalletsNativeSendRender = function() {
{ translate('INDEX.SEND') } { this.props.ActiveCoin.coin } { translate('INDEX.SEND') } { this.props.ActiveCoin.coin }
</h3> </h3>
</div> </div>
<div className="qr-modal-send-block">
<QRModal
mode="scan"
setRecieverFromScan={ this.setRecieverFromScan } />
</div>
<div className="panel-body container-fluid"> <div className="panel-body container-fluid">
<form <form
className="extcoin-send-form" className="extcoin-send-form"
method="post" method="post"
autoComplete="off"> autoComplete="off">
{ this.state.renderAddressDropdown &&
<div className="row"> <div className="row">
<div className="col-xlg-12 form-group form-material"> <div className="col-xlg-12 form-group form-material">
<label className="control-label">{ translate('INDEX.SEND_FROM') }</label> <label className="control-label">{ translate('INDEX.SEND_FROM') }</label>
{ this.renderAddressList() } { this.renderAddressList() }
</div> </div>
</div> </div>
}
{ this.renderOASendUI() } { this.renderOASendUI() }
<div className="row"> <div className="row">
<div className="col-xlg-12 form-group form-material"> <div className="col-xlg-12 form-group form-material">
@ -97,22 +112,23 @@ export const WalletsNativeSendRender = function() {
autoComplete="off" autoComplete="off"
required /> required />
</div> </div>
<div className="col-lg-6 form-group form-material"> <div className="col-lg-12 form-group form-material">
<label <label
className="control-label" className="control-label"
htmlFor="kmdWalletAmount"> htmlFor="kmdWalletAmount">
{ this.props.ActiveCoin.coin } { translate('INDEX.AMOUNT') }
</label> </label>
<input <input
type="text" type="text"
className="form-control" className="form-control"
name="amount" name="amount"
value={ this.state.amount !== 0 ? this.state.amount : '' }
onChange={ this.updateInput } onChange={ this.updateInput }
id="kmdWalletAmount" id="kmdWalletAmount"
placeholder="0.000" placeholder="0.000"
autoComplete="off" /> autoComplete="off" />
</div> </div>
<div className="col-lg-6 form-group form-material"> <div className="col-lg-6 form-group form-material hide">
<label <label
className="control-label" className="control-label"
htmlFor="kmdWalletFee"> htmlFor="kmdWalletFee">
@ -125,13 +141,13 @@ export const WalletsNativeSendRender = function() {
onChange={ this.updateInput } onChange={ this.updateInput }
id="kmdWalletFee" id="kmdWalletFee"
placeholder="0.000" placeholder="0.000"
value={ this.state.fee } value={ this.state.fee !== 0 ? this.state.fee : '' }
autoComplete="off" /> autoComplete="off" />
</div> </div>
<div className="col-lg-12"> <div className="col-lg-12 hide">
<span> <span>
<strong>{ translate('INDEX.TOTAL') }:</strong> <strong>{ translate('INDEX.TOTAL') }:</strong>&nbsp;
{ this.state.amount } - { this.state.fee }/kb = { Number(this.state.amount) - Number(this.state.fee) } { this.state.amount } - { this.state.fee }/kb = { Number(this.state.amount) - Number(this.state.fee) }&nbsp;
{ this.props.ActiveCoin.coin } { this.props.ActiveCoin.coin }
</span> </span>
</div> </div>
@ -140,7 +156,7 @@ export const WalletsNativeSendRender = function() {
type="button" type="button"
className="btn btn-primary waves-effect waves-light pull-right" className="btn btn-primary waves-effect waves-light pull-right"
onClick={ this.handleSubmit } onClick={ this.handleSubmit }
disabled={ !this.state.sendFrom || !this.state.sendTo || !this.state.amount }> disabled={ !this.state.sendTo || !this.state.amount }>
{ translate('INDEX.SEND') } { this.state.amount } { this.props.ActiveCoin.coin } { translate('INDEX.SEND') } { this.state.amount } { this.props.ActiveCoin.coin }
</button> </button>
</div> </div>
@ -150,6 +166,7 @@ export const WalletsNativeSendRender = function() {
</div> </div>
</div> </div>
{ this.renderOPIDListCheck() &&
<div className="col-xs-12"> <div className="col-xs-12">
<div className="row"> <div className="row">
<div className="panel nav-tabs-horizontal"> <div className="panel nav-tabs-horizontal">
@ -192,6 +209,7 @@ export const WalletsNativeSendRender = function() {
</div> </div>
</div> </div>
</div> </div>
}
</div> </div>
); );
}; };

46
react/src/components/dashboard/walletsNav/walletsNav.js

@ -21,6 +21,9 @@ class WalletsNav extends React.Component {
nativeOnly: Config.iguanaLessMode, nativeOnly: Config.iguanaLessMode,
}; };
this.toggleSendReceiveCoinForms = this.toggleSendReceiveCoinForms.bind(this); this.toggleSendReceiveCoinForms = this.toggleSendReceiveCoinForms.bind(this);
this.toggleNativeWalletInfo = this.toggleNativeWalletInfo.bind(this);
this.toggleNativeWalletTransactions = this.toggleNativeWalletTransactions.bind(this);
this.checkTotalBalance = this.checkTotalBalance.bind(this);
} }
componentWillMount() { componentWillMount() {
@ -31,6 +34,41 @@ class WalletsNav extends React.Component {
Store.dispatch(copyCoinAddress(address)); Store.dispatch(copyCoinAddress(address));
} }
checkTotalBalance() {
let _balance = '0';
const _mode = this.props.ActiveCoin.mode;
if (_mode === 'full') {
_balance = this.props.ActiveCoin.balance || 0;
} else if (_mode === 'basilisk') {
if (this.props.ActiveCoin.cache) {
const _cache = this.props.ActiveCoin.cache;
const _coin = this.props.ActiveCoin.coin;
const _address = this.props.ActiveCoin.activeAddress;
if (_address &&
_cache[_coin] &&
_cache[_coin][_address] &&
_cache[_coin][_address].getbalance &&
_cache[_coin][_address].getbalance.data &&
(_cache[_coin][_address].getbalance.data.balance ||
_cache[_coin][_address].getbalance.data.interest)) {
const _regBalance = _cache[_coin][_address].getbalance.data.balance ? _cache[_coin][_address].getbalance.data.balance : 0;
const _regInterest = _cache[_coin][_address].getbalance.data.interest ? _cache[_coin][_address].getbalance.data.interest : 0;
_balance = _regBalance + _regInterest;
}
}
} else if (_mode === 'native') {
if (this.props.ActiveCoin.balance &&
this.props.ActiveCoin.balance.total) {
_balance = this.props.ActiveCoin.balance.total;
}
}
return _balance;
}
toggleSendReceiveCoinForms() { toggleSendReceiveCoinForms() {
if (this.props.ActiveCoin.mode === 'native') { if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch( Store.dispatch(
@ -43,6 +81,14 @@ class WalletsNav extends React.Component {
} }
} }
toggleNativeWalletInfo() {
Store.dispatch(toggleDashboardActiveSection('settings'));
}
toggleNativeWalletTransactions() {
Store.dispatch(toggleDashboardActiveSection('default'));
}
toggleSendCoinForm(display) { toggleSendCoinForm(display) {
if (this.props.ActiveCoin.mode === 'native') { if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch( Store.dispatch(

16
react/src/components/dashboard/walletsNav/walletsNav.render.js

@ -38,21 +38,31 @@ export const WalletsNavWithWalletRender = function() {
</ol> </ol>
<div className="page-header-actions"> <div className="page-header-actions">
<div id="kmd_header_button"> <div id="kmd_header_button">
{ this.props.ActiveCoin.mode === 'native' &&
<button
type="button"
className="btn btn-info waves-effect waves-light"
onClick={ this.toggleNativeWalletInfo }>
<i className="icon fa-info"></i>
</button>
}
<button <button
type="button" type="button"
className="btn btn-dark waves-effect waves-light" className="btn btn-dark waves-effect waves-light"
onClick={ this.toggleSendReceiveCoinForms }> onClick={ this.props.ActiveCoin.mode !== 'native' ? this.toggleSendReceiveCoinForms : this.toggleNativeWalletTransactions }>
<i className="icon md-view-dashboard"></i> { this.props.ActiveCoin.mode !== 'native' ? translate('INDEX.DASHBOARD') : translate('INDEX.WALLET_INFO') } <i className="icon md-view-dashboard"></i> { translate('INDEX.TRANSACTIONS') }
</button> </button>
{ this.checkTotalBalance() > 0 &&
<button <button
type="button" type="button"
className="btn btn-primary waves-effect waves-light" className="btn btn-primary waves-effect waves-light"
onClick={ () => this.toggleSendCoinForm(!this.props.ActiveCoin.send) }> onClick={ () => this.toggleSendCoinForm(!this.props.ActiveCoin.send) }>
<i className="icon fa-send"></i> { translate('INDEX.SEND') } <i className="icon fa-send"></i> { translate('INDEX.SEND') }
</button> </button>
}
<button <button
type="button" type="button"
className="btn btn-info waves-effect waves-light" className="btn btn-success waves-effect waves-light"
onClick={ () => this.toggleReceiveCoinForm(!this.props.ActiveCoin.receive) }> onClick={ () => this.toggleReceiveCoinForm(!this.props.ActiveCoin.receive) }>
<i className="icon fa-inbox"></i> { translate('INDEX.RECEIVE') } <i className="icon fa-inbox"></i> { translate('INDEX.RECEIVE') }
</button> </button>

16
react/src/components/dashboard/walletsProgress/walletsProgress.js

@ -73,6 +73,7 @@ class WalletsProgress extends React.Component {
} }
if (temp[i].indexOf('progress=') > -1) { if (temp[i].indexOf('progress=') > -1) {
currentProgress = Number(temp[i].replace('progress=', '')) * 1000; currentProgress = Number(temp[i].replace('progress=', '')) * 1000;
currentProgress = currentProgress >= 100 ? 100 : currentProgress;
} }
} }
@ -93,7 +94,7 @@ class WalletsProgress extends React.Component {
if (_progress && if (_progress &&
_progress[1]) { _progress[1]) {
return SyncPercentageRender.call(this, _progress[1].toFixed(2)); return SyncPercentageRender.call(this, _progress[1] === 1000 ? 100 : _progress[1].toFixed(2));
} else { } else {
return LoadingBlocksRender.call(this); return LoadingBlocksRender.call(this);
} }
@ -112,9 +113,8 @@ class WalletsProgress extends React.Component {
if (this.props.Dashboard.progress && if (this.props.Dashboard.progress &&
this.props.Dashboard.progress.blocks) { this.props.Dashboard.progress.blocks) {
const syncPercentage = (parseFloat(parseInt(this.props.Dashboard.progress.blocks, 10) * 100 const syncPercentage = (parseFloat(parseInt(this.props.Dashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2) + '%').replace('NaN', 0);
/ parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2) + '%').replace('NaN', 0); return SyncPercentageRender.call(this, syncPercentage === 1000 ? 100 : syncPercentage);
return SyncPercentageRender.call(this, syncPercentage);
} }
return LoadingBlocksRender.call(this); return LoadingBlocksRender.call(this);
@ -189,18 +189,22 @@ class WalletsProgress extends React.Component {
} else { } else {
if (currentProgress) { if (currentProgress) {
return ( return (
`: ${currentProgress}% (${ translate('INDEX.RESCAN_SM') })` `: ${currentProgress.toFixed(2)}% (${ translate('INDEX.RESCAN_SM') })`
); );
} else { } else {
return null; return null;
} }
} }
} else if (this.props.Settings.debugLog.indexOf('Rescanning last') > -1) {
return (
`: (${ translate('INDEX.RESCANNING_LAST_BLOCKS') })`
);
} else if ( } else if (
this.props.Settings.debugLog.indexOf('LoadExternalBlockFile:') > -1 || this.props.Settings.debugLog.indexOf('LoadExternalBlockFile:') > -1 ||
this.props.Settings.debugLog.indexOf('Reindexing block file') > -1 this.props.Settings.debugLog.indexOf('Reindexing block file') > -1
) { ) {
return ( return (
`: ({ translate('INDEX.REINDEX') })` `: (${ translate('INDEX.REINDEX') })`
); );
} else { } else {
return ( return (

4
react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js

@ -15,6 +15,10 @@ class WalletsTxInfo extends React.Component {
toggleTxInfoModal() { toggleTxInfoModal() {
Store.dispatch(toggleDashboardTxInfoModal(false)); Store.dispatch(toggleDashboardTxInfoModal(false));
this.setState(Object.assign({}, this.state, {
activeTab: 0,
}));
} }
openTab(tab) { openTab(tab) {

36
react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js

@ -20,23 +20,20 @@ const WalletsTxInfoRender = function(txInfo) {
<i className="icon md-balance-wallet"></i>TxID Info <i className="icon md-balance-wallet"></i>TxID Info
</a> </a>
</li> </li>
{ this.isNativeMode() && { this.isNativeMode() &&
<li className={ this.state.activeTab === 1 ? 'active' : '' }> <li className={ this.state.activeTab === 1 ? 'hide active' : 'hide' }>
<a onClick={ () => this.openTab(1) }> <a onClick={ () => this.openTab(1) }>
<i className="icon md-plus-square"></i>Vjointsplits, Details <i className="icon md-plus-square"></i>Vjointsplits, Details
</a> </a>
</li> </li>
} }
{ this.isNativeMode() && { this.isNativeMode() &&
<li className={ this.state.activeTab === 2 ? 'active' : '' }> <li className={ this.state.activeTab === 2 ? 'hide active' : 'hide' }>
<a onClick={ () => this.openTab(2) }> <a onClick={ () => this.openTab(2) }>
<i className="icon wb-briefcase"></i>Hex <i className="icon wb-briefcase"></i>Hex
</a> </a>
</li> </li>
} }
<li className={ this.state.activeTab === 3 ? 'active' : '' }> <li className={ this.state.activeTab === 3 ? 'active' : '' }>
<a onClick={ () => this.openTab(3) }> <a onClick={ () => this.openTab(3) }>
<i className="icon wb-file"></i>Raw info <i className="icon wb-file"></i>Raw info
@ -45,13 +42,14 @@ const WalletsTxInfoRender = function(txInfo) {
</ul> </ul>
<div className="panel-body"> <div className="panel-body">
<div className="tab-content"> <div className="tab-content">
<div className={ 'tab-pane' + (this.state.activeTab === 0 ? ' active' : '') }> { this.state.activeTab === 0 &&
<div className="tab-pane active">
<table className="table table-striped"> <table className="table table-striped">
<tbody> <tbody>
<tr> <tr>
<td>{ translate('TX_INFO.ADDRESS') }</td> <td>{ translate('TX_INFO.ADDRESS') }</td>
<td> <td>
{ txInfo.address } { this.props.ActiveCoin.mode === 'basilisk' ? this.props.ActiveCoin.activeAddress : txInfo.address }
</td> </td>
</tr> </tr>
<tr> <tr>
@ -72,34 +70,36 @@ const WalletsTxInfoRender = function(txInfo) {
{ txInfo.confirmations } { txInfo.confirmations }
</td> </td>
</tr> </tr>
{ txInfo.blockhash &&
<tr> <tr>
<td>blockhash</td> <td>blockhash</td>
<td> <td>
{ txInfo.blockhash } { txInfo.blockhash }
</td> </td>
</tr> </tr>
}
{ (txInfo.blocktime || txInfo.timestamp) &&
<tr> <tr>
<td>blocktime</td> <td>blocktime</td>
<td> <td>
{ secondsToString(txInfo.blocktime || txInfo.timestamp) } { secondsToString(txInfo.blocktime || txInfo.timestamp) }
</td> </td>
</tr> </tr>
}
<tr> <tr>
<td>txid</td> <td>txid</td>
<td> <td>
{ txInfo.txid } { txInfo.txid }
</td> </td>
</tr> </tr>
{ this.isNativeMode() && { this.isNativeMode() &&
<tr> <tr>
<td>walletconflicts</td> <td>walletconflicts</td>
<td> <td>
{ txInfo.walletconflicts ? txInfo.walletconflicts.length : null } { txInfo.walletconflicts.length }
</td> </td>
</tr> </tr>
} }
{ this.isNativeMode() && { this.isNativeMode() &&
<tr> <tr>
<td>time</td> <td>time</td>
@ -108,7 +108,6 @@ const WalletsTxInfoRender = function(txInfo) {
</td> </td>
</tr> </tr>
} }
{ this.isNativeMode() && { this.isNativeMode() &&
<tr> <tr>
<td>timereceived</td> <td>timereceived</td>
@ -120,8 +119,9 @@ const WalletsTxInfoRender = function(txInfo) {
</tbody> </tbody>
</table> </table>
</div> </div>
}
<div className={ 'tab-pane' + (this.state.activeTab === 1 ? ' active' : '') }> { this.state.activeTab === 1 &&
<div className="tab-pane active">
<table className="table table-striped"> <table className="table table-striped">
<tbody> <tbody>
<tr> <tr>
@ -139,7 +139,9 @@ const WalletsTxInfoRender = function(txInfo) {
</tbody> </tbody>
</table> </table>
</div> </div>
<div className={ 'tab-pane' + (this.state.activeTab === 2 ? ' active' : '') }> }
{ this.state.activeTab === 2 &&
<div className="tab-pane active">
<textarea <textarea
className="full-width height-170" className="full-width height-170"
rows="10" rows="10"
@ -147,8 +149,9 @@ const WalletsTxInfoRender = function(txInfo) {
defaultValue={ txInfo.hex } defaultValue={ txInfo.hex }
disabled></textarea> disabled></textarea>
</div> </div>
}
<div className={ 'tab-pane' + (this.state.activeTab === 3 ? ' active' : '') }> { this.state.activeTab === 3 &&
<div className="tab-pane active">
<textarea <textarea
className="full-width height-400" className="full-width height-400"
rows="40" rows="40"
@ -156,6 +159,7 @@ const WalletsTxInfoRender = function(txInfo) {
defaultValue={ JSON.stringify(txInfo, null, '\t') } defaultValue={ JSON.stringify(txInfo, null, '\t') }
disabled></textarea> disabled></textarea>
</div> </div>
}
</div> </div>
</div> </div>
</div> </div>

2
react/src/components/login/login.js

@ -21,6 +21,8 @@ import { translate } from '../../translate/translate';
const IGUNA_ACTIVE_HANDLE_TIMEOUT = 3000; const IGUNA_ACTIVE_HANDLE_TIMEOUT = 3000;
const IGUNA_ACTIVE_COINS_TIMEOUT = 10000; const IGUNA_ACTIVE_COINS_TIMEOUT = 10000;
// TODO: remove duplicate activehandle and activecoins calls
class Login extends React.Component { class Login extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);

10
react/src/components/main/main.js

@ -23,6 +23,16 @@ class Main extends React.Component {
} }
componentDidMount() { componentDidMount() {
let appVersion;
try {
appVersion = window.require('electron').remote.getCurrentWindow().appBasicInfo;
} catch (e) {}
if (appVersion) {
document.title = `${appVersion.name} (v${appVersion.version.replace('version=', '')}-beta)`;
}
Store.dispatch(iguanaActiveHandle()); Store.dispatch(iguanaActiveHandle());
const _iguanaActiveHandle = setInterval(function() { const _iguanaActiveHandle = setInterval(function() {
Store.dispatch(iguanaActiveHandle()); Store.dispatch(iguanaActiveHandle());

1
react/src/components/main/walletMain.js

@ -10,6 +10,7 @@ class WalletMain extends React.Component {
render() { render() {
return ( return (
<div className="full-height"> <div className="full-height">
<input type="text" id="js-copytextarea" />
<SyncOnly {...this.props} /> <SyncOnly {...this.props} />
<Dashboard {...this.props} /> <Dashboard {...this.props} />
<AddCoin {...this.props} /> <AddCoin {...this.props} />

36
react/src/components/overrides.scss

@ -649,3 +649,39 @@ select{
right: 4px; right: 4px;
top: 3px; top: 3px;
} }
.table-striped {
> tbody {
> tr.hover--none {
background-color: inherit;
}
}
}
.qr-modal-send-block {
position: absolute;
top: 15px;
right: 30px;
}
@media only screen and (min-width : 1201px) {
.wallet-widgets {
.flex {
display: flex;
flex-wrap: wrap;
}
> div {
display: flex;
.widget,
.widget-content {
height: 100%;
> div,
.clearfix {
height: 100%;
}
}
}
}
}

4
react/src/translate/en.js

@ -17,6 +17,7 @@ export const _lang = {
'NO_ACTIVE_COIN': 'No active coin', 'NO_ACTIVE_COIN': 'No active coin',
}, },
'INDEX': { 'INDEX': {
'RESCANNING_LAST_BLOCKS': 'Rescanning last blocks...',
'NO_DATA_AVAILABLE': 'No data available', 'NO_DATA_AVAILABLE': 'No data available',
'LOADING': 'Loading', 'LOADING': 'Loading',
'ACTIVATING_SM': 'activating', 'ACTIVATING_SM': 'activating',
@ -193,7 +194,8 @@ export const _lang = {
'- Your External Wallet/daemon is setup, but is not setup with config settings like<br>', '- Your External Wallet/daemon is setup, but is not setup with config settings like<br>',
'ACTIVATING_CHAIN': 'Activating best chain', 'ACTIVATING_CHAIN': 'Activating best chain',
'KMD_STARTED': 'Komodo daemon has been started and is processing.<br>' + 'KMD_STARTED': 'Komodo daemon has been started and is processing.<br>' +
'Please wait while the best chain is being activated.', 'Please wait while the best chain is being activated.<br>' +
'Tip: in case sync is stuck restart the wallet.',
'CONNECTIONS': 'Connections', 'CONNECTIONS': 'Connections',
'TRANSPARENT_BALANCE': 'Transparent Balance', 'TRANSPARENT_BALANCE': 'Transparent Balance',
'Z_BALANCE': 'Private (Z) Balance', 'Z_BALANCE': 'Private (Z) Balance',

8
react/src/translate/translate.js

@ -13,13 +13,13 @@ export function translate(langID) {
_lang[defaultLang][langIDComponents[0]][langIDComponents[1]]) { _lang[defaultLang][langIDComponents[0]][langIDComponents[1]]) {
return _lang[defaultLang][langIDComponents[0]][langIDComponents[1]]; return _lang[defaultLang][langIDComponents[0]][langIDComponents[1]];
} else { } else {
console.warn('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID); console.warn(`Missing translation ${langID} in js/${defaultLang.toLowerCase()}.js`);
return '--> ' + langID + ' <--'; return `--> ${langID} <--`;
} }
} else { } else {
if (langID.length) { if (langID.length) {
console.warn('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID); console.warn(`Missing translation ${langID} in js/${defaultLang.toLowerCase()}.js`);
return '--> ' + langID + ' <--'; return `--> ${langID} <--`;
} }
} }
} }

13
react/src/util/formatValue.js

@ -1,5 +1,6 @@
// ref: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Math/round#Decimal_rounding // ref: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Math/round#Decimal_rounding
export function formatValue(formatType, formatValue, formatExp) { export function formatValue(formatType, formatValue, formatExp) {
let _formatExp;
/** /**
* Decimal adjustment of a number. * Decimal adjustment of a number.
* *
@ -31,19 +32,21 @@ export function formatValue(formatType, formatValue, formatExp) {
return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)); return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp));
} }
if (formatValue >= 1) { if (Math.abs(Number(formatValue)) >= 1) {
formatExp = -3; _formatExp = -3;
} else {
_formatExp = formatExp;
} }
switch (formatType) { switch (formatType) {
case 'round': case 'round':
return decimalAdjust('round', formatValue, formatExp); return decimalAdjust('round', formatValue, _formatExp);
break; break;
case 'floor': case 'floor':
return decimalAdjust('floor', formatValue, formatExp); return decimalAdjust('floor', formatValue, _formatExp);
break; break;
case 'ceil': case 'ceil':
return decimalAdjust('ceil', formatValue, formatExp); return decimalAdjust('ceil', formatValue, _formatExp);
break; break;
} }
} }

15
react/src/util/sort.js

@ -1,10 +1,13 @@
export function sortByDate(data) { export function sortByDate(data, sortKey) {
return data.sort(function(a, b) { return data.sort(function(a, b) {
if (a.timestamp && if (a[sortKey] < b[sortKey]) {
b.timestamp) { return -1;
return b.timestamp - a.timestamp;
} else {
return b.blocktime - a.blocktime;
} }
if (a[sortKey] > b[sortKey]) {
return 1;
}
return 0;
}); });
} }

6
react/src/util/time.js

@ -37,9 +37,9 @@ export function secondsElapsedToString(timestamp) { // in seconds
const hours = Math.floor(timestamp / 3600); const hours = Math.floor(timestamp / 3600);
const minutes = Math.floor((timestamp - (hours * 3600)) / 60); const minutes = Math.floor((timestamp - (hours * 3600)) / 60);
const seconds = timestamp - (hours * 3600) - (minutes * 60); const seconds = timestamp - (hours * 3600) - (minutes * 60);
const returnTimeVal = (hours > 0 ? hours + ' hour(s) ' : '') + const returnTimeVal = (hours > 0 ? `${hours} hour(s) ` : '') +
(minutes > 0 ? minutes + ' minute(s) ' : '') + (minutes > 0 ? `${minutes} minute(s) ` : '') +
(seconds > 0 ? seconds + ' second(s) ' : ''); (seconds > 0 ? `${seconds} second(s) ` : '');
return returnTimeVal; return returnTimeVal;
} }

3
react/www/index.html

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui"> <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="description" content="bootstrap admin template">
<meta name="author" content="SuperNET Team"> <meta name="author" content="SuperNET Team">
<title>Agama (v0.2.0.21a-beta)</title> <title>Agama</title>
<link rel="apple-touch-icon" href="assets/images/android-chrome-192x192.png"> <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-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="assets/images/favicon-194x194.png" sizes="194x194"> <link rel="icon" type="image/png" href="assets/images/favicon-194x194.png" sizes="194x194">
@ -15,7 +15,6 @@
<link rel="icon" type="image/png" href="assets/images/favicon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="assets/images/favicon-16x16.png" sizes="16x16">
</head> </head>
<body id="body" class="page-login layout-full page-dark"> <body id="body" class="page-login layout-full page-dark">
<input type="text" id="js-copytextarea" />
<div id="app" class="full-height"></div> <div id="app" class="full-height"></div>
</body> </body>
</html> </html>

Loading…
Cancel
Save