diff --git a/server/api/controllers/deposit.js b/server/api/controllers/deposit.js index 3cd2a7ae4b..bfcc1b192c 100644 --- a/server/api/controllers/deposit.js +++ b/server/api/controllers/deposit.js @@ -30,6 +30,10 @@ const getAdminDeposits = (req, res) => { format } = req.swagger.params; + if (format.value && req.auth.scopes.indexOf(ROLES.ADMIN) === -1 && !user_id.value) { + return res.status(403).json({ message: API_KEY_NOT_PERMITTED }); + } + toolsLib.wallet.getUserDepositsByKitId( user_id.value, currency.value, diff --git a/server/api/controllers/withdrawal.js b/server/api/controllers/withdrawal.js index 9b7b6ca55b..d79c4a98d2 100644 --- a/server/api/controllers/withdrawal.js +++ b/server/api/controllers/withdrawal.js @@ -267,7 +267,7 @@ const getAdminWithdrawals = (req, res) => { address } = req.swagger.params; - if (format.value && req.auth.scopes.indexOf(ROLES.ADMIN) === -1) { + if (format.value && req.auth.scopes.indexOf(ROLES.ADMIN) === -1 && !user_id.value) { return res.status(403).json({ message: API_KEY_NOT_PERMITTED }); } diff --git a/server/api/swagger/admin.yaml b/server/api/swagger/admin.yaml index 26b48f582a..ae4e263209 100644 --- a/server/api/swagger/admin.yaml +++ b/server/api/swagger/admin.yaml @@ -2669,6 +2669,8 @@ paths: x-security-scopes: - admin - supervisor + - kyc + - support x-token-permissions: - can_read /admin/user/referer: @@ -2699,6 +2701,9 @@ paths: - hmac x-security-scopes: - admin + - supervisor + - kyc + - support x-token-permissions: - can_read /admin/user/wallet: diff --git a/server/api/swagger/common.yaml b/server/api/swagger/common.yaml index 4d475016ab..0434fbddac 100644 --- a/server/api/swagger/common.yaml +++ b/server/api/swagger/common.yaml @@ -264,7 +264,7 @@ paths: in: query required: false type: string - maxLength: 1024 + maxLength: 5000 responses: 200: description: Success diff --git a/server/api/swagger/definitions.yaml b/server/api/swagger/definitions.yaml index 6c8edd2d74..8ba3981b27 100644 --- a/server/api/swagger/definitions.yaml +++ b/server/api/swagger/definitions.yaml @@ -25,7 +25,7 @@ definitions: maxLength: 256 captcha: type: string - maxLength: 1024 + maxLength: 5000 referral: type: string maxLength: 256 diff --git a/server/api/swagger/swagger.js b/server/api/swagger/swagger.js index 0811ec54af..f8496ed2da 100644 --- a/server/api/swagger/swagger.js +++ b/server/api/swagger/swagger.js @@ -4,7 +4,7 @@ const definition = { swagger: '2.0', info: { title: 'HollaEx Kit', - version: '2.6.4' + version: '2.6.5' }, host: 'api.hollaex.com', basePath: '/v2', diff --git a/server/package.json b/server/package.json index 6499feae3e..51e5e03167 100644 --- a/server/package.json +++ b/server/package.json @@ -1,5 +1,5 @@ { - "version": "2.6.4", + "version": "2.6.5", "private": false, "description": "HollaEx Kit", "keywords": [ diff --git a/templates/local/nginx/nginx.conf b/templates/local/nginx/nginx.conf index 0345f411da..d11e876781 100644 --- a/templates/local/nginx/nginx.conf +++ b/templates/local/nginx/nginx.conf @@ -10,6 +10,14 @@ events { } http { + gzip on; + gzip_comp_level 6; + gzip_min_length 500; + gzip_buffers 16 8k; + gzip_proxied any; + gzip_vary on; + gzip_types text/plain text/css application/json application/x-javascript application/javascript text/xml application/xml application/rss+xml text/javascript image/svg+xml application/vnd.ms-fo + include /etc/nginx/mime.types; include /etc/nginx/proxy.conf; include /etc/nginx/conf.d/upstream*.conf; diff --git a/version b/version index e46a05b196..68167133b9 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.6.4 \ No newline at end of file +2.6.5 \ No newline at end of file diff --git a/web/package-lock.json b/web/package-lock.json index 7e5d7f3080..00d18238f1 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1,6 +1,6 @@ { "name": "hollaex-kit", - "version": "2.6.4", + "version": "2.6.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/web/package.json b/web/package.json index 1687c058f0..6ae9da121f 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "hollaex-kit", - "version": "2.6.4", + "version": "2.6.5", "private": true, "dependencies": { "@ant-design/compatible": "1.0.5", diff --git a/web/src/components/Form/FormFields/FieldWrapper.js b/web/src/components/Form/FormFields/FieldWrapper.js index e568af59b6..21c97ae5eb 100644 --- a/web/src/components/Form/FormFields/FieldWrapper.js +++ b/web/src/components/Form/FormFields/FieldWrapper.js @@ -14,22 +14,21 @@ const Warning = ({ text, className = '' }) => ( ); -const renderWarning = (warning) => { - if (warning) { - if (Array.isArray(warning)) { - return ( -
- {warning.map((msg, index) => ( - - ))} -
- ); - } else { - return ; - } +const WarningContainer = ({ warning, warnings }) => { + if (warnings && Array.isArray(warnings)) { + return ( +
+ {warnings.map((msg, index) => ( + + ))} +
+ ); + } else if (warning) { + return ; } else { return null; } @@ -53,6 +52,7 @@ export const FieldContent = ({ ishorizontalfield = false, dateFieldClassName, warning, + warnings, preview, isEmail, emailMsg, @@ -68,10 +68,14 @@ export const FieldContent = ({ ) : ( label )} - {renderWarning(warning)} + )} - +
{ const { coins, exchange } = this.state; this.setState({ submitting: true }); + const pairedCoins = exchange.pairs.filter((data) => { + let pairData = data.split('-'); + return pairData[0] === symbol || pairData[1] === symbol; + }); try { let formProps = { id: exchange.id, coins: coins .filter((data) => data.symbol !== symbol) .map((data) => data.symbol), - pairs: exchange.pairs.filter((data) => { + }; + if (pairedCoins.length) { + formProps.pairs = exchange.pairs.filter((data) => { let pairData = data.split('-'); return pairData[0] !== symbol && pairData[1] !== symbol; - }), - }; + }); + } await updateExchange(formProps); await this.getMyExchange(); await this.getCoins(); diff --git a/web/src/containers/Admin/Deposits/utils.js b/web/src/containers/Admin/Deposits/utils.js index 1d0c6e6b53..53b9da7d26 100644 --- a/web/src/containers/Admin/Deposits/utils.js +++ b/web/src/containers/Admin/Deposits/utils.js @@ -9,7 +9,6 @@ import { import { Button, Tooltip } from 'antd'; import { Link } from 'react-router'; import { isSupport } from 'utils/token'; -import { formatCurrencyByIncrementalUnit } from 'utils/currency'; import { formatDate } from 'utils'; /*export const renderBoolean = (value) => ( @@ -234,20 +233,10 @@ export const renderRowContent = ({ return (
- Amount:{' '} - {formatCurrencyByIncrementalUnit( - amount, - coins?.[currency?.toLocaleLowerCase()]?.increment_unit - )}{' '} - {currency} + Amount: {amount} {currency}
- Fee:{' '} - {formatCurrencyByIncrementalUnit( - fee, - coins?.[fee_coin?.toLocaleLowerCase()]?.increment_unit - )}{' '} - {fee_coin} + Fee: {fee} {fee_coin}
{address &&
Address: {address}
}
Timestamp: {formatDate(created_at)}
diff --git a/web/src/containers/Deposit/utils.js b/web/src/containers/Deposit/utils.js index def5da7fd8..5ae44020ec 100644 --- a/web/src/containers/Deposit/utils.js +++ b/web/src/containers/Deposit/utils.js @@ -47,9 +47,9 @@ export const generateFormFields = ({ })); const { min } = coins[currency]; - const warning = [STRINGS['DEPOSIT_FORM_NETWORK_WARNING']]; + const warnings = [STRINGS['DEPOSIT_FORM_NETWORK_WARNING']]; if (min) { - warning.push( + warnings.push( STRINGS.formatString( STRINGS['DEPOSIT_FORM_MIN_WARNING'], min, @@ -64,7 +64,7 @@ export const generateFormFields = ({ 'WITHDRAWALS_FORM_NETWORK_LABEL,WITHDRAWALS_FORM_NETWORK_PLACEHOLDER,DEPOSIT_FORM_NETWORK_WARNING,DEPOSIT_FORM_MIN_WARNING', label: STRINGS['WITHDRAWALS_FORM_NETWORK_LABEL'], placeholder: STRINGS['WITHDRAWALS_FORM_NETWORK_PLACEHOLDER'], - warning, + warnings, validate: [required], fullWidth: true, options: networkOptions,