Browse Source

Merge branch 'redux' into feature/settings-refactor

all-modes
Miika Turunen 8 years ago
parent
commit
bed8146504
  1. 341
      assets/mainWindow/css/loading.css
  2. BIN
      assets/mainWindow/img/fa-caret-down.png
  3. BIN
      assets/mainWindow/img/fa-caret-up.png
  4. BIN
      assets/mainWindow/img/fa-close.png
  5. BIN
      assets/mainWindow/img/fa-cogs.png
  6. BIN
      assets/mainWindow/img/fa-cube.png
  7. BIN
      assets/mainWindow/img/fa-cubes.png
  8. BIN
      assets/mainWindow/img/fa-question.png
  9. 279
      assets/mainWindow/js/loading.js
  10. 3
      react/change.log
  11. 43
      react/src/actions/actionCreators.js
  12. 34
      react/src/actions/actions/addCoin.js
  13. 113
      react/src/actions/actions/addressBalance.js
  14. 30
      react/src/actions/actions/atomic.js
  15. 4
      react/src/actions/actions/basiliskCache.js
  16. 56
      react/src/actions/actions/basiliskProcessAddress.js
  17. 4
      react/src/actions/actions/basiliskTxHistory.js
  18. 4
      react/src/actions/actions/cli.js
  19. 4
      react/src/actions/actions/coinList.js
  20. 30
      react/src/actions/actions/createWallet.js
  21. 30
      react/src/actions/actions/dexCoins.js
  22. 49
      react/src/actions/actions/edexBalance.js
  23. 30
      react/src/actions/actions/edexGetTx.js
  24. 30
      react/src/actions/actions/fullTxHistory.js
  25. 30
      react/src/actions/actions/getAddrByAccount.js
  26. 30
      react/src/actions/actions/iguanaHelpers.js
  27. 20
      react/src/actions/actions/iguanaInstance.js
  28. 4
      react/src/actions/actions/interest.js
  29. 4
      react/src/actions/actions/jumblr.js
  30. 61
      react/src/actions/actions/log.js
  31. 30
      react/src/actions/actions/logout.js
  32. 30
      react/src/actions/actions/nativeBalance.js
  33. 67
      react/src/actions/actions/nativeDashboardUpdate.js
  34. 30
      react/src/actions/actions/nativeNewAddress.js
  35. 61
      react/src/actions/actions/nativeSend.js
  36. 58
      react/src/actions/actions/nativeSyncInfo.js
  37. 30
      react/src/actions/actions/nativeTxHistory.js
  38. 223
      react/src/actions/actions/notary.js
  39. 4
      react/src/actions/actions/openAlias.js
  40. 110
      react/src/actions/actions/sendFullBasilisk.js
  41. 82
      react/src/actions/actions/settings.js
  42. 30
      react/src/actions/actions/syncInfo.js
  43. 4
      react/src/actions/actions/syncOnly.js
  44. 4
      react/src/actions/actions/sysInfo.js
  45. 4
      react/src/actions/actions/update.js
  46. 126
      react/src/actions/actions/walletAuth.js
  47. 5
      react/src/actions/storeType.js
  48. 14
      react/src/components/addcoin/addcoin.js
  49. 59
      react/src/components/addcoin/addcoin.scss
  50. 46
      react/src/components/addcoin/addcoinOptionsAC.js
  51. 77
      react/src/components/addcoin/addcoinOptionsACFiat.js
  52. 44
      react/src/components/addcoin/addcoinOptionsCrypto.js
  53. 8
      react/src/components/addcoin/coin-selectors.render.js
  54. 1
      react/src/components/app/app.js
  55. 3
      react/src/components/dashboard/atomic/atomic.js
  56. 9
      react/src/components/dashboard/claimInterestModal/claimInterestModal.js
  57. 25
      react/src/components/dashboard/claimInterestModal/claimInterestModal.render.js
  58. 47
      react/src/components/dashboard/claimInterestModal/claimInterestModal.scss
  59. 4
      react/src/components/dashboard/coinTile/coinTile.js
  60. 52
      react/src/components/dashboard/coinTile/coinTileItem.js
  61. 2
      react/src/components/dashboard/coinTile/coinTileItem.render.js
  62. 7
      react/src/components/dashboard/coindDownModal/coindDownModal.js
  63. 2
      react/src/components/dashboard/coindDownModal/coindDownModal.render.js
  64. 24
      react/src/components/dashboard/coindDownModal/coindDownModal.scss
  65. 3
      react/src/components/dashboard/jumblr/jumblr.js
  66. 89
      react/src/components/dashboard/jumblr/jumblr.scss
  67. 2
      react/src/components/dashboard/loginModal/loginModal.render.js
  68. 3
      react/src/components/dashboard/loginSettingsModal/loginSettingsModal.js
  69. 5
      react/src/components/dashboard/main/dashboard.js
  70. 14
      react/src/components/dashboard/navbar/navbar.js
  71. 4
      react/src/components/dashboard/navbar/navbar.render.js
  72. 122
      react/src/components/dashboard/notifications/notifications.js
  73. 116
      react/src/components/dashboard/notifications/notifications.render.js
  74. 4
      react/src/components/dashboard/qrModal/qrModal.js
  75. 76
      react/src/components/dashboard/qrModal/qrModal.render.js
  76. 11
      react/src/components/dashboard/qrModal/qrModal.scss
  77. 3
      react/src/components/dashboard/receiveCoin/receiveCoin.js
  78. 28
      react/src/components/dashboard/sendCoin/sendCoin.js
  79. 4
      react/src/components/dashboard/settings/settings.js
  80. 115
      react/src/components/dashboard/settings/settings.scss
  81. 3
      react/src/components/dashboard/syncOnly/syncOnly.js
  82. 4
      react/src/components/dashboard/syncOnly/syncOnly.render.js
  83. 37
      react/src/components/dashboard/syncOnly/syncOnly.scss
  84. 27
      react/src/components/dashboard/walletsBalance/walletsBalance.js
  85. 46
      react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.js
  86. 83
      react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.render.js
  87. 26
      react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.js
  88. 36
      react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.render.js
  89. 3
      react/src/components/dashboard/walletsCacheData/walletsCacheData.js
  90. 2
      react/src/components/dashboard/walletsData/pagination.js
  91. 105
      react/src/components/dashboard/walletsData/walletsData.js
  92. 23
      react/src/components/dashboard/walletsData/walletsData.render.js
  93. 92
      react/src/components/dashboard/walletsData/walletsData.scss
  94. 9
      react/src/components/dashboard/walletsInfo/walletsInfo.js
  95. 40
      react/src/components/dashboard/walletsInfo/walletsInfo.render.js
  96. 27
      react/src/components/dashboard/walletsNative/walletsNative.js
  97. 2
      react/src/components/dashboard/walletsNative/walletsNative.render.js
  98. 20
      react/src/components/dashboard/walletsNativeAlert/walletsNativeAlert.js
  99. 19
      react/src/components/dashboard/walletsNativeAlert/walletsNativeAlert.render.js
  100. 36
      react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js

341
assets/mainWindow/css/loading.css

@ -2,6 +2,8 @@ body {
overflow: hidden !important;
border: solid 1px #ccc;
height: 300px;
user-select: none;
cursor: default;
}
.text-center {
@ -31,6 +33,15 @@ body.agamaMode {
background-color: rgba(33, 33, 33, 0.85);
padding-top: 40px;
color: #fff;
height: 335px;
}
body.agama-default-window-height {
height: 300px !important;
}
body.agama-app-settings-window {
height: 820px;
}
.agama-logo {
@ -38,11 +49,21 @@ body.agamaMode {
}
#agamaModeStatus {
padding-bottom: 25px;
padding-bottom: 35px;
font-weight: bold;
font-size: 16px;
}
.btn-info {
color: #fff;
background-color: #25b4c5 !important;
border-color: #25b4c5 !important;
}
.btn-info:hover {
background-color: #6cd2de !important;
border-color: #6cd2de !important;
}
.btn-primary.focus,
.btn-primary:focus,
.btn-primary:hover,
@ -67,8 +88,8 @@ body.agamaMode {
font-size: 14px;
line-height: 1.57142857;
border-radius: 3px;
-webkit-box-shadow: 0 1px 4px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 4px 0 rgba(0,0,0,.1);
-webkit-box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1);
-webkit-transition: border .2s linear,color .2s linear,width .2s linear,background-color .2s linear;
-o-transition: border .2s linear,color .2s linear,width .2s linear,background-color .2s linear;
transition: border .2s linear,color .2s linear,width .2s linear,background-color .2s linear;
@ -114,4 +135,318 @@ body.agamaMode {
.app-closing {
position: relative;
top: 50px;
}
.height--auto {
height: auto;
}
.settings-title {
font-weight: bold;
margin-bottom: 30px;
}
.margin-right-5 {
margin-right: 5px;
}
.margin-right-10 {
margin-right: 10px;
}
.margin-right-20 {
margin-right: 20px;
}
.margin-top-15 {
margin-top: 15px;
}
.margin-top-20 {
margin-top: 20px;
}
.pull-left {
float: left;
margin-left: 50px;
}
.btn-close {
border-bottom-left-radius: 50%;
background: #fff;
color: rgba(33, 33, 33, 0.85);
padding: 8px 10px;
font-weight: bold;
font-size: 20px;
position: absolute;
top: 0;
right: 0;
cursor: pointer;
}
.btn-close img {
height: 12px;
position: relative;
top: -1px;
right: -1px;
}
.btn-mode img {
height: 20px;
position: relative;
top: -1px;
left: -4px;
padding-right: 5px;
}
/* settings */
.settings-help {
position: relative;
top: -2px;
left: 10px;
color: #fff;
border-radius: 50%;
background: #5683ad;
display: inline-block;
padding: 4px 4px;
line-height: 30px;
cursor: default;
}
.settings-help img {
height: 13px;
}
.settings-buttons-block {
margin-top: 50px;
margin-right: 50px;
text-align: right;
}
.settings-table {
margin: 0 auto;
width: 650px;
text-align: left;
}
.settings-table input[type="number"] {
width: 100px;
padding: 0 4px;
}
.settings-table input[type="text"] {
width: 100%;
padding: 0 4px;
}
.settings-table td {
padding-bottom: 35px;
}
.settings-table tr:last-child td {
padding: 0;
}
.settings-table .left {
width: 50%;
}
.settings-table .right {
width: 50%;
text-align: left;
}
.agama-app-settings-window #agamaModeStatus {
padding-bottom: 50px;
}
/* toggle */
.slider {
border-radius: 20px;
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #fff;
transition: .4s;
}
.switch input {
display: none;
}
input[type=checkbox],
input[type=radio] {
margin: 4px 0 0;
margin-top: 1px\9;
line-height: normal;
}
input[type=checkbox],
input[type=radio] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
.switch {
position: relative;
display: inline-block;
width: 40px;
height: 24px;
}
label {
font-weight: 300;
}
label {
display: inline-block;
max-width: 100%;
margin-bottom: 5px;
font-weight: 700;
}
input:checked + .slider {
background: #36ab7a;
}
input:checked + .slider:before {
background: #fff;
}
input:checked + .slider:before {
-ms-transform: translateX(16px);
transform: translateX(16px);
}
.slider:before {
content: '';
display: inline-block;
border-radius: 50%;
position: absolute;
height: 20px;
width: 20px;
left: 2px;
bottom: 2px;
background-color: #ccc;
transition: .4s;
}
input[type="text"],
input[type="number"] {
color: rgb(33, 33, 33);
}
/* toastr */
#toast-container {
position: fixed;
z-index: 999999;
}
.toast-bottom-right {
right: 12px;
bottom: 12px;
}
#toast-container > .toast-success {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==) !important;
}
#toast-container > .toast-error {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=) !important;
}
#toast-container > div {
margin: 0 0 6px;
padding: 15px 15px 15px 50px;
width: 300px;
-moz-border-radius: 3px 3px 3px 3px;
-webkit-border-radius: 3px 3px 3px 3px;
border-radius: 3px 3px 3px 3px;
background-position: 15px center;
background-repeat: no-repeat;
color: #fff;
}
.toast-success {
background-color: #51a351;
}
.toast-error {
background-color: #bd362f;
}
.toast-title {
font-weight: bold;
text-align: left;
margin-left: 10px;
}
button.toast-close-button {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}
.toast-close-button {
position: relative;
right: -0.3em;
top: -0.3em;
float: right;
font-size: 20px;
font-weight: bold;
color: #fff;
-webkit-text-shadow: 0 1px 0 #fff;
text-shadow: 0 1px 0 #fff;
opacity: .8;
-ms-filter: alpha(opacity=80);
filter: alpha(opacity=80);
}
.toast-message {
text-align: left;
margin-left: 10px;
-ms-word-wrap: break-word;
word-wrap: break-word;
}
.test-bins {
text-align: left;
margin-top: 10px;
margin-left: 30px;
}
.btn-caret {
display: inline-block;
position: relative;
left: -4px;
height: 36px;
border-bottom-left-radius: 0;
border-top-left-radius: 0;
box-shadow: none;
width: 38px;
}
.btn-caret:before {
content: '';
display: inline-block;
position: absolute;
height: 25px;
background: #fff;
width: 1px;
left: -2px;
top: 4px;
}
.btn-caret img {
height: 14px;
position: absolute;
top: 10px;
left: 10px;
}
.btn-native {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.btn-native:hover + .btn-caret:before {
display: none;
}
.btn-caret:hover:before {
display: none;
}
.dropdown-menu {
display: inherit;
top: inherit;
left: inherit;
right: 48%;
padding: 2px 0;
}
.dropdown-menu li {
cursor: pointer;
margin: 5px 0;
}

BIN
assets/mainWindow/img/fa-caret-down.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/mainWindow/img/fa-caret-up.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/mainWindow/img/fa-close.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
assets/mainWindow/img/fa-cogs.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
assets/mainWindow/img/fa-cube.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
assets/mainWindow/img/fa-cubes.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
assets/mainWindow/img/fa-question.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

279
assets/mainWindow/js/loading.js

@ -1,59 +1,262 @@
function closeMainWindow() {
const remote = require('electron').remote;
const window = remote.getCurrentWindow();
let _configCopy;
window.createWindow('open');
window.hide();
function toggleDropdown() {
const _dropdown = $('.dropdown-menu');
if (_dropdown.hasClass('hide')) {
_dropdown.removeClass('hide');
} else {
_dropdown.addClass('hide');
}
}
function quitApp() {
const remote = require('electron').remote;
const window = remote.getCurrentWindow();
function initSettingsForm() {
const remote = require('electron').remote;
let appConf = remote.getCurrentWindow().appConfig;
let appConfSchema = remote.getCurrentWindow().appConfigSchema;
_configCopy = Object.assign({}, appConf);
window.forseCloseApp();
let _htmlOut = '<table class="settings-table">';
for (let key in appConf) {
if (appConfSchema[key] &&
appConfSchema[key].initDisplay) {
_htmlOut = `
${_htmlOut}
<tr>
<td class="left">
${appConfSchema[key].displayName}`;
if (appConfSchema[key].info) {
_htmlOut = `
${_htmlOut}
<div
class="settings-help"
title="${appConfSchema[key].info}">
<img src="../EasyDEX-GUI/assets/mainWindow/img/fa-question.png" />
</div>`;
}
if (appConfSchema[key].type === 'number') {
_htmlOut = `
${_htmlOut}
</td>
<td class="right">
<input
type="number"
id="${key}"
pattern="[0-9]*"
onKeyup="handleInput('${key}')"
value="${_configCopy[key]}" />
</td>
</tr>`;
} else if (appConfSchema[key].type === 'string' || appConfSchema[key].type === 'folder') {
_htmlOut = `
${_htmlOut}
</td>
<td class="right">
<input
type="text"
id="${key}"
onKeyup="handleInput('${key}')"
value="${_configCopy[key]}" />
</td>
</tr>`;
} else if (appConfSchema[key].type === 'boolean') {
_htmlOut = `${_htmlOut}
</td>
<td class="right">
<label
class="switch"
id="${key}"
onClick="settingsToggle(\'${key}\')">
${(appConf[key] ? '<input type="checkbox" class="cb" checked />' : '<input type="checkbox" class="cb" />')}
<div class="slider"></div>
</label>
</td>
</tr>`;
}
}
}
function normalStart() {
_htmlOut = `
${_htmlOut}
</table>`;
$('#agamaConfigBlock').html(_htmlOut);
}
function hideToastImmediate() {
$('#toast-container').addClass('hide');
}
function hideToast() {
setTimeout(function() {
$('#toast-container').addClass('hide');
}, 5000);
}
function showToast(type, message) {
$('#toast-container .toast').removeClass('toast-success').removeClass('toast-error');
$('#toast-container .toast').addClass(`toast-${type}`);
$('#toast-container .toast-message').html(message);
$('#toast-container').removeClass('hide');
hideToast();
}
function setDefaultAppSettings() {
const remote = require('electron').remote;
remote.getCurrentWindow().setDefaultAppSettings();
remote.getCurrentWindow().appConfig = remote.getCurrentWindow().defaultAppSettings;
initSettingsForm();
showToast('success', 'App settings are reset to default');
}
function testBins(binName) {
const remote = require('electron').remote;
remote.getCurrentWindow().testBins(binName).
then(function(res) {
$('#debugOut').html(JSON.stringify(res, null, '\t'));
});
}
function handleSaveSettings() {
if (_configCopy.dataDir &&
_configCopy.dataDir.length) {
const remote = require('electron').remote;
let appConf = remote.getCurrentWindow().appConfig;
appConf.iguanaLessMode = false;
// run iguana-less mode with no daemons startup
if (appConf && appConf.iguanaLessMode) {
// do something
} else { // run normal mode with 2 iguana instances started prior loading GUI
if (appConf && !appConf.manualIguanaStart) {
StartIguana();
remote.getCurrentWindow().testLocation(_configCopy.dataDir)
.then(function(res) {
$('#debugOut').html(res + ' | ' + _configCopy.dataDir);
if (res === -1) {
showToast('error', 'Komodo datadir path is invalid');
} else if (res === false) {
showToast('error', 'Komodo datadir path is not a directory');
} else {
// save settings
remote.getCurrentWindow().updateAppSettings(_configCopy);
remote.getCurrentWindow().appConfig = _configCopy;
showToast('success', 'Settings saved');
}
});
} else {
// save settings
const remote = require('electron').remote;
remote.getCurrentWindow().updateAppSettings(_configCopy);
remote.getCurrentWindow().appConfig = _configCopy;
showToast('success', 'Settings saved');
}
}
function handleInput(key) {
const _value = $(`#${key}`).val();
_configCopy[key] = _value;
}
var portcheck;
function settingsToggle(key) {
const _value = $(`#${key} .cb`).prop('checked');
_configCopy[key] = _value;
}
function closeSettingsWindow() {
const remote = require('electron').remote;
const window = remote.getCurrentWindow();
toggleDropdown();
window.destroyAppSettingsWindow();
}
function reloadSettingsWindow() {
const remote = require('electron').remote;
const window = remote.getCurrentWindow();
window.reloadSettingsWindow();
}
function openSettingsWindow() {
const remote = require('electron').remote;
const window = remote.getCurrentWindow();
$('.dropdown-menu').addClass('hide');
window.createAppSettingsWindow();
}
function closeMainWindow(isKmdOnly, isCustom) {
const remote = require('electron').remote;
const window = remote.getCurrentWindow();
$('.dropdown-menu').addClass('hide');
disableModeButtons();
if (!isCustom) {
window.startKMDNative(isKmdOnly ? 'KMD' : null);
}
window.createWindow('open');
window.hide();
}
function quitApp() {
const remote = require('electron').remote;
const window = remote.getCurrentWindow();
window.forseCloseApp();
}
function startcheck() {
portcheck = setInterval(function() {
Iguana_activehandle(appConf).then(function(result){
console.log(result);
function disableModeButtons() {
$('#nativeOnlyBtn').attr('disabled', true);
$('#normalStartBtn').attr('disabled', true);
$('#settingsBtn').attr('disabled', true);
$('#nativeOnlyBtnCarret').attr('disabled', true);
}
function normalStart() {
const remote = require('electron').remote;
let appConf = remote.getCurrentWindow().appConfig;
appConf.iguanaLessMode = false;
if (result !== 'error') {
stopcheck();
$('.dropdown-menu').addClass('hide');
disableModeButtons();
// run iguana-less mode with no daemons startup
if (appConf &&
appConf.iguanaLessMode) {
// do something
} else { // run normal mode with 2 iguana instances started prior loading GUI
if (appConf &&
!appConf.manualIguanaStart) {
StartIguana();
}
if (appConf && appConf.useBasiliskInstance) {
StartIguana_Cache();
}
var portcheck;
$('#loading_status_text').text('Connecting to Basilisk Network...');
EDEX_DEXgetinfoAll(appConf.skipBasiliskNetworkCheck, appConf.minNotaries, appConf);
function startcheck() {
portcheck = setInterval(function() {
Iguana_activehandle(appConf).then(function(result){
console.log(result);
if (result !== 'error') {
stopcheck();
if (appConf && appConf.useBasiliskInstance) {
StartIguana_Cache();
}
})
}, 2000);
}
function stopcheck() {
clearInterval(portcheck);
}
$('#loading_status_text').text('Connecting to Basilisk Network...');
EDEX_DEXgetinfoAll(appConf.skipBasiliskNetworkCheck, appConf.minNotaries, appConf);
}
})
}, 2000);
}
startcheck();
function stopcheck() {
clearInterval(portcheck);
}
startcheck();
}
}
function IguanaAJAX(url, ajax_data, timeout) {
return $.ajax({

3
react/change.log

@ -8,7 +8,7 @@ UI:
- minor placeholders fixes
- hide address dropdown if wallet has only one address
- komodod crash report modal
- values rounding (up to 6 decimals)
- values clipping
- add coin multi ui reflow fix
- reset app setting to default
- manual balance / transactions list refresh
@ -26,6 +26,7 @@ UI:
- coin daemon port check on addcoin
- updated application settings
- komodo datadir
- windows bins path fix
v0.2.0.21a-beta
--------------

43
react/src/actions/actionCreators.js

@ -6,7 +6,6 @@ import {
GET_ACTIVE_COINS,
DASHBOARD_ACTIVE_ADDRESS,
VIEW_CACHE_DATA,
DASHBOARD_DISPLAY_NOTARIES_MODAL,
DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR,
DASHBOARD_ACTIVE_SECTION,
DASHBOARD_ACTIVE_TXINFO_MODAL,
@ -31,11 +30,6 @@ import {
START_INTERVAL,
STOP_INTERVAL
} from './storeType';
import {
logGuiHttp,
getAgamaLog,
guiLogState
} from './actions/log';
export * from './actions/nativeSyncInfo';
export * from './actions/basiliskCache';
@ -52,7 +46,6 @@ export * from './actions/sendFullBasilisk';
export * from './actions/settings';
export * from './actions/syncOnly';
export * from './actions/iguanaInstance';
export * from './actions/notary';
export * from './actions/edexBalance';
export * from './actions/addCoin';
export * from './actions/addressBalance';
@ -71,6 +64,7 @@ export * from './actions/cli';
export * from './actions/update';
export * from './actions/jumblr';
export * from './actions/interest';
export * from './actions/nativeDashboardUpdate';
export function changeActiveAddress(address) {
return {
@ -92,13 +86,6 @@ export function toggleViewCacheModal(display) {
}
}
export function displayNotariesModal(display) {
return {
type: DASHBOARD_DISPLAY_NOTARIES_MODAL,
display,
}
}
export function changeMainBasiliskAddress(address) {
return {
type: DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR,
@ -121,34 +108,6 @@ export function toggleDashboardTxInfoModal(display, txIndex) {
}
}
export function basiliskConnectionState(display, json) {
return {
type: BASILISK_CONNECTION,
basiliskConnection: display,
progress: json,
}
}
export function basiliskRefreshState(display, json) {
return {
type: BASILISK_REFRESH,
basiliskRefresh: display,
progress: json,
}
}
export function basiliskRefresh(display) {
return dispatch => {
dispatch(basiliskRefreshState(display));
}
}
export function basiliskConnection(display) {
return dispatch => {
dispatch(basiliskConnectionState(display));
}
}
export function syncingNativeModeState(display, json) {
return {
type: SYNCING_NATIVE_MODE,

34
react/src/actions/actions/addCoin.js

@ -7,10 +7,6 @@ import {
startIguanaInstance,
iguanaWalletPassphraseState,
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import {
startCurrencyAssetChain,
startAssetChain,
@ -96,31 +92,12 @@ export function addCoin(coin, mode, syncOnly, port, startupParams) {
export function iguanaAddCoin(coin, mode, acData, port) {
function _iguanaAddCoin(dispatch) {
const _timestamp = Date.now();
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',
body: JSON.stringify(acData),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
translate('TOASTR.FAILED_TO_ADDCOIN'),
@ -131,13 +108,6 @@ export function iguanaAddCoin(coin, mode, acData, port) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(
addCoinResult(
coin,
@ -287,7 +257,7 @@ export function shepherdHerd(coin, mode, path, startupParams) {
console.warn(acData);
dispatch(
triggerToaster(
`Error starting ${coin} daemon. Port ${acData.rpc} is already taken!`,
`Error starting ${coin} daemon. Port ${acData.rpc} is already taken!`, // translate
translate('TOASTR.SERVICE_NOTIFICATION'),
'error',
false
@ -372,7 +342,7 @@ export function iguanaActiveHandleBypass() {
.then(response => response.json())
.then(
json => dispatch(
iguanaWalletPassphraseState(json, dispatch)
iguanaWalletPassphraseState(json, dispatch, true)
)
)
}

113
react/src/actions/actions/addressBalance.js

@ -5,10 +5,6 @@ import {
getPassthruAgent,
iguanaHashHex
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
function getKMDAddressesNativeState(json) {
@ -105,18 +101,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
};
}
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
@ -139,13 +123,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
)
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getKMDAddressesNative',
@ -156,13 +133,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
resolve(Config.cli.default && mode === 'native' ? json.result : json);
})
}
@ -307,16 +277,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
hex: hashHexJson,
};
}
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',
@ -349,13 +309,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
)
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getKMDAddressesNative+ZBalance',
@ -369,13 +322,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
if (json &&
json.error) {
resolve(0);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: json,
}));
}
dispatch(
triggerToaster(
'getKMDAddressesNative+ZBalance',
@ -394,13 +340,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
amount: json,
type: 'private',
};
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
}
});
});
@ -448,31 +387,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
if (json[coin][currentAddress].refresh) {
calcBalance(result, json[coin][currentAddress].refresh.data, dispatch, mode);
} else {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getKMDAddressesNative+Balance',
@ -483,13 +403,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
})
.then(response => response.json())
.then(function(json) {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
updatedCache.basilisk[coin][currentAddress].refresh = {
data: json,
status: 'done',
@ -506,18 +419,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
}
})
} else {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
@ -547,13 +448,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
)
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getKMDAddressesNative+Balance',
@ -568,13 +462,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
mode === 'native') {
json = json.result;
}
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
calcBalance(
result,
json,

30
react/src/actions/actions/atomic.js

@ -1,38 +1,15 @@
import { ATOMIC } from '../storeType';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function atomic(payload) {
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
payload.method,
@ -43,13 +20,6 @@ export function atomic(payload) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(atomicState(json));
});
}

4
react/src/actions/actions/basiliskCache.js

@ -1,9 +1,5 @@
import { DASHBOARD_ACTIVE_COIN_GET_CACHE } from '../storeType';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
// TODO: rewrite cache API to use POST

56
react/src/actions/actions/basiliskProcessAddress.js

@ -1,9 +1,5 @@
import { translate } from '../../translate/translate';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function checkAddressBasilisk(coin, address) {
@ -16,31 +12,12 @@ export function checkAddressBasilisk(coin, address) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'checkAddressBasilisk',
@ -51,13 +28,6 @@ export function checkAddressBasilisk(coin, address) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(checkAddressBasiliskHandle(json));
})
}
@ -102,31 +72,12 @@ export function validateAddressBasilisk(coin, address) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'validateAddressBasilisk',
@ -137,13 +88,6 @@ export function validateAddressBasilisk(coin, address) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(validateAddressBasiliskHandle(json));
})
}

4
react/src/actions/actions/basiliskTxHistory.js

@ -2,10 +2,6 @@ import {
triggerToaster,
getNativeTxHistoryState
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getBasiliskTransactionsList(coin, address) {

4
react/src/actions/actions/cli.js

@ -1,9 +1,5 @@
import { triggerToaster } from '../actionCreators';
import { CLI } from '../storeType';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function shepherdCliPromise(mode, chain, cmd) {

4
react/src/actions/actions/coinList.js

@ -1,8 +1,4 @@
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function shepherdGetCoinList() {

30
react/src/actions/actions/createWallet.js

@ -1,9 +1,5 @@
import { translate } from '../../translate/translate';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
function createNewWalletState(json) {
@ -41,31 +37,12 @@ export function createNewWallet(_passphrase) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'createNewWallet',
@ -76,13 +53,6 @@ export function createNewWallet(_passphrase) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(createNewWalletState(json));
})
}

30
react/src/actions/actions/dexCoins.js

@ -2,10 +2,6 @@ import {
triggerToaster,
dashboardCoinsState
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
// TODO: find out why it errors on slow systems
@ -17,18 +13,6 @@ export function getDexCoins() {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(_payload),
@ -49,13 +33,6 @@ export function getDexCoins() {
)
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'Error getDexCoins',
@ -66,13 +43,6 @@ export function getDexCoins() {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(dashboardCoinsState(json));
});
}

49
react/src/actions/actions/edexBalance.js

@ -1,9 +1,5 @@
import { DASHBOARD_ACTIVE_COIN_BALANCE } from '../storeType';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function iguanaEdexBalance(coin) {
@ -16,31 +12,12 @@ export function iguanaEdexBalance(coin) {
return dispatch => {
if (coin) {
const _timestamp = Date.now();
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',
body: JSON.stringify(_payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'Error iguanaEdexBalance',
@ -73,31 +50,12 @@ export function getDexBalance(coin, mode, addr) {
};
return new Promise((resolve, reject) => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getDexBalance',
@ -109,13 +67,6 @@ export function getDexBalance(coin, mode, addr) {
.then(response => response.json())
.then(json => {
console.log(json);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
})
resolve(index);

30
react/src/actions/actions/edexGetTx.js

@ -1,8 +1,4 @@
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function edexGetTransaction(data, dispatch) {
@ -16,31 +12,12 @@ export function edexGetTransaction(data, dispatch) {
};
return new Promise((resolve, reject) => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'edexGetTransaction',
@ -51,13 +28,6 @@ export function edexGetTransaction(data, dispatch) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
resolve(json);
})
});

30
react/src/actions/actions/fullTxHistory.js

@ -2,10 +2,6 @@ import {
triggerToaster,
getNativeTxHistoryState
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getFullTransactionsList(coin) {
@ -21,31 +17,12 @@ export function getFullTransactionsList(coin) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getFullTransactionsList',
@ -56,13 +33,6 @@ export function getFullTransactionsList(coin) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(getNativeTxHistoryState(json));
})
}

30
react/src/actions/actions/getAddrByAccount.js

@ -1,8 +1,4 @@
import { ACTIVE_COIN_GET_ADDRESSES } from '../storeType';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getAddressesByAccountState(json, coin, mode) {
@ -36,31 +32,12 @@ export function getAddressesByAccount(coin, mode) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(updateErrosStack('activeHandle'));
dispatch(
triggerToaster(
@ -72,13 +49,6 @@ export function getAddressesByAccount(coin, mode) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(
getAddressesByAccountState(
json,

30
react/src/actions/actions/iguanaHelpers.js

@ -1,7 +1,3 @@
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
import { checkAC } from '../../components/addcoin/payload';
@ -29,31 +25,12 @@ export function iguanaHashHex(data, dispatch) {
if (Config.cli.default) {
resolve(true);
} else {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'iguanaHashHex',
@ -64,13 +41,6 @@ export function iguanaHashHex(data, dispatch) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
resolve(json.hex);
})
}

20
react/src/actions/actions/iguanaInstance.js

@ -1,8 +1,4 @@
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function restartIguanaInstance(pmid) {
@ -28,22 +24,6 @@ export function restartIguanaInstance(pmid) {
});
}
export function restartBasiliskInstance() {
return dispatch => {
getIguanaInstancesList()
.then(function(json) {
for (let port in json.result) {
if (json.result[port].mode === 'basilisk') {
restartIguanaInstance(json.result[port].pmid)
.then(function(json) {
console.log('restartBasiliskInstance', json);
});
}
}
});
}
}
export function startIguanaInstance(mode, coin) {
return new Promise((resolve, reject) => {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/forks`, {

4
react/src/actions/actions/interest.js

@ -1,10 +1,6 @@
import {
triggerToaster
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getListUnspent(coin) {

4
react/src/actions/actions/jumblr.js

@ -2,10 +2,6 @@ import {
triggerToaster,
getNewKMDAddresses
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
function getNewAddress(coin) { // TODO: remove(?)

61
react/src/actions/actions/log.js

@ -1,61 +0,0 @@
import { LOG_GUI_HTTP } from '../storeType';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
export function logGuiHttp(payload) {
return dispatch => {
dispatch(guiLogState(payload));
// disabled for now
/*return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/guilog`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster('logGuiHttp', 'Error', 'error'));
})
.then(response => response.json())*/
}
}
export function getAgamaLog(type) {
return dispatch => {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/getlog?type=${type}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
})
.catch(function(error) {
console.log(error);
dispatch(
triggerToaster(
'getAgamaLog',
'Error',
'error'
)
);
})
.then(response => response.json())
}
}
export function guiLogState(logData) {
return {
type: LOG_GUI_HTTP,
timestamp: logData.timestamp,
log: {
timestamp: logData.timestamp,
function: logData.function,
httpMethod: logData.type,
url: logData.url,
payload: logData.payload,
status: logData.status,
response: logData.response,
}
}
}

30
react/src/actions/actions/logout.js

@ -4,10 +4,6 @@ import {
} from '../storeType';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState
} from './log';
function logoutState(json) {
sessionStorage.removeItem('IguanaActiveAccount');
@ -38,31 +34,12 @@ function walletLock() {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'walletLock',
@ -73,13 +50,6 @@ function walletLock() {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(logoutState(json));
dispatch(logoutResetAppState());
})

30
react/src/actions/actions/nativeBalance.js

@ -4,10 +4,6 @@ import {
getPassthruAgent
} from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState
} from './log';
export function getKMDBalanceTotal(coin) {
let payload;
@ -41,18 +37,6 @@ export function getKMDBalanceTotal(coin) {
}
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
@ -74,13 +58,6 @@ export function getKMDBalanceTotal(coin) {
)
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getKMDBalanceTotal',
@ -91,13 +68,6 @@ export function getKMDBalanceTotal(coin) {
})
.then(response => response.json())
.then(function(json) { // TODO: figure out why komodod spits out "parse error"
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
if (json &&
!json.error) {
dispatch(getNativeBalancesState(json));

67
react/src/actions/actions/nativeDashboardUpdate.js

@ -0,0 +1,67 @@
import {
triggerToaster,
} from '../actionCreators';
import Config from '../../config';
import { DASHBOARD_UPDATE } from '../storeType';
export function getDashboardUpdate(coin, activeCoinProps) {
return dispatch => {
const _fetchConfig = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ coin: coin }),
};
return fetch(
`http://127.0.0.1:${Config.agamaPort}/shepherd/native/dashboard/update`,
_fetchConfig
)
.catch(function(error) {
console.log(error);
dispatch(
triggerToaster(
'getDashboardUpdate',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
dispatch(getDashboardUpdateState(json, coin));
// dirty hack to trigger dashboard render
if (!activeCoinProps.balance &&
!activeCoinProps.addresses) {
setTimeout(() => {
dispatch(getDashboardUpdateState(json, coin));
}, 100);
}
})
}
}
export function getDashboardUpdateState(json, coin) {
let _listtransactions = json.result['listtransactions'];
if (_listtransactions &&
_listtransactions.error) {
_listtransactions = null;
} else if (_listtransactions && _listtransactions.result && _listtransactions.result.length) {
_listtransactions = _listtransactions.result;
} else if (!_listtransactions || (!_listtransactions.result || !_listtransactions.result.length)) {
_listtransactions = 'no data';
}
return {
type: DASHBOARD_UPDATE,
progress: json.result['getinfo'].result,
opids: json.result['z_getoperationstatus'].result,
txhistory: _listtransactions,
balance: json.result['z_gettotalbalance'].result,
addresses: json.result['addresses'],
coin: coin,
};
}

30
react/src/actions/actions/nativeNewAddress.js

@ -5,10 +5,6 @@ import {
getKMDAddressesNative
} from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState
} from './log';
export function getNewKMDAddresses(coin, pubpriv, mode) {
let payload;
@ -34,18 +30,6 @@ export function getNewKMDAddresses(coin, pubpriv, mode) {
}
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
@ -73,13 +57,6 @@ export function getNewKMDAddresses(coin, pubpriv, mode) {
)
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getNewKMDAddresses',
@ -93,13 +70,6 @@ export function getNewKMDAddresses(coin, pubpriv, mode) {
if (Config.cli.default) {
json = json.result;
}
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(
triggerToaster(
json.result ? json.result : json,

61
react/src/actions/actions/nativeSend.js

@ -5,10 +5,6 @@ import {
getPassthruAgent,
iguanaHashHex
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function sendNativeTx(coin, _payload) {
@ -47,18 +43,6 @@ export function sendNativeTx(coin, _payload) {
};
}
const _timestamp = Date.now();
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),
@ -110,13 +94,6 @@ export function sendNativeTx(coin, _payload) {
)
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'sendNativeTx',
@ -130,14 +107,6 @@ export function sendNativeTx(coin, _payload) {
return _response;
})
.then(function(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`,
@ -230,18 +199,6 @@ export function getKMDOPID(opid, coin) {
};
}
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
@ -251,7 +208,7 @@ export function getKMDOPID(opid, coin) {
payload = {
mode: null,
chain: coin,
cmd: 'z_getoperationstatus'
cmd: 'z_getoperationstatus',
};
_fetchConfig = {
@ -269,13 +226,6 @@ export function getKMDOPID(opid, coin) {
)
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getKMDOPID',
@ -289,13 +239,6 @@ export function getKMDOPID(opid, coin) {
if (Config.cli.default) {
json = json.result;
}
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(getKMDOPIDState(json));
})
})
@ -342,6 +285,6 @@ export function sendToAddressPromise(coin, address, amount) {
.then(response => response.json())
.then(json => {
resolve(json);
})
});
});
}

58
react/src/actions/actions/nativeSyncInfo.js

@ -5,41 +5,19 @@ import {
getDebugLog,
toggleCoindDownModal
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
// TODO: use debug.log instead
export function getSyncInfoNativeKMD(skipDebug, json) {
const coin = 'KMD';
// https://www.kmd.host/
return dispatch => {
const _timestamp = Date.now();
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}`, {
Config.iguanaLessMode ? 'https://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}`, {
method: 'GET',
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
/*dispatch(
triggerToaster(
'getSyncInfoNativeKMD',
@ -52,13 +30,6 @@ export function getSyncInfoNativeKMD(skipDebug, json) {
})
.then(response => response.json())
.then(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() {
@ -111,17 +82,6 @@ export function getSyncInfoNative(coin, skipDebug) {
}
return dispatch => {
const _timestamp = Date.now();
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),
@ -143,13 +103,6 @@ export function getSyncInfoNative(coin, skipDebug) {
)
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getSyncInfo',
@ -206,13 +159,6 @@ export function getSyncInfoNative(coin, skipDebug) {
}
}
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(
getSyncInfoNativeState(
json,

30
react/src/actions/actions/nativeTxHistory.js

@ -4,10 +4,6 @@ import {
getNativeTxHistoryState
} from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState
} from './log';
export function getNativeTxHistory(coin) {
let payload;
@ -32,18 +28,6 @@ export function getNativeTxHistory(coin) {
}
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
@ -71,13 +55,6 @@ export function getNativeTxHistory(coin) {
)
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getNativeTxHistory',
@ -88,13 +65,6 @@ export function getNativeTxHistory(coin) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(getNativeTxHistoryState(json));
})
}

223
react/src/actions/actions/notary.js

@ -1,223 +0,0 @@
import {
DASHBOARD_CONNECT_NOTARIES,
DASHBOARD_GET_NOTARIES_LIST
} from '../storeType';
import { translate } from '../../translate/translate';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState
} from './log';
function initNotaryNodesConSequence(nodes) {
return dispatch => {
Promise.all(nodes.map((node, index) => {
const payload = {
userpass: `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
agent: 'dex',
method: 'getinfo',
symbol: node,
timeout: 10000,
};
return new Promise((resolve, reject) => {
const _timestamp = Date.now();
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);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
`getInfoDexNode+${node}`,
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(
updateNotaryNodeConState(
json,
nodes.length,
index,
node
)
);
})
});
}));
}
}
function updateNotaryNodeConState(json, totalNodes, currentNodeIndex, currentNodeName) {
if (currentNodeIndex === totalNodes - 1) {
return dispatch => {
dispatch(basiliskConnectionState(false));
};
} else {
if (json &&
json.error === 'less than required responses') {
return {
type: DASHBOARD_CONNECT_NOTARIES,
total: totalNodes - 1,
current: currentNodeIndex,
name: currentNodeName,
failedNode: currentNodeName,
}
} else {
return {
type: DASHBOARD_CONNECT_NOTARIES,
total: totalNodes - 1,
current: currentNodeIndex,
name: currentNodeName,
}
}
}
}
function connectAllNotaryNodes(json, dispatch) {
if (json &&
json.length) {
dispatch(initNotaryNodesConSequence(json));
return {
type: DASHBOARD_CONNECT_NOTARIES,
total: json.length - 1,
current: 0,
name: json[0],
}
}
}
export function connectNotaries() {
const payload = {
userpass: `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
agent: 'dpow',
method: 'notarychains',
};
return dispatch => {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(
triggerToaster(
'connectNotaries',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(
json => dispatch(
connectAllNotaryNodes(json, dispatch)
)
)
}
}
function getDexNotariesState(json) {
if (json.error === 'less than required responses') {
return dispatch => {
dispatch(
triggerToaster(
translate('TOASTR.LESS_RESPONSES_REQ'),
translate('TOASTR.BASILISK_NOTIFICATION'),
'error'
)
);
}
} else {
return {
type: DASHBOARD_GET_NOTARIES_LIST,
notaries: json,
}
}
}
export function getDexNotaries(coin) {
const payload = {
userpass: `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
agent: 'dex',
method: 'getnotaries',
symbol: coin,
};
return dispatch => {
const _timestamp = Date.now();
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);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getDexNotaries',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(getDexNotariesState(json));
})
}
}

4
react/src/actions/actions/openAlias.js

@ -1,8 +1,4 @@
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
export function resolveOpenAliasAddress(email) {
const url = email.replace('@', '.');

110
react/src/actions/actions/sendFullBasilisk.js

@ -5,10 +5,6 @@ import {
getDispatch
} from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState
} from './log';
export function sendToAddress(coin, _payload) {
const payload = {
@ -24,31 +20,12 @@ export function sendToAddress(coin, _payload) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'sendToAddress',
@ -59,13 +36,6 @@ export function sendToAddress(coin, _payload) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(sendToAddressState(json, dispatch));
})
}
@ -86,31 +56,12 @@ export function sendFromAddress(coin, _payload) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'sendFromAddress',
@ -121,13 +72,6 @@ export function sendFromAddress(coin, _payload) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(sendToAddressState(json, dispatch));
})
}
@ -151,31 +95,12 @@ export function iguanaUTXORawTX(data, dispatch) {
};
return new Promise((resolve, reject) => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch => dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'iguanaUTXORawTX',
@ -186,13 +111,6 @@ export function iguanaUTXORawTX(data, dispatch) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
resolve(json);
})
});
@ -208,31 +126,12 @@ export function dexSendRawTX(data, dispatch) {
};
return new Promise((resolve, reject) => {
const _timestamp = Date.now();
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, {
fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'dexSendRawTX',
@ -247,13 +146,6 @@ export function dexSendRawTX(data, dispatch) {
return _response;
})
.then(function(json) {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
resolve(json);
})
});

82
react/src/actions/actions/settings.js

@ -8,10 +8,6 @@ import {
import { translate } from '../../translate/translate';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState
} from './log';
function getAppInfoState(json) {
return {
@ -100,31 +96,12 @@ export function importPrivKey(wifKey) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'importPrivKey',
@ -135,13 +112,6 @@ export function importPrivKey(wifKey) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(
parseImportPrivKeyResponse(
json,
@ -209,31 +179,12 @@ export function getPeersList(coin) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getPeersList',
@ -244,13 +195,6 @@ export function getPeersList(coin) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(getPeersListState(json, dispatch));
})
}
@ -331,31 +275,12 @@ export function addPeerNode(coin, ip) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'addPeerNode',
@ -366,13 +291,6 @@ export function addPeerNode(coin, ip) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(addPeerNodeState(json, dispatch));
})
}

30
react/src/actions/actions/syncInfo.js

@ -1,10 +1,6 @@
import { SYNCING_FULL_MODE } from '../storeType';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState
} from './log';
// TODO: add custom json parser
function getSyncInfoState(json) {
@ -30,31 +26,12 @@ export function getSyncInfo(coin) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'getSyncInfo',
@ -69,13 +46,6 @@ export function getSyncInfo(coin) {
return _response;
})
.then(function(json) {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
if (json.indexOf('coin is busy processing') === -1) {
dispatch(getSyncInfoState(json, dispatch));
}

4
react/src/actions/actions/syncOnly.js

@ -5,10 +5,6 @@ import {
import { translate } from '../../translate/translate';
import Config from '../../config';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
export function toggleSyncOnlyModal(display) {
return {

4
react/src/actions/actions/sysInfo.js

@ -1,9 +1,5 @@
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState
} from './log';
export function shepherdGetSysInfo() {
return dispatch => {

4
react/src/actions/actions/update.js

@ -1,9 +1,5 @@
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState
} from './log';
export function checkForUpdateUIPromise() {
return new Promise((resolve, reject) => {

126
react/src/actions/actions/walletAuth.js

@ -9,10 +9,6 @@ import {
getMainAddressState,
updateErrosStack
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
export function encryptWallet(_passphrase, cb, coin) {
const payload = {
@ -23,31 +19,12 @@ export function encryptWallet(_passphrase, cb, coin) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'encryptWallet',
@ -59,13 +36,6 @@ export function encryptWallet(_passphrase, cb, coin) {
.then(dispatch(walletPassphrase(_passphrase)))
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(
cb.call(
this,
@ -87,31 +57,12 @@ export function walletPassphrase(_passphrase) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'walletPassphrase',
@ -121,13 +72,6 @@ export function walletPassphrase(_passphrase) {
);
})
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
})
}
}
@ -143,31 +87,12 @@ export function iguanaWalletPassphrase(_passphrase) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(_payload),
})
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(
triggerToaster(
'Error iguanaWalletPassphrase',
@ -178,13 +103,6 @@ export function iguanaWalletPassphrase(_passphrase) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
dispatch(iguanaWalletPassphraseState(json, dispatch));
});
}
@ -198,18 +116,6 @@ export function iguanaActiveHandle(getMainAddress) {
};
return dispatch => {
const _timestamp = Date.now();
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',
body: JSON.stringify(_payload),
@ -230,13 +136,6 @@ export function iguanaActiveHandle(getMainAddress) {
)
.catch(function(error) {
console.log(error);
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'error',
response: error,
}));
}
dispatch(updateErrosStack('activeHandle'));
dispatch(
triggerToaster(
@ -248,13 +147,6 @@ export function iguanaActiveHandle(getMainAddress) {
})
.then(response => response.json())
.then(json => {
if (Config.debug) {
dispatch(logGuiHttp({
timestamp: _timestamp,
status: 'success',
response: json,
}));
}
if (!Config.iguanaLessMode &&
sessionStorage.getItem('IguanaActiveAccount') &&
JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey === json.pubkey &&
@ -266,15 +158,17 @@ export function iguanaActiveHandle(getMainAddress) {
}
}
export function iguanaWalletPassphraseState(json, dispatch) {
export function iguanaWalletPassphraseState(json, dispatch, skipToastr) {
sessionStorage.setItem('IguanaActiveAccount', JSON.stringify(json));
dispatch(
triggerToaster(
translate('TOASTR.LOGIN_SUCCESSFULL'),
translate('TOASTR.ACCOUNT_NOTIFICATION'),
'success'
)
);
if (!skipToastr) {
dispatch(
triggerToaster(
translate('TOASTR.LOGIN_SUCCESSFULL'),
translate('TOASTR.ACCOUNT_NOTIFICATION'),
'success'
)
);
}
dispatch(getMainAddressState(json));
dispatch(iguanaActiveHandleState(json));

5
react/src/actions/storeType.js

@ -30,9 +30,7 @@ export const DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS = 'DASHBOARD_ACTIVE_COIN_NATIVE_
export const DASHBOARD_ACTIVE_COIN_SENDTO = 'DASHBOARD_ACTIVE_COIN_SENDTO';
export const DASHBOARD_ACTIVE_COIN_GET_CACHE = 'DASHBOARD_ACTIVE_COIN_GET_CACHE';
export const DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR = 'DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR';
export const DASHBOARD_GET_NOTARIES_LIST = 'DASHBOARD_GET_NOTARIES_LIST';
export const DASHBOARD_DISPLAY_NOTARIES_MODAL = 'DASHBOARD_DISPLAY_NOTARIES_MODAL';
export const DASHBOARD_CONNECT_NOTARIES = 'DASHBOARD_CONNECT_NOTARIES';
export const DASHBOARD_UPDATE = 'DASHBOARD_UPDATE';
export const VIEW_CACHE_DATA = 'VIEW_CACHE_DATA';
export const SYNC_ONLY_MODAL_TOGGLE = 'SYNC_ONLY_MODAL_TOGGLE';
export const SYNC_ONLY_DATA = 'SYNC_ONLY_DATA';
@ -41,7 +39,6 @@ export const SAVE_APP_CONFIG = 'SAVE_APP_CONFIG';
export const SERVICE_ERROR = 'SERVICE_ERROR';
export const DASHBOARD_ACTIVE_ADDRESS = 'DASHBOARD_ACTIVE_ADDRESS';
export const LOAD_APP_INFO = 'LOAD_APP_INFO';
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';

14
react/src/components/addcoin/addcoin.js

@ -43,6 +43,7 @@ class AddCoin extends React.Component {
display: false,
actionsMenu: false,
modalClassName: 'hide',
isExperimentalOn: false,
};
this.existingCoins = null;
this.activateCoin = this.activateCoin.bind(this);
@ -113,6 +114,16 @@ class AddCoin extends React.Component {
componentWillMount() {
this.addNewItem();
let appConfig;
try {
appConfig = window.require('electron').remote.getCurrentWindow().appConfig;
} catch (e) {}
this.setState({
isExperimentalOn: appConfig.experimentalFeatures,
});
}
componentWillReceiveProps(props) {
@ -363,9 +374,8 @@ const mapStateToProps = (state) => {
ActiveCoin: {
coin: state.ActiveCoin.coin,
},
AddCoin: state.AddCoin,
AddCoin: state.AddCoin,
};
};
export default connect(mapStateToProps)(AddCoin);

59
react/src/components/addcoin/addcoin.scss

@ -1,5 +1,43 @@
.add-coin-modal {
color: #757575;
.modal-body {
max-height: 590px;
overflow-y: auto;
}
.multi {
.col-sm-8 {
width: 30%;
}
.col-sm-12 {
&.text-center {
width: 60%;
padding: 0;
.col-lg-4 {
width: 25%;
margin-right: 8%;
padding: 0;
.input{
&.to-labelauty+label {
max-width: 136px;
}
}
}
.col-lg-4 {
&:last-child {
margin-right: 0;
}
}
.col-sm-1 {
width: 44px;
padding: 0;
}
}
}
}
}
.vertical-margin-20 {
@ -24,4 +62,25 @@
margin: 0;
}
}
}
.btn-add-coin-item,
.btn-add-coin-item-options,
.btn-save-coin-selection,
.btn-load-coin-selection {
position: absolute;
right: 32px;
z-index: 50;
}
.btn-add-coin-item {
right: 60px;
}
.btn-add-coin-item-options {
padding: 6px;
}
.btn-save-coin-selection {
top: 60px;
}
.btn-load-coin-selection {
top: 95px;
}

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

@ -3,25 +3,37 @@ import { translate } from '../../translate/translate';
class AddCoinOptionsAC extends React.Component {
render() {
const _assetChains = [
'bet',
'bots',
'ceal',
'coqui',
'crypto',
'hodl',
'dex',
'jumblr',
'kv',
'mgw',
//'mvp',
'pangea',
'revs',
'shark',
'supernet',
'wlc'
];
let _items = [];
for (let i = 0; i < _assetChains.length; i++) {
_items.push(
<option
key={ _assetChains[i] }
value={ `${_assetChains[i].toUpperCase()}|basilisk|native` }>{ translate(`ASSETCHAINS.${_assetChains[i].toUpperCase()}`) }</option>
);
}
return (
<optgroup label={ translate('ADD_COIN.ASSETCHAINS') }>
<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="HODL|basilisk|native">HODL (HODL)</option>
<option value="DEX|basilisk|native">InstantDEX (DEX)</option>
<option value="JUMBLR|basilisk|native">JUMBLR (JUMBLR)</option>
<option value="KV|basilisk|native">KV (KV)</option>
<option value="MGW|basilisk|native">MultiGateway (MGW)</option>
<option value="MVP|basilisk|native" className="hide">MVP Lineup (MVP)</option>
<option value="PANGEA|basilisk|native">PANGEA (PANGEA)</option>
<option value="REVS|basilisk|native">REVS (REVS)</option>
<option value="SHARK|basilisk|native">SHARK (SHARK)</option>
<option value="MESH|basilisk|native">SpaceMesh (MESH)</option>
<option value="SUPERNET|basilisk|native">SUPERNET (SUPERNET)</option>
<option value="WLC|basilisk|native">WIRELESS (WIRELESS)</option>
{ _items }
</optgroup>
);
}

77
react/src/components/addcoin/addcoinOptionsACFiat.js

@ -3,40 +3,53 @@ import { translate } from '../../translate/translate';
class AddCoinOptionsACFiat extends React.Component {
render() {
const _fiat = [
'aud',
'brl',
'gbp',
'bgn',
'cad',
'hrk',
'czk',
'cny',
'dkk',
'eur',
'hkd',
'huf',
'inr',
'idr',
'ils',
'jpy',
'krw',
'myr',
'mxn',
'nzd',
'nok',
'php',
'pln',
'ron',
'rub',
'sgd',
'zar',
'sek',
'chf',
'thb',
'try',
'usd'
];
let _items = [];
for (let i = 0; i < _fiat.length; i++) {
_items.push(
<option
key={ _fiat[i] }
value={ `${_fiat[i].toUpperCase()}|basilisk|native` }>{ translate(`FIAT_CURRENCIES.${_fiat[i].toUpperCase()}`) }</option>
);
}
return (
<optgroup label={ translate('ADD_COIN.FIAT_CURRENCIES') }>
<option value="AUD|basilisk|native">Australian Dollar (AUD)</option>
<option value="BRL|basilisk|native">Brazilian Real (BRL)</option>
<option value="GBP|basilisk|native">British Pound (GBP)</option>
<option value="BGN|basilisk|native">Bulgarian Lev (BGN)</option>
<option value="CAD|basilisk|native">Canadian Dollar (CAD)</option>
<option value="HRK|basilisk|native">Croatian Kuna (HRK)</option>
<option value="CZK|basilisk|native">Czech Koruna (CZK)</option>
<option value="CNY|basilisk|native">Chinese Yuan (CNY)</option>
<option value="DKK|basilisk|native">Danish Krone (DKK)</option>
<option value="EUR|basilisk|native">Euro (EUR)</option>
<option value="HKD|basilisk|native">Hong Kong Dollar (HKD)</option>
<option value="HUF|basilisk|native">Hungarian Forint (HUF)</option>
<option value="INR|basilisk|native">Indian Rupee (INR)</option>
<option value="IDR|basilisk|native">Indonesian Rupiah (IDR)</option>
<option value="ILS|basilisk|native">Israeli Shekel (ILS)</option>
<option value="JPY|basilisk|native">Japanese Yen (JPY)</option>
<option value="KRW|basilisk|native">Korean Won (KRW)</option>
<option value="MYR|basilisk|native">Malaysian Ringgit (MYR)</option>
<option value="MXN|basilisk|native">Mexican peso (MXN)</option>
<option value="NZD|basilisk|native">New Zealand Dollar (NZD)</option>
<option value="NOK|basilisk|native">Norwegian Krone (NOK)</option>
<option value="PHP|basilisk|native">Philippine Peso (PHP)</option>
<option value="PLN|basilisk|native">Polish Zloty (PLN)</option>
<option value="RON|basilisk|native">Romanian Leu (RON)</option>
<option value="RUB|basilisk|native">Russian Ruble (RUB)</option>
<option value="SGD|basilisk|native">Singapore Dollar (SGD)</option>
<option value="ZAR|basilisk|native">South African Rand (ZAR)</option>
<option value="SEK|basilisk|native">Swedish Krona (SEK)</option>
<option value="CHF|basilisk|native">Swiss Franc (CHF)</option>
<option value="THB|basilisk|native">Thai Baht (THB)</option>
<option value="TRY|basilisk|native">Turkish Lira (TRY)</option>
<option value="USD|basilisk|native">US Dollar (USD)</option>
{ _items }
</optgroup>
);
}

44
react/src/components/addcoin/addcoinOptionsCrypto.js

@ -12,50 +12,61 @@ class AddCoinOptionsCrypto extends React.Component {
}
render() {
const isWindows = this.props.appSettings && this.props.appSettings.appInfo && this.props.appSettings.appInfo.sysInfo && this.props.appSettings.appInfo.sysInfo.platform === 'win32';
// const isWindows = this.props.appSettings && this.props.appSettings.appInfo && this.props.appSettings.appInfo.sysInfo && this.props.appSettings.appInfo.sysInfo.platform === 'win32';
let appConfig;
try {
appConfig = window.require('electron').remote.getCurrentWindow().appConfig;
} catch (e) {}
//<option value="ANC|full">AnonCoin (ANC)</option>
//<option value="MZC|full">MazaCoin (MZC)</option>
//<option value="SYS|full">SysCoin (SYS)</option>
return (
<optgroup label={ translate('ADD_COIN.CRYPTO_CURRENCIES') }>
<option
value="ANC|full"
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>AnonCoin (ANC)</option>
<option
value="BTCD|full"
className={ this.state.nativeOnly || isWindows ? 'hide' : '' }>BitcoinDark (BTCD)</option>
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>BitcoinDark (BTCD)</option>
<option
value="BTC|full"
className={ this.state.nativeOnly || isWindows ? 'hide' : '' }>Bitcoin (BTC)</option>
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Bitcoin (BTC)</option>
<option
value="BTM|full"
className={ this.state.nativeOnly || isWindows ? 'hide' : '' }>Bitmark (BTM)</option>
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Bitmark (BTM)</option>
<option
value="CARB|full"
className={ this.state.nativeOnly || isWindows ? 'hide' : '' }>Carboncoin (CARB)</option>
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Carboncoin (CARB)</option>
<option
value="DGB|full"
className={ this.state.nativeOnly || isWindows ? 'hide' : '' }>Digibyte (DGB)</option>
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Digibyte (DGB)</option>
<option
value="DOGE|full"
className={ this.state.nativeOnly || isWindows ? 'hide' : '' }>Dogecoin (DOGE)</option>
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Dogecoin (DOGE)</option>
<option
value="FRK|full"
className={ this.state.nativeOnly || isWindows ? 'hide' : '' }>Franko (FRK)</option>
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Franko (FRK)</option>
<option
value="GAME|full"
className={ this.state.nativeOnly || isWindows ? 'hide' : '' }>Gamecredits (GAME)</option>
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Gamecredits (GAME)</option>
<option value="KMD|basilisk|native">Komodo (KMD)</option>
<option
value="MZC|full"
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>MazaCoin (MZC)</option>
<option
value="LTC|full"
className={ this.state.nativeOnly || isWindows ? 'hide' : '' }>Litecoin (LTC)</option>
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Litecoin (LTC)</option>
<option
value="SYS|full"
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>SysCoin (SYS)</option>
<option
value="UNO|full"
className={ this.state.nativeOnly || isWindows ? 'hide' : '' }>Unobtanium (UNO)</option>
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Unobtanium (UNO)</option>
<option
value="ZEC|full"
className={ this.state.nativeOnly || isWindows ? 'hide' : '' }>Zcash (ZEC)</option>
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Zcash (ZEC)</option>
<option
value="ZET|full"
className={ this.state.nativeOnly || isWindows ? 'hide' : '' }>Zetacoin (ZET)</option>
className={ this.state.nativeOnly || !appConfig.experimentalFeatures ? 'hide' : '' }>Zetacoin (ZET)</option>
</optgroup>
);
}
@ -65,7 +76,6 @@ const mapStateToProps = (state) => {
return {
appSettings: state.appSettings,
};
};
export default connect(mapStateToProps)(AddCoinOptionsCrypto);

8
react/src/components/addcoin/coin-selectors.render.js

@ -5,7 +5,8 @@ import AddCoinOptionsAC from '../addcoin/addcoinOptionsAC';
import AddCoinOptionsACFiat from '../addcoin/addcoinOptionsACFiat';
const CoinSelectorsRender = function(item, coin, i) {
const isWindows = this.props.Settings && this.props.Settings.appInfo && this.props.Settings.appInfo.sysInfo && this.props.Settings.appInfo.sysInfo.platform === 'win32';
// const isWindows = this.props.Settings && this.props.Settings.appInfo && this.props.Settings.appInfo.sysInfo && this.props.Settings.appInfo.sysInfo.platform === 'win32';
const hideFullModeBtn = item && item.selectedCoin && item.selectedCoin.indexOf('|full') === -1 || !this.state.isExperimentalOn ? true : false;
return (
<div
@ -54,7 +55,7 @@ const CoinSelectorsRender = function(item, coin, i) {
</button>
</div>
<div className="col-sm-11 text-center add-coin-modes">
<div className={ this.state.nativeOnly || isWindows ? 'hide' : 'form-group col-lg-4 col-md-4 col-sm-6 col-xs-6 style-addcoin-lbl-mdl-login' }>
<div className={ this.state.nativeOnly || hideFullModeBtn ? 'hide' : 'form-group col-lg-4 col-md-4 col-sm-6 col-xs-6 style-addcoin-lbl-mdl-login' }>
<input
type="radio"
className="to-labelauty labelauty"
@ -169,7 +170,7 @@ const CoinSelectorsRender = function(item, coin, i) {
</select>
</div>
</div>
<div className={ item.mode === '1' || item.mode === 1 ? 'col-sm-12' : 'hide' }>
<div className={ (item.mode === '1' || item.mode === 1) && this.state.isExperimentalOn ? 'col-sm-12' : 'hide' }>
<div className="toggle-box padding-top-3 padding-bottom-10">
<span className="pointer">
<label className="switch">
@ -191,4 +192,5 @@ const CoinSelectorsRender = function(item, coin, i) {
</div>
)
};
export default CoinSelectorsRender;

1
react/src/components/app/app.js

@ -14,7 +14,6 @@ function mapStateToProps(state) {
Settings: state.Settings,
Interval: state.Interval,
SyncOnly: state.SyncOnly,
Errors: state.Errors,
};
}

3
react/src/components/dashboard/atomic/atomic.js

@ -502,9 +502,8 @@ const mapStateToProps = (state) => {
return {
Atomic: {
response: state.Atomic.response,
}
},
};
};
export default connect(mapStateToProps)(Atomic);

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

@ -24,6 +24,7 @@ class ClaimInterestModal extends React.Component {
isLoading: true,
transactionsList: [],
showZeroInterest: true,
totalInterest: 0,
};
this.claimInterestTableRender = this.claimInterestTableRender.bind(this);
this.toggleZeroInterest = this.toggleZeroInterest.bind(this);
@ -37,6 +38,7 @@ class ClaimInterestModal extends React.Component {
loadListUnspent() {
let _transactionsList = [];
let _totalInterest = 0;
getListUnspent(this.props.ActiveCoin.coin)
.then((json) => {
@ -52,11 +54,13 @@ class ClaimInterestModal extends React.Component {
interest: json[i].interest,
txid: json[i].txid,
});
_totalInterest =+ json[i].interest;
if (i === json.length - 1) {
this.setState({
transactionsList: _transactionsList,
isLoading: false,
totalInterest: _totalInterest,
});
}
});
@ -142,10 +146,9 @@ const mapStateToProps = (state) => {
activeSection: state.ActiveCoin.activeSection,
},
Dashboard: {
displayClaimInterestModal: state.Dashboard.displayClaimInterestModal
}
displayClaimInterestModal: state.Dashboard.displayClaimInterestModal,
},
};
};
export default connect(mapStateToProps)(ClaimInterestModal);

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

@ -39,7 +39,12 @@ export const _ClaimInterestTableRender = function() {
return (
<span>
<div className="padding-bottom-20">
<strong>{ translate('CLAIM_INTEREST.REQ_P1') }:</strong> { translate('CLAIM_INTEREST.REQ_P2') } <strong>10 KMD</strong>
<p>
<strong>{ translate('CLAIM_INTEREST.REQ_P1') }:</strong> { translate('CLAIM_INTEREST.REQ_P2') } <strong>10 KMD</strong>
</p>
<p>
<strong>{ translate('CLAIM_INTEREST.TIP') }:</strong> { translate('CLAIM_INTEREST.TIP_DESC') }
</p>
</div>
<div className="text-left padding-top-10 padding-bottom-10">
<label className="switch">
@ -55,13 +60,13 @@ export const _ClaimInterestTableRender = function() {
onClick={ this.toggleZeroInterest }>
Show zero interest
</div>
<button
type="button"
className="btn btn-success waves-effect waves-light claim-btn"
onClick={ () => this.claimInterest() }>
<i className="icon fa-dollar"></i> { translate('CLAIM_INTEREST.CLAIM_INTEREST', `${this.state.totalInterest} KMD `) }
</button>
</div>
<button
type="button"
className="btn btn-success waves-effect waves-light claim-btn"
onClick={ () => this.claimInterest() }>
<i className="icon fa-dollar"></i> { translate('CLAIM_INTEREST.CLAIM_INTEREST') }
</button>
<div className="table-scroll">
<table className="table table-hover dataTable table-striped">
<thead>
@ -69,7 +74,7 @@ export const _ClaimInterestTableRender = function() {
<th></th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.AMOUNT') }</th>
<th>{ translate('INDEX.Address') }</th>
<th>{ translate('INDEX.INTEREST') }</th>
<th>Locktime</th>
</tr>
</thead>
@ -81,7 +86,7 @@ export const _ClaimInterestTableRender = function() {
<th></th>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.AMOUNT') }</th>
<th>{ translate('INDEX.Address') }</th>
<th>{ translate('INDEX.INTEREST') }</th>
<th>Locktime</th>
</tr>
</tfoot>
@ -104,7 +109,7 @@ export const ClaimInterestModalRender = function() {
onClick={ this.closeModal }>
<span>×</span>
</button>
<h4 className="modal-title white text-left">{ translate('INDEX.CLAIM_INTEREST') }</h4>
<h4 className="modal-title white text-left">{ translate('CLAIM_INTEREST.CLAIM_INTEREST') }</h4>
</div>
<div className="modal-body">
<i

47
react/src/components/dashboard/claimInterestModal/claimInterestModal.scss

@ -0,0 +1,47 @@
.modal-claim-interest {
.modal-dialog {
width: 70%;
.table > tbody > tr > td,
.table > tbody > tr > th,
.table > tfoot > tr > td,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > thead > tr > th {
padding: 8px 30px 8px 0;
}
.claim-btn {
float: right;
margin-bottom: 30px;
}
.table-scroll {
height: 366px;
overflow-y: auto;
overflow-x: hidden;
width: 100%;
}
.bold {
font-weight: bold;
}
.green {
color: #66bb6a;
}
.red {
color: #f96868;
}
.locktime {
i {
font-size: 20px;
line-height: 1.1;
}
}
.refresh-icon {
position: absolute;
right: 20px;
font-size: 20px;
z-index: 100;
}
}
}

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

@ -53,8 +53,7 @@ class CoinTile extends React.Component {
<CoinTileItem
key={ i }
i={ i }
item={ item }
/>)
item={ item } />)
);
}
@ -66,7 +65,6 @@ const mapStateToProps = (state) => {
return {
allCoins: state.Main.coins,
};
};
export default connect(mapStateToProps)(CoinTile);

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

@ -18,7 +18,8 @@ import {
getNativeTxHistory,
getKMDBalanceTotal,
getSyncInfoNative,
getDebugLog
getDebugLog,
getDashboardUpdate
} from '../../../actions/actionCreators';
import Store from '../../../store';
import Config from '../../../config';
@ -39,11 +40,40 @@ class CoinTileItem extends React.Component {
// 2) limit amount of req per update e.g. list of addresses don't change too often
// 3) limit req in basilisk as much as possible incl. activehandle
componentWillMount() {
if (!this.props.ActiveCoin.coin) {
let _coinSelected = false;
let _mode;
let _coin;
const modes = [
'native',
'basilisk',
'full'
];
const allCoins = this.props.Main.coins;
if (allCoins) {
modes.map((mode) => {
allCoins[mode].map((coin) => {
if (!_coinSelected) {
_coinSelected = true;
_coin = coin;
_mode = mode;
}
});
});
setTimeout(() => {
this._dashboardChangeActiveCoin(_coin, _mode);
}, 100);
}
}
}
dispatchCoinActions(coin, mode) {
if (mode === 'native') {
Store.dispatch(iguanaActiveHandle(true));
const _propsDashboard = this.props.Dashboard;
const syncPercentage = _propsDashboard && _propsDashboard.progress && (parseFloat(parseInt(_propsDashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2)).replace('NaN', 0);
const _propsDashboard = this.props.ActiveCoin;
const syncPercentage = _propsDashboard && _propsDashboard.progress && (parseFloat(parseInt(_propsDashboard.progress.blocks, 10) * 100 / parseInt(_propsDashboard.progress.longestchain, 10)).toFixed(2)).replace('NaN', 0);
if (syncPercentage < 100 &&
!this.props.Dashboard.displayCoindDownModal) {
@ -56,10 +86,7 @@ class CoinTileItem extends React.Component {
syncPercentage &&
(Config.iguanaLessMode || syncPercentage >= NATIVE_MIN_SYNC_PERCENTAGE_THRESHOLD)) {
Store.dispatch(getSyncInfoNative(coin, true));
Store.dispatch(getKMDBalanceTotal(coin));
Store.dispatch(getNativeTxHistory(coin));
Store.dispatch(getKMDAddressesNative(coin, mode));
Store.dispatch(getKMDOPID(null, coin));
Store.dispatch(getDashboardUpdate(coin, _propsDashboard));
} else {
Store.dispatch(getSyncInfoNative(coin));
}
@ -104,7 +131,7 @@ class CoinTileItem extends React.Component {
}
}
dashboardChangeActiveCoin(coin, mode) {
_dashboardChangeActiveCoin(coin, mode) {
if (coin !== this.props.ActiveCoin.coin) {
Store.dispatch(dashboardChangeActiveCoin(coin, mode));
setTimeout(() => {
@ -205,14 +232,15 @@ const mapStateToProps = (state) => {
ActiveCoin: {
coin: state.ActiveCoin.coin,
addresses: state.ActiveCoin.addresses,
mainBasiliskAddress: state.ActiveCoin.mainBasiliskAddress
mainBasiliskAddress: state.ActiveCoin.mainBasiliskAddress,
progress: state.ActiveCoin.progress,
},
Dashboard: state.Dashboard,
Interval: {
interval: state.Interval.interval
}
interval: state.Interval.interval,
},
Main: state.Main,
};
};
export default connect(mapStateToProps)(CoinTileItem);

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

@ -8,7 +8,7 @@ const CoinTileItemRender = function() {
<div className={ 'widget widget-shadow' + (this.props.ActiveCoin.coin === item.coin ? ' active' : '') }>
<div
className="widget-content text-center bg-white padding-20"
onClick={ () => this.dashboardChangeActiveCoin(item.coin, item.mode) }>
onClick={ () => this._dashboardChangeActiveCoin(item.coin, item.mode) }>
<a className="avatar margin-bottom-5">
<img
className="img-responsive"

7
react/src/components/dashboard/coindDownModal/coindDownModal.js

@ -37,10 +37,13 @@ class CoindDownModal extends React.Component {
}
const mapStateToProps = (state) => {
return {
ActiveCoin: {
mode: state.ActiveCoin.mode,
coin: state.ActiveCoin.coin,
},
displayCoindDownModal: state.Dashboard.displayCoindDownModal,
debugLog: state.Settings.debugLog
debugLog: state.Settings.debugLog,
};
};
export default connect(mapStateToProps)(CoindDownModal);

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

@ -1,7 +1,7 @@
import React from 'react';
import { translate } from '../../../translate/translate';
const CoindDownModalRender = function () {
const CoindDownModalRender = function() {
return (
<div>
<div

24
react/src/components/dashboard/coindDownModal/coindDownModal.scss

@ -0,0 +1,24 @@
.coind-down-modal {
.modal-body {
height: 60vh;
> div {
height: 100%;
}
.form-group {
&.form-material {
&.floating {
height: 80%;
}
}
}
.page-content {
width: 90%;
height: 100%;
textarea {
height: 100%;
}
}
}
}

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

@ -429,9 +429,8 @@ const mapStateToProps = (state) => {
return {
ActiveCoin: {
coin: state.ActiveCoin.coin,
}
},
};
};
export default connect(mapStateToProps)(Jumblr);

89
react/src/components/dashboard/jumblr/jumblr.scss

@ -0,0 +1,89 @@
.jumblr {
p {
width: calc(100% - 100px);
}
.breadcrumb {
padding: 8px 30px;
position: relative;
top: 0;
}
.img-responsive {
position: absolute;
top: -28px;
right: 18px;
.coin {
font-size: 30px;
position: relative;
left: -18px;
top: 4px;
}
.image {
width: 60px;
}
}
.header-easydex-section {
img {
max-width: inherit;
}
}
.copy-string-btn {
position: absolute;
right: 36px;
margin-top: -68px;
}
.btn-next {
position: absolute;
top: 60px;
right: 32px;
}
input.labelauty+label,
input.labelauty+label {
background: #d6d5d5;
color: #504e4e;
}
input.labelauty:checked+label {
color: #fff;
background-color: #3949ab;
}
input.labelauty + label:hover .labelauty-unchecked,
input.labelauty + label .labelauty-unchecked {
color: #504e4e;
}
.nofloat {
float: none;
display: inline-block;
padding-left: 0;
}
}
.jumblr-mode-selector {
.nav-tabs {
li {
cursor: pointer;
&.active {
> a {
cursor: pointer;
color: #fff;
background-color: #62a8ea;
border-color: transparent;
border-bottom-color: #62a8ea;
}
}
}
}
.panel-heading {
background: #f3f3f3;
cursor: pointer;
}
.panel-title {
color: #676767;
}
.jumblr-addresses-list {
.col-xs-3 {
padding: 0;
}
}
}

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

@ -1,7 +1,7 @@
import React from 'react';
import { translate } from '../../../translate/translate';
const LoginModalRender = function () {
const LoginModalRender = function() {
return (
<div>
<div

3
react/src/components/dashboard/loginSettingsModal/loginSettingsModal.js

@ -32,9 +32,8 @@ class LoginSettingsModal extends React.Component {
const mapStateToProps = (state) => {
return {
Main: state.Main
Main: state.Main,
};
};
export default connect(mapStateToProps)(LoginSettingsModal);

5
react/src/components/dashboard/main/dashboard.js

@ -46,10 +46,9 @@ const mapStateToProps = (state) => {
mode: state.ActiveCoin.mode,
},
Dashboard: {
activeSection: state.Dashboard.activeSection,
}
activeSection: state.Dashboard.activeSection,
},
};
};
export default connect(mapStateToProps)(Dashboard);

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

@ -21,6 +21,7 @@ class Navbar extends React.Component {
this.state = {
openDropMenu: false,
nativeOnly: Config.iguanaLessMode,
isExperimentalOn: false,
};
this.openDropMenu = this.openDropMenu.bind(this);
this.logout = this.logout.bind(this);
@ -34,6 +35,16 @@ class Navbar extends React.Component {
this.handleClickOutside,
false
);
let appConfig;
try {
appConfig = window.require('electron').remote.getCurrentWindow().appConfig;
} catch (e) {}
this.setState({
isExperimentalOn: appConfig.experimentalFeatures,
});
}
componentWillUnmount() {
@ -127,9 +138,8 @@ const mapStateToProps = (state) => {
Interval: {
interval: state.Interval.interval,
},
nativeOnly: Config.iguanaLessMode
nativeOnly: Config.iguanaLessMode,
};
};
export default connect(mapStateToProps)(Navbar);

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

@ -57,7 +57,7 @@ const NavbarRender = function() {
<i className="site-menu-icon"></i> BarterDEX
</a>
</li>
{ this.props.ActiveCoin && this.props.ActiveCoin.mode === 'native' && (this._checkAC() || this.props.ActiveCoin.coin === 'KMD') &&
{ 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
@ -99,7 +99,7 @@ const NavbarRender = function() {
<i className="icon md-settings"></i> { translate('INDEX.SETTINGS') }
</a>
</li>
<li className={ this.state.nativeOnly ? 'hide' : '' }>
<li className={ this.state.nativeOnly || !this.state.isExperimentalOn ? 'hide' : '' }>
<a onClick={ () => this.openSyncOnlyModal() }>
<i className="icon fa-cubes"></i> { translate('ADD_COIN.SYNC_ONLY') }
</a>

122
react/src/components/dashboard/notifications/notifications.js

@ -1,122 +0,0 @@
import React from 'react';
import { connect } from 'react-redux';
import { sortByDate } from '../../../util/sort';
import Config from '../../../config';
import {
NotificationsByTypeRender,
NotificationsModalRender,
NotificationsRender
} from './notifications.render';
class Notifications extends React.Component {
constructor() {
super();
this.state = {
displayModal: false,
calls: {
total: 0,
error: 0,
success: 0,
pending: 0,
},
activeTab: 2,
guiLog: null,
debug: Config.debug,
};
this.toggleNotificationsModal = this.toggleNotificationsModal.bind(this);
}
openTab(tab) {
this.setState(Object.assign({}, this.state, {
activeTab: tab,
}));
}
componentWillReceiveProps(props) {
// get total number of calls per type
if (this.props.Dashboard &&
this.props.Dashboard.guiLog) {
const _guiLog = this.props.Dashboard.guiLog;
let _callsLength = {
total: Object.keys(_guiLog).length,
error: 0,
success: 0,
pending: 0,
}
let guiLogToArray = [];
for (let timestamp in _guiLog) {
guiLogToArray.push(_guiLog[timestamp]);
_callsLength[_guiLog[timestamp].status]++;
}
this.setState(Object.assign({}, this.state, {
calls: {
total: _callsLength.total,
error: _callsLength.error,
success: _callsLength.success,
pending: _callsLength.pending,
},
guiLog: guiLogToArray,
}));
}
}
renderNotificationsByType(type) {
// get total number of calls per type
if (this.state.guiLog &&
this.state.guiLog.length) {
let _guiLog = this.state.guiLog;
let items = [];
_guiLog = sortByDate(_guiLog);
for (let i = 0; i < _guiLog.length; i++) {
if (_guiLog[i].status === type) {
const _logItem = _guiLog[i];
items.push(
NotificationsByTypeRender.call(
this,
_logItem,
type,
i
)
);
}
}
return items;
}
}
renderNotificationsModal() {
if (this.state.displayModal) {
return NotificationsModalRender.call(this);
}
return null;
}
toggleNotificationsModal() {
this.setState(Object.assign({}, this.state, {
displayModal: !this.state.displayModal,
}));
}
render() {
return NotificationsRender.call(this);
}
}
const mapStateToProps = (state) => {
return {
Dashboard: {
guiLog: state.Dashboard.guiLog,
activeHandle: state.Dashboard.activeHandle,
}
};
};
export default connect(mapStateToProps)(Notifications);

116
react/src/components/dashboard/notifications/notifications.render.js

@ -1,116 +0,0 @@
import React from 'react';
import {
secondsToString
} from '../../../util/time';
import { translate } from '../../../translate/translate';
export const NotificationsByTypeRender = function(logItem, type, index) {
return (
<div key={ logItem.timestamp }>
<div>{ index + 1 }.</div>
<div>
<strong>Time:</strong> { secondsToString(logItem.timestamp, true, true) }
</div>
<div>
<strong>GUI Function:</strong> { logItem.function }
</div>
<div>
<strong>HTTP:</strong> { logItem.httpMethod.toUpperCase() }
</div>
<div>
<strong>URL:</strong> { logItem.url }
</div>
<div>
<strong>Payload:</strong> { JSON.stringify(logItem.payload, null, '\t') }
</div>
<div className={ type !== 'pending' ? '' : 'hide' }>
<strong>Response:</strong> { JSON.stringify(logItem.response, null, '\t') }
</div>
<hr />
</div>
);
}
export const NotificationsModalRender = function() {
return (
<div onKeyDown={ (event) => this.handleKeydown(event) }>
<div className="modal show notifications-modal">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-body modal-body-container">
<div className="panel nav-tabs-horizontal">
<ul className="nav nav-tabs nav-tabs-line">
<li className={ this.state.activeTab === 0 ? 'active' : 'pointer' }>
<a onClick={ () => this.openTab(0) }>
<i className="icon fa fa-thumbs-o-up"></i> Success ({ this.state.calls.success })
</a>
</li>
<li className={ this.state.activeTab === 1 ? 'active' : 'pointer' }>
<a onClick={ () => this.openTab(1) }>
<i className="icon fa fa-exclamation-triangle"></i> Error ({ this.state.calls.error })
</a>
</li>
<li className={ this.state.activeTab === 2 ? 'active' : 'pointer' }>
<a onClick={ () => this.openTab(2) }>
<i className="icon fa fa-clock-o"></i> Pending ({ this.state.calls.pending })
</a>
</li>
</ul>
<div className="panel-body panel-body-container">
<div className="tab-content">
<div className={ 'tab-pane' + (this.state.activeTab === 0 ? ' active' : '') }>
{ this.renderNotificationsByType('success') }
</div>
<div className={ 'tab-pane' + (this.state.activeTab === 1 ? ' active' : '') }>
{ this.renderNotificationsByType('error') }
</div>
<div className={ 'tab-pane' + (this.state.activeTab === 2 ? ' active' : '') }>
{ this.renderNotificationsByType('pending') }
</div>
</div>
</div>
</div>
</div>
<div className="modal-footer">
<button
type="button"
className="btn btn-default"
onClick={ this.toggleNotificationsModal }>
{ translate('INDEX.CLOSE') }
</button>
</div>
</div>
</div>
</div>
<div className="modal-backdrop show in"></div>
</div>
);
};
export const NotificationsRender = function() {
return (
<div>
<div
className={ 'notifications-badge' + (this.props.Dashboard.activeHandle && this.props.Dashboard.activeHandle.status === 'unlocked' ? ' stick-to-top' : '') }
onClick={ this.state.debug ? this.toggleNotificationsModal : null }>
<span className={ this.state.debug ? 'badge success' : 'hide' }>
{ this.state.calls.success }
</span>
<span className={ this.state.debug ? 'badge error' : 'hide' }>
{ this.state.calls.error }
</span>
<span className={ this.state.debug ? 'badge pending' : 'hide' }>
{ this.state.calls.pending }
</span>
<div className={ 'spinner' + (this.state.calls.pending === 0 ? ' spinner-hide' : '') }>
<div className="rect1"></div>
<div className="rect2"></div>
<div className="rect3"></div>
<div className="rect4"></div>
<div className="rect5"></div>
</div>
</div>
{ this.renderNotificationsModal() }
</div>
);
};

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

@ -14,6 +14,7 @@ class QRModal extends React.Component {
this.state = {
modalIsOpen: false,
error: null,
errorShown: false,
};
this.openModal = this.openModal.bind(this);
this.closeModal = this.closeModal.bind(this);
@ -45,7 +46,7 @@ class QRModal extends React.Component {
openModal() {
this.setState({
modalIsOpen: true
modalIsOpen: true,
});
if (this.props.mode === 'scan') {
@ -65,6 +66,7 @@ class QRModal extends React.Component {
closeModal() {
this.setState({
modalIsOpen: false,
errorShown: this.state.error ? true : false,
});
}

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

@ -2,7 +2,7 @@ import React from 'react';
import { translate } from '../../../translate/translate';
import QRCode from 'qrcode.react';
export const QRModalRender = function () {
export const QRModalRender = function() {
return (
<span>
<span className="label label-default margin-left-10 action"
@ -41,48 +41,46 @@ export const QRModalRender = function () {
);
};
export const QRModalReaderRender = function () {
return (
<span>
<button type="button"
className="btn btn-default"
onClick={ this.openModal }>
<i className="icon fa-qrcode"></i>
{ translate('INDEX.SCAN_QRCODE_WEBCAM') }
</button>
<div
className={ 'modal modal-3d-sign ' + (this.state.modalIsOpen ? 'show in' : 'fade hide') }
id="QRReadModal">
<div className="modal-dialog modal-center modal-md">
<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">{ translate('INDEX.SCAN_QRCODE_WEBCAM') }</h4>
</div>
<div className="modal-body">
<div className="animsition vertical-align fade-in">
<div
className="page-content vertical-align-middle"
style={{
width: '100%',
textAlign: 'center',
fontSize: '16px'
}}>
<div id="webcam">
{ this.state.error }
export const QRModalReaderRender = function() {
if (!this.state.errorShown) {
return (
<span>
<button type="button"
className="btn btn-default"
onClick={ this.openModal }>
<i className="icon fa-qrcode"></i>
{ translate('INDEX.SCAN_QRCODE_WEBCAM') }
</button>
<div
className={ 'modal modal-3d-sign ' + (this.state.modalIsOpen ? 'show in' : 'fade hide') }
id="QRReadModal">
<div className="modal-dialog modal-center modal-md">
<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">{ translate('INDEX.SCAN_QRCODE_WEBCAM') }</h4>
</div>
<div className="modal-body">
<div className="animsition vertical-align fade-in">
<div className="page-content vertical-align-middle webcam-frame">
<div id="webcam">
{ this.state.error }
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div className={ 'modal-backdrop ' + (this.state.modalIsOpen ? 'show in' : 'fade hide') }></div>
</span>
);
<div className={ 'modal-backdrop ' + (this.state.modalIsOpen ? 'show in' : 'fade hide') }></div>
</span>
);
} else {
return null;
}
};

11
react/src/components/dashboard/qrModal/qrModal.scss

@ -0,0 +1,11 @@
.qr-modal-send-block {
position: absolute;
top: 15px;
right: 30px;
}
.webcam-frame {
width: 100%;
text-align: center;
font-size: 16px;
}

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

@ -226,9 +226,8 @@ const mapStateToProps = (state) => {
cache: state.ActiveCoin.cache,
activeSection: state.ActiveCoin.activeSection,
activeAddress: state.ActiveCoin.activeAddress,
addresses: state.ActiveCoin.addresses
addresses: state.ActiveCoin.addresses,
};
};
export default connect(mapStateToProps)(ReceiveCoin);

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

@ -10,7 +10,6 @@ import {
import {
resolveOpenAliasAddress,
triggerToaster,
basiliskRefresh,
shepherdGroomPostPromise,
edexGetTransaction,
getCacheFile,
@ -128,13 +127,6 @@ class SendCoin extends React.Component {
currentStackLength: data.message.shepherd.iguanaAPI.currentStackLength,
}));
}
if (data &&
data.message &&
data.message.shepherd.method &&
data.message.shepherd.method === 'cache-one' &&
data.message.shepherd.status === 'done') {
Store.dispatch(basiliskRefresh(false));
}
}
_fetchNewUTXOData() {
@ -765,7 +757,7 @@ class SendCoin extends React.Component {
}
// TODO same as in walletsNav and receiveCoin, find a way to reuse it?
checkTotalBalance() {
checkBalance() {
let _balance = '0';
const _mode = this.props.ActiveCoin.mode;
@ -785,21 +777,16 @@ class SendCoin extends React.Component {
(_cache[_coin][_address].getbalance.data.balance ||
_cache[_coin][_address].getbalance.data.interest)) {
const _regBalance = _cache[_coin][_address].getbalance.data.balance ? _cache[_coin][_address].getbalance.data.balance : 0;
const _regInterest = _cache[_coin][_address].getbalance.data.interest ? _cache[_coin][_address].getbalance.data.interest : 0;
_balance = _regBalance + _regInterest;
_balance = _regBalance;
}
}
} else if (_mode === 'native') {
if (this.props.ActiveCoin.balance &&
this.props.ActiveCoin.balance.total) {
_balance = this.props.ActiveCoin.balance.total;
}
}
return +_balance;
return _balance;
}
// TODO: reduce to a single toast
validateSendFormData() {
let valid = true;
if (!this.state.sendTo || this.state.sendTo.length < 34) {
@ -846,7 +833,8 @@ class SendCoin extends React.Component {
valid = false;
}
if (this.state.amount > this.checkTotalBalance()) {
if ((this.props.ActiveCoin.mode === 'basilisk' && Number(this.state.amount) > Number(this.state.sendFromAmount)) ||
(this.props.ActiveCoin.mode === 'full' && Number(this.state.amount) > Number(this.checkBalance()))) {
Store.dispatch(
triggerToaster(
translate('SEND.INSUFFICIENT_FUNDS'),
@ -890,10 +878,8 @@ const mapStateToProps = (state) => {
},
Dashboard: {
activeHandle: state.Dashboard.activeHandle,
}
},
};
};
export default connect(mapStateToProps)(SendCoin);

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

@ -496,7 +496,6 @@ class Settings extends React.Component {
<input
type="number"
pattern="[0-9]*"
type="text"
name={ `${key}__${_key}` }
value={ _appConfig[key][_key] }
onChange={ (event) => this.updateInputSettings(event, key, _key) } />
@ -818,9 +817,8 @@ const mapStateToProps = (state) => {
ActiveCoin: {
coin: state.ActiveCoin.coin,
},
Settings: state.Settings,
Settings: state.Settings,
};
};
export default connect(mapStateToProps)(Settings);

115
react/src/components/dashboard/settings/settings.scss

@ -0,0 +1,115 @@
.support-box {
padding: 15px 20px;
width: 220px;
display: inline-block;
cursor: pointer;
&-title {
font-weight: bold;
padding-top: 12px;
padding-bottom: 3px;
}
img {
height: 50px;
}
}
.support-box-wrapper {
display: inline-block;
margin-right: 50px;
&:last-child, {
margin-right: 0;
}
}
.support-box:hover {
.support-box-link {
color: #5683ad;
font-weight: 500;
}
}
.login-settings-modal {
#AppUpdate {
.col-sm-4 {
width: 100%;
}
}
.modal-dialog {
width: 80%;
}
.modal-body {
background: #f3f4f5;
border-radius: 4px;
}
.modal-footer {
margin-top: 15px;
}
.page-content {
padding-top: 0;
}
.support-box-wrapper {
.support-box {
margin: 0;
margin-bottom: 20px;
}
}
}
.settings-help {
font-size: 20px;
position: relative;
top: 2px;
left: 10px;
color: #5683ad;
}
#SettingsAccordion {
.toggle {
position: relative;
top: 4px;
}
table {
width: 100%;
td {
&:first-child {
width: 40%;
}
&:last-child {
width: 60%;
}
}
}
}
#SettingsAccordion {
.panel {
.panel-collapse {
transition: all .3s;
&.collapse {
height: 0;
}
}
}
}
#section-iguana-wallet-settings {
background: #f3f4f5;
.panel-title {
cursor: pointer;
cursor: hand;
&:before {
content: '\F273';
}
&.collapsed {
&:before {
content: '\F278';
}
}
}
}

3
react/src/components/dashboard/syncOnly/syncOnly.js

@ -169,9 +169,8 @@ const mapStateToProps = (state) => {
},
Interval: {
interval: state.Interval.interval,
}
},
};
};
export default connect(mapStateToProps)(SyncOnly);

4
react/src/components/dashboard/syncOnly/syncOnly.render.js

@ -1,7 +1,7 @@
import React from 'react';
import { translate } from '../../../translate/translate';
export const ProgressRender = function (fork) {
export const ProgressRender = function(fork) {
return (
<div>
<div>
@ -46,7 +46,7 @@ export const ProgressRender = function (fork) {
);
};
export const ForkItemRender = function (forkInfo, port) {
export const ForkItemRender = function(forkInfo, port) {
return (
<div
key={ port }

37
react/src/components/dashboard/syncOnly/syncOnly.scss

@ -0,0 +1,37 @@
.sync-only-forks {
color: #757575;
.modal-body {
overflow-y: auto;
}
.badge{
&.up {
position: absolute;
top: 40px;
left: 65px;
margin: 0 5px;
}
}
.avatar {
width: 20%;
display: inline-block;
text-align: center;
vertical-align: top;
img {
width: 55px;
display: inherit;
}
}
.progress-bars {
padding-left: 40px;
display: inline-block;
width: 80%;
margin: 0 auto;
}
.padding-bottom-60 {
&:last-child {
padding-bottom: 0 !important;
}
}
}

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

@ -30,11 +30,13 @@ class WalletsBalance extends React.Component {
}
isFullySynced() {
if (this.props.Dashboard.progress &&
(Number(this.props.Dashboard.progress.balances) +
Number(this.props.Dashboard.progress.validated) +
Number(this.props.Dashboard.progress.bundles) +
Number(this.props.Dashboard.progress.utxo)) / 4 === 100) {
const _progress = this.props.ActiveCoin.progress;
if (_progress &&
(Number(_progress.balances) +
Number(_progress.validated) +
Number(_progress.bundles) +
Number(_progress.utxo)) / 4 === 100) {
return true;
} else {
return false;
@ -119,9 +121,9 @@ class WalletsBalance extends React.Component {
}
if (type === 'interest' &&
this.props.Dashboard.progress &&
this.props.Dashboard.progress.interest) {
_balance = this.props.Dashboard.progress.interest;
this.props.ActiveCoin.progress &&
this.props.ActiveCoin.progress.interest) {
_balance = this.props.ActiveCoin.progress.interest;
}
if (type === 'private' &&
@ -188,6 +190,7 @@ class WalletsBalance extends React.Component {
return null;
}
}
const mapStateToProps = (state) => {
return {
ActiveCoin: {
@ -198,13 +201,13 @@ const mapStateToProps = (state) => {
balance: state.ActiveCoin.balance,
cache: state.ActiveCoin.cache,
activeSection: state.ActiveCoin.activeSection,
activeAddress: state.ActiveCoin.activeAddress
activeAddress: state.ActiveCoin.activeAddress,
progress: state.ActiveCoin.progress,
},
Dashboard: {
progress: state.Dashboard.progress,
}
activeHandle: state.Dashboard.activeHandle,
},
};
};
export default connect(mapStateToProps)(WalletsBalance);

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

@ -1,46 +0,0 @@
import React from 'react';
import { connect } from 'react-redux';
import { basiliskConnection } from '../../../actions/actionCreators';
import Store from '../../../store';
import WalletsBasiliskConnectionRender from './walletsBasiliskConnection.render';
class WalletsBasiliskConnection extends React.Component {
constructor() {
super();
this.basiliskConnectionAction = this.basiliskConnectionAction.bind(this);
}
basiliskConnectionAction() {
Store.dispatch(basiliskConnection(false));
}
handleKeydown(e) {
if (e.key === 'Escape') {
this.basiliskConnectionAction();
}
}
isBasiliskConnection() {
return this.props &&
this.props.Dashboard.basiliskConnection;
}
render() {
if (this.isBasiliskConnection()) {
return WalletsBasiliskConnectionRender.call(this);
} else {
return null;
}
}
}
const mapStateToProps = (state) => {
return {
Dashboard: {
basiliskConnection: state.Dashboard.basiliskConnection,
connectedNotaries: state.Dashboard.connectedNotaries,
}
};
};
export default connect(mapStateToProps)(WalletsBasiliskConnection);

83
react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.render.js

@ -1,83 +0,0 @@
import React from 'react';
import { translate } from '../../../translate/translate';
const WalletsBasiliskConnectionRender = function() {
return (
<div onKeyDown={ (event) => this.handleKeydown(event) }>
<div
className="modal show"
id="RefreshBasiliskConnectionsMdl">
<div className="modal-dialog modal-center modal-md">
<div className="modal-content">
<div className="modal-header bg-orange-a400 wallet-send-header">
<h4 className="modal-title white">
<span className="icon fa-refresh no-margin"></span> { translate('INDEX.REFRESHING_BASILISK_NET') }...
</h4>
<button
type="button"
className="close btn-close"
onClick={ this.basiliskConnectionAction }>
<span>&times;</span>
<span className="sr-only">{ translate('INDEX.CLOSE') }</span>
</button>
</div>
<div className="modal-body text-align-center">
<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>
<h5 className="text-left">
{ `${translate('IAPI.CON_STATUS')}... ${this.props.Dashboard.connectedNotaries.current} / ${this.props.Dashboard.connectedNotaries.total}:${this.props.Dashboard.connectedNotaries.currentNodeName}` } <span className="pull-right" id="basilisk-connections-refresh-percent">{ Math.floor(this.props.Dashboard.connectedNotaries.current * 100 / this.props.Dashboard.connectedNotaries.total) }%</span>
</h5>
<div className="progress progress-sm">
<div
className="progress-bar progress-bar-info progress-bar-striped active font-size-80-percent"
style={{ width: Math.floor(this.props.Dashboard.connectedNotaries.current * 100 / this.props.Dashboard.connectedNotaries.total) + '%' }}></div>
</div>
<pre id="no-padding">
{ this.props.Dashboard.connectedNotaries.failedToConnectNodes ? `Failed: ${this.props.Dashboard.connectedNotaries.failedToConnectNodes}` : null }
</pre>
</div>
</div>
</div>
</div>
<div className="modal-backdrop show in"></div>
</div>
);
};
export default WalletsBasiliskConnectionRender;

26
react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.js

@ -1,26 +0,0 @@
import React from 'react';
import { connect } from 'react-redux';
import WalletsBasiliskRefreshRender from './walletsBasiliskRefresh.render';
class WalletsBasiliskRefresh extends React.Component {
isBasiliskRefresh() {
return this.props &&
this.props.Dashboard.basiliskRefresh;
}
render() {
if (this.isBasiliskRefresh()) {
return WalletsBasiliskRefreshRender.call(this);
}
return null;
}
}
const mapStateToProps = (state) => {
return {
Dashboard: {
basiliskRefresh: state.Dashboard.basiliskRefresh,
}
};
};
export default connect(mapStateToProps)(WalletsBasiliskRefresh);

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

@ -1,36 +0,0 @@
import React from 'react';
import { translate } from '../../../translate/translate';
const WalletsBasiliskRefreshRender = function() {
return (
<div id="edexcoin_dashboard_basilisk_refresh_status">
<div className="col-xs-12 margin-top-20">
<div className="col-xs-12">
<div className="panel">
<div className="panel-heading">
<h3 className="panel-title">{ translate('INDEX.FETCHING_BASILISK_DATA') }</h3>
<div className="panel-actions">
<a className="panel-action icon md-refresh-alt"></a>
</div>
</div>
<div className="table-responsive">
<table className="table table-hover table-striped">
<thead>
<tr>
<th>{ translate('INDEX.ADDRESS') }</th>
<th>{ translate('INDEX.LIST_UNSPENT') }</th>
<th>{ translate('INDEX.LIST_TRANSACTIONS') }</th>
<th>{ translate('INDEX.GET_BALANCE') }</th>
<th>{ translate('INDEX.REFRESH') }</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
);
};
export default WalletsBasiliskRefreshRender;

3
react/src/components/dashboard/walletsCacheData/walletsCacheData.js

@ -193,9 +193,8 @@ const mapStateToProps = (state) => {
},
Dashboard: {
displayViewCacheModal: state.Dashboard.displayViewCacheModal,
}
},
};
};
export default connect(mapStateToProps)(WalletsCacheData);

2
react/src/components/dashboard/walletsData/pagination.js

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import PaginationRender from './pagination.render';
export default class TablePaginationRenderer extends Component {
constructor (props) {
constructor(props) {
super();
this.state = {
page: props.page

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

@ -5,17 +5,11 @@ import { sortByDate } from '../../../util/sort';
import { formatValue } from '../../../util/formatValue';
import Config from '../../../config';
import {
basiliskRefresh,
basiliskConnection,
toggleDashboardTxInfoModal,
getBasiliskTransactionsList,
changeMainBasiliskAddress,
displayNotariesModal,
toggleViewCacheModal,
changeActiveAddress,
restartBasiliskInstance,
connectNotaries,
getDexNotaries,
deleteCacheFile,
fetchNewCacheData,
fetchUtxoCache,
@ -64,14 +58,10 @@ class WalletsData extends React.Component {
this.toggleBasiliskActionsMenu = this.toggleBasiliskActionsMenu.bind(this);
this.basiliskRefreshAction = this.basiliskRefreshAction.bind(this);
this.basiliskConnectionAction = this.basiliskConnectionAction.bind(this);
this.getDexNotariesAction = this.getDexNotariesAction.bind(this);
this.openDropMenu = this.openDropMenu.bind(this);
this.removeAndFetchNewCache = this.removeAndFetchNewCache.bind(this);
this._toggleViewCacheModal = this._toggleViewCacheModal.bind(this);
this.toggleCacheApi = this.toggleCacheApi.bind(this);
this._fetchUtxoCache = this._fetchUtxoCache.bind(this);
this.restartBasiliskInstance = this.restartBasiliskInstance.bind(this);
this.basiliskRefreshActionOne = this.basiliskRefreshActionOne.bind(this);
this.handleClickOutside = this.handleClickOutside.bind(this);
this.refreshTxHistory = this.refreshTxHistory.bind(this);
@ -219,20 +209,6 @@ class WalletsData extends React.Component {
}
}
// deprecated
toggleCacheApi() {
const _useCache = !this.state.useCache;
sessionStorage.setItem('useCache', _useCache);
this.setState(Object.assign({}, this.state, {
useCache: _useCache,
}));
}
restartBasiliskInstance() {
Store.dispatch(restartBasiliskInstance());
}
_toggleViewCacheModal() {
Store.dispatch(toggleViewCacheModal(!this.props.Dashboard.displayViewCacheModal));
}
@ -257,13 +233,6 @@ class WalletsData extends React.Component {
currentStackLength: data.message.shepherd.iguanaAPI.currentStackLength,
});
}
if (data &&
data.message &&
data.message.shepherd.method &&
data.message.shepherd.method === 'cache-one' &&
data.message.shepherd.status === 'done') {
Store.dispatch(basiliskRefresh(false));
}
if (Object.keys(stateObj).length) {
this.setState(Object.assign({}, this.state, stateObj));
@ -340,18 +309,6 @@ class WalletsData extends React.Component {
}));
}
basiliskConnectionAction() {
if (this.props.Dashboard) {
Store.dispatch(basiliskConnection(!this.props.Dashboard.basiliskConnection));
Store.dispatch(connectNotaries());
}
}
getDexNotariesAction() {
Store.dispatch(getDexNotaries(this.props.ActiveCoin.coin));
Store.dispatch(displayNotariesModal(true));
}
toggleTxInfoModal(display, txIndex) {
Store.dispatch(toggleDashboardTxInfoModal(display, txIndex));
}
@ -367,52 +324,56 @@ class WalletsData extends React.Component {
}
componentWillReceiveProps(props) {
let _stateChange = {};
if (!this.state.currentAddress &&
this.props.ActiveCoin.activeAddress &&
this.props.ActiveCoin.mode === 'basilisk') {
this.setState(Object.assign({}, this.state, {
_stateChange = Object.assign({}, _stateChange, {
currentAddress: this.props.ActiveCoin.activeAddress,
}));
});
}
// TODO: clean
if (this.props.ActiveCoin.txhistory &&
this.props.ActiveCoin.txhistory !== 'loading' &&
this.props.ActiveCoin.txhistory !== 'no data' &&
this.props.ActiveCoin.txhistory.length) {
if (!this.state.itemsList ||
/*if (!this.state.itemsList || this.state.itemsList === 'no data' ||
(this.state.coin && this.state.coin !== this.props.ActiveCoin.coin) ||
(JSON.stringify(this.props.ActiveCoin.txhistory) !== JSON.stringify(this.state.txhistory))) {
this.setState(Object.assign({}, this.state, {
(JSON.stringify(this.props.ActiveCoin.txhistory) !== JSON.stringify(this.state.txhistory))) {*/
_stateChange = Object.assign({}, _stateChange, {
itemsList: this.props.ActiveCoin.txhistory,
filteredItemsList: this.filterTransactions(this.props.ActiveCoin.txhistory, this.state.searchTerm),
txhistory: this.props.ActiveCoin.txhistory,
showPagination: this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory.length >= this.state.defaultPageSize,
}));
}
itemsListColumns: this.generateItemsListColumns(),
});
//}
}
if (this.props.ActiveCoin.txhistory &&
this.props.ActiveCoin.txhistory === 'no data') {
this.setState(Object.assign({}, this.state, {
itemsList: 'no data',
}));
_stateChange = Object.assign({}, _stateChange, {
itemsList: 'no data',
});
} else if (this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory === 'loading') {
this.setState(Object.assign({}, this.state, {
_stateChange = Object.assign({}, _stateChange, {
itemsList: 'loading',
}));
});
}
this.setState({
itemsListColumns: this.generateItemsListColumns(),
});
this.setState(Object.assign({}, _stateChange));
}
isFullySynced() {
if (this.props.Dashboard.progress &&
(Number(this.props.Dashboard.progress.balances) +
Number(this.props.Dashboard.progress.validated) +
Number(this.props.Dashboard.progress.bundles) +
Number(this.props.Dashboard.progress.utxo)) / 4 === 100) {
const _progress = this.props.ActiveCoin.progress;
if (_progress &&
(Number(_progress.balances) +
Number(_progress.validated) +
Number(_progress.bundles) +
Number(_progress.utxo)) / 4 === 100) {
return true;
} else {
return false;
@ -421,28 +382,27 @@ class WalletsData extends React.Component {
// TODO: add basilisk first run check, display no data if second run
renderTxHistoryList() {
if (this.state.itemsList === 'loading' ||
this.state.itemsList.length == 0) {
if (this.state.itemsList === 'loading') {
if (this.isFullySynced()) {
return (
<tr className="hover--none">
<td colSpan="7">{ translate('INDEX.LOADING_HISTORY') }...</td>
<td colSpan="7" className="table-cell-offset-16">{ translate('INDEX.LOADING_HISTORY') }...</td>
</tr>
);
} else {
return (
<tr className="hover--none">
<td colSpan="7">{ translate('INDEX.SYNC_IN_PROGRESS') }...</td>
<td colSpan="7" className="table-cell-offset-16">{ translate('INDEX.SYNC_IN_PROGRESS') }...</td>
</tr>
);
}
} else if (this.state.itemsList === 'no data') {
return (
<tr className="hover--none">
<td colSpan="7">{ translate('INDEX.NO_DATA') }</td>
<td colSpan="7" className="table-cell-offset-16">{ translate('INDEX.NO_DATA') }</td>
</tr>
);
} else if (this.state.itemsList) {
} else if (this.state.itemsList && this.state.itemsList.length) {
return TxHistoryListRender.call(this);
}
@ -687,19 +647,16 @@ const mapStateToProps = (state) => {
addresses: state.ActiveCoin.addresses,
txhistory: state.ActiveCoin.txhistory,
showTransactionInfo: state.ActiveCoin.showTransactionInfo,
progress: state.ActiveCoin.progress,
},
Dashboard: {
activeHandle: state.Dashboard.activeHandle,
displayViewCacheModal: state.Dashboard.displayViewCacheModal,
basiliskConnection: state.Dashboard.basiliskConnection,
progress: state.Dashboard.progress,
},
Main: {
coins: state.Main.coins,
}
},
};
};
export default connect(mapStateToProps)(WalletsData);

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

@ -1,8 +1,5 @@
import React from 'react';
import { translate } from '../../../translate/translate';
import WalletsBasiliskRefresh from '../walletsBasiliskRefresh/walletsBasiliskRefresh';
import WalletsBasiliskConnection from '../walletsBasiliskConnection/walletsBasiliskConnection';
import WalletsNotariesList from '../walletsNotariesList/walletsNotariesList';
import WalletsCacheData from '../walletsCacheData/walletsCacheData';
import ReactTable from 'react-table';
import TablePaginationRenderer from './pagination';
@ -192,9 +189,6 @@ export const WalletsDataRender = function() {
return (
<span>
<WalletsBasiliskRefresh />
<WalletsBasiliskConnection />
<WalletsNotariesList />
<WalletsCacheData />
<div id="edexcoin_dashboardinfo">
<div className="col-xs-12 margin-top-20 backround-gray">
@ -225,16 +219,6 @@ export const WalletsDataRender = function() {
<span className="caret"></span>
</a>
<ul className="dropdown-menu dropdown-menu-right">
<li className="hide">
<a onClick={ this.getDexNotariesAction }>
<i className="icon fa-sitemap"></i> { translate('INDEX.GET_NOTARY_NODES_LIST') }
</a>
</li>
<li className="hide">
<a onClick={ this.basiliskConnectionAction }>
<i className="icon wb-refresh"></i> { translate('INDEX.REFRESH_BASILISK_CONNECTIONS') }
</a>
</li>
<li className={ !this.state.useCache ? 'hide' : '' }>
<a onClick={ this.basiliskRefreshActionOne }>
<i className="icon fa-cloud-download"></i> { translate('INDEX.FETCH_WALLET_DATA') }&nbsp;
@ -252,11 +236,6 @@ export const WalletsDataRender = function() {
<i className="icon fa-history"></i> { translate('INDEX.REFETCH_WALLET_DATA') }
</a>
</li>
<li className={ 'hide ' + (!this.state.useCache ? 'hide' : '') }>
<a onClick={ this.restartBasiliskInstance }>
<i className="icon fa-refresh"></i> Restart Basilisk Instance (unsafe!)
</a>
</li>
<li className="hide">
<a onClick={ this._toggleViewCacheModal }>
<i className="icon fa-list-alt"></i> { translate('INDEX.VIEW_CACHE_DATA') }
@ -277,7 +256,7 @@ export const WalletsDataRender = function() {
{ this.renderAddressList() }
</div>
}
{ this.props.ActiveCoin.txhistory !== 'loading' &&
{ (this.props.ActiveCoin.txhistory !== 'loading' && this.props.ActiveCoin.txhistory !== 'no data') &&
<div className="col-sm-4 search-box">
<input
className="form-control"

92
react/src/components/dashboard/walletsData/walletsData.scss

@ -0,0 +1,92 @@
.search-box {
float: right;
padding-right: 0;
}
.basilisk-progress-bar {
position: absolute;
width: 100%;
}
.breadcrumb--basilisk,
.breadcrumb--native {
top: 0;
}
.dropdown-menu {
.no--hover {
pointer-events: none;
}
}
.ReactTable {
border: none;
.pagination-bottom {
margin-top: 35px;
}
.rt-td {
text-align: center;
}
.rt-table {
border: 1px solid rgba(0, 0, 0, 0.1);
}
.rt-thead .rt-th,
.rt-thead .rt-td {
padding: 10px 5px;
}
.rt-tr.-odd div,
.rt-tr.-even div {
padding-top: 10px;
padding-bottom: 10px;
}
.-pagination,
.rt-thead,
.rt-tfoot {
border: none;
}
.rt-tfoot {
border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.rt-thead {
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.colum--direction {
width: 40px !important;
flex: 40 0 auto !important;
padding-right: 10px;
}
.colum--txinfo {
width: 40px !important;
flex: 40 0 auto !important;
}
.colum--type {
width: 40px !important;
flex: 40 0 auto !important;
}
.-pagination {
.-pageJump {
margin-right: 5px;
margin-left: 5px;
}
.-btn {
color: #757575;
background-color: #efefef;
border: 1px solid #e0e0e0;
&:hover {
color: #fff;
}
}
.-btn[disabled]:hover {
color: #757575;
}
}
.rt-noData {
top: 46px;
width: 100%;
text-align: center;
height: 98px;
padding: 38px;
background: rgba(255, 255, 255, 0.85);
}
}
.table-cell-offset-16 {
padding-left: 16px;
}

9
react/src/components/dashboard/walletsInfo/walletsInfo.js

@ -16,8 +16,8 @@ class WalletsInfo extends React.Component {
render() {
if (this.props &&
this.props.Dashboard &&
this.props.Dashboard.progress &&
this.props.ActiveCoin &&
this.props.ActiveCoin.progress &&
this.props.ActiveCoin.activeSection === 'settings') {
return WalletsNativeInfoRender.call(this);
}
@ -31,12 +31,9 @@ const mapStateToProps = (state) => {
ActiveCoin: {
coin: state.ActiveCoin.coin,
activeSection: state.ActiveCoin.activeSection,
progress: state.ActiveCoin.progress,
},
Dashboard: {
progress: state.Dashboard.progress
}
};
};
export default connect(mapStateToProps)(WalletsInfo);

40
react/src/components/dashboard/walletsInfo/walletsInfo.render.js

@ -3,6 +3,8 @@ import { translate } from '../../../translate/translate';
import ClaimInterestModal from '../claimInterestModal/claimInterestModal';
const WalletsInfoRender = function() {
const _progress = this.props.ActiveCoin.progress;
return (
<div>
<div className="col-xlg-6 col-md-4">
@ -16,13 +18,13 @@ const WalletsInfoRender = function() {
<tr>
<td>{ translate('INDEX.WALLET_VERSION') }</td>
<td>
{ this.props.Dashboard.progress.walletversion }
{ _progress.walletversion }
</td>
</tr>
<tr>
<td>{ translate('INDEX.BALANCE') }</td>
<td>
{ this.props.Dashboard.progress.balance }
{ _progress.balance }
</td>
</tr>
<tr>
@ -46,7 +48,7 @@ const WalletsInfoRender = function() {
<button
type="button"
className="btn btn-success waves-effect waves-light margin-top-20 btn-next"
onClick={ () => this.openClaimInterestModal() }>{ translate('CLAIM_INTEREST.CLAIM_INTEREST') }</button>
onClick={ () => this.openClaimInterestModal() }>{ translate('CLAIM_INTEREST.CLAIM_INTEREST', ' ') }</button>
<ClaimInterestModal />
</div>
}
@ -65,19 +67,19 @@ const WalletsInfoRender = function() {
<tr>
<td>{ translate('INDEX.VERSION') }</td>
<td>
{ this.props.Dashboard.progress.KMDversion }
{ _progress.KMDversion }
</td>
</tr>
<tr>
<td>{ translate('INDEX.PROTOCOL_VERSION') }</td>
<td>
{ this.props.Dashboard.progress.protocolversion }
{ _progress.protocolversion }
</td>
</tr>
<tr>
<td>{ translate('INDEX.NOTARIZED') }</td>
<td>
{ this.props.Dashboard.progress.notarized }
{ _progress.notarized }
</td>
</tr>
<tr>
@ -85,15 +87,15 @@ const WalletsInfoRender = function() {
{ translate('INDEX.NOTARIZED') } { translate('INDEX.HASH') }
</td>
<td>
{ this.props.Dashboard.progress.notarizedhash ?
this.props.Dashboard.progress.notarizedhash.substring(
{ _progress.notarizedhash ?
_progress.notarizedhash.substring(
0,
Math.floor(this.props.Dashboard.progress.notarizedhash.length / 2)
Math.floor(_progress.notarizedhash.length / 2)
) +
'\t' +
this.props.Dashboard.progress.notarizedhash.substring(
Math.floor(this.props.Dashboard.progress.notarizedhash.length / 2),
this.props.Dashboard.progress.notarizedhash.length
_progress.notarizedhash.substring(
Math.floor(_progress.notarizedhash.length / 2),
_progress.notarizedhash.length
)
: ''
}
@ -108,43 +110,43 @@ const WalletsInfoRender = function() {
<tr>
<td>{ translate('INDEX.BLOCKS') }</td>
<td>
{ this.props.Dashboard.progress.blocks }
{ _progress.blocks }
</td>
</tr>
<tr>
<td>{ translate('INDEX.CONNECTIONS') }</td>
<td>
{ this.props.Dashboard.progress.connections }
{ _progress.connections }
</td>
</tr>
<tr>
<td>{ translate('INDEX.DIFFICULTY') }</td>
<td>
{ this.props.Dashboard.progress.difficulty }
{ _progress.difficulty }
</td>
</tr>
<tr>
<td>Testnet</td>
<td>
{ this.props.Dashboard.progress.testnet }
{ _progress.testnet }
</td>
</tr>
<tr>
<td>{ translate('INDEX.PAY_TX_FEE') }</td>
<td>
{ this.props.Dashboard.progress.paytxfee }
{ _progress.paytxfee }
</td>
</tr>
<tr>
<td>{ translate('INDEX.RELAY_FEE') }</td>
<td>
{ this.props.Dashboard.progress.relayfee }
{ _progress.relayfee }
</td>
</tr>
<tr>
<td>{ translate('INDEX.ERRORS') }</td>
<td>
{ this.props.Dashboard.progress.errors }
{ _progress.errors }
</td>
</tr>
</tbody>

27
react/src/components/dashboard/walletsNative/walletsNative.js

@ -26,18 +26,18 @@ class WalletsNative extends React.Component {
if (data &&
data.komodod &&
data.komodod.error) {
switch (data.komodod.error) {
case 'run -reindex':
Store.dispatch(
triggerToaster(
translate('TOASTR.RESTART_AGAMA_WITH_REINDEX_PARAM'),
translate('TOASTR.WALLET_NOTIFICATION'),
'info',
false
)
);
break;
}
switch (data.komodod.error) {
case 'run -reindex':
Store.dispatch(
triggerToaster(
translate('TOASTR.RESTART_AGAMA_WITH_REINDEX_PARAM'),
translate('TOASTR.WALLET_NOTIFICATION'),
'info',
false
)
);
break;
}
}
}
@ -79,9 +79,8 @@ const mapStateToProps = (state) => {
ActiveCoin: {
coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode,
}
},
};
};
export default connect(mapStateToProps)(WalletsNative);

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

@ -27,7 +27,7 @@ const WalletsNativeRender = function() {
</li>
</ol>
</div>
<div className="page-content">
<div className={ 'page-content' + (this.state.nativeOnly ? ' page-content-native' : '') }>
<WalletsProgress />
<div className="row">
<WalletsBalance />

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

@ -1,20 +0,0 @@
import React from 'react';
import WalletsNativeAlertRender from './walletsNativeAlert.render';
class WalletsNativeAlert extends React.Component {
hasNoProgress() {
return this.props &&
this.props.Dashboard &&
!this.props.Dashboard.progress;
}
render() {
if (this.hasNoProgress()) {
return WalletsNativeAlertRender.call(this);
}
return null;
}
}
export default WalletsNativeAlert;

19
react/src/components/dashboard/walletsNativeAlert/walletsNativeAlert.render.js

@ -1,19 +0,0 @@
import React from 'react';
import { translate } from '../../../translate/translate';
const WalletsNativeAlertRender = function() {
return (
<div className="alert alert-danger alert-dismissible">
<h4>{ translate('INDEX.OOPS_ERROR') }</h4>
<p>
<span>{ translate('INDEX.OOPS_ERROR_DESC') }</span>
<code>server=1</code><br/>
<code>rpcport=</code><br/>
<code>rpcuser=</code><br/>
<code>rpcpassword=</code>
</p>
</div>
);
};
export default WalletsNativeAlertRender;

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

@ -17,7 +17,7 @@ import {
WalletsNativeSendFormRender,
_WalletsNativeSendFormRender
} from './walletsNativeSend.render';
import { isPositiveNumber } from "../../../util/number";
import { isPositiveNumber } from '../../../util/number';
class WalletsNativeSend extends React.Component {
constructor(props) {
@ -47,6 +47,9 @@ class WalletsNativeSend extends React.Component {
this.toggleSubstractFee = this.toggleSubstractFee.bind(this);
}
// TODO: 1) t -> z amount validation
// 2) z -> z amount validation
WalletsNativeSendFormRender() {
return _WalletsNativeSendFormRender.call(this);
}
@ -364,18 +367,10 @@ class WalletsNativeSend extends React.Component {
return null;
}
checkTotalBalance() {
let _balance = 0;
if (this.props.ActiveCoin.balance &&
this.props.ActiveCoin.balance.total) {
_balance = this.props.ActiveCoin.balance.total;
}
return _balance;
}
// TODO: reduce to a single toast
validateSendFormData() {
let valid = true;
if (!this.state.sendTo ||
this.state.sendTo.length < 34) {
Store.dispatch(
@ -399,7 +394,20 @@ class WalletsNativeSend extends React.Component {
valid = false;
}
if (this.state.amount > this.checkTotalBalance()) {
if (((!this.state.sendFrom || this.state.addressType === 'public') &&
this.state.sendTo &&
this.state.sendTo.length === 34 &&
this.props.ActiveCoin.balance &&
this.props.ActiveCoin.balance.transparent &&
Number(this.state.amount) > Number(this.props.ActiveCoin.balance.transparent)) ||
(this.state.addressType === 'public' &&
this.state.sendTo &&
this.state.sendTo.length > 34 &&
Number(this.state.amount) > Number(this.state.sendFromAmount)) ||
(this.state.addressType === 'private' &&
this.state.sendTo &&
this.state.sendTo.length >= 34 &&
Number(this.state.amount) > Number(this.state.sendFromAmount))) {
Store.dispatch(
triggerToaster(
translate('SEND.INSUFFICIENT_FUNDS'),
@ -452,10 +460,10 @@ const mapStateToProps = (state) => {
coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode,
opids: state.ActiveCoin.opids,
balance: state.ActiveCoin.balance,
activeSection: state.ActiveCoin.activeSection,
}
},
};
};
export default connect(mapStateToProps)(WalletsNativeSend);

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

Loading…
Cancel
Save