Skip to content

Commit

Permalink
Merge pull request #1772 from hollaex/testnet
Browse files Browse the repository at this point in the history
Testnet
  • Loading branch information
abeikverdi committed Nov 11, 2022
2 parents 96fc9f3 + a308324 commit 362fc77
Show file tree
Hide file tree
Showing 18 changed files with 82 additions and 42 deletions.
5 changes: 4 additions & 1 deletion server/api/swagger/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
swagger: "2.0"
info:
version: "2.4.5"
version: "2.4.6"
title: HollaEx Kit
host: api.hollaex.com
basePath: /v2
Expand Down Expand Up @@ -3186,6 +3186,7 @@ paths:
x-security-scopes:
- admin
- supervisor
- kyc
/admin/user/role:
x-swagger-router-controller: admin
put:
Expand Down Expand Up @@ -3246,6 +3247,7 @@ paths:
- Bearer: []
x-security-scopes:
- admin
- supervisor
/admin/user/discount:
x-swagger-router-controller: admin
put:
Expand Down Expand Up @@ -3290,6 +3292,7 @@ paths:
- Bearer: []
x-security-scopes:
- admin
- supervisor
/admin/user/note:
x-swagger-router-controller: admin
put:
Expand Down
8 changes: 3 additions & 5 deletions server/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ services:
env_file:
- ./tools/hollaex-kit.env.local
entrypoint:
- pm2-runtime
- start
- ecosystem.config.js
- --env
- development
- /bin/sh
- -c
- ip -4 route list match 0/0 | awk '{print $$3 " host.docker.internal"}' >> /etc/hosts && cat /etc/hosts && pm2-runtime start ecosystem.config.js --env development;
volumes:
- ./api:/app/api
- ./config:/app/config
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.4.5",
"version": "2.4.6",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion server/tools/Dockerfile.pm2
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ FROM node:10.15.3-stretch-slim

COPY --from=build /app /app

RUN apt-get update && apt-get install -y --no-install-recommends git python build-essential && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends git iproute2 python build-essential && rm -rf /var/lib/apt/lists/*

RUN npm install pm2@3.2.7 sequelize-cli@5.4.0 mocha@6.2.3 -g

Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.5
2.4.6
1 change: 1 addition & 0 deletions web/.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ REACT_APP_PLUGIN_DEV_MODE=
REACT_APP_PLUGIN=
REACT_APP_LANG=

REACT_APP_LAST_BUILD=
2 changes: 1 addition & 1 deletion web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hollaex-kit",
"version": "2.4.5",
"version": "2.4.6",
"private": true,
"dependencies": {
"@ant-design/compatible": "1.0.5",
Expand Down
6 changes: 3 additions & 3 deletions web/src/components/AppBar/AnnouncementList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { bindActionCreators } from 'redux';
import Scrollbars from 'react-custom-scrollbars';

import { EditWrapper, NotificationsList, Image } from 'components';
import STRINGS from 'config/localizedStrings';
import STRINGS from '../../config/localizedStrings';
import withConfig from 'components/ConfigProvider/withConfig';
import { getAnnouncement } from 'actions/appActions';
import { LAST_UPDATED_NOTIFICATION_KEY } from 'config/constants';
import { LAST_UPDATED_NOTIFICATION_KEY } from '../../config/constants';

const AnnouncementList = ({
icons: ICONS,
Expand Down Expand Up @@ -97,7 +97,7 @@ const AnnouncementList = ({
</div>
</div>
{isOpen && (
<div className="app-bar-account-menu apply_rtl">
<div className="app-bar-account-menu apply_rtl opacity-1">
<div className="app-announcement-list">
<Scrollbars>
<NotificationsList ICONS={ICONS} />
Expand Down
8 changes: 5 additions & 3 deletions web/src/components/CurrencyBall/withPrice.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { connect } from 'react-redux';
import { CurrencyBall } from 'components';
import { formatToCurrency } from 'utils/currency';
import { formatCurrencyByIncrementalUnit } from 'utils/currency';
import { DEFAULT_COIN_DATA } from 'config/constants';

const CurrencyBallWithPrice = ({
Expand All @@ -13,13 +13,15 @@ const CurrencyBallWithPrice = ({
isExistBroker = false,
}) => {
const { display_name, ...rest } = coins[symbol] || DEFAULT_COIN_DATA;
const minValue = rest.min ? rest.min : min;
const minValue = rest.increment_unit ?? min;

return (
<div className="with_price-block_amount d-flex direction_ltr">
<CurrencyBall name={display_name} symbol={symbol} size={size} />
<div className="with_price-block_amount-value d-flex">
{isExistBroker ? amount : `${formatToCurrency(amount, minValue)}`}
{isExistBroker
? amount
: `${formatCurrencyByIncrementalUnit(amount, minValue)}`}
</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion web/src/containers/Admin/User/AboutData.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ const AboutData = ({
/>
</div>
<div className="user-info-label">
Verification level: {userData.verification_level}
Tier: {userData.verification_level}
</div>
<div className="ml-4">
<Button
Expand Down
9 changes: 0 additions & 9 deletions web/src/containers/Admin/UserBalance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { Component } from 'react';
import { Spin, Table } from 'antd';
import { SubmissionError } from 'redux-form';
import { ReactSVG } from 'react-svg';
import Moment from 'react-moment';

import { DonutChart, CurrencyBall } from '../../../components';
import { requestUserBalance } from './actions';
Expand Down Expand Up @@ -126,14 +125,6 @@ class UserBalance extends Component {
// }
// }
// },
{
title: 'Last generated',
dataIndex: 'updated_at',
key: 'updated_at',
render: (updated) => (
<Moment format="YYYY/MM/DD HH:mm">{updated}</Moment>
),
},
{
title: 'Available',
dataIndex: 'balance_available',
Expand Down
5 changes: 2 additions & 3 deletions web/src/containers/Trade/Chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class TVChartContainer extends React.PureComponent {
library_path: libraryPath,
// timeframe: 'M',
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
locale: locale === 'id' ? 'en' : locale,
locale: ['id', 'mn'].includes(locale) ? 'en' : locale,
withdateranges: true,
range: 'ytd',
disabled_features: [
Expand Down Expand Up @@ -402,8 +402,7 @@ class TVChartContainer extends React.PureComponent {
} else if (data.price > lastBar.high) {
lastBar.high = data.price;
}

lastBar.volume = lastBar.volume ? lastBar.volume + data.size : data.size;
lastBar.volume = lastBar.volume ? Number(lastBar.volume) + Number(data.size) : data.size;
lastBar.close = data.price;
if (!lastBar.low) lastBar.low = 0;
if (!lastBar.close) lastBar.close = 0;
Expand Down
16 changes: 11 additions & 5 deletions web/src/containers/Trade/components/PriceRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,16 @@ class PriceRow extends Component {
const fillStyle = {
backgroundSize: `${calcPercentage(amount, maxCumulative)}% 100%`,
};
const totalAmount = isBase ? cumulative : cumulativePrice;

const totalProps = {
className: classnames(
'f-1',
'trade_orderbook-cell',
'trade_orderbook-cell_total',
{ pointer: isBase }
),
...(isBase ? { onClick: onAmountClick(cumulative) } : {}),
};

return (
<Transition in={inProp} timeout={1000}>
Expand Down Expand Up @@ -87,10 +96,7 @@ class PriceRow extends Component {
>
{opacifyNumber(formatToCurrency(amount, increment_size))}
</div>
<div
className="f-1 trade_orderbook-cell trade_orderbook-cell_total pointer"
onClick={onAmountClick(totalAmount)}
>
<div {...totalProps}>
{isBase
? formatToCurrency(cumulative, increment_size)
: formatToCurrency(cumulativePrice, increment_price)}
Expand Down
17 changes: 13 additions & 4 deletions web/src/containers/Wallet/AssetsBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import {
AssetsBlockForm,
EditWrapper,
} from 'components';
import { formatToCurrency, calculateOraclePrice } from 'utils/currency';
import {
formatCurrencyByIncrementalUnit,
calculateOraclePrice,
} from 'utils/currency';
import STRINGS from 'config/localizedStrings';
import {
BASE_CURRENCY,
Expand Down Expand Up @@ -235,8 +238,11 @@ const AssetsBlock = ({
const baseCoin = coins[BASE_CURRENCY] || DEFAULT_COIN_DATA;
const balanceText =
key === BASE_CURRENCY
? formatToCurrency(balanceValue, increment_unit)
: formatToCurrency(
? formatCurrencyByIncrementalUnit(
balanceValue,
increment_unit
)
: formatCurrencyByIncrementalUnit(
calculateOraclePrice(balanceValue, oraclePrice),
baseCoin.increment_unit
);
Expand Down Expand Up @@ -284,7 +290,10 @@ const AssetsBlock = ({
<div className="mr-4">
{STRINGS.formatString(
CURRENCY_PRICE_FORMAT,
formatToCurrency(balanceValue, increment_unit),
formatCurrencyByIncrementalUnit(
balanceValue,
increment_unit
),
display_name
)}
</div>
Expand Down
7 changes: 4 additions & 3 deletions web/src/containers/Wallet/MainWallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
CURRENCY_PRICE_FORMAT,
DEFAULT_COIN_DATA,
} from 'config/constants';
import { formatToCurrency } from 'utils/currency';
import { formatCurrencyByIncrementalUnit } from 'utils/currency';
import STRINGS from 'config/localizedStrings';
import withConfig from 'components/ConfigProvider/withConfig';

Expand Down Expand Up @@ -143,11 +143,12 @@ class Wallet extends Component {
contracts = {},
isFetching
) => {
const { min, display_name } = coins[BASE_CURRENCY] || DEFAULT_COIN_DATA;
const { increment_unit, display_name } =
coins[BASE_CURRENCY] || DEFAULT_COIN_DATA;
const totalAssets = STRINGS.formatString(
CURRENCY_PRICE_FORMAT,
display_name,
formatToCurrency(total, min)
formatCurrencyByIncrementalUnit(total, increment_unit)
);
const searchResult = this.getSearchResult(coins, balance, oraclePrices);

Expand Down
21 changes: 21 additions & 0 deletions web/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4207,6 +4207,11 @@ table th {
width: 100%;
font-size: 1rem;
margin-bottom: 3rem; }
.market-list__container .market-list__block .market-list__block-table .loading-anime {
height: 20px;
width: 100px;
border-radius: 7px;
animation: mymove 3s infinite; }
.market-list__container .market-list__block .market-list__block-table thead {
color: var(--labels_secondary-inactive-label-text-graphics); }
.market-list__container .market-list__block .market-list__block-table thead tr {
Expand Down Expand Up @@ -4260,6 +4265,12 @@ table th {
.direction_ltr .market-list__container .market-list__block .market-list__block-table .table-icon {
padding-right: 0.5rem; }

.direction_ltr .market-list__container .market-list__block .market-list__block-table .loading-anime {
height: 20px;
width: 100px;
border-radius: 7px;
animation: mymove 3s infinite; }

.direction_rtl .market-list__container .market-list__block .market-list__block-table th,
.direction_rtl .market-list__container .market-list__block .market-list__block-table td {
text-align: right; }
Expand Down Expand Up @@ -4292,6 +4303,11 @@ table th {
min-width: 12rem !important;
max-width: 12rem !important;
z-index: 1; }
.layout-mobile .market-list__container .market-list__block .market-list__block-table .loading-anime {
height: 20px;
width: 100px;
border-radius: 7px;
animation: mymove 3s infinite; }

.layout-mobile .trade_tabs-container .sticky-col {
background-color: var(--base_background) !important; }
Expand Down Expand Up @@ -4499,6 +4515,11 @@ table th {
.trade_tabs-container .market-card__sparkline-wrapper {
padding-top: 10px;
height: 12rem; }
.trade_tabs-container .loading-anime {
height: 20px;
width: 100px;
border-radius: 7px;
animation: mymove 3s infinite; }

.layout-mobile .trade_tabs-container {
overflow-y: scroll; }
Expand Down
9 changes: 9 additions & 0 deletions web/src/utils/currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ export const getFormat = (min = 0, fullFormat) => {
};

export const formatToCurrency = (amount = 0, min = 0, fullFormat = false) => {
let formatObj = getFormat(min, fullFormat);
return numbro(roundNumber(amount, formatObj.digit)).format(formatObj.format);
};

export const formatCurrencyByIncrementalUnit = (
amount = 0,
min = 0,
fullFormat = false
) => {
let formatObj = getFormat(min, fullFormat);
let _amount = amount;
if (min >= 1) {
Expand Down

0 comments on commit 362fc77

Please sign in to comment.