Browse Source

wallet components #6

all-modes
pbca26 8 years ago
parent
commit
a23114ffd9
  1. 102
      react/src/actions/actionCreators.js
  2. 10
      react/src/components/dashboard/coinTileItem.js
  3. 2
      react/src/components/dashboard/dashboard.js
  4. 2
      react/src/components/dashboard/receiveCoin.js
  5. 92
      react/src/components/dashboard/sendCoin.js
  6. 17
      react/src/components/dashboard/walletsData.js
  7. 2
      react/src/components/dashboard/walletsNative.js
  8. 1
      react/src/components/dashboard/walletsNativeReceive.js
  9. 10
      react/src/components/dashboard/walletsNativeSend.js
  10. 18
      react/src/components/dashboard/walletsTxInfo.js
  11. 3
      react/src/config.js
  12. 8
      react/src/reducers/activeCoin.js

102
react/src/actions/actionCreators.js

@ -40,6 +40,7 @@ export const DASHBOARD_ACTIVE_TXINFO_MODAL = 'DASHBOARD_ACTIVE_TXINFO_MODAL';
export const DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE = 'DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE';
export const DASHBOARD_ACTIVE_COIN_NATIVE_TXHISTORY = 'DASHBOARD_ACTIVE_COIN_NATIVE_TXHISTORY';
export const DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS = 'DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS';
export const DASHBOARD_ACTIVE_COIN_SENDTO = 'DASHBOARD_ACTIVE_COIN_SENDTO';
export function toggleDashboardActiveSection(name) {
return {
@ -661,6 +662,31 @@ export function getFullTransactionsList(coin) {
}
}
export function getBasiliskTransactionsList(coin, address) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'dex',
'method': 'listtransactions',
'address': address,
'count': 100,
'skip': 0,
'symbol': coin
};
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, 'getBasiliskTransactionsList', 'Error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(getNativeTxHistoryState(json)))
}
}
export function getPeersList(coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
@ -907,7 +933,7 @@ export function getKMDAddressesNative(coin, mode) {
};
}
if (mode !== 'native') {
if (mode !== 'native' || mode !== 'basilisk') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'coin': coin,
@ -962,11 +988,20 @@ export function getKMDAddressesNative(coin, mode) {
'params': [
1,
9999999,
//[ atomic_explorer_input_data_val ]
]
};
}
if (mode === 'basilisk') {
payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'dex',
'method': 'listunspent',
'address': 'RDbGxL8QYdEp8sMULaVZS2E6XThcTKT9Jd',
'symbol': coin
};
}
fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify(payload),
@ -977,10 +1012,12 @@ export function getKMDAddressesNative(coin, mode) {
})
.then(response => response.json())
.then(function(json) {
if (mode === 'full') {
console.log('getaddrjson', result[0]);
if (mode === 'full' || mode === 'basilisk') {
result[0] = result[0].result;
}
if (mode !== 'basilisk') {
const allAddrArray = json.map(res => res.address).filter((x, i, a) => a.indexOf(x) == i);
for (let a=0; a < allAddrArray.length; a++) {
const filteredArray = json.filter(res => res.address === allAddrArray[a]).map(res => res.amount);
@ -1003,6 +1040,7 @@ export function getKMDAddressesNative(coin, mode) {
console.log('new addr ' + allAddrArray[a] + ' | ' + allAddrArray[a].substring(0, 2));
}
}
}
let newAddressArray = [];
@ -1010,7 +1048,14 @@ export function getKMDAddressesNative(coin, mode) {
newAddressArray[a] = [];
for (let b=0; b < result[a].length; b++) {
const filteredArray = json.filter(res => res.address === result[a][b]).map(res => res.amount);
var filteredArray;
if (mode === 'basilisk') {
filteredArray = json.map(res => res.amount);
} else {
filteredArray = json.filter(res => res.address === result[a][b]).map(res => res.amount);
}
let sum = 0;
for (let i=0; i < filteredArray.length; i++) {
@ -1500,6 +1545,55 @@ export function getKMDOPID(opid, coin) {
}
}
function sendToAddressState(json, dispatch) {
if (json && json.error) {
dispatch(triggerToaster(true, json.error, 'Error', 'error'));
return {
type: DASHBOARD_ACTIVE_COIN_SENDTO,
lastSendToResponse: json.error,
}
} else if (json && json.result && json.complete) {
dispatch(triggerToaster(true, translate('TOASTR.TX_SENT_ALT'), translate('TOASTR.WALLET_NOTIFICATION'), 'success'));
return {
type: DASHBOARD_ACTIVE_COIN_SENDTO,
lastSendToResponse: json,
}
}
}
export function sendToAddress(coin, _payload) {
var payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'coin': coin,
'method': 'sendtoaddress',
'params': [
_payload.sendTo,
_payload.amount,
'EasyDEX',
'EasyDEXTransaction'
]
};
return dispatch => {
const json = {"result":"1c629f37ed45a4734e27e5cf699907dc29d278a09a48d8564e2bf9571687a1d9","signedtx":"0100000001ff3de00c3ef4f2eefbda19debe2d454031f80481fd7a6db07a8faa3e8094f5be010000006b48304502210093ab5029e24645acaa014fc806a43caa8ba55ebc5767647d235f568ce045cf0c022055925b481e9cb9210a17dd5df01360420aea4b3bfd8b632e9b5e506309cfac14012102743d2afdb88ede68fb5938e961b1f41c2b6267b3286516543eb4e4ab87ad0d0affffffff02a0860100000000001976a9142f4c0f91fc06ac228c120aee41741d0d3909683288aca070da14000000001976a9142f4c0f91fc06ac228c120aee41741d0d3909683288ac00000000","complete":true,"sendrawtransaction":"success","tag":"9015189477602923119"};
dispatch(sendToAddressState(json, dispatch));
}
/*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, 'sendToAddress', 'Error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(sendToAddressHandler(json)))
}*/
}
/*function Shepherd_SendPendValue() {
Shepherd_SysInfo().then(function(result){
var ram_data = formatBytes(result.totalmem_bytes)

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

@ -13,7 +13,8 @@ import {
getNativeTxHistory,
getKMDAddressesNative,
getKMDOPID,
getFullTransactionsList
getFullTransactionsList,
getBasiliskTransactionsList
} from '../../actions/actionCreators';
import Store from '../../store';
@ -50,7 +51,12 @@ class CoinTileItem extends React.Component {
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
}
if (mode === 'basilisk') {
Store.dispatch(getAddressesByAccount(coin));
var _iguanaActiveHandle = setInterval(function() {
Store.dispatch(getBasiliskTransactionsList(coin, 'RDbGxL8QYdEp8sMULaVZS2E6XThcTKT9Jd'));
Store.dispatch(iguanaEdexBalance(coin, mode));
Store.dispatch(getKMDAddressesNative(coin, mode));
}, 3000);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
// basilisk
}
}

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

@ -38,7 +38,7 @@ class Dashboard extends React.Component {
<WalletsNav {...this.props} />
<WalletsProgress {...this.props} />
<WalletsBalance {...this.props.ActiveCoin} />
<SendCoin {...this.props.ActiveCoin} />
<SendCoin {...this.props} />
<ReceiveCoin {...this.props.ActiveCoin} />
<WalletsData {...this.props} />
<WalletsBasiliskRefresh {...this.props} />

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

@ -1,6 +1,8 @@
import React from 'react';
import { translate } from '../../translate/translate';
// TODO: implement sorting
class ReceiveCoin extends React.Component {
renderAddressList() {
if (this.props.addresses && this.props.addresses['public'] && this.props.addresses['public'].length) {

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

@ -1,7 +1,7 @@
import React from 'react';
import { translate } from '../../translate/translate';
//import { } from '../../actions/actionCreators';
//import Store from '../../store';
import { sendToAddress } from '../../actions/actionCreators';
import Store from '../../store';
// TODO: implement logic
@ -10,17 +10,65 @@ class SendCoin extends React.Component {
super(props);
this.state = {
currentStep: 0,
sendFrom: this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : null,
sendFromAmount: 0,
sendTo: null,
amount: 0,
fee: 0.0001,
sendSig: false,
};
this.updateInput = this.updateInput.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
this.toggleSendSig = this.toggleSendSig.bind(this);
}
changeSendCoinStep(step) {
this.setState(Object.assign({}, this.state, {
currentStep: step,
}));
if (step === 2) {
Store.dispatch(sendToAddress(this.props.ActiveCoin.coin, this.state));
}
}
toggleSendSig() {
this.setState(Object.assign({}, this.state, {
sendSig: !this.state.sendSig,
}));
}
updateInput(e) {
this.setState({
[e.target.name]: e.target.value,
});
console.log(this.state);
}
handleSubmit() {
Store.dispatch(sendNativeTx(this.props.ActiveCoin.coin, this.state));
setTimeout(function() {
Store.dispatch(getKMDOPID(null, this.props.ActiveCoin.coin));
}, 1000);
}
renderSendCoinResponse() {
if (this.props.ActiveCoin.lastSendToResponse) {
return Object.keys(this.props.ActiveCoin.lastSendToResponse).map((key, index) =>
<tr key={key}>
<td>{key}</td>
<td>{key === 'signedtx' ? (
this.props.ActiveCoin.lastSendToResponse[key].substring(0, this.props.ActiveCoin.lastSendToResponse[key].length / 3) + ' ' +
this.props.ActiveCoin.lastSendToResponse[key].substring(this.props.ActiveCoin.lastSendToResponse[key].length / 3, this.props.ActiveCoin.lastSendToResponse[key].length * 2 / 3)) : this.props.ActiveCoin.lastSendToResponse[key]}</td>
</tr>
);
} else {
return null;
}
}
render() {
if (this.props && this.props.send && this.props.mode !== 'native') {
if (this.props.ActiveCoin && this.props.ActiveCoin.send && this.props.ActiveCoin.mode !== 'native') {
return (
<div className="col-sm-12 padding-top-10" data-edexcoin="COIN" id="edexcoin_send">
<div className="col-xlg-12 col-md-12 col-sm-12 col-xs-12">
@ -51,49 +99,44 @@ class SendCoin extends React.Component {
<div className={this.state.currentStep === 0 ? 'panel' : 'panel hide'} id="edexcoin-send-screen">
<div className="panel-heading">
<h3 data-edexcoin="COIN" className="panel-title">
{translate('INDEX.SEND')} <span data-edexcoin="COIN"></span>
{translate('INDEX.SEND')} {this.props.ActiveCoin.coin}
</h3>
<div className="panel-actions">
<a href="javascript:void(0)" className="dropdown-toggle white btn-xs btn-info btn_refresh_edexcoin_send" data-edexcoin="COIN" aria-expanded="false" role="button">
<i className="icon fa-refresh margin-right-10" aria-hidden="true"></i> {translate('INDEX.REFRESH_FUNDS')}
</a>
</div>
</div>
<div className="panel-body container-fluid">
<form className="edexcoin-send-form" data-edexcoin="COIN" method="post" role="form" autoComplete="off">
<div className="row">
<div className="col-xlg-12 form-group form-material edexcoin_send_from_for_basilisk">
<div className={this.props.ActiveCoin.mode === 'basilisk' ? 'col-xlg-12 form-group form-material' : 'hide'}>
<label className="control-label" data-edexcoin="COIN" htmlFor="edexcoin_send_from">{translate('INDEX.SEND_FROM')}</label>
<select className="form-control form-material showedexcoinaddrs show-tick" data-edexcoin="COIN" id="edexcoin_send_from" title="Select Transparent or Private Address" data-size="5"></select>
<select className="form-control form-material showedexcoinaddrs show-tick" data-edexcoin="COIN" id="edexcoin_send_from" onChange={this.updateInput} title="Select Transparent or Private Address" data-size="5"></select>
</div>
<div className="col-xlg-12 form-group form-material">
<label className="control-label" data-edexcoin="COIN" htmlFor="edexcoin_sendto">{translate('INDEX.SEND_TO')}</label>
<input type="text" className="form-control" data-edexcoin="COIN" id="edexcoin_sendto" name="edexcoin_sendto" placeholder="Enter address" autoComplete="off" required />
<input type="text" className="form-control" data-edexcoin="COIN" id="edexcoin_sendto" name="sendTo" placeholder="Enter address" autoComplete="off" onChange={this.updateInput} required />
</div>
<div className="col-lg-6 form-group form-material">
<label className="control-label" htmlFor="edexcoin_amount" data-edexcoin="COIN" id="edexcoin_amount_label">
<span data-edexcoin="COIN"></span>
{this.props.ActiveCoin.coin}
</label>
<input type="text" className="form-control" data-edexcoin="COIN" id="edexcoin_amount" name="edexcoin_amount" placeholder="0.000" autoComplete="off" />
<input type="text" className="form-control" data-edexcoin="COIN" id="edexcoin_amount" name="amount" placeholder="0.000" autoComplete="off" onChange={this.updateInput} />
</div>
<div className="col-lg-6 form-group form-material">
<label className="control-label" data-edexcoin="COIN" htmlFor="edexcoin_fee">{translate('INDEX.FEE')}</label>
<input type="text" className="form-control" data-edexcoin="COIN" id="edexcoin_fee" name="edexcoin_fee" placeholder="0.000" autoComplete="off" />
<input type="text" className="form-control" data-edexcoin="COIN" id="edexcoin_fee" name="fee" defaultValue={this.state.fee} placeholder="0.000" autoComplete="off" onChange={this.updateInput} />
</div>
<div className="col-lg-12">
<span data-edexcoin="KMD">
<b>{translate('INDEX.TOTAL')} (<span data-edexcoin="COIN">{translate('INDEX.AMOUNT_SM')}</span> - txfee):</b> <span data-edexcoin="COIN" id="edexcoin_total_value">0.000</span> <span data-edexcoin="COIN" id="edexcoin_total_coinname" data-edexcoin="COIN"></span>
<b>{translate('INDEX.TOTAL')} (<span data-edexcoin="COIN">{translate('INDEX.AMOUNT_SM')}</span> - txfee):</b> <span data-edexcoin="COIN" id="edexcoin_total_value">{Number(this.state.amount) - Number(this.state.fee)}</span> {this.props.ActiveCoin.coin}
</span>
</div>
<div className="col-lg-10 margin-top-10">
<div className="pull-left margin-right-10">
<input type="checkbox" id="edexcoin_send_sig" name="edexcoin_send_sig" data-plugin="switchery" data-size="small" />
<input type="checkbox" id="edexcoin_send_sig" onClick={this.toggleSendSig} data-plugin="switchery" data-size="small" />
</div>
<label className="padding-top-3" htmlFor="edexcoin_send_sig">{translate('INDEX.DONT_SEND')}</label>
<label className="padding-top-3" htmlFor="edexcoin_send_sig" onClick={this.toggleSendSig}>{translate('INDEX.DONT_SEND')}</label>
</div>
<div className="col-lg-2">
<button type="button" className="btn btn-primary waves-effect waves-light pull-right edexcoin_send_coins_btn_step1" onClick={() => this.changeSendCoinStep(1)}>
{translate('INDEX.SEND')} <span data-edexcoin="COIN"></span>
{translate('INDEX.SEND')} {Number(this.state.amount) - Number(this.state.fee)} {this.props.ActiveCoin.coin}
</button>
</div>
</div>
@ -109,13 +152,13 @@ class SendCoin extends React.Component {
<div className="col-xs-12">
<b>{translate('INDEX.TO')}</b>
</div>
<div className="col-lg-6 col-sm-6 col-xs-12" id="mdl_confirm_currency_sendto_addr">[coin-address-goes-here]</div>
<div className="col-lg-6 col-sm-6 col-xs-12" id="mdl_confirm_currency_sendto_addr">{this.state.sendTo}</div>
<div className="col-lg-6 col-sm-6 col-xs-6">
<span id="mdl_confirm_currency_send_amount">0.00000000</span> <span id="mdl_confirm_currency_coinname">[COIN]</span>
<span id="mdl_confirm_currency_send_amount">{this.state.amount}</span> {this.props.ActiveCoin.coin}
</div>
<div className="col-lg-6 col-sm-6 col-xs-12">{translate('INDEX.TX_FEE_REQ')}</div>
<div className="col-lg-6 col-sm-6 col-xs-6">
<span id="mdl_confirm_currency_send_fee">0.00000000</span> <span id="mdl_confirm_currency_coinname_fee">[COIN]</span>
<span id="mdl_confirm_currency_send_fee">{this.state.fee}</span> {this.props.ActiveCoin.coin}
</div>
</div>
<br />
@ -124,9 +167,9 @@ class SendCoin extends React.Component {
<div className="col-xs-12">
<b>{translate('INDEX.FROM')}</b>
</div>
<div className="col-lg-6 col-sm-6 col-xs-12" id="mdl_confirm_currency_sendfrom_addr">[coin-address-goes-here]</div>
<div className="col-lg-6 col-sm-6 col-xs-12" id="mdl_confirm_currency_sendfrom_addr">{this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin]}</div>
<div className="col-lg-6 col-sm-6 col-xs-6" style={{color: '#f44336'}}>
<span id="mdl_confirm_currency_sendfrom_total_dedcut">-0.00000000</span> <span id="mdl_confirm_currency_coinname_total">[COIN]</span>
<span id="mdl_confirm_currency_sendfrom_total_dedcut">{Number(this.state.amount) - Number(this.state.fee)}</span> {this.props.ActiveCoin.coin}
</div>
</div>
<div className="widget-body-footer">
@ -151,6 +194,7 @@ class SendCoin extends React.Component {
</tr>
</thead>
<tbody>
{this.renderSendCoinResponse()}
</tbody>
</table>
<div className="widget-body-footer">

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

@ -148,14 +148,14 @@ class WalletsData extends React.Component {
}
renderTxType(category) {
if ( category === 'send' ) {
if ( category === 'send' || category === 'sent' ) {
return (
<span>
<i className="icon fa-arrow-circle-left"></i> <span>{translate('DASHBOARD.OUT')}</span>
</span>
);
}
if ( category === 'receive' ) {
if ( category === 'receive' || category === 'received' ) {
return (
<span>
<i className="icon fa-arrow-circle-right"></i> <span>{translate('DASHBOARD.IN')}</span>
@ -176,16 +176,23 @@ class WalletsData extends React.Component {
</span>
);
}
if ( category === 'unknown' ) {
return (
<span>
<i className="icon fa-meh-o"></i> <span>{translate('DASHBOARD.UNKNOWN')}</span>
</span>
);
}
}
renderTxHistoryList() {
if (this.state.itemsList && this.state.itemsList.length) {
return this.state.itemsList.map((tx, index) =>
<tr key={tx.txid + tx.amount}>
<td>{this.renderTxType(tx.category)}</td>
<td>{this.renderTxType(tx.category || tx.type)}</td>
<td>{tx.confirmations}</td>
<td>{tx.amount}</td>
<td>{secondsToString(tx.blocktime)}</td>
<td>{tx.amount || translate('DASHBOARD.UNKNOWN')}</td>
<td>{secondsToString(tx.blocktime || tx.timestamp)}</td>
<td>{tx.address}</td>
<td>
<button type="button" className="btn btn-xs white btn-info waves-effect waves-light btn-kmdtxid" onClick={() => this.toggleTxInfoModal(!this.props.ActiveCoin.showTransactionInfo, index)}><i className="icon fa-search"></i></button>

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

@ -13,6 +13,7 @@ class WalletsNative extends React.Component {
super(props);
}
// <WalletsNativeAlert {...this.props} />
render() {
if (this.props && this.props.ActiveCoin && this.props.ActiveCoin.mode === 'native') {
return (
@ -26,7 +27,6 @@ class WalletsNative extends React.Component {
</ol>
</div>
<div className="page-content">
<WalletsNativeAlert {...this.props} />
<WalletsNativeSyncProgress {...this.props} />
<div className="row" data-extcoin="COIN" id="extcoin-wallet" data-plugin="masonry">

1
react/src/components/dashboard/walletsNativeReceive.js

@ -3,6 +3,7 @@ import { translate } from '../../translate/translate';
import { getNewKMDAddresses, copyCoinAddress } from '../../actions/actionCreators';
import Store from '../../store';
// TODO: implement sorting
// TODO: importaddress, importprivkey(?)
class WalletsNativeReceive extends React.Component {

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

@ -103,13 +103,13 @@ class WalletsNativeSend extends React.Component {
if (opid.status === 'queued') {
isWaitingStatus = false;
return (
<i>{translate('KMD_NATIVE.PLEASE_REFRESH')}...</i>
<i>Awaiting in queue...</i>
);
}
if (opid.status === 'executing') {
isWaitingStatus = false;
return (
<i>{translate('KMD_NATIVE.PLEASE_REFRESH')}...</i>
<i>Processing...</i>
);
}
if (opid.status === 'failed') {
@ -176,7 +176,6 @@ class WalletsNativeSend extends React.Component {
}
handleSubmit() {
console.log(this.state);
Store.dispatch(sendNativeTx(this.props.ActiveCoin.coin, this.state));
setTimeout(function() {
Store.dispatch(getKMDOPID(null, this.props.ActiveCoin.coin));
@ -238,11 +237,6 @@ class WalletsNativeSend extends React.Component {
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
<div className="panel">
<header className="panel-heading">
<div className="panel-actions">
<button className="btn btn-info btn-block" id="kmd_opids_status_btn" type="button">
<i className="icon fa-repeat" aria-hidden="true"></i> {translate('INDEX.REFRESH')}
</button>
</div>
<h3 className="panel-title">{translate('INDEX.OPERATIONS_STATUSES')}</h3>
</header>
<div className="panel-body">

18
react/src/components/dashboard/walletsTxInfo.js

@ -51,6 +51,12 @@ class WalletsTxInfo extends React.Component {
<div className={this.state.activeTab === 0 ? 'tab-pane active' : 'tab-pane'} id="KmdTxIDInfotab1" data-extcoin="COIN" role="tabpanel">
<table className="table table-striped">
<tbody>
<tr>
<td>address</td>
<td>
{txInfo.address}
</td>
</tr>
<tr>
<td>amount</td>
<td>
@ -87,18 +93,6 @@ class WalletsTxInfo extends React.Component {
{txInfo.txid}
</td>
</tr>
<tr>
<td>time</td>
<td>
{secondsToString(txInfo.time)}
</td>
</tr>
<tr>
<td>timereceived</td>
<td>
{secondsToString(txInfo.timereceived)}
</td>
</tr>
</tbody>
</table>
</div>

3
react/src/config.js

@ -1,4 +1,5 @@
module.exports = {
iguanaCorePort: 7778,
agamaPort: 17777
agamaPort: 17777,
enableCacheApi: false,
};

8
react/src/reducers/activeCoin.js

@ -9,7 +9,8 @@ import {
ACTIVE_COIN_GET_ADDRESSES,
DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE,
DASHBOARD_ACTIVE_COIN_NATIVE_TXHISTORY,
DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS
DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS,
DASHBOARD_ACTIVE_COIN_SENDTO
} from '../actions/actionCreators';
// TODO: keep all coin data in array of objects instead of single object
@ -25,6 +26,7 @@ export function ActiveCoin(state = {
showTransactionInfoTxIndex: null,
txhistory: [],
opids: null,
lastSendToResponse: null,
}, action) {
switch (action.type) {
case DASHBOARD_ACTIVE_COIN_CHANGE:
@ -83,6 +85,10 @@ export function ActiveCoin(state = {
return Object.assign({}, state, {
opids: action.opids,
});
case DASHBOARD_ACTIVE_COIN_SENDTO:
return Object.assign({}, state, {
lastSendToResponse: action.lastSendToResponse,
});
default:
return state;
}

Loading…
Cancel
Save