From 54a4c9ef22bde1b5745be75e7382e07a4b7e0a82 Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Fri, 11 Feb 2022 12:24:47 +0900 Subject: [PATCH 1/7] network lib readme and example updated --- server/utils/hollaex-network-lib/README.md | 2 +- .../hollaex-network-lib/example/hollaex.js | 70 +++++++------------ server/utils/hollaex-network-lib/package.json | 4 +- 3 files changed, 30 insertions(+), 46 deletions(-) diff --git a/server/utils/hollaex-network-lib/README.md b/server/utils/hollaex-network-lib/README.md index 99031ad0d5..7cc193693b 100644 --- a/server/utils/hollaex-network-lib/README.md +++ b/server/utils/hollaex-network-lib/README.md @@ -5,7 +5,7 @@ Nodejs library for operators of HollaEx Kit enabled exchanges to connect to the ## Usage ```javascript -const { Network } = require('hollaex-node-lib'); +const Network = require('hollaex-network-lib'); const client = new Network({ apiKey: '', diff --git a/server/utils/hollaex-network-lib/example/hollaex.js b/server/utils/hollaex-network-lib/example/hollaex.js index eda6da6794..305731ffbd 100644 --- a/server/utils/hollaex-network-lib/example/hollaex.js +++ b/server/utils/hollaex-network-lib/example/hollaex.js @@ -1,45 +1,29 @@ -const HollaEx = require('../index'); -require('dotenv').load(); - -const API_KEY = process.env.API_KEY || ''; -const API_SECRET = process.env.API_SECRET || ''; -const client = new HollaEx({ apiKey: API_KEY, apiSecret: API_SECRET }); - -client - .getTicker('xht-usdt') - .then((res) => { - let data = JSON.parse(res); - console.log('The volume is', data.volume); - }) - .catch((err) => { - console.log(err); - }); - -// connect to websocket -/* - events (emitted) : trades (trades), orderbook (orderbook), user (userInfo, userWallet, userOrder, userTrades, userUpdate), all - - symbols : xht-usdt -*/ - -const socket1 = client.connect('trades:xht-usdt'); - -socket1.on('trades', (data) => { - console.log(data); +const Network = require('./index'); + +const network = new Network({ + apiUrl: 'https://api.hollaex.network', + apiKey: '', + apiSecret: '', + activation_code: '', + exchange_id: 1 }); -const socket2 = client.connect('all'); - -socket2.on('orderbook', (data) => { - console.log(data); -}); - -// You have to use a token to use these otherwise the socket disconnects -socket2.on('userInfo', (data) => { - console.log(data); -}); - - -setTimeout(() => { - socket2.disconnect(); -}, 5000); \ No newline at end of file +(async () => { + try { + const init = await network.init(); + console.log(init); + console.log(network.exchange_id) + + console.log('connecting to websocket') + network.connect(['orderbook:xht-usdt']); + network.ws.on('message', (data) => { + console.log(data) + }) + + } catch (err) { + console.log(err) + } + + + +}) (); \ No newline at end of file diff --git a/server/utils/hollaex-network-lib/package.json b/server/utils/hollaex-network-lib/package.json index a2de846891..fd5412c873 100644 --- a/server/utils/hollaex-network-lib/package.json +++ b/server/utils/hollaex-network-lib/package.json @@ -1,7 +1,7 @@ { "name": "hollaex-network-lib", "version": "2.11.0", - "description": "hollaex api and websocket library for nodejs", + "description": "hollaex network api and websocket library for nodejs", "main": "index.js", "dependencies": { "file-type": "16.5.2", @@ -24,7 +24,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/bitholla/hollaex-node-lib" + "url": "https://github.com/bitholla/hollaex-kit/tree/master/server/utils/hollaex-network-lib" }, "author": "bitHolla Inc", "license": "MIT" From 36088a1fe51cacca5bf77983f4dbb18019d384fb Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Fri, 11 Feb 2022 12:31:41 +0900 Subject: [PATCH 2/7] syncing version of network lib with kit --- server/utils/hollaex-network-lib/LICENSE | 21 ------------------- server/utils/hollaex-network-lib/package.json | 2 +- 2 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 server/utils/hollaex-network-lib/LICENSE diff --git a/server/utils/hollaex-network-lib/LICENSE b/server/utils/hollaex-network-lib/LICENSE deleted file mode 100644 index 6171c310f7..0000000000 --- a/server/utils/hollaex-network-lib/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 bitHolla - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/server/utils/hollaex-network-lib/package.json b/server/utils/hollaex-network-lib/package.json index fd5412c873..13fa68f92a 100644 --- a/server/utils/hollaex-network-lib/package.json +++ b/server/utils/hollaex-network-lib/package.json @@ -1,6 +1,6 @@ { "name": "hollaex-network-lib", - "version": "2.11.0", + "version": "2.2.8", "description": "hollaex network api and websocket library for nodejs", "main": "index.js", "dependencies": { From a696da6ea467b234694b6e90e4b635bbf2efa7e9 Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Fri, 11 Feb 2022 12:32:37 +0900 Subject: [PATCH 3/7] syncing tools lib with kit --- server/utils/hollaex-tools-lib/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/utils/hollaex-tools-lib/package.json b/server/utils/hollaex-tools-lib/package.json index f0f2b19aba..e6b3a246fd 100644 --- a/server/utils/hollaex-tools-lib/package.json +++ b/server/utils/hollaex-tools-lib/package.json @@ -1,6 +1,6 @@ { "name": "hollaex-tools-lib", - "version": "2.15.0", + "version": "2.2.8", "description": "HollaEx tools library for developers", "main": "index.js", "scripts": { From c43731303b13731b374df7f590b98e83d548a1c2 Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Fri, 11 Feb 2022 12:33:53 +0900 Subject: [PATCH 4/7] tools and network package.json cleanup --- server/utils/hollaex-network-lib/package.json | 3 +-- server/utils/hollaex-tools-lib/package.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/server/utils/hollaex-network-lib/package.json b/server/utils/hollaex-network-lib/package.json index 13fa68f92a..cd07bf7629 100644 --- a/server/utils/hollaex-network-lib/package.json +++ b/server/utils/hollaex-network-lib/package.json @@ -26,6 +26,5 @@ "type": "git", "url": "https://github.com/bitholla/hollaex-kit/tree/master/server/utils/hollaex-network-lib" }, - "author": "bitHolla Inc", - "license": "MIT" + "author": "bitHolla Inc" } diff --git a/server/utils/hollaex-tools-lib/package.json b/server/utils/hollaex-tools-lib/package.json index e6b3a246fd..d2f75ef6ee 100644 --- a/server/utils/hollaex-tools-lib/package.json +++ b/server/utils/hollaex-tools-lib/package.json @@ -7,10 +7,9 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "author": "bitHolla Inc", - "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/bitholla/hollaex-tools-lib" + "url": "https://github.com/bitholla/hollaex-kit/tree/master/server/utils/hollaex-tools-lib" }, "dependencies": {} } From 5cececc804d8622f3cf63c77b58f1f914c2d5901 Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Fri, 11 Feb 2022 12:34:44 +0900 Subject: [PATCH 5/7] removed license from tools --- server/utils/hollaex-tools-lib/LICENSE | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 server/utils/hollaex-tools-lib/LICENSE diff --git a/server/utils/hollaex-tools-lib/LICENSE b/server/utils/hollaex-tools-lib/LICENSE deleted file mode 100644 index 6171c310f7..0000000000 --- a/server/utils/hollaex-tools-lib/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 bitHolla - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. From 0a840f9a02bb6969ad6ad0fea10530c2afe29265 Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Thu, 3 Feb 2022 17:26:26 +0330 Subject: [PATCH 6/7] crypto wallet placeholders (cherry picked from commit 00bc41f) --- web/src/containers/Deposit/utils.js | 14 ++-- web/src/containers/Withdraw/form.js | 104 +++++++++++++++------------- 2 files changed, 64 insertions(+), 54 deletions(-) diff --git a/web/src/containers/Deposit/utils.js b/web/src/containers/Deposit/utils.js index d17f2ceccc..c9f5486c83 100644 --- a/web/src/containers/Deposit/utils.js +++ b/web/src/containers/Deposit/utils.js @@ -1,10 +1,10 @@ -import React, { Fragment } from 'react'; +import React from 'react'; import { connect } from 'react-redux'; import { reduxForm } from 'redux-form'; import QRCode from 'qrcode.react'; import { ExclamationCircleFilled } from '@ant-design/icons'; -import STRINGS from '../../config/localizedStrings'; -import { EditWrapper, Button } from 'components'; +import STRINGS from 'config/localizedStrings'; +import { EditWrapper, Button, SmartTarget } from 'components'; import { CopyToClipboard } from 'react-copy-to-clipboard'; import { required } from 'components/Form/validations'; import { getNetworkLabelByKey } from 'utils/wallet'; @@ -111,7 +111,11 @@ const RenderContentForm = ({ if (coinObject && coinObject.type !== 'fiat') { return ( - +
)}
- + ); } else if (coinObject && coinObject.type === 'fiat') { return ( diff --git a/web/src/containers/Withdraw/form.js b/web/src/containers/Withdraw/form.js index f615682e1d..7a3c20d69a 100644 --- a/web/src/containers/Withdraw/form.js +++ b/web/src/containers/Withdraw/form.js @@ -11,17 +11,17 @@ import { import math from 'mathjs'; // import classnames from 'classnames'; // import { isMobile } from 'react-device-detect'; -import { Button, Dialog, OtpForm, Loader } from '../../components'; -import renderFields from '../../components/Form/factoryFields'; +import { Button, Dialog, OtpForm, Loader, SmartTarget } from 'components'; +import renderFields from 'components/Form/factoryFields'; import { setWithdrawEmailConfirmation, setWithdrawNotificationError, } from './notifications'; -import { BASE_CURRENCY } from '../../config/constants'; +import { BASE_CURRENCY } from 'config/constants'; import { calculateBaseFee } from './utils'; import Fiat from 'containers/Deposit/Fiat'; import Image from 'components/Image'; -import STRINGS from '../../config/localizedStrings'; +import STRINGS from 'config/localizedStrings'; import ReviewModalContent from './ReviewModalContent'; @@ -212,53 +212,59 @@ class Form extends Component { if (coinObject && coinObject.type !== 'fiat') { return ( -
-
- - {titleSection} - {renderFields(formValues)} - {error &&
{error}
} -
-
-
- - {dialogOtpOpen ? ( - + +
+ - ) : !submitting ? ( - {error}
} +
+
+
+ + {dialogOtpOpen ? ( + + ) : !submitting ? ( + + ) : ( + + )} + + +
); } else if (coinObject && coinObject.type === 'fiat') { return ( From 534312cfb26140419bd7973d5bd226d5bf10e8d4 Mon Sep 17 00:00:00 2001 From: Amir Hossein Salar Date: Fri, 11 Feb 2022 14:51:41 +0330 Subject: [PATCH 7/7] update package-lock.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 d48c856786..200c27dd5f 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1,6 +1,6 @@ { "name": "hollaex-kit", - "version": "2.2.7", + "version": "2.2.9", "lockfileVersion": 1, "requires": true, "dependencies": {