From dcb57fb7fbd0b280e89d0aa0d8a9fe40b69ca5f5 Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Mon, 22 Feb 2021 18:33:03 +0900 Subject: [PATCH 01/10] 404 Page for root '/' URL. --- templates/local/nginx/nginx.conf | 10 ++++++++-- templates/local/nginx/static/404-nodomain.html | 12 ++++++++++++ templates/local/nginx/static/404.html | 6 +++--- 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 templates/local/nginx/static/404-nodomain.html diff --git a/templates/local/nginx/nginx.conf b/templates/local/nginx/nginx.conf index 0f063bf502..2ed6606e3d 100644 --- a/templates/local/nginx/nginx.conf +++ b/templates/local/nginx/nginx.conf @@ -27,8 +27,8 @@ server { listen 80 default_server; server_name _; - error_page 404 /404.html; - location = /404.html { + error_page 404 /404-nodomain.html; + location = /404-nodomain.html { root /usr/share/nginx/html; internal; } @@ -78,6 +78,12 @@ server { proxy_pass http://plugins; } + error_page 404 /404.html; + location = /404.html { + root /usr/share/nginx/html; + internal; + } + error_page 429 /429.html; location = /429.html { root /usr/share/nginx/html; diff --git a/templates/local/nginx/static/404-nodomain.html b/templates/local/nginx/static/404-nodomain.html new file mode 100644 index 0000000000..9a1155ef2b --- /dev/null +++ b/templates/local/nginx/static/404-nodomain.html @@ -0,0 +1,12 @@ + + + 404 Not found + + +

404 There is nothing here!

+

If you are an exchange administrator, and facing this page after the initial setup, You probably missed to setup domain(s) for the exchange.

+

If you haven't bind domain(s) for the exchange yet, please run 'hollaex prod' command to do so.

+

Please visit docs.hollaex.com to see guides, forum.hollaex.com to get further help.

+

Regards, HollaEx Team.

+ + diff --git a/templates/local/nginx/static/404.html b/templates/local/nginx/static/404.html index 12cd989043..ec4bf6312c 100644 --- a/templates/local/nginx/static/404.html +++ b/templates/local/nginx/static/404.html @@ -4,9 +4,9 @@

404 There is nothing here!

-

If you are an exchange administrator, and facing this page after the initial setup, You probably missed to setup domain(s) for the exchange.

-

If you haven't bind domain(s) for the exchange yet, please run 'hollaex prod' command to do so.

-

Please visit docs.bitholla.com (docs.bitholla.com/hollaex-kit/get-started/setup#opening-the-exchange-to-the-internet) to see guides, forum.bitholla.com to get further help.

+

To view the API health, visit Health Page.

+

To view the API explorer, visit Explorer Page.

+

Please visit docs.hollaex.com to see guides, forum.hollaex.com to get further help.

Regards, HollaEx Team.

From 2c166ecd0e2b7cd80a8aa2e6f0322693e680a607 Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Mon, 22 Feb 2021 18:50:14 +0900 Subject: [PATCH 02/10] Added /explorer path support --- templates/local/nginx/nginx.conf | 4 ++++ templates/local/nginx/static/404.html | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/local/nginx/nginx.conf b/templates/local/nginx/nginx.conf index 2ed6606e3d..927901ddea 100644 --- a/templates/local/nginx/nginx.conf +++ b/templates/local/nginx/nginx.conf @@ -66,6 +66,10 @@ server { proxy_pass http://api; } + location /explorer { + proxy_pass http://api; + } + location /stream { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; diff --git a/templates/local/nginx/static/404.html b/templates/local/nginx/static/404.html index ec4bf6312c..0efd625d27 100644 --- a/templates/local/nginx/static/404.html +++ b/templates/local/nginx/static/404.html @@ -4,8 +4,8 @@

404 There is nothing here!

-

To view the API health, visit Health Page.

-

To view the API explorer, visit Explorer Page.

+

To view the API health, visit Health Page.

+

To view the API explorer, visit Explorer Page.

Please visit docs.hollaex.com to see guides, forum.hollaex.com to get further help.

Regards, HollaEx Team.

From 9e416810e3cd7d67160fae2259ba27f72e94d0ce Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Tue, 23 Feb 2021 07:53:50 +0330 Subject: [PATCH 03/10] update package.json --- web/package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/package-lock.json b/web/package-lock.json index 059faa05f6..d1a0ab1867 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1,6 +1,6 @@ { "name": "hollaex-kit", - "version": "2.0.4", + "version": "2.0.6", "lockfileVersion": 1, "requires": true, "dependencies": { From 58f040d11d1531514bf99e559a2d5f1b4fe58ebb Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Tue, 23 Feb 2021 07:54:37 +0330 Subject: [PATCH 04/10] changes for ESLint warnings for unused variables --- web/src/containers/Admin/Wallets/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/src/containers/Admin/Wallets/index.js b/web/src/containers/Admin/Wallets/index.js index 722c1bb34d..0f9a123d3a 100644 --- a/web/src/containers/Admin/Wallets/index.js +++ b/web/src/containers/Admin/Wallets/index.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Spin, Button, Tag, Card, Alert } from 'antd'; +import { Spin, Card, Alert } from 'antd'; import { connect } from 'react-redux'; import { ReactSVG } from 'react-svg'; @@ -71,7 +71,6 @@ class Wallets extends Component { render() { const { balance, loading, error } = this.state; - const { plugins = { enabled: '' } } = this.state.constants; return (
{error && ( From 9f3d34375fd349cd53405969c895c08d02672509 Mon Sep 17 00:00:00 2001 From: Brandon Kim Date: Tue, 23 Feb 2021 14:09:16 +0900 Subject: [PATCH 05/10] admin/check-transaction => user/check-transaction --- server/api/controllers/admin.js | 28 +--------------------------- server/api/controllers/user.js | 28 +++++++++++++++++++++++++++- server/api/swagger/swagger.yaml | 16 ++++++++-------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/server/api/controllers/admin.js b/server/api/controllers/admin.js index 16089ac578..86647125bb 100644 --- a/server/api/controllers/admin.js +++ b/server/api/controllers/admin.js @@ -465,7 +465,7 @@ const transferFund = (req, res) => { const data = req.swagger.params.data.value; - toolsLib.wallet.transferAssetByKitIds(data.sender_id, data.receiver_id, data.currency, data.amount) + toolsLib.wallet.transferAssetByKitIds(data.sender_id, data.receiver_id, data.currency, data.amount, { email: data.email, description: data.description }) .then(() => { return res.json({ message: 'Success' }); }) @@ -479,31 +479,6 @@ const transferFund = (req, res) => { }); }; -const adminCheckTransaction = (req, res) => { - loggerAdmin.verbose( - req.uuid, - 'controllers/admin/adminCheckTransaction auth', - req.auth - ); - const transactionId = req.swagger.params.transaction_id.value; - const address = req.swagger.params.address.value; - const currency = req.swagger.params.currency.value; - const isTestnet = req.swagger.params.is_testnet.value; - - toolsLib.wallet.checkTransaction(currency, transactionId, address, isTestnet) - .then((transaction) => { - return res.json({ message: 'Success', transaction }); - }) - .catch((err) => { - loggerAdmin.error( - req.uuid, - 'controllers/admin/adminCheckTransaction catch', - err.message - ); - return res.status(err.status || 400).json({ message: err.message }); - }); -}; - const completeExchangeSetup = (req, res) => { loggerAdmin.verbose( req.uuid, @@ -719,7 +694,6 @@ module.exports = { getCoins, getPairs, transferFund, - adminCheckTransaction, completeExchangeSetup, putNetworkCredentials, uploadImage, diff --git a/server/api/controllers/user.js b/server/api/controllers/user.js index 092beb594e..f3ebd7ed90 100644 --- a/server/api/controllers/user.js +++ b/server/api/controllers/user.js @@ -636,6 +636,31 @@ const getUserStats = (req, res) => { }); }; +const userCheckTransaction = (req, res) => { + loggerUser.verbose( + req.uuid, + 'controllers/user/userCheckTransaction auth', + req.auth + ); + const transactionId = req.swagger.params.transaction_id.value; + const address = req.swagger.params.address.value; + const currency = req.swagger.params.currency.value; + const isTestnet = req.swagger.params.is_testnet.value; + + toolsLib.wallet.checkTransaction(currency, transactionId, address, isTestnet) + .then((transaction) => { + return res.json({ message: 'Success', transaction }); + }) + .catch((err) => { + loggerUser.error( + req.uuid, + 'controllers/user/userCheckTransaction catch', + err.message + ); + return res.status(err.status || 400).json({ message: err.message }); + }); +}; + module.exports = { signUpUser, getVerifyUser, @@ -656,5 +681,6 @@ module.exports = { getHmacToken, createHmacToken, deleteHmacToken, - getUserStats + getUserStats, + userCheckTransaction }; diff --git a/server/api/swagger/swagger.yaml b/server/api/swagger/swagger.yaml index 8388ede018..13b28fe609 100644 --- a/server/api/swagger/swagger.yaml +++ b/server/api/swagger/swagger.yaml @@ -2189,13 +2189,14 @@ paths: - Bearer: [] x-security-scopes: - admin - /admin/check-transaction: - x-swagger-router-controller: admin + /user/check-transaction: + x-swagger-router-controller: user get: - operationId: adminCheckTransaction + operationId: userCheckTransaction description: Check a blockchain transaction to add create/update deposit tags: - - Admin + - User + - Wallet parameters: - in: query name: currency @@ -2230,10 +2231,7 @@ paths: security: - Bearer: [] x-security-scopes: - - admin - - supervisor - - support - - kyc + - user /admin/users: x-swagger-router-controller: admin get: @@ -4055,6 +4053,8 @@ definitions: amount: type: number format: double + email: + type: boolean ExternalDepositRequest: type: object required: From b0549f04c82a13002a77adcc788dac8c4d423e65 Mon Sep 17 00:00:00 2001 From: Brandon Kim Date: Tue, 23 Feb 2021 15:49:12 +0900 Subject: [PATCH 06/10] non breaking update --- server/api/controllers/admin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/controllers/admin.js b/server/api/controllers/admin.js index 86647125bb..2abc303734 100644 --- a/server/api/controllers/admin.js +++ b/server/api/controllers/admin.js @@ -465,7 +465,7 @@ const transferFund = (req, res) => { const data = req.swagger.params.data.value; - toolsLib.wallet.transferAssetByKitIds(data.sender_id, data.receiver_id, data.currency, data.amount, { email: data.email, description: data.description }) + toolsLib.wallet.transferAssetByKitIds(data.sender_id, data.receiver_id, data.currency, data.amount, data.description, data.email) .then(() => { return res.json({ message: 'Success' }); }) From 75e30a3e969335a3a3db431afbaf815333c12688 Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Tue, 23 Feb 2021 16:46:02 +0900 Subject: [PATCH 07/10] stellar based chain deposit/withdrawal --- web/src/containers/Deposit/utils.js | 4 ++-- web/src/containers/Withdraw/formUtils.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/containers/Deposit/utils.js b/web/src/containers/Deposit/utils.js index 387efbf7bf..860153a5c5 100644 --- a/web/src/containers/Deposit/utils.js +++ b/web/src/containers/Deposit/utils.js @@ -84,13 +84,13 @@ export const renderContent = ( const { fullname } = coins[symbol] || DEFAULT_COIN_DATA; let address = crypto_wallet[symbol]; let destinationAddress = ''; - if (symbol === 'xrp' || symbol === 'xlm') { + if (symbol === 'xrp' || symbol === 'xlm' || coins[symbol].network === 'stellar') { const temp = address.split(':'); address = temp[0] ? temp[0] : address; destinationAddress = temp[1] ? temp[1] : ''; } const additionalText = - symbol === 'xlm' + symbol === 'xlm' || coins[symbol].network === 'stellar' ? STRINGS['DEPOSIT.CRYPTO_LABELS.MEMO'] : STRINGS['DEPOSIT.CRYPTO_LABELS.DESTINATION_TAG']; diff --git a/web/src/containers/Withdraw/formUtils.js b/web/src/containers/Withdraw/formUtils.js index 0ec7e9d2d9..d89e74feef 100644 --- a/web/src/containers/Withdraw/formUtils.js +++ b/web/src/containers/Withdraw/formUtils.js @@ -71,7 +71,7 @@ export const generateFormValues = ( placeholder: STRINGS['WITHDRAWALS_FORM_DESTINATION_TAG_PLACEHOLDER'], fullWidth: true, }; - } else if (symbol === 'xlm') { + } else if (symbol === 'xlm' || coins[symbol].network === 'stellar') { fields.destination_tag = { type: 'text', stringId: From 1d0d617c4f87745b567b93150c18918f34e4c6dd Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Tue, 23 Feb 2021 17:03:49 +0900 Subject: [PATCH 08/10] version update --- server/api/swagger/swagger.yaml | 2 +- server/package.json | 2 +- version | 2 +- web/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/api/swagger/swagger.yaml b/server/api/swagger/swagger.yaml index 8388ede018..e663bb09e4 100644 --- a/server/api/swagger/swagger.yaml +++ b/server/api/swagger/swagger.yaml @@ -1,6 +1,6 @@ swagger: "2.0" info: - version: "2.0.6" + version: "2.0.7" title: HollaEx Kit host: api.hollaex.com basePath: /v2 diff --git a/server/package.json b/server/package.json index b6390abe4f..1e608e9766 100644 --- a/server/package.json +++ b/server/package.json @@ -1,5 +1,5 @@ { - "version": "2.0.6", + "version": "2.0.7", "private": false, "description": "HollaEx Kit", "keywords": [ diff --git a/version b/version index 703cec9e23..6a0ca2d59d 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.0.6 \ No newline at end of file +2.0.7 \ No newline at end of file diff --git a/web/package.json b/web/package.json index 1b1eeebc64..24f2ea4ad9 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "hollaex-kit", - "version": "2.0.6", + "version": "2.0.7", "private": true, "dependencies": { "@ant-design/compatible": "1.0.5", From 13846ba37a678735f3c0bb7016480d8dc423284e Mon Sep 17 00:00:00 2001 From: Alireza Beikverdi Date: Tue, 23 Feb 2021 17:14:44 +0900 Subject: [PATCH 09/10] Update README.md --- README.md | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 299554d0cf..a813965cc5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # HollaEx Kit [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://github.com/facebook/create-react-app/pulls) -HollaEx Kit is an open source crypto exchange software that can be utilized to onboard your users and traders in order to run your white label exchange. In order to run the HollaEx Kit, you need to run HollaEx Server as the back-end and Web as your front-end user interface. HollaEx Kit automatically then connects to HollaEx Network where you have access to markets and liquidity for different digital assets. +HollaEx Kit is an open source crypto exchange software that can be utilized to onboard your users and traders in order to run your white label exchange. In order to run the HollaEx Kit, you need to run HollaEx Server as the back-end and Web as your front-end user interface. HollaEx Kit automatically then connects to HollaEx Network for asset where you have access to markets and liquidity as well as wallets for different digital assets. ## Get Started @@ -10,20 +10,20 @@ git clone https://github.com/bitholla/hollaex-kit.git bash install.sh ``` -Read more on our [Docs](https://docs.bitholla.com/hollaex-kit/get-started)! +Read more on our [Docs](https://docs.hollaex.com)! ## Developers -Checkout Web for the front-end UI/UX modifications. +Checkout [Web](https://github.com/bitholla/hollaex-kit/tree/master/web) for the front-end UI/UX modifications. -Check out Server for back-end and server side operations and endpoints. +Check out [Server](https://github.com/bitholla/hollaex-kit/tree/master/server) for back-end and server side operations and endpoints. -Check out Plugins for developing seamless and flexible custom services that can be added to the HollaEx Kit. +Check out [Plugins](https://github.com/bitholla/hollaex-kit/tree/2.0-develop/server#plugins) for developing seamless and flexible custom services that can be added to the HollaEx Kit. -Check out HollaEx CLI (Command Line Interface) for interacting and deploying your exchange. +Check out [HollaEx CLI](https://github.com/bitholla/hollaex-cli) (Command Line Interface) for interacting and deploying your exchange. ## Community -Join us on the [Forum](https://forum.bitholla.com) and feel free to raise any topic and ask questions from our active community. +Join us on the [Forum](https://forum.hollaex.com) and feel free to raise any topic and ask questions from our active community. [![alt text][1.2]][1] @@ -46,11 +46,6 @@ Join us on the [Forum](https://forum.bitholla.com) and feel free to raise any to ## Useful Resources -- bitHolla Site: https://bitholla.com - Exchange Dashboard: https://dash.bitholla.com -- Documentation: https://docs.bitholla.com -- Forum: https://forum.bitholla.com -- HollaEx CLI (Command Line Interface): https://github.com/bitholla/hollaex-cli -- Vault API Explorer: https://api.bitholla.com/docs - HollaEx Whitepaper: https://hollaex.com/docs/whitepaper.html - HollaEx Official Marketplace: https://hollaex.com From 5e5614e820580f3f04adf9c8c95125cb9ee09579 Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Wed, 24 Feb 2021 12:02:46 +0330 Subject: [PATCH 10/10] changes for cached images issue --- web/src/containers/Admin/General/index.js | 3 ++- web/src/containers/Admin/Tiers/ModalForm.js | 3 ++- .../containers/OperatorControls/components/AllIconsModal.js | 3 ++- web/src/containers/OperatorControls/components/UploadIcon.js | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/web/src/containers/Admin/General/index.js b/web/src/containers/Admin/General/index.js index e97016d400..10f12f824b 100644 --- a/web/src/containers/Admin/General/index.js +++ b/web/src/containers/Admin/General/index.js @@ -134,8 +134,9 @@ class General extends Component { if (file) { const formData = new FormData(); const { name: fileName } = file; + const uniqueId = Date.now(); const extension = fileName.split('.').pop(); - const name = `${key}__${themeKey}.${extension}`; + const name = `${key}__${themeKey}___${uniqueId}.${extension}`; formData.append('name', name); formData.append('file', file); diff --git a/web/src/containers/Admin/Tiers/ModalForm.js b/web/src/containers/Admin/Tiers/ModalForm.js index a017bc312f..849210f7b7 100644 --- a/web/src/containers/Admin/Tiers/ModalForm.js +++ b/web/src/containers/Admin/Tiers/ModalForm.js @@ -201,8 +201,9 @@ class NewTierForm extends Component { if (file) { const formData = new FormData(); const { name: fileName } = file; + const uniqueId = Date.now(); const extension = fileName.split('.').pop(); - const name = `${key}__${themeKey}.${extension}`; + const name = `${key}__${themeKey}___${uniqueId}.${extension}`; formData.append('name', name); formData.append('file', file); diff --git a/web/src/containers/OperatorControls/components/AllIconsModal.js b/web/src/containers/OperatorControls/components/AllIconsModal.js index b0c6c514c6..c18b261950 100644 --- a/web/src/containers/OperatorControls/components/AllIconsModal.js +++ b/web/src/containers/OperatorControls/components/AllIconsModal.js @@ -110,8 +110,9 @@ class AllIconsModal extends Component { if (file) { const formData = new FormData(); const { name: fileName } = file; + const uniqueId = Date.now(); const extension = fileName.split('.').pop(); - const name = `${key}__${themeKey}.${extension}`; + const name = `${key}__${themeKey}___${uniqueId}.${extension}`; formData.append('name', name); formData.append('file', file); diff --git a/web/src/containers/OperatorControls/components/UploadIcon.js b/web/src/containers/OperatorControls/components/UploadIcon.js index 2d70273d3f..e68455db0f 100644 --- a/web/src/containers/OperatorControls/components/UploadIcon.js +++ b/web/src/containers/OperatorControls/components/UploadIcon.js @@ -57,8 +57,9 @@ class UploadIcon extends Component { if (file) { const formData = new FormData(); const { name: fileName } = file; + const uniqueId = Date.now(); const extension = fileName.split('.').pop(); - const name = `${key}__${themeKey}.${extension}`; + const name = `${key}__${themeKey}___${uniqueId}.${extension}`; formData.append('name', name); formData.append('file', file);