Skip to content

Commit e733d83

Browse files
committed
Refactor cryptos, add BCH
1 parent fcc6c3e commit e733d83

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/botPage/common/const.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { translate } from '../../common/i18n';
22

3-
export default {
3+
const CRYPTO_CURRENCIES = ['BTC', 'LTC', 'BCH'];
4+
5+
const config = {
46
lists: {
57
PAYOUTTYPE: [
68
// [translate('Payout'), 'payout'],
79
[translate('Stake'), 'stake'],
810
],
9-
CURRENCY: [['USD', 'USD'], ['EUR', 'EUR'], ['GBP', 'GBP'], ['AUD', 'AUD'], ['BTC', 'BTC'], ['LTC', 'LTC']],
11+
CRYPTO_CURRENCIES,
12+
CURRENCY: ['USD', 'EUR', 'GBP', 'AUD', ...CRYPTO_CURRENCIES].map(c => [c, c]),
1013
DETAILS : [
1114
[translate('statement'), '1'],
1215
[translate('ask price'), '2'],
@@ -199,3 +202,5 @@ export default {
199202
bbResult : [[translate('upper'), '1'], [translate('middle'), '0'], [translate('lower'), '2']],
200203
macdFields: [[translate('Histogram'), '0'], [translate('MACD'), '1'], [translate('Signal'), '2']],
201204
};
205+
206+
export default config;

src/botPage/common/tools.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import config from '../common/const';
2+
13
export const roundBalance = ({ currency, balance }) => {
2-
const point = ['BTC', 'LTC'].includes(currency) ? 8 : 2;
4+
const point = config.lists.CRYPTO_CURRENCIES.includes(currency) ? 8 : 2;
35
return Number(balance).toFixed(point);
46
};
57

0 commit comments

Comments
 (0)