Browse Source

cleanup #1

all-modes
Petr Balashov 8 years ago
parent
commit
b14d7c47be
  1. 57
      react/src/components/addcoin/addcoin.js
  2. 2
      react/src/components/dashboard/about.js
  3. 39
      react/src/components/dashboard/appSettings.js
  4. 174
      react/src/components/dashboard/atomic.js
  5. 10
      react/src/components/dashboard/settings.js
  6. 24
      react/src/components/dashboard/walletsNativeTxHistory.js
  7. 29
      react/src/components/dashboard/walletsNativeTxInfo.js
  8. 12
      react/src/components/dashboard/walletsNav.js
  9. 12
      react/src/components/dashboard/walletsNotariesList.js
  10. 35
      react/src/components/dashboard/walletsProgress.js
  11. 14
      react/src/components/dashboard/walletsTxInfo.js
  12. 23
      react/src/components/login/login.js
  13. 1
      react/src/config.js
  14. 8
      react/src/index.js
  15. 4
      react/src/reducers/interval.js
  16. 6
      react/src/reducers/main.js
  17. 5
      react/src/reducers/syncOnly.js
  18. 27
      react/src/translate/en.js
  19. 10
      react/src/translate/translate.js
  20. 408
      react/src/util/crypto/md5.js
  21. 30
      react/src/util/edex.js

57
react/src/components/addcoin/addcoin.js

@ -48,7 +48,6 @@ class AddCoin extends React.Component {
saveCoinSelection() {
shepherdPostCoinList(this.state.coins)
.then(function(json) {
console.log(json);
this.toggleActionsMenu();
}.bind(this));
}
@ -56,7 +55,6 @@ class AddCoin extends React.Component {
loadCoinSelection() {
shepherdGetCoinList()
.then(function(json) {
console.log(json);
this.setState(Object.assign({}, this.state, {
coins: json.result,
actionsMenu: false,
@ -156,7 +154,11 @@ class AddCoin extends React.Component {
}
activateCoin() {
Store.dispatch(addCoin(this.state.coins[0].selectedCoin.split('|')[0], this.state.coins[0].mode, this.state.coins[0].syncOnly));
Store.dispatch(addCoin(
this.state.coins[0].selectedCoin.split('|')[0],
this.state.coins[0].mode,
this.state.coins[0].syncOnly
));
}
dismiss() {
@ -182,13 +184,21 @@ class AddCoin extends React.Component {
}
activateAllCoins() {
Store.dispatch(addCoin(this.state.coins[0].selectedCoin.split('|')[0], this.state.coins[0].mode, this.state.coins[0].syncOnly));
Store.dispatch(addCoin(
this.state.coins[0].selectedCoin.split('|')[0],
this.state.coins[0].mode,
this.state.coins[0].syncOnly
));
for (let i = 1; i < this.state.coins.length; i++) {
const _item = this.state.coins[i];
setTimeout(function() {
Store.dispatch(addCoin(_item.selectedCoin.split('|')[0], _item.mode, _item.syncOnly));
Store.dispatch(addCoin(
_item.selectedCoin.split('|')[0],
_item.mode,
_item.syncOnly
));
}, 2000 * i);
}
}
@ -204,7 +214,12 @@ class AddCoin extends React.Component {
<div className={this.state.coins.length > 1 ? 'multi' : 'single'} key={'add-coin-' + i}>
<div className="col-sm-8">
<div className="form-group">
<select className="form-control form-material" name="selectedCoin" id="addcoin_select_coin_mdl_options-login" value={_coin} onChange={(event) => this.updateSelectedCoin(event, i)}>
<select
className="form-control form-material"
name="selectedCoin"
id="addcoin_select_coin_mdl_options-login"
value={_coin}
onChange={(event) => this.updateSelectedCoin(event, i)}>
<option>{translate('INDEX.SELECT')}</option>
<AddCoinOptionsCrypto />
<AddCoinOptionsAC />
@ -213,7 +228,12 @@ class AddCoin extends React.Component {
</div>
</div>
<div className={this.state.coins.length > 1 ? 'hide' : 'col-sm-4'}>
<button type="button" className="btn btn-primary mdl_addcoin_done_btn-login" data-toggle="modal" data-dismiss="modal" id="mdl_addcoin_done_btn-login" onClick={() => this.activateCoin(i)} disabled={_item.mode === -2 }>{translate('INDEX.ACTIVATE_COIN')}</button>
<button
type="button"
className="btn btn-primary mdl_addcoin_done_btn-login"
id="mdl_addcoin_done_btn-login"
onClick={() => this.activateCoin(i)}
disabled={_item.mode === -2 }>{translate('INDEX.ACTIVATE_COIN')}</button>
</div>
<div className="col-sm-12 text-center">
<div className="form-group col-lg-4 col-md-4 col-sm-6 col-xs-6 style-addcoin-lbl-mdl-login">
@ -253,7 +273,7 @@ class AddCoin extends React.Component {
<div className="pull-left margin-right-10">
<input type="checkbox" id="addcoin_sync_only" data-plugin="switchery" data-size="small" checked={_item.syncOnly} />
</div>
<label className="padding-top-3 padding-bottom-10" htmlFor="addcoin_sync_only" onClick={() => this.toggleSyncOnlyMode(i)}>Sync only</label>
<label className="padding-top-3 padding-bottom-10" htmlFor="addcoin_sync_only" onClick={() => this.toggleSyncOnlyMode(i)}>{translate('ADD_COIN.SYNC_ONLY')}</label>
</div>
</div>
);
@ -265,7 +285,13 @@ class AddCoin extends React.Component {
render() {
return (
<div>
<div className={'modal modal-3d-sign add-coin-modal ' + (this.state.display ? 'show in' : 'fade hide')} id="AddCoinDilogModel-login" aria-hidden="true" aria-labelledby="AddCoinDilogModel-login" role="dialog" tabIndex="-1">
<div
className={'modal modal-3d-sign add-coin-modal ' + (this.state.display ? 'show in' : 'fade hide')}
id="AddCoinDilogModel-login"
aria-hidden="true"
aria-labelledby="AddCoinDilogModel-login"
role="dialog"
tabIndex="-1">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-header bg-orange-a400 wallet-send-header">
@ -280,12 +306,19 @@ class AddCoin extends React.Component {
<i className={this.state.actionsMenu ? 'fa-chevron-up' : 'fa-chevron-down' }></i>
</button>
<span className={!this.state.actionsMenu ? 'hide' : ''}>
<button className="btn btn-outline-primary btn-save-coin-selection" onClick={this.saveCoinSelection}>Save Selection</button>
<button className="btn btn-outline-primary btn-load-coin-selection" onClick={this.loadCoinSelection}>Load Selection</button>
<button className="btn btn-outline-primary btn-save-coin-selection" onClick={this.saveCoinSelection}>{translate('ADD_COIN.SAVE_SELECTION')}</button>
<button className="btn btn-outline-primary btn-load-coin-selection" onClick={this.loadCoinSelection}>{translate('ADD_COIN.LOAD_SELECTION')}</button>
</span>
{this.renderCoinSelectors()}
<div className={this.state.coins.length > 1 ? 'col-sm-12' : 'hide'} style={{textAlign: 'center', margin: '20px 0'}}>
<button type="button" className="btn btn-primary col-sm-4" style={{float: 'none'}} data-toggle="modal" data-dismiss="modal" id="mdl_addcoin_done_btn-login" onClick={this.activateAllCoins}>Activate all</button>
<button
type="button"
className="btn btn-primary col-sm-4"
style={{float: 'none'}}
data-toggle="modal"
data-dismiss="modal"
id="mdl_addcoin_done_btn-login"
onClick={this.activateAllCoins}>{translate('ADD_COIN.ACTIVATE_ALL')}</button>
</div>
<div className="col-sm-12">
<p>

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

@ -4,7 +4,7 @@ import { translate } from '../../translate/translate';
class About extends React.Component {
render() {
return(
<div className="page" data-animsition-in="fade-in" data-animsition-out="fade-out" style={{marginLeft: '0'}}>
<div className="page" style={{marginLeft: '0'}}>
<div className="page-content" id="section-about-iguana">
<h2>About Iguana</h2>
<p>Page content goes here</p>

39
react/src/components/dashboard/appSettings.js

@ -1,39 +0,0 @@
import React from 'react';
import { translate } from '../../translate/translate';
import {
} from '../../actions/actionCreators';
import Store from '../../store';
class AppSettings extends React.Component {
constructor(props) {
super(props);
//this.closeSyncOnlyModal = this.closeSyncOnlyModal.bind(this);
}
render() {
/*if (this.props && this.props.SyncOnly.display) {
return (
<div>
<div className="modal show sync-only-forks" aria-hidden="false" role="dialog">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-body" style={{height: '590px'}}>
{this.renderForksList()}
</div>
<div className="modal-footer">
<button type="button" className="btn btn-default" onClick={this.closeSyncOnlyModal}>Close</button>
</div>
</div>
</div>
</div>
<div className="modal-backdrop show in"></div>
</div>
);
} else {
return null;
}*/
}
}
export default AppSettings;

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

@ -339,14 +339,145 @@ class Atomic extends React.Component {
if (props.Atomic.response.error === 'less than required responses') {
console.log('error');
//toastr.error(_lang[defaultLang].DASHBOARD.LESS_RESPONSES_REQ, _lang[defaultLang].DASHBOARD.BASILISC_NOTIFICATION)
// toastr.error(_lang[defaultLang].DASHBOARD.LESS_RESPONSES_REQ, _lang[defaultLang].DASHBOARD.BASILISC_NOTIFICATION)
}
}
}
renderAtomicOptions() {
const _options = [
{
method: 'history',
name: 'Address History',
},
{
method: 'getbalance',
name: 'Get Balance',
},
{
method: 'listunspent',
name: 'List Unspent',
},
{
method: 'txid',
name: 'Transaction ID',
},
{
method: 'blockash',
name: 'Block Hash',
},
{
method: 'chaintip',
name: 'Chain Tip',
},
{
method: 'activehandle',
name: 'Active Handle',
},
{
method: 'gettransaction',
name: 'Get Transaction',
},
{
method: 'dex_alladdresses',
name: 'DEX All Addresses',
},
{
method: 'dex_importaddress',
name: 'DEX Import Address',
},
{
method: 'dex_checkaddress',
name: 'DEX Check Address',
},
{
method: 'dex_validateaddress',
name: 'DEX Validate Address',
},
{
method: 'dex_getinfo',
name: 'DEX Get Info',
},
{
method: 'dex_getnotaries',
name: 'DEX Get Notaries',
},
{
method: 'dex_getbestblockhash',
name: 'DEX Get Best Block Has',
},
{
method: 'dex_getblock',
name: 'DEX Get Block',
},
{
method: 'dex_gettxin',
name: 'DEX Get Txin',
},
{
method: 'dex_gettxout',
name: 'DEX Get Txout',
},
{
method: 'dex_gettransaction',
name: 'DEX Get Transaction',
},
{
method: 'dex_getbalance',
name: 'DEX Get Balance',
},
{
method: 'dex_getsupply',
name: 'DEX Get Supply',
},
{
method: 'dex_listtransactions',
name: 'DEX List Transactions',
},
{
method: 'dex_listtransactions2',
name: 'DEX List Transactions 2',
},
{
method: 'dex_listspent',
name: 'DEX List Spent',
},
{
method: 'dex_listunspent',
name: 'DEX List Unspent',
},
{
method: 'dex_listunspent2',
name: 'DEX List Unspent 2',
},
{
method: 'dex_sendrawtransaction',
name: 'DEX Send Raw Transaction',
},
{
method: 'basilisk_refresh',
name: 'Basilisk Refresh',
},
{
method: 'jumblr_status',
name: 'Jumbler Status',
},
];
let items = [];
for (let i = 0; i < _options.length; i++) {
items.push(
<option key={_options[i].method} value={_options[i].method}>{_options[i].name}</option>
);
}
return items;
}
render() {
return (
<div className="page" data-animsition-in="fade-in" data-animsition-out="fade-out" style={{marginLeft: '0'}}>
<div className="page" style={{marginLeft: '0'}}>
<div className="page-content" id="section-iguana-atomic-explorer">
<div className="row" id="atomic-explorer" data-plugin="masonry">
<div className="col-xlg-12 col-md-12">
@ -365,44 +496,15 @@ class Atomic extends React.Component {
</div>
<div className="col-sm-4 col-xs-12" style={{textAlign: 'center'}}>
<select className="form-control form-material" id="atomic_explorer_select_command_options" onChange={this.updateSelectedAPI}>
<option value="">-Select Command-</option>
<option value="history">Address History</option>
<option value="getbalance">Get Balance</option>
<option value="listunspent">List Unspent</option>
<option value="txid">Transaction ID</option>
<option value="blockash">Block Hash</option>
<option value="chaintip">Chain Tip</option>
<option value="activehandle">Active Handle</option>
<option value="gettransaction">Get Transaction</option>
<option value="dex_alladdresses">DEX All Addresses</option>
<option value="dex_importaddress">DEX Import Address</option>
<option value="dex_checkaddress">DEX Check Address</option>
<option value="dex_validateaddress">DEX Validate Address</option>
<option value="dex_getinfo">DEX Get Info</option>
<option value="dex_getnotaries">DEX Get Notaries</option>
<option value="dex_getbestblockhash">DEX Get Best Block Hash</option>
<option value="dex_getblockhash">DEX Get Block Hash</option>
<option value="dex_getblock">DEX Get Block</option>
<option value="dex_gettxin">DEX Get txin</option>
<option value="dex_gettxout">DEX Get txout</option>
<option value="dex_gettransaction">DEX Get Transaction</option>
<option value="dex_getbalance">DEX Get Balance</option>
<option value="dex_getsupply">DEX Get Supply</option>
<option value="dex_listtransactions">DEX List Transactions</option>
<option value="dex_listtransactions2">DEX List Transactions 2</option>
<option value="dex_listspent">DEX List Spent</option>
<option value="dex_listunspent">DEX List Unspent</option>
<option value="dex_listunspent2">DEX List Unspent 2</option>
<option value="dex_sendrawtransaction">DEX Send Raw Transaction</option>
<option value="basilisk_refresh">Basilisk Refresh</option>
<option value="jumblr_status">Jumbler Status</option>
<option value="">-{translate('ATOMIC.SELECT_COMMAND')}-</option>
{this.renderAtomicOptions()}
</select>
</div>
<div className="col-sm-4 col-xs-12" style={{textAlign: 'center'}}>
<input type="text" className="form-control" id="atomic_explorer_input_data" name="atomic_explorer_input_data" placeholder="addr, txid, blockash etc." onChange={this.updateInput} />
<input type="text" className="form-control" id="atomic_explorer_input_data" name="atomic_explorer_input_data" placeholder={translate('ATOMIC.INPUT_PLACEHOLDER')} onChange={this.updateInput} />
</div>
<div className="col-sm-12 col-xs-12" style={{textAlign: 'center'}}>
<button type="button" className="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="atomic_explorer_getcoinpeers_btn" onClick={this.getAtomicData}>Submit</button>
<button type="button" className="btn btn-primary waves-effect waves-light" id="atomic_explorer_getcoinpeers_btn" onClick={this.getAtomicData}>{translate('ATOMIC.SUBMIT')}</button>
</div>
</div>
</div>
@ -410,7 +512,7 @@ class Atomic extends React.Component {
<div className="col-xlg-4 col-md-12">
<div className="panel">
<div className="panel-heading">
<h3 className="panel-title">Raw Output</h3>
<h3 className="panel-title">{translate('ATOMIC.RAW_OUTPUT')}</h3>
</div>
<div className="panel-body">
<div className="tab-content">

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

@ -55,7 +55,7 @@ class Settings extends React.Component {
}
openTab(elemId, tab) {
const _height = document.querySelector('#' + elemId + ' .panel-collapse .panel-body').clientHeight;
const _height = document.querySelector('#' + elemId + ' .panel-collapse .panel-body').offsetHeight;
this.setState(Object.assign({}, this.state, {
activeTab: tab,
@ -533,15 +533,10 @@ class Settings extends React.Component {
</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'}} id="DebugLogTab" aria-labelledby="DebugLog" role="tabpanel">
<div className="panel-body">
<p>Manage app config</p>
<p>
<strong>Most changes to app config require wallet restart!</strong>
</p>
<div className="col-sm-12"></div>
<form className="read-debug-log-import-form" method="post" action="javascript:" autoComplete="off">
<div className="col-sm-12" style={{paddingTop: '15px'}}>
<div className="row" data-plugin="masonry"></div>
</div>
<div className="col-sm-12" style={{paddingTop: '15px'}}>
<table>
<tbody>
@ -549,14 +544,13 @@ class Settings extends React.Component {
</tbody>
</table>
</div>
<div className="col-sm-12 col-xs-12" style={{textAlign: 'center'}}>
<div className="col-sm-12 col-xs-12" style={{textAlign: 'center', paddingTop: '25px', paddingBottom: '25px'}}>
<button type="button" className="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="read_debug_log_btn" onClick={this._saveAppConfig}>Save app config</button>
</div>
</form>
</div>
</div>
</div>
{this.renderAppInfoTab()}
</div>
</div>

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

@ -80,7 +80,9 @@ class WalletsNativeTxHistory extends React.Component {
}
componentWillReceiveProps(props) {
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)) {
if (this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory !== 'loading') {
let historyToSplit = sortByDate(this.props.ActiveCoin.txhistory);
historyToSplit = historyToSplit.slice((this.state.activePage - 1) * this.state.itemsPerPage, this.state.activePage * this.state.itemsPerPage);
@ -108,7 +110,7 @@ class WalletsNativeTxHistory extends React.Component {
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" data-dt-idx="1" tabIndex="0" key={i + '-pagination'} onClick={this.state.activePage !== (i + 1) ? () => this.updateCurrentPage(i + 1) : null}>{i + 1}</a>
<a aria-controls="kmd-tx-history-tbl" tabIndex="0" key={i + '-pagination'} onClick={this.state.activePage !== (i + 1) ? () => this.updateCurrentPage(i + 1) : null}>{i + 1}</a>
</li>
);
}
@ -117,18 +119,20 @@ class WalletsNativeTxHistory extends React.Component {
}
renderPaginationItemsPerPageSelector() {
if (this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory !== 'loading' && this.props.ActiveCoin.txhistory.length > 10) {
if (this.props.ActiveCoin.txhistory &&
this.props.ActiveCoin.txhistory !== 'loading' &&
this.props.ActiveCoin.txhistory.length > 10) {
return (
<div className="dataTables_length" id="kmd-tx-history-tbl_length">
<label>
Show&nbsp;
{translate('INDEX.SHOW')}&nbsp;
<select name="itemsPerPage" aria-controls="kmd-tx-history-tbl" className="form-control input-sm" onChange={this.updateInput}>
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>&nbsp;
entries
{translate('INDEX.ENTRIES_SM')}
</label>
</div>
);
@ -138,21 +142,23 @@ class WalletsNativeTxHistory extends React.Component {
}
renderPagination() {
if (this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory !== 'loading' && this.props.ActiveCoin.txhistory.length > 10) {
if (this.props.ActiveCoin.txhistory &&
this.props.ActiveCoin.txhistory !== 'loading' &&
this.props.ActiveCoin.txhistory.length > 10) {
return (
<div className="row unselectable">
<div className="col-sm-5">
<div className="dataTables_info" id="kmd-tx-history-tbl_info" role="status" aria-live="polite">Showing {((this.state.activePage - 1) * this.state.itemsPerPage) + 1} to {this.state.activePage * this.state.itemsPerPage} of {this.props.ActiveCoin.txhistory.length} entries</div>
<div className="dataTables_info" id="kmd-tx-history-tbl_info" role="status" aria-live="polite">{translate('INDEX.SHOWING')} {((this.state.activePage - 1) * this.state.itemsPerPage) + 1} {translate('INDEX.TO')} {this.state.activePage * this.state.itemsPerPage} {translate('INDEX.OF')} {this.props.ActiveCoin.txhistory.length} entries</div>
</div>
<div className="col-sm-7">
<div className="dataTables_paginate paging_simple_numbers" id="kmd-tx-history-tbl_paginate">
<ul className="pagination">
<li className={this.state.activePage === 1 ? 'paginate_button previous disabled' : 'paginate_button previous'} id="kmd-tx-history-tbl_previous">
<a aria-controls="kmd-tx-history-tbl" data-dt-idx="0" tabIndex="0" onClick={() => this.updateCurrentPage(this.state.activePage - 1)}>Previous</a>
<a aria-controls="kmd-tx-history-tbl" tabIndex="0" onClick={() => this.updateCurrentPage(this.state.activePage - 1)}>{translate('INDEX.PREVIOUS')}</a>
</li>
{this.renderPaginationItems()}
<li className={this.state.activePage > Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage) ? 'paginate_button next disabled' : 'paginate_button next'} id="kmd-tx-history-tbl_next">
<a aria-controls="kmd-tx-history-tbl" data-dt-idx="2" tabIndex="0" onClick={() => this.updateCurrentPage(this.state.activePage + 1)}>Next</a>
<a aria-controls="kmd-tx-history-tbl" tabIndex="0" onClick={() => this.updateCurrentPage(this.state.activePage + 1)}>{translate('INDEX.NEXT')}</a>
</li>
</ul>
</div>

29
react/src/components/dashboard/walletsNativeTxInfo.js

@ -24,41 +24,44 @@ class WalletsNativeTxInfo extends React.Component {
}
render() {
if (this.props && this.props.ActiveCoin.showTransactionInfo && this.props.ActiveCoin.nativeActiveSection === 'default' && this.props.ActiveCoin.mode === 'native') {
if (this.props &&
this.props.ActiveCoin.showTransactionInfo &&
this.props.ActiveCoin.nativeActiveSection === 'default' &&
this.props.ActiveCoin.mode === 'native') {
const txInfo = this.props.ActiveCoin.txhistory[this.props.ActiveCoin.showTransactionInfoTxIndex];
return (
<div>
<div className="modal show" data-extcoin="COIN" id="kmd_txid_info_mdl" aria-hidden="false" role="dialog">
<div className="modal show" id="kmd_txid_info_mdl" aria-hidden="false" role="dialog">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-body" style={{height: '590px'}}>
<div className="panel nav-tabs-horizontal">
<ul className="nav nav-tabs nav-tabs-line" data-plugin="nav-tabs" role="tablist">
<li className={this.state.activeTab === 0 ? 'active' : ''} role="presentation">
<a data-toggle="tab" data-extcoin="COIN" aria-controls="KmdTxIDInfotab1" role="tab" onClick={() => this.openTab(0)}>
<a data-toggle="tab" aria-controls="KmdTxIDInfotab1" role="tab" onClick={() => this.openTab(0)}>
<i className="icon md-balance-wallet" aria-hidden="true"></i>TxID Info
</a>
</li>
<li className={this.state.activeTab === 1 ? 'active' : ''} role="presentation">
<a data-toggle="tab" data-extcoin="COIN" aria-controls="KmdTxIDInfotab2" role="tab" onClick={() => this.openTab(1)}>
<a data-toggle="tab" aria-controls="KmdTxIDInfotab2" role="tab" onClick={() => this.openTab(1)}>
<i className="icon md-plus-square" aria-hidden="true"></i>Vjointsplits, Details
</a>
</li>
<li className={this.state.activeTab === 2 ? 'active' : ''} role="presentation">
<a data-toggle="tab" data-extcoin="COIN" aria-controls="KmdTxIDInfotab3" role="tab" onClick={() => this.openTab(2)}>
<a data-toggle="tab" aria-controls="KmdTxIDInfotab3" role="tab" onClick={() => this.openTab(2)}>
<i className="icon wb-briefcase" aria-hidden="true"></i>Hex
</a>
</li>
<li className={this.state.activeTab === 3 ? 'active' : ''} role="presentation">
<a data-toggle="tab" data-extcoin="COIN" aria-controls="KmdTxIDInfotab4" role="tab" onClick={() => this.openTab(3)}>
<a data-toggle="tab" aria-controls="KmdTxIDInfotab4" role="tab" onClick={() => this.openTab(3)}>
<i className="icon wb-file" aria-hidden="true"></i>Raw info
</a>
</li>
</ul>
<div className="panel-body">
<div className="tab-content">
<div className={this.state.activeTab === 0 ? 'tab-pane active' : 'tab-pane'} id="KmdTxIDInfotab1" data-extcoin="COIN" role="tabpanel">
<div className={this.state.activeTab === 0 ? 'tab-pane active' : 'tab-pane'} id="KmdTxIDInfotab1" role="tabpanel">
<table className="table table-striped">
<tbody>
<tr>
@ -124,7 +127,7 @@ class WalletsNativeTxInfo extends React.Component {
</tbody>
</table>
</div>
<div className={this.state.activeTab === 1 ? 'tab-pane active' : 'tab-pane'} id="KmdTxIDInfotab2" data-extcoin="COIN" role="tabpanel">
<div className={this.state.activeTab === 1 ? 'tab-pane active' : 'tab-pane'} id="KmdTxIDInfotab2" role="tabpanel">
<table className="table table-striped">
<tbody>
<tr>
@ -142,18 +145,18 @@ class WalletsNativeTxInfo extends React.Component {
</tbody>
</table>
</div>
<div className={this.state.activeTab === 2 ? 'tab-pane active' : 'tab-pane'} id="KmdTxIDInfotab3" data-extcoin="COIN" role="tabpanel">
<textarea id="kmd_txid_info_hex" data-extcoin="COIN" style={{width: '100%', height: '170px'}} rows="10" cols="80" defaultValue={txInfo.hex} disabled></textarea>
<div className={this.state.activeTab === 2 ? 'tab-pane active' : 'tab-pane'} id="KmdTxIDInfotab3" role="tabpanel">
<textarea id="kmd_txid_info_hex" style={{width: '100%', height: '170px'}} rows="10" cols="80" defaultValue={txInfo.hex} disabled></textarea>
</div>
<div className={this.state.activeTab === 3 ? 'tab-pane active' : 'tab-pane'} id="KmdTxIDInfotab4" data-extcoin="COIN" role="tabpanel">
<textarea id="kmd_txid_info_hex" data-extcoin="COIN" style={{width: '100%', height: '400px'}} rows="40" cols="80" defaultValue={JSON.stringify(txInfo, null, '\t')} disabled></textarea>
<div className={this.state.activeTab === 3 ? 'tab-pane active' : 'tab-pane'} id="KmdTxIDInfotab4" role="tabpanel">
<textarea id="kmd_txid_info_hex" style={{width: '100%', height: '400px'}} rows="40" cols="80" defaultValue={JSON.stringify(txInfo, null, '\t')} disabled></textarea>
</div>
</div>
</div>
</div>
</div>
<div className="modal-footer">
<button type="button" className="btn btn-default" data-dismiss="modal" onClick={this.toggleTxInfoModal}>Close</button>
<button type="button" className="btn btn-default" data-dismiss="modal" onClick={this.toggleTxInfoModal}>{translate('INDEX.CLOSE')}</button>
</div>
</div>
</div>

12
react/src/components/dashboard/walletsNav.js

@ -67,19 +67,19 @@ class WalletsNav extends React.Component {
} else {
return (
<div>
<div className="page-header page-header-bordered header-easydex" id="header-dashboard" data-edexcoin="COIN" style={{paddingBottom: '20px', marginBottom: this.props.ActiveCoin.mode !== 'basilisk' && this.props.Dashboard.progress ? '0' : '30px'}}>
<ol className="breadcrumb" data-edexcoin="COIN">
<b>{translate('INDEX.MY')} <span data-edexcoin="COIN" id="edexcoin-active">{this.props && this.props.ActiveCoin ? this.props.ActiveCoin.coin : '-'}</span> {translate('INDEX.ADDRESS')}: </b> <span data-edexcoin="COIN" id="edexcoin_active_addr">{this.props && this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : '-'}</span> <button className="btn btn-default btn-xs clipboard-edexaddr" data-edexcoin="COIN" id="edexcoin_active_addr_clipboard" data-clipboard-text="" onClick={() => this.copyMyAddress(this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin])}><i className="icon wb-copy" aria-hidden="true"></i> {translate('INDEX.COPY')}</button>
<div className="page-header page-header-bordered header-easydex" id="header-dashboard" style={{paddingBottom: '20px', marginBottom: this.props.ActiveCoin.mode !== 'basilisk' && this.props.Dashboard.progress ? '0' : '30px'}}>
<ol className="breadcrumb">
<strong>{translate('INDEX.MY')} <span data-edexcoin="COIN" id="edexcoin-active">{this.props && this.props.ActiveCoin ? this.props.ActiveCoin.coin : '-'}</span> {translate('INDEX.ADDRESS')}: </strong> <span id="edexcoin_active_addr">{this.props && this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : '-'}</span> <button className="btn btn-default btn-xs clipboard-edexaddr" id="edexcoin_active_addr_clipboard" onClick={() => this.copyMyAddress(this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin])}><i className="icon wb-copy" aria-hidden="true"></i> {translate('INDEX.COPY')}</button>
</ol>
<div className="page-header-actions" data-edexcoin="COIN" id="edexcoin-actions">
<div id="kmd_header_button">
<button type="button" className="btn btn-dark waves-effect waves-light" data-edexcoinmenu="COIN" id="btn_edexcoin_dashboard" onClick={this.toggleSendReceiveCoinForms}>
<button type="button" className="btn btn-dark waves-effect waves-light" id="btn_edexcoin_dashboard" onClick={this.toggleSendReceiveCoinForms}>
<i className="icon md-view-dashboard" aria-hidden="true"></i> {this.props.ActiveCoin.mode !== 'native' ? translate('INDEX.DASHBOARD') : 'Settings'}
</button>
<button type="button" className="btn btn-primary waves-effect waves-light" data-edexcoinmenu="COIN" id="btn_edexcoin_send" onClick={() => this.toggleSendCoinForm(!this.props.ActiveCoin.send)}>
<button type="button" className="btn btn-primary waves-effect waves-light" id="btn_edexcoin_send" onClick={() => this.toggleSendCoinForm(!this.props.ActiveCoin.send)}>
<i className="icon fa-send" aria-hidden="true"></i> {translate('INDEX.SEND')}
</button>
<button type="button" className="btn btn-info waves-effect waves-light" data-edexcoinmenu="COIN" id="btn_edexcoin_recieve" onClick={() => this.toggleReceiveCoinForm(!this.props.ActiveCoin.receive)}>
<button type="button" className="btn btn-info waves-effect waves-light" id="btn_edexcoin_recieve" onClick={() => this.toggleReceiveCoinForm(!this.props.ActiveCoin.receive)}>
<i className="icon fa-inbox" aria-hidden="true"></i> {translate('INDEX.RECEIVE')}
</button>
</div>

12
react/src/components/dashboard/walletsNotariesList.js

@ -18,17 +18,19 @@ class WalletsNotariesList extends React.Component {
renderNotariesFetching() {
if (!this.props.ActiveCoin.notaries) {
return (
<div>Fetching notaries list data...</div>
<div>{translate('INDEX.FETCHING_NOTARIES_LIST')}...</div>
);
} else {
return (
<div>Notaries list. Total nodes count: {this.props.ActiveCoin.notaries.numnotaries}</div>
<div>{translate('INDEX.TOTAL_NOTARIES')}: {this.props.ActiveCoin.notaries.numnotaries}</div>
);
}
}
renderNotariesList() {
if (this.props.ActiveCoin.notaries && this.props.ActiveCoin.notaries.notaries && this.props.ActiveCoin.notaries.notaries.length) {
if (this.props.ActiveCoin.notaries &&
this.props.ActiveCoin.notaries.notaries &&
this.props.ActiveCoin.notaries.notaries.length) {
return this.props.ActiveCoin.notaries.notaries.map((node, index) =>
<TreeNode title={`Node ${index}`} key={`node-${index}`}>
<TreeNode key={`node-${index}-btc`} title={`BTC: ${node.BTCaddress}`} />
@ -47,7 +49,7 @@ class WalletsNotariesList extends React.Component {
return (
<div>
<div className="modal show" data-extcoin="COIN" id="kmd_txid_info_mdl" aria-hidden="false" role="dialog">
<div className="modal show" id="kmd_txid_info_mdl" aria-hidden="false" role="dialog">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-body" style={{height: '590px'}}>
@ -65,7 +67,7 @@ class WalletsNotariesList extends React.Component {
</div>
</div>
<div className="modal-footer">
<button type="button" className="btn btn-default" onClick={this.closeNotariesModal}>Close</button>
<button type="button" className="btn btn-default" onClick={this.closeNotariesModal}>{translate('INDEX.CLOSE')}</button>
</div>
</div>
</div>

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

@ -19,37 +19,40 @@ class WalletsProgress extends React.Component {
}
render() {
if (this.props && this.props.ActiveCoin && this.props.ActiveCoin.mode === 'full' && this.props.Dashboard.progress) {
if (this.props &&
this.props.ActiveCoin &&
this.props.ActiveCoin.mode === 'full' &&
this.props.Dashboard.progress) {
if (this.props.Dashboard.progress && this.props.Dashboard.progress.error) {
return (<div style={{textAlign: 'center', padding: '10px'}}>Coin is busy processing</div>);
return (<div style={{textAlign: 'center', padding: '10px'}}>{translate('INDEX.COIN_IS_BUSY')}</div>);
} else {
return (
<div id="edex-footer" data-edexcoin="COIN" style={{marginBottom: '20px'}}>
<div className="row no-space" data-edexcoin="COIN">
<div data-edexcoin="COIN" id="currency-progressbars">
<div id="edex-footer" style={{marginBottom: '20px'}}>
<div className="row no-space">
<div id="currency-progressbars">
<div className="progress progress-sm">
<div className={this.isFullySynced() ? 'progress-bar progress-bar-striped active progress-bar-indicating progress-bar-success' : 'hide'} style={{width: '100%', fontSize: '80%'}} role="progressbar" data-edexcoin="GAME" id="currency-bundles">
{translate('INDEX.BUNDLES')} <span data-edexcoin="GAME" id="currency-bundles-percent">({this.props.ActiveCoin.coin}) 100.00% - ( {this.props.Dashboard.progress.blocks} / {this.props.Dashboard.progress.blocks} ) ==&gt;&gt; RT{this.props.Dashboard.progress.RTheight}</span>
<div className={this.isFullySynced() ? 'progress-bar progress-bar-striped active progress-bar-indicating progress-bar-success' : 'hide'} style={{width: '100%', fontSize: '80%'}} role="progressbar" id="currency-bundles">
{translate('INDEX.BUNDLES')} <span id="currency-bundles-percent">({this.props.ActiveCoin.coin}) 100.00% - ( {this.props.Dashboard.progress.blocks} / {this.props.Dashboard.progress.blocks} ) ==&gt;&gt; RT{this.props.Dashboard.progress.RTheight}</span>
</div>
<div className={this.isFullySynced() ? 'hide' : 'progress-bar progress-bar-info progress-bar-striped active'} style={{width: this.props.Dashboard.progress.bundles + '%', fontSize: '80%'}} role="progressbar" data-edexcoin="COIN" id="currency-bundles">
{translate('INDEX.BUNDLES')} <span data-edexcoin="COIN" id="currency-bundles-percent">{this.props.Dashboard.progress.bundles}%</span>
<div className={this.isFullySynced() ? 'hide' : 'progress-bar progress-bar-info progress-bar-striped active'} style={{width: this.props.Dashboard.progress.bundles + '%', fontSize: '80%'}} role="progressbar" id="currency-bundles">
{translate('INDEX.BUNDLES')} <span id="currency-bundles-percent">{this.props.Dashboard.progress.bundles}%</span>
</div>
</div>
</div>
<div data-edexcoin="COIN" id="additional-progress-bars" className={this.isFullySynced() ? 'hide' : ''}>
<div id="additional-progress-bars" className={this.isFullySynced() ? 'hide' : ''}>
<div className="progress progress-sm">
<div className="progress-bar progress-bar-warning progress-bar-striped active" style={{width: this.props.Dashboard.progress.utxo + '%', fontSize: '80%'}} role="progressbar" data-edexcoin="COIN" id="currency-utxo">
utxo <span data-edexcoin="COIN" id="currency-utxo-percent">{this.props.Dashboard.progress.utxo}%</span>
<div className="progress-bar progress-bar-warning progress-bar-striped active" style={{width: this.props.Dashboard.progress.utxo + '%', fontSize: '80%'}} role="progressbar" id="currency-utxo">
utxo <span id="currency-utxo-percent">{this.props.Dashboard.progress.utxo}%</span>
</div>
</div>
<div className="progress progress-sm">
<div className="progress-bar progress-bar-danger progress-bar-striped active" style={{width: this.props.Dashboard.progress.balances + '%', fontSize: '80%'}} role="progressbar" data-edexcoin="COIN" id="currency-balances">
{translate('INDEX.BALANCES')} <span data-edexcoin="COIN" id="currency-balances-percent">{this.props.Dashboard.progress.balances}%</span>
<div className="progress-bar progress-bar-danger progress-bar-striped active" style={{width: this.props.Dashboard.progress.balances + '%', fontSize: '80%'}} role="progressbar" id="currency-balances">
{translate('INDEX.BALANCES')} <span id="currency-balances-percent">{this.props.Dashboard.progress.balances}%</span>
</div>
</div>
<div className="progress progress-sm">
<div className="progress-bar progress-bar-success progress-bar-striped active" style={{width: this.props.Dashboard.progress.validated + '%', fontSize: '80%'}} role="progressbar" data-edexcoin="COIN" id="currency-validated">
{translate('INDEX.VALIDATED')} <span data-edexcoin="COIN" id="currency-validated-percent">{this.props.Dashboard.progress.validated}%</span>
<div className="progress-bar progress-bar-success progress-bar-striped active" style={{width: this.props.Dashboard.progress.validated + '%', fontSize: '80%'}} role="progressbar" id="currency-validated">
{translate('INDEX.VALIDATED')} <span id="currency-validated-percent">{this.props.Dashboard.progress.validated}%</span>
</div>
</div>
</div>

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

@ -29,26 +29,26 @@ class WalletsTxInfo extends React.Component {
return (
<div>
<div className="modal show" data-extcoin="COIN" id="kmd_txid_info_mdl" aria-hidden="false" role="dialog">
<div className="modal show" id="kmd_txid_info_mdl" aria-hidden="false" role="dialog">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-body" style={{height: '590px'}}>
<div className="panel nav-tabs-horizontal">
<ul className="nav nav-tabs nav-tabs-line" data-plugin="nav-tabs" role="tablist">
<ul className="nav nav-tabs nav-tabs-line" role="tablist">
<li className={this.state.activeTab === 0 ? 'active' : ''} role="presentation">
<a data-toggle="tab" data-extcoin="COIN" aria-controls="KmdTxIDInfotab1" role="tab" onClick={() => this.openTab(0)}>
<a data-toggle="tab" aria-controls="KmdTxIDInfotab1" role="tab" onClick={() => this.openTab(0)}>
<i className="icon md-balance-wallet" aria-hidden="true"></i>TxID Info
</a>
</li>
<li className={this.state.activeTab === 1 ? 'active' : ''} role="presentation">
<a data-toggle="tab" data-extcoin="COIN" aria-controls="KmdTxIDInfotab4" role="tab" onClick={() => this.openTab(1)}>
<a data-toggle="tab" aria-controls="KmdTxIDInfotab4" role="tab" onClick={() => this.openTab(1)}>
<i className="icon wb-file" aria-hidden="true"></i>Raw info
</a>
</li>
</ul>
<div className="panel-body">
<div className="tab-content">
<div className={this.state.activeTab === 0 ? 'tab-pane active' : 'tab-pane'} id="KmdTxIDInfotab1" data-extcoin="COIN" role="tabpanel">
<div className={this.state.activeTab === 0 ? 'tab-pane active' : 'tab-pane'} id="KmdTxIDInfotab1" role="tabpanel">
<table className="table table-striped">
<tbody>
<tr>
@ -96,8 +96,8 @@ class WalletsTxInfo extends React.Component {
</tbody>
</table>
</div>
<div className={this.state.activeTab === 1 ? 'tab-pane active' : 'tab-pane'} id="KmdTxIDInfotab4" data-extcoin="COIN" role="tabpanel">
<textarea id="kmd_txid_info_hex" data-extcoin="COIN" style={{width: '100%', height: '400px'}} rows="40" cols="80" defaultValue={JSON.stringify(txInfo, null, '\t')} disabled></textarea>
<div className={this.state.activeTab === 1 ? 'tab-pane active' : 'tab-pane'} id="KmdTxIDInfotab4" role="tabpanel">
<textarea id="kmd_txid_info_hex" style={{width: '100%', height: '400px'}} rows="40" cols="80" defaultValue={JSON.stringify(txInfo, null, '\t')} disabled></textarea>
</div>
</div>
</div>

23
react/src/components/login/login.js

@ -143,7 +143,7 @@ class Login extends React.Component {
if ((this.state && this.state.display) || !this.props.Main) {
return (
<div id="wallet-login">
<div className="page animsition vertical-align text-center fade-in" data-animsition-in="fade-in" data-animsition-out="fade-out">
<div className="page animsition vertical-align text-center fade-in">
<div className="page-content vertical-align-middle">
<div className="brand">
<img className="brand-img" src="assets/images/easydex-logo-big.png" alt="SuperNET Iguana" />
@ -151,7 +151,7 @@ class Login extends React.Component {
<div style={{padding: '20px 0'}}>
<span className="display-sync-only-coins-toggle" onClick={this.openSyncOnlyModal}>
<i className="fa fa-cubes"></i> Display sync only coins progress
<i className="fa fa-cubes"></i> {translate('LOGIN.DISPLAY_SYNC_ONLY')}
</span>
</div>
@ -185,7 +185,13 @@ class Login extends React.Component {
<h4 style={{ color: '#fff' }} id="login-welcome">{translate('INDEX.WELCOME_LOGIN')}</h4>
<div className="login-form">
<div className="form-group form-material floating">
<input type={this.state.seedInputVisibility ? 'text' : 'password'} className="form-control" name="loginPassphrase" id="password" onChange={this.updateInput} onKeyDown={(event) => this.handleKeydown(event)} />
<input
type={this.state.seedInputVisibility ? 'text' : 'password'}
className="form-control"
name="loginPassphrase"
id="password"
onChange={this.updateInput}
onKeyDown={(event) => this.handleKeydown(event)} />
<i className={this.state.seedInputVisibility ? 'seed-toggle fa fa-eye-slash' : 'seed-toggle fa fa-eye'} onClick={this.toggleSeedInputVisibility}></i>
<label className="floating-label" htmlFor="inputPassword">{translate('INDEX.WALLET_SEED')}</label>
</div>
@ -200,7 +206,14 @@ class Login extends React.Component {
<div id="section-login-addcoin-btn" className={this.state.activeLoginSection === 'activateCoin' ? 'show' : 'hide'}>
<h4 style={{ color: '#fff' }} id="login-welcome">{translate('INDEX.WELCOME_PLEASE_ADD')}</h4>
<div className="form-group form-material floating" style={{width: '540px', margin: '30px 0'}}>
<button className="btn btn-lg btn-primary btn-block ladda-button" id="start-coin-login" role="menuitem" data-edexcoinmenu="COIN" data-target="#AddCoinDilogModel-login" data-toggle="modal" data-style="expand-left" data-plugin="ladda" onClick={this.toggleActivateCoinForm} disabled={!this.props.Main}><span className="ladda-label">{translate('INDEX.ACTIVATE_COIN')}</span></button>
<button
className="btn btn-lg btn-primary btn-block ladda-button"
id="start-coin-login"
role="menuitem"
onClick={this.toggleActivateCoinForm}
disabled={!this.props.Main}>
<span className="ladda-label">{translate('INDEX.ACTIVATE_COIN')}</span>
</button>
</div>
</div>
@ -229,7 +242,7 @@ class Login extends React.Component {
</div>
<div className="form-group form-material floating">
<textarea className="form-control placeholder-no-fix" type="text" name="randomSeedConfirm" onChange={this.updateInput} id="rwalletseed" style={{ height: '100px' }}></textarea>
<span className={this.state.isSeedConfirmError ? 'help-block' : 'hide'}>Please enter the same value again.</span>
<span className={this.state.isSeedConfirmError ? 'help-block' : 'hide'}>{translate('LOGIN.ENTER_VALUE_AGAIN')}.</span>
<label className="floating-label" htmlFor="rwalletseed">{translate('INDEX.CONFIRM_SEED')}</label>
</div>
<button type="button" id="register-submit-btn" className="btn btn-primary btn-block" onClick={this.handleRegisterWallet}>{translate('INDEX.REGISTER')}</button>

1
react/src/config.js

@ -7,4 +7,5 @@ module.exports = {
useForksAll: true,
openAlias: false,
debug: true,
defaultLang: 'EN',
};

8
react/src/index.js

@ -1,6 +1,12 @@
import React from 'react';
import { render } from 'react-dom';
import { Router, Route, IndexRoute, browserHistory, hashHistory } from 'react-router';
import {
Router,
Route,
IndexRoute,
browserHistory,
hashHistory
} from 'react-router';
import { Provider } from 'react-redux';
import store from './store';

4
react/src/reducers/interval.js

@ -3,16 +3,16 @@ import { START_INTERVAL, STOP_INTERVAL } from '../actions/actionCreators'
export function Interval(state = {
interval: {},
}, action) {
let newIntervalState = Object.assign({}, state.interval);
switch (action.type) {
case START_INTERVAL:
var newIntervalState = Object.assign({}, state.interval);
newIntervalState[action.name] = action.handle;
return Object.assign({}, state, {
interval: newIntervalState,
});
case STOP_INTERVAL:
var newIntervalState = Object.assign({}, state.interval);
newIntervalState[action.name] = null;
return Object.assign({}, state, {

6
react/src/reducers/main.js

@ -1,4 +1,8 @@
import { GET_ACTIVE_COINS, LOGIN, ACTIVE_HANDLE } from '../actions/actionCreators';
import {
GET_ACTIVE_COINS,
LOGIN,
ACTIVE_HANDLE
} from '../actions/actionCreators';
export function Main(state = {
isLoggedIn: false,

5
react/src/reducers/syncOnly.js

@ -1,4 +1,7 @@
import { SYNC_ONLY_MODAL_TOGGLE, SYNC_ONLY_DATA } from '../actions/actionCreators';
import {
SYNC_ONLY_MODAL_TOGGLE,
SYNC_ONLY_DATA
} from '../actions/actionCreators';
export function SyncOnly(state = {
display: false,

27
react/src/translate/en.js

@ -1,6 +1,17 @@
export const _lang = {
'EN': {
'INDEX': {
'FETCHING_NOTARIES_LIST': 'Fetching notaries list data',
'TOTAL_NOTARIES': 'Notaries list. Total nodes count',
'CLOSE': 'Close',
'SHOW': 'Show',
'SHOWING': 'Showing',
'OF': 'of',
'TO': 'to',
'PREVIOUS': 'Previous',
'NEXT': 'Next',
'ENTRIES_SM': 'entries',
'COIN_IS_BUSY': 'Coin is busy processing',
'REFRESHING_BASILISK_NET': 'Refreshing Basilisk Network Connections',
'SELECT_A_COIN': 'Select Coin to add to EasyDEX',
'WALLETS': 'Wallets',
@ -180,6 +191,18 @@ export const _lang = {
'ADDR_SM': 'address',
'ACTIVATING': 'Activating'
},
'ATOMIC': {
'RAW_OUTPUT': 'Raw Output',
'SUBMIT': 'Submit',
'INPUT_PLACEHOLDER': 'addr, txid, blockash etc.',
'SELECT_COMMAND': 'Select Command',
},
'ADD_COIN': {
'SYNC_ONLY': 'Sync only',
'SAVE_SELECTION': 'Save Selection',
'LOAD_SELECTION': 'Load Selection',
'ACTIVATE_ALL': 'Activate all',
},
'JUMBLR': {
'NOTICE': 'EXPERIMENTAL TEST VERSION ONLY',
'DESCRIPTION': 'Jumblr feature is very experimental and for now, is Only enabled for testing and debugging.' +
@ -345,7 +368,9 @@ export const _lang = {
'WALLET_LOCKED_LOGIN': 'Wallet Locked. Please login.',
'UNLOCK': 'Unlock',
'SIGN_IN': 'Sign In',
'WELCOME': 'Welcome'
'WELCOME': 'Welcome',
'DISPLAY_SYNC_ONLY': 'Display sync only coins progress',
'ENTER_VALUE_AGAIN': 'Please enter the same value again'
},
'SIDEBAR': {
'EDEX_MOTTO': 'Most Secure, Easy and Native Decentralised Exchange',

10
react/src/translate/translate.js

@ -1,10 +1,11 @@
import { _lang } from './en.js';
import { _lang } from './en';
import Config from '../config';
export function translate(langID) {
var defaultLang = 'EN';
let defaultLang = Config.defaultLang;
if (langID && langID.indexOf('.') > -1) {
var langIDComponents = langID.split('.');
let langIDComponents = langID.split('.');
if (_lang && langIDComponents && _lang[defaultLang][langIDComponents[0]][langIDComponents[1]]) {
return _lang[defaultLang][langIDComponents[0]][langIDComponents[1]];
@ -13,8 +14,9 @@ export function translate(langID) {
return '--> ' + langID + ' <--';
}
} else {
if (langID.length)
if (langID.length) {
console.log('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID);
return '--> ' + langID + ' <--';
}
}
}

408
react/src/util/crypto/md5.js

@ -1,201 +1,219 @@
// ref: https://css-tricks.com/snippets/javascript/javascript-md5/
export const md5 = function (string) {
function RotateLeft(lValue, iShiftBits) {
return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits));
export const md5 = function(string) {
function RotateLeft(lValue, iShiftBits) {
return (lValue<<iShiftBits) | (lValue>>>(32 - iShiftBits));
}
function AddUnsigned(lX,lY) {
var lX4,
lY4,
lX8,
lY8,
lResult;
lX8 = (lX & 0x80000000);
lY8 = (lY & 0x80000000);
lX4 = (lX & 0x40000000);
lY4 = (lY & 0x40000000);
lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
if (lX4 & lY4) {
return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
}
function AddUnsigned(lX,lY) {
var lX4,lY4,lX8,lY8,lResult;
lX8 = (lX & 0x80000000);
lY8 = (lY & 0x80000000);
lX4 = (lX & 0x40000000);
lY4 = (lY & 0x40000000);
lResult = (lX & 0x3FFFFFFF)+(lY & 0x3FFFFFFF);
if (lX4 & lY4) {
return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
}
if (lX4 | lY4) {
if (lResult & 0x40000000) {
return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
} else {
return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
}
} else {
return (lResult ^ lX8 ^ lY8);
}
if (lX4 | lY4) {
if (lResult & 0x40000000) {
return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
} else {
return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
}
} else {
return (lResult ^ lX8 ^ lY8);
}
}
function F(x,y,z) { return (x & y) | ((~x) & z); }
function G(x,y,z) { return (x & z) | (y & (~z)); }
function H(x,y,z) { return (x ^ y ^ z); }
function I(x,y,z) { return (y ^ (x | (~z))); }
function FF(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
function GG(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
function HH(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
function II(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
function ConvertToWordArray(string) {
var lWordCount;
var lMessageLength = string.length;
var lNumberOfWords_temp1 = lMessageLength + 8;
var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64;
var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
var lWordArray = Array(lNumberOfWords - 1);
var lBytePosition = 0;
var lByteCount = 0;
while ( lByteCount < lMessageLength ) {
lWordCount = (lByteCount-(lByteCount % 4)) / 4;
lBytePosition = (lByteCount % 4) * 8;
lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount)<<lBytePosition));
lByteCount++;
}
lWordCount = (lByteCount-(lByteCount % 4)) / 4;
lBytePosition = (lByteCount % 4) * 8;
lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80<<lBytePosition);
lWordArray[lNumberOfWords-2] = lMessageLength<<3;
lWordArray[lNumberOfWords-1] = lMessageLength>>>29;
return lWordArray;
};
function WordToHex(lValue) {
var WordToHexValue = "",
WordToHexValue_temp = "",
lByte,
lCount;
for (lCount = 0;lCount<=3;lCount++) {
lByte = (lValue>>>(lCount * 8)) & 255;
WordToHexValue_temp = "0" + lByte.toString(16);
WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
}
return WordToHexValue;
};
function Utf8Encode(string) {
string = string.replace(/\r\n/g,"\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
}
else if ((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
}
else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
function F(x,y,z) { return (x & y) | ((~x) & z); }
function G(x,y,z) { return (x & z) | (y & (~z)); }
function H(x,y,z) { return (x ^ y ^ z); }
function I(x,y,z) { return (y ^ (x | (~z))); }
function FF(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
function GG(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
function HH(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
function II(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
function ConvertToWordArray(string) {
var lWordCount;
var lMessageLength = string.length;
var lNumberOfWords_temp1=lMessageLength + 8;
var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1 % 64))/64;
var lNumberOfWords = (lNumberOfWords_temp2+1)*16;
var lWordArray=Array(lNumberOfWords-1);
var lBytePosition = 0;
var lByteCount = 0;
while ( lByteCount < lMessageLength ) {
lWordCount = (lByteCount-(lByteCount % 4))/4;
lBytePosition = (lByteCount % 4)*8;
lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount)<<lBytePosition));
lByteCount++;
}
lWordCount = (lByteCount-(lByteCount % 4))/4;
lBytePosition = (lByteCount % 4)*8;
lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80<<lBytePosition);
lWordArray[lNumberOfWords-2] = lMessageLength<<3;
lWordArray[lNumberOfWords-1] = lMessageLength>>>29;
return lWordArray;
};
function WordToHex(lValue) {
var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
for (lCount = 0;lCount<=3;lCount++) {
lByte = (lValue>>>(lCount*8)) & 255;
WordToHexValue_temp = "0" + lByte.toString(16);
WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
}
return WordToHexValue;
};
function Utf8Encode(string) {
string = string.replace(/\r\n/g,"\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
}
else if((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
}
else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
};
var x=Array();
var k,AA,BB,CC,DD,a,b,c,d;
var S11=7, S12=12, S13=17, S14=22;
var S21=5, S22=9 , S23=14, S24=20;
var S31=4, S32=11, S33=16, S34=23;
var S41=6, S42=10, S43=15, S44=21;
string = Utf8Encode(string);
x = ConvertToWordArray(string);
a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476;
for (k=0;k<x.length;k+=16) {
AA=a; BB=b; CC=c; DD=d;
a=FF(a,b,c,d,x[k+0], S11,0xD76AA478);
d=FF(d,a,b,c,x[k+1], S12,0xE8C7B756);
c=FF(c,d,a,b,x[k+2], S13,0x242070DB);
b=FF(b,c,d,a,x[k+3], S14,0xC1BDCEEE);
a=FF(a,b,c,d,x[k+4], S11,0xF57C0FAF);
d=FF(d,a,b,c,x[k+5], S12,0x4787C62A);
c=FF(c,d,a,b,x[k+6], S13,0xA8304613);
b=FF(b,c,d,a,x[k+7], S14,0xFD469501);
a=FF(a,b,c,d,x[k+8], S11,0x698098D8);
d=FF(d,a,b,c,x[k+9], S12,0x8B44F7AF);
c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);
b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE);
a=FF(a,b,c,d,x[k+12],S11,0x6B901122);
d=FF(d,a,b,c,x[k+13],S12,0xFD987193);
c=FF(c,d,a,b,x[k+14],S13,0xA679438E);
b=FF(b,c,d,a,x[k+15],S14,0x49B40821);
a=GG(a,b,c,d,x[k+1], S21,0xF61E2562);
d=GG(d,a,b,c,x[k+6], S22,0xC040B340);
c=GG(c,d,a,b,x[k+11],S23,0x265E5A51);
b=GG(b,c,d,a,x[k+0], S24,0xE9B6C7AA);
a=GG(a,b,c,d,x[k+5], S21,0xD62F105D);
d=GG(d,a,b,c,x[k+10],S22,0x2441453);
c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681);
b=GG(b,c,d,a,x[k+4], S24,0xE7D3FBC8);
a=GG(a,b,c,d,x[k+9], S21,0x21E1CDE6);
d=GG(d,a,b,c,x[k+14],S22,0xC33707D6);
c=GG(c,d,a,b,x[k+3], S23,0xF4D50D87);
b=GG(b,c,d,a,x[k+8], S24,0x455A14ED);
a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905);
d=GG(d,a,b,c,x[k+2], S22,0xFCEFA3F8);
c=GG(c,d,a,b,x[k+7], S23,0x676F02D9);
b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);
a=HH(a,b,c,d,x[k+5], S31,0xFFFA3942);
d=HH(d,a,b,c,x[k+8], S32,0x8771F681);
c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122);
b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C);
a=HH(a,b,c,d,x[k+1], S31,0xA4BEEA44);
d=HH(d,a,b,c,x[k+4], S32,0x4BDECFA9);
c=HH(c,d,a,b,x[k+7], S33,0xF6BB4B60);
b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);
a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6);
d=HH(d,a,b,c,x[k+0], S32,0xEAA127FA);
c=HH(c,d,a,b,x[k+3], S33,0xD4EF3085);
b=HH(b,c,d,a,x[k+6], S34,0x4881D05);
a=HH(a,b,c,d,x[k+9], S31,0xD9D4D039);
d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);
c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);
b=HH(b,c,d,a,x[k+2], S34,0xC4AC5665);
a=II(a,b,c,d,x[k+0], S41,0xF4292244);
d=II(d,a,b,c,x[k+7], S42,0x432AFF97);
c=II(c,d,a,b,x[k+14],S43,0xAB9423A7);
b=II(b,c,d,a,x[k+5], S44,0xFC93A039);
a=II(a,b,c,d,x[k+12],S41,0x655B59C3);
d=II(d,a,b,c,x[k+3], S42,0x8F0CCC92);
c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D);
b=II(b,c,d,a,x[k+1], S44,0x85845DD1);
a=II(a,b,c,d,x[k+8], S41,0x6FA87E4F);
d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);
c=II(c,d,a,b,x[k+6], S43,0xA3014314);
b=II(b,c,d,a,x[k+13],S44,0x4E0811A1);
a=II(a,b,c,d,x[k+4], S41,0xF7537E82);
d=II(d,a,b,c,x[k+11],S42,0xBD3AF235);
c=II(c,d,a,b,x[k+2], S43,0x2AD7D2BB);
b=II(b,c,d,a,x[k+9], S44,0xEB86D391);
a=AddUnsigned(a,AA);
b=AddUnsigned(b,BB);
c=AddUnsigned(c,CC);
d=AddUnsigned(d,DD);
}
var temp = WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);
return temp.toLowerCase();
return utftext;
};
var x = Array();
var k, AA, BB,CC,DD,a,b,c,d;
var S11 = 7, S12 = 12, S13 = 17, S14 = 22,
S21 = 5, S22 = 9 , S23 = 14, S24 = 20,
S31 = 4, S32 = 11, S33 = 16, S34 = 23,
S41 = 6, S42 = 10, S43 = 15, S44 = 21;
string = Utf8Encode(string);
x = ConvertToWordArray(string);
a = 0x67452301;
b = 0xEFCDAB89;
c = 0x98BADCFE;
d = 0x10325476;
for (k = 0; k < x.length; k += 16) {
AA = a;
BB = b;
CC = c;
DD = d;
a = FF(a,b,c,d,x[k+0], S11, 0xD76AA478);
d = FF(d,a,b,c,x[k+1], S12, 0xE8C7B756);
c =FF(c,d,a,b,x[k+2], S13, 0x242070DB);
b=FF(b,c,d,a,x[k+3], S14, 0xC1BDCEEE);
a=FF(a,b,c,d,x[k+4], S11, 0xF57C0FAF);
d=FF(d,a,b,c,x[k+5], S12, 0x4787C62A);
c=FF(c,d,a,b,x[k+6], S13, 0xA8304613);
b=FF(b,c,d,a,x[k+7], S14, 0xFD469501);
a=FF(a,b,c,d,x[k+8], S11, 0x698098D8);
d=FF(d,a,b,c,x[k+9], S12, 0x8B44F7AF);
c=FF(c,d,a,b,x[k+10], S13, 0xFFFF5BB1);
b=FF(b,c,d,a,x[k+11], S14, 0x895CD7BE);
a=FF(a,b,c,d,x[k+12], S11, 0x6B901122);
d=FF(d,a,b,c,x[k+13], S12, 0xFD987193);
c=FF(c,d,a,b,x[k+14], S13, 0xA679438E);
b=FF(b,c,d,a,x[k+15], S14, 0x49B40821);
a=GG(a,b,c,d,x[k+1], S21, 0xF61E2562);
d=GG(d,a,b,c,x[k+6], S22, 0xC040B340);
c=GG(c,d,a,b,x[k+11], S23, 0x265E5A51);
b=GG(b,c,d,a,x[k+0], S24, 0xE9B6C7AA);
a=GG(a,b,c,d,x[k+5], S21, 0xD62F105D);
d=GG(d,a,b,c,x[k+10], S22, 0x2441453);
c=GG(c,d,a,b,x[k+15], S23, 0xD8A1E681);
b=GG(b,c,d,a,x[k+4], S24, 0xE7D3FBC8);
a=GG(a,b,c,d,x[k+9], S21, 0x21E1CDE6);
d=GG(d,a,b,c,x[k+14], S22, 0xC33707D6);
c=GG(c,d,a,b,x[k+3], S23, 0xF4D50D87);
b=GG(b,c,d,a,x[k+8], S24, 0x455A14ED);
a=GG(a,b,c,d,x[k+13], S21, 0xA9E3E905);
d=GG(d,a,b,c,x[k+2], S22, 0xFCEFA3F8);
c=GG(c,d,a,b,x[k+7], S23, 0x676F02D9);
b=GG(b,c,d,a,x[k+12], S24, 0x8D2A4C8A);
a=HH(a,b,c,d,x[k+5], S31, 0xFFFA3942);
d=HH(d,a,b,c,x[k+8], S32, 0x8771F681);
c=HH(c,d,a,b,x[k+11], S33, 0x6D9D6122);
b=HH(b,c,d,a,x[k+14], S34, 0xFDE5380C);
a=HH(a,b,c,d,x[k+1], S31, 0xA4BEEA44);
d=HH(d,a,b,c,x[k+4], S32, 0x4BDECFA9);
c=HH(c,d,a,b,x[k+7], S33, 0xF6BB4B60);
b=HH(b,c,d,a,x[k+10], S34, 0xBEBFBC70);
a=HH(a,b,c,d,x[k+13], S31, 0x289B7EC6);
d=HH(d,a,b,c,x[k+0], S32, 0xEAA127FA);
c=HH(c,d,a,b,x[k+3], S33, 0xD4EF3085);
b=HH(b,c,d,a,x[k+6], S34, 0x4881D05);
a=HH(a,b,c,d,x[k+9], S31, 0xD9D4D039);
d=HH(d,a,b,c,x[k+12], S32, 0xE6DB99E5);
c=HH(c,d,a,b,x[k+15], S33, 0x1FA27CF8);
b=HH(b,c,d,a,x[k+2], S34, 0xC4AC5665);
a=II(a,b,c,d,x[k+0], S41, 0xF4292244);
d=II(d,a,b,c,x[k+7], S42, 0x432AFF97);
c=II(c,d,a,b,x[k+14], S43, 0xAB9423A7);
b=II(b,c,d,a,x[k+5], S44, 0xFC93A039);
a=II(a,b,c,d,x[k+12], S41, 0x655B59C3);
d=II(d,a,b,c,x[k+3], S42, 0x8F0CCC92);
c=II(c,d,a,b,x[k+10], S43, 0xFFEFF47D);
b=II(b,c,d,a,x[k+1], S44, 0x85845DD1);
a=II(a,b,c,d,x[k+8], S41, 0x6FA87E4F);
d=II(d,a,b,c,x[k+15], S42, 0xFE2CE6E0);
c=II(c,d,a,b,x[k+6], S43, 0xA3014314);
b=II(b,c,d,a,x[k+13], S44, 0x4E0811A1);
a=II(a,b,c,d,x[k+4], S41, 0xF7537E82);
d=II(d,a,b,c,x[k+11], S42, 0xBD3AF235);
c=II(c,d,a,b,x[k+2], S43, 0x2AD7D2BB);
b=II(b,c,d,a,x[k+9], S44, 0xEB86D391);
a=AddUnsigned(a, AA);
b=AddUnsigned(b, BB);
c=AddUnsigned(c, CC);
d=AddUnsigned(d, DD);
}
var temp = WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d);
return temp.toLowerCase();
}

30
react/src/util/edex.js

@ -1,30 +0,0 @@
export function edexRemoveTXID(_obj, txidArray) {
const txidToStr = txidArray.join(':');
console.log(txidToStr);
if (_obj, _obj.basilisk) {
if (Object.keys(_obj.basilisk).length === 0) {
console.log('no coin nodes to parse');
} else {
for (var key in _obj.basilisk) {
for (var coinAddr in _obj.basilisk[key]) {
if (_obj.basilisk[key][coinAddr] !== 'addresses') {
if (_obj.basilisk[key][coinAddr].refresh &&
_obj.basilisk[key][coinAddr].refresh.data &&
_obj.basilisk[key][coinAddr].refresh.data.length > 0) {
for (var i = 0; i < _obj.basilisk[key][coinAddr].refresh.data.length; i++) {
if (txidToStr.indexOf(_obj.basilisk[key][coinAddr].refresh.data[i].txid) > -1) {
_obj.basilisk[key][coinAddr].refresh.data.splice(i, 1);
}
}
}
}
}
}
}
} else {
console.log('basilisk node is missing');
}
return _obj;
}
Loading…
Cancel
Save