Skip to content

Commit

Permalink
Merge pull request #2038 from hollaex/testnet
Browse files Browse the repository at this point in the history
Testnet
  • Loading branch information
abeikverdi committed Mar 17, 2023
2 parents ffe7999 + 792ed9a commit 37746ee
Show file tree
Hide file tree
Showing 24 changed files with 851 additions and 268 deletions.
22 changes: 22 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,28 @@ steps:
DOCKER_PASSWORD:
from_secret: docker_password

- name: docker_tagging_arm64v8_master
image: alpine
commands:
- export TZ=UTC-9 && export GIT_COMMIT_SHORT="$(echo $DRONE_COMMIT | cut -c 1-7)" && export PACKAGE_VERSION="$(cat version)" && echo " $PACKAGE_VERSION-arm64v8" > .tags
- echo "Current Docker tag is :" && cat .tags
- echo "dockerTag:$(cat .tags)" > .dockerTag.yml
when:
branch: master

- name: docker_build_arm64v8
image: plugins/docker
settings:
repo: bitholla/hollaex-kit
dockerfile: Dockerfile.arm64v8
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
when:
branch: master

- name: manifest_creation
image: docker:18.06.3-dind
privileged: true
Expand Down
2 changes: 1 addition & 1 deletion server/api/swagger/swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const definition = {
swagger: '2.0',
info: {
title: 'HollaEx Kit',
version: '2.5.2'
version: '2.5.3'
},
host: 'api.hollaex.com',
basePath: '/v2',
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.5.2",
"version": "2.5.3",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down
22 changes: 17 additions & 5 deletions server/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const sequelize = require('sequelize');
const lodash = require('lodash');
const pluginProcess = path.join(__dirname, './plugin-process.js');
const { Worker } = require('worker_threads');
const proxy = require('express-http-proxy');
const { createProxyMiddleware, fixRequestBody } = require('http-proxy-middleware');

let app;
let pluginWorkerThread;
Expand Down Expand Up @@ -164,15 +164,27 @@ checkStatus()
app.use(morgan(morganType, { stream }));
app.listen(PORT);
app.use(cors());
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
app.use(logEntryRequest);
app.use(domainMiddleware);
helmetMiddleware(app);
app.use(express.urlencoded({ extended: true }));
app.use(express.json());

const defaultURL = 'http://localhost:10012';

app.use('/plugins', routes);
app.use('/', proxy(defaultURL));
const customRouter = function (req) {
return defaultURL;
};

const options = {
target: defaultURL,
router: customRouter,
changeOrigin: true,
onProxyReq: fixRequestBody
};


app.use('/plugins', routes, createProxyMiddleware(options));

startPluginProcess();

Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.2
2.5.3
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.5.2",
"version": "2.5.3",
"private": true,
"dependencies": {
"@ant-design/compatible": "1.0.5",
Expand Down
32 changes: 32 additions & 0 deletions web/src/actions/appActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,14 @@ export const SET_ALL_CONTRACTS = 'SET_ALL_CONTRACTS';
export const SET_TRADE_TAB = 'SET_TRADE_TAB';
export const SET_SORT_MODE = 'SET_SORT_MODE';
export const SET_WALLET_SORT_MODE = 'SET_WALLET_SORT_MODE';
export const SET_DIGITAL_ASSETS_SORT_MODE = 'SET_DIGITAL_ASSETS_SORT_MODE';
export const TOGGLE_WALLET_SORT = 'TOGGLE_WALLET_SORT';
export const TOGGLE_SORT = 'TOGGLE_SORT';
export const TOGGLE_DIGITAL_ASSETS_SORT = 'TOGGLE_DIGITAL_ASSETS_SORT';
export const SET_ADMIN_SORT = 'SET_ADMIN_SORT';
export const SET_ADMIN_WALLET_SORT = 'SET_ADMIN_WALLET_SORT';
export const SET_ADMIN_DIGITAL_ASSETS_SORT = 'SET_ADMIN_DIGITAL_ASSETS_SORT';

export const SORT = {
VOL: 'volume',
CHANGE: 'change',
Expand All @@ -99,6 +103,10 @@ export const WALLET_SORT = {
AMOUNT: 'amount',
};

export const DIGITAL_ASSETS_SORT = {
CHANGE: 'change',
};

export const SORT_EXP = {
VOL: 'most actively traded first',
CHANGE: 'biggest gainers first',
Expand All @@ -108,6 +116,10 @@ export const WALLET_SORT_EXP = {
AMOUNT: 'asset with the most amount',
};

export const DIGITAL_ASSETS_SORT_EXP = {
CHANGE: 'biggest gainers first',
};

export const setSortModeAmount = () => ({
type: SET_WALLET_SORT_MODE,
payload: WALLET_SORT.AMOUNT,
Expand Down Expand Up @@ -150,6 +162,26 @@ export const setAdminWalletSortData = ({
},
});

export const setDigitalAssetsSortModeChange = () => ({
type: SET_DIGITAL_ASSETS_SORT_MODE,
payload: DIGITAL_ASSETS_SORT.CHANGE,
});

export const toggleDigitalAssetsSort = () => ({
type: TOGGLE_DIGITAL_ASSETS_SORT,
});

export const setAdminDigitalAssetsSortData = ({
pinned_assets,
default_digital_assets_sort,
}) => ({
type: SET_ADMIN_DIGITAL_ASSETS_SORT,
payload: {
pinned_assets,
default_digital_assets_sort,
},
});

export const USER_TYPES = {
USER_TYPE_NORMAL: 'normal',
USER_TYPE_ADMIN: 'admin',
Expand Down
2 changes: 2 additions & 0 deletions web/src/actions/operatorActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const pushVersions = async (configs = {}) => {
default_sort,
pinned_assets,
default_wallet_sort,
default_digital_assets_sort,
...versioned_configs
} = configs;
const { sections = {}, ...rest } = versioned_configs;
Expand All @@ -82,6 +83,7 @@ export const pushVersions = async (configs = {}) => {
pinned_markets,
pinned_assets,
default_wallet_sort,
default_digital_assets_sort,
},
};
};
Expand Down
12 changes: 6 additions & 6 deletions web/src/components/AdminForm/hoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ const Form = (name, className = '', allowPristine = false) => {
</div>
)}
{renderCustomFooter(formValues)}
<div className="d-flex justify-content-between">
<div
className={secondaryBtnTxt ? 'd-flex justify-content-between' : ''}
>
{secondaryBtnTxt ? (
<Button
type="primary"
onClick={onClose}
className={'green-btn btn-48'}
className={`green-btn btn-48`}
>
{secondaryBtnTxt}
</Button>
Expand All @@ -68,13 +70,11 @@ const Form = (name, className = '', allowPristine = false) => {
}
size={small ? 'small' : 'large'}
className={`${small ? buttonClass : buttonClass} ${
!secondaryBtnTxt ? 'btn-48' : 'w-100'
secondaryBtnTxt ? 'btn-48' : 'w-100'
}`}
style={small ? { float: 'right' } : null}
buttonText={buttonText}
secondaryClassName={
secondaryBtnTxt ? 'btn-48' : 'w-100 d-flex justify-content-center'
}
secondaryClassName={'w-100'}
/>
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
import React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import classnames from 'classnames';
import { CaretUpOutlined, CaretDownOutlined } from '@ant-design/icons';

import {
toggleSort,
setSortModeChange,
setSortModeVolume,
DIGITAL_ASSETS_SORT as SORT,
toggleDigitalAssetsSort as toggleSort,
setDigitalAssetsSortModeChange as setSortModeChange,
} from 'actions/appActions';
import {
oneOfType,
arrayOf,
shape,
array,
object,
number,
string,
func,
} from 'prop-types';
import { Paginator } from 'components';
import { Paginator, EditWrapper } from 'components';
import STRINGS from 'config/localizedStrings';
import withConfig from 'components/ConfigProvider/withConfig';
import MarketRow from './MarketRow';
import { EditWrapper } from 'components';
import MarketRow from 'containers/TradeTabs/components/MarketRow';

const AssetsList = ({
markets,
Expand All @@ -34,19 +26,43 @@ const AssetsList = ({
goToPreviousPage,
showPaginator = false,
loading,
constants,
mode,
is_descending,
toggleSort,
setSortModeChange,
setSortModeVolume,
isAsset = false,
constants,
}) => {
const handleClickChange = () => {
if (mode === SORT.CHANGE) {
toggleSort();
} else {
setSortModeChange();
}
};

const renderCaret = (cell) => (
<div className="market-list__caret d-flex flex-direction-column mx-1 secondary-text">
<CaretUpOutlined
className={classnames({
'important-text': mode === cell && is_descending,
})}
/>
<CaretDownOutlined
className={classnames({
'important-text': mode === cell && !is_descending,
})}
/>
</div>
);

return (
<div className="market-list__container">
<div className="market-list__block">
<div className="d-flex justify-content-end">
<EditWrapper configId="MARKET_LIST_CONFIGS" position={[0, 0]} />
<EditWrapper
configId="DIGITAL_ASSETS_LIST_CONFIGS"
position={[0, 0]}
/>
</div>
<table className="market-list__block-table">
<thead>
Expand All @@ -67,16 +83,17 @@ const AssetsList = ({
</th>
<th>
<div>
<EditWrapper stringId="MARKETS_TABLE.LAST_PRICE">
<EditWrapper stringId="MARKETS_TABLE.SOURCE">
{STRINGS['MARKETS_TABLE.SOURCE']}
</EditWrapper>
</div>
</th>
<th>
<div className="d-flex">
<div onClick={handleClickChange} className="d-flex pointer">
<EditWrapper stringId="MARKETS_TABLE.CHANGE_24H">
{STRINGS['MARKETS_TABLE.CHANGE_24H']}
</EditWrapper>
{renderCaret(SORT.CHANGE)}
</div>
</th>
<th>
Expand Down Expand Up @@ -112,7 +129,7 @@ const AssetsList = ({
chartData={chartData}
market={market}
loading={loading}
isAsset={isAsset}
isAsset={true}
constants={constants}
/>
))}
Expand All @@ -132,36 +149,19 @@ const AssetsList = ({
);
};

AssetsList.propTypes = {
markets: oneOfType([
arrayOf(
shape({
key: string,
pair: object,
ticker: object,
increment_price: number,
priceDifference: number,
priceDifferencePercent: string,
})
),
array,
]).isRequired,
chartData: object.isRequired,
handleClick: func.isRequired,
};

const mapStateToProps = ({
app: {
sort: { mode, is_descending },
digital_assets_sort: { mode, is_descending },
constants,
},
}) => ({
constants,
mode,
is_descending,
});

const mapDispatchToProps = (dispatch) => ({
toggleSort: bindActionCreators(toggleSort, dispatch),
setSortModeVolume: bindActionCreators(setSortModeVolume, dispatch),
setSortModeChange: bindActionCreators(setSortModeChange, dispatch),
});

Expand Down
Loading

0 comments on commit 37746ee

Please sign in to comment.