Skip to content

Commit

Permalink
Merge pull request #3110 from hollaex/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
abeikverdi authored Dec 2, 2024
2 parents 1b59b1b + baf1cde commit 3b02717
Show file tree
Hide file tree
Showing 32 changed files with 1,764 additions and 193 deletions.
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.13.1'
version: '2.13.2'
},
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.13.1",
"version": "2.13.2",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down
10 changes: 0 additions & 10 deletions server/utils/hollaex-tools-lib/tools/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,6 @@ const getUserQuickTrade = async (spending_currency, spending_amount, receiving_a
if (spending_amount != null) responseObj.receiving_amount = priceValues.targetAmount;
else if (receiving_amount != null) responseObj.spending_amount = priceValues.sourceAmount;

//Check if the estimated price is 50% greater than the last trade
const lastTrades = await getPublicTrades(symbol);
if (Array.isArray(lastTrades[symbol]) && lastTrades[symbol].length > 0) {
const lastPrice = new BigNumber(lastTrades[symbol][0].price).multipliedBy(1.50).toNumber();

if (priceValues.estimatedPrice > lastPrice) {
throw new Error(QUICK_TRADE_ORDER_CURRENT_PRICE_ERROR);
}
}

let user_id = null;
if (bearerToken) {
const auth = await verifyBearerTokenPromise(bearerToken, ip);
Expand Down
2 changes: 1 addition & 1 deletion server/utils/hollaex-tools-lib/tools/p2p.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ const createP2PTransaction = async (data) => {
data.user_status = 'pending';
data.merchant_status = 'pending';
data.transaction_status = 'active';
data.transaction_duration = 30;
data.transaction_duration = Number(p2pConfig?.transaction_duration || 30);
data.transaction_id = uuid();
data.merchant_id = side === 'buy' ? user_id : merchant_id;
data.user_id = side === 'buy' ? merchant_id : user_id;
Expand Down
14 changes: 12 additions & 2 deletions server/utils/orderbook.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
'use strict';
const { getOrderbook, getKitPairsConfig } = require('./hollaex-tools-lib/tools/common');
const { getOrderbook, getOrderbooks, getKitPairsConfig } = require('./hollaex-tools-lib/tools/common');
const math = require('mathjs');
const BigNumber = require('bignumber.js');
const { client } = require('./hollaex-tools-lib/tools/database/redis')


const sumQuantities = (orders) =>
orders.reduce((total, [, size]) => math.add(total, size), 0);

Expand Down Expand Up @@ -52,8 +55,15 @@ const estimatedQuickTradePriceSelector = ({ pairsOrders, pair, side, size, isFir
}

const setPriceEssentials = async (priceEssentials, opts) => {
const pairsOrders = await getOrderbook(priceEssentials.pair, opts);
let pairsOrders = await client.getAsync(`orderbooks`);

if (!pairsOrders) {
pairsOrders = await getOrderbooks(opts);
await client.setexAsync(`orderbooks`, 30, JSON.stringify(pairsOrders));
} else {
pairsOrders = JSON.parse(pairsOrders);

};
const pair = priceEssentials.pair;
const side = priceEssentials.side;
const isSourceChanged = priceEssentials.isSourceChanged;
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.13.1
2.13.2
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.13.1",
"version": "2.13.2",
"private": true,
"dependencies": {
"@ant-design/compatible": "1.0.5",
Expand Down
16 changes: 15 additions & 1 deletion web/src/components/AppBar/AccountTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import withConfig from 'components/ConfigProvider/withConfig';
import { Image, EditWrapper } from 'components';
import { isLoggedIn, removeToken } from 'utils/token';
import { setSecurityTab, setSettingsTab } from 'actions/appActions';
import { renderConfirmSignout } from './Utils';

const AccountTab = ({
config_level,
Expand Down Expand Up @@ -105,6 +106,7 @@ const AccountList = ({
}) => {
const [isHelpResources, setIsHelpResources] = useState(false);
const [currPath, setCurrpath] = useState('/summary');
const [isLogout, setIsLogout] = useState(false);

useEffect(() => {
const getCurrPage = window.location.pathname;
Expand Down Expand Up @@ -186,7 +188,7 @@ const AccountList = ({
const onHandleRoutes = (value = '/', title = '') => {
const selectedTab = {
'LOGIN.HELP': () => setIsHelpResources(true),
'ACCOUNTS.TAB_SIGNOUT': () => removeToken(),
'ACCOUNTS.TAB_SIGNOUT': () => setIsLogout(true),
'ACCOUNTS.TAB_SECURITY': () => setSecurityTab(0),
'MORE_OPTIONS_LABEL.ICONS.API': () => setSecurityTab(2),
'USER_SETTINGS.TITLE_LANGUAGE': () => setSettingsTab(2),
Expand Down Expand Up @@ -217,6 +219,16 @@ const AccountList = ({
? Icons[`LEVEL_ACCOUNT_ICON_${verification_level}`]
: Icons['LEVEL_ACCOUNT_ICON_4'];

const onHandlelogout = () => {
setIsLogout(false);
removeToken();
return browserHistory?.push('/login');
};

const onHandleclose = () => {
setIsLogout(false);
};

return (
<div className="navigation-dropdown-container">
{isHelpResources && renderHelpResource()}
Expand All @@ -238,6 +250,8 @@ const AccountList = ({
</span>
<span className="secondary-text">({user?.email})</span>
</div>
{isLogout &&
renderConfirmSignout(isLogout, onHandleclose, onHandlelogout)}
{accountOptions?.map((options) => {
return (
options?.isDisplay && (
Expand Down
23 changes: 23 additions & 0 deletions web/src/components/AppBar/DesktopSearch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import STRINGS from 'config/localizedStrings';
import EditWrapper from 'components/EditWrapper';
import MobileBarMoreOptions from 'containers/App/MobileBarMoreOptions';

const DesktopSearch = () => {
return (
<div className="summary-container desktop-search-wrapper">
<div className="search-description-container">
<div className="search-description">
<EditWrapper stringId="DESKTOP_ULTIMATE_SEARCH.SEARCH_DESCRIPTION">
{STRINGS['DESKTOP_ULTIMATE_SEARCH.SEARCH_DESCRIPTION']}
</EditWrapper>
</div>
<div className="dynamic-search-container">
<MobileBarMoreOptions />
</div>
</div>
</div>
);
};

export default DesktopSearch;
34 changes: 34 additions & 0 deletions web/src/components/AppBar/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,37 @@ export const ReconnectPopup = ({ isDisplayPopup, onHandleClose }) => {
</Dialog>
);
};

export const renderConfirmSignout = (
isVisible,
onHandleclose,
onHandlelogout
) => {
return (
<Dialog
isOpen={isVisible}
className="signout-confirmation-popup-wrapper"
onCloseDialog={() => onHandleclose()}
>
<div className="signout-confirmation-popup-description">
<span className="signout-title">
<EditWrapper stringId="LOGOUT_CONFIRM_TEXT">
{STRINGS['LOGOUT_CONFIRM_TEXT']}
</EditWrapper>
</span>
<div className="signout-confirmation-button-wrapper">
<Button
className="cancel-btn"
label={STRINGS['CANCEL']}
onClick={() => onHandleclose()}
></Button>
<Button
className="confirm-btn"
label={STRINGS['CONFIRM_TEXT']}
onClick={() => onHandlelogout()}
></Button>
</div>
</div>
</Dialog>
);
};
179 changes: 179 additions & 0 deletions web/src/components/AppBar/_AppBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ $app-menu-width: calc(100vw - 40rem);
}
}
}
.active-menu {
color: $base_top-bar-navigation_text;
border-top: 4px solid $link;
height: 100%;
opacity: 1;
}
}

.app_bar-quicktrade-container {
Expand Down Expand Up @@ -517,6 +523,11 @@ $app-menu-width: calc(100vw - 40rem);
cursor: pointer;
font-size: 11px;
}

.app-bar-search-icon {
padding: 2%;
font-size: 16px;
}
}
.capitalize {
text-transform: capitalize;
Expand Down Expand Up @@ -1530,3 +1541,171 @@ $app-menu-width: calc(100vw - 40rem);
}
}
}

.dynamic-search-description {
font-size: 12px;
}

.desktop-search-wrapper {
.search-description-container {
margin: 3% 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
.search-description {
.edit-wrapper__container {
font-size: 24px;
}
}
.dynamic-search-container {
width: 100%;
display: flex;
align-items: center;
flex-direction: column;
.desktop-search-more-option {
width: 90%;
display: flex;
flex-direction: column;
align-items: center;
.search-field {
width: 90%;
margin-top: 2%;
display: flex;
align-items: center;
justify-content: center;
.ant-input-affix-wrapper {
width: 80%;
height: 4rem;
background-color: transparent;
border: 1px solid $colors-notifications-blue;
}
.ant-input {
border: none;
color: $colors-main-black;
background-color: transparent;
padding: 3%;
}
.ant-input:hover {
border: none;
}
.ant-input-affix-wrapper:hover {
border: 2px solid $colors-notifications-blue;
box-shadow: none;
}
.ant-input-suffix {
svg {
font-size: 20px;
path {
fill: $colors-black;
}
}
}
.search-icon-container {
margin-left: 1%;
background-color: $colors-notifications-blue;
padding: 1.5%;
border-radius: 5px;
.search-icon {
font-size: 30px;
svg {
path {
fill: #ffffff;
}
}
}
}
}
}

.options-container {
margin: 3% 0;
width: 100%;
.popular-option-container {
.options-field {
width: 60% !important;
}
}
.other-option-container {
margin-top: 5%;
}

.hot-options-container {
display: flex;
align-items: center;
flex-direction: column;
.hot-function-title {
font-size: 16px;
}
.search-result {
font-family: 'Open Sans';
}
.options-field {
width: 90%;
margin-top: 3%;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 2%;
.plugins-icon {
svg {
path {
fill: $colors-main-black;
}
}
}
.icon-field {
min-width: 14%;
display: flex;
flex-direction: column;
align-items: center;
padding: 2%;
.hot-icon {
position: relative;
bottom: 15px;
svg {
width: 1.2rem;
path {
fill: $colors-notification-pending !important;
}
}
}
.icon-logo {
width: 25px;
path {
fill: $colors-main-black;
}
}
}
.image-wrapper {
.icon-logo {
position: relative;
left: 10px;
}
.assets-icon {
position: relative;
bottom: 15px;
}
}
.icon-field:hover {
cursor: pointer;
background-color: $app-sidebar-background;
border-radius: 5px;
}
}
}
}
}
}
.crypto-link {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 10px;
.blue-link:hover {
cursor: pointer;
}
}
}
Loading

0 comments on commit 3b02717

Please sign in to comment.