diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js
index 8ba7978..6f030a3 100644
--- a/react/src/actions/actionCreators.js
+++ b/react/src/actions/actionCreators.js
@@ -47,10 +47,13 @@ export function toggleDashboardActiveSection(name) {
}
}
-export function toggleDashboardTxInfoModal(display) {
+export function toggleDashboardTxInfoModal(display, txIndex) {
+ console.log('toggleTxInfoModal', txIndex);
+
return {
type: DASHBOARD_ACTIVE_TXINFO_MODAL,
showTransactionInfo: display,
+ showTransactionInfoTxIndex: txIndex,
}
}
@@ -801,6 +804,96 @@ export function getSyncInfo(coin) {
}
}
+function getKMDAddressesNativeState(json) {
+ return {
+ type: ACTIVE_COIN_GET_ADDRESSES,
+ addresses: json,
+ }
+}
+
+export function getKMDAddressesNative(coin, pubpriv) {
+ var payload,
+ ajax_data_to_hex = '',
+ ajax_function_input = '',
+ tmplistaddr_hex_input = '',
+ passthru_agent = getPassthruAgent(coin),
+ tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
+
+ if ( pubpriv === 'public' ) {
+ ajax_function_input = 'getaddressesbyaccount';
+ tmplistaddr_hex_input = '222200';
+ }
+ if ( pubpriv === 'private' ) {
+ ajax_function_input = 'z_listaddresses';
+ tmplistaddr_hex_input = '';
+ }
+
+ if (passthru_agent === 'iguana') {
+ payload = {
+ 'userpass': tmpIguanaRPCAuth,
+ 'agent': passthru_agent,
+ 'method': 'passthru',
+ 'asset': coin,
+ 'function': ajax_function_input,
+ 'hex': tmplistaddr_hex_input
+ };
+ } else {
+ payload = {
+ 'userpass': tmpIguanaRPCAuth,
+ 'agent': passthru_agent,
+ 'method': 'passthru',
+ 'function': ajax_function_input,
+ 'hex': tmplistaddr_hex_input
+ };
+ }
+
+ return dispatch => {
+ return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
+ method: 'POST',
+ body: JSON.stringify(payload),
+ })
+ .catch(function(error) {
+ console.log(error);
+ dispatch(triggerToaster(true, 'getKMDAddressesNative', 'Error', 'error'));
+ })
+ .then(response => response.json())
+ .then(json => dispatch(getKMDAddressesNativeState(json, dispatch)))
+ }
+}
+
+/*function KMDListAddresses(pubpriv) {
+ NProgress.done(true);
+ NProgress.configure({
+ template: templates.nprogressBar
+ });
+ NProgress.start();
+
+
+
+ $.ajax({
+ async: false,
+ type: 'POST',
+ data: JSON.stringify(ajax_data),
+ url: 'http://127.0.0.1:' + config.iguanaPort,
+ success: function(data, textStatus, jqXHR) {
+ var AjaxOutputData = JSON.parse(data); // Ajax output gets the whole list of unspent coin with addresses
+ result = AjaxOutputData;
+ },
+ error: function(xhr, textStatus, error) {
+ console.log('failed getting Coin History.');
+ console.log(xhr.statusText);
+ if ( xhr.readyState == 0 ) {
+ Iguana_ServiceUnavailable();
+ }
+ console.log(textStatus);
+ console.log(error);
+ }
+ });
+
+ NProgress.done();
+ return result;
+}*/
+
function getDebugLogState(json) {
const _data = json.result.replace('\n', '\r\n');
diff --git a/react/src/components/dashboard/coinTileItem.js b/react/src/components/dashboard/coinTileItem.js
index d0bf865..3130125 100644
--- a/react/src/components/dashboard/coinTileItem.js
+++ b/react/src/components/dashboard/coinTileItem.js
@@ -10,7 +10,8 @@ import {
iguanaEdexBalance,
getSyncInfoNative,
getKMDBalanceTotal,
- getNativeTxHistory
+ getNativeTxHistory,
+ getKMDAddressesNative
} from '../../actions/actionCreators';
import Store from '../../store';
@@ -27,24 +28,27 @@ class CoinTileItem extends React.Component {
var _iguanaActiveHandle = setInterval(function() {
Store.dispatch(getSyncInfo(coin));
Store.dispatch(iguanaEdexBalance(coin, mode));
+ Store.dispatch(getAddressesByAccount(coin));
}, 3000);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
} else if (mode === 'native' && coin !== this.props.ActiveCoin.coin) {
Store.dispatch(stopInterval('sync', this.props.Interval.interval));
+ // TODO: add conditions to skip txhistory, balances, addresses while "activating best chain"
var _iguanaActiveHandle = setInterval(function() {
Store.dispatch(getSyncInfoNative(coin));
Store.dispatch(getKMDBalanceTotal(coin));
Store.dispatch(getNativeTxHistory(coin));
- }, 3000);
+ Store.dispatch(getKMDAddressesNative(coin, 'public'));
+ }, coin === 'KMD' ? 15000 : 3000);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
} else {
Store.dispatch(stopInterval('sync', this.props.Interval.interval));
+ Store.dispatch(getAddressesByAccount(coin));
// basilisk
}
Store.dispatch(dashboardChangeActiveCoin(coin, mode));
Store.dispatch(iguanaActiveHandle(true));
- Store.dispatch(getAddressesByAccount(coin));
/*this.setState(Object.assign({}, this.state, {
activeHandleInterval: _iguanaActiveHandle,
diff --git a/react/src/components/dashboard/dashboard.js b/react/src/components/dashboard/dashboard.js
index 4078db8..fbbbe17 100644
--- a/react/src/components/dashboard/dashboard.js
+++ b/react/src/components/dashboard/dashboard.js
@@ -16,6 +16,7 @@ import About from './about';
import WalletsBasiliskRefresh from './walletsBasiliskRefresh';
import WalletsBasiliskConnection from './walletsBasiliskConnection';
import WalletsNative from './walletsNative';
+import WalletsNativeTxInfo from './walletsNativeTxInfo';
class Dashboard extends React.Component {
constructor(props) {
@@ -42,6 +43,7 @@ class Dashboard extends React.Component {
+
diff --git a/react/src/components/dashboard/walletsNative.js b/react/src/components/dashboard/walletsNative.js
index 5ae1845..9f1640f 100644
--- a/react/src/components/dashboard/walletsNative.js
+++ b/react/src/components/dashboard/walletsNative.js
@@ -7,17 +7,12 @@ import WalletsNativeReceive from './walletsNativeReceive';
import WalletsNativeSend from './walletsNativeSend';
import WalletsNativeSyncProgress from './walletsNativeSyncProgress';
import WalletsNativeTxHistory from './walletsNativeTxHistory';
-import WalletsNativeTxInfo from './walletsNativeTxInfo';
class WalletsNative extends React.Component {
constructor(props) {
super(props);
}
- /*$('.header-easydex-section')
- .html('
' + _coin + '');
- $('#easydex-header-div').css('background-image', 'url("assets/images/bg/' + imgBgName + '_transparent_header_bg.png")');*/
-
render() {
if (this.props && this.props.ActiveCoin && this.props.ActiveCoin.mode === 'native') {
return (
@@ -42,7 +37,6 @@ class WalletsNative extends React.Component {
-
);
diff --git a/react/src/components/dashboard/walletsNativeBalance.js b/react/src/components/dashboard/walletsNativeBalance.js
index 3d23b32..818cf51 100644
--- a/react/src/components/dashboard/walletsNativeBalance.js
+++ b/react/src/components/dashboard/walletsNativeBalance.js
@@ -3,69 +3,73 @@ import { translate } from '../../translate/translate';
class WalletsNativeBalance extends React.Component {
render() {
- return (
-