Skip to content

Commit

Permalink
Merge pull request #1459 from bitholla/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
abeikverdi authored Jun 14, 2022
2 parents 16fbc45 + 5d775d5 commit 1fd151a
Show file tree
Hide file tree
Showing 61 changed files with 13,356 additions and 15,864 deletions.
12 changes: 6 additions & 6 deletions server/api/controllers/broker.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const { loggerBroker } = require('../../config/logger');
const { INIT_CHANNEL } = require('../../constants')
const { INIT_CHANNEL } = require('../../constants');
const { publisher } = require('../../db/pubsub');
const toolsLib = require('hollaex-tools-lib');
const { errorMessageConverter } = require('../../utils/conversion');
Expand Down Expand Up @@ -47,7 +47,7 @@ const createBrokerPair = (req, res) => {
user_id,
min_size,
max_size,
increment_size,
increment_size
})
.then((data) => {
publisher.publish(INIT_CHANNEL, JSON.stringify({ type: 'refreshInit' }));
Expand All @@ -61,7 +61,7 @@ const createBrokerPair = (req, res) => {
);
return res.status(err.statusCode || 400).json({ message: errorMessageConverter(err) });
});
}
};

function updateBrokerPair(req, res) {
loggerBroker.verbose(
Expand Down Expand Up @@ -114,7 +114,7 @@ function deleteBrokerPair(req, res) {
toolsLib.broker.deleteBrokerPair(req.swagger.params.data.value.id)
.then((data) => {
publisher.publish(INIT_CHANNEL, JSON.stringify({ type: 'refreshInit' }));
return res.json({ message: "Successfully deleted broker pair." });
return res.json({ message: 'Successfully deleted broker pair.' });
})
.catch((err) => {
loggerBroker.error(
Expand Down Expand Up @@ -168,7 +168,7 @@ const executeBrokerDeal = (req, res) => {
side,
symbol,
price,
size,
size
} = req.swagger.params.data.value;

const userId = req.auth.sub.id;
Expand All @@ -190,7 +190,7 @@ const executeBrokerDeal = (req, res) => {
);
return res.status(err.statusCode || 400).json({ message: errorMessageConverter(err) });
});
}
};

module.exports = {
createBrokerPair,
Expand Down
2 changes: 1 addition & 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.3.5"
version: "2.3.6"
title: HollaEx Kit
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.3.5",
"version": "2.3.6",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down
58 changes: 29 additions & 29 deletions server/utils/hollaex-tools-lib/tools/broker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,41 @@ const { validatePair, getKitTier } = require('./common');

const validateBrokerPair = (brokerPair) => {
if (math.compare(brokerPair.buy_price, 0) !== 1) {
throw new Error("Broker buy price must be bigger than zero.")
throw new Error('Broker buy price must be bigger than zero.');
} else if (math.compare(brokerPair.sell_price, 0) !== 1) {
throw new Error("Broker sell price must be bigger than zero.")
throw new Error('Broker sell price must be bigger than zero.');
} else if (math.compare(brokerPair.min_size, 0) !== 1) {
throw new Error("Broker minimum order size must be bigger than zero.")
throw new Error('Broker minimum order size must be bigger than zero.');
} else if (math.compare(brokerPair.max_size, brokerPair.min_size) !== 1) {
throw new Error("Broker maximum order size must be bigger than minimum order size.")
throw new Error('Broker maximum order size must be bigger than minimum order size.');
} else if (math.compare(brokerPair.increment_size, 0) !== 1) {
throw new Error("Broker order price increment must be bigger than zero.")
throw new Error('Broker order price increment must be bigger than zero.');
} else if (brokerPair.symbol && !validatePair(brokerPair.symbol)) {
throw new Error('invalid symbol');
}
}
};

const createBrokerPair = (brokerPair) => {
validateBrokerPair(brokerPair);
return fetchBrokerPair(brokerPair.symbol)
.then((deal) => {
if (deal) {
throw new Error('A deal for this symbol alreadys exists')
throw new Error('A deal for this symbol alreadys exists');
}
return getModel("broker").create(brokerPair, { raw: true });
})
}
return getModel('broker').create(brokerPair, { raw: true });
});
};

const fetchBrokerPair = (symbol) => {
return getModel("broker").findOne({ where: { symbol } });
}
return getModel('broker').findOne({ where: { symbol } });
};

async function fetchBrokerPairs(attributes) {
return await getModel("broker").findAll({ attributes });
return await getModel('broker').findAll({ attributes });
}

const updateBrokerPair = async (id, data) => {
const brokerPair = await getModel("broker").findOne({ where: { id } });
const brokerPair = await getModel('broker').findOne({ where: { id } });
if (!brokerPair) {
throw new Error('Pair does not exist');
}
Expand All @@ -58,35 +58,35 @@ const updateBrokerPair = async (id, data) => {
return brokerPair.update(data, {
fields: [
'user_id',
"buy_price",
"sell_price",
"min_size",
"max_size",
"increment_size",
"paused"
'buy_price',
'sell_price',
'min_size',
'max_size',
'increment_size',
'paused'
]
});
}
};

const deleteBrokerPair = async (id) => {
const brokerPair = await getModel("broker").findOne({ where: { id } });
const brokerPair = await getModel('broker').findOne({ where: { id } });

if (!brokerPair) {
throw new Error("Broker pair could not be found.");
throw new Error('Broker pair could not be found.');
} else if (!brokerPair.paused) {
throw new Error("Broker pair could not be deleted while unpaused.");
throw new Error('Broker pair could not be deleted while unpaused.');
}

return brokerPair.destroy();
}
};

const executeBrokerDeal = async (userId, symbol, side, size, price) => {
const brokerPair = await getModel("broker").findOne({ where: { symbol } });
const brokerPair = await getModel('broker').findOne({ where: { symbol } });

if (!brokerPair) {
throw new Error("Broker pair could not be found.");
throw new Error('Broker pair could not be found.');
} else if (brokerPair.paused) {
throw new Error("Broker pair is paused.");
throw new Error('Broker pair is paused.');
}

const brokerPrice = {
Expand Down Expand Up @@ -116,7 +116,7 @@ const executeBrokerDeal = async (userId, symbol, side, size, price) => {
user.network_id,
{ maker: makerFee, taker: takerFee }
);
}
};

module.exports = {
createBrokerPair,
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.5
2.3.6
1 change: 1 addition & 0 deletions web/.env
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ REACT_APP_LOGO_BLACK_PATH=https://bitholla.s3.ap-northeast-2.amazonaws.com/kit/L
REACT_APP_EXCHANGE_NAME='TestExchange_'
REACT_APP_PLUGIN_DEV_MODE=
REACT_APP_PLUGIN=
REACT_APP_LANG=

89 changes: 89 additions & 0 deletions web/diff.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"FOOTER": {
"FOOTER_LEGAL": ["Proudly made in Seoul, South Korea", "bitHolla Inc."],
"XHT_DESCRIPTION": "HollaEx Kit is an open source trading platform built by bitHolla Inc. You can create and list any digital assets and onboard users to trade on your exchange using this exchange Kit. In order to simply run one yourself {1}."
},
"LEGAL": {
"PRIVACY_POLICY": {
"TEXTS": [
"HollaEx Web is a virtual trading platform that is wholly owned by bitHolla Inc. bitHolla Inc (hereinafter referred to as bitHolla) was incorporated in Seoul South Korea.",
"Use of this HollaEx website (“Website”) and the service offered on the Website (“Service”) are governed by the terms contained on this Terms and Conditions page (“Terms”). This agreement entirely constitutes the agreement between the parties. All other information provided on the Website or oral/written statements made are excluded from this agreement; the exchange policy is provided for guidance only and does not constitute a legal agreement between the parties.",
"By accessing, viewing or downloading information from the Website and using the Service provided by bitHolla you acknowledge that you have read, understand, and unconditionally agree to be bound by these Terms. bitHolla may at any time, without notice, amend the Terms. You agree to continue to be bound by any amended terms and conditions and that bitHolla has no obligation to notify you of such amendments. You acknowledge that it is your responsibility to check these Terms periodically for changes and that your continued use of the Website and Services offered by bitHolla following the posting of any changes to the Terms indicates your acceptance of any such changes.",
"The Website and the copyright in all text, graphics, images, software and any other materials on the Website is owned by bitHolla including all trademarks and other intellectual property rights in respect of materials and Service on the Website. Materials on this Website may only be used for personal use and non-commercial purposes.",
"You may display on a computer screen or print extracts from the Website for the above-stated purpose only provided that you retain any copyright and other proprietary notices or any bitHolla trademarks or logos, as shown on the initial printout or download without alteration, addition or deletion. Except as expressly stated herein, you may not without bitHolla’s prior written permission alter, modify, reproduce, distribute or use in any other commercial context any materials from the Website.",
"You acknowledge that ‘bitHolla’ and the bitHolla logo are trademarks of bitHolla Inc. You may reproduce such trademarks without alteration on material downloaded from this Website to the extent authorised above, but you may not otherwise use, copy, adapt or erase them.",
"You shall not in any circumstances obtain any rights over or in respect of the Website (other than rights to use the Website pursuant to these Terms and any other terms and conditions governing a particular service or section of the Website) or hold yourself out as having any such rights over or in respect of the Website."
]
},
"GENERAL_TERMS": {
"TEXTS": [
"HollaEx Web is a virtual trading platform that is wholly owned by bitHolla Inc. bitHolla Inc (hereinafter referred to as bitHolla) was incorporated in Seoul South Korea.",
"Use of this HollaEx website (“Website”) and the service offered on the Website (“Service”) are governed by the terms contained on this Terms and Conditions page (“Terms”). This agreement entirely constitutes the agreement between the parties. All other information provided on the Website or oral/written statements made are excluded from this agreement; the exchange policy is provided for guidance only and does not constitute a legal agreement between the parties.",
"By accessing, viewing or downloading information from the Website and using the Service provided by bitHolla you acknowledge that you have read, understand, and unconditionally agree to be bound by these Terms. bitHolla may at any time, without notice, amend the Terms. You agree to continue to be bound by any amended terms and conditions and that bitHolla has no obligation to notify you of such amendments. You acknowledge that it is your responsibility to check these Terms periodically for changes and that your continued use of the Website and Services offered by bitHolla following the posting of any changes to the Terms indicates your acceptance of any such changes.",
"The Website and the copyright in all text, graphics, images, software and any other materials on the Website is owned by bitHolla including all trademarks and other intellectual property rights in respect of materials and Service on the Website. Materials on this Website may only be used for personal use and non-commercial purposes.",
"You may display on a computer screen or print extracts from the Website for the above-stated purpose only provided that you retain any copyright and other proprietary notices or any bitHolla trademarks or logos, as shown on the initial printout or download without alteration, addition or deletion. Except as expressly stated herein, you may not without bitHolla’s prior written permission alter, modify, reproduce, distribute or use in any other commercial context any materials from the Website.",
"You acknowledge that ‘bitHolla’ and the bitHolla logo are trademarks of bitHolla Inc. You may reproduce such trademarks without alteration on material downloaded from this Website to the extent authorised above, but you may not otherwise use, copy, adapt or erase them.",
"You shall not in any circumstances obtain any rights over or in respect of the Website (other than rights to use the Website pursuant to these Terms and any other terms and conditions governing a particular service or section of the Website) or hold yourself out as having any such rights over or in respect of the Website."
]
}
},
"STAKE": {
"REWARDS": {
"3": { "CARD": "", "TEXT": "" },
"4": { "CARD": "", "TEXT": "" }
}
},
"SETTINGS_ORDERPOPUP_OPTIONS": [
{ "value": false, "label": "NO" },
{ "value": true, "label": "YES" }
],
"SETTINGS_THEME_OPTIONS": [
{ "value": "white", "label": "White" },
{ "value": "dark", "label": "Dark" }
],
"SUMMARY": {
"LEVEL_1_TXT": "Your journey starts here young crypto trader! To obtain bonuses you can verify your identification and also get larger deposit and withdraw limits with reduced trading fees.",
"LEVEL_2_TXT": "Simply trade monthly over $3,000 USDT worth or have balance of over 5,000 XHT and enjoy lower trading fees.",
"LEVEL_3_TXT": "This is where things get real! Enjoy reduced trading fees and large deposit and withdrawal limits. To get to level 3 you must complete your verification",
"LEVEL_4_TXT": "Simply trade monthly over $10,000 USDT worth or have balance of over 10,000 XHT and enjoy lower trading fees.",
"LEVEL_5_TXT": "You’ve made it! The level 5 account is a rare account only for exchange operators, Vault users or HollaEx Affiliate Program (HAP). Enjoy large limits and enjoy zero maker fees.",
"LEVEL_6_TXT": "Simply trade monthly over $300,000 USDT worth or have balance of over 100,000 XHT and enjoy lower trading fees. Increased withdraw amount.",
"LEVEL_7_TXT": "Simply trade monthly over $500,000 USDT worth or have balance of over 300,000 XHT and enjoy lower trading fees. Increased withdraw amount.",
"LEVEL_8_TXT": "Simply trade monthly over $600,000 USDT worth or have balance of over 400,000 XHT and enjoy lower trading fees.",
"LEVEL_9_TXT": "Simply trade monthly over $2,000,000 USDT worth or have balance of over 1,000,000 XHT and enjoy lower trading fees.",
"LEVEL_10_TXT": "The whale trader account that earns you money back for market making. To obtain this special account please get in touch with us.",
"TRADER_ACCOUNT_XHT_TEXT": "Your account is in the presale period of XHT, this means you can obtain XHT for $0.10 per XHT. All deposit will be converted to XHT once the transaction has cleared.",
"HAP_ACCOUNT_TXT": "Your account is a verified HollaEx affiliate program account. You can now earn 10% bonus for every person you invite that buys XHT."
},
"STAKE_TOKEN": {
"TITLE": "Stake HollaEx Token",
"INFO_TXT1": "HollaEx tokens (XHT) are required to be collateralized (staked) to run the HollaEx Kit exchange software.",
"INFO_TXT2": "You can collateralize your HollaEx token in a similar fashion and earn XHT not sold during the Wave Auction.",
"INFO_TXT3": "Simply go to dash.bitholla.com and collateralize your own exchange today and earn free XHT",
"BUTTON_TXT": "FIND OUT MORE"
},
"TERMS_OF_SERVICES": {
"TITLE": "HollaEx Token Purchase Agreement",
"PROCEED": "PROCEED",
"AGREE_TERMS_LABEL": "I have read and agree to the HollaEx Token Purchase Agreement",
"RISK_INVOLVED_LABEL": "I understand the risks involved",
"DOWNLOAD_PDF": "Download the PDF",
"DEPOSIT_FUNDS": "Deposit funds into your wallet to obtain HollaEx Token (XHT)",
"READ_FAG": "Read HollaEx FAQ here: {0}",
"READ_DOCUMENTATION": "Read HollaEx whitepaper here: {0}",
"READ_WAVES": "Rules for the coming December Public Wave Auction{0}",
"DOWNLOAD_BUY_XHT": "Download the PDF to see a visual step-by-step processes on {0}",
"HOW_TO_BUY": "how to buy HollaEx Token (XHT)",
"PUBLIC_SALES": " Public Wave Auction",
"CONTACT_US": "Feel free to contact us for more information and any issues by sending us an email to {0}",
"VISUAL_STEP": "See a visual step-by-step processes on {0}",
"WARNING_TXT": "We will review your request and send further instructions to your email on how to access the HollaEx exchange.",
"WARNING_TXT1": "In the mean time you can familiarize yourself with the HollaEx network with the resources below",
"XHT_ORDER_TXT_1": "To start trading you must login",
"XHT_ORDER_TXT_2": "",
"XHT_ORDER_TXT_3": "{0} or {1}",
"XHT_TRADE_TXT_1": "Login to see your recent trades",
"XHT_TRADE_TXT_2": "You can {0} to see your recent trade history",
"LOGIN_HERE": "login here"
}
}
12 changes: 12 additions & 0 deletions web/package-lock.json

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

9 changes: 7 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hollaex-kit",
"version": "2.3.5",
"version": "2.3.6",
"private": true,
"dependencies": {
"@ant-design/compatible": "1.0.5",
Expand Down Expand Up @@ -90,7 +90,9 @@
"devDependencies": {
"cpy-cli": "3.1.1",
"husky": "4.3.0",
"json-beautify": "1.1.1",
"lint-staged": "10.5.1",
"lodash.isempty": "4.4.0",
"node-sass-chokidar": "1.5.0",
"prettier": "2.1.2",
"react-scripts": "3.4.3",
Expand All @@ -113,7 +115,10 @@
"publish:demo": "surge build",
"check-build": "npm run pre-build && npm run build:demo && npm run copy-cname && npm run publish:demo",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"lang:diff": "REACT_APP_LANG=$npm_config_lang node ./translationRunner.js --save-diff",
"lang:merge": "REACT_APP_LANG=$npm_config_lang node ./translationRunner.js --merge-diff",
"lang:rc": "REACT_APP_LANG=$npm_config_lang node ./translationRunner.js --reverse-check"
},
"description": "Cryptocurrency exchange platfrom",
"main": "index.js",
Expand Down
1 change: 0 additions & 1 deletion web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/css/bootstrap-grid.min.css">
<script src="%PUBLIC_URL%/datafeeds/udf/dist/polyfills.js"></script>
<script src="%PUBLIC_URL%/datafeeds/udf/dist/bundle.js"></script>
</head>
<body>
Expand Down
1 change: 0 additions & 1 deletion web/src/actions/appActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export const SET_CURRENCIES = 'SET_CURRENCIES';
export const SET_BROKER = 'SET_BROKER';
export const SET_CONFIG = 'SET_CONFIG';
export const SET_PLUGINS = 'SET_PLUGINS';
export const REQUEST_XHT_ACCESS = 'REQUEST_XHT_ACCESS';
export const SET_INFO = 'SET_INFO';
export const SET_PLUGINS_REQUEST = 'SET_PLUGINS_REQUEST';
export const SET_PLUGINS_SUCCESS = 'SET_PLUGINS_SUCCESS';
Expand Down
16 changes: 5 additions & 11 deletions web/src/actions/chartAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import { getDecimals } from '../utils/utils';
export const getChartConfig = () => {
return axios({
url: '/udf/config',
method: 'GET'
})
.then((res) => {
return res.data;
});
method: 'GET',
}).then((res) => {
return res.data;
});
// const config = {
// supported_resolutions: ['60', '240', '1D'],
// supports_group_request: false,
Expand Down Expand Up @@ -51,12 +50,7 @@ export const getChartSymbol = (symbol, tickSize, api_name = '') => {
});
};

export const getChartHistory = (
symbol,
resolution,
from,
to
) => {
export const getChartHistory = (symbol, resolution, from, to) => {
return axios({
url: `/chart?symbol=${symbol}&resolution=${resolution}&from=${from}&to=${to}`,
method: 'GET',
Expand Down
Loading

0 comments on commit 1fd151a

Please sign in to comment.