Browse Source

Merge branch 'redux' into jsx-separate-component-logic

# Conflicts:
#	react/src/components/addcoin/addcoin.js
#	react/src/components/dashboard/walletsHeader.js
all-modes
petitPapillon 8 years ago
parent
commit
122b19a66e
  1. 3
      react/package.json
  2. 139
      react/src/actions/actionCreators.js
  3. 33
      react/src/actions/actions/addCoin.js
  4. 88
      react/src/actions/actions/addressBalance.js
  5. 10
      react/src/actions/actions/atomic.js
  6. 44
      react/src/actions/actions/basiliskCache.js
  7. 17
      react/src/actions/actions/basiliskProcessAddress.js
  8. 5
      react/src/actions/actions/basiliskTxHistory.js
  9. 7
      react/src/actions/actions/coinList.js
  10. 10
      react/src/actions/actions/copyAddress.js
  11. 11
      react/src/actions/actions/createWallet.js
  12. 9
      react/src/actions/actions/dexCoins.js
  13. 18
      react/src/actions/actions/edexBalance.js
  14. 11
      react/src/actions/actions/edexGetTx.js
  15. 9
      react/src/actions/actions/fullTxHistory.js
  16. 12
      react/src/actions/actions/getAddrByAccount.js
  17. 11
      react/src/actions/actions/iguanaHelpers.js
  18. 9
      react/src/actions/actions/iguanaInstance.js
  19. 10
      react/src/actions/actions/log.js
  20. 12
      react/src/actions/actions/logout.js
  21. 14
      react/src/actions/actions/nativeBalance.js
  22. 21
      react/src/actions/actions/nativeNewAddress.js
  23. 63
      react/src/actions/actions/nativeSend.js
  24. 16
      react/src/actions/actions/nativeSyncInfo.js
  25. 11
      react/src/actions/actions/nativeTxHistory.js
  26. 37
      react/src/actions/actions/notary.js
  27. 6
      react/src/actions/actions/openAlias.js
  28. 46
      react/src/actions/actions/sendFullBasilisk.js
  29. 50
      react/src/actions/actions/settings.js
  30. 12
      react/src/actions/actions/syncInfo.js
  31. 17
      react/src/actions/actions/syncOnly.js
  32. 5
      react/src/actions/actions/sysInfo.js
  33. 37
      react/src/actions/actions/walletAuth.js
  34. 10
      react/src/components/addcoin/addcoin.js
  35. 30
      react/src/components/addcoin/payload.js
  36. 6
      react/src/components/dashboard/atomic.js
  37. 315
      react/src/components/dashboard/coinTile.js
  38. 35
      react/src/components/dashboard/coinTileItem.js
  39. 34
      react/src/components/dashboard/navbar.js
  40. 66
      react/src/components/dashboard/notifications.js
  41. 11
      react/src/components/dashboard/sendCoin.js
  42. 137
      react/src/components/dashboard/settings.js
  43. 108
      react/src/components/dashboard/syncOnly.js
  44. 2
      react/src/components/dashboard/walletsBalance.js
  45. 4
      react/src/components/dashboard/walletsBasiliskConnection.js
  46. 10
      react/src/components/dashboard/walletsData.js
  47. 4
      react/src/components/dashboard/walletsHeader.js
  48. 4
      react/src/components/dashboard/walletsNative.js
  49. 56
      react/src/components/dashboard/walletsNativeSend.js
  50. 2
      react/src/components/dashboard/walletsNativeSyncProgress.js
  51. 8
      react/src/components/dashboard/walletsNativeTxHistory.js
  52. 31
      react/src/components/login/login.js
  53. 4
      react/src/components/main/main.js
  54. 552
      react/src/components/overrides.scss
  55. 14
      react/src/components/toaster/toaster-item.js
  56. 52
      react/src/components/toaster/toaster.js
  57. 31
      react/src/reducers/dashboard.js
  58. 490
      react/src/styles/index.scss
  59. 1
      react/src/translate/en.js
  60. 316
      react/src/util/coinHelper.js
  61. 8
      react/webpack.config.js

3
react/package.json

@ -5,8 +5,7 @@
"main": "src/index.js",
"scripts": {
"start": "webpack-dashboard -t 'EDEX-ReactJS' -- webpack-dev-server --colors --no-info",
"build": "rm -rf ./build && NODE_ENV=\"production\" webpack",
"build_dist": " webpack -p --config ./webpack.config.js",
"build": "rm -rf ./build && mkdir build && mkdir build/assets && cp -R src/assets build/ && NODE_ENV=\"production\" webpack",
"lint-break-on-errors": "eslint ./src ./webpack.config.js -f table --ext .js --ext .jsx",
"lint": "eslint ./src ./webpack.config.js -f table --ext .js --ext .jsx || true",
"preview": "NODE_ENV=\"production\" ./node_modules/webpack-dashboard/bin/webpack-dashboard.js -t 'Preview Mode - EDEX' -- ./node_modules/webpack-dev-server/bin/webpack-dev-server.js",

139
react/src/actions/actionCreators.js

@ -3,43 +3,68 @@ import 'bluebird';
import _config from '../config';
import { translate } from '../translate/translate';
import * as storeType from './storeType';
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,
BASILISK_CONNECTION,
BASILISK_REFRESH,
SYNCING_FULL_MODE,
SYNCING_NATIVE_MODE,
DASHBOARD_ACTIVE_COIN_SEND_FORM,
DASHBOARD_ACTIVE_COIN_RECEIVE_FORM,
DASHBOARD_ACTIVE_COIN_RESET_FORMS,
ADD_TOASTER_MESSAGE,
REMOVE_TOASTER_MESSAGE,
DISPLAY_ADDCOIN_MODAL,
GET_MAIN_ADDRESS,
DASHBOARD_SECTION_CHANGE,
DASHBOARD_ACTIVE_COIN_CHANGE,
ACTIVE_COIN_GET_ADDRESSES,
DASHBOARD_ACTIVE_COIN_NATIVE_TXHISTORY,
START_INTERVAL,
STOP_INTERVAL
} from './storeType';
import {
logGuiHttp,
getAgamaLog,
guiLogState
} from './log';
export * from './nativeSyncInfo';
export * from './basiliskCache';
export * from './nativeSend';
export * from './coinList';
export * from './createWallet';
export * from './nativeTxHistory';
export * from './nativeBalance';
export * from './nativeNewAddress';
export * from './logout';
export * from './basiliskProcessAddress';
export * from './edexGetTx';
export * from './sendFullBasilisk';
export * from './settings';
export * from './syncOnly';
export * from './iguanaInstance';
export * from './notary';
export * from './edexBalance';
export * from './addCoin';
export * from './addressBalance';
export * from './syncInfo';
export * from './getAddrByAccount';
export * from './atomic';
export * from './walletAuth';
export * from './openAlias';
export * from './copyAddress';
export * from './sysInfo';
export * from './dexCoins';
export * from './fullTxHistory';
export * from './basiliskTxHistory';
export * from './iguanaHelpers';
} from './actions/log';
export * from './actions/nativeSyncInfo';
export * from './actions/basiliskCache';
export * from './actions/nativeSend';
export * from './actions/coinList';
export * from './actions/createWallet';
export * from './actions/nativeTxHistory';
export * from './actions/nativeBalance';
export * from './actions/nativeNewAddress';
export * from './actions/logout';
export * from './actions/basiliskProcessAddress';
export * from './actions/edexGetTx';
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';
export * from './actions/syncInfo';
export * from './actions/getAddrByAccount';
export * from './actions/atomic';
export * from './actions/walletAuth';
export * from './actions/openAlias';
export * from './actions/copyAddress';
export * from './actions/sysInfo';
export * from './actions/dexCoins';
export * from './actions/fullTxHistory';
export * from './actions/basiliskTxHistory';
export * from './actions/iguanaHelpers';
export let Config;
@ -51,7 +76,7 @@ try {
export function changeActiveAddress(address) {
return {
type: storeType.DASHBOARD_ACTIVE_ADDRESS,
type: DASHBOARD_ACTIVE_ADDRESS,
address,
}
}
@ -64,35 +89,35 @@ export function updateErrosStack(method) {
export function toggleViewCacheModal(display) {
return {
type: storeType.VIEW_CACHE_DATA,
type: VIEW_CACHE_DATA,
display,
}
}
export function displayNotariesModal(display) {
return {
type: storeType.DASHBOARD_DISPLAY_NOTARIES_MODAL,
type: DASHBOARD_DISPLAY_NOTARIES_MODAL,
display,
}
}
export function changeMainBasiliskAddress(address) {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR,
type: DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR,
address,
}
}
export function toggleDashboardActiveSection(name) {
return {
type: storeType.DASHBOARD_ACTIVE_SECTION,
type: DASHBOARD_ACTIVE_SECTION,
section: name,
}
}
export function toggleDashboardTxInfoModal(display, txIndex) {
return {
type: storeType.DASHBOARD_ACTIVE_TXINFO_MODAL,
type: DASHBOARD_ACTIVE_TXINFO_MODAL,
showTransactionInfo: display,
showTransactionInfoTxIndex: txIndex,
}
@ -100,7 +125,7 @@ export function toggleDashboardTxInfoModal(display, txIndex) {
export function basiliskConnectionState(display, json) {
return {
type: storeType.BASILISK_CONNECTION,
type: BASILISK_CONNECTION,
basiliskConnection: display,
progress: json,
}
@ -108,7 +133,7 @@ export function basiliskConnectionState(display, json) {
export function basiliskRefreshState(display, json) {
return {
type: storeType.BASILISK_REFRESH,
type: BASILISK_REFRESH,
basiliskRefresh: display,
progress: json,
}
@ -128,7 +153,7 @@ export function basiliskConnection(display) {
export function syncingNativeModeState(display, json) {
return {
type: storeType.SYNCING_FULL_MODE,
type: SYNCING_FULL_MODE,
syncingNativeMode: display,
progress: json,
}
@ -136,7 +161,7 @@ export function syncingNativeModeState(display, json) {
export function syncingFullModeState(display, json) {
return {
type: storeType.SYNCING_NATIVE_MODE,
type: SYNCING_NATIVE_MODE,
syncingFullMode: display,
progress: json,
}
@ -144,21 +169,21 @@ export function syncingFullModeState(display, json) {
export function toggleSendCoinFormState(display) {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_SEND_FORM,
type: DASHBOARD_ACTIVE_COIN_SEND_FORM,
send: display,
}
}
export function toggleReceiveCoinFormState(display) {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_RECEIVE_FORM,
type: DASHBOARD_ACTIVE_COIN_RECEIVE_FORM,
receive: display,
}
}
export function toggleSendReceiveCoinFormsState() {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_RESET_FORMS,
type: DASHBOARD_ACTIVE_COIN_RESET_FORMS,
send: false,
receive: false,
}
@ -166,7 +191,7 @@ export function toggleSendReceiveCoinFormsState() {
export function triggerToaster(display, message, title, _type) {
return {
type: storeType.ADD_TOASTER_MESSAGE,
type: ADD_TOASTER_MESSAGE,
display,
message,
title,
@ -177,14 +202,14 @@ export function triggerToaster(display, message, title, _type) {
// triggers removing of the toast with the provided toastId
export function dismissToaster(toastId) {
return {
type: storeType.REMOVE_TOASTER_MESSAGE,
type: REMOVE_TOASTER_MESSAGE,
toastId: toastId
}
}
export function toggleAddcoinModalState(display, isLogin) {
return {
type: storeType.DISPLAY_ADDCOIN_MODAL,
type: DISPLAY_ADDCOIN_MODAL,
display: display,
isLogin: isLogin,
}
@ -192,7 +217,7 @@ export function toggleAddcoinModalState(display, isLogin) {
export function dashboardCoinsState(json) {
return {
type: storeType.GET_ACTIVE_COINS,
type: GET_ACTIVE_COINS,
coins: json,
activeCoins: Object.keys(json.native).length || Object.keys(json.basilisk).length || Object.keys(json.full).length ? true : false
}
@ -200,7 +225,7 @@ export function dashboardCoinsState(json) {
export function getMainAddressState(json) {
return {
type: storeType.GET_MAIN_ADDRESS,
type: GET_MAIN_ADDRESS,
activeHandle: json,
}
}
@ -225,7 +250,7 @@ export function toggleSendReceiveCoinForms() {
export function dashboardChangeSectionState(sectionName) {
return {
type: storeType.DASHBOARD_SECTION_CHANGE,
type: DASHBOARD_SECTION_CHANGE,
activeSection: sectionName,
}
}
@ -238,7 +263,7 @@ export function dashboardChangeSection(sectionName) {
export function dashboardChangeActiveCoinState(coin, mode) {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_CHANGE,
type: DASHBOARD_ACTIVE_COIN_CHANGE,
coin: coin,
mode: mode,
}
@ -292,7 +317,7 @@ export function setBasiliskMainAddress(json, coin, mode) {
}
return {
type: storeType.ACTIVE_COIN_GET_ADDRESSES,
type: ACTIVE_COIN_GET_ADDRESSES,
addresses: { 'public': [] },
}
}
@ -308,14 +333,14 @@ export function getNativeTxHistoryState(json) {
}
return {
type: storeType.DASHBOARD_ACTIVE_COIN_NATIVE_TXHISTORY,
type: DASHBOARD_ACTIVE_COIN_NATIVE_TXHISTORY,
txhistory: json,
}
}
export function startInterval(name, handle) {
return {
type: storeType.START_INTERVAL,
type: START_INTERVAL,
name,
handle,
}
@ -325,7 +350,7 @@ export function stopInterval(name, intervals) {
clearInterval(intervals[name]);
return {
type: storeType.STOP_INTERVAL,
type: STOP_INTERVAL,
name,
}
}

33
react/src/actions/addCoin.js → react/src/actions/actions/addCoin.js

@ -1,11 +1,11 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
toggleAddcoinModal,
getDexCoins
} from './actionCreators';
getDexCoins,
startIguanaInstance
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -16,7 +16,7 @@ import {
startCrypto,
checkCoinType,
checkAC
} from '../components/addcoin/payload';
} from '../../components/addcoin/payload';
export function addCoin(coin, mode, syncOnly, port) {
if (mode === '-1') {
@ -49,10 +49,10 @@ export function addCoin(coin, mode, syncOnly, port) {
};
return dispatch => {
startIguanaInstance(modeToValue[mode] + '/sync', coin)
startIguanaInstance(`${modeToValue[mode]}/sync`, coin)
.then(function(json) {
setTimeout(function() {
console.log('started ' + coin + ' / ' + modeToValue[mode] + ' fork', json);
console.log(`started ${coin} / ${modeToValue[mode]} fork`, json);
dispatch(iguanaAddCoin(coin, mode, _acData, json.result));
}, 2000);
});
@ -79,12 +79,12 @@ export function iguanaAddCoin(coin, mode, acData, port) {
'timestamp': _timestamp,
'function': 'iguanaAddCoin',
'type': 'post',
'url': 'http://127.0.0.1:' + (port ? port : Config.iguanaCorePort),
'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), {
return fetch(`http://127.0.0.1:${(port ? port : Config.iguanaCorePort)}`, {
method: 'POST',
body: JSON.stringify(acData),
})
@ -126,7 +126,7 @@ export function shepherdHerd(coin, mode, path) {
'ac_options': [
'-daemon=0',
'-server',
'-ac_name=' + coin,
`-ac_name=${coin}`,
'-addnode=78.47.196.146'
]
};
@ -160,12 +160,11 @@ export function shepherdHerd(coin, mode, path) {
if (checkCoinType(coin) === 'ac') {
acData = startAssetChain(path.result, coin, mode);
const supply = startAssetChain(path.result, coin, mode, true);
herdData.ac_options.push('-ac_supply=' + supply);
herdData.ac_options.push(`-ac_supply=${supply}`);
}
console.log('herdData', herdData);
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/herd', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/herd`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -192,7 +191,7 @@ export function addCoinResult(coin, mode) {
};
return dispatch => {
dispatch(triggerToaster(true, coin + ' ' + translate('TOASTR.STARTED_IN') + ' ' + modeToValue[mode] + ' ' + translate('TOASTR.MODE'), translate('TOASTR.COIN_NOTIFICATION'), 'success'));
dispatch(triggerToaster(true, `${coin} ${translate('TOASTR.STARTED_IN')} ${modeToValue[mode]} ${translate('TOASTR.MODE')}`, translate('TOASTR.COIN_NOTIFICATION'), 'success'));
dispatch(toggleAddcoinModal(false, false));
dispatch(getDexCoins());
}
@ -200,7 +199,7 @@ export function addCoinResult(coin, mode) {
export function _shepherdGetConfig(coin, mode) {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/getconf', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/getconf`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -220,7 +219,7 @@ export function shepherdGetConfig(coin, mode) {
if (coin === 'KMD' &&
mode === '-1') {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/getconf', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/getconf`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -236,7 +235,7 @@ export function shepherdGetConfig(coin, mode) {
}
} else {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/getconf', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/getconf`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',

88
react/src/actions/addressBalance.js → react/src/actions/actions/addressBalance.js

@ -1,10 +1,12 @@
import * as storeType from './storeType';
import {
ACTIVE_COIN_GET_ADDRESSES
} from '../storeType';
import {
triggerToaster,
Config,
shepherdGroomPost,
getPassthruAgent
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -12,13 +14,16 @@ import {
function getKMDAddressesNativeState(json) {
return {
type: storeType.ACTIVE_COIN_GET_ADDRESSES,
type: ACTIVE_COIN_GET_ADDRESSES,
addresses: json,
}
}
export function getKMDAddressesNative(coin, mode, currentAddress) {
const type = ['public', 'private'];
const type = [
'public',
'private'
];
if (mode !== 'native') {
type.pop();
@ -28,43 +33,43 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
Promise.all(type.map((_type, index) => {
return new Promise((resolve, reject) => {
let payload,
ajax_data_to_hex = '',
ajax_function_input = '',
tmplistaddr_hex_input = '',
passthru_agent = getPassthruAgent(coin),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
ajaxFunctionInput = '',
tmplistaddrHexInput = '',
passthruAgent = getPassthruAgent(coin),
tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
if (_type === 'public') {
ajax_function_input = 'getaddressesbyaccount';
tmplistaddr_hex_input = '222200';
ajaxFunctionInput = 'getaddressesbyaccount';
tmplistaddrHexInput = '222200';
}
if (_type === 'private') {
ajax_function_input = 'z_listaddresses';
tmplistaddr_hex_input = '';
ajaxFunctionInput = 'z_listaddresses';
tmplistaddrHexInput = '';
}
if (passthru_agent === 'iguana') {
if (passthruAgent === 'iguana') {
payload = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'agent': passthruAgent,
'method': 'passthru',
'asset': coin,
'function': ajax_function_input,
'hex': tmplistaddr_hex_input,
'function': ajaxFunctionInput,
'hex': tmplistaddrHexInput,
};
} else {
payload = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'agent': passthruAgent,
'method': 'passthru',
'function': ajax_function_input,
'hex': tmplistaddr_hex_input,
'function': ajaxFunctionInput,
'hex': tmplistaddrHexInput,
};
}
if (mode === 'full' || mode === 'basilisk') {
if (mode === 'full' ||
mode === 'basilisk') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'agent': 'bitcoinrpc',
'method': 'getaddressesbyaccount',
@ -75,7 +80,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
if (mode === 'basilisk') {
const pubkey = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey;
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/cache?pubkey=' + pubkey, {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/cache?pubkey=${pubkey}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -99,12 +104,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'timestamp': _timestamp,
'function': 'getKMDAddressesNative',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'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),
})
@ -131,14 +136,14 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
}))
.then(result => {
// TODO: split into 2 functions
const passthru_agent = getPassthruAgent(coin),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
const passthruAgent = getPassthruAgent(coin),
tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
let payload;
if (passthru_agent === 'iguana') {
if (passthruAgent === 'iguana') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': passthru_agent,
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': passthruAgent,
'method': 'passthru',
'asset': coin,
'function': 'listunspent',
@ -146,8 +151,8 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
};
} else {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': passthru_agent,
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': passthruAgent,
'method': 'passthru',
'function': 'listunspent',
'hex': '',
@ -156,7 +161,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
if (mode === 'full') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'method': 'listunspent',
'params': [
@ -169,7 +174,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
// if api cache option is off
if (mode === 'basilisk') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'listunspent',
'address': currentAddress,
@ -217,7 +222,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
newAddressArray[a] = [];
for (let b = 0; b < result[a].length; b++) {
var filteredArray;
let filteredArray;
if (mode === 'basilisk') {
filteredArray = json.map(res => res.amount);
@ -226,8 +231,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
}
let sum = 0;
for (let i=0; i < filteredArray.length; i++) {
for (let i = 0; i < filteredArray.length; i++) {
sum += filteredArray[i];
}
@ -247,7 +251,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
if (mode === 'basilisk') {
const pubkey = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey;
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/cache?pubkey=' + pubkey, {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/cache?pubkey=${pubkey}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -271,12 +275,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'timestamp': _timestamp,
'function': 'getKMDAddressesNative+Balance',
'type': 'post',
'url': 'http://127.0.0.1:' + (Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort),
'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), {
fetch(`http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -312,12 +316,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
'timestamp': _timestamp,
'function': 'getKMDAddressesNative+Balance',
'type': 'post',
'url': 'http://127.0.0.1:' + (Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort),
'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), {
fetch(`http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, {
method: 'POST',
body: JSON.stringify(payload),
})

10
react/src/actions/atomic.js → react/src/actions/actions/atomic.js

@ -1,8 +1,8 @@
import * as storeType from './storeType';
import { ATOMIC } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -15,12 +15,12 @@ export function atomic(payload) {
'timestamp': _timestamp,
'function': 'atomic',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -47,7 +47,7 @@ export function atomic(payload) {
function atomicState(json) {
return {
type: storeType.ATOMIC,
type: ATOMIC,
response: json,
}
}

44
react/src/actions/basiliskCache.js → react/src/actions/actions/basiliskCache.js

@ -1,8 +1,8 @@
import * as storeType from './storeType';
import { DASHBOARD_ACTIVE_COIN_GET_CACHE } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -10,7 +10,7 @@ import {
export function deleteCacheFile(_payload) {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/groom?', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/groom`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
@ -30,7 +30,7 @@ export function getCacheFile(pubkey) {
const _pubkey = pubkey || JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey;
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/groom?filename=' + _pubkey, {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/groom?filename=${_pubkey}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -46,16 +46,16 @@ export function getCacheFile(pubkey) {
}
export function fetchNewCacheData(_payload) {
const _userpass = '?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
_pubkey = '&pubkey=' + _payload.pubkey,
const _userpass = `?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
_pubkey = `&pubkey=${_payload.pubkey}`,
_route = _payload.allcoins ? 'cache-all' : 'cache-one',
_coin = '&coin=' + _payload.coin,
_calls = '&calls=' + _payload.calls,
_address = _payload.address ? ('&address=' + _payload.address) : '',
_iguanaInstancePort = Config.useBasiliskInstance ? '&port=' + (Config.iguanaCorePort + 1) : '';
_coin = `&coin=${_payload.coin}`,
_calls = `&calls=${_payload.calls}`,
_address = _payload.address ? (`&address=${_payload.address}`) : '',
_iguanaInstancePort = Config.useBasiliskInstance ? `&port=${Config.iguanaCorePort + 1}` : '';
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/' + _route + _userpass + _pubkey + _coin + _calls + _address + _iguanaInstancePort, {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/${_route}${_userpass}${_pubkey}${_coin}${_calls}${_address}${_iguanaInstancePort}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -72,7 +72,7 @@ export function fetchNewCacheData(_payload) {
export function getShepherdCache(pubkey, coin) {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/cache?pubkey=' + pubkey, {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/cache?pubkey=${pubkey}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -101,23 +101,23 @@ function getShepherdCacheState(json, pubkey, coin) {
}
} else {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_GET_CACHE,
type: DASHBOARD_ACTIVE_COIN_GET_CACHE,
cache: json && json.result && json.result.basilisk ? json.result.basilisk : null,
}
}
}
export function fetchUtxoCache(_payload) {
const _userpass = '?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
_pubkey = '&pubkey=' + _payload.pubkey,
const _userpass = `?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
_pubkey = `&pubkey=${_payload.pubkey}`,
_route = _payload.allcoins ? 'cache-all' : 'cache-one',
_coin = '&coin=' + _payload.coin,
_calls = '&calls=' + _payload.calls,
_address = _payload.address ? ('&address=' + _payload.address) : '',
_iguanaInstancePort = Config.useBasiliskInstance ? '&port=' + (Config.iguanaCorePort + 1) : '';
_coin = `&coin=${_payload.coin}`,
_calls = `&calls=${_payload.calls}`,
_address = _payload.address ? (`&address=${_payload.address}`) : '',
_iguanaInstancePort = Config.useBasiliskInstance ? `&port=${Config.iguanaCorePort + 1}` : '';
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/' + _route + _userpass + _pubkey + _coin + _calls + _address + _iguanaInstancePort, {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/${_route}${_userpass}${_pubkey}${_coin}${_calls}${_address}${_iguanaInstancePort}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -134,7 +134,7 @@ export function fetchUtxoCache(_payload) {
export function shepherdGroomPost(_filename, _payload) {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/groom/', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/groom/`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -155,7 +155,7 @@ export function shepherdGroomPost(_filename, _payload) {
export function shepherdGroomPostPromise(_filename, _payload) {
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/groom/', {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/groom/`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',

17
react/src/actions/basiliskProcessAddress.js → react/src/actions/actions/basiliskProcessAddress.js

@ -1,9 +1,8 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -11,7 +10,7 @@ import {
export function checkAddressBasilisk(coin, address) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'checkaddress',
'address': address,
@ -24,12 +23,12 @@ export function checkAddressBasilisk(coin, address) {
'timestamp': _timestamp,
'function': 'checkAddressBasilisk',
'type': 'post',
'url': 'http://127.0.0.1:' + (Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort),
'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), {
return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -73,7 +72,7 @@ function checkAddressBasiliskHandle(json) {
export function validateAddressBasilisk(coin, address) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'validateaddress',
'address': address,
@ -86,12 +85,12 @@ export function validateAddressBasilisk(coin, address) {
'timestamp': _timestamp,
'function': 'validateAddressBasilisk',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'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), {
return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

5
react/src/actions/basiliskTxHistory.js → react/src/actions/actions/basiliskTxHistory.js

@ -1,9 +1,8 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config,
getNativeTxHistoryState
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -13,7 +12,7 @@ export function getBasiliskTransactionsList(coin, address) {
const pubkey = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey;
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/cache?pubkey=' + pubkey, {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/cache?pubkey=${pubkey}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',

7
react/src/actions/coinList.js → react/src/actions/actions/coinList.js

@ -1,8 +1,7 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -10,7 +9,7 @@ import {
export function shepherdGetCoinList() {
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/coinslist', {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/coinslist`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -27,7 +26,7 @@ export function shepherdGetCoinList() {
export function shepherdPostCoinList(data) {
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/coinslist', {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/coinslist`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',

10
react/src/actions/copyAddress.js → react/src/actions/actions/copyAddress.js

@ -1,10 +1,6 @@
import { copyToClipboard } from '../util/copyToClipboard';
import { translate } from '../translate/translate';
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
import { copyToClipboard } from '../../util/copyToClipboard';
import { translate } from '../../translate/translate';
import { triggerToaster } from '../actionCreators';
export function copyCoinAddress(address) {
const _result = copyToClipboard(address);

11
react/src/actions/createWallet.js → react/src/actions/actions/createWallet.js

@ -1,9 +1,8 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -25,7 +24,7 @@ function createNewWalletState(json) {
export function createNewWallet(_passphrase) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'bitcoinrpc',
'method': 'encryptwallet',
'passphrase': _passphrase,
@ -37,12 +36,12 @@ export function createNewWallet(_passphrase) {
'timestamp': _timestamp,
'function': 'createNewWallet',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

9
react/src/actions/dexCoins.js → react/src/actions/actions/dexCoins.js

@ -1,9 +1,8 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config,
dashboardCoinsState
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -11,7 +10,7 @@ import {
export function getDexCoins() {
const _payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'InstantDEX',
'method': 'allcoins',
};
@ -22,12 +21,12 @@ export function getDexCoins() {
'timestamp': _timestamp,
'function': 'getDexCoins',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(_payload)
})

18
react/src/actions/edexBalance.js → react/src/actions/actions/edexBalance.js

@ -1,8 +1,8 @@
import * as storeType from './storeType';
import { DASHBOARD_ACTIVE_COIN_BALANCE } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -10,7 +10,7 @@ import {
export function iguanaEdexBalance(coin) {
const _payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'bitcoinrpc',
'method': 'getbalance',
'coin': coin,
@ -23,12 +23,12 @@ export function iguanaEdexBalance(coin) {
'timestamp': _timestamp,
'function': 'iguanaEdexBalance',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(_payload),
})
@ -49,7 +49,7 @@ export function iguanaEdexBalance(coin) {
function iguanaEdexBalanceState(json) {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_BALANCE,
type: DASHBOARD_ACTIVE_COIN_BALANCE,
balance: json && json.result ? json.result : 0,
}
}
@ -57,7 +57,7 @@ function iguanaEdexBalanceState(json) {
export function getDexBalance(coin, mode, addr) {
Promise.all(addr.map((_addr, index) => {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'listunspent',
'address': _addr,
@ -70,12 +70,12 @@ export function getDexBalance(coin, mode, addr) {
'timestamp': _timestamp,
'function': 'getDexBalance',
'type': 'post',
'url': 'http://127.0.0.1:' + (Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort),
'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), {
fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

11
react/src/actions/edexGetTx.js → react/src/actions/actions/edexGetTx.js

@ -1,16 +1,15 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
export function edexGetTransaction(data) {
export function edexGetTransaction(data, dispatch) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'symbol': data.coin,
'agent': 'dex',
'method': 'gettransaction',
@ -24,12 +23,12 @@ export function edexGetTransaction(data) {
'timestamp': _timestamp,
'function': 'edexGetTransaction',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'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),
})

9
react/src/actions/fullTxHistory.js → react/src/actions/actions/fullTxHistory.js

@ -1,9 +1,8 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config,
getNativeTxHistoryState
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -11,7 +10,7 @@ import {
export function getFullTransactionsList(coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'method': 'listtransactions',
'params': [
@ -27,12 +26,12 @@ export function getFullTransactionsList(coin) {
'timestamp': _timestamp,
'function': 'getFullTransactionsList',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

12
react/src/actions/getAddrByAccount.js → react/src/actions/actions/getAddrByAccount.js

@ -1,8 +1,8 @@
import * as storeType from './storeType';
import { ACTIVE_COIN_GET_ADDRESSES } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -24,14 +24,14 @@ export function getAddressesByAccountState(json, coin, mode) {
}
return {
type: storeType.ACTIVE_COIN_GET_ADDRESSES,
type: ACTIVE_COIN_GET_ADDRESSES,
addresses: { 'public': json.result },
}
}
export function getAddressesByAccount(coin, mode) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'agent': 'bitcoinrpc',
'method': 'getaddressesbyaccount',
@ -44,12 +44,12 @@ export function getAddressesByAccount(coin, mode) {
'timestamp': _timestamp,
'function': 'getAddressesByAccount',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

11
react/src/actions/iguanaHelpers.js → react/src/actions/actions/iguanaHelpers.js

@ -1,13 +1,12 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import { checkAC } from '../components/addcoin/payload';
import { checkAC } from '../../components/addcoin/payload';
export function getPassthruAgent(coin) {
let passthruAgent;
@ -22,7 +21,7 @@ export function getPassthruAgent(coin) {
export function iguanaHashHex(data, dispatch) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'hash',
'method': 'hex',
'message': data,
@ -34,12 +33,12 @@ export function iguanaHashHex(data, dispatch) {
'timestamp': _timestamp,
'function': 'iguanaHashHex',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'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),
})

9
react/src/actions/iguanaInstance.js → react/src/actions/actions/iguanaInstance.js

@ -1,8 +1,7 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -10,7 +9,7 @@ import {
export function restartIguanaInstance(pmid) {
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/forks/restart?pmid=' + pmid, {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/forks/restart?pmid=${pmid}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -43,7 +42,7 @@ export function restartBasiliskInstance() {
export function startIguanaInstance(mode, coin) {
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/forks', {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/forks`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -64,7 +63,7 @@ export function startIguanaInstance(mode, coin) {
export function getIguanaInstancesList() {
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/forks', {
fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/forks`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',

10
react/src/actions/log.js → react/src/actions/actions/log.js

@ -1,15 +1,15 @@
import * as storeType from './storeType';
import { LOG_GUI_HTTP } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
export function logGuiHttp(payload) {
return dispatch => {
dispatch(guiLogState(payload));
// disabled for now
/*return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/guilog', {
/*return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/guilog`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -26,7 +26,7 @@ export function logGuiHttp(payload) {
export function getAgamaLog(type) {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/getlog?type=' + type, {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/getlog?type=${type}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -43,7 +43,7 @@ export function getAgamaLog(type) {
export function guiLogState(logData) {
return {
type: storeType.LOG_GUI_HTTP,
type: LOG_GUI_HTTP,
timestamp: logData.timestamp,
log: {
timestamp: logData.timestamp,

12
react/src/actions/logout.js → react/src/actions/actions/logout.js

@ -1,8 +1,8 @@
import * as storeType from './storeType';
import { LOGIN } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -12,7 +12,7 @@ function logoutState(json, dispatch) {
sessionStorage.removeItem('IguanaActiveAccount');
return {
type: storeType.LOGIN,
type: LOGIN,
isLoggedIn: false,
}
}
@ -25,7 +25,7 @@ export function logout() {
function walletLock() {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'bitcoinrpc',
'method': 'walletlock',
};
@ -36,12 +36,12 @@ function walletLock() {
'timestamp': _timestamp,
'function': 'walletLock',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

14
react/src/actions/nativeBalance.js → react/src/actions/actions/nativeBalance.js

@ -1,9 +1,9 @@
import * as storeType from './storeType';
import { DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE } from '../storeType';
import {
triggerToaster,
Config,
getPassthruAgent
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -15,7 +15,7 @@ export function getKMDBalanceTotal(coin) {
if (coin !== 'KMD' &&
coin !== 'ZEC') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'iguana',
'method': 'passthru',
'asset': coin,
@ -24,7 +24,7 @@ export function getKMDBalanceTotal(coin) {
};
} else {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': getPassthruAgent(coin),
'method': 'passthru',
'function': 'z_gettotalbalance',
@ -38,12 +38,12 @@ export function getKMDBalanceTotal(coin) {
'timestamp': _timestamp,
'function': 'getKMDBalanceTotal',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -73,7 +73,7 @@ export function getKMDBalanceTotal(coin) {
export function getNativeBalancesState(json) {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE,
type: DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE,
balance: json && !json.error ? json : 0,
}
}

21
react/src/actions/nativeNewAddress.js → react/src/actions/actions/nativeNewAddress.js

@ -1,10 +1,9 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
getPassthruAgent
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -19,22 +18,22 @@ function handleGetNewKMDAddresses(pubpriv, coin, dispatch) {
export function getNewKMDAddresses(coin, pubpriv) {
let payload,
ajax_function_input = '';
ajaxFunctionInput = '';
if (pubpriv === 'public') {
ajax_function_input = 'getnewaddress';
ajaxFunctionInput = 'getnewaddress';
}
if (pubpriv === 'private') {
ajax_function_input = 'z_getnewaddress';
ajaxFunctionInput = 'z_getnewaddress';
}
if (getPassthruAgent(coin) === 'iguana') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': getPassthruAgent(coin),
'method': 'passthru',
'asset': coin,
'function': ajax_function_input,
'function': ajaxFunctionInput,
'hex': '',
};
} else {
@ -42,7 +41,7 @@ export function getNewKMDAddresses(coin, pubpriv) {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': coin,
'method': 'passthru',
'function': ajax_function_input,
'function': ajaxFunctionInput,
'hex': '',
};
}
@ -53,12 +52,12 @@ export function getNewKMDAddresses(coin, pubpriv) {
'timestamp': _timestamp,
'function': 'getNewKMDAddresses',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

63
react/src/actions/nativeSend.js → react/src/actions/actions/nativeSend.js

@ -1,34 +1,34 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import { DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS } from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
getPassthruAgent,
iguanaHashHex
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
export function sendNativeTx(coin, _payload) {
let ajax_data_to_hex;
let ajaxDataToHex;
let payload;
let _apiMethod;
if (_payload.addressType === 'public') {
_apiMethod = 'sendtoaddress';
ajax_data_to_hex = '["' + _payload.sendTo + '", ' + (Number(_payload.amount) - Number(_payload.fee)) + ']';
ajaxDataToHex = `["${_payload.sendTo}", ${Number(_payload.amount) - Number(_payload.fee)}]`;
} else {
_apiMethod = 'z_sendmany';
ajax_data_to_hex = '["' + _payload.sendFrom + '",[{"address":"' + _payload.sendTo + '","amount":' + (Number(_payload.amount) - Number(_payload.fee)) + '}]]';
ajaxDataToHex = `["${_payload.sendFrom}", [{"address": "${_payload.sendTo}", "amount": ${Number(_payload.amount) - Number(_payload.fee)}}]]`;
}
return dispatch => {
return iguanaHashHex(ajax_data_to_hex, dispatch).then((hashHexJson) => {
return iguanaHashHex(ajaxDataToHex, dispatch).then((hashHexJson) => {
if (getPassthruAgent(coin) === 'iguana') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': getPassthruAgent(coin),
'method': 'passthru',
'asset': coin,
@ -37,7 +37,7 @@ export function sendNativeTx(coin, _payload) {
};
} else {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': getPassthruAgent(coin),
'method': 'passthru',
'function': _apiMethod,
@ -50,12 +50,12 @@ export function sendNativeTx(coin, _payload) {
'timestamp': _timestamp,
'function': 'sendNativeTx',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'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),
})
@ -68,7 +68,16 @@ export function sendNativeTx(coin, _payload) {
}));
dispatch(triggerToaster(true, 'sendNativeTx', 'Error', 'error'));
})
.then(response => response.json())
.then(function(response) {
if (_apiMethod === 'sendtoaddress') {
const _response = response.text().then(function(text) { return text; });
console.log('native sendtoaddress', _response);
return _response;
} else {
return response.json();
}
})
.then(function(json) {
dispatch(logGuiHttp({
'timestamp': _timestamp,
@ -83,45 +92,41 @@ export function sendNativeTx(coin, _payload) {
dispatch(triggerToaster(true, translate('TOASTR.TX_SENT_ALT'), translate('TOASTR.WALLET_NOTIFICATION'), 'success'));
}
})
.catch(function(ex) {
dispatch(triggerToaster(true, translate('TOASTR.TX_SENT_ALT'), translate('TOASTR.WALLET_NOTIFICATION'), 'success'));
console.log('parsing failed', ex);
})
});
}
}
export function getKMDOPIDState(json) {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS,
type: DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS,
opids: json,
}
}
export function getKMDOPID(opid, coin) {
let tmpopid_output = '',
ajax_data_to_hex;
let tmpopidOutput = '',
ajaxDataToHex;
if (opid === undefined) {
ajax_data_to_hex = null;
ajaxDataToHex = null;
} else {
ajax_data_to_hex = '["' + opid + '"]';
ajaxDataToHex = `["${opid}"]`;
}
return dispatch => {
return iguanaHashHex(ajax_data_to_hex, dispatch).then((hashHexJson) => {
return iguanaHashHex(ajaxDataToHex, dispatch).then((hashHexJson) => {
if (hashHexJson === '5b226e756c6c225d00') {
hashHexJson = '';
}
let payload,
passthru_agent = getPassthruAgent(coin),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
passthruAgent = getPassthruAgent(coin),
tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
if (passthru_agent == 'iguana') {
if (passthruAgent == 'iguana') {
payload = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'agent': passthruAgent,
'method': 'passthru',
'asset': coin,
'function': 'z_getoperationstatus',
@ -130,7 +135,7 @@ export function getKMDOPID(opid, coin) {
} else {
payload = {
'userpass': tmpIguanaRPCAuth,
'agent': passthru_agent,
'agent': passthruAgent,
'method': 'passthru',
'function': 'z_getoperationstatus',
'hex': hashHexJson,
@ -142,12 +147,12 @@ export function getKMDOPID(opid, coin) {
'timestamp': _timestamp,
'function': 'getKMDOPID',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'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),
})

16
react/src/actions/nativeSyncInfo.js → react/src/actions/actions/nativeSyncInfo.js

@ -1,10 +1,10 @@
import * as storeType from './storeType';
import { SYNCING_NATIVE_MODE } from '../storeType';
import {
triggerToaster,
Config,
getPassthruAgent,
getDebugLog
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -19,12 +19,12 @@ export function getSyncInfoNativeKMD(skipDebug) {
'timestamp': _timestamp,
'function': 'getSyncInfoNativeKMD',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort + '/api/dex/getinfo?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth') + '&symbol=' + coin,
'url': `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`,
'payload': '',
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort + '/api/dex/getinfo?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth') + '&symbol=' + coin, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`, {
method: 'GET',
})
.catch(function(error) {
@ -60,7 +60,7 @@ function getSyncInfoNativeState(json, coin, skipDebug) {
return getSyncInfoNativeKMD(skipDebug);
} else {
return {
type: storeType.SYNCING_NATIVE_MODE,
type: SYNCING_NATIVE_MODE,
progress: json,
}
}
@ -68,7 +68,7 @@ function getSyncInfoNativeState(json, coin, skipDebug) {
export function getSyncInfoNative(coin, skipDebug) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': getPassthruAgent(coin),
'method': 'passthru',
'asset': coin,
@ -82,12 +82,12 @@ export function getSyncInfoNative(coin, skipDebug) {
'timestamp': _timestamp,
'function': 'getSyncInfo',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

11
react/src/actions/nativeTxHistory.js → react/src/actions/actions/nativeTxHistory.js

@ -1,10 +1,9 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config,
getPassthruAgent,
getNativeTxHistoryState
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -15,7 +14,7 @@ export function getNativeTxHistory(coin) {
if (getPassthruAgent(coin) === 'iguana') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'iguana',
'method': 'passthru',
'asset': coin,
@ -24,7 +23,7 @@ export function getNativeTxHistory(coin) {
};
} else {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': getPassthruAgent(coin),
'method': 'passthru',
'function': 'listtransactions',
@ -38,12 +37,12 @@ export function getNativeTxHistory(coin) {
'timestamp': _timestamp,
'function': 'getNativeTxHistory',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

37
react/src/actions/notary.js → react/src/actions/actions/notary.js

@ -1,9 +1,12 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import {
DASHBOARD_CONNECT_NOTARIES,
DASHBOARD_GET_NOTARIES_LIST
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -13,7 +16,7 @@ function initNotaryNodesConSequence(nodes) {
return dispatch => {
Promise.all(nodes.map((node, index) => {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'getinfo',
'symbol': node,
@ -24,14 +27,14 @@ function initNotaryNodesConSequence(nodes) {
const _timestamp = Date.now();
dispatch(logGuiHttp({
'timestamp': _timestamp,
'function': 'initNotaryNodesConSequence+' + node,
'function': `initNotaryNodesConSequence+${node}`,
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'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, {
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) {
@ -41,7 +44,7 @@ function initNotaryNodesConSequence(nodes) {
'status': 'error',
'response': error,
}));
dispatch(triggerToaster(true, 'getInfoDexNode+' + node, 'Error', 'error'));
dispatch(triggerToaster(true, `getInfoDexNode+${node}`, 'Error', 'error'));
})
.then(response => response.json())
.then(json => {
@ -66,7 +69,7 @@ function updateNotaryNodeConState(json, totalNodes, currentNodeIndex, currentNod
if (json &&
json.error === 'less than required responses') {
return {
type: storeType.DASHBOARD_CONNECT_NOTARIES,
type: DASHBOARD_CONNECT_NOTARIES,
total: totalNodes - 1,
current: currentNodeIndex,
name: currentNodeName,
@ -74,7 +77,7 @@ function updateNotaryNodeConState(json, totalNodes, currentNodeIndex, currentNod
}
} else {
return {
type: storeType.DASHBOARD_CONNECT_NOTARIES,
type: DASHBOARD_CONNECT_NOTARIES,
total: totalNodes - 1,
current: currentNodeIndex,
name: currentNodeName,
@ -89,7 +92,7 @@ function connectAllNotaryNodes(json, dispatch) {
dispatch(initNotaryNodesConSequence(json));
return {
type: storeType.DASHBOARD_CONNECT_NOTARIES,
type: DASHBOARD_CONNECT_NOTARIES,
total: json.length - 1,
current: 0,
name: json[0],
@ -99,13 +102,13 @@ function connectAllNotaryNodes(json, dispatch) {
export function connectNotaries() {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dpow',
'method': 'notarychains',
};
return dispatch => {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -125,7 +128,7 @@ function getDexNotariesState(json) {
}
} else {
return {
type: storeType.DASHBOARD_GET_NOTARIES_LIST,
type: DASHBOARD_GET_NOTARIES_LIST,
notaries: json,
}
}
@ -133,7 +136,7 @@ function getDexNotariesState(json) {
export function getDexNotaries(coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'getnotaries',
'symbol': coin,
@ -145,11 +148,11 @@ export function getDexNotaries(coin) {
'timestamp': _timestamp,
'function': 'getDexNotaries',
'type': 'post',
'url': 'http://127.0.0.1:' + (Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort),
'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), {
return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

6
react/src/actions/openAlias.js → react/src/actions/actions/openAlias.js

@ -1,8 +1,4 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState

46
react/src/actions/sendFullBasilisk.js → react/src/actions/actions/sendFullBasilisk.js

@ -1,9 +1,10 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import { DASHBOARD_ACTIVE_COIN_SENDTO } from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from './actionCreators';
Config,
getDispatch
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -11,7 +12,7 @@ import {
export function sendToAddress(coin, _payload) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'method': 'sendtoaddress',
'params': [
@ -28,12 +29,12 @@ export function sendToAddress(coin, _payload) {
'timestamp': _timestamp,
'function': 'sendToAddress',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -60,7 +61,7 @@ export function sendToAddress(coin, _payload) {
export function sendFromAddress(coin, _payload) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'method': 'sendfrom',
'params': [
@ -78,12 +79,12 @@ export function sendFromAddress(coin, _payload) {
'timestamp': _timestamp,
'function': 'sendFromAddress',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -108,9 +109,9 @@ export function sendFromAddress(coin, _payload) {
}
}
export function iguanaUTXORawTX(data) {
export function iguanaUTXORawTX(data, dispatch) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'symbol': data.coin,
'agent': 'basilisk',
'method': 'utxorawtx',
@ -124,7 +125,6 @@ export function iguanaUTXORawTX(data) {
},
'utxos': data.utxos,
};
console.log('iguanaUTXORawTXExport', payload);
return new Promise((resolve, reject) => {
const _timestamp = Date.now();
@ -132,18 +132,18 @@ export function iguanaUTXORawTX(data) {
'timestamp': _timestamp,
'function': 'iguanaUTXORawTX',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'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);
dispatch(logGuiHttp({
dispatch => dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'error',
'response': error,
@ -162,9 +162,9 @@ export function iguanaUTXORawTX(data) {
});
}
export function dexSendRawTX(data) {
export function dexSendRawTX(data, dispatch) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'dex',
'method': 'sendrawtransaction',
'signedtx': data.signedtx,
@ -177,7 +177,7 @@ export function dexSendRawTX(data) {
'timestamp': _timestamp,
'function': 'dexSendRawTX',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
@ -217,14 +217,14 @@ function sendToAddressState(json, dispatch) {
dispatch(triggerToaster(true, json.error, 'Error', 'error'));
return {
type: storeType.DASHBOARD_ACTIVE_COIN_SENDTO,
type: DASHBOARD_ACTIVE_COIN_SENDTO,
lastSendToResponse: json,
}
} else if (json && json.result && json.complete) {
dispatch(triggerToaster(true, translate('TOASTR.TX_SENT_ALT'), translate('TOASTR.WALLET_NOTIFICATION'), 'success'));
return {
type: storeType.DASHBOARD_ACTIVE_COIN_SENDTO,
type: DASHBOARD_ACTIVE_COIN_SENDTO,
lastSendToResponse: json,
}
}
@ -232,14 +232,14 @@ function sendToAddressState(json, dispatch) {
export function sendToAddressStateAlt(json) {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_SENDTO,
type: DASHBOARD_ACTIVE_COIN_SENDTO,
lastSendToResponse: json,
}
}
export function clearLastSendToResponseState() {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_SENDTO,
type: DASHBOARD_ACTIVE_COIN_SENDTO,
lastSendToResponse: null,
}
}

50
react/src/actions/settings.js → react/src/actions/actions/settings.js

@ -1,9 +1,15 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import {
LOAD_APP_INFO,
GET_WIF_KEY,
GET_DEBUG_LOG,
GET_PEERS_LIST,
LOAD_APP_CONFIG
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -11,14 +17,14 @@ import {
function getAppInfoState(json) {
return {
type: storeType.LOAD_APP_INFO,
type: LOAD_APP_INFO,
info: json,
}
}
export function getAppInfo() {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/appinfo', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/appinfo`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -35,8 +41,8 @@ export function getAppInfo() {
export function settingsWifkeyState(json, coin) {
return {
type: storeType.GET_WIF_KEY,
wifkey: json[coin + 'wif'],
type: GET_WIF_KEY,
wifkey: json[`{$coin}wif`],
address: json[coin],
}
}
@ -63,7 +69,7 @@ function parseImportPrivKeyResponse(json, dispatch) {
export function importPrivKey(wifKey) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'method': 'importprivkey',
'params': [
wifKey,
@ -77,12 +83,12 @@ export function importPrivKey(wifKey) {
'timestamp': _timestamp,
'function': 'importPrivKey',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -117,7 +123,7 @@ function getDebugLogState(json) {
const _data = json.result.replace('\n', '\r\n');
return {
type: storeType.GET_DEBUG_LOG,
type: GET_DEBUG_LOG,
data: _data,
}
}
@ -129,7 +135,7 @@ export function getDebugLog(target, linesCount) {
};
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/debuglog', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/debuglog`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -147,7 +153,7 @@ export function getDebugLog(target, linesCount) {
export function getPeersList(coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'SuperNET',
'method': 'getpeers',
'activecoin': coin,
@ -159,12 +165,12 @@ export function getPeersList(coin) {
'timestamp': _timestamp,
'function': 'getPeersList',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -201,7 +207,7 @@ export function getPeersListState(json) {
}
return {
type: storeType.GET_PEERS_LIST,
type: GET_PEERS_LIST,
supernetPeers: json && json.supernet[0] ? json.supernet : null,
rawPeers: peersList,
}
@ -232,7 +238,7 @@ function addPeerNodeState(json, dispatch) {
export function addPeerNode(coin, ip) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'iguana',
'method': 'addnode',
'activecoin': coin,
@ -245,12 +251,12 @@ export function addPeerNode(coin, ip) {
'timestamp': _timestamp,
'function': 'addPeerNode',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -277,7 +283,7 @@ export function addPeerNode(coin, ip) {
export function saveAppConfig(_payload) {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/appconf', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/appconf`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -295,14 +301,14 @@ export function saveAppConfig(_payload) {
function getAppConfigState(json) {
return {
type: storeType.LOAD_APP_CONFIG,
type: LOAD_APP_CONFIG,
config: json,
}
}
export function getAppConfig() {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/appconf', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/appconf`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',

12
react/src/actions/syncInfo.js → react/src/actions/actions/syncInfo.js

@ -1,8 +1,8 @@
import * as storeType from './storeType';
import { SYNCING_FULL_MODE } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -18,14 +18,14 @@ function getSyncInfoState(json) {
}
return {
type: storeType.SYNCING_FULL_MODE,
type: SYNCING_FULL_MODE,
progress: json,
}
}
export function getSyncInfo(coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'coin': coin,
'agent': 'bitcoinrpc',
'method': 'getinfo',
@ -37,12 +37,12 @@ export function getSyncInfo(coin) {
'timestamp': _timestamp,
'function': 'getSyncInfo',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})

17
react/src/actions/syncOnly.js → react/src/actions/actions/syncOnly.js

@ -1,9 +1,12 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import {
SYNC_ONLY_MODAL_TOGGLE,
SYNC_ONLY_DATA
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -11,21 +14,21 @@ import {
export function toggleSyncOnlyModal(display) {
return {
type: storeType.SYNC_ONLY_MODAL_TOGGLE,
type: SYNC_ONLY_MODAL_TOGGLE,
display,
}
}
function getSyncOnlyForksState(json) {
return {
type: storeType.SYNC_ONLY_DATA,
type: SYNC_ONLY_DATA,
forks: JSON.parse(json.result),
}
}
export function getSyncOnlyForks() {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/forks/info/show', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/forks/info/show`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -42,7 +45,7 @@ export function getSyncOnlyForks() {
export function stopIguanaFork(pmid) {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/forks/stop?pmid=' + pmid, {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/forks/stop?pmid=${pmid}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',

5
react/src/actions/sysInfo.js → react/src/actions/actions/sysInfo.js

@ -1,8 +1,7 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -10,7 +9,7 @@ import {
export function shepherdGetSysInfo() {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/sysinfo', {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/sysinfo`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',

37
react/src/actions/walletAuth.js → react/src/actions/actions/walletAuth.js

@ -1,11 +1,14 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import {
LOGIN,
ACTIVE_HANDLE
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
getMainAddressState,
updateErrosStack
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -13,7 +16,7 @@ import {
export function encryptWallet(_passphrase, cb, coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'bitcoinrpc',
'method': 'encryptwallet',
'passphrase': _passphrase,
@ -25,12 +28,12 @@ export function encryptWallet(_passphrase, cb, coin) {
'timestamp': _timestamp,
'function': 'encryptWallet',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -58,7 +61,7 @@ export function encryptWallet(_passphrase, cb, coin) {
export function walletPassphrase(_passphrase) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'bitcoinrpc',
'method': 'walletpassphrase',
'password': _passphrase,
@ -71,12 +74,12 @@ export function walletPassphrase(_passphrase) {
'timestamp': _timestamp,
'function': 'walletpassphrase',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(payload),
})
@ -101,7 +104,7 @@ export function walletPassphrase(_passphrase) {
export function iguanaWalletPassphrase(_passphrase) {
const _payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'handle': '',
'password': _passphrase,
'timeout': '2592000',
@ -115,12 +118,12 @@ export function iguanaWalletPassphrase(_passphrase) {
'timestamp': _timestamp,
'function': 'iguanaWalletPassphrase',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(_payload),
})
@ -147,7 +150,7 @@ export function iguanaWalletPassphrase(_passphrase) {
export function iguanaActiveHandle(getMainAddress) {
const _payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`,
'agent': 'SuperNET',
'method': 'activehandle',
};
@ -158,12 +161,12 @@ export function iguanaActiveHandle(getMainAddress) {
'timestamp': _timestamp,
'function': 'iguanaActiveHandle',
'type': 'post',
'url': 'http://127.0.0.1:' + Config.iguanaCorePort,
'url': `http://127.0.0.1:${Config.iguanaCorePort}`,
'payload': _payload,
'status': 'pending',
}));
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, {
method: 'POST',
body: JSON.stringify(_payload),
})
@ -196,14 +199,14 @@ function iguanaWalletPassphraseState(json, dispatch) {
dispatch(iguanaActiveHandleState(json));
return {
type: storeType.LOGIN,
type: LOGIN,
isLoggedIn: json && json.pubkey ? true : false,
}
}
function iguanaActiveHandleState(json) {
return {
type: storeType.ACTIVE_HANDLE,
type: ACTIVE_HANDLE,
isLoggedIn: sessionStorage.getItem('IguanaActiveAccount') && JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey === json.pubkey && json.status === 'unlocked' ? true : false,
handle: json,
}

10
react/src/components/addcoin/addcoin.js

@ -97,12 +97,12 @@ class AddCoin extends React.Component {
modalClassName: props.display ? 'show fade' : 'show fade',
}));
setTimeout(function() {
setTimeout(() => {
this.setState(Object.assign({}, this.state, {
display: props.display,
modalClassName: props.display ? 'show in' : 'hide',
}));
}.bind(this), 100);
}, 100);
}
}
@ -220,7 +220,7 @@ class AddCoin extends React.Component {
for (let i = 1; i < this.state.coins.length; i++) {
const _item = this.state.coins[i];
setTimeout(function() {
setTimeout(() => {
Store.dispatch(addCoin(
_item.selectedCoin.split('|')[0],
_item.mode,
@ -237,7 +237,7 @@ class AddCoin extends React.Component {
Store.dispatch(toggleAddcoinModal(false, false));
}
}.bind(this), 2000 * i);
}, 2000 * i);
}
}
@ -249,7 +249,7 @@ class AddCoin extends React.Component {
const _coin = _item.selectedCoin || '';
items.push(
<div className={ this.hasMoreThanOneCoin() ? 'multi' : 'single' } key={ 'add-coin-' + i }>
<div className={ this.hasMoreThanOneCoin() ? 'multi' : 'single' } key={ `add-coin-${i}` }>
<div className="col-sm-8">
<div className="form-group">
<select

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

@ -133,9 +133,11 @@ export function startCrypto(confpath, coin, mode) {
var tmpinternval = 0,
AddCoinData = {},
tmpPendValue = 1, // TODO: hook up to shepherd sysinfo
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
if (coin !== 'BTC' && coin !== 'LTC' && coin !== 'DOGE') {
if (coin !== 'BTC' &&
coin !== 'LTC' &&
coin !== 'DOGE') {
tmpPendValue = parseInt(tmpPendValue) * 4;
}
@ -153,14 +155,14 @@ export function startCrypto(confpath, coin, mode) {
AddCoinData.GAME = {'userpass':tmpIguanaRPCAuth,"RELAY":mode,"VALIDATE":mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"services":129,"prefetchlag":-1,"poll":10,"active":1,"agent":"iguana","method":"addcoin","maxpeers":256,"newcoin":"GAME","name":"GameCredits","netmagic":"fbc0b6db","p2p":40002,"rpc":40001,"pubval":38,"p2shval":5,"wifval":166,"txfee_satoshis":"100000","minconfirms":2,"genesishash":"91ec5f25ee9a0ffa1af7d4da4db9a552228dd2dc77cdb15b738be4e1f55f30ee","genesis":{"hashalgo":"scrypt","version":1,"timestamp":1392757140,"nBits":"1e0ffff0","nonce":2084565393,"merkle_root":"d849db99a14164f4b4c8ad6d2d8d7e2b1ba7f89963e9f4bf9fad5ff1a4754429"},"alertpubkey":"04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284","auxpow":1,"protover":80006,"isPoS":0};
AddCoinData.ZET = {'userpass':tmpIguanaRPCAuth,"RELAY":mode,"VALIDATE":mode,"startpend":tmpPendValue,"endpend":tmpPendValue,"services":129,"prefetchlag":-1,"poll":10,"active":1,"agent":"iguana","method":"addcoin","maxpeers":256,"newcoin":"ZET","name":"Zetacoin","netmagic":"fab503df","p2p":17333,"rpc":17335,"pubval":80,"p2shval":9,"wifval":224,"txfee_satoshis":"10000","minconfirms":2,"genesishash":"000006cab7aa2be2da91015902aa4458dd5fbb8778d175c36d429dc986f2bff4","genesis":{"version":1,"timestamp":1375548986,"nBits":"1e0fffff","nonce":2089928209,"merkle_root":"d0227b8c3e3d07bce9656b3d9e474f050d23458aaead93357dcfdac9ab9b79f9"},"alertpubkey":"045337216002ca6a71d63edf062895417610a723d453e722bf4728996c58661cdac3d4dec5cecd449b9086e9602b35cc726a9e0163e1a4d40f521fbdaebb674658"};
if ( coin === 'KMD' ) {
if ( mode === '-1' ) {
if (coin === 'KMD') {
if (mode === '-1') {
AddCoinData.KMD = {"coin":"KMD","conf":"komodo.conf","path":confpath,"unitval":"20","zcash":1,"RELAY":-1,"VALIDATE":0,"prefetchlag":-1,"poll":10,"active":1,"agent":"iguana","method":"addcoin","startpend":8,"endpend":8,"services":0,"maxpeers":32,"newcoin":"KMD","name":"Komodo","hasheaders":1,"useaddmultisig":0,"netmagic":"f9eee48d","p2p":7770,"rpc":7771,"pubval":60,"p2shval":85,"wifval":188,"txfee_satoshis":"10000","isPoS":0,"minoutput":10000,"minconfirms":2,"genesishash":"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71","protover":170002,"genesisblock":"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2","debug":0}
} else {
AddCoinData.KMD = {'userpass':tmpIguanaRPCAuth,"unitval":"20","zcash":1,"RELAY":mode,"VALIDATE":mode,"prefetchlag":-1,"poll":10,"active":1,"agent":"iguana","method":"addcoin","startpend":tmpPendValue,"endpend":tmpPendValue,"services":129,"maxpeers":32,"newcoin":"KMD","name":"Komodo","hasheaders":1,"useaddmultisig":0,"netmagic":"f9eee48d","p2p":7770,"rpc":7771,"pubval":60,"p2shval":85,"wifval":188,"txfee_satoshis":"10000","isPoS":0,"minoutput":10000,"minconfirms":2,"genesishash":"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71","protover":170002,"genesisblock":"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2","debug":0}
}
}
if ( coin === 'ZEC' ) {
if (coin === 'ZEC') {
if ( mode === '-1' ) {
AddCoinData.ZEC = {"coin":"ZEC","conf":"zcash.conf","path":confpath,"unitval":"20","zcash":1,"RELAY":-1,"VALIDATE":0,"prefetchlag":-1,"poll":10,"active":1,"agent":"iguana","method":"addcoin","startpend":8,"endpend":8,"services":129,"maxpeers":32,"newcoin":"ZEC","name":"Zcash","hasheaders":0,"useaddmultisig":0,"netmagic":"24e92764","p2p":8233,"rpc":8232,"pubval":184,"p2shval":189,"wifval":128,"txfee_satoshis":"10000","isPoS":0,"minoutput":10000,"minconfirms":2,"genesishash":"00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08","protover":170002,"genesisblock":"040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac4000000000000000000000000000000000000000000000000000000000000000090041358ffff071f5712000000000000000000000000000000000000000000000000000000000000fd4005000a889f00854b8665cd555f4656f68179d31ccadc1b1f7fb0952726313b16941da348284d67add4686121d4e3d930160c1348d8191c25f12b267a6a9c131b5031cbf8af1f79c9d513076a216ec87ed045fa966e01214ed83ca02dc1797270a454720d3206ac7d931a0a680c5c5e099057592570ca9bdf6058343958b31901fce1a15a4f38fd347750912e14004c73dfe588b903b6c03166582eeaf30529b14072a7b3079e3a684601b9b3024054201f7440b0ee9eb1a7120ff43f713735494aa27b1f8bab60d7f398bca14f6abb2adbf29b04099121438a7974b078a11635b594e9170f1086140b4173822dd697894483e1c6b4e8b8dcd5cb12ca4903bc61e108871d4d915a9093c18ac9b02b6716ce1013ca2c1174e319c1a570215bc9ab5f7564765f7be20524dc3fdf8aa356fd94d445e05ab165ad8bb4a0db096c097618c81098f91443c719416d39837af6de85015dca0de89462b1d8386758b2cf8a99e00953b308032ae44c35e05eb71842922eb69797f68813b59caf266cb6c213569ae3280505421a7e3a0a37fdf8e2ea354fc5422816655394a9454bac542a9298f176e211020d63dee6852c40de02267e2fc9d5e1ff2ad9309506f02a1a71a0501b16d0d36f70cdfd8de78116c0c506ee0b8ddfdeb561acadf31746b5a9dd32c21930884397fb1682164cb565cc14e089d66635a32618f7eb05fe05082b8a3fae620571660a6b89886eac53dec109d7cbb6930ca698a168f301a950be152da1be2b9e07516995e20baceebecb5579d7cdbc16d09f3a50cb3c7dffe33f26686d4ff3f8946ee6475e98cf7b3cf9062b6966e838f865ff3de5fb064a37a21da7bb8dfd2501a29e184f207caaba364f36f2329a77515dcb710e29ffbf73e2bbd773fab1f9a6b005567affff605c132e4e4dd69f36bd201005458cfbd2c658701eb2a700251cefd886b1e674ae816d3f719bac64be649c172ba27a4fd55947d95d53ba4cbc73de97b8af5ed4840b659370c556e7376457f51e5ebb66018849923db82c1c9a819f173cccdb8f3324b239609a300018d0fb094adf5bd7cbb3834c69e6d0b3798065c525b20f040e965e1a161af78ff7561cd874f5f1b75aa0bc77f720589e1b810f831eac5073e6dd46d00a2793f70f7427f0f798f2f53a67e615e65d356e66fe40609a958a05edb4c175bcc383ea0530e67ddbe479a898943c6e3074c6fcc252d6014de3a3d292b03f0d88d312fe221be7be7e3c59d07fa0f2f4029e364f1f355c5d01fa53770d0cd76d82bf7e60f6903bc1beb772e6fde4a70be51d9c7e03c8d6d8dfb361a234ba47c470fe630820bbd920715621b9fbedb49fcee165ead0875e6c2b1af16f50b5d6140cc981122fcbcf7c5a4e3772b3661b628e08380abc545957e59f634705b1bbde2f0b4e055a5ec5676d859be77e20962b645e051a880fddb0180b4555789e1f9344a436a84dc5579e2553f1e5fb0a599c137be36cabbed0319831fea3fddf94ddc7971e4bcf02cdc93294a9aab3e3b13e3b058235b4f4ec06ba4ceaa49d675b4ba80716f3bc6976b1fbf9c8bf1f3e3a4dc1cd83ef9cf816667fb94f1e923ff63fef072e6a19321e4812f96cb0ffa864da50ad74deb76917a336f31dce03ed5f0303aad5e6a83634f9fcc371096f8288b8f02ddded5ff1bb9d49331e4a84dbe1543164438fde9ad71dab024779dcdde0b6602b5ae0a6265c14b94edd83b37403f4b78fcd2ed555b596402c28ee81d87a909c4e8722b30c71ecdd861b05f61f8b1231795c76adba2fdefa451b283a5d527955b9f3de1b9828e7b2e74123dd47062ddcc09b05e7fa13cb2212a6fdbc65d7e852cec463ec6fd929f5b8483cf3052113b13dac91b69f49d1b7d1aec01c4a68e41ce157","debug":0}
} else {
@ -168,16 +170,17 @@ export function startCrypto(confpath, coin, mode) {
}
}
console.log('AddCoinData', AddCoinData[coin]);
return AddCoinData[coin];
}
export function startCurrencyAssetChain(confpath, coin, mode) {
var AddCoinDataPayload = {},
tmpPendValue = 1,
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
if (coin !== 'BTC' && coin !== 'LTC' && coin !== 'DOGE') {
if (coin !== 'BTC' &&
coin !== 'LTC' &&
coin !== 'DOGE') {
tmpPendValue = parseInt(tmpPendValue) * 4;
}
@ -631,15 +634,17 @@ export function startCurrencyAssetChain(confpath, coin, mode) {
};
AddCoinDataPayload.CZKVar = Object.assign({}, _payloadVar, CZKDiff);
return AddCoinDataPayload[coin + 'Var'];
return AddCoinDataPayload[`${coin}Var`];
}
}
export function startAssetChain(confpath, coin, mode, getSuppyOnly) {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
var tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
var tmpPendValue;
if (coin !== 'BTC' && coin !== 'LTC' && coin !== 'DOGE') {
if (coin !== 'BTC' &&
coin !== 'LTC' &&
coin !== 'DOGE') {
tmpPendValue = parseInt(tmpPendValue) * 4;
}
@ -667,6 +672,7 @@ export function startAssetChain(confpath, coin, mode, getSuppyOnly) {
'debug': 0,
'seedipaddr': '78.47.196.146'
};
const acConfig = {
'SUPERNET': {
'name': 'SUPERNET',
@ -766,7 +772,7 @@ export function startAssetChain(confpath, coin, mode, getSuppyOnly) {
}
};
if ( mode === '-1' ) {
if (mode === '-1') {
if (getSuppyOnly) {
return acConfig[coin].supply;
} else {

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

@ -44,7 +44,7 @@ class Atomic extends React.Component {
}
getAtomicData() {
const tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
const tmpIguanaRPCAuth = `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`;
let ExplorerInputData;
switch (this.state.api) {
@ -472,7 +472,7 @@ class Atomic extends React.Component {
for (let i = 0; i < _options.length; i++) {
items.push(
<option key={_options[i].method} value={_options[i].method}>{_options[i].name}</option>
<option key={ _options[i].method } value={ _options[i].method }>{ _options[i].name }</option>
);
}
@ -506,7 +506,7 @@ class Atomic extends React.Component {
<select
className="form-control form-material"
id="atomic_explorer_select_command_options"
onChange={this.updateSelectedAPI}>
onChange={ this.updateSelectedAPI }>
<option value="">-{ translate('ATOMIC.SELECT_COMMAND') }-</option>
{ this.renderAtomicOptions() }
</select>

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

@ -1,5 +1,9 @@
import React from 'react';
import { translate } from '../../translate/translate';
import {
getCoinTitle,
getModeInfo
} from '../../util/coinHelper';
import CoinTileItem from './coinTileItem';
class CoinTile extends React.Component {
@ -17,311 +21,20 @@ class CoinTile extends React.Component {
'full'
];
const allCoins = this.props.Main.coins;
var items = [];
let items = [];
if (this.props.Main && this.props.Main.coins) {
if (this.props.Main &&
allCoins) {
modes.map(function(mode) {
allCoins[mode].map(function(coin) {
var coinlogo = '',
coinname = '',
modecode = '',
modetip = '',
modecolor = '';
const _coinMode = getModeInfo(mode),
modecode = _coinMode.code,
modetip = _coinMode.tip,
modecolor = _coinMode.color;
switch (mode) {
case 'native':
modecode = 'Native';
modetip = 'Native';
modecolor = 'primary';
break;
case 'basilisk':
modecode = 'Basilisk';
modetip = 'Basilisk';
modecolor = 'info';
break;
case 'full':
modecode = 'Full';
modetip = 'Full';
modecolor = 'success';
break;
case 'virtual':
modecode = 'Virtual';
modetip = 'Virtual';
modecolor = 'danger';
break;
case 'notarychains':
modecode = 'Notarychains';
modetip = 'Notarychains';
modecolor = 'dark';
break;
}
switch (coin) {
case 'BTC':
coinlogo = 'bitcoin';
coinname = 'Bitcoin';
break;
case 'BTCD':
coinlogo = 'bitcoindark';
coinname = 'BitcoinDark';
break;
case 'LTC':
coinlogo = 'litecoin';
coinname = 'Litecoin';
break;
case 'VPN':
coinlogo = 'vpncoin';
coinname = 'VPNcoin';
break;
case 'SYS':
coinlogo = 'syscoin';
coinname = 'Syscoin';
break;
case 'ZEC':
coinlogo = 'zcash';
coinname = 'Zcash';
break;
case 'NMC':
coinlogo = 'namecoin';
coinname = 'Namecoin';
break;
case 'DEX':
coinlogo = 'dex';
coinname = 'InstantDEX';
break;
case 'DOGE':
coinlogo = 'dogecoin';
coinname = 'Dogecoin';
break;
case 'DGB':
coinlogo = 'digibyte';
coinname = 'Digibyte';
break;
case 'MZC':
coinlogo = 'mazacoin';
coinname = 'Mazacoin';
break;
case 'UNO':
coinlogo = 'unobtanium';
coinname = 'Unobtanium';
break;
case 'ZET':
coinlogo = 'zetacoin';
coinname = 'Zetacoin';
break;
case 'KMD':
coinlogo = 'komodo';
coinname = 'Komodo';
break;
case 'BTM':
coinlogo = 'bitmark';
coinname = 'Bitmark';
break;
case 'CARB':
coinlogo = 'carboncoin';
coinname = 'Carboncoin';
break;
case 'ANC':
coinlogo = 'anoncoin';
coinname = 'AnonCoin';
break;
case 'FRK':
coinlogo = 'franko';
coinname = 'Franko';
break;
case 'GAME':
coinlogo = 'GAME';
coinname = 'GameCredits';
break;
case 'SUPERNET':
coinlogo = 'SUPERNET';
coinname = 'SUPERNET';
break;
case 'REVS':
coinlogo = 'REVS';
coinname = 'REVS';
break;
case 'WLC':
coinlogo = 'WLC';
coinname = 'WIRELESS';
break;
case 'PANGEA':
coinlogo = 'PANGEA';
coinname = 'PANGEA';
break;
case 'JUMBLR':
coinlogo = 'JUMBLR';
coinname = 'JUMBLR';
break;
case 'BET':
coinlogo = 'BET';
coinname = 'BET';
break;
case 'CRYPTO':
coinlogo = 'CRYPTO';
coinname = 'CRYPTO';
break;
case 'HODL':
coinlogo = 'HODL';
coinname = 'HODL';
break;
case 'SHARK':
coinlogo = 'SHARK';
coinname = 'SHARK';
break;
case 'BOTS':
coinlogo = 'BOTS';
coinname = 'BOTS';
break;
case 'MGW':
coinlogo = 'MGW';
coinname = 'MultiGateway';
break;
case 'MVP':
coinlogo = 'MVP';
coinname = 'MVP Lineup';
break;
case 'KV':
coinlogo = 'KV';
coinname = 'KV';
break;
case 'CEAL':
coinlogo = 'CEAL';
coinname = 'CEAL NET';
break;
case 'MESH':
coinlogo = 'MESH';
coinname = 'SpaceMesh';
break;
case 'USD':
coinlogo = 'usd';
coinname = 'US Dollar';
break;
case 'RON':
coinlogo = 'RON';
coinname = 'Romanian Leu';
break;
case 'EUR':
coinlogo = 'EUR';
coinname = 'Euro';
break;
case 'JPY':
coinlogo = 'JPY';
coinname = 'Japanese Yen';
break;
case 'GBP':
coinlogo = 'GBP';
coinname = 'British Pound';
break;
case 'AUD':
coinlogo = 'AUD';
coinname = 'Australian Dollar';
break;
case 'CAD':
coinlogo = 'CAD';
coinname = 'Canadian Dollar';
break;
case 'CHF':
coinlogo = 'CHF';
coinname = 'Swiss Franc';
break;
case 'NZD':
coinlogo = 'NZD';
coinname = 'New Zealand Dollar';
break;
case 'CNY':
coinlogo = 'CNY';
coinname = 'Chinese Yuan';
break;
case 'RUB':
coinlogo = 'RUB';
coinname = 'Russian Ruble';
break;
case 'MXN':
coinlogo = 'MXN';
coinname = 'Mexican peso';
break;
case 'BRL':
coinlogo = 'BRL';
coinname = 'Brazilian Real';
break;
case 'INR':
coinlogo = 'INR';
coinname = 'Indian Rupee';
break;
case 'HKD':
coinlogo = 'HKD';
coinname = 'Hong Kong Dollar';
break;
case 'TRY':
coinlogo = 'TRY';
coinname = 'Turkish Lira';
break;
case 'ZAR':
coinlogo = 'ZAR';
coinname = 'South African Rand';
break;
case 'PLN':
coinlogo = 'PLN';
coinname = 'Polish Zloty';
break;
case 'NOK':
coinlogo = 'NOK';
coinname = 'Norwegian Krone';
break;
case 'SEK':
coinlogo = 'SEK';
coinname = 'Swedish Krona';
break;
case 'DKK':
coinlogo = 'DKK';
coinname = 'Danish Krone';
break;
case 'CZK':
coinlogo = 'CZK';
coinname = 'Czech Koruna';
break;
case 'HUF':
coinlogo = 'HUF';
coinname = 'Hungarian Forint';
break;
case 'ILS':
coinlogo = 'ILS';
coinname = 'Israeli Shekel';
break;
case 'KRW':
coinlogo = 'KRW';
coinname = 'Korean Won';
break;
case 'MYR':
coinlogo = 'MYR';
coinname = 'Malaysian Ringgit';
break;
case 'PHP':
coinlogo = 'PHP';
coinname = 'Philippine Peso';
break;
case 'SGD':
coinlogo = 'SGD';
coinname = 'Singapore Dollar';
break;
case 'THB':
coinlogo = 'THB';
coinname = 'Thai Baht';
break;
case 'BGN':
coinlogo = 'BGN';
coinname = 'Bulgarian Lev';
break;
case 'IDR':
coinlogo = 'IDR';
coinname = 'Indonesian Rupiah';
break;
case 'HRK':
coinlogo = 'HRK';
coinname = 'Croatian Kuna';
break;
}
const _coinTitle = getCoinTitle(coin),
coinlogo = _coinTitle.logo,
coinname = _coinTitle.name;
items.push({
coinlogo,

35
react/src/components/dashboard/coinTileItem.js

@ -21,6 +21,11 @@ import {
} from '../../actions/actionCreators';
import Store from '../../store';
const BASILISK_CACHE_UPDATE_TIMEOUT = 240000;
const IGUNA_ACTIVE_HANDLE_TIMEOUT = 3000;
const IGUNA_ACTIVE_HANDLE_TIMEOUT_KMD_NATIVE = 15000;
const NATIVE_MIN_SYNC_PERCENTAGE_THRESHOLD = 90;
class CoinTileItem extends React.Component {
constructor(props) {
super(props);
@ -39,10 +44,13 @@ class CoinTileItem extends React.Component {
dispatchCoinActions(coin, mode) {
if (mode === 'native') {
Store.dispatch(iguanaActiveHandle(true));
const syncPercentage = this.props.Dashboard && this.props.Dashboard.progress && (parseFloat(parseInt(this.props.Dashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2)).replace('NaN', 0);
if (this.props.Dashboard.progress &&
this.props.Dashboard.progress.blocks &&
this.props.Dashboard.progress.longestchain &&
this.props.Dashboard.progress.blocks === this.props.Dashboard.progress.longestchain) {
syncPercentage &&
syncPercentage >= NATIVE_MIN_SYNC_PERCENTAGE_THRESHOLD) {
Store.dispatch(getSyncInfoNative(coin, true));
Store.dispatch(getKMDBalanceTotal(coin));
Store.dispatch(getNativeTxHistory(coin));
@ -61,6 +69,7 @@ class CoinTileItem extends React.Component {
}
if (mode === 'basilisk') {
const useAddress = this.props.ActiveCoin.mainBasiliskAddress ? this.props.ActiveCoin.mainBasiliskAddress : this.props.Dashboard.activeHandle[coin];
Store.dispatch(iguanaActiveHandle(true));
Store.dispatch(getKMDAddressesNative(coin, mode, useAddress));
Store.dispatch(getShepherdCache(JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey, coin));
@ -72,8 +81,8 @@ class CoinTileItem extends React.Component {
if (!this.props.ActiveCoin.addresses) {
Store.dispatch(getAddressesByAccount(coin, mode));
}
Store.dispatch(getBasiliskTransactionsList(coin, useAddress));
//Store.dispatch(iguanaEdexBalance(coin, mode));
}
}
}
@ -87,16 +96,15 @@ class CoinTileItem extends React.Component {
this.dispatchCoinActions(coin, mode);
if (mode === 'full') {
var _iguanaActiveHandle = setInterval(function() {
const _iguanaActiveHandle = setInterval(() => {
this.dispatchCoinActions(coin, mode);
}.bind(this), 3000);
}, IGUNA_ACTIVE_HANDLE_TIMEOUT);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
}
if (mode === 'native') {
// TODO: add conditions to skip txhistory, balances, addresses while "activating best chain"
var _iguanaActiveHandle = setInterval(function() {
const _iguanaActiveHandle = setInterval(() => {
this.dispatchCoinActions(coin, mode);
}.bind(this), coin === 'KMD' ? 15000 : 3000);
}, coin === 'KMD' ? IGUNA_ACTIVE_HANDLE_TIMEOUT_KMD_NATIVE : IGUNA_ACTIVE_HANDLE_TIMEOUT);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
}
if (mode === 'basilisk') {
@ -112,11 +120,11 @@ class CoinTileItem extends React.Component {
'address': _basiliskMainAddress,
}));
var _iguanaActiveHandle = setInterval(function() {
const _iguanaActiveHandle = setInterval(() => {
this.dispatchCoinActions(coin, mode);
}.bind(this), 3000);
}, IGUNA_ACTIVE_HANDLE_TIMEOUT);
var _basiliskCache = setInterval(function() {
const _basiliskCache = setInterval(() => {
Store.dispatch(fetchNewCacheData({
'pubkey': this.props.Dashboard.activeHandle.pubkey,
'allcoins': false,
@ -124,10 +132,9 @@ class CoinTileItem extends React.Component {
'calls': 'listtransactions:getbalance',
'address': _basiliskMainAddress,
}));
}.bind(this), 240000);
}, BASILISK_CACHE_UPDATE_TIMEOUT);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
Store.dispatch(startInterval('basilisk', _basiliskCache));
// basilisk
}
}
}
@ -145,9 +152,9 @@ class CoinTileItem extends React.Component {
<a className="avatar margin-bottom-5" id="edexcoin-logo">
<img
className="img-responsive"
src={ 'assets/images/cryptologo/' + item.coinlogo + '.png' }
src={ `assets/images/cryptologo/${item.coinlogo}.png` }
alt={ item.coinname }/>
<span className={ 'badge up badge-' + item.modecolor } id="basfull">{ item.modecode }</span>
<span className={ `badge up badge-${item.modecolor}` } id="basfull">{ item.modecode }</span>
</a>
<div className="coin-name">{ item.coinname } ({ item.coinlogo.toUpperCase() })</div>
</div>

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

@ -19,6 +19,27 @@ class Navbar extends React.Component {
};
this.openDropMenu = this.openDropMenu.bind(this);
this.logout = this.logout.bind(this);
this.handleClickOutside = this.handleClickOutside.bind(this);
}
componentWillMount() {
document.addEventListener('click', this.handleClickOutside, false);
}
componentWillUnmount() {
document.removeEventListener('click', this.handleClickOutside, false);
}
handleClickOutside(e) {
if (e.srcElement.className !== 'dropdown-menu' &&
e.srcElement.alt !== 'iguana profile pic' &&
(e.srcElement.offsetParent && e.srcElement.offsetParent.className !== 'avatar avatar-online') &&
e.srcElement.className.indexOf('navbar-avatar') === -1 &&
(e.path && e.path[4] && e.path[4].className.indexOf('dropdown-menu') === -1)) {
this.setState({
openDropMenu: false,
});
}
}
openDropMenu() {
@ -114,11 +135,6 @@ class Navbar extends React.Component {
<i className="site-menu-icon" aria-hidden="true"></i> Atomic Explorer
</a>
</li>
<li className="nav-top-menu">
<a id="nav-iguana-atomic-explorer" onClick={ () => this.openSyncOnlyModal() }>
<i className="site-menu-icon" aria-hidden="true"></i> { translate('ADD_COIN.SYNC_ONLY') }
</a>
</li>
</ul>
<ul className="nav navbar-toolbar navbar-right navbar-toolbar-right">
<li role="presentation">
@ -150,6 +166,14 @@ class Navbar extends React.Component {
<i className="icon md-settings" aria-hidden="true"></i> { translate('INDEX.SETTINGS') }
</a>
</li>
<li role="presentation">
<a
role="menuitem"
id="nav-iguana-sync-only"
onClick={ () => this.openSyncOnlyModal() }>
<i className="icon fa-cubes" aria-hidden="true"></i> { translate('ADD_COIN.SYNC_ONLY') }
</a>
</li>
<li role="presentation">
<a
role="menuitem"

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

@ -12,10 +12,12 @@ class Notifications extends React.Component {
super(props);
this.state = {
displayModal: false,
totalCalls: 0,
totalErrorCalls: 0,
totalSuccessCalls: 0,
totalPendingCalls: 0,
calls: {
total: 0,
error: 0,
success: 0,
pending: 0,
},
activeTab: 2,
guiLog: null,
};
@ -33,31 +35,27 @@ class Notifications extends React.Component {
if (this.props.Dashboard &&
this.props.Dashboard.guiLog) {
const _guiLog = this.props.Dashboard.guiLog;
let totalCalls = Object.keys(_guiLog).length;
let totalErrorCalls = 0;
let totalSuccessCalls = 0;
let totalPendingCalls = 0;
let _callsLength = {
total: Object.keys(_guiLog).length,
error: 0,
success: 0,
pending: 0,
}
let guiLogToArray = [];
for (let timestamp in _guiLog) {
guiLogToArray.push(_guiLog[timestamp]);
if (_guiLog[timestamp].status === 'error') {
totalErrorCalls++;
}
if (_guiLog[timestamp].status === 'success') {
totalSuccessCalls++;
}
if (_guiLog[timestamp].status === 'pending') {
totalPendingCalls++;
}
_callsLength[_guiLog[timestamp].status]++;
}
this.setState(Object.assign({}, this.state, {
totalCalls,
totalErrorCalls,
totalSuccessCalls,
totalPendingCalls,
calls: {
total: _callsLength.total,
error: _callsLength.error,
success: _callsLength.success,
pending: _callsLength.pending,
},
guiLog: guiLogToArray,
}));
}
@ -70,7 +68,6 @@ class Notifications extends React.Component {
let _guiLog = this.state.guiLog;
_guiLog = sortByDate(_guiLog);
let items = [];
let index = 0;
for (let i = 0; i < _guiLog.length; i++) {
if (_guiLog[i].status === type) {
@ -78,7 +75,7 @@ class Notifications extends React.Component {
items.push(
<div key={ _logItem.timestamp }>
<div>{ index + 1 }.</div>
<div>{ i + 1 }.</div>
<div>
<strong>Time:</strong> { secondsToString(_logItem.timestamp, true, true) }
</div>
@ -101,8 +98,6 @@ class Notifications extends React.Component {
</div>
);
}
index++;
}
return items;
@ -123,21 +118,21 @@ class Notifications extends React.Component {
<a
role="tab"
onClick={ () => this.openTab(0) }>
<i className="icon fa fa-thumbs-o-up" aria-hidden="true"></i> Success ({ this.state.totalSuccessCalls })
<i className="icon fa fa-thumbs-o-up" aria-hidden="true"></i> Success ({ this.state.calls.success })
</a>
</li>
<li className={ this.state.activeTab === 1 ? 'active' : 'pointer' } role="presentation">
<a
role="tab"
onClick={ () => this.openTab(1) }>
<i className="icon fa fa-exclamation-triangle" aria-hidden="true"></i> Error ({ this.state.totalErrorCalls })
<i className="icon fa fa-exclamation-triangle" aria-hidden="true"></i> Error ({ this.state.calls.error })
</a>
</li>
<li className={ this.state.activeTab === 2 ? 'active' : 'pointer' } role="presentation">
<a
role="tab"
onClick={ () => this.openTab(2) }>
<i className="icon fa fa-clock-o" aria-hidden="true"></i> Pending ({ this.state.totalPendingCalls })
<i className="icon fa fa-clock-o" aria-hidden="true"></i> Pending ({ this.state.calls.pending })
</a>
</li>
</ul>
@ -192,9 +187,16 @@ class Notifications extends React.Component {
<div
className={ this.props.Dashboard.activeHandle && this.props.Dashboard.activeHandle.status === 'unlocked' ? 'notifications-badge stick-to-top' : 'notifications-badge' }
onClick={ this.toggleNotificationsModal }>
<span className="badge success">{ this.state.totalSuccessCalls }</span>
<span className="badge error">{ this.state.totalErrorCalls }</span>
<span className="badge pending">{ this.state.totalPendingCalls }</span>
<span className="badge success">{ this.state.calls.success }</span>
<span className="badge error">{ this.state.calls.error }</span>
<span className="badge pending">{ this.state.calls.pending }</span>
<div className={ this.state.calls.pending === 0 ? 'spinner spinner-hide' : 'spinner' }>
<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>

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

@ -291,7 +291,7 @@ class SendCoin extends React.Component {
renderAddressList() {
return (
<div id="showkmdwalletaddrs" className={ 'btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ' + (this.state.addressSelectorOpen ? 'open' : '') }>
<div id="showkmdwalletaddrs" className={ `btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ${(this.state.addressSelectorOpen ? 'open' : '')}` }>
<button
type="button"
className="btn dropdown-toggle btn-info"
@ -357,7 +357,8 @@ class SendCoin extends React.Component {
});
}
if (step === 1 || step === 2) {
if (step === 1 ||
step === 2) {
this.setState(Object.assign({}, this.state, {
currentStep: step,
utxoMethodInProgress: !this.state.sendApiType && this.props.ActiveCoin.mode === 'basilisk' ? true : false,
@ -411,7 +412,7 @@ class SendCoin extends React.Component {
'utxos': utxoSet
};
iguanaUTXORawTX(sendData)
iguanaUTXORawTX(sendData, Store.dispatch)
.then(function(json) {
console.log('sendData', sendData);
console.log('iguanaUTXORawTXJSON', json);
@ -424,7 +425,7 @@ class SendCoin extends React.Component {
'signedtx': json.signedtx,
'coin': sendData.coin
};
dexSendRawTX(dexrawtxData)
dexSendRawTX(dexrawtxData, Store.dispatch)
.then(function(dexRawTxJSON) {
console.log('dexRawTxJSON', dexRawTxJSON);
if (dexRawTxJSON.indexOf('"error":{"code"') > -1) {
@ -445,7 +446,7 @@ class SendCoin extends React.Component {
edexGetTransaction({
'coin': sendData.coin,
'txid': dexRawTxJSON.txid ? dexRawTxJSON.txid : dexRawTxJSON
})
}, Store.dispatch)
.then(function(json) {
console.log('gettx', json);
resolve(json);

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

@ -23,6 +23,7 @@ import AddCoinOptionsACFiat from '../addcoin/addcoinOptionsACFiat';
2) add fiat section
3) kickstart section
4) batch export/import wallet addresses
5) export keys, add coin selector
*/
class Settings extends React.Component {
constructor(props) {
@ -31,8 +32,9 @@ class Settings extends React.Component {
activeTab: 0,
debugLinesCount: 10,
debugTarget: 'iguana',
activeTabHeight: '10px',
activeTabHeight: '0',
appSettings: {},
tabElId: null,
};
this.exportWifKeys = this.exportWifKeys.bind(this);
this.updateInput = this.updateInput.bind(this);
@ -52,13 +54,28 @@ class Settings extends React.Component {
Store.dispatch(getAppInfo());
}
openTab(elemId, tab) {
const _height = document.querySelector('#' + elemId + ' .panel-collapse .panel-body').offsetHeight;
componentWillReceiveProps(props) {
if (this.state.tabElId) {
const _height = document.querySelector(`#${this.state.tabElId} .panel-collapse .panel-body`).offsetHeight;
this.setState(Object.assign({}, this.state, {
activeTab: tab,
activeTabHeight: _height,
}));
this.setState(Object.assign({}, this.state, {
activeTab: this.state.activeTab,
activeTabHeight: _height,
tabElId: this.state.tabElId,
}));
}
}
openTab(elemId, tab) {
setTimeout(() => {
const _height = document.querySelector(`#${elemId} .panel-collapse .panel-body`).offsetHeight;
this.setState(Object.assign({}, this.state, {
activeTab: tab,
activeTabHeight: _height,
tabElId: elemId,
}));
}, 100);
}
exportWifKeys() {
@ -108,15 +125,15 @@ class Settings extends React.Component {
if (releaseInfo) {
return (
<div className="panel" id="AppInfo">
<div className="panel-heading" role="tab" onClick={ () => this.openTab('AppInfo', 8) }>
<div className="panel" id="AppInfo" onClick={ () => this.openTab('AppInfo', 8) }>
<div className="panel-heading" role="tab">
<a className={this.state.activeTab === 8 ? 'panel-title' : 'panel-title collapsed'}>
<i className="icon md-info" aria-hidden="true"></i>{ translate('SETTINGS.APP_INFO') }
</a>
</div>
<div
className={ this.state.activeTab === 8 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }
style={{ height: this.state.activeTab === 8 ? this.state.activeTabHeight + 'px' : '10px' }}
style={{ height: this.state.activeTab === 8 ? this.state.activeTabHeight + 'px' : '0' }}
aria-labelledby="DebugLog"
role="tabpanel">
<div className="panel-body">
@ -217,8 +234,6 @@ class Settings extends React.Component {
this.setState({
appSettings: _appSettings,
});
console.log(this.state.appSettings);
}
_saveAppConfig() {
@ -295,6 +310,27 @@ class Settings extends React.Component {
});
}
renderDebugLogData() {
if (this.props.Settings.debugLog) {
const _debugLogDataRows = this.props.Settings.debugLog.split('\n');
if (_debugLogDataRows &&
_debugLogDataRows.length) {
return _debugLogDataRows.map((_row) =>
<div
key={ `settings-debuglog-${Math.random(0, 9) * 10}` }
className="padding-bottom-5">{ _row }</div>
);
} else {
return (
<span>{ translate('INDEX.EMPTY_DEBUG_LOG') }</span>
);
}
} else {
return null;
}
}
renderLB(_translationID) {
const _translationComponents = translate(_translationID).split('<br>');
@ -316,15 +352,18 @@ class Settings extends React.Component {
<div className="col-xlg-12 col-md-12">
<h4 className="font-size-14 text-uppercase">{ translate('INDEX.WALLET_SETTINGS') }</h4>
<div className="panel-group" id="SettingsAccordion" aria-multiselectable="true" role="tablist">
<div className="panel" id="WalletInfo">
<div className="panel-heading" role="tab" onClick={ () => this.openTab('WalletInfo', 0) }>
<div
className="panel"
id="WalletInfo"
onClick={ () => this.openTab('WalletInfo', 0) }>
<div className="panel-heading" role="tab">
<a className={ this.state.activeTab === 0 ? 'panel-title' : 'panel-title collapsed' }>
<i className="icon md-balance-wallet" aria-hidden="true"></i>{ translate('INDEX.WALLET_INFO') }
</a>
</div>
<div
className={ this.state.activeTab === 0 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }
style={{ height: this.state.activeTab === 0 ? this.state.activeTabHeight + 'px' : '10px' }}
style={{ height: this.state.activeTab === 0 ? this.state.activeTabHeight + 'px' : '0' }}
id="WalletInfoTab"
aria-labelledby="WalletInfo"
role="tabpanel">
@ -379,15 +418,18 @@ class Settings extends React.Component {
</div>
</div>
<div className="panel" id="AddNodeforCoin">
<div className="panel-heading" role="tab" onClick={ () => this.openTab('AddNodeforCoin', 1) }>
<div
className="panel"
id="AddNodeforCoin"
onClick={ () => this.openTab('AddNodeforCoin', 1) }>
<div className="panel-heading" role="tab">
<a className={ this.state.activeTab === 1 ? 'panel-title' : 'panel-title collapsed' }>
<i className="icon md-plus-square" aria-hidden="true"></i>{ translate('INDEX.ADD_NODE') }
</a>
</div>
<div
className={ this.state.activeTab === 1 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }
style={{ height: this.state.activeTab === 1 ? this.state.activeTabHeight + 'px' : '10px' }}
style={{ height: this.state.activeTab === 1 ? this.state.activeTabHeight + 'px' : '0' }}
id="AddNodeforCoinTab"
aria-labelledby="AddNodeforCoin"
role="tabpanel">
@ -470,15 +512,18 @@ class Settings extends React.Component {
</div>
</div>
<div className="panel" id="DumpWallet">
<div className="panel-heading" role="tab" onClick={ () => this.openTab('DumpWallet', 2) }>
<div
className="panel"
id="DumpWallet"
onClick={ () => this.openTab('DumpWallet', 2) }>
<div className="panel-heading" role="tab">
<a className={this.state.activeTab === 2 ? 'panel-title' : 'panel-title collapsed'}>
<i className="icon wb-briefcase" aria-hidden="true"></i>{ translate('INDEX.WALLET_BACKUP') }
</a>
</div>
<div
className={ this.state.activeTab === 2 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }
style={{ height: this.state.activeTab === 2 ? this.state.activeTabHeight + 'px' : '10px' }}
style={{ height: this.state.activeTab === 2 ? this.state.activeTabHeight + 'px' : '0' }}
id="DumpWalletTab"
aria-labelledby="DumpWallet"
role="tabpanel">
@ -486,18 +531,18 @@ class Settings extends React.Component {
</div>
</div>
<div className="panel" id="FiatCurrencySettings">
<div
className="panel-heading"
role="tab"
onClick={ () => this.openTab('FiatCurrencySettings', 3) }>
<div
className="panel"
id="FiatCurrencySettings"
onClick={ () => this.openTab('FiatCurrencySettings', 3) }>
<div className="panel-heading" role="tab">
<a className={ this.state.activeTab === 3 ? 'panel-title' : 'panel-title collapsed' }>
<i className="icon fa-money" aria-hidden="true"></i>{ translate('INDEX.FIAT_CURRENCY') }
</a>
</div>
<div
className={ this.state.activeTab === 3 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }
style={{ height: this.state.activeTab === 3 ? this.state.activeTabHeight + 'px' : '10px' }}
style={{ height: this.state.activeTab === 3 ? this.state.activeTabHeight + 'px' : '0' }}
id="FiatCurrencySettingsTab"
aria-labelledby="FiatCurrencySettings"
role="tabpanel">
@ -505,15 +550,18 @@ class Settings extends React.Component {
</div>
</div>
<div className="panel" id="ExportKeys">
<div className="panel-heading" role="tab" onClick={ () => this.openTab('ExportKeys', 4) }>
<div
className="panel"
id="ExportKeys"
onClick={ () => this.openTab('ExportKeys', 4) }>
<div className="panel-heading" role="tab">
<a className={ this.state.activeTab === 4 ? 'panel-title' : 'panel-title collapsed' }>
<i className="icon md-key" aria-hidden="true"></i>{ translate('INDEX.EXPORT_KEYS') }
</a>
</div>
<div
className={ this.state.activeTab === 4 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }
style={{ height: this.state.activeTab === 4 ? this.state.activeTabHeight + 'px' : '10px' }}
style={{ height: this.state.activeTab === 4 ? this.state.activeTabHeight + 'px' : '0' }}
id="ExportKeysTab"
aria-labelledby="ExportKeys"
role="tabpanel">
@ -566,15 +614,18 @@ class Settings extends React.Component {
</div>
</div>
<div className="panel" id="ImportKeys">
<div className="panel-heading" role="tab" onClick={ () => this.openTab('ImportKeys', 5) }>
<div
className="panel"
id="ImportKeys"
onClick={ () => this.openTab('ImportKeys', 5) }>
<div className="panel-heading" role="tab">
<a className={ this.state.activeTab === 5 ? 'panel-title' : 'panel-title collapsed' }>
<i className="icon md-key" aria-hidden="true"></i>{ translate('INDEX.IMPORT_KEYS') }
</a>
</div>
<div
className={ this.state.activeTab === 5 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }
style={{ height: this.state.activeTab === 5 ? this.state.activeTabHeight + 'px' : '10px' }}
style={{ height: this.state.activeTab === 5 ? this.state.activeTabHeight + 'px' : '0' }}
id="ImportKeysTab"
aria-labelledby="ImportKeys"
role="tabpanel">
@ -612,15 +663,18 @@ class Settings extends React.Component {
</div>
</div>
<div className="panel" id="DebugLog">
<div className="panel-heading" role="tab" onClick={ () => this.openTab('DebugLog', 6) }>
<div
className="panel"
id="DebugLog"
onClick={ () => this.openTab('DebugLog', 6) }>
<div className="panel-heading" role="tab">
<a className={ this.state.activeTab === 6 ? 'panel-title' : 'panel-title collapsed' }>
<i className="icon fa-bug" aria-hidden="true"></i>{ translate('INDEX.DEBUG_LOG') }
</a>
</div>
<div
className={ this.state.activeTab === 6 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }
style={{ height: this.state.activeTab === 6 ? this.state.activeTabHeight + 'px' : '10px' }}
style={{ height: this.state.activeTab === 6 ? this.state.activeTabHeight + 'px' : '0' }}
id="DebugLogTab" aria-labelledby="DebugLog" role="tabpanel">
<div className="panel-body">
<p>{ translate('INDEX.DEBUG_LOG_DESC') }</p>
@ -663,22 +717,25 @@ class Settings extends React.Component {
onClick={ this.readDebugLog }>{ translate('INDEX.LOAD_DEBUG_LOG') }</button>
</div>
<div className="col-sm-12 col-xs-12 text-align-left">
<div className="padding-top-40 padding-bottom-20 horizontal-padding-0">{ this.props.Settings.debugLog }</div>
<div className="padding-top-40 padding-bottom-20 horizontal-padding-0">{ this.renderDebugLogData() }</div>
</div>
</form>
</div>
</div>
</div>
<div className="panel" id="AppSettings">
<div className="panel-heading" role="tab" onClick={ () => this.openTab('AppSettings', 7) }>
<div
className="panel"
id="AppSettings"
onClick={ () => this.openTab('AppSettings', 7) }>
<div className="panel-heading" role="tab">
<a className={ this.state.activeTab === 7 ? 'panel-title' : 'panel-title collapsed' }>
<i className="icon fa-wrench" aria-hidden="true"></i>{ translate('SETTINGS.APP_CONFIG') } (config.json)
</a>
</div>
<div
className={ this.state.activeTab === 7 ? 'panel-collapse collapse in' : 'panel-collapse collapse' }
style={{ height: this.state.activeTab === 7 ? this.state.activeTabHeight + 'px' : '10px' }}
style={{ height: this.state.activeTab === 7 ? this.state.activeTabHeight + 'px' : '0' }}
id="DebugLogTab" aria-labelledby="DebugLog" role="tabpanel">
<div className="panel-body">
<p>

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

@ -1,5 +1,6 @@
import React from 'react';
import { translate } from '../../translate/translate';
import { getCoinTitle } from '../../util/coinHelper';
import {
stopInterval,
addCoin,
@ -19,7 +20,8 @@ class SyncOnly extends React.Component {
}
isFullySynced(fork) {
if (fork.balances && ((Number(fork.balances) +
if (fork.balances &&
((Number(fork.balances) +
Number(fork.validated) +
Number(fork.bundles) +
Number(fork.utxo)) / 4 === 100)) {
@ -30,96 +32,15 @@ class SyncOnly extends React.Component {
}
renderCoinName(coin) {
let coinlogo;
let coinname;
switch (coin) {
case 'BTC':
coinlogo = 'bitcoin';
coinname = 'Bitcoin';
break;
case 'BTCD':
coinlogo = 'bitcoindark';
coinname = 'BitcoinDark';
break;
case 'LTC':
coinlogo = 'litecoin';
coinname = 'Litecoin';
break;
case 'VPN':
coinlogo = 'vpncoin';
coinname = 'VPNcoin';
break;
case 'SYS':
coinlogo = 'syscoin';
coinname = 'Syscoin';
break;
case 'ZEC':
coinlogo = 'zcash';
coinname = 'Zcash';
break;
case 'NMC':
coinlogo = 'namecoin';
coinname = 'Namecoin';
break;
case 'DEX':
coinlogo = 'dex';
coinname = 'InstantDEX';
break;
case 'DOGE':
coinlogo = 'dogecoin';
coinname = 'Dogecoin';
break;
case 'DGB':
coinlogo = 'digibyte';
coinname = 'Digibyte';
break;
case 'MZC':
coinlogo = 'mazacoin';
coinname = 'Mazacoin';
break;
case 'UNO':
coinlogo = 'unobtanium';
coinname = 'Unobtanium';
break;
case 'ZET':
coinlogo = 'zetacoin';
coinname = 'Zetacoin';
break;
case 'KMD':
coinlogo = 'komodo';
coinname = 'Komodo';
break;
case 'BTM':
coinlogo = 'bitmark';
coinname = 'Bitmark';
break;
case 'CARB':
coinlogo = 'carboncoin';
coinname = 'Carboncoin';
break;
case 'ANC':
coinlogo = 'anoncoin';
coinname = 'AnonCoin';
break;
case 'FRK':
coinlogo = 'franko';
coinname = 'Franko';
break;
case 'GAME':
coinlogo = 'GAME';
coinname = 'GameCredits';
break;
}
const _coinTitle = getCoinTitle(coin);
return {
'logo': coinlogo,
'name': coinname
'logo': _coinTitle.logo,
'name': _coinTitle.name
};
}
componentWillReceiveProps(props) {
// console.log('SyncOnly', props);
if (props.SyncOnly) {
for (let port in this.props.SyncOnly.forks) {
const forkInfo = this.props.SyncOnly.forks[port];
@ -130,7 +51,6 @@ class SyncOnly extends React.Component {
forkInfo.getinfo &&
forkInfo.getinfo.error &&
forkInfo.getinfo.error === 'bitcoinrpc needs coin that is active') {
console.log('fork add coin required');
let _autoRestartedForks = Object.assign({}, this.state.autoRestartedForks);
_autoRestartedForks[port] = true;
@ -138,14 +58,15 @@ class SyncOnly extends React.Component {
autoRestartedForks: _autoRestartedForks,
});
Store.dispatch(addCoin(forkInfo.registry.coin, '1', null, port));
setTimeout(function() {
setTimeout(() => {
let _autoRestartedForks = Object.assign({}, this.state.autoRestartedForks);
_autoRestartedForks[port] = false;
this.setState({
autoRestartedForks: _autoRestartedForks,
});
}.bind(this), 10000);
}, 10000);
}
}
}
@ -237,12 +158,14 @@ class SyncOnly extends React.Component {
<div className="avatar">
<img
className="img-responsive margin-bottom-5"
src={ 'assets/images/cryptologo/' + this.renderCoinName(forkInfo.registry.coin).logo + '.png' }
src={ `assets/images/cryptologo/${this.renderCoinName(forkInfo.registry.coin).logo}.png` }
alt={ forkInfo.registry.coin }/>
<span className="badge up badge-success margin-bottom-5">Full</span>
<div className="coin-name">{ this.renderCoinName(forkInfo.registry.coin).name } ({ forkInfo.registry.coin.toUpperCase() })</div>
<div className="margin-top-10">
<span className="btn btn-primary" onClick={ () => this._stopIguanaFork(forkInfo.registry.pmid) }>
<span
className="btn btn-primary"
onClick={ () => this._stopIguanaFork(forkInfo.registry.pmid) }>
<span className="fa fa-stop"></span> { translate('INDEX.STOP') }
</span>
<span
@ -281,7 +204,10 @@ class SyncOnly extends React.Component {
{ this.renderForksList() }
</div>
<div className="modal-footer">
<button type="button" className="btn btn-default" onClick={ this.closeSyncOnlyModal }>{ translate('INDEX.CLOSE') }</button>
<button
type="button"
className="btn btn-default"
onClick={ this.closeSyncOnlyModal }>{ translate('INDEX.CLOSE') }</button>
</div>
</div>
</div>

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

@ -30,7 +30,7 @@ class WalletsBalance extends React.Component {
this.props.ActiveCoin.mode === 'basilisk' &&
this.props.ActiveCoin.activeAddress &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin] &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress]&&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress] &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data.balance) {

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

@ -80,13 +80,13 @@ class WalletsBasiliskConnection extends React.Component {
</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>
{ `${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) + '%' }} role="progressbar" id="basilisk-connections-refresh-progress-bar"></div>
</div>
<pre id="basilisk-connections-refresh-status-output no-padding">
{ this.props.Dashboard.connectedNotaries.failedToConnectNodes ? 'Failed: ' + this.props.Dashboard.connectedNotaries.failedToConnectNodes : null }
{ this.props.Dashboard.connectedNotaries.failedToConnectNodes ? `Failed: ${this.props.Dashboard.connectedNotaries.failedToConnectNodes}` : null }
</pre>
</div>
</div>

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

@ -82,6 +82,7 @@ class WalletsData extends React.Component {
}
}
// deprecated
toggleCacheApi() {
const _useCache = !this.state.useCache;
@ -463,6 +464,7 @@ class WalletsData extends React.Component {
}
}*/
// deprecated
renderUseCacheToggle() {
if (this.props.ActiveCoin.mode === 'basilisk') {
return (
@ -552,11 +554,11 @@ class WalletsData extends React.Component {
this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] &&
this.props.ActiveCoin.mode === 'basilisk') {
return (
<div className={ 'btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ' + (this.state.addressSelectorOpen ? 'open' : '') }>
<div className={ `btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ${(this.state.addressSelectorOpen ? 'open' : '')}` }>
<button
type="button"
className="btn dropdown-toggle btn-info"
title={ '-' + translate('KMD_NATIVE.SELECT_ADDRESS') + '-' }
title={ `-${translate('KMD_NATIVE.SELECT_ADDRESS')}-` }
aria-expanded="true"
onClick={ this.openDropMenu }>
<span className="filter-option pull-left">{ this.renderSelectorCurrentLabel() } </span>&nbsp;
@ -609,7 +611,9 @@ class WalletsData extends React.Component {
{ translate('SEND.PROCESSING_REQ') }: { this.state.currentStackLength } / { this.state.totalStackLength }
</div>
</div>
<div className={ this.state.basiliskActionsMenu ? 'dropdown open' : 'dropdown' } onClick={ this.toggleBasiliskActionsMenu }>
<div
className={ this.state.basiliskActionsMenu ? 'dropdown open' : 'dropdown' }
onClick={ this.toggleBasiliskActionsMenu }>
<a
className="dropdown-toggle btn-xs btn-default"
id="btn_edexcoin_basilisk"

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

@ -1,7 +1,5 @@
import React from 'react';
import { translate } from '../../translate/translate';
// import { dashboardChangeSection, toggleAddcoinModal } from '../../actions/actionCreators';
// import Store from '../../store';
class WalletsHeader extends React.Component {
hasActiveSection() {
@ -19,7 +17,7 @@ class WalletsHeader extends React.Component {
<div
className="page-header page-header-bordered header-easydex margin-bottom-0"
id="easydex-header-div"
style={{ backgroundImage: 'url("assets/images/bg/' + this.props.activeSection + '_transparent_header_bg.png")', backgroundRepeat: 'no-repeat', backgroundPosition: '0%' }}>
style={{ backgroundImage: `url("assets/images/bg/${this.props.activeSection}_transparent_header_bg.png")`, backgroundRepeat: 'no-repeat', backgroundPosition: '0%' }}>
<h1 className={ this.isActiveSectionJumblr() ? 'hide' : 'page-title' }>EasyDEX</h1>
<ol className="breadcrumb">
<li className={ this.isActiveSectionJumblr() ? 'hide' : 'header-easydex-section' }>{ translate('INDEX.DASHBOARD') }</li>

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

@ -33,10 +33,10 @@ class WalletsNative extends React.Component {
return (
<div className="page margin-left-0">
<div id="section-extcoin" className="padding-top-0">
<div id="easydex-header-div" className="background-color-white" style={{ 'backgroundImage': 'url("assets/images/bg/' + this.defaultBG() + '_transparent_header_bg.png")' }}>
<div id="easydex-header-div" className="background-color-white" style={{ 'backgroundImage': `url("assets/images/bg/${this.defaultBG()}_transparent_header_bg.png")` }}>
<ol className="breadcrumb">
<li className="header-easydex-section">
<img src={ 'assets/images/native/' + this.defaultBG() + '_header_title_logo.png' } /> <span className={'easydex-section-image ' + (this.props.ActiveCoin.coin === 'KMD' ? 'hide' : '') }>{ this.props.ActiveCoin.coin }</span>
<img src={ `assets/images/native/${this.defaultBG()}_header_title_logo.png` } /> <span className={ `easydex-section-image ${(this.props.ActiveCoin.coin === 'KMD' ? 'hide' : '')}` }>{ this.props.ActiveCoin.coin }</span>
</li>
</ol>
</div>

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

@ -80,7 +80,7 @@ class WalletsNativeSend extends React.Component {
renderAddressList() {
return (
<div className={ 'btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ' + (this.state.addressSelectorOpen ? 'open' : '') }>
<div className={ `btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ${(this.state.addressSelectorOpen ? 'open' : '')}` }>
<button
type="button"
className="btn dropdown-toggle btn-info"
@ -106,31 +106,29 @@ class WalletsNativeSend extends React.Component {
}
renderOPIDLabel(opid) {
const _satatusDef = {
queued: {
icon: 'warning',
label: 'QUEUED'
},
executing: {
icon: 'info',
label: 'EXECUTING'
},
failed: {
icon: 'danger',
label: 'FAILED'
},
success: {
icon: 'success',
label: 'SUCCESS'
}
};
if (opid.status === 'queued') {
return (
<span className="label label-warning">
<i className="icon fa-eye"></i> <span>{ translate('KMD_NATIVE.QUEUED') }</span>
</span>
);
}
if (opid.status === 'executing') {
return (
<span className="label label-info">
<i className="icon fa-eye"></i> <span>{ translate('KMD_NATIVE.EXECUTING') }</span>
</span>
);
}
if (opid.status === 'failed') {
return (
<span className="label label-danger">
<i className="icon fa-eye"></i> <span>{ translate('KMD_NATIVE.FAILED') }</span>
</span>
);
}
if (opid.status === 'success') {
return (
<span className="label label-success">
<i className="icon fa-eye"></i> <span>{ translate('KMD_NATIVE.SUCCESS') }</span>
<span className={`label label-${_satatusDef[opid.status].icon}`}>
<i className="icon fa-eye"></i> <span>{ translate(`KMD_NATIVE.${_satatusDef[opid.status].label}`) }</span>
</span>
);
}
@ -217,14 +215,14 @@ class WalletsNativeSend extends React.Component {
handleSubmit() {
Store.dispatch(sendNativeTx(this.props.ActiveCoin.coin, this.state));
setTimeout(function() {
setTimeout(() => {
Store.dispatch(getKMDOPID(null, this.props.ActiveCoin.coin));
}.bind(this), 1000);
}, 1000);
}
getOAdress() {
resolveOpenAliasAddress(this.state.sendToOA)
.then(function(json) {
.then((json) => {
const reply = json.Answer;
if (reply &&
@ -247,7 +245,7 @@ class WalletsNativeSend extends React.Component {
} else {
Store.dispatch(triggerToaster(true, 'Couldn\'t find any addresses', 'OpenAlias', 'error'));
}
}.bind(this));
});
}
renderOASendUI() {
@ -293,7 +291,7 @@ class WalletsNativeSend extends React.Component {
<div className="col-xlg-12 col-md-12 col-sm-12 col-xs-12">
<div className="panel" id="projects">
<div className="panel-heading">
<h3 data-extcoin="COIN" className="panel-title">
<h3 className="panel-title">
{ translate('INDEX.SEND') } { this.props.ActiveCoin.coin }
</h3>
</div>

2
react/src/components/dashboard/walletsNativeSyncProgress.js

@ -57,7 +57,7 @@ class WalletsNativeSyncProgress extends React.Component {
}
}
return(': ' + Math.floor(currentBestChain * 100 / this.props.Dashboard.progress.remoteKMDNode.blocks) + '% (blocks ' + currentBestChain + ' / ' + this.props.Dashboard.progress.remoteKMDNode.blocks + ')');
return(`: ${Math.floor(currentBestChain * 100 / this.props.Dashboard.progress.remoteKMDNode.blocks)}% (blocks ${currentBestChain} / ${this.props.Dashboard.progress.remoteKMDNode.blocks})`);
} else {
return (
<span id="activating-komodod-tridot">...</span>

8
react/src/components/dashboard/walletsNativeTxHistory.js

@ -121,12 +121,12 @@ class WalletsNativeTxHistory extends React.Component {
renderPaginationItems() {
let items = [];
for (let i=0; i < Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) {
for (let i = 0; i < Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) {
items.push(
<li className={ this.state.activePage === i + 1 ? 'paginate_button active' : 'paginate_button' }>
<a
aria-controls="kmd-tx-history-tbl"
tabIndex="0" key={i + '-pagination'}
tabIndex="0" key={ `${i}-pagination` }
onClick={ this.state.activePage !== (i + 1) ? () => this.updateCurrentPage(i + 1) : null }>{ i + 1 }</a>
</li>
);
@ -142,7 +142,7 @@ class WalletsNativeTxHistory extends React.Component {
return (
<div className="dataTables_length" id="kmd-tx-history-tbl_length">
<label>
{translate('INDEX.SHOW')}&nbsp;
{ translate('INDEX.SHOW') }&nbsp;
<select
name="itemsPerPage"
aria-controls="kmd-tx-history-tbl"
@ -153,7 +153,7 @@ class WalletsNativeTxHistory extends React.Component {
<option value="50">50</option>
<option value="100">100</option>
</select>&nbsp;
{translate('INDEX.ENTRIES_SM')}
{ translate('INDEX.ENTRIES_SM') }
</label>
</div>
);

31
react/src/components/login/login.js

@ -14,6 +14,9 @@ import {
import Store from '../../store';
import { PassPhraseGenerator } from '../../util/crypto/passphrasegenerator';
const IGUNA_ACTIVE_HANDLE_TIMEOUT = 3000;
const IGUNA_ACTIVE_COINS_TIMEOUT = 10000;
class Login extends React.Component {
constructor(props) {
super(props);
@ -41,9 +44,9 @@ class Login extends React.Component {
openSyncOnlyModal() {
Store.dispatch(getSyncOnlyForks());
const _iguanaActiveHandle = setInterval(function() {
const _iguanaActiveHandle = setInterval(() => {
Store.dispatch(getSyncOnlyForks());
}.bind(this), 3000);
}, IGUNA_ACTIVE_HANDLE_TIMEOUT);
Store.dispatch(startInterval('syncOnly', _iguanaActiveHandle));
Store.dispatch(toggleSyncOnlyModal(true));
@ -67,21 +70,25 @@ class Login extends React.Component {
}
componentWillReceiveProps(props) {
if (props && props.Main && props.Main.isLoggedIn) {
if (props &&
props.Main &&
props.Main.isLoggedIn) {
this.setState({
display: false,
});
}
if (props && props.Main && !props.Main.isLoggedIn) {
if (props &&
props.Main &&
!props.Main.isLoggedIn) {
this.setState({
display: true,
});
if (!this.props.Interval.interval.activeCoins) {
const _iguanaActiveCoins = setInterval(function() {
const _iguanaActiveCoins = setInterval(() => {
Store.dispatch(getDexCoins());
}.bind(this), 10000);
}, IGUNA_ACTIVE_COINS_TIMEOUT);
Store.dispatch(startInterval('activeCoins', _iguanaActiveCoins));
}
@ -89,7 +96,9 @@ class Login extends React.Component {
}
if (this.state.activeLoginSection !== 'signup') {
if (props && props.Main && props.Main.activeCoins) {
if (props &&
props.Main &&
props.Main.activeCoins) {
this.setState({
activeLoginSection: 'login',
});
@ -164,8 +173,12 @@ class Login extends React.Component {
<h2>{ translate('LOGIN.SAVED_WALLET_SEED') }</h2>
<div className="swal2-content display-block">{ translate('LOGIN.SEED_MAKE_SURE_BACKUP') }</div>
<hr className="swal2-spacer display-block" />
<button className="swal2-confirm styled swal2-confirm-container" onClick={ this.execWalletCreate }>{ translate('LOGIN.YES_I_BACKUP') }</button>
<button className="swal2-cancel styled swal2-cancel-container" onClick={ this.toggleSeedBackupModal }>{ translate('LOGIN.CANCEL') }</button>
<button
className="swal2-confirm styled swal2-confirm-container"
onClick={ this.execWalletCreate }>{ translate('LOGIN.YES_I_BACKUP') }</button>
<button
className="swal2-cancel styled swal2-cancel-container"
onClick={ this.toggleSeedBackupModal }>{ translate('LOGIN.CANCEL') }</button>
</div>
</div>
);

4
react/src/components/main/main.js

@ -8,6 +8,8 @@ import {
iguanaActiveHandle
} from '../../actions/actionCreators';
const IGUANA_ACTIVE_HANDLE_TIMEOUT = 30000;
class Main extends React.Component {
constructor(props) {
super(props);
@ -24,7 +26,7 @@ class Main extends React.Component {
Store.dispatch(iguanaActiveHandle());
const _iguanaActiveHandle = setInterval(function() {
Store.dispatch(iguanaActiveHandle());
}, 30000);
}, IGUANA_ACTIVE_HANDLE_TIMEOUT);
this.setState(Object.assign({}, this.state, {
activeHandleInterval: _iguanaActiveHandle,

552
react/src/components/overrides.scss

@ -0,0 +1,552 @@
/* TODO: nesting, separate */
#app > div {
height: 100%;
}
.page-main {
background: #f3f4f5;
}
#kmd_header_button button {
margin-right: 5px;
}
.widget.active .bg-white {
box-shadow: inset 1px 1px 10px #ccc;
}
body {
padding-top: 44px;
}
.login-form,
.register-form {
width: 540px;
margin: 30px 0;
}
#section-iguana-wallet-settings .panel-title {
cursor: pointer;
cursor: hand;
}
#section-iguana-wallet-settings .panel-title:before {
content: '\F273';
}
#section-iguana-wallet-settings .panel-title.collapsed:before {
content: '\F278';
}
#section-dashboard {
height: 100%;
}
#section-iguana-wallet-settings {
background: #f3f4f5;
}
#edexcoin_dashboardinfo a,
.nav-top-menu,
#kmd_txid_info_mdl .nav-tabs li,
.pagination a,
.action {
cursor: pointer;
cursor: hand;
}
#easydex-header-div {
background-repeat: no-repeat;
background-size: 100%;
}
.unselectable {
user-select: none;
}
.seed-toggle {
position: absolute;
right: 0;
top: 0px;
cursor: pointer;
cursor: hand;
}
.radio-custom input {
cursor: pointer;
cursor: hand;
}
.collapse {
overflow: hidden;
display: block;
}
.collapse-active {
transition: height 0.3s ease-out;
}
.rc-tree {
height: 450px;
overflow-y: scroll;
margin-top: 20px;
a {
pointer-events: none;
}
li span.rc-tree-iconEle {
display: none;
}
}
.rc-tree-node-content-wrapper-close + ul {
height: 0;
}
.rc-tree-node-content-wrapper {
user-select: none;
}
.rc-tree-node-content-wrapper-normal {
color: inherit;
pointer-events: all;
user-select: all;
}
#RefreshBasiliskConnectionsMdl .btn-close {
position: absolute;
top: 15px;
right: 15px;
}
.page-aside {
position: fixed;
}
.page-aside-inner .wallet-widgets-list {
overflow-y: auto;
height: 100%;
}
.display-sync-only-coins-toggle {
cursor: pointer;
}
.display-sync-only-coins-toggle:hover {
color: #ffa726;
}
.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;
}
.btn-outline-primary {
color: #FF6600;
background-color: #fff;
border-color: #FF6600;
}
.add-coin-modal {
.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;
}
}
}
}
}
.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;
}
}
#SettingsAccordion {
.panel {
.panel-collapse {
transition: all .3s;
&.collapse {
height: 0;
}
}
}
}
.center {
text-align: center;
}
.navbar {
&.navbar-fixed-top {
.dropdown {
&.open {
.dropdown-menu {
right: 0;
}
}
.dropdown-menu {
display: block;
right: -165px;
}
}
}
}
/* The switch - the box around the slider */
.switch {
position: relative;
display: inline-block;
width: 40px;
height: 24px;
}
/* Hide default HTML checkbox */
.switch input {
display: none;
}
/* The slider */
.slider {
border-radius: 20px;
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
border-radius: 50%;
position: absolute;
content: "";
height: 20px;
width: 20px;
left: 2px;
bottom: 2px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
.toggle-label {
color: #757575;
display: inline-block;
position: relative;
top: -12px;
left: 8px;
}
input:checked + .slider {
background-color: rgb(57, 73, 171);
}
input:focus + .slider {
box-shadow: 0 0 1px rgb(57, 73, 171);
}
input:checked + .slider:before {
-webkit-transform: translateX(16px);
-ms-transform: translateX(16px);
transform: translateX(16px);
}
.dropdown-menu li {
cursor: pointer;
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
.pointer {
cursor: pointer;
}
.text-center {
text-align: center;
}
.breadcrumb > li + li:before {
display: none;
}
.notifications-modal {
color: #757575;
}
.notifications {
.notice {
position: relative;
margin: 1em;
background: #F9F9F9;
padding: 1em 1em 1em 2em;
border-left: 4px solid #DDD;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125);
}
.notice:before {
position: absolute;
top: 50%;
margin-top: -17px;
left: -17px;
background-color: #DDD;
color: #FFF;
width: 30px;
height: 30px;
border-radius: 100%;
text-align: center;
line-height: 30px;
font-weight: bold;
font-family: Georgia;
text-shadow: 1px 1px rgba(0, 0, 0, 0.5);
}
.info {
border-color: #0074D9;
}
.info:before {
content: 'i';
background-color: #0074D9;
}
.success {
border-color: #2ECC40;
}
.success:before {
content: '';
background-color: #2ECC40;
}
.warning {
border-color: #FFDC00;
}
.warning:before {
content: '!';
background-color: #FFDC00;
}
.error {
border-color: #FF4136;
}
.error:before {
content: 'X';
background-color: #FF4136;
}
}
.notifications-badge {
position: fixed;
bottom: 10px;
left: 5px;
cursor: pointer;
height: 20px;
z-index: 20;
.badge {
margin-left: 2px;
font-weight: bold;
}
.badge.success {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.badge.pending {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc;
}
.badge.error {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
}
.spinner-hide {
>div {
display: none;
}
}
.spinner {
position: absolute;
left: 60px;
bottom: -12px;
>div {
background-color: #fff;
margin-right: 1px;
width: 3px;
}
}
&.stick-to-top {
top: -3px;
left: 470px;
z-index: 1500;
.spinner {
display: inline-block;
position: relative;
left: -4px;
bottom: -16px;
>div {
background-color: #00bcd4;
margin-right: 1px;
width: 3px;
}
}
}
}
#js-copytextarea {
opacity: 0;
height: 10px;
width: 200px;
}
#app {
height: 100%;
}
.spinner {
width: 50px;
height: 40px;
text-align: center;
font-size: 10px;
}
.spinner > div {
background-color: #333;
height: 100%;
width: 6px;
display: inline-block;
-webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
animation: sk-stretchdelay 1.2s infinite ease-in-out;
}
.spinner .rect2 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}
.spinner .rect3 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
.spinner .rect4 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
}
.spinner .rect5 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s;
}
@-webkit-keyframes sk-stretchdelay {
0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
20% { -webkit-transform: scaleY(1.0) }
}
@keyframes sk-stretchdelay {
0%, 40%, 100% {
transform: scaleY(0.4);
-webkit-transform: scaleY(0.4);
} 20% {
transform: scaleY(1.0);
-webkit-transform: scaleY(1.0);
}
}
.bootstrap-select > .dropdown-toggle {
z-index: 0;
}

14
react/src/components/toaster/toaster-item.js

@ -1,6 +1,6 @@
import React from "react";
import {dismissToasterMessage} from "../../actions/actionCreators";
import Store from "../../store";
import React from 'react';
import { dismissToasterMessage } from '../../actions/actionCreators';
import Store from '../../store';
// each toast will be displayed for 5 seconds
const DISPLAY_LENGTH_MILLIS = 5000;
@ -10,7 +10,6 @@ const DISPLAY_LENGTH_MILLIS = 5000;
* each messages has a type, title and a content message
*/
class ToasterItem extends React.Component {
constructor(props) {
super(props);
this.state = {
@ -60,9 +59,10 @@ class ToasterItem extends React.Component {
}
return (
<div className={ 'toast toast-' + this.state.type }>
<button className="toast-close-button" role="button"
onClick={ () => this.dismissToast(this.state.toastId) }>×
<div className={ `toast toast-${this.state.type}` }>
<button
className="toast-close-button" role="button"
onClick={ () => this.dismissToast(this.state.toastId) }>×
</button>
<div className="toast-title">{ this.state.title }</div>
<div className="toast-message">{ this.state.message }</div>

52
react/src/components/toaster/toaster.js

@ -1,11 +1,8 @@
import React from "react";
import {dismissToasterMessage} from "../../actions/actionCreators";
import Store from "../../store";
import ToasterItem from "./toaster-item";
import React from 'react';
import { dismissToasterMessage } from '../../actions/actionCreators';
import Store from '../../store';
import ToasterItem from './toaster-item';
/**
* Container component used for creating multiple toasts
*/
class Toaster extends React.Component {
constructor(props) {
super(props);
@ -17,7 +14,7 @@ class Toaster extends React.Component {
componentWillReceiveProps(props) {
if (props &&
props.toasts) {
props.toasts) {
this.setState({
toasts: props.toasts,
toastId: props.toasts.length
@ -34,24 +31,33 @@ class Toaster extends React.Component {
Store.dispatch(dismissToasterMessage(toastId));
}
renderToasts() {
if (this.state.toasts &&
this.state.toasts.length) {
return this.state.toasts.map((toast) => {
// sets the toastId for all new toasts
if (!toast.toastId) {
toast.toastId = this.toastId++;
}
return (
<ToasterItem key={ toast.toastId } {...toast} />
);
});
} else {
return null;
}
}
// render all current toasts
render() {
return (
<div id="toast-container"
className="single-toast toast-bottom-right"
aria-live="polite"
role="alert">
{this.state.toasts
.map((toast) => {
// sets the toastId for all new toasts
if (!toast.toastId) {
toast.toastId = this.toastId++;
}
return (
<ToasterItem key={toast.toastId} {...toast} />
);
})}
<div
id="toast-container"
className="single-toast toast-bottom-right"
aria-live="polite"
role="alert">
{ this.renderToasts() }
</div>
);
}

31
react/src/reducers/dashboard.js

@ -11,6 +11,8 @@ import {
TOGGLE_NOTIFICATIONS_MODAL
} from '../actions/storeType';
const HTTP_STACK_MAX_ENTRIES = 150; // limit stack mem length to N records per type
export function Dashboard(state = {
activeSection: 'wallets',
activeHandle: null,
@ -69,6 +71,11 @@ export function Dashboard(state = {
});
case LOG_GUI_HTTP:
let _guiLogState = state.guiLog;
let _guiLogStateTrim = {
error: [],
success: [],
pending: []
};
if (_guiLogState[action.timestamp]) {
_guiLogState[action.timestamp].status = action.log.status;
@ -77,8 +84,30 @@ export function Dashboard(state = {
_guiLogState[action.timestamp] = action.log;
}
for (let timestamp in _guiLogState) {
if (_guiLogState[timestamp].status === 'error') {
_guiLogStateTrim.error.push(_guiLogState[timestamp]);
}
if (_guiLogState[timestamp].status === 'success') {
_guiLogStateTrim.success.push(_guiLogState[timestamp]);
}
if (_guiLogState[timestamp].status === 'pending') {
_guiLogStateTrim.pending.push(_guiLogState[timestamp]);
}
}
let _guiLogStateNew = {};
for (let _key in _guiLogStateTrim) {
if (_guiLogStateTrim[_key].length > HTTP_STACK_MAX_ENTRIES) {
_guiLogStateTrim[_key].shift();
}
for (let i = 0; i < _guiLogStateTrim[_key].length; i++) {
_guiLogStateNew[_guiLogStateTrim[_key][i].timestamp] = _guiLogStateTrim[_key][i];
}
}
return Object.assign({}, state, {
guiLog: _guiLogState,
guiLog: _guiLogStateNew,
});
default:
return state;

490
react/src/styles/index.scss

@ -1,7 +1,3 @@
@import '../components/addcoin/addcoin.scss';
@import '../components/dashboard/dashboard.scss';
@import '../components/login/login.scss';
@import '../assets/global/css/bootstrap.min.css';
@import '../assets/global/css/bootstrap-extend.min.css';
@import '../assets/global/css/alertify.css';
@ -34,485 +30,7 @@
@import '../assets/global/fonts/brand-icons/brand-icons.min.css';
@import '../assets/skins/orange.min.css';
@import '../../node_modules/rc-tree/assets/index.css';
#app > div {
height: 100%;
}
.page-main {
background: #f3f4f5;
}
#kmd_header_button button {
margin-right: 5px;
}
.widget.active .bg-white {
box-shadow: inset 1px 1px 10px #ccc;
}
body {
padding-top: 44px;
}
.login-form,
.register-form {
width: 540px;
margin: 30px 0;
}
#section-iguana-wallet-settings .panel-title {
cursor: pointer;
cursor: hand;
}
#section-iguana-wallet-settings .panel-title:before {
content: '\F273';
}
#section-iguana-wallet-settings .panel-title.collapsed:before {
content: '\F278';
}
#section-dashboard {
height: 100%;
}
#section-iguana-wallet-settings {
background: #f3f4f5;
}
#edexcoin_dashboardinfo a,
.nav-top-menu,
#kmd_txid_info_mdl .nav-tabs li,
.pagination a,
.action {
cursor: pointer;
cursor: hand;
}
#easydex-header-div {
background-repeat: no-repeat;
background-size: 100%;
}
.unselectable {
user-select: none;
}
.seed-toggle {
position: absolute;
right: 0;
top: 0px;
cursor: pointer;
cursor: hand;
}
.radio-custom input {
cursor: pointer;
cursor: hand;
}
.collapse {
overflow: hidden;
display: block;
}
.collapse-active {
transition: height 0.3s ease-out;
}
.rc-tree {
height: 450px;
overflow-y: scroll;
margin-top: 20px;
a {
pointer-events: none;
}
li span.rc-tree-iconEle {
display: none;
}
}
.rc-tree-node-content-wrapper-close + ul {
height: 0;
}
.rc-tree-node-content-wrapper {
user-select: none;
}
.rc-tree-node-content-wrapper-normal {
color: inherit;
pointer-events: all;
user-select: all;
}
#RefreshBasiliskConnectionsMdl .btn-close {
position: absolute;
top: 15px;
right: 15px;
}
.page-aside {
position: fixed;
}
.page-aside-inner .wallet-widgets-list {
overflow-y: auto;
height: 100%;
}
.display-sync-only-coins-toggle {
cursor: pointer;
}
.display-sync-only-coins-toggle:hover {
color: #ffa726;
}
.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;
}
.btn-outline-primary {
color: #FF6600;
background-color: #fff;
border-color: #FF6600;
}
.add-coin-modal {
.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;
}
}
}
}
}
.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;
}
}
#SettingsAccordion {
.panel {
.panel-collapse {
transition: all .3s;
&.collapse {
height: 10px;
}
}
}
}
.center {
text-align: center;
}
.navbar {
&.navbar-fixed-top {
.dropdown {
&.open {
.dropdown-menu {
right: 0;
}
}
.dropdown-menu {
display: block;
right: -165px;
}
}
}
}
/* The switch - the box around the slider */
.switch {
position: relative;
display: inline-block;
width: 40px;
height: 24px;
}
/* Hide default HTML checkbox */
.switch input {
display: none;
}
/* The slider */
.slider {
border-radius: 20px;
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
border-radius: 50%;
position: absolute;
content: "";
height: 20px;
width: 20px;
left: 2px;
bottom: 2px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
.toggle-label {
color: #757575;
display: inline-block;
position: relative;
top: -12px;
left: 8px;
}
input:checked + .slider {
background-color: rgb(57, 73, 171);
}
input:focus + .slider {
box-shadow: 0 0 1px rgb(57, 73, 171);
}
input:checked + .slider:before {
-webkit-transform: translateX(16px);
-ms-transform: translateX(16px);
transform: translateX(16px);
}
.dropdown-menu li {
cursor: pointer;
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
.pointer {
cursor: pointer;
}
.text-center {
text-align: center;
}
#section-dashboard .navbar-brand {
padding: 10px 20px;
}
.breadcrumb > li + li:before {
display: none;
}
.notifications-modal {
color: #757575;
}
.notifications {
.notice {
position: relative;
margin: 1em;
background: #F9F9F9;
padding: 1em 1em 1em 2em;
border-left: 4px solid #DDD;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125);
}
.notice:before {
position: absolute;
top: 50%;
margin-top: -17px;
left: -17px;
background-color: #DDD;
color: #FFF;
width: 30px;
height: 30px;
border-radius: 100%;
text-align: center;
line-height: 30px;
font-weight: bold;
font-family: Georgia;
text-shadow: 1px 1px rgba(0, 0, 0, 0.5);
}
.info {
border-color: #0074D9;
}
.info:before {
content: 'i';
background-color: #0074D9;
}
.success {
border-color: #2ECC40;
}
.success:before {
content: '';
background-color: #2ECC40;
}
.warning {
border-color: #FFDC00;
}
.warning:before {
content: '!';
background-color: #FFDC00;
}
.error {
border-color: #FF4136;
}
.error:before {
content: 'X';
background-color: #FF4136;
}
}
.notifications-badge.stick-to-top {
top: 38px;
left: 30px;
z-index: 1500;
}
.notifications-badge {
position: fixed;
bottom: 10px;
left: 5px;
cursor: pointer;
height: 20px;
z-index: 20;
.badge {
margin-left: 2px;
font-weight: bold;
}
.badge.success {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.badge.pending {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc;
}
.badge.error {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
}
}
#js-copytextarea {
opacity: 0;
height: 10px;
width: 200px;
}
#app {
height: 100%;
}
/*.toaster .single-toast:nth-child(0) {
bottom: 12px;
}
.toaster .single-toast:nth-child(1) {
bottom: 102px;
}
.toaster .single-toast:nth-child(2) {
bottom: 192px;
}
.toaster .single-toast:nth-child(3) {
bottom: 282px;
}*/
@import '../components/addcoin/addcoin.scss';
@import '../components/dashboard/dashboard.scss';
@import '../components/login/login.scss';
@import '../components/overrides.scss';

1
react/src/translate/en.js

@ -1,6 +1,7 @@
export const _lang = {
'EN': {
'INDEX': {
'EMPTY_DEBUG_LOG': 'Debug.log is empty',
'RESTART': 'Restart',
'WALLET_INFO': 'Wallet Info',
'ADD_COIN': 'Add Coin',

316
react/src/util/coinHelper.js

@ -0,0 +1,316 @@
export function getCoinTitle(coin) {
let coinlogo,
coinname;
switch (coin) {
case 'BTC':
coinlogo = 'bitcoin';
coinname = 'Bitcoin';
break;
case 'BTCD':
coinlogo = 'bitcoindark';
coinname = 'BitcoinDark';
break;
case 'LTC':
coinlogo = 'litecoin';
coinname = 'Litecoin';
break;
case 'VPN':
coinlogo = 'vpncoin';
coinname = 'VPNcoin';
break;
case 'SYS':
coinlogo = 'syscoin';
coinname = 'Syscoin';
break;
case 'ZEC':
coinlogo = 'zcash';
coinname = 'Zcash';
break;
case 'NMC':
coinlogo = 'namecoin';
coinname = 'Namecoin';
break;
case 'DEX':
coinlogo = 'dex';
coinname = 'InstantDEX';
break;
case 'DOGE':
coinlogo = 'dogecoin';
coinname = 'Dogecoin';
break;
case 'DGB':
coinlogo = 'digibyte';
coinname = 'Digibyte';
break;
case 'MZC':
coinlogo = 'mazacoin';
coinname = 'Mazacoin';
break;
case 'UNO':
coinlogo = 'unobtanium';
coinname = 'Unobtanium';
break;
case 'ZET':
coinlogo = 'zetacoin';
coinname = 'Zetacoin';
break;
case 'KMD':
coinlogo = 'komodo';
coinname = 'Komodo';
break;
case 'BTM':
coinlogo = 'bitmark';
coinname = 'Bitmark';
break;
case 'CARB':
coinlogo = 'carboncoin';
coinname = 'Carboncoin';
break;
case 'ANC':
coinlogo = 'anoncoin';
coinname = 'AnonCoin';
break;
case 'FRK':
coinlogo = 'franko';
coinname = 'Franko';
break;
case 'GAME':
coinlogo = 'GAME';
coinname = 'GameCredits';
break;
case 'SUPERNET':
coinlogo = 'SUPERNET';
coinname = 'SUPERNET';
break;
case 'REVS':
coinlogo = 'REVS';
coinname = 'REVS';
break;
case 'WLC':
coinlogo = 'WLC';
coinname = 'WIRELESS';
break;
case 'PANGEA':
coinlogo = 'PANGEA';
coinname = 'PANGEA';
break;
case 'JUMBLR':
coinlogo = 'JUMBLR';
coinname = 'JUMBLR';
break;
case 'BET':
coinlogo = 'BET';
coinname = 'BET';
break;
case 'CRYPTO':
coinlogo = 'CRYPTO';
coinname = 'CRYPTO';
break;
case 'HODL':
coinlogo = 'HODL';
coinname = 'HODL';
break;
case 'SHARK':
coinlogo = 'SHARK';
coinname = 'SHARK';
break;
case 'BOTS':
coinlogo = 'BOTS';
coinname = 'BOTS';
break;
case 'MGW':
coinlogo = 'MGW';
coinname = 'MultiGateway';
break;
case 'MVP':
coinlogo = 'MVP';
coinname = 'MVP Lineup';
break;
case 'KV':
coinlogo = 'KV';
coinname = 'KV';
break;
case 'CEAL':
coinlogo = 'CEAL';
coinname = 'CEAL NET';
break;
case 'MESH':
coinlogo = 'MESH';
coinname = 'SpaceMesh';
break;
case 'USD':
coinlogo = 'usd';
coinname = 'US Dollar';
break;
case 'RON':
coinlogo = 'RON';
coinname = 'Romanian Leu';
break;
case 'EUR':
coinlogo = 'EUR';
coinname = 'Euro';
break;
case 'JPY':
coinlogo = 'JPY';
coinname = 'Japanese Yen';
break;
case 'GBP':
coinlogo = 'GBP';
coinname = 'British Pound';
break;
case 'AUD':
coinlogo = 'AUD';
coinname = 'Australian Dollar';
break;
case 'CAD':
coinlogo = 'CAD';
coinname = 'Canadian Dollar';
break;
case 'CHF':
coinlogo = 'CHF';
coinname = 'Swiss Franc';
break;
case 'NZD':
coinlogo = 'NZD';
coinname = 'New Zealand Dollar';
break;
case 'CNY':
coinlogo = 'CNY';
coinname = 'Chinese Yuan';
break;
case 'RUB':
coinlogo = 'RUB';
coinname = 'Russian Ruble';
break;
case 'MXN':
coinlogo = 'MXN';
coinname = 'Mexican peso';
break;
case 'BRL':
coinlogo = 'BRL';
coinname = 'Brazilian Real';
break;
case 'INR':
coinlogo = 'INR';
coinname = 'Indian Rupee';
break;
case 'HKD':
coinlogo = 'HKD';
coinname = 'Hong Kong Dollar';
break;
case 'TRY':
coinlogo = 'TRY';
coinname = 'Turkish Lira';
break;
case 'ZAR':
coinlogo = 'ZAR';
coinname = 'South African Rand';
break;
case 'PLN':
coinlogo = 'PLN';
coinname = 'Polish Zloty';
break;
case 'NOK':
coinlogo = 'NOK';
coinname = 'Norwegian Krone';
break;
case 'SEK':
coinlogo = 'SEK';
coinname = 'Swedish Krona';
break;
case 'DKK':
coinlogo = 'DKK';
coinname = 'Danish Krone';
break;
case 'CZK':
coinlogo = 'CZK';
coinname = 'Czech Koruna';
break;
case 'HUF':
coinlogo = 'HUF';
coinname = 'Hungarian Forint';
break;
case 'ILS':
coinlogo = 'ILS';
coinname = 'Israeli Shekel';
break;
case 'KRW':
coinlogo = 'KRW';
coinname = 'Korean Won';
break;
case 'MYR':
coinlogo = 'MYR';
coinname = 'Malaysian Ringgit';
break;
case 'PHP':
coinlogo = 'PHP';
coinname = 'Philippine Peso';
break;
case 'SGD':
coinlogo = 'SGD';
coinname = 'Singapore Dollar';
break;
case 'THB':
coinlogo = 'THB';
coinname = 'Thai Baht';
break;
case 'BGN':
coinlogo = 'BGN';
coinname = 'Bulgarian Lev';
break;
case 'IDR':
coinlogo = 'IDR';
coinname = 'Indonesian Rupiah';
break;
case 'HRK':
coinlogo = 'HRK';
coinname = 'Croatian Kuna';
break;
}
return {
'logo': coinlogo,
'name': coinname
};
}
export function getModeInfo(mode) {
let modecode,
modetip,
modecolor;
switch (mode) {
case 'native':
modecode = 'Native';
modetip = 'Native';
modecolor = 'primary';
break;
case 'basilisk':
modecode = 'Basilisk';
modetip = 'Basilisk';
modecolor = 'info';
break;
case 'full':
modecode = 'Full';
modetip = 'Full';
modecolor = 'success';
break;
case 'virtual':
modecode = 'Virtual';
modetip = 'Virtual';
modecolor = 'danger';
break;
case 'notarychains':
modecode = 'Notarychains';
modetip = 'Notarychains';
modecolor = 'dark';
break;
}
return {
'code': modecode,
'tip': modetip,
'color': modecolor
};
}

8
react/webpack.config.js

@ -122,7 +122,13 @@ if (isProduction) {
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader!postcss-loader!sass-loader!file-loader!url-loader',
use: [
'css-loader',
'postcss-loader',
'sass-loader'
//'file-loader',
//'url-loader'
]
}),
}
);

Loading…
Cancel
Save