Browse Source

Merge pull request #10 from SuperNETorg/v0.25

V0.25
v0.25
pbca26 7 years ago
committed by GitHub
parent
commit
4a40022db7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      react/src/actions/actionCreators.js
  2. 29
      react/src/actions/actions/addCoin.js
  3. 4
      react/src/actions/actions/cli.js
  4. 14
      react/src/actions/actions/coinList.js
  5. 40
      react/src/actions/actions/electrum.js
  6. 4
      react/src/actions/actions/getTxDetails.js
  7. 6
      react/src/actions/actions/interest.js
  8. 16
      react/src/actions/actions/jumblr.js
  9. 20
      react/src/actions/actions/nativeDashboardUpdate.js
  10. 6
      react/src/actions/actions/nativeNetwork.js
  11. 1
      react/src/actions/actions/nativeNewAddress.js
  12. 18
      react/src/actions/actions/nativeSend.js
  13. 10
      react/src/actions/actions/nativeSyncInfo.js
  14. 6
      react/src/actions/actions/pin.js
  15. 58
      react/src/actions/actions/settings.js
  16. 6
      react/src/actions/actions/update.js
  17. 2
      react/src/actions/actions/walletAuth.js
  18. 63
      react/src/components/dashboard/coinTile/coinTileItem.js
  19. 32
      react/src/components/dashboard/coinTile/coinTileItem.render.js
  20. 25
      react/src/components/dashboard/receiveCoin/receiveCoin.js
  21. 5
      react/src/components/dashboard/receiveCoin/receiveCoin.render.js
  22. 9
      react/src/components/dashboard/sendCoin/sendCoin.js
  23. 18
      react/src/components/dashboard/sendCoin/sendCoin.render.js
  24. 2
      react/src/components/dashboard/settings/settings.exportKeysPanel.js
  25. 2
      react/src/components/dashboard/walletsInfo/walletsInfo.render.js
  26. 2
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js
  27. 18
      react/src/components/overrides.scss
  28. 5
      react/src/components/toaster/toaster-item.js
  29. 4
      react/src/components/toaster/toaster.scss
  30. 4
      react/src/translate/en.js

3
react/src/actions/actionCreators.js

@ -103,13 +103,14 @@ export function toggleSendReceiveCoinFormsState() {
}
}
export function triggerToaster(message, title, _type, autoClose = true) {
export function triggerToaster(message, title, _type, autoClose = true, className) {
return {
type: ADD_TOASTER_MESSAGE,
message,
title,
_type,
autoClose,
className,
}
}

29
react/src/actions/actions/addCoin.js

@ -70,12 +70,22 @@ export function shepherdElectrumAuth(seed) {
'Error',
'error'
)
)
);
})
.then(response => response.json())
.then(json => {
dispatch(activeHandle());
dispatch(shepherdElectrumCoins());
if (json.msg !== 'error') {
dispatch(activeHandle());
dispatch(shepherdElectrumCoins());
} else {
dispatch(
triggerToaster(
'Icorrect WIF key format',
'Error',
'error'
)
);
}
});
}
}
@ -96,7 +106,7 @@ export function shepherdElectrumAddCoin(coin) {
'Error',
'error'
)
)
);
})
.then(response => response.json())
.then(json => {
@ -140,7 +150,7 @@ export function shepherdHerd(coin, mode, path, startupParams) {
'-server',
`-ac_name=${coin}`,
'-addnode=78.47.196.146',
]
],
};
if (coin === 'ZEC') {
@ -149,7 +159,7 @@ export function shepherdHerd(coin, mode, path, startupParams) {
'ac_options': [
'-daemon=0',
'-server=1',
]
],
};
}
@ -159,7 +169,7 @@ export function shepherdHerd(coin, mode, path, startupParams) {
'ac_options': [
'-daemon=0',
'-addnode=78.47.196.146',
]
],
};
}
@ -268,10 +278,11 @@ export function addCoinResult(coin, mode) {
)
);
dispatch(toggleAddcoinModal(false, false));
if (Number(mode) === 0) {
dispatch(activeHandle());
dispatch(shepherdElectrumCoins());
dispatch(getDexCoins());
dispatch(getDexCoins());
setTimeout(() => {
dispatch(activeHandle());
@ -372,7 +383,7 @@ export function shepherdGetConfig(coin, mode, startupParams) {
startupParams
)
)
)
);
}
} else {
return dispatch => {

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

@ -29,7 +29,7 @@ export function shepherdCliPromise(mode, chain, cmd) {
);
})
.then(response => response.json())
.then(json => resolve(json))
.then(json => resolve(json));
});
}
@ -59,7 +59,7 @@ export function shepherdCli(mode, chain, cmd) {
);
})
.then(response => response.json())
.then(json => dispatch(cliResponseState(json)))
.then(json => dispatch(cliResponseState(json)));
}
}

14
react/src/actions/actions/coinList.js

@ -23,7 +23,7 @@ export function shepherdElectrumLock() {
);
})
.then(response => response.json())
.then(json => resolve(json))
.then(json => resolve(json));
});
}
@ -47,7 +47,7 @@ export function shepherdElectrumLogout() {
);
})
.then(response => response.json())
.then(json => resolve(json))
.then(json => resolve(json));
});
}
@ -71,7 +71,7 @@ export function shepherdStopCoind(coin) {
);
})
.then(response => response.json())
.then(json => resolve(json))
.then(json => resolve(json));
});
}
@ -111,7 +111,7 @@ export function shepherdRemoveCoin(coin, mode) {
)
);
}
})
});
});
}
@ -134,7 +134,7 @@ export function shepherdGetCoinList() {
);
})
.then(response => response.json())
.then(json => resolve(json))
.then(json => resolve(json));
});
}
@ -158,7 +158,7 @@ export function shepherdPostCoinList(data) {
);
})
.then(response => response.json())
.then(json => resolve(json))
.then(json => resolve(json));
});
}
@ -181,6 +181,6 @@ export function shepherdClearCoindFolder(coin, keepWalletDat) {
);
})
.then(response => response.json())
.then(json => resolve(json))
.then(json => resolve(json));
});
}

40
react/src/actions/actions/electrum.js

@ -17,7 +17,7 @@ export function shepherdElectrumSetServer(coin, address, port) {
method: 'GET',
headers: {
'Content-Type': 'application/json',
}
},
})
.catch((error) => {
console.log(error);
@ -42,7 +42,7 @@ export function shepherdElectrumCheckServerConnection(address, port) {
method: 'GET',
headers: {
'Content-Type': 'application/json',
}
},
})
.catch((error) => {
console.log(error);
@ -56,11 +56,7 @@ export function shepherdElectrumCheckServerConnection(address, port) {
})
.then(response => response.json())
.then(json => {
if (!json.result) {
resolve('error');
} else {
resolve(json);
}
resolve(!json.result ? 'error' : json);
});
});
}
@ -90,11 +86,7 @@ export function shepherdElectrumKeys(seed) {
})
.then(response => response.json())
.then(json => {
if (!json.result) {
resolve('error');
} else {
resolve(json);
}
resolve(!json.result ? 'error' : json);
});
});
}
@ -105,7 +97,7 @@ export function shepherdElectrumBalance(coin, address) {
method: 'GET',
headers: {
'Content-Type': 'application/json',
}
},
})
.catch((error) => {
console.log(error);
@ -137,7 +129,7 @@ export function shepherdElectrumTransactions(coin, address) {
method: 'GET',
headers: {
'Content-Type': 'application/json',
}
},
})
.catch((error) => {
console.log(error);
@ -178,7 +170,7 @@ export function shepherdElectrumCoins() {
method: 'GET',
headers: {
'Content-Type': 'application/json',
}
},
})
.catch((error) => {
console.log(error);
@ -211,7 +203,7 @@ export function shepherdElectrumSend(coin, value, sendToAddress, changeAddress)
method: 'GET',
headers: {
'Content-Type': 'application/json',
}
},
})
.catch((error) => {
console.log(error);
@ -225,11 +217,7 @@ export function shepherdElectrumSend(coin, value, sendToAddress, changeAddress)
})
.then(response => response.json())
.then(json => {
if (json.msg === 'error') {
dispatch(sendToAddressState(json));
} else {
dispatch(sendToAddressState(json.result));
}
dispatch(sendToAddressState(json.msg === 'error' ? json : json.result));
});
}
}
@ -240,7 +228,7 @@ export function shepherdElectrumSendPromise(coin, value, sendToAddress, changeAd
method: 'GET',
headers: {
'Content-Type': 'application/json',
}
},
})
.catch((error) => {
console.log(error);
@ -265,7 +253,7 @@ export function shepherdElectrumSendPreflight(coin, value, sendToAddress, change
method: 'GET',
headers: {
'Content-Type': 'application/json',
}
},
})
.catch((error) => {
console.log(error);
@ -304,11 +292,7 @@ export function shepherdElectrumListunspent(coin, address) {
})
.then(response => response.json())
.then(json => {
if (!json.result) {
resolve('error');
} else {
resolve(json);
}
resolve(!json.result ? 'error' : json);
});
});
}

4
react/src/actions/actions/getTxDetails.js

@ -11,6 +11,7 @@ export function getTxDetails(coin, txid, type) {
params: [
txid
],
rpc2cli: Config.rpc2cli,
};
if (type === 'raw') {
@ -22,6 +23,7 @@ export function getTxDetails(coin, txid, type) {
txid,
1
],
rpc2cli: Config.rpc2cli,
};
}
@ -47,6 +49,6 @@ export function getTxDetails(coin, txid, type) {
.then(response => response.json())
.then(json => {
resolve(json.result ? json.result : json);
})
});
});
}

6
react/src/actions/actions/interest.js

@ -8,6 +8,7 @@ export function getListUnspent(coin) {
mode: null,
chain: coin,
cmd: 'listunspent',
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
@ -49,7 +50,7 @@ export function getListUnspent(coin) {
}
resolve(json.result ? json.result : json);
})
});
});
}
@ -63,6 +64,7 @@ export function getRawTransaction(coin, txid) {
txid,
1
],
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
@ -90,6 +92,6 @@ export function getRawTransaction(coin, txid) {
.then(response => response.json())
.then(json => {
resolve(json.result ? json.result : json);
})
});
});
}

16
react/src/actions/actions/jumblr.js

@ -1,16 +1,17 @@
import {
triggerToaster,
getNewKMDAddresses
getNewKMDAddresses,
} from '../actionCreators';
import Config from '../../config';
import Store from '../../store';
function getNewAddress(coin) { // TODO: remove(?)
function getNewAddress(coin) {
return new Promise((resolve, reject) => {
const payload = {
mode: null,
chain: coin,
cmd: 'getnewaddress',
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
@ -38,7 +39,7 @@ function getNewAddress(coin) { // TODO: remove(?)
.then(response => response.json())
.then(json => {
resolve(json.result ? json.result : json);
})
});
});
}
@ -49,6 +50,7 @@ export function setJumblrAddress(coin, type, address) {
chain: coin,
cmd: type === 'deposit' ? 'jumblr_deposit' : 'jumblr_secret',
params: [address],
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
@ -87,6 +89,7 @@ export function pauseJumblr(coin) {
chain: coin,
cmd: 'jumblr_pause',
params: [],
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
@ -125,6 +128,7 @@ export function resumeJumblr(coin) {
chain: coin,
cmd: 'jumblr_resume',
params: [],
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
@ -163,6 +167,7 @@ function dumpPrivkey(coin, key) {
chain: coin,
cmd: 'dumpprivkey',
params: [key],
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
@ -190,7 +195,7 @@ function dumpPrivkey(coin, key) {
.then(response => response.json())
.then(json => {
resolve(json.result ? json.result : json);
})
});
});
}
@ -205,6 +210,7 @@ export function importPrivkey(coin, key, rescan = false) {
'',
rescan
],
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
@ -232,6 +238,6 @@ export function importPrivkey(coin, key, rescan = false) {
.then(response => response.json())
.then(json => {
resolve(json.result ? json.result : json);
})
});
});
}

20
react/src/actions/actions/nativeDashboardUpdate.js

@ -9,7 +9,10 @@ export function getDashboardUpdate(coin, activeCoinProps) {
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ coin: coin }),
body: JSON.stringify({
coin: coin,
rpc2cli: Config.rpc2cli,
}),
};
return fetch(
@ -38,7 +41,7 @@ export function getDashboardUpdate(coin, activeCoinProps) {
dispatch(getDashboardUpdateState(json, coin));
}, 100);
}
})
});
}
}
@ -80,7 +83,7 @@ export function getDashboardUpdateState(json, coin, fakeResponse) {
txhistory: _listtransactions,
balance: {
transparent: json.result.getbalance.result,
total: json.result.getbalance.result
total: json.result.getbalance.result,
},
addresses: json.result.addresses,
coin: coin,
@ -89,13 +92,14 @@ export function getDashboardUpdateState(json, coin, fakeResponse) {
};
} else {
// calc transparent balance properly
const _addresses = json.result.addresses;
let _tbalance = 0;
if (json.result.addresses &&
json.result.addresses.public &&
json.result.addresses.public.length) {
for (let i = 0; i < json.result.addresses.public.length; i++) {
_tbalance += json.result.addresses.public[i].spendable;
if (_addresses &&
_addresses.public &&
_addresses.public.length) {
for (let i = 0; i < _addresses.public.length; i++) {
_tbalance += _addresses.public[i].spendable;
}
}

6
react/src/actions/actions/nativeNetwork.js

@ -12,6 +12,7 @@ export function getNativePeers(coin) {
mode: null,
chain: coin,
cmd: 'getpeerinfo',
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
@ -40,7 +41,7 @@ export function getNativePeers(coin) {
.then(json => {
json = json.result;
dispatch(getNativePeersState(json));
})
});
};
}
@ -50,6 +51,7 @@ export function getNativeNettotals(coin) {
mode: null,
chain: coin,
cmd: 'getnettotals',
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
@ -78,7 +80,7 @@ export function getNativeNettotals(coin) {
.then(json => {
json = json.result;
dispatch(getNativeNettotalsState(json));
})
});
};
}

1
react/src/actions/actions/nativeNewAddress.js

@ -11,6 +11,7 @@ export function getNewKMDAddresses(coin, pubpriv, mode) {
mode: null,
chain: coin,
cmd: pubpriv === 'public' ? 'getnewaddress' : 'z_getnewaddress',
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {

18
react/src/actions/actions/nativeSend.js

@ -1,6 +1,6 @@
import {
DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS,
DASHBOARD_ACTIVE_COIN_SENDTO
DASHBOARD_ACTIVE_COIN_SENDTO,
} from '../storeType';
import { translate } from '../../translate/translate';
import { triggerToaster } from '../actionCreators';
@ -23,6 +23,7 @@ export function sendNativeTx(coin, _payload) {
mode: null,
chain: coin,
cmd: _apiMethod,
rpc2cli: Config.rpc2cli,
params:
(_payload.addressType === 'public' && _payload.sendTo.length !== 95) || !_payload.sendFrom ?
(_payload.substractFee ?
@ -77,8 +78,8 @@ export function sendNativeTx(coin, _payload) {
})
.then((json) => {
if (json.indexOf('"code":') > -1) {
const _message = json.substring(
`${json.indexOf('"message":"')}11`,
let _message = json.substring(
`${json.indexOf('"message":"') + 11}`,
json.indexOf('"},"id":"jl777"')
);
@ -100,6 +101,10 @@ export function sendNativeTx(coin, _payload) {
)
);
} else {
if (Config.rpc2cli) {
_message = JSON.parse(json).error.message;
}
dispatch(
triggerToaster(
_message,
@ -118,7 +123,7 @@ export function sendNativeTx(coin, _payload) {
)
);
}
})
});
}
}
@ -136,6 +141,7 @@ export function getKMDOPID(opid, coin) {
mode: null,
chain: coin,
cmd: 'z_getoperationstatus',
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
@ -164,7 +170,7 @@ export function getKMDOPID(opid, coin) {
.then(json => {
json = json.result;
dispatch(getKMDOPIDState(json));
})
});
};
}
@ -174,6 +180,7 @@ export function sendToAddressPromise(coin, address, amount) {
mode: null,
chain: coin,
cmd: 'sendtoaddress',
rpc2cli: Config.rpc2cli,
params: [
address,
amount,
@ -233,6 +240,7 @@ export function validateAddressPromise(coin, address) {
chain: coin,
cmd: 'validateaddress',
params: [ address ],
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {

10
react/src/actions/actions/nativeSyncInfo.js

@ -1,6 +1,6 @@
import {
SYNCING_NATIVE_MODE,
DASHBOARD_ACTIVE_COIN_GETINFO_FAILURE
DASHBOARD_ACTIVE_COIN_GETINFO_FAILURE,
} from '../storeType';
import {
triggerToaster,
@ -97,6 +97,7 @@ export function getSyncInfoNative(coin, skipDebug, skipRemote, suppressErrors) {
mode: null,
chain: coin,
cmd: 'getinfo',
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
method: 'POST',
@ -197,7 +198,7 @@ export function getSyncInfoNative(coin, skipDebug, skipRemote, suppressErrors) {
);
}
}
})
});
}
}
@ -206,6 +207,7 @@ export function getBlockTemplate(_json, coin) {
mode: null,
chain: coin,
cmd: 'getblocktemplate',
rpc2cli: Config.rpc2cli,
};
return dispatch => {
@ -262,7 +264,7 @@ export function getBlockTemplate(_json, coin) {
);
}
}
})
});
}
}
@ -338,6 +340,6 @@ export function getDebugLogProgress(_json, coin) {
)
);
}
})
});
}
}

6
react/src/actions/actions/pin.js

@ -40,7 +40,7 @@ export function encryptPassphrase(passphrase, key, pubKey) {
'success'
)
);
})
});
}
}
@ -71,7 +71,7 @@ export function loginWithPin(key, pubKey) {
.then(response => response.json())
.then(json => {
dispatch(iguanaWalletPassphrase(json.result));
})
});
}
}
@ -105,6 +105,6 @@ export function loadPinList() {
dispatch(
getPinList(json.result)
);
})
});
}
}

58
react/src/actions/actions/settings.js

@ -36,7 +36,7 @@ export function getAppInfo() {
);
})
.then(response => response.json())
.then(json => dispatch(getAppInfoState(json)))
.then(json => dispatch(getAppInfoState(json)));
}
}
@ -125,7 +125,7 @@ export function importPrivKey(wifKey) {
error: 'privkey already in wallet',
}, dispatch));
console.log('parsing failed', ex);
})
});
}
}
@ -167,7 +167,7 @@ export function getDebugLog(target, linesCount, acName) {
);
})
.then(response => response.json())
.then(json => dispatch(getDebugLogState(json)))
.then(json => dispatch(getDebugLogState(json)));
}
}
@ -197,7 +197,7 @@ export function getPeersList(coin) {
.then(response => response.json())
.then(json => {
dispatch(getPeersListState(json, dispatch));
})
});
}
}
@ -290,7 +290,7 @@ export function addPeerNode(coin, ip) {
.then(response => response.json())
.then(json => {
dispatch(addPeerNodeState(json, dispatch));
})
});
}
}
@ -323,7 +323,7 @@ export function saveAppConfig(_payload) {
'success'
)
);
})
});
}
}
@ -353,7 +353,7 @@ export function getAppConfig() {
);
})
.then(response => response.json())
.then(json => dispatch(getAppConfigState(json)))
.then(json => dispatch(getAppConfigState(json)));
}
}
@ -385,7 +385,7 @@ export function resetAppConfig() {
'success'
)
);
})
});
}
}
@ -449,7 +449,8 @@ export function dumpPrivKey(coin, address, isZaddr) {
mode: null,
chain: coin,
cmd: isZaddr ? 'z_exportkey' : 'dumpprivkey',
params: [ address ]
params: [ address ],
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
@ -477,6 +478,45 @@ export function dumpPrivKey(coin, address, isZaddr) {
.then(response => response.json())
.then(json => {
resolve(json.result ? json.result : json);
});
});
}
export function validateAddress(coin, address, isZaddr) {
return new Promise((resolve, reject) => {
const payload = {
mode: null,
chain: coin,
cmd: isZaddr ? 'z_validateaddress' : 'validateaddress',
params: [ address ],
rpc2cli: Config.rpc2cli,
};
const _fetchConfig = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ 'payload': payload }),
};
fetch(
`http://127.0.0.1:${Config.agamaPort}/shepherd/cli`,
_fetchConfig
)
.catch(function(error) {
console.log(error);
Store.dispatch(
triggerToaster(
'validateAddress',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
resolve(json.result ? json.result : json);
});
});
}

6
react/src/actions/actions/update.js

@ -21,7 +21,7 @@ export function checkForUpdateUIPromise() {
);
})
.then(response => response.json())
.then(json => resolve(json))
.then(json => resolve(json));
});
}
@ -44,7 +44,7 @@ export function updateUIPromise() {
);
})
.then(response => response.json())
.then(json => resolve(json))
.then(json => resolve(json));
});
}
@ -67,6 +67,6 @@ export function downloadZCashParamsPromise(dloption) {
);
})
.then(response => response.json())
.then(json => resolve(json))
.then(json => resolve(json));
});
}

2
react/src/actions/actions/walletAuth.js

@ -1,6 +1,6 @@
import {
LOGIN,
ACTIVE_HANDLE
ACTIVE_HANDLE,
} from '../storeType';
import { translate } from '../../translate/translate';
import Config from '../../config';

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

@ -46,8 +46,55 @@ class CoinTileItem extends React.Component {
activeCoin: null,
activeCoinMode: null,
propsUpdatedCounter: 0,
toggledCoinMenu: null,
};
this.autoSetActiveCoin = this.autoSetActiveCoin.bind(this);
this.toggleCoinMenu = this.toggleCoinMenu.bind(this);
this.handleClickOutside = this.handleClickOutside.bind(this);
}
componentWillMount() {
const appConfig = mainWindow.appConfig;
if (!this.props.ActiveCoin.coin) {
this.autoSetActiveCoin();
}
this.setState({
appConfig,
});
document.addEventListener(
'click',
this.handleClickOutside,
false
);
}
componentWillUnmount() {
document.removeEventListener(
'click',
this.handleClickOutside,
false
);
}
handleClickOutside(e) {
if (e &&
e.srcElement &&
e.srcElement.offsetParent &&
e.srcElement.offsetParent.className.indexOf('dropdown') === -1 &&
(e.srcElement.offsetParent && e.srcElement.offsetParent.className.indexOf('dropdown') === -1)) {
this.setState({
toggledCoinMenu: e.srcElement.className.indexOf('coin-tile-context-menu-trigger') === -1 ? null : this.state.toggledCoinMenu,
});
}
}
toggleCoinMenu(coin) {
this.setState({
toggledCoinMenu: this.state.toggledCoinMenu === coin ? null : coin,
});
}
openCoindDownModal() {
@ -130,19 +177,11 @@ class CoinTileItem extends React.Component {
}
}
componentWillMount() {
if (!this.props.ActiveCoin.coin) {
this.autoSetActiveCoin();
}
const appConfig = mainWindow.appConfig;
removeCoin(coin, mode) {
this.setState({
appConfig,
toggledCoinMenu: null,
});
}
removeCoin(coin, mode) {
shepherdRemoveCoin(coin, mode)
.then((res) => {
Store.dispatch(
@ -163,6 +202,10 @@ class CoinTileItem extends React.Component {
}
stopCoind(coin) {
this.setState({
toggledCoinMenu: null,
});
shepherdStopCoind(coin)
.then((res) => {
if (res.msg === 'error') {

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

@ -24,17 +24,41 @@ const CoinTileItemRender = function() {
</div>
</div>
</div>
{ this.renderStopCoinButton() &&
<button
onClick={ () => this.toggleCoinMenu(item.coin) }
className="btn btn-default btn-xs clipboard-edexaddr coin-tile-context-menu-trigger coind-actions-menu">
<i
title="Toggle coin context menu"
className="fa fa-ellipsis-v coin-tile-context-menu-trigger"></i>
</button>
{ this.state.toggledCoinMenu &&
this.state.toggledCoinMenu === item.coin &&
<div className="coin-tile-context-menu">
<ul>
{ this.renderStopCoinButton() &&
<li onClick={ () => this.stopCoind(item.coin, item.mode) }>
<i className="icon fa-stop-circle margin-right-5"></i> { translate('DASHBOARD.STOP') }
</li>
}
{ this.renderRemoveCoinButton() &&
<li onClick={ () => this.removeCoin(item.coin, item.mode) }>
<i className="icon fa-trash-o margin-right-5"></i> { translate('DASHBOARD.REMOVE') }
</li>
}
</ul>
</div>
}
{ /*this.renderStopCoinButton() &&
<i
onClick={ () => this.stopCoind(item.coin, item.mode) }
title={ translate('DASHBOARD.STOP') }
className="icon fa-stop-circle coind-stop-icon"></i>
className="icon fa-stop-circle coind-stop-icon"></i>*/
}
{ this.renderRemoveCoinButton() &&
{ /*this.renderRemoveCoinButton() &&
<i
onClick={ () => this.removeCoin(item.coin, item.mode) }
title={ translate('DASHBOARD.REMOVE') }
className={ 'icon fa-plus-circle coind-remove-icon' + (item.mode === 'spv' ? ' coind-remove-icon-spv' : '') }></i>
className={ 'icon fa-plus-circle coind-remove-icon' + (item.mode === 'spv' ? ' coind-remove-icon-spv' : '') }></i>*/
}
{ this.props.Dashboard &&
this.props.Dashboard.electrumCoins &&

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

@ -5,6 +5,8 @@ import {
getNewKMDAddresses,
dumpPrivKey,
copyString,
triggerToaster,
validateAddress,
} from '../../../actions/actionCreators';
import Store from '../../../store';
import {
@ -33,6 +35,7 @@ class ReceiveCoin extends React.Component {
this.ReceiveCoinTableRender = _ReceiveCoinTableRender.bind(this);
this.toggleAddressMenu = this.toggleAddressMenu.bind(this);
this.toggleIsMine = this.toggleIsMine.bind(this);
this.validateCoinAddress = this.validateCoinAddress.bind(this);
}
toggleAddressMenu(address) {
@ -61,6 +64,28 @@ class ReceiveCoin extends React.Component {
);
}
validateCoinAddress(address, isZaddr) {
this.toggleAddressMenu(address);
validateAddress(this.props.coin, address, isZaddr)
.then((json) => {
let _items = [];
for (let key in json) {
_items.push(`${key}: ${json[key]}`);
}
Store.dispatch(
triggerToaster(
_items,
translate('TOASTR.COIN_NOTIFICATION'),
json && json.ismine ? 'info' : 'warning',
false,
'toastr--validate-address'
)
);
});
}
dumpPrivKey(address, isZaddr) {
this.toggleAddressMenu(address);
dumpPrivKey(this.props.coin, address, isZaddr)

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

@ -30,6 +30,11 @@ export const AddressActionsNonBasiliskModeRender = function(address, type) {
<i className="icon fa-key margin-right-5"></i> { translate('INDEX.COPY') + ' priv key (WIF)' }
</li>
}
{ this.props.mode !== 'spv' &&
<li onClick={ () => this.validateCoinAddress(address, type !== 'public' ? true : null) }>
<i className="icon fa-check margin-right-5"></i> validate address
</li>
}
<li className="receive-address-context-menu-get-qr">
<QRModal content={ address } />
</li>

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

@ -211,11 +211,12 @@ class SendCoin extends React.Component {
renderAddressByType(type) {
let _items = [];
const _coinAddresses = this.props.ActiveCoin.addresses;
if (this.props.ActiveCoin.addresses &&
this.props.ActiveCoin.addresses[type] &&
this.props.ActiveCoin.addresses[type].length) {
this.props.ActiveCoin.addresses[type].map((address) => {
if (_coinAddresses &&
_coinAddresses[type] &&
_coinAddresses[type].length) {
_coinAddresses[type].map((address) => {
if (address.amount > 0 &&
(type !== 'public' || (address.canspend && type === 'public'))) {
_items.push(

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

@ -275,14 +275,16 @@ export const SendRender = function() {
<span className="label label-success">{ translate('SEND.SUCCESS_SM') }</span>
</td>
</tr>
<tr>
<td className="padding-left-30">
{ translate('INDEX.SEND_FROM') }
</td>
<td className="padding-left-30">
{ this.props.ActiveCoin.mode === 'spv' ? this.props.Dashboard.electrumCoins[this.props.ActiveCoin.coin].pub : this.state.sendFrom }
</td>
</tr>
{ this.state.sendFrom &&
<tr>
<td className="padding-left-30">
{ translate('INDEX.SEND_FROM') }
</td>
<td className="padding-left-30">
{ this.props.ActiveCoin.mode === 'spv' ? this.props.Dashboard.electrumCoins[this.props.ActiveCoin.coin].pub : this.state.sendFrom }
</td>
</tr>
}
<tr>
<td className="padding-left-30">
{ translate('INDEX.SEND_TO') }

2
react/src/components/dashboard/settings/settings.exportKeysPanel.js

@ -43,7 +43,7 @@ class ExportKeysPanel extends React.Component {
if (keys === 'error') {
Store.dispatch(
triggerToaster(
translate('SETTINGS.WRONG_PASSPHRASE'),
translate('SETTINGS.WRONG_PASSPHRASE') + ' or WIF key format',
translate('TOASTR.WALLET_NOTIFICATION'),
'error'
)

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

@ -28,7 +28,7 @@ const WalletsInfoRender = function() {
</td>
</tr>
<tr>
<td>{ translate('WALLETS_INFO.ADRESS_LOCAL') }</td>
<td>{ translate('WALLETS_INFO.ADDRESS_LOCAL') }</td>
<td>
{ _netPeers[i].addrlocal }
</td>

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

@ -2,6 +2,7 @@ import React from 'react';
import { translate } from '../../../translate/translate';
import { secondsToString } from '../../../util/time';
import Config from '../../../config';
import { isKomodoCoin } from '../../../util/coinHelper';
const WalletsTxInfoRender = function(txInfo) {
return (
@ -190,6 +191,7 @@ const WalletsTxInfoRender = function(txInfo) {
<div className="modal-footer">
{ this.state.txDetails &&
this.props.ActiveCoin.coin !== 'CHIPS' &&
isKomodoCoin(this.props.ActiveCoin.coin) &&
<button
type="button"
className="btn btn-sm white btn-dark waves-effect waves-light pull-left"

18
react/src/components/overrides.scss

@ -549,7 +549,8 @@ select{
background-image: none !important;
}
.receive-address-context-menu {
.receive-address-context-menu,
.coin-tile-context-menu {
box-shadow: 0 1px 2px 1px rgba(0, 0, 0, 0.4);
background: #fff;
position: absolute;
@ -696,4 +697,19 @@ select{
top: -2px;
}
}
}
.coind-actions-menu {
position: absolute;
top: 22px;
left: 20px;
}
.coin-tile-context-menu {
top: 45px;
left: -34px;
li {
color: #757575;
}
}

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

@ -19,6 +19,7 @@ class ToasterItem extends React.Component {
title: props.title,
autoClose: props.autoClose,
toastId: props.toastId,
className: props.className,
};
this.dismissToast = this.dismissToast.bind(this);
@ -35,6 +36,7 @@ class ToasterItem extends React.Component {
title: props.title,
autoClose: props.autoClose,
toastId: props.toastId,
className: props.className,
});
} else {
this.setState({
@ -43,6 +45,7 @@ class ToasterItem extends React.Component {
title: null,
autoClose: true,
toastId: null,
className: null,
});
}
}
@ -86,7 +89,7 @@ class ToasterItem extends React.Component {
}
return (
<div className={ `toast toast-${this.state.type}` }>
<div className={ `toast toast-${this.state.type}${this.state.className ? ' ' + this.state.className : ''}` }>
<button
className="toast-close-button"
onClick={ () => this.dismissToast(this.state.toastId) }>×

4
react/src/components/toaster/toaster.scss

@ -4,4 +4,8 @@
width: 310px;
opacity: 1;
}
.toastr--validate-address {
width: 430px;
}
}

4
react/src/translate/en.js

@ -515,7 +515,7 @@ export const LANG_EN = {
'ERROR': 'Error',
'FAILED_TO_VERIFY_ADDR': 'Failed to verify address',
'COIN_UNABLE_TO_STOP': 'Unable to stop @template@. Try again.',
'COIN_IS_STOPED': 'is stopped',
'COIN_IS_STOPPED': 'is stopped',
'COIN_IS_REMOVED': 'is removed',
'JUMBLR_RESUMED': 'Jumblr resumed',
'JUMBLR_PAUSED': 'Jumblr paused',
@ -680,7 +680,7 @@ export const LANG_EN = {
'BIP39_DESC_P1': 'Description: the form below is going to search for a pub key depending on a range of key path combinations is chosen (No of accounts * account address path depth).',
'BIP39_DESC_P2': 'The app might temporary freeze for several seconds during search procedure.',
'SHOW_APP_RUNTIME_LOG': 'Show app runtime log',
'WRONG_PASSPHRASE': 'Wrong passphrase!',
'WRONG_PASSPHRASE': 'Wrong passphrase',
'SPV_SERVER_LIST_DESC': 'Server list selection is only available for active coins that have more than 1 server to connect to.',
'SPV_SERVERS': 'SPV servers list',
'SPV_SINGLE_SERVER_NOTICE': 'There is only one electrum server available. SPV verification is coming from the same server providing all remote data.',

Loading…
Cancel
Save