Browse Source

resolved merge conflicts

all-modes
pbca26 8 years ago
parent
commit
c29bfddd15
  1. 7
      react/change.log
  2. 14
      react/src/actions/actionCreators.js
  3. 42
      react/src/actions/actions/addCoin.js
  4. 216
      react/src/actions/actions/addressBalance.js
  5. 42
      react/src/actions/actions/atomic.js
  6. 84
      react/src/actions/actions/basiliskProcessAddress.js
  7. 14
      react/src/actions/actions/copyAddress.js
  8. 42
      react/src/actions/actions/createWallet.js
  9. 42
      react/src/actions/actions/dexCoins.js
  10. 72
      react/src/actions/actions/edexBalance.js
  11. 42
      react/src/actions/actions/edexGetTx.js
  12. 42
      react/src/actions/actions/fullTxHistory.js
  13. 42
      react/src/actions/actions/getAddrByAccount.js
  14. 42
      react/src/actions/actions/iguanaHelpers.js
  15. 86
      react/src/actions/actions/interest.js
  16. 164
      react/src/actions/actions/jumblr.js
  17. 1
      react/src/actions/actions/log.js
  18. 42
      react/src/actions/actions/logout.js
  19. 42
      react/src/actions/actions/nativeBalance.js
  20. 79
      react/src/actions/actions/nativeNewAddress.js
  21. 141
      react/src/actions/actions/nativeSend.js
  22. 159
      react/src/actions/actions/nativeSyncInfo.js
  23. 42
      react/src/actions/actions/nativeTxHistory.js
  24. 84
      react/src/actions/actions/notary.js
  25. 168
      react/src/actions/actions/sendFullBasilisk.js
  26. 132
      react/src/actions/actions/settings.js
  27. 42
      react/src/actions/actions/syncInfo.js
  28. 168
      react/src/actions/actions/walletAuth.js
  29. 3
      react/src/actions/storeType.js
  30. 0
      react/src/assets/images/cryptologo/aud.png
  31. 0
      react/src/assets/images/cryptologo/bet.png
  32. 0
      react/src/assets/images/cryptologo/bgn.png
  33. 0
      react/src/assets/images/cryptologo/bots.png
  34. 0
      react/src/assets/images/cryptologo/brl.png
  35. 0
      react/src/assets/images/cryptologo/cad.png
  36. 0
      react/src/assets/images/cryptologo/ceal.png
  37. 0
      react/src/assets/images/cryptologo/chf.png
  38. 0
      react/src/assets/images/cryptologo/cny.png
  39. BIN
      react/src/assets/images/cryptologo/coqui.png
  40. 0
      react/src/assets/images/cryptologo/crypto.png
  41. 0
      react/src/assets/images/cryptologo/czk.png
  42. 0
      react/src/assets/images/cryptologo/dkk.png
  43. 0
      react/src/assets/images/cryptologo/eur.png
  44. 0
      react/src/assets/images/cryptologo/game.png
  45. 0
      react/src/assets/images/cryptologo/gbp.png
  46. 0
      react/src/assets/images/cryptologo/hkd.png
  47. 0
      react/src/assets/images/cryptologo/hodl.png
  48. 0
      react/src/assets/images/cryptologo/hrk.png
  49. 0
      react/src/assets/images/cryptologo/huf.png
  50. 0
      react/src/assets/images/cryptologo/idr.png
  51. 0
      react/src/assets/images/cryptologo/ils.png
  52. 0
      react/src/assets/images/cryptologo/inr.png
  53. 0
      react/src/assets/images/cryptologo/jpy.png
  54. 0
      react/src/assets/images/cryptologo/jumblr.png
  55. 0
      react/src/assets/images/cryptologo/kmd.png
  56. 0
      react/src/assets/images/cryptologo/krw.png
  57. 0
      react/src/assets/images/cryptologo/kv.png
  58. 0
      react/src/assets/images/cryptologo/mesh.png
  59. 0
      react/src/assets/images/cryptologo/mgw.png
  60. 0
      react/src/assets/images/cryptologo/mvp.png
  61. 0
      react/src/assets/images/cryptologo/mxn.png
  62. 0
      react/src/assets/images/cryptologo/myr.png
  63. 0
      react/src/assets/images/cryptologo/nok.png
  64. 0
      react/src/assets/images/cryptologo/nzd.png
  65. 0
      react/src/assets/images/cryptologo/pangea.png
  66. 0
      react/src/assets/images/cryptologo/php.png
  67. 0
      react/src/assets/images/cryptologo/pln.png
  68. 0
      react/src/assets/images/cryptologo/revs.png
  69. 0
      react/src/assets/images/cryptologo/ron.png
  70. 0
      react/src/assets/images/cryptologo/rub.png
  71. 0
      react/src/assets/images/cryptologo/sek.png
  72. 0
      react/src/assets/images/cryptologo/sgd.png
  73. 0
      react/src/assets/images/cryptologo/shark.png
  74. 0
      react/src/assets/images/cryptologo/supernet.png
  75. 0
      react/src/assets/images/cryptologo/thb.png
  76. 0
      react/src/assets/images/cryptologo/try.png
  77. 0
      react/src/assets/images/cryptologo/wlc.png
  78. 0
      react/src/assets/images/cryptologo/zar.png
  79. 1
      react/src/components/addcoin/addcoinOptionsAC.js
  80. 31
      react/src/components/addcoin/payload.js
  81. 136
      react/src/components/dashboard/claimInterestModal/claimInterestModal.js
  82. 132
      react/src/components/dashboard/claimInterestModal/claimInterestModal.render.js
  83. 21
      react/src/components/dashboard/coinTile/coinTileItem.js
  84. 2
      react/src/components/dashboard/coinTile/coinTileItem.render.js
  85. 2
      react/src/components/dashboard/coindDownModal/coindDownModal.render.js
  86. 387
      react/src/components/dashboard/jumblr/jumblr.js
  87. 593
      react/src/components/dashboard/jumblr/jumblr.render.js
  88. 20
      react/src/components/dashboard/main/dashboard.render.js
  89. 6
      react/src/components/dashboard/navbar/navbar.js
  90. 12
      react/src/components/dashboard/navbar/navbar.render.js
  91. 20
      react/src/components/dashboard/qrModal/qrModal.js
  92. 8
      react/src/components/dashboard/qrModal/qrModal.render.js
  93. 24
      react/src/components/dashboard/receiveCoin/receiveCoin.js
  94. 202
      react/src/components/dashboard/receiveCoin/receiveCoin.render.js
  95. 36
      react/src/components/dashboard/sendCoin/sendCoin.js
  96. 124
      react/src/components/dashboard/sendCoin/sendCoin.render.js
  97. 51
      react/src/components/dashboard/settings/settings.js
  98. 12
      react/src/components/dashboard/settings/settings.render.js
  99. 31
      react/src/components/dashboard/walletsBalance/walletsBalance.js
  100. 41
      react/src/components/dashboard/walletsBalance/walletsBalance.render.js

7
react/change.log

@ -13,6 +13,13 @@ UI:
- reset app setting to default
- manual balance / transactions list refresh
- 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
- added coqui assetchain
- jumblr
- zcashparams folder check
- claim interest modal
v0.2.0.21a-beta
--------------

14
react/src/actions/actionCreators.js

@ -27,6 +27,7 @@ import {
DASHBOARD_ACTIVE_COIN_NATIVE_TXHISTORY,
DISPLAY_LOGIN_SETTINGS_MODAL,
DISPLAY_COIND_DOWN_MODAL,
DISPLAY_CLAIM_INTEREST_MODAL,
START_INTERVAL,
STOP_INTERVAL
} from './storeType';
@ -68,6 +69,8 @@ export * from './actions/basiliskTxHistory';
export * from './actions/iguanaHelpers';
export * from './actions/cli';
export * from './actions/update';
export * from './actions/jumblr';
export * from './actions/interest';
export function changeActiveAddress(address) {
return {
@ -325,9 +328,9 @@ export function getNativeTxHistoryState(json) {
if (json &&
json.error) {
json = null;
} else if (json && json.result) {
} else if (json && json.result && json.result.length) {
json = json.result;
} else if (!json.length) {
} else if (!json || !json.result.length) {
json = 'no data';
}
@ -366,4 +369,11 @@ export function toggleLoginSettingsModal(display) {
type: DISPLAY_LOGIN_SETTINGS_MODAL,
displayLoginSettingsModal: display,
}
}
export function toggleClaimInterestModal(display) {
return {
type: DISPLAY_CLAIM_INTEREST_MODAL,
displayClaimInterestModal: display,
}
}

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

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

216
react/src/actions/actions/addressBalance.js

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

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

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

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

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

14
react/src/actions/actions/copyAddress.js

@ -14,4 +14,18 @@ export function copyCoinAddress(address) {
)
);
}
}
export function copyString(string, message) {
const _result = copyToClipboard(string);
return dispatch => {
dispatch(
triggerToaster(
message,
translate('TOASTR.COIN_NOTIFICATION'),
_result ? 'success' : 'error'
)
);
}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

86
react/src/actions/actions/interest.js

@ -0,0 +1,86 @@
import {
triggerToaster
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getListUnspent(coin) {
return new Promise((resolve, reject) => {
const payload = {
mode: null,
chain: coin,
cmd: 'listunspent',
};
const _fetchConfig = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ 'payload': payload }),
};
fetch(
`http://127.0.0.1:${Config.agamaPort}/shepherd/cli`,
_fetchConfig
)
.catch(function(error) {
console.log(error);
dispatch(
triggerToaster(
'getListUnspent',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
resolve(json.result ? json.result : json);
})
});
}
export function getRawTransaction(coin, txid) {
return new Promise((resolve, reject) => {
const payload = {
mode: null,
chain: coin,
cmd: 'getrawtransaction',
params: [
txid,
1
],
};
const _fetchConfig = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ 'payload': payload }),
};
fetch(
`http://127.0.0.1:${Config.agamaPort}/shepherd/cli`,
_fetchConfig
)
.catch(function(error) {
console.log(error);
dispatch(
triggerToaster(
'getTransaction',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
resolve(json.result ? json.result : json);
})
});
}

164
react/src/actions/actions/jumblr.js

@ -0,0 +1,164 @@
import {
triggerToaster,
getNewKMDAddresses
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
function getNewAddress(coin) { // TODO: remove(?)
return new Promise((resolve, reject) => {
const payload = {
mode: null,
chain: coin,
cmd: 'getnewaddress'
};
const _fetchConfig = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ 'payload': payload }),
};
fetch(
`http://127.0.0.1:${Config.agamaPort}/shepherd/cli`,
_fetchConfig
)
.catch(function(error) {
console.log(error);
dispatch(
triggerToaster(
'genJumblrAddress + getKMDAddressesNative',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
resolve(json.result ? json.result : json);
})
});
}
export function setJumblrAddress(coin, type, address) {
return new Promise((resolve, reject) => {
const payload = {
mode: null,
chain: coin,
cmd: type === 'deposit' ? 'jumblr_deposit' : 'jumblr_secret',
params: [address],
};
const _fetchConfig = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ 'payload': payload }),
};
fetch(
`http://127.0.0.1:${Config.agamaPort}/shepherd/cli`,
_fetchConfig
)
.catch(function(error) {
console.log(error);
dispatch(
triggerToaster(
'setJumblrAddress',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
resolve(json);
});
});
}
function dumpPrivkey(coin, key) {
return new Promise((resolve, reject) => {
const payload = {
mode: null,
chain: coin,
cmd: 'dumpprivkey',
params: [key],
};
const _fetchConfig = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ 'payload': payload }),
};
fetch(
`http://127.0.0.1:${Config.agamaPort}/shepherd/cli`,
_fetchConfig
)
.catch(function(error) {
console.log(error);
dispatch(
triggerToaster(
'dumpPrivkey ',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
resolve(json.result ? json.result : json);
})
});
}
export function importPrivkey(coin, key) {
return new Promise((resolve, reject) => {
const payload = {
mode: null,
chain: coin,
cmd: 'importprivkey',
params: [
key,
'',
false
],
};
const _fetchConfig = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ 'payload': payload }),
};
fetch(
`http://127.0.0.1:${Config.agamaPort}/shepherd/cli`,
_fetchConfig
)
.catch(function(error) {
console.log(error);
dispatch(
triggerToaster(
'importPrivkey ',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
resolve(json.result ? json.result : json);
})
});
}

1
react/src/actions/actions/log.js

@ -41,7 +41,6 @@ export function getAgamaLog(type) {
);
})
.then(response => response.json())
.then()
}
}

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

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

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

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

79
react/src/actions/actions/nativeNewAddress.js

@ -10,21 +10,7 @@ import {
guiLogState
} from './log';
function handleGetNewKMDAddresses(pubpriv, coin, dispatch, json) {
dispatch(
triggerToaster(
json.result ? json.result : json,
translate('KMD_NATIVE.NEW_ADDR_GENERATED'),
'info',
false
)
);
dispatch(getKMDAddressesNative(coin));
return {};
}
export function getNewKMDAddresses(coin, pubpriv) {
export function getNewKMDAddresses(coin, pubpriv, mode) {
let payload;
let ajaxFunctionInput = pubpriv === 'public' ? 'getnewaddress' : 'z_getnewaddress';
@ -49,14 +35,16 @@ export function getNewKMDAddresses(coin, pubpriv) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getNewKMDAddresses',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getNewKMDAddresses',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
@ -85,11 +73,13 @@ export function getNewKMDAddresses(coin, pubpriv) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getNewKMDAddresses',
@ -103,28 +93,33 @@ export function getNewKMDAddresses(coin, pubpriv) {
if (Config.cli.default) {
json = json.result;
}
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(
handleGetNewKMDAddresses(
pubpriv,
coin,
dispatch,
json
triggerToaster(
json.result ? json.result : json,
translate('KMD_NATIVE.NEW_ADDR_GENERATED'),
'info',
false
)
);
dispatch(getKMDAddressesNative(coin, mode));
})
.catch(function(ex) {
dispatch(
handleGetNewKMDAddresses(
pubpriv,
coin,
dispatch
triggerToaster(
json.result ? json.result : json,
translate('KMD_NATIVE.NEW_ADDR_GENERATED'),
'info',
false
)
);
dispatch(getKMDAddressesNative(coin, mode));
});
}
}

141
react/src/actions/actions/nativeSend.js

@ -16,8 +16,9 @@ export function sendNativeTx(coin, _payload) {
let payload;
let _apiMethod;
if (_payload.addressType === 'public' && // transparent
_payload.sendTo.length !== 95) {
// iguana core
if ((_payload.addressType === 'public' && // transparent
_payload.sendTo.length !== 95) || !_payload.sendFrom) {
_apiMethod = 'sendtoaddress';
ajaxDataToHex = `["${_payload.sendTo}", ${Number(_payload.amount) - Number(_payload.fee)}]`;
} else { // private
@ -47,27 +48,29 @@ export function sendNativeTx(coin, _payload) {
}
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'sendNativeTx',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'sendNativeTx',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
body: JSON.stringify(payload),
};
if (Config.cli.default) {
if (Config.cli.default) { // rpc
payload = {
mode: null,
chain: coin,
cmd: payload.function,
params:
_payload.addressType === 'public' && _payload.sendTo.length !== 95 ?
(_payload.addressType === 'public' && _payload.sendTo.length !== 95) || !_payload.sendFrom ?
[
_payload.sendTo,
_payload.amount
@ -97,11 +100,13 @@ export function sendNativeTx(coin, _payload) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'sendNativeTx',
@ -115,15 +120,17 @@ export function sendNativeTx(coin, _payload) {
return _response;
})
.then(function(json) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
if (json.indexOf('"code":') > -1) {
const _message = json.substring(
`${json.indexOf('"message":"')}11`,
`${json.indexOf('"message":"')}11`,
json.indexOf('"},"id":"jl777"')
);
@ -188,7 +195,7 @@ export function getKMDOPID(opid, coin) {
passthruAgent = getPassthruAgent(coin),
tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
if (passthruAgent == 'iguana') {
if (passthruAgent === 'iguana') {
payload = {
'userpass': tmpIguanaRPCAuth,
'agent': passthruAgent,
@ -208,14 +215,16 @@ export function getKMDOPID(opid, coin) {
}
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDOPID',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getKMDOPID',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
@ -244,11 +253,13 @@ export function getKMDOPID(opid, coin) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getKMDOPID',
@ -262,13 +273,59 @@ export function getKMDOPID(opid, coin) {
if (Config.cli.default) {
json = json.result;
}
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(getKMDOPIDState(json));
})
})
}
}
export function sendToAddressPromise(coin, address, amount) {
return new Promise((resolve, reject) => {
const payload = {
mode: null,
chain: coin,
cmd: 'sendtoaddress',
params: [
address,
amount,
'KMD interest claim request',
'KMD interest claim request',
true
]
};
const _fetchConfig = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ 'payload': payload }),
};
fetch(
`http://127.0.0.1:${Config.agamaPort}/shepherd/cli`,
_fetchConfig
)
.catch(function(error) {
console.log(error);
dispatch(
triggerToaster(
'sendToAddress',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
resolve(json);
})
});
}

159
react/src/actions/actions/nativeSyncInfo.js

@ -11,19 +11,21 @@ import {
} from './log';
import Config from '../../config';
export function getSyncInfoNativeKMD(skipDebug) {
export function getSyncInfoNativeKMD(skipDebug, json) {
const coin = 'KMD';
// https://www.kmd.host/
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getSyncInfoNativeKMD',
'type': 'post',
'url': Config.iguanaLessMode ? 'http://kmd.explorer.supernet.org/api/status?q=getInfo' : `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`,
'payload': '',
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getSyncInfoNativeKMD',
'type': 'post',
'url': Config.iguanaLessMode ? 'http://kmd.explorer.supernet.org/api/status?q=getInfo' : `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`,
'payload': '',
'status': 'pending',
}));
}
return fetch(
Config.iguanaLessMode ? 'http://kmd.explorer.supernet.org/api/status?q=getInfo' : `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`, {
@ -31,26 +33,32 @@ export function getSyncInfoNativeKMD(skipDebug) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
dispatch(
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
/*dispatch(
triggerToaster(
'getSyncInfoNativeKMD',
'Error',
'error'
)
);
);*/
console.warn('remote kmd node fetch failed', true);
dispatch(getSyncInfoNativeState({ 'remoteKMDNode': null }));
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': Config.iguanaLessMode ? json.info : json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': Config.iguanaLessMode ? json.info : json,
}));
}
dispatch(getSyncInfoNativeState({ 'remoteKMDNode': Config.iguanaLessMode ? json.info : json }));
})
.then(function() {
@ -66,7 +74,7 @@ function getSyncInfoNativeState(json, coin, skipDebug) {
json &&
json.error &&
json.error.message.indexOf('Activating best') === -1) {
return getSyncInfoNativeKMD(skipDebug);
return getSyncInfoNativeKMD(skipDebug, json);
} else {
if (json &&
json.error &&
@ -104,14 +112,16 @@ export function getSyncInfoNative(coin, skipDebug) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getSyncInfo',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getSyncInfo',
'type': 'post',
'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
let _fetchConfig = {
method: 'POST',
body: JSON.stringify(payload),
@ -133,11 +143,13 @@ export function getSyncInfoNative(coin, skipDebug) {
)
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getSyncInfo',
@ -151,39 +163,60 @@ export function getSyncInfoNative(coin, skipDebug) {
return _response;
})
.then(json => {
if (!json &&
Config.cli.default) {
if (json === 'Work queue depth exceeded') {
dispatch(
triggerToaster(
'Komodod is down',
'Critical Error',
'error',
true
getSyncInfoNativeState(
{ result: 'daemon is busy', error: null, id: null },
coin,
skipDebug
)
);
dispatch(getDebugLog('komodo', 50));
dispatch(toggleCoindDownModal(true));
} else {
json = JSON.parse(json);
}
if (!json &&
Config.cli.default) {
dispatch(
triggerToaster(
'Komodod is down',
'Critical Error',
'error',
true
)
);
if (json.error &&
json.error.message.indexOf('Activating best') === -1) {
dispatch(getDebugLog('komodo', 1));
}
if (coin === 'KMD') {
dispatch(getDebugLog('komodo', 50));
} else {
dispatch(getDebugLog('komodo', 50, coin));
}
dispatch(toggleCoindDownModal(true));
} else {
json = JSON.parse(json);
}
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
dispatch(
getSyncInfoNativeState(
json,
coin,
skipDebug
)
);
if (json.error &&
json.error.message.indexOf('Activating best') === -1) {
if (coin === 'KMD') {
dispatch(getDebugLog('komodo', 1));
} else {
dispatch(getDebugLog('komodo', 1, coin));
}
}
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(
getSyncInfoNativeState(
json,
coin,
skipDebug
)
);
}
})
}
}

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

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

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

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

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

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

132
react/src/actions/actions/settings.js

@ -101,14 +101,16 @@ export function importPrivKey(wifKey) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'importPrivKey',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'importPrivKey',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -116,11 +118,13 @@ export function importPrivKey(wifKey) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'importPrivKey',
@ -131,11 +135,13 @@ export function importPrivKey(wifKey) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(
parseImportPrivKeyResponse(
json,
@ -161,12 +167,16 @@ function getDebugLogState(json) {
}
}
export function getDebugLog(target, linesCount) {
export function getDebugLog(target, linesCount, acName) {
const payload = {
'herdname': target,
'lastLines': linesCount
};
if (acName) {
payload['ac'] = acName;
}
return dispatch => {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/debuglog`, {
method: 'POST',
@ -200,14 +210,16 @@ export function getPeersList(coin) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getPeersList',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'getPeersList',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -215,11 +227,13 @@ export function getPeersList(coin) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'getPeersList',
@ -230,11 +244,13 @@ export function getPeersList(coin) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(getPeersListState(json, dispatch));
})
}
@ -316,14 +332,16 @@ export function addPeerNode(coin, ip) {
return dispatch => {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'addPeerNode',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'addPeerNode',
'type': 'post',
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
}
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
@ -331,11 +349,13 @@ export function addPeerNode(coin, ip) {
})
.catch(function(error) {
console.log(error);
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
}));
}
dispatch(
triggerToaster(
'addPeerNode',
@ -346,11 +366,13 @@ export function addPeerNode(coin, ip) {
})
.then(response => response.json())
.then(json => {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
if (Config.debug) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',
'response': json,
}));
}
dispatch(addPeerNodeState(json, dispatch));
})
}

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

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

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

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

3
react/src/actions/storeType.js

@ -45,4 +45,5 @@ export const LOG_GUI_HTTP = 'LOG_GUI_HTTP';
export const CLI = 'CLI';
export const LOGOUT = 'LOGOUT';
export const DISPLAY_COIND_DOWN_MODAL = 'DISPLAY_COIND_DOWN_MODAL';
export const DISPLAY_LOGIN_SETTINGS_MODAL = 'DISPLAY_LOGIN_SETTINGS_MODAL';
export const DISPLAY_LOGIN_SETTINGS_MODAL = 'DISPLAY_LOGIN_SETTINGS_MODAL';
export const DISPLAY_CLAIM_INTEREST_MODAL = 'DISPLAY_CLAIM_INTEREST_MODAL';

0
react/src/assets/images/cryptologo/AUD.png → react/src/assets/images/cryptologo/aud.png

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

0
react/src/assets/images/cryptologo/BET.png → react/src/assets/images/cryptologo/bet.png

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

0
react/src/assets/images/cryptologo/BGN.png → react/src/assets/images/cryptologo/bgn.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
react/src/assets/images/cryptologo/BOTS.png → react/src/assets/images/cryptologo/bots.png

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

0
react/src/assets/images/cryptologo/BRL.png → react/src/assets/images/cryptologo/brl.png

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

0
react/src/assets/images/cryptologo/CAD.png → react/src/assets/images/cryptologo/cad.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
react/src/assets/images/cryptologo/CEAL.png → react/src/assets/images/cryptologo/ceal.png

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

0
react/src/assets/images/cryptologo/CHF.png → react/src/assets/images/cryptologo/chf.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
react/src/assets/images/cryptologo/CNY.png → react/src/assets/images/cryptologo/cny.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
react/src/assets/images/cryptologo/coqui.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

0
react/src/assets/images/cryptologo/CRYPTO.png → react/src/assets/images/cryptologo/crypto.png

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

0
react/src/assets/images/cryptologo/CZK.png → react/src/assets/images/cryptologo/czk.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
react/src/assets/images/cryptologo/DKK.png → react/src/assets/images/cryptologo/dkk.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
react/src/assets/images/cryptologo/EUR.png → react/src/assets/images/cryptologo/eur.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
react/src/assets/images/cryptologo/GAME.png → react/src/assets/images/cryptologo/game.png

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

0
react/src/assets/images/cryptologo/GBP.png → react/src/assets/images/cryptologo/gbp.png

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

0
react/src/assets/images/cryptologo/HKD.png → react/src/assets/images/cryptologo/hkd.png

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

0
react/src/assets/images/cryptologo/HODL.png → react/src/assets/images/cryptologo/hodl.png

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

0
react/src/assets/images/cryptologo/HRK.png → react/src/assets/images/cryptologo/hrk.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
react/src/assets/images/cryptologo/HUF.png → react/src/assets/images/cryptologo/huf.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
react/src/assets/images/cryptologo/IDR.png → react/src/assets/images/cryptologo/idr.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
react/src/assets/images/cryptologo/ILS.png → react/src/assets/images/cryptologo/ils.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
react/src/assets/images/cryptologo/INR.png → react/src/assets/images/cryptologo/inr.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
react/src/assets/images/cryptologo/JPY.png → react/src/assets/images/cryptologo/jpy.png

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

0
react/src/assets/images/cryptologo/JUMBLR.png → react/src/assets/images/cryptologo/jumblr.png

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

0
react/src/assets/images/cryptologo/komodo.png → react/src/assets/images/cryptologo/kmd.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
react/src/assets/images/cryptologo/KRW.png → react/src/assets/images/cryptologo/krw.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
react/src/assets/images/cryptologo/KV.png → react/src/assets/images/cryptologo/kv.png

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

0
react/src/assets/images/cryptologo/MESH.png → react/src/assets/images/cryptologo/mesh.png

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

0
react/src/assets/images/cryptologo/MGW.png → react/src/assets/images/cryptologo/mgw.png

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

0
react/src/assets/images/cryptologo/MVP.png → react/src/assets/images/cryptologo/mvp.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
react/src/assets/images/cryptologo/MXN.png → react/src/assets/images/cryptologo/mxn.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
react/src/assets/images/cryptologo/MYR.png → react/src/assets/images/cryptologo/myr.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
react/src/assets/images/cryptologo/NOK.png → react/src/assets/images/cryptologo/nok.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
react/src/assets/images/cryptologo/NZD.png → react/src/assets/images/cryptologo/nzd.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
react/src/assets/images/cryptologo/PANGEA.png → react/src/assets/images/cryptologo/pangea.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
react/src/assets/images/cryptologo/PHP.png → react/src/assets/images/cryptologo/php.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
react/src/assets/images/cryptologo/PLN.png → react/src/assets/images/cryptologo/pln.png

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

0
react/src/assets/images/cryptologo/REVS.png → react/src/assets/images/cryptologo/revs.png

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

0
react/src/assets/images/cryptologo/RON.png → react/src/assets/images/cryptologo/ron.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
react/src/assets/images/cryptologo/RUB.png → react/src/assets/images/cryptologo/rub.png

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

0
react/src/assets/images/cryptologo/SEK.png → react/src/assets/images/cryptologo/sek.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
react/src/assets/images/cryptologo/SGD.png → react/src/assets/images/cryptologo/sgd.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
react/src/assets/images/cryptologo/SHARK.png → react/src/assets/images/cryptologo/shark.png

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

0
react/src/assets/images/cryptologo/SUPERNET.png → react/src/assets/images/cryptologo/supernet.png

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

0
react/src/assets/images/cryptologo/THB.png → react/src/assets/images/cryptologo/thb.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
react/src/assets/images/cryptologo/TRY.png → react/src/assets/images/cryptologo/try.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
react/src/assets/images/cryptologo/WLC.png → react/src/assets/images/cryptologo/wlc.png

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

0
react/src/assets/images/cryptologo/ZAR.png → react/src/assets/images/cryptologo/zar.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

1
react/src/components/addcoin/addcoinOptionsAC.js

@ -8,6 +8,7 @@ class AddCoinOptionsAC extends React.Component {
<option value="BET|basilisk|native">BET (BET)</option>
<option value="BOTS|basilisk|native">BOTS (BOTS)</option>
<option value="CEAL|basilisk|native">CEAL NET (CEAL)</option>
<option value="COQUI|basilisk|native">COQUI (COQUI)</option>
<option value="CRYPTO|basilisk|native">CRYPTO (CRYPTO)</option>
<option value="HOD|basilisk|native">HODL (HODL)</option>
<option value="DEX|basilisk|native">InstantDEX (DEX)</option>

31
react/src/components/addcoin/payload.js

@ -1,4 +1,5 @@
// TODO: merge check functions
// move to nodejs
export function checkAC(coinVal) {
if (coinVal === 'SUPERNET' ||
@ -9,6 +10,7 @@ export function checkAC(coinVal) {
coinVal === 'JUMBLR' ||
coinVal === 'BET' ||
coinVal === 'CRYPTO' ||
coinVal === 'COQUI' ||
coinVal === 'HODL' ||
coinVal === 'SHARK' ||
coinVal === 'BOTS' ||
@ -98,6 +100,7 @@ export function checkCoinType(coin) {
coin === 'JUMBLR' ||
coin === 'BET' ||
coin === 'CRYPTO' ||
coin === 'COQUI' ||
coin === 'HODL' ||
coin === 'SHARK' ||
coin === 'BOTS' ||
@ -131,10 +134,10 @@ export function checkCoinType(coin) {
}
export function startCrypto(confpath, coin, mode) {
let tmpinternval = 0,
AddCoinData = {},
tmpPendValue = 1, // TODO: hook up to shepherd sysinfo
tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
let tmpinternval = 0;
let AddCoinData = {};
let tmpPendValue = 1; // TODO: hook up to shepherd sysinfo
let tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
if (coin !== 'BTC' &&
coin !== 'LTC' &&
@ -176,9 +179,9 @@ export function startCrypto(confpath, coin, mode) {
}
export function startCurrencyAssetChain(confpath, coin, mode) {
let AddCoinDataPayload = {},
tmpPendValue = 1,
tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
let AddCoinDataPayload = {};
let tmpPendValue = 1;
let tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
if (coin !== 'BTC' &&
coin !== 'LTC' &&
@ -702,7 +705,7 @@ export function startAssetChain(confpath, coin, mode, getSuppyOnly) {
},
'DEX': {
'name': 'DEX',
'supply': 1300000,
'supply': 999999,
'AddCoinData': confpath ? Object.assign({}, _acPayloadOrigin, {"coin":"DEX","conf":"DEX.conf","path":confpath,"RELAY":-1,"VALIDATE":1,"startpend":4,"endpend":4,"maxpeers":8,"newcoin":"DEX","name":"DEX","netmagic":"f2ae0516","p2p":9502,"rpc":9503}) : {},
'AddCoinDataVar': Object.assign({}, _acPayloadOrigin, {'userpass':tmpIguanaRPCAuth,"RELAY":mode,"VALIDATE":mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"maxpeers":8,"newcoin":"DEX","name":"DEX","netmagic":"f2ae0516","p2p":9502,"rpc":9503})
},
@ -726,7 +729,7 @@ export function startAssetChain(confpath, coin, mode, getSuppyOnly) {
},
'HODL': {
'name': 'HODL',
'supply': 999999,
'supply': 9999999,
'AddCoinData': confpath ? Object.assign({}, _acPayloadOrigin, {"coin":"HODL","conf":"HODL.conf","path":confpath,"RELAY":-1,"VALIDATE":1,"startpend":4,"endpend":4,"maxpeers":8,"newcoin":"HODL","name":"HODL","netmagic":"9b13fb5f","p2p":8009,"rpc":8010}) : {},
'AddCoinDataVar': Object.assign({}, _acPayloadOrigin, {'userpass':tmpIguanaRPCAuth,"RELAY":mode,"VALIDATE":mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"maxpeers":8,"newcoin":"HODL","name":"HODL","netmagic":"9b13fb5f","p2p":8009,"rpc":8010})
},
@ -756,7 +759,7 @@ export function startAssetChain(confpath, coin, mode, getSuppyOnly) {
},
'KV': {
'name': 'KV',
'supply': 999999,
'supply': 1000000,
'AddCoinData': confpath ? Object.assign({}, _acPayloadOrigin, {"coin":"KV","conf":"KV.conf","path":confpath,"RELAY":-1,"VALIDATE":1,"startpend":4,"endpend":4,"maxpeers":8,"newcoin":"KV","name":"KV","netmagic":"b09a2d65","p2p":9746,"rpc":9747}) : {},
'AddCoinDataVar': Object.assign(_acPayloadOrigin, {'userpass':tmpIguanaRPCAuth,"RELAY":mode,"VALIDATE":mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"maxpeers":8,"newcoin":"KV","name":"KV","netmagic":"b09a2d65","p2p":9746,"rpc":9747})
},
@ -768,9 +771,15 @@ export function startAssetChain(confpath, coin, mode, getSuppyOnly) {
},
'MESH': {
'name': 'MESH',
'supply': 1000000,
'supply': 1000007,
'AddCoinData': confpath ? Object.assign({}, _acPayloadOrigin, {"coin":"MESH","conf":"MESH.conf","path":confpath,"RELAY":-1,"VALIDATE":1,"startpend":4,"endpend":4,"maxpeers":8,"newcoin":"MESH","name":"MESH","netmagic":"f0265c67","p2p":8399,"rpc":8400}) : {},
'AddCoinDataVar': Object.assign({}, _acPayloadOrigin, {'userpass':tmpIguanaRPCAuth,"RELAY":mode,"VALIDATE":mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"maxpeers":8,"newcoin":"MESH","name":"MESH","netmagic":"f0265c67","p2p":8399,"rpc":8400})
},
'COQUI': {
'name': 'COQUI',
'supply': 72000000,
'AddCoinData': confpath ? Object.assign({}, _acPayloadOrigin, {"coin":"COQUI","conf":"COQUI.conf","path":confpath,"RELAY":-1,"VALIDATE":1,"startpend":4,"endpend":4,"maxpeers":8,"newcoin":"COQUI","name":"COQUI","netmagic":"4cbd5ef4","p2p":14275,"rpc":14276}) : {},
'AddCoinDataVar': Object.assign({}, _acPayloadOrigin, {'userpass':tmpIguanaRPCAuth,"RELAY":mode,"VALIDATE":mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"maxpeers":8,"newcoin":"COQUI","name":"COQUI","netmagic":"4cbd5ef4","p2p":14275,"rpc":14276})
}
};

136
react/src/components/dashboard/claimInterestModal/claimInterestModal.js

@ -0,0 +1,136 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Store from '../../../store';
import {
toggleClaimInterestModal,
getListUnspent,
getRawTransaction,
copyString,
sendToAddressPromise,
triggerToaster
} from '../../../actions/actionCreators';
import { translate } from '../../../translate/translate';
import {
ClaimInterestModalRender,
_ClaimInterestTableRender
} from './claimInterestModal.render';
class ClaimInterestModal extends React.Component {
constructor(props) {
super(props);
this.state = {
open: false,
isLoading: true,
transactionsList: [],
showZeroInterest: true,
};
this.claimInterestTableRender = this.claimInterestTableRender.bind(this);
this.toggleZeroInterest = this.toggleZeroInterest.bind(this);
this.loadListUnspent = this.loadListUnspent.bind(this);
this.checkTransactionsListLength = this.checkTransactionsListLength.bind(this);
}
componentWillMount() {
this.loadListUnspent();
}
loadListUnspent() {
let _transactionsList = [];
getListUnspent(this.props.ActiveCoin.coin)
.then((json) => {
if (json &&
json.length) {
for (let i = 0; i < json.length; i++) {
getRawTransaction(this.props.ActiveCoin.coin, json[i].txid)
.then((_json) => {
_transactionsList.push({
address: json[i].address,
locktime: _json.locktime,
amount: json[i].amount,
interest: json[i].interest,
txid: json[i].txid,
});
if (i === json.length - 1) {
this.setState({
transactionsList: _transactionsList,
isLoading: false,
});
}
});
}
}
});
}
claimInterest(address, amount) {
sendToAddressPromise(this.props.ActiveCoin.coin, this.state.transactionsList[0].address, this.props.ActiveCoin.balance.transparent)
.then((json) => {
if (json.error &&
json.error.code) {
Store.dispatch(
triggerToaster(
json.error.message,
'Error',
'error'
)
);
} else if (json.result && json.result.length && json.result.length === 64) {
Store.dispatch(
triggerToaster(
`Your full balance is sent to address ${this.state.transactionsList[0].address}. Check back your new balance in a few minutes.`,
translate('TOASTR.WALLET_NOTIFICATION'),
'success',
false
)
);
}
});
}
checkTransactionsListLength() {
if (this.state.transactionsList && this.state.transactionsList.length) {
return true;
} else if (!this.state.transactionsList || !this.state.transactionsList.length) {
return false;
}
}
toggleZeroInterest() {
this.setState({
showZeroInterest: !this.state.showZeroInterest,
});
}
copyTxId(txid) {
Store.dispatch(copyString(txid, 'Transaction ID copied'));
}
claimInterestTableRender() {
return _ClaimInterestTableRender.call(this);
}
componentWillReceiveProps(props) {
if (props.Dashboard.displayClaimInterestModal !== this.state.open) {
this.setState({
open: props.Dashboard.displayClaimInterestModal,
});
}
if (!this.state.open &&
props.Dashboard.displayClaimInterestModal) {
this.loadListUnspent();
}
}
closeModal() {
Store.dispatch(toggleClaimInterestModal(false));
}
render() {
return ClaimInterestModalRender.call(this);
}
}
export default ClaimInterestModal;

132
react/src/components/dashboard/claimInterestModal/claimInterestModal.render.js

@ -0,0 +1,132 @@
import React from 'react';
import { translate } from '../../../translate/translate';
const MIN_INTEREST_THRESHOLD = 0.001;
export const _ClaimInterestTableRender = function() {
const _transactionsList = this.state.transactionsList;
let _items = [];
for (let i = 0; i < _transactionsList.length; i++) {
if ((_transactionsList[i].interest === 0 && this.state.showZeroInterest) || (_transactionsList[i].amount > 0 && _transactionsList[i].interest > 0)) {
_items.push(
<tr key={ `${_transactionsList[i].txid}${_transactionsList[i].address}` }>
<td>
<button
className="btn btn-default btn-xs clipboard-edexaddr copy-string-btn"
title={ translate('INDEX.COPY_TO_CLIPBOARD') }
onClick={ () => this.copyTxId(_transactionsList[i].txid) }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button>
</td>
<td>{ _transactionsList[i].address }</td>
<td className={ _transactionsList[i].amount > 10 ? 'green bold' : '' }>{ _transactionsList[i].amount }</td>
<td>{ _transactionsList[i].interest }</td>
<td className="locktime center">
{ _transactionsList[i].locktime &&
<i className="fa-check-circle green"></i>
}
{ !_transactionsList[i].locktime &&
<i className="fa-exclamation-circle red"></i>
}
</td>
</tr>
);
}
}
return (
<span>
<div className="padding-bottom-20">
<strong>Requirements to accrue interest:</strong> locktime field is set and amount is greater than <strong>10 KMD</strong>
</div>
<div className="text-left padding-top-10 padding-bottom-10">
<label className="switch">
<input
type="checkbox"
checked={ this.state.showZeroInterest } />
<div
className="slider"
onClick={ this.toggleZeroInterest }></div>
</label>
<div
className="toggle-label margin-right-15 pointer"
onClick={ this.toggleZeroInterest }>
Show zero interest
</div>
</div>
<button
type="button"
className="btn btn-success waves-effect waves-light claim-btn"
onClick={ () => this.claimInterest() }>
<i className="icon fa-dollar"></i> Claim interest
</button>
<div className="table-scroll">
<table className="table table-hover dataTable table-striped">
<thead>
<tr>
<th></th>
<th>Address</th>
<th>Amount</th>
<th>Interest</th>
<th>Locktime</th>
</tr>
</thead>
<tbody>
{ _items }
</tbody>
<tfoot>
<tr>
<th></th>
<th>Address</th>
<th>Amount</th>
<th>Interest</th>
<th>Locktime</th>
</tr>
</tfoot>
</table>
</div>
</span>
);
};
export const ClaimInterestModalRender = function() {
return (
<span>
<div className={ 'modal modal-claim-interest modal-3d-sign ' + (this.state.open ? 'show in' : 'fade hide') }>
<div className="modal-dialog modal-center modal-sm">
<div className="modal-content">
<div className="modal-header bg-orange-a400 wallet-send-header">
<button
type="button"
className="close white"
onClick={ this.closeModal }>
<span>×</span>
</button>
<h4 className="modal-title white text-left">Claim interest</h4>
</div>
<div className="modal-body">
<i
className="icon fa-refresh pointer refresh-icon"
onClick={ this.loadListUnspent }></i>
<div className="animsition vertical-align fade-in">
<div className="page-content vertical-align-middle full-width">
{ this.state.isLoading &&
<span>Loading interest data...</span>
}
{ !this.state.isLoading && this.checkTransactionsListLength() &&
<div>{ this.claimInterestTableRender() }</div>
}
{ !this.state.isLoading && !this.checkTransactionsListLength() &&
<div>No data</div>
}
</div>
</div>
</div>
</div>
</div>
</div>
<div className={ 'modal-backdrop ' + (this.state.open ? 'show in' : 'fade hide') }></div>
</span>
);
};

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

@ -76,7 +76,7 @@ class CoinTileItem extends React.Component {
const useAddress = this.props.ActiveCoin.mainBasiliskAddress ? this.props.ActiveCoin.mainBasiliskAddress : this.props.Dashboard.activeHandle[coin];
Store.dispatch(iguanaActiveHandle(true));
Store.dispatch(
getKMDAddressesNative(
coin,
@ -107,6 +107,16 @@ class CoinTileItem extends React.Component {
dashboardChangeActiveCoin(coin, mode) {
if (coin !== this.props.ActiveCoin.coin) {
Store.dispatch(dashboardChangeActiveCoin(coin, mode));
setTimeout(() => {
this.dispatchCoinActions(coin, mode);
}, 100);
if (mode === 'native') { // faster coin data load if fully synced
setTimeout(() => {
this.dispatchCoinActions(coin, mode);
}, 1000);
}
Store.dispatch(
stopInterval(
'sync',
@ -121,10 +131,6 @@ class CoinTileItem extends React.Component {
)
);
Store.dispatch(dashboardChangeActiveCoin(coin, mode));
this.dispatchCoinActions(coin, mode);
if (mode === 'full') {
const _iguanaActiveHandle = setInterval(() => {
this.dispatchCoinActions(coin, mode);
@ -140,13 +146,14 @@ class CoinTileItem extends React.Component {
if (mode === 'native') {
const _iguanaActiveHandle = setInterval(() => {
this.dispatchCoinActions(coin, mode);
}, coin === 'KMD' ? IGUNA_ACTIVE_HANDLE_TIMEOUT_KMD_NATIVE : IGUNA_ACTIVE_HANDLE_TIMEOUT);
}, IGUNA_ACTIVE_HANDLE_TIMEOUT_KMD_NATIVE);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
}
if (mode === 'basilisk') {
const _activeHandle = this.props.Dashboard.activeHandle;
const _basiliskMainAddress = _activeHandle[coin] || JSON.parse(sessionStorage.getItem('IguanaActiveAccount'))[coin];
Store.dispatch(changeActiveAddress(_basiliskMainAddress));
if (_basiliskMainAddress) {
@ -178,7 +185,7 @@ class CoinTileItem extends React.Component {
_iguanaActiveHandle
)
);
Store.dispatch(
startInterval(
'basilisk',

2
react/src/components/dashboard/coinTile/coinTileItem.render.js

@ -12,7 +12,7 @@ const CoinTileItemRender = function() {
<a className="avatar margin-bottom-5">
<img
className="img-responsive"
src={ `assets/images/cryptologo/${item.coinlogo}.png` }
src={ `assets/images/cryptologo/${item.coinlogo.toLowerCase()}.png` }
alt={ item.coinname }/>
<span className={ `badge up badge-${item.modecolor}` }>
{ item.modecode }

2
react/src/components/dashboard/coindDownModal/coindDownModal.render.js

@ -16,7 +16,7 @@ const CoindDownModalRender = function () {
onClick={ this.dismiss }>
<span>×</span>
</button>
<h4 className="modal-title white">Komodod is down!</h4>
<h4 className="modal-title white">{ this.props.ActiveCoin.coin === 'KMD' ? 'Komodod' : `Komodod / ${this.props.ActiveCoin.coin}` } is down!</h4>
</div>
<div className="modal-body">
<div className="vertical-align text-center">

387
react/src/components/dashboard/jumblr/jumblr.js

@ -1,14 +1,391 @@
import React from 'react';
import { translate } from '../../../translate/translate';
import {
dashboardChangeActiveCoin,
getKMDAddressesNative,
startInterval,
stopInterval,
triggerToaster,
setJumblrAddress,
importPrivkey,
copyCoinAddress,
copyString
} from '../../../actions/actionCreators';
import Store from '../../../store';
import Config from '../../../config';
import {
JumblrRender,
JumblrRenderSecretAddressList
} from './jumblr.render';
import { PassPhraseGenerator } from '../../../util/crypto/passphrasegenerator';
import JumblrRender from './jumblr.render';
// import gen komodo keys utils
import '../../../util/crypto/gen/array.map.js';
import '../../../util/crypto/gen/cryptojs.js';
import '../../../util/crypto/gen/cryptojs.sha256.js';
import '../../../util/crypto/gen/cryptojs.pbkdf2.js';
import '../../../util/crypto/gen/cryptojs.hmac.js';
import '../../../util/crypto/gen/cryptojs.aes.js';
import '../../../util/crypto/gen/cryptojs.blockmodes.js';
import '../../../util/crypto/gen/cryptojs.ripemd160.js';
import '../../../util/crypto/gen/securerandom.js';
import '../../../util/crypto/gen/ellipticcurve.js';
import '../../../util/crypto/gen/biginteger.js';
import '../../../util/crypto/gen/crypto-scrypt.js';
import { Bitcoin } from '../../../util/crypto/gen/bitcoin.js';
if (!window.jumblrPasshrase) { // gen jumblr passphrase
window.jumblrPasshrase = 'jumblr ' + PassPhraseGenerator.generatePassPhrase(256);
}
class Jumblr extends React.Component {
constructor(props) {
super(props);
this.state = {
activeTab: 0,
randomSeed: window.jumblrPasshrase,
jumblrDepositAddress: null,
jumblrDepositAddressPBased: true,
jumblrSecretAddressShow: true,
jumblrSecretAddress: [],
jumblrSecretAddressImport: [],
jumblrSecretAddressCountImport: 0,
jumblrSecretAddressShowImport: true,
jumblrSecretAddressCount: 0,
jumblrMode: 'public',
secretAddressCount: 1,
secretAddressCountImport: 1,
jumblrPassphraseImport: '',
};
this.generateJumblrDepositAddress = this.generateJumblrDepositAddress.bind(this);
this.generateJumblrSecretAddress = this.generateJumblrSecretAddress.bind(this);
this.checkJumblrSecretAddressListLength = this.checkJumblrSecretAddressListLength.bind(this);
this.returnPassphrase = this.returnPassphrase.bind(this);
this.generateKeys = this.generateKeys.bind(this);
this._copyCoinAddress = this._copyCoinAddress.bind(this);
this.copyPassphrase = this.copyPassphrase.bind(this);
this.checkPassphraseValid = this.checkPassphraseValid.bind(this);
this.importJumblrSecretAddress = this.importJumblrSecretAddress.bind(this);
this.onChange = this.onChange.bind(this);
}
generateKeys(passphrase) {
if (!passphrase) {
const key = new Bitcoin.ECKey(false).setCompressed(true);
const kmdAddress = key.getBitcoinAddress();
const wifAddress = key.getBitcoinWalletImportFormat();
return {
address: kmdAddress,
wif: wifAddress,
};
} else {
const bytes = Crypto.SHA256(passphrase, { asBytes: true });
const btcKey = new Bitcoin.ECKey(bytes).setCompressed(true);
const kmdAddress = btcKey.getBitcoinAddress();
const wifAddress = btcKey.getBitcoinWalletImportFormat();
return {
address: kmdAddress,
wif: wifAddress,
};
}
}
_JumblrRenderSecretAddressList(type) {
return JumblrRenderSecretAddressList.call(this, type);
}
onChange(e) {
const regex = /^[0-9\b]+$/;
if (e.target.value === '' ||
regex.test(e.target.value)) {
this.setState({
[e.target.name]: e.target.value,
});
}
}
passphraseOnChange(e) {
this.setState({
[e.target.name]: e.target.value,
});
}
returnPassphrase() {
this.setState({
randomSeed: window.jumblrPasshrase,
});
}
toggle(prop) {
const _prop = this.state[prop];
this.setState({
[prop]: !_prop,
});
}
/*toggleAddressGenMod() {
this.setState({
jumblrDepositAddressPBased: !this.state.jumblrDepositAddressPBased,
});
}*/
generateJumblrSecretAddress() {
let _jumblrSecretAddress = [];
let _apiSuccessCount = 0;
if (this.state.secretAddressCount === '') {
Store.dispatch(
triggerToaster(
'Enter a correct address count value',
'Jumblr',
'error'
)
);
} else {
for (let i = 0; i < this.state.secretAddressCount; i++) {
let _genKeys;
if (this.state.jumblrDepositAddressPBased) {
let _postfix;
if (i < 9) {
_postfix = `00${i + 1}`;
} else if (i > 10 && i < 100) {
_postfix = `0${i + 1}`;
}
_genKeys = this.generateKeys(`${this.state.randomSeed} ${_postfix}`);
// console.warn(`${this.state.randomSeed} ${_postfix}`);
} else {
_genKeys = this.generateKeys();
}
setJumblrAddress(this.props.ActiveCoin.coin, 'secret', _genKeys.address)
.then((json) => {
if (json.error &&
json.error.code) {
Store.dispatch(
triggerToaster(
json.error.message,
'Error',
'error'
)
);
} else if (json.result && json.result.result && json.result.result === 'success') {
_jumblrSecretAddress.push(_genKeys);
this.setState(Object.assign({}, this.state, {
jumblrSecretAddress: _jumblrSecretAddress,
}));
if (_apiSuccessCount === this.state.secretAddressCount - 1) {
Store.dispatch(
triggerToaster(
this.state.secretAddressCount > 1 ? 'Jumblr secret addresses are set' : 'Jumblr secret address is set',
'Jumblr',
'success'
)
);
}
_apiSuccessCount++;
}
});
}
}
}
checkPassphraseValid() { // test passphrase validity
const _passphrase = this.state.jumblrPassphraseImport;
const _jumblrPrefix = _passphrase.substring(0, 6);
const _passphraseWords = _passphrase.substring(6, _passphrase.length);
let _errors = {
prefix: false, // jumblr
length: false, // 24
};
if (_jumblrPrefix !== 'jumblr') {
_errors.prefix = true;
}
try {
const _passphraseWordsSplit = _passphraseWords.split(' ');
let _correctWords = 0;
if (_passphraseWordsSplit &&
_passphraseWordsSplit.length) {
for (let i = 0; i < _passphraseWordsSplit.length; i++) {
if (_passphraseWordsSplit[i].length > 2) {
_correctWords++;
}
}
if (_correctWords !== _passphraseWordsSplit.length - 1 || _correctWords !== 24) {
_errors.length = true;
}
} else {
_errors.length = true;
}
} catch(e) {
_errors.length = true;
}
if (_errors.length ||
_errors.prefix) {
Store.dispatch(
triggerToaster(
'Provided passphrase has wrong format',
'Jumblr',
'error',
false
)
);
return false;
}
return true;
}
importJumblrSecretAddress() {
let _jumblrSecretAddress = [];
let _apiSuccessCount = 0;
if (this.state.secretAddressCountImport === '') {
Store.dispatch(
triggerToaster(
'Enter a correct address count value',
'Jumblr',
'error'
)
);
} else {
if (this.checkPassphraseValid()) {
for (let i = 0; i < this.state.secretAddressCountImport; i++) {
let _genKeys;
if (this.state.jumblrDepositAddressPBased) {
let _postfix;
if (i < 9) {
_postfix = `00${i + 1}`;
} else if (i > 10 && i < 100) {
_postfix = `0${i + 1}`;
}
_genKeys = this.generateKeys(`${this.state.jumblrPassphraseImport} ${_postfix}`);
} else {
_genKeys = this.generateKeys();
}
importPrivkey(this.props.ActiveCoin.coin, _genKeys.wif)
.then((json) => {
if (!json.id && !json.result && !json.error) {
_jumblrSecretAddress.push(_genKeys);
this.setState(Object.assign({}, this.state, {
jumblrSecretAddressImport: _jumblrSecretAddress,
}));
if (_apiSuccessCount === this.state.secretAddressCountImport - 1) {
Store.dispatch(
triggerToaster(
this.state.secretAddressCountImport > 1 ? 'Jumblr secret addresses imported' : 'Jumblr secret address imported',
'Jumblr',
'success'
)
);
}
_apiSuccessCount++;
} else {
Store.dispatch(
triggerToaster(
json.error.message,
'Error',
'error'
)
);
}
});
}
}
}
}
checkJumblrSecretAddressListLength(type) {
if (type === 'gen') {
if (this.state.jumblrSecretAddress &&
this.state.jumblrSecretAddress.length) {
return true;
} else {
return false;
}
} else {
if (this.state.jumblrSecretAddressImport &&
this.state.jumblrSecretAddressImport.length) {
return true;
} else {
return false;
}
}
}
generateJumblrDepositAddress() {
let _genKeys;
if (this.state.jumblrDepositAddressPBased) {
_genKeys = this.generateKeys(this.state.randomSeed);
} else {
_genKeys = this.generateKeys();
}
importPrivkey(this.props.ActiveCoin.coin, _genKeys.wif)
.then((json) => {
if (!json.id && !json.result && !json.error) {
// console.warn('importPrivkey', json);
setJumblrAddress(this.props.ActiveCoin.coin, 'deposit', _genKeys.address)
.then((json) => {
if (json.error &&
json.error.code) {
Store.dispatch(
triggerToaster(
json.error.message,
'Error',
'error'
)
);
} else if (json.result && json.result.result === 0) {
this.setState(Object.assign({}, this.state, {
jumblrDepositAddress: {
address: _genKeys.address,
wif: _genKeys.wif,
},
}));
Store.dispatch(
triggerToaster(
'Jumblr deposit address is set',
'Jumblr',
'success'
)
);
}
});
} else {
Store.dispatch(
triggerToaster(
json.error.message,
'Error',
'error'
)
);
}
});
}
switchJumblrMode(mode) {
this.setState(Object.assign({}, this.state, {
jumblrMode: mode,
activeTab: 0,
}));
}
openTab(tab) {
@ -17,6 +394,14 @@ class Jumblr extends React.Component {
}));
}
_copyCoinAddress(address) {
Store.dispatch(copyCoinAddress(address));
}
copyPassphrase() {
Store.dispatch(copyString(this.state.randomSeed, 'Passphrase copied'));
}
renderLB(_translationID) {
const _translationComponents = translate(_translationID).split('<br>');

593
react/src/components/dashboard/jumblr/jumblr.render.js

@ -2,10 +2,52 @@ import React from 'react';
import { translate } from '../../../translate/translate';
import WalletsHeader from '../walletsHeader/walletsHeader';
import WalletsNativeSend from '../walletsNativeSend/walletsNativeSend';
import ReceiveCoin from '../receiveCoin/receiveCoin';
const JumblrRender = function() {
export const JumblrRenderSecretAddressList = function(type) {
const _jumblrAddressList = type === 'gen' ? this.state.jumblrSecretAddress : this.state.jumblrSecretAddressImport;
let _items = [];
if (_jumblrAddressList &&
_jumblrAddressList.length) {
for (let i = 0; i < _jumblrAddressList.length; i++) {
_items.push(
<tr key={ `jumblr-secret-address-${i}` }>
<td>{ _jumblrAddressList[i].address }</td>
<td>{ _jumblrAddressList[i].wif }</td>
</tr>
);
}
return _items;
} else {
return null;
}
};
/* passphrase toggle
<div className={ 'toggle-box padding-top-20 padding-bottom-' + (this.state.jumblrDepositAddressPBased ? '10' : '30') }>
<span className="pointer">
<label className="switch">
<input
type="checkbox"
checked={ this.state.jumblrDepositAddressPBased } />
<div
className="slider"
onClick={ () => this.toggleAddressGenMod() }></div>
</label>
<div
className="toggle-label"
onClick={ () => this.toggleAddressGenMod() }>
Passphrase based address
</div>
</span>
</div>
*/
export const JumblrRender = function() {
return (
<div className="page margin-left-0">
<div className="page margin-left-0 jumblr">
<WalletsHeader activeSection="jumblr" />
<div className="page-content margin-top-30">
<div className="row">
@ -32,87 +74,135 @@ const JumblrRender = function() {
<span>×</span>
</button>
<span className="jumblr-header">
<i className="icon fa-paw"></i> { translate('JUMBLR.NEED_NATIVE') }
<i className="icon fa-paw"></i> About Jumblr
</span>
<br />
{ translate('JUMBLR.TO_USE_JUMBLR') }
<br />
{ translate('JUMBLR.IF_YOU_ALREADY_RUNNING') }
<p>
Jumblr functions all locally which means no middle man is required to jumble your funds. You take control over the whole process.
</p>
<p>
<strong>Tip:</strong> to achive maximum anonimity setup Jumblr node on a dedicated piece of hardware (laptop or VPS), use a separate IP address for main Jumblr node.
</p>
</div>
</div>
<div className="col-xlg-12 col-md-12">
<p>{ translate('JUMBLR.THIS_SCREEN_DOESNT_REFRESH') }</p>
<div className="col-xlg-12 col-md-12 padding-top-20 padding-bottom-30">
<div
className="form-group col-lg-2 col-md-2 col-sm-2 col-xs-2"
style={{ padding: 0 }}>
<input
type="radio"
className="to-labelauty labelauty"
name={ `mode-public` }
id={ `mode-public` }
checked={ this.state.jumblrMode === 'public' ? true : false } />
<label
htmlFor={ `mode-public` }
style={{ margin: 0 }}
onClick={ () => this.switchJumblrMode('public') }>
<span
className="labelauty-unchecked-image"
style={{ display: this.state.jumblrMode === 'public' ? 'none' : 'inline-block' }}></span>
<span
className="labelauty-unchecked"
style={{ display: this.state.jumblrMode === 'public' ? 'none' : 'inline-block' }}>
Public node
</span>
<span
className="labelauty-checked-image"
style={{ display: this.state.jumblrMode === 'public' ? 'inline-block' : 'none' }}></span>
<span
className="labelauty-checked"
style={{ display: this.state.jumblrMode === 'public' ? 'inline-block' : 'none' }}>
Public node
</span>
</label>
</div>
<div
className="form-group col-lg-2 col-md-2 col-sm-2 col-xs-2"
style={{ padding: 0 }}>
<input
type="radio"
className="to-labelauty labelauty"
name={ `mode-private` }
id={ `mode-private` }
checked={ this.state.jumblrMode === 'private' ? true : false } />
<label
htmlFor={ `mode-private` }
style={{ margin: 0 }}
onClick={ () => this.switchJumblrMode('private') }>
<span
className="labelauty-unchecked-image"
style={{ display: this.state.jumblrMode === 'private' ? 'none' : 'inline-block' }}></span>
<span
className="labelauty-unchecked"
style={{ display: this.state.jumblrMode === 'private' ? 'none' : 'inline-block' }}>
Private node
</span>
<span
className="labelauty-checked-image"
style={{ display: this.state.jumblrMode === 'private' ? 'inline-block' : 'none' }}></span>
<span
className="labelauty-checked"
style={{ display: this.state.jumblrMode === 'private' ? 'inline-block' : 'none' }}>
Private node
</span>
</label>
</div>
</div>
<div className="col-xs-12">
<div className="panel-group">
<div className="panel">
<div
className="panel-heading"
onClick={ () => this.openTab(0) }>
<a className={ this.state.activeTab === 0 ? 'panel-title' : 'panel-title collapsed' }>{ translate('JUMBLR.FEW_SECURITY_NOTES') }</a>
</div>
<div className={ this.state.activeTab === 0 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }>
<div className="panel-body">
<ul>
<li>{ translate('JUMBLR.FEW_SECURITY_NOTES_DESC1') }</li>
<li>{ translate('JUMBLR.FEW_SECURITY_NOTES_DESC2') }</li>
<li>{ translate('JUMBLR.FEW_SECURITY_NOTES_DESC3') }</li>
<li>{ translate('JUMBLR.FEW_SECURITY_NOTES_DESC4') }</li>
<li>{ translate('JUMBLR.FEW_SECURITY_NOTES_DESC5') }</li>
</ul>
</div>
</div>
</div>
<div className="panel">
<div
className="panel-heading"
onClick={ () => this.openTab(1) }>
<a className={ this.state.activeTab === 1 ? 'panel-title' : 'panel-title collapsed' }>{ translate('JUMBLR.ACCESS_JUMBLR_FUNDS') }</a>
</div>
<div className={ this.state.activeTab === 1 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }>
<div className="panel-body">
<p>{ translate('JUMBLR.ADDRESS_ACCESSIBLE_EASILY') }</p>
<ul>
<code>duck dog cat donkey</code>
</ul>
<ol>
<li>{ translate('JUMBLR.TO_ACCESS') }</li>
<li>{ translate('JUMBLR.CLOSE_IAPP') }</li>
<li>{ translate('JUMBLR.START_IAPP') }</li>
<li>{ translate('JUMBLR.START_KMD') }</li>
<li>{ translate('JUMBLR.ACCESS_JUMBLR_FUNDS') }
<ul>
<li>{ translate('JUMBLR.SMALL_LETTERS') }</li>
<li>{ translate('JUMBLR.WHITE_SPACE') }</li>
</ul>
</li>
<li>
{ translate('JUMBLR.PER_EXAMPLE') }
<br />
<code>jumblr duck dog cat donkey</code>
</li>
<li>{ translate('JUMBLR.LOGIN_WITH_JUMBLR') }</li>
</ol>
<h4>{ translate('JUMBLR.AGAIN_DONT_SHARE') }</h4>
</div>
</div>
</div>
<div className="panel">
<div
className="panel-heading"
onClick={ () => this.openTab(2) }>
<a className={ this.state.activeTab === 2 ? 'panel-title' : 'panel-title collapsed' }>{ translate('JUMBLR.USING_JUMBLR') }</a>
<div className="col-xlg-12 col-md-12">
{ this.state.jumblrMode === 'public' &&
<div className="jumblr-mode-selector nav-tabs-horizontal nav-tabs-inverse">
<div className="img-responsive">
<span className="coin">{ this.props.ActiveCoin.coin }</span>
<img
className="image"
src={ `assets/images/cryptologo/${this.props.ActiveCoin.coin.toLowerCase()}.png` }
alt={ this.props.ActiveCoin.coin }/>
</div>
<div className={ this.state.activeTab === 2 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }>
<div className="panel-body">
<ul className="nav nav-tabs">
<li
className={ this.state.activeTab === 0 ? 'active' : '' }
onClick={ () => this.openTab(0) }>
<a>
{ translate('JUMBLR.USING_JUMBLR') }
</a>
</li>
<li
className={ this.state.activeTab === 1 ? 'active' : '' }
onClick={ () => this.openTab(1) }>
<a>
Deposit address
</a>
</li>
<li
className={ this.state.activeTab === 2 ? 'active' : '' }
onClick={ () => this.openTab(2) }>
<a>
Secret address
</a>
</li>
<li
className={ this.state.activeTab === 3 ? 'active' : '' }
onClick={ () => this.openTab(3) }>
<a>
Deposit funds
</a>
</li>
</ul>
<div className="tab-content padding-20">
<div className={ 'tab-pane' + (this.state.activeTab === 0 ? ' active' : '') }>
<button
type="button"
className="btn btn-success waves-effect waves-light margin-top-20 btn-next"
onClick={ () => this.openTab(1) }>Next</button>
<h5>How to use Jumblr</h5>
<ul>
<li>{ translate('JUMBLR.RUN_KMD') }</li>
<li>{ translate('JUMBLR.LOGIN_KMD') }</li>
<li>{ translate('JUMBLR.GO_TO') }</li>
<li>{ translate('JUMBLR.FIND_DEPOSIT_ADDR') }</li>
<li>{ translate('JUMBLR.YOU_SEND_FUNDS') }</li>
<li>Create deposit address</li>
<li>Create secret address</li>
<li>Send funds to deposit address</li>
<li>{ translate('JUMBLR.KEEP_WALLET_OPEN') }</li>
<li>{ translate('JUMBLR.IMPORTANT_FUNDS') }</li>
<li>{ translate('JUMBLR.LARGE_LOT') }</li>
@ -122,105 +212,276 @@ const JumblrRender = function() {
<p>{ translate('JUMBLR.TO_CLEAR_THEM') }</p>
<p>{ translate('JUMBLR.WHEN_IT_TOTALS') }</p>
</div>
</div>
</div>
</div>
</div>
<div className="col-xlg-12 col-md-12">
<h4 className="font-size-14 text-uppercase">{ translate('JUMBLR.JADDR') }</h4>
<div className="panel">
<div className="table-responsive">
<table className="table table-striped">
<tbody>
<tr>
<td width="20%">{ translate('JUMBLR.BTC_DEPOSIT') }</td>
<td>
<span></span>
</td>
</tr>
<tr>
<td>BTC Jumblr</td>
<td>
<div className={ 'tab-pane' + (this.state.activeTab === 1 ? ' active' : '') }>
<button
type="button"
className="btn btn-success waves-effect waves-light btn-next"
onClick={ () => this.openTab(2) }>Next</button>
<h5>{ translate('JUMBLR.FEW_SECURITY_NOTES') }</h5>
<div className="col-xs-12 nofloat">
<ul className="padding-bottom-20">
<li>{ translate('JUMBLR.FEW_SECURITY_NOTES_DESC1') }</li>
<li>{ translate('JUMBLR.FEW_SECURITY_NOTES_DESC2') }</li>
<li>{ translate('JUMBLR.FEW_SECURITY_NOTES_DESC3') }</li>
<li>{ translate('JUMBLR.FEW_SECURITY_NOTES_DESC4') }</li>
<li>{ translate('JUMBLR.FEW_SECURITY_NOTES_DESC5') }</li>
</ul>
</div>
{ this.state.jumblrDepositAddressPBased &&
<div className="padding-bottom-30">
<div className="padding-bottom-20">
<p>
<strong>Please write down your Jumblr passphrase and keept it safe.</strong>
</p>
<p>This is your main recovery passphrase.</p>
<p>All Jumblr addresses can be regenrated based on it.</p>
<p>
<strong>Tip:</strong> do not use smart editors to store your passphrase as they tend to add extra characters.<br />This may result in passphrase mismatch with the original passphrase.
</p>
</div>
<label>Passphrase</label>
<input
type="text"
className="form-control"
name="loginPassphrase"
onChange={ this.returnPassphrase }
value={ this.state.randomSeed } />
<button
type="button"
className="btn btn-animate btn-animate-side btn-default btn-sm waves-effect waves-light">
<span>
<i className="icon fa-eye"></i> { translate('JUMBLR.SHOW_HIDE') }
</span>
className="btn btn-default btn-xs clipboard-edexaddr copy-string-btn"
title={ translate('INDEX.COPY_TO_CLIPBOARD') }
onClick={ () => this.copyPassphrase() }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button>
<span className="label label-lg label-outline label-success hide"></span>
<span className="label label-lg label-outline label-default">{ translate('JUMBLR.HIDDEN') }</span>
</td>
</tr>
<tr>
<td>{ translate('JUMBLR.KMD_DEPOSIT') }</td>
<td></td>
</tr>
<tr>
<td>KMD Jumblr</td>
<td>
</div>
}
<button
type="button"
className="btn btn-info waves-effect waves-light"
onClick={ this.generateJumblrDepositAddress }>Create Jumblr deposit address</button>
{ this.state.jumblrDepositAddress && this.state.jumblrDepositAddress.address &&
<div className="padding-top-40">
<strong>Your Jumblr deposit address:</strong>
<p>
{ this.state.jumblrDepositAddress.address }
<button
className="btn btn-default btn-xs clipboard-edexaddr margin-left-10"
title={ translate('INDEX.COPY_TO_CLIPBOARD') }
onClick={ () => this._copyCoinAddress(this.state.jumblrDepositAddress.address) }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button>
</p>
<p>
{ this.state.jumblrDepositAddress.wif }
<button
className="btn btn-default btn-xs clipboard-edexaddr margin-left-10"
title={ translate('INDEX.COPY_TO_CLIPBOARD') }
onClick={ () => this._copyCoinAddress(this.state.jumblrDepositAddress.wif) }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button>
</p>
</div>
}
</div>
<div className={ 'tab-pane' + (this.state.activeTab === 2 ? ' active' : '') }>
<button
type="button"
className="btn btn-success waves-effect waves-light margin-top-20 btn-next"
onClick={ () => this.openTab(3) }>Next</button>
<p>Jumblr secret addresses are used for the final z -> t transactions.</p>
<p>In order to allow larger accounts to obtain privacy, up to 777 secret addresses are supported.</p>
<p>Whenever a z -> t stage is activated, a random secret address from the list of the then active secret addresses is selected.</p>
<p>To add a new set of secret addresses enter address count below. The passphrase below is exactly the same you saw on the previous step.</p>
<p>Your Jumblr secret address recovery passphrase will have the following pattern <code>jumblr muffin smart educate tomato boss foil open dirt opinion pizza goddess skate action card garden cotton life write life note shine myself gloom summer XXX</code>. Where XXX any number from 001 to 777.</p>
{ this.state.jumblrDepositAddressPBased &&
<div className="padding-bottom-20 padding-top-20">
<label>Passphrase</label>
<input
type="text"
className="form-control"
name="jumblrPassphrase"
onChange={ this.returnPassphrase }
value={ this.state.randomSeed } />
<button
type="button"
className="btn btn-animate btn-animate-side btn-default btn-sm waves-effect waves-light">
<span>
<i className="icon fa-eye"></i> { translate('JUMBLR.SHOW_HIDE') }
</span>
className="btn btn-default btn-xs clipboard-edexaddr copy-string-btn"
title={ translate('INDEX.COPY_TO_CLIPBOARD') }
onClick={ () => this.copyPassphrase() }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button>
<span className="label label-lg label-outline label-success hide"></span>
<span className="label label-lg label-outline label-default">
{ translate('JUMBLR.HIDDEN') }
</span>
</td>
</tr>
</tbody>
</table>
</div>
}
<div className="col-xs-2 nofloat padding-top-30">Number of secret addresses</div>
<div className="col-xs-2 nofloat padding-left-10">
<input
type="text"
pattern="[0-9]*"
className="form-control"
name="secretAddressCount"
min="1"
max="777"
onChange={ this.onChange }
value={ this.state.secretAddressCount } />
</div>
<div className="col-xs-2 nofloat">
<button
type="button"
className="btn btn-info waves-effect waves-light"
onClick={ this.generateJumblrSecretAddress }>Create Jumblr secret address(es)</button>
</div>
<div className="toggle-box padding-top-20">
<span className="pointer">
<label className="switch">
<input
type="checkbox"
checked={ this.state.jumblrSecretAddressShow } />
<div
className="slider"
onClick={ () => this.toggle('jumblrSecretAddressShow') }></div>
</label>
<div
className="toggle-label"
onClick={ () => this.toggle('jumblrSecretAddressShow') }>
Show address list
</div>
</span>
</div>
<div className="col-xlg-12 col-md-12 padding-top-20 nofloat">
{ this.state.jumblrSecretAddressShow && this.checkJumblrSecretAddressListLength('gen') &&
<table className="table table-hover dataTable table-striped">
<thead>
<tr>
<td>
<strong>Address</strong>
</td>
<td>
<strong>Wif</strong>
</td>
</tr>
</thead>
<tbody>
{ this._JumblrRenderSecretAddressList('gen') }
</tbody>
</table>
}
</div>
</div>
<div className={ 'tab-pane' + (this.state.activeTab === 3 ? ' active' : '') }>
<p>Use the form below to send funds to your jumblr deposit address.</p>
<p className="padding-bottom-20">You can also send funds to deposit address from an external service or another wallet.</p>
<WalletsNativeSend
{...this.props}
renderFormOnly="true"
nativeActiveSection="send" />
</div>
</div>
</div>
</div>
</div>
}
{ this.state.jumblrMode === 'private' &&
<div className="jumblr-mode-selector nav-tabs-horizontal nav-tabs-inverse">
<ul className="nav nav-tabs">
<li
className={ this.state.activeTab === 0 ? 'active' : '' }
onClick={ () => this.openTab(0) }>
<a>
Import secret address
</a>
</li>
<li
className={ this.state.activeTab === 1 ? 'active' : '' }
onClick={ () => this.openTab(1) }>
<a>
Check funds
</a>
</li>
</ul>
<div className="tab-content padding-20">
<div className={ 'tab-pane' + (this.state.activeTab === 0 ? ' active' : '') }>
<button
type="button"
className="btn btn-success waves-effect waves-light margin-top-20 btn-next"
onClick={ () => this.openTab(1) }>Next</button>
<div className="col-xlg-12 col-md-12 nofloat">
<p>Enter your Jumblr passphrase you got previously during Public node configuration to import secret address.</p>
<p>Passphrase example: <code>jumblr muffin smart educate tomato boss foil open dirt opinion pizza goddess skate action card garden cotton life write life note shine myself gloom summer</code>.</p>
<p>The form below will "regenerate" Jumblr secret address based on passphrase provided.</p>
<p>After this final step expect to see funds processed and credited to your address after 2 days period.</p>
<div className="col-xlg-12 col-md-12">
<h4 className="font-size-14 text-uppercase">
{ translate('JUMBLR.JSTATUS') }
</h4>
<div className="panel">
<div className="table-responsive">
<table className="table table-striped">
<tbody>
<tr>
<td width="20%">{ translate('JUMBLR.RESULT') }</td>
<td>
<span className="label label-success"></span>
</td>
</tr>
<tr>
<td>{ translate('JUMBLR.DEPOSITED') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.PUB_TO_PRIV') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.PRIV_TO_PRIV') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.PRIV_TO_PUB') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.FINISHED') }</td>
<td></td>
</tr>
<tr>
<td>{ translate('JUMBLR.PENDING') }</td>
<td></td>
</tr>
</tbody>
</table>
{ this.state.jumblrDepositAddressPBased &&
<div className="padding-bottom-20 padding-top-20">
<label>Passphrase</label>
<input
type="text"
className="form-control"
name="jumblrPassphraseImport"
onChange={ (event) => this.passphraseOnChange(event) }
value={ this.state.jumblrPassphraseImport } />
</div>
}
<div className="col-xs-2 nofloat padding-top-30">Number of secret addresses</div>
<div className="col-xs-2 nofloat padding-left-10">
<input
type="text"
pattern="[0-9]*"
className="form-control"
name="secretAddressCountImport"
min="1"
max="777"
onChange={ this.onChange }
value={ this.state.secretAddressCountImport } />
</div>
<div className="col-xs-2 nofloat">
<button
type="button"
className="btn btn-info waves-effect waves-light"
onClick={ this.importJumblrSecretAddress }>Import Jumblr secret address(es)</button>
</div>
<div className="toggle-box padding-top-20">
<span className="pointer">
<label className="switch">
<input
type="checkbox"
checked={ this.state.jumblrSecretAddressShowImport } />
<div
className="slider"
onClick={ () => this.toggle('jumblrSecretAddressShowImport') }></div>
</label>
<div
className="toggle-label"
onClick={ () => this.toggle('jumblrSecretAddressShowImport') }>
Show address list
</div>
</span>
</div>
<div className="col-xlg-12 col-md-12 padding-top-20 nofloat">
{ this.state.jumblrSecretAddressShowImport && this.checkJumblrSecretAddressListLength('import') &&
<table className="table table-hover dataTable table-striped">
<thead>
<tr>
<td>
<strong>Address</strong>
</td>
<td>
<strong>Wif</strong>
</td>
</tr>
</thead>
<tbody>
{ this._JumblrRenderSecretAddressList('import') }
</tbody>
</table>
}
</div>
</div>
</div>
<div className={ 'tab-pane' + (this.state.activeTab === 1 ? ' active' : '') }>
<ReceiveCoin
{...this.props.ActiveCoin}
nativeActiveSection="receive"
renderTableOnly="true" />
</div>
</div>
</div>
</div>
}
</div>
</div>
</div>

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

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

6
react/src/components/dashboard/navbar/navbar.js

@ -10,6 +10,7 @@ import {
} from '../../../actions/actionCreators';
import Store from '../../../store';
import Config from '../../../config';
import { checkAC } from '../../addcoin/payload';
import NavbarRender from './navbar.render';
@ -23,6 +24,7 @@ class Navbar extends React.Component {
this.openDropMenu = this.openDropMenu.bind(this);
this.logout = this.logout.bind(this);
this.handleClickOutside = this.handleClickOutside.bind(this);
this._checkAC = this._checkAC.bind(this);
}
componentWillMount() {
@ -67,6 +69,10 @@ class Navbar extends React.Component {
Store.dispatch(dashboardChangeSection(sectionName));
}
_checkAC() {
return checkAC(this.props.ActiveCoin.coin);
}
logout() {
Store.dispatch(
stopInterval(

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

@ -57,11 +57,13 @@ const NavbarRender = function() {
<i className="site-menu-icon"></i> BarterDEX
</a>
</li>
<li className={ 'hide ' + (this.isSectionActive('jumblr') ? 'active nav-top-menu' : 'nav-top-menu') }>
<a onClick={ () => this.dashboardChangeSection('jumblr') }>
<i className="site-menu-icon"></i> Jumblr
</a>
</li>
{ this.props.ActiveCoin && this.props.ActiveCoin.mode === 'native' && (this._checkAC() || this.props.ActiveCoin.coin === 'KMD') &&
<li className={ this.isSectionActive('jumblr') ? 'active nav-top-menu' : 'nav-top-menu' }>
<a onClick={ () => this.dashboardChangeSection('jumblr') }>
<i className="site-menu-icon"></i> Jumblr
</a>
</li>
}
<li className={ this.state.nativeOnly ? 'hide' : (this.isSectionActive('atomic') ? 'active nav-top-menu' : 'nav-top-menu') }>
<a onClick={ () => this.dashboardChangeSection('atomic') }>
<i className="site-menu-icon"></i> Atomic Explorer

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

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

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

@ -66,7 +66,13 @@ export const QRModalReaderRender = function () {
</div>
<div className="modal-body">
<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">
{ this.state.error }
</div>

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

@ -10,7 +10,8 @@ import {
AddressActionsBasiliskModeRender,
AddressActionsNonBasiliskModeRender,
AddressItemRender,
ReceiveCoinRender
ReceiveCoinRender,
_ReceiveCoinTableRender
} from './receiveCoin.render';
// TODO: implement balance/interest sorting
@ -28,6 +29,11 @@ class ReceiveCoin extends React.Component {
this.handleClickOutside = this.handleClickOutside.bind(this);
this.toggleVisibleAddress = this.toggleVisibleAddress.bind(this);
this.checkTotalBalance = this.checkTotalBalance.bind(this);
this.ReceiveCoinTableRender = _ReceiveCoinTableRender.bind(this);
}
ReceiveCoinTableRender() {
return this._ReceiveCoinTableRender();
}
componentWillMount() {
@ -108,7 +114,7 @@ class ReceiveCoin extends React.Component {
}
getNewAddress(type) {
Store.dispatch(getNewKMDAddresses(this.props.coin, type));
Store.dispatch(getNewKMDAddresses(this.props.coin, type, this.props.mode));
}
toggleVisibleAddress() {
@ -167,15 +173,17 @@ class ReceiveCoin extends React.Component {
if (this.isBasiliskMode() &&
this.hasNoAmount(address)) {
address.amount = _cache && _cache[_coin][address.address]
&& _cache[_coin][address.address].getbalance.data
&& _cache[_coin][address.address].getbalance.data.balance ? _cache[_coin][address.address].getbalance.data.balance : 'N/A';
address.amount = _cache && _cache[_coin][address.address] &&
_cache[_coin][address.address].getbalance &&
_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() &&
this.hasNoInterest(address)) {
address.interest = _cache && _cache[_coin][address.address]
&& _cache[_coin][address.address].getbalance.data
&& _cache[_coin][address.address].getbalance.data.interest ? _cache[_coin][address.address].getbalance.data.interest : 'N/A';
address.interest = _cache && _cache[_coin][address.address] &&
_cache[_coin][address.address].getbalance &&
_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) {

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

@ -26,9 +26,7 @@ export const AddressActionsBasiliskModeRender = function(address) {
onClick={ () => this._validateAddressBasilisk(address) }>
<i className="icon fa-info-circle"></i>
</span>
<QRModal
content={address}
/>
<QRModal content={ address } />
</td>
);
};
@ -45,9 +43,7 @@ export const AddressActionsNonBasiliskModeRender = function(address, type) {
onClick={ () => this._copyCoinAddress(address) }>
<i className="icon wb-copy"></i> { translate('INDEX.COPY') }
</button>
<QRModal
content={address}
/>
<QRModal content={ address } />
</td>
);
};
@ -65,105 +61,119 @@ export const AddressItemRender = function(address, type) {
);
};
export const ReceiveCoinRender = function() {
export const _ReceiveCoinTableRender = function() {
return (
<div>
<div className="col-xs-12 margin-top-20">
<div className="panel nav-tabs-horizontal">
<div>
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
<div className="panel">
<header className="panel-heading">
{this.isNativeMode() &&
<div className="panel-actions">
<div
className={ 'dropdown' + (this.state.openDropMenu ? ' open' : '') }
onClick={ this.openDropMenu }>
<a className="dropdown-toggle white btn btn-warning">
<i className="icon md-arrows margin-right-10"></i> { translate('INDEX.GET_NEW_ADDRESS') }
<span className="caret"></span>
</a>
<ul
className="dropdown-menu dropdown-menu-right">
<li>
<a onClick={ () => this.getNewAddress('public') }>
<i className="icon fa-eye"></i> { translate('INDEX.TRANSPARENT_ADDRESS') }
</a>
</li>
<li>
<a onClick={ () => this.getNewAddress('private') }>
<i className="icon fa-eye-slash"></i> { translate('INDEX.PRIVATE_Z_ADDRESS') }
</a>
</li>
</ul>
</div>
</div>
}
<h4 className="panel-title">{ translate('INDEX.RECEIVING_ADDRESS') }</h4>
</header>
<div className="panel-body">
{ this.checkTotalBalance() !== 0 &&
<div className="text-left padding-top-10 padding-bottom-10">
<label className="switch">
<input
type="checkbox"
checked={ this.state.hideZeroAddresses } />
<span>
{ this.checkTotalBalance() !== 0 &&
<div className="text-left padding-top-10 padding-bottom-10">
<label className="switch">
<input
type="checkbox"
checked={ this.state.hideZeroAddresses } />
<div
className="slider"
onClick={ this.toggleVisibleAddress }></div>
</label>
<div
className="toggle-label margin-right-15 pointer"
onClick={ this.toggleVisibleAddress }>
{ translate('INDEX.TOGGLE_ZERO_ADDRESSES') }
</div>
</div>
}
<table className="table table-hover dataTable table-striped">
<thead>
{ this.isNativeMode() ?
<tr>
<th>{ translate('INDEX.TYPE') }</th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.AMOUNT') }</th>
</tr>
:
<tr>
<th>{ translate('INDEX.TYPE') }</th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.BALANCE') }</th>
<th> {translate('INDEX.INTEREST') }</th>
</tr>
}
</thead>
<tbody>
{ this.renderAddressList('public') }
{ this.isNativeMode() && this.renderAddressList('private') }
</tbody>
<tfoot>
{ this.isNativeMode() ?
<tr>
<th>{ translate('INDEX.TYPE') }</th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.AMOUNT') }</th>
</tr>
:
<tr>
<th>{ translate('INDEX.TYPE') }</th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.BALANCE') }</th>
<th>{ translate('INDEX.INTEREST') }</th>
</tr>
}
</tfoot>
</table>
</span>
);
};
export const ReceiveCoinRender = function() {
if (this.props.renderTableOnly) {
return (
<div>{ this.ReceiveCoinTableRender() }</div>
);
} else {
return (
<div>
<div className="col-xs-12 margin-top-20">
<div className="panel nav-tabs-horizontal">
<div>
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
<div className="panel">
<header className="panel-heading">
{ this.isNativeMode() &&
<div className="panel-actions">
<div
className="slider"
onClick={ this.toggleVisibleAddress }></div>
</label>
<div
className="toggle-label margin-right-15 pointer"
onClick={ this.toggleVisibleAddress }>
{ translate('INDEX.TOGGLE_ZERO_ADDRESSES') }
className={ 'dropdown' + (this.state.openDropMenu ? ' open' : '') }
onClick={ this.openDropMenu }>
<a className="dropdown-toggle white btn btn-warning">
<i className="icon md-arrows margin-right-10"></i> { translate('INDEX.GET_NEW_ADDRESS') }
<span className="caret"></span>
</a>
<ul
className="dropdown-menu dropdown-menu-right">
<li>
<a onClick={ () => this.getNewAddress('public') }>
<i className="icon fa-eye"></i> { translate('INDEX.TRANSPARENT_ADDRESS') }
</a>
</li>
<li>
<a onClick={ () => this.getNewAddress('private') }>
<i className="icon fa-eye-slash"></i> { translate('INDEX.PRIVATE_Z_ADDRESS') }
</a>
</li>
</ul>
</div>
</div>
</div>
}
<table className="table table-hover dataTable table-striped">
<thead>
{ this.isNativeMode() ?
<tr>
<th>{ translate('INDEX.TYPE') }</th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.AMOUNT') }</th>
</tr>
:
<tr>
<th>{ translate('INDEX.TYPE') }</th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.BALANCE') }</th>
<th> {translate('INDEX.INTEREST') }</th>
</tr>
}
</thead>
<tbody>
{ this.renderAddressList('public') }
{ this.isNativeMode() && this.renderAddressList('private') }
</tbody>
<tfoot>
{ this.isNativeMode() ?
<tr>
<th>{ translate('INDEX.TYPE') }</th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.AMOUNT') }</th>
</tr>
:
<tr>
<th>{ translate('INDEX.TYPE') }</th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.BALANCE') }</th>
<th>{ translate('INDEX.INTEREST') }</th>
</tr>
}
</tfoot>
</table>
<h4 className="panel-title">{ translate('INDEX.RECEIVING_ADDRESS') }</h4>
</header>
<div className="panel-body">
{ this.ReceiveCoinTableRender() }
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
);
);
}
};

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

@ -1,9 +1,7 @@
import React from 'react';
import Config from '../../../config';
import { translate } from '../../../translate/translate';
import {
checkTimestamp
} from '../../../util/time';
import { checkTimestamp } from '../../../util/time';
import {
edexGetTxIDList,
edexRemoveTXID
@ -55,7 +53,6 @@ class SendCoin extends React.Component {
currentStackLength: 0,
totalStackLength: 0,
utxoMethodInProgress: false,
isCameraFeatureDetected: false,
};
this.updateInput = this.updateInput.bind(this);
this.handleBasiliskSend = this.handleBasiliskSend.bind(this);
@ -66,27 +63,9 @@ class SendCoin extends React.Component {
this._fetchNewUTXOData = this._fetchNewUTXOData.bind(this);
this.handleClickOutside = this.handleClickOutside.bind(this);
this.setRecieverFromScan = this.setRecieverFromScan.bind(this);
this.detectCamera = this.detectCamera.bind(this);
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) {
this.setState({
sendTo: receiver
@ -101,8 +80,6 @@ class SendCoin extends React.Component {
this.handleClickOutside,
false
);
this.detectCamera();
}
componentWillUnmount() {
@ -323,7 +300,7 @@ class SendCoin extends React.Component {
);
} else {
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">
<li className="selected">
<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>
</a>
</li>
@ -395,7 +372,7 @@ class SendCoin extends React.Component {
amount: 0,
fee: 0.0001,
sendSig: false,
sendApiType: false,
sendApiType: true,
addressSelectorOpen: false,
currentStackLength: 0,
totalStackLength: 0,
@ -697,6 +674,8 @@ class SendCoin extends React.Component {
);
}
} else if (key === 'sendrawtransaction') {
const _lastSendToResponse = this.props.ActiveCoin.lastSendToResponse;
if (_lastSendToResponse[key] === 'success') {
return (
<span className="label label-success">true</span>
@ -707,6 +686,8 @@ class SendCoin extends React.Component {
);
}
} else if (key === 'txid' || key === 'sent') {
const _lastSendToResponse = this.props.ActiveCoin.lastSendToResponse;
return (
<span>{ _lastSendToResponse[key] }</span>
);
@ -775,6 +756,7 @@ class SendCoin extends React.Component {
return null;
}
render() {
if (this.props.ActiveCoin &&
this.props.ActiveCoin.send &&

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

@ -8,6 +8,8 @@ import {
import QRModal from '../qrModal/qrModal';
export const UTXOCacheInfoRender = function(refreshCacheData, isReadyToUpdate, waitUntilCallIsFinished, timestamp) {
const _progress = 100 - this.state.currentStackLength * 100 / this.state.totalStackLength;
return (
<div className="col-lg-12">
<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="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 }
</div>
</div>
@ -40,7 +42,7 @@ export const UTXOCacheInfoRender = function(refreshCacheData, isReadyToUpdate, w
);
};
export const SendCoinResponseRender = function () {
export const SendCoinResponseRender = function() {
if (this.props.ActiveCoin.lastSendToResponse) {
let items = [];
const _response = this.props.ActiveCoin.lastSendToResponse;
@ -59,55 +61,59 @@ export const SendCoinResponseRender = function () {
return items;
} else {
return (
<div className="padding-20 text-align-center">
<div className="vertical-padding-10 horizontal-padding-0">
{ translate('SEND.PROCESSING_TRANSACTION') }...<br />
{ translate('SEND.NOTE_IT_WILL_TAKE') }.
</div>
<div className="loader-wrapper active">
<div className="loader-layer loader-blue">
<div className="loader-circle-left">
<div className="circle"></div>
</div>
<div className="loader-circle-gap"></div>
<div className="loader-circle-right">
<div className="circle"></div>
</div>
</div>
<div className="loader-layer loader-red">
<div className="loader-circle-left">
<div className="circle"></div>
</div>
<div className="loader-circle-gap"></div>
<div className="loader-circle-right">
<div className="circle"></div>
</div>
</div>
<div className="loader-layer loader-green">
<div className="loader-circle-left">
<div className="circle"></div>
</div>
<div className="loader-circle-gap"></div>
<div className="loader-circle-right">
<div className="circle"></div>
</div>
</div>
<div className="loader-layer loader-yellow">
<div className="loader-circle-left">
<div className="circle"></div>
<tr className="hover--none">
<td colSpan="2">
<div className="padding-20 text-align-center">
<div className="vertical-padding-10 horizontal-padding-0">
{ translate('SEND.PROCESSING_TRANSACTION') }...<br />
{ translate('SEND.NOTE_IT_WILL_TAKE') }.
</div>
<div className="loader-circle-gap"></div>
<div className="loader-circle-right">
<div className="circle"></div>
<div className="loader-wrapper active">
<div className="loader-layer loader-blue">
<div className="loader-circle-left">
<div className="circle"></div>
</div>
<div className="loader-circle-gap"></div>
<div className="loader-circle-right">
<div className="circle"></div>
</div>
</div>
<div className="loader-layer loader-red">
<div className="loader-circle-left">
<div className="circle"></div>
</div>
<div className="loader-circle-gap"></div>
<div className="loader-circle-right">
<div className="circle"></div>
</div>
</div>
<div className="loader-layer loader-green">
<div className="loader-circle-left">
<div className="circle"></div>
</div>
<div className="loader-circle-gap"></div>
<div className="loader-circle-right">
<div className="circle"></div>
</div>
</div>
<div className="loader-layer loader-yellow">
<div className="loader-circle-left">
<div className="circle"></div>
</div>
<div className="loader-circle-gap"></div>
<div className="loader-circle-right">
<div className="circle"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
);
}
}
export const OASendUIRender = function () {
export const OASendUIRender = function() {
return (
<div className="row">
<div className="col-lg-6 form-group form-material">
@ -136,7 +142,7 @@ export const OASendUIRender = function () {
);
};
export const SendApiTypeSelectorRender = function () {
export const SendApiTypeSelectorRender = function() {
return (
<div className="row">
<div className="col-lg-8 margin-bottom-10">
@ -144,7 +150,8 @@ export const SendApiTypeSelectorRender = function () {
<label className="switch">
<input
type="checkbox"
checked={ this.state.sendApiType } />
checked={ this.state.sendApiType }
readOnly />
<div
className="slider"
onClick={ this.toggleSendAPIType }></div>
@ -156,18 +163,16 @@ export const SendApiTypeSelectorRender = function () {
</div>
</span>
</div>
{ this.stateisCameraFeatureDetected &&
<div className="col-lg-4 text-right">
<QRModal
mode="scan"
setRecieverFromScan={this.setRecieverFromScan} />
</div>
}
<div className="col-lg-4 text-right">
<QRModal
mode="scan"
setRecieverFromScan={ this.setRecieverFromScan } />
</div>
</div>
);
};
export const SendCoinRender = function () {
export const SendCoinRender = function() {
return (
<div className="col-sm-12 padding-top-10">
<div className="col-xlg-12 col-md-12 col-sm-12 col-xs-12">
@ -247,9 +252,8 @@ export const SendCoinRender = function () {
className="form-control"
id="edexcoinAmount"
name="amount"
placeholder="0.000"
placeholder="0.001"
autoComplete="off"
defaultValue={ this.state.amount }
value={ this.state.amount }
onChange={ this.updateInput } />
</div>
@ -264,16 +268,15 @@ export const SendCoinRender = function () {
className="form-control"
id="edexcoinFee"
name="fee"
defaultValue={ this.state.fee }
value={ this.state.fee }
placeholder="0.000"
placeholder="0.001"
autoComplete="off"
onChange={ this.updateInput } />
</div>
<div className="col-lg-12">
<strong>
{ translate('INDEX.TOTAL') }&nbsp;
({ translate('INDEX.AMOUNT_SM') } - txfee):
({ translate('INDEX.AMOUNT_SM') } - fee):
</strong>&nbsp;
{ Number(this.state.amount) - Number(this.state.fee) } { this.props.ActiveCoin.coin }
</div>
@ -282,7 +285,8 @@ export const SendCoinRender = function () {
<label className="switch">
<input
type="checkbox"
checked={ this.state.sendSig } />
checked={ this.state.sendSig }
readOnly />
<div
className="slider"
onClick={ this.toggleSendSig }></div>

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

@ -79,9 +79,21 @@ class Settings extends React.Component {
this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this);
this._checkForUpdateUIPromise = this._checkForUpdateUIPromise.bind(this);
this._updateUIPromise = this._updateUIPromise.bind(this);
}
componentWillMount() {
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() {
if (!this.props.disableWalletSpecificUI) {
Store.dispatch(iguanaActiveHandle());
@ -207,23 +219,27 @@ class Settings extends React.Component {
for (let i = 0; i < this.state.updateLog.length; i++) {
items.push(
<div>{ this.state.updateLog[i] }</div>
<div key={ `settings-update-log-${i}` }>{ this.state.updateLog[i] }</div>
);
}
return (
<div style={{ minHeight: '200px' }}>
<hr />
<h5>Progress:</h5>
<div className="padding-bottom-15">{ items }</div>
<div className={ updateProgressBar.patch > -1 ? 'progress progress-sm' : 'hide' }>
<div
className="progress-bar progress-bar-striped active progress-bar-indicating progress-bar-success font-size-80-percent"
style={{ width: updateProgressBar.patch + '%' }}>
if (this.state.updateLog.length) {
return (
<div style={{ minHeight: '200px' }}>
<hr />
<h5>Progress:</h5>
<div className="padding-bottom-15">{ items }</div>
<div className={ updateProgressBar.patch > -1 ? 'progress progress-sm' : 'hide' }>
<div
className="progress-bar progress-bar-striped active progress-bar-indicating progress-bar-success font-size-80-percent"
style={{ width: updateProgressBar.patch + '%' }}>
</div>
</div>
</div>
</div>
);
);
} else {
return null;
}
}
toggleSeedInputVisibility() {
@ -251,6 +267,17 @@ class Settings extends React.Component {
activeTabHeight: _height,
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);
}

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

@ -24,7 +24,7 @@ export const AppUpdateTabRender = function() {
<div className="padding-top-15">
<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>
<button
type="button"
@ -38,7 +38,7 @@ export const AppUpdateTabRender = function() {
<div className="padding-top-15">
<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>
<button
type="button"
@ -77,7 +77,7 @@ export const AppInfoTabRender = function() {
{ translate('SETTINGS.NAME') }: { this.props.Settings.appInfo.releaseInfo.name }
</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>
{ translate('SETTINGS.APP_SESSION') }: { this.props.Settings.appInfo.appSession }
@ -144,9 +144,9 @@ export const AppInfoTabRender = function() {
export const SettingsRender = function() {
return (
<div className="margin-left-0">
<div className="margin-left-0 full-height">
<div
className="page-content"
className="page-content full-height"
id="section-iguana-wallet-settings">
<div className="row">
<div className="col-xlg-12 col-md-12">
@ -593,7 +593,7 @@ export const SettingsRender = function() {
<textarea
type="text"
className="form-control"
name="cliCmd"
name="cliCmdString"
id="cliCmd"
value={ this.state.cliCmdString }
onChange={ this.updateInput }></textarea>

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

@ -70,14 +70,13 @@ class WalletsBalance extends React.Component {
if (_mode === 'full') {
_balance = this.props.ActiveCoin.balance || 0;
} else {
} 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 (type === 'main' &&
_mode === 'basilisk' &&
if (type === 'transparent' &&
_address &&
_cache[_coin] &&
_cache[_coin][_address] &&
@ -88,7 +87,6 @@ class WalletsBalance extends React.Component {
}
if (type === 'interest' &&
_mode === 'basilisk' &&
_address &&
_cache[_coin] &&
_cache[_coin][_address] &&
@ -99,7 +97,6 @@ class WalletsBalance extends React.Component {
}
if (type === 'total' &&
_mode === 'basilisk' &&
_address &&
_cache[_coin] &&
_cache[_coin][_address] &&
@ -113,6 +110,30 @@ class WalletsBalance extends React.Component {
_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;

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

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

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save