- Last updated @ {secondsToString(refreshCacheData ? refreshCacheData.timestamp : 0, true)} | {secondsElapsedToString(timestamp || 0)} ago
+ { translate('SEND.TOTAL_UTXO_AVAILABLE') }: { refreshCacheData ? refreshCacheData.data && refreshCacheData.data.length : translate('SEND.PRESS_UPDATE_BTN') }
+ { translate('SEND.LAST_UPDATED') } @ { secondsToString(refreshCacheData ? refreshCacheData.timestamp : 0, true) } | { secondsElapsedToString(timestamp || 0) } { translate('SEND.AGO') }
-
- Processing requests: {this.state.currentStackLength} / {this.state.totalStackLength}
+
{ translate('SEND.NEXT_UPDATE_IN') } { secondsElapsedToString(600 - timestamp) }s
+
+
+ { translate('SEND.PROCESSING_REQ') }: { this.state.currentStackLength } / { this.state.totalStackLength }
-
);
@@ -180,8 +195,13 @@ class SendCoin extends React.Component {
const mainAddressAmount = this.renderAddressAmount(mainAddress);
return(
-
- this.updateAddressSelection(mainAddress, type, mainAddressAmount)}> [ {mainAddressAmount} {this.props.ActiveCoin.coin} ] {mainAddress}
+
+ this.updateAddressSelection(mainAddress, type, mainAddressAmount) }> [ { mainAddressAmount } { this.props.ActiveCoin.coin } ] { mainAddress }
);
} else {
@@ -192,14 +212,21 @@ class SendCoin extends React.Component {
let _amount = address.amount;
if (this.props.ActiveCoin.mode === 'basilisk') {
- _amount = this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance ? this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance : 'N/A';
+ _amount = this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address] && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance ? this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance : 'N/A';
}
- items.push(
-
- this.updateAddressSelection(address.address, type, _amount)}> [ {_amount} {this.props.ActiveCoin.coin} ] {address.address}
-
- );
+ if (_amount !== 'N/A') {
+ items.push(
+
+ this.updateAddressSelection(address.address, type, _amount) }> [ { _amount } { this.props.ActiveCoin.coin } ] { address.address }
+
+ );
+ }
}
return items;
@@ -211,9 +238,18 @@ class SendCoin extends React.Component {
renderSelectorCurrentLabel() {
if (this.state.sendFrom) {
+ let _amount;
+
+ if (this.state.sendFromAmount === 0 &&
+ this.props.ActiveCoin.mode === 'basilisk') {
+ _amount = this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.state.sendFrom].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.state.sendFrom].getbalance.data.balance ? this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.state.sendFrom].getbalance.data.balance : 'N/A';
+ } else {
+ _amount = this.state._sendFromAmount;
+ }
+
return (
- [ {this.state.sendFromAmount} {this.props.ActiveCoin.coin} ] {this.state.sendFrom}
+ [ { _amount } {this.props.ActiveCoin.coin} ] {this.state.sendFrom}
);
} else if (this.state.sendApiType) {
diff --git a/react/src/components/dashboard/walletsBalance.js b/react/src/components/dashboard/walletsBalance.js
index 259e22b..00f1c66 100644
--- a/react/src/components/dashboard/walletsBalance.js
+++ b/react/src/components/dashboard/walletsBalance.js
@@ -28,6 +28,7 @@ class WalletsBalance extends React.Component {
if (type === 'main' &&
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].getbalance &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data &&
@@ -38,6 +39,7 @@ class WalletsBalance extends React.Component {
if (type === 'interest' &&
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].getbalance &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data &&
@@ -48,6 +50,7 @@ class WalletsBalance extends React.Component {
if (type === 'total' &&
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].getbalance &&
this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data &&
diff --git a/react/src/components/dashboard/walletsData.js b/react/src/components/dashboard/walletsData.js
index 8eb5538..1671892 100644
--- a/react/src/components/dashboard/walletsData.js
+++ b/react/src/components/dashboard/walletsData.js
@@ -83,19 +83,25 @@ class WalletsData extends React.Component {
}
updateSocketsData(data) {
- if (data && data.message && data.message.shepherd.iguanaAPI &&
+ if (data &&
+ data.message &&
+ data.message.shepherd.iguanaAPI &&
data.message.shepherd.iguanaAPI.totalStackLength) {
this.setState(Object.assign({}, this.state, {
totalStackLength: data.message.shepherd.iguanaAPI.totalStackLength,
}));
}
- if (data && data.message && data.message.shepherd.iguanaAPI &&
+ if (data &&
+ data.message &&
+ data.message.shepherd.iguanaAPI &&
data.message.shepherd.iguanaAPI.currentStackLength) {
this.setState(Object.assign({}, this.state, {
currentStackLength: data.message.shepherd.iguanaAPI.currentStackLength,
}));
}
- if (data && data.message && data.message.shepherd.method &&
+ if (data &&
+ data.message &&
+ data.message.shepherd.method &&
data.message.shepherd.method === 'cache-one' &&
data.message.shepherd.status === 'done') {
Store.dispatch(basiliskRefresh(false));
@@ -108,6 +114,7 @@ class WalletsData extends React.Component {
'allcoins': false,
'coin': this.props.ActiveCoin.coin,
'calls': 'listtransactions:getbalance',
+ 'address': this.state.currentAddress,
}));
}
@@ -119,13 +126,6 @@ class WalletsData extends React.Component {
'calls': 'refresh',
'address': this.state.currentAddress,
}));
- console.log('_fetchUtxoCache', {
- 'pubkey': this.props.Dashboard.activeHandle.pubkey,
- 'allcoins': false,
- 'coin': this.props.ActiveCoin.coin,
- 'calls': 'refresh',
- 'address': this.state.currentAddress,
- });
}
toggleBasiliskActionsMenu() {
@@ -181,7 +181,8 @@ class WalletsData extends React.Component {
}
componentWillReceiveProps(props) {
- if (!this.state.currentAddress && this.props.ActiveCoin.activeAddress) {
+ if (!this.state.currentAddress &&
+ this.props.ActiveCoin.activeAddress) {
this.setState(Object.assign({}, this.state, {
currentAddress: this.props.ActiveCoin.activeAddress,
}));
@@ -191,7 +192,9 @@ class WalletsData extends React.Component {
this.props.ActiveCoin.txhistory !== 'loading' &&
this.props.ActiveCoin.txhistory !== 'no data' &&
this.props.ActiveCoin.txhistory.length) {
- if (!this.state.itemsList || (this.state.itemsList && !this.state.itemsList.length) || (props.ActiveCoin.txhistory !== this.props.ActiveCoin.txhistory)) {
+ if (!this.state.itemsList ||
+ (this.state.itemsList && !this.state.itemsList.length) ||
+ (props.ActiveCoin.txhistory !== this.props.ActiveCoin.txhistory)) {
let historyToSplit = sortByDate(this.props.ActiveCoin.txhistory);
historyToSplit = historyToSplit.slice((this.state.activePage - 1) * this.state.itemsPerPage, this.state.activePage * this.state.itemsPerPage);
@@ -201,7 +204,8 @@ class WalletsData extends React.Component {
}
}
- if (this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory === 'no data') {
+ if (this.props.ActiveCoin.txhistory &&
+ this.props.ActiveCoin.txhistory === 'no data') {
this.setState(Object.assign({}, this.state, {
itemsList: 'no data',
}));
@@ -227,8 +231,13 @@ class WalletsData extends React.Component {
for (let i=0; i < Math.ceil(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) {
items.push(
-
- this.updateCurrentPage(i + 1) : null}>{i + 1}
+
+ this.updateCurrentPage(i + 1) : null }>{ i + 1 }
);
}
@@ -237,18 +246,24 @@ class WalletsData extends React.Component {
}
renderPaginationItemsPerPageSelector() {
- if (this.props.ActiveCoin.txhistory && this.state.itemsList !== 'loading' && this.props.ActiveCoin.txhistory.length > 10) {
+ if (this.props.ActiveCoin.txhistory &&
+ this.state.itemsList !== 'loading' &&
+ this.props.ActiveCoin.txhistory.length > 10) {
return (
);
@@ -258,21 +273,40 @@ class WalletsData extends React.Component {
}
renderPagination() {
- if (this.props.ActiveCoin.txhistory && this.state.itemsList !== 'loading' && this.props.ActiveCoin.txhistory.length > 10) {
+ if (this.props.ActiveCoin.txhistory &&
+ this.state.itemsList !== 'loading' &&
+ this.props.ActiveCoin.txhistory.length > 10) {
+ const _paginationFrom = ((this.state.activePage - 1) * this.state.itemsPerPage) + 1;
+ const _paginationTo = this.state.activePage * this.state.itemsPerPage;
+
return (
-
Showing {((this.state.activePage - 1) * this.state.itemsPerPage) + 1} to {this.state.activePage * this.state.itemsPerPage} of {this.props.ActiveCoin.txhistory.length} entries
+
{ translate('INDEX.SHOWING') } { _paginationFrom } { translate('INDEX.TO') } { _paginationTo } { translate('INDEX.OF') } { this.props.ActiveCoin.txhistory.length } { translate('INDEX.ENTRIES_SM') }
@@ -285,38 +319,40 @@ class WalletsData extends React.Component {
}
renderTxType(category) {
- if ( category === 'send' || category === 'sent' ) {
+ if (category === 'send' ||
+ category === 'sent') {
return (
- {translate('DASHBOARD.OUT')}
+ { translate('DASHBOARD.OUT') }
);
}
- if ( category === 'receive' || category === 'received' ) {
+ if (category === 'receive' ||
+ category === 'received') {
return (
- {translate('DASHBOARD.IN')}
+ { translate('DASHBOARD.IN') }
);
}
- if ( category === 'generate' ) {
+ if (category === 'generate') {
return (
- {translate('DASHBOARD.MINED')}
+ { translate('DASHBOARD.MINED') }
);
}
- if ( category === 'immature' ) {
+ if (category === 'immature') {
return (
- {translate('DASHBOARD.IMMATURE')}
+ { translate('DASHBOARD.IMMATURE') }
);
}
- if ( category === 'unknown' ) {
+ if (category === 'unknown') {
return (
- {translate('DASHBOARD.UNKNOWN')}
+ { translate('DASHBOARD.UNKNOWN') }
);
}
@@ -325,23 +361,30 @@ class WalletsData extends React.Component {
renderTxHistoryList() {
if (this.state.itemsList === 'loading') {
return (
-
Loading history...
+
{ translate('INDEX.LOADING_HISTORY') }...
);
} else if (this.state.itemsList === 'no data') {
return (
-
No data
+
{ translate('INDEX.NO_DATA') }
);
} else {
- if (this.state.itemsList && this.state.itemsList.length && this.state.itemsList !== 'no data') {
+ if (this.state.itemsList &&
+ this.state.itemsList.length &&
+ this.state.itemsList !== 'no data') {
return this.state.itemsList.map((tx, index) =>
-
- {this.renderTxType(tx.category || tx.type)} |
- {tx.confirmations} |
- {tx.amount || translate('DASHBOARD.UNKNOWN')} |
- {secondsToString(tx.blocktime || tx.timestamp)} |
- {tx.address} |
+
+ { this.renderTxType(tx.category || tx.type) } |
+ { tx.confirmations } |
+ { tx.amount || translate('DASHBOARD.UNKNOWN') } |
+ { secondsToString(tx.blocktime || tx.timestamp) } |
+ { tx.address } |
- this.toggleTxInfoModal(!this.props.ActiveCoin.showTransactionInfo, index)}>
+ this.toggleTxInfoModal(!this.props.ActiveCoin.showTransactionInfo, index) }>
+
+
|
);
@@ -408,7 +451,7 @@ class WalletsData extends React.Component {
return (
@@ -429,7 +472,7 @@ class WalletsData extends React.Component {
let _amount = address.amount;
if (this.props.ActiveCoin.mode === 'basilisk') {
- _amount = this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address] && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance ? this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance : 'N/A';
+ _amount = this.props.ActiveCoin.cache && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin] && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address] && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance ? this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance : 'N/A';
}
items.push(
@@ -455,7 +498,7 @@ class WalletsData extends React.Component {
return this.props.ActiveCoin.addresses.public[i].amount;
} else {
const address = this.props.ActiveCoin.addresses.public[i].address;
- const _amount = this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address].getbalance.data.balance ? this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address].getbalance.data.balance : 'N/A';
+ const _amount = this.props.ActiveCoin.cache[this.props.ActiveCoin.coin] && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address] && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address].getbalance.data.balance ? this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address].getbalance.data.balance : 'N/A';
return _amount;
}
}
diff --git a/react/src/components/dashboard/walletsHeader.js b/react/src/components/dashboard/walletsHeader.js
index 5b2f74c..74af1d6 100644
--- a/react/src/components/dashboard/walletsHeader.js
+++ b/react/src/components/dashboard/walletsHeader.js
@@ -1,83 +1,152 @@
import React from 'react';
import { translate } from '../../translate/translate';
-//import { dashboardChangeSection, toggleAddcoinModal } from '../../actions/actionCreators';
-//import Store from '../../store';
+// import { dashboardChangeSection, toggleAddcoinModal } from '../../actions/actionCreators';
+// import Store from '../../store';
class WalletsHeader extends React.Component {
render() {
- if (this.props && this.props.coin) {
+ if (this.props &&
+ this.props.coin) {
return (