Skip to content

Commit

Permalink
Merge pull request #1190 from bitholla/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
abeikverdi committed Feb 14, 2022
2 parents 401b5e6 + ca75127 commit 3b4eece
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 149 deletions.
21 changes: 0 additions & 21 deletions server/utils/hollaex-network-lib/LICENSE

This file was deleted.

2 changes: 1 addition & 1 deletion server/utils/hollaex-network-lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: '<MY_API_KEY>',
Expand Down
70 changes: 27 additions & 43 deletions server/utils/hollaex-network-lib/example/hollaex.js
Original file line number Diff line number Diff line change
@@ -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);
(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)
}



}) ();
9 changes: 4 additions & 5 deletions server/utils/hollaex-network-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hollaex-network-lib",
"version": "2.11.0",
"description": "hollaex api and websocket library for nodejs",
"version": "2.2.8",
"description": "hollaex network api and websocket library for nodejs",
"main": "index.js",
"dependencies": {
"file-type": "16.5.2",
Expand All @@ -24,8 +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"
"author": "bitHolla Inc"
}
21 changes: 0 additions & 21 deletions server/utils/hollaex-tools-lib/LICENSE

This file was deleted.

5 changes: 2 additions & 3 deletions server/utils/hollaex-tools-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"name": "hollaex-tools-lib",
"version": "2.15.0",
"version": "2.2.8",
"description": "HollaEx tools library for developers",
"main": "index.js",
"scripts": {
"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": {}
}
2 changes: 1 addition & 1 deletion web/package-lock.json

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

14 changes: 9 additions & 5 deletions web/src/containers/Deposit/utils.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -111,7 +111,11 @@ const RenderContentForm = ({

if (coinObject && coinObject.type !== 'fiat') {
return (
<Fragment>
<SmartTarget
id={currencySpecificId}
titleSection={titleSection}
currency={currency}
>
<div className="withdraw-form-wrapper">
<div className="withdraw-form">
<Image
Expand Down Expand Up @@ -171,7 +175,7 @@ const RenderContentForm = ({
</div>
)}
</div>
</Fragment>
</SmartTarget>
);
} else if (coinObject && coinObject.type === 'fiat') {
return (
Expand Down
104 changes: 55 additions & 49 deletions web/src/containers/Withdraw/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -212,53 +212,59 @@ class Form extends Component {

if (coinObject && coinObject.type !== 'fiat') {
return (
<form autoComplete="off" className="withdraw-form-wrapper">
<div className="withdraw-form">
<Image
iconId={`${currency.toUpperCase()}_ICON`}
icon={ICONS[`${currency.toUpperCase()}_ICON`]}
wrapperClassName="form_currency-ball"
/>
{titleSection}
{renderFields(formValues)}
{error && <div className="warning_text">{error}</div>}
</div>
<div className="btn-wrapper">
<Button
label={STRINGS['WITHDRAWALS_BUTTON_TEXT']}
disabled={pristine || submitting || !valid}
onClick={this.onOpenDialog}
className="mb-3"
/>
</div>
<Dialog
isOpen={dialogIsOpen}
label="withdraw-modal"
onCloseDialog={this.onCloseDialog}
shouldCloseOnOverlayClick={dialogOtpOpen}
theme={activeTheme}
showCloseText={false}
>
{dialogOtpOpen ? (
<OtpForm
onSubmit={this.onSubmitOtp}
onClickHelp={openContactForm}
<SmartTarget
id={currencySpecificId}
titleSection={titleSection}
currency={currency}
>
<form autoComplete="off" className="withdraw-form-wrapper">
<div className="withdraw-form">
<Image
iconId={`${currency.toUpperCase()}_ICON`}
icon={ICONS[`${currency.toUpperCase()}_ICON`]}
wrapperClassName="form_currency-ball"
/>
) : !submitting ? (
<ReviewModalContent
coins={coins}
currency={currency}
data={data}
price={currentPrice}
onClickAccept={this.onAcceptDialog}
onClickCancel={this.onCloseDialog}
hasDestinationTag={hasDestinationTag}
{titleSection}
{renderFields(formValues)}
{error && <div className="warning_text">{error}</div>}
</div>
<div className="btn-wrapper">
<Button
label={STRINGS['WITHDRAWALS_BUTTON_TEXT']}
disabled={pristine || submitting || !valid}
onClick={this.onOpenDialog}
className="mb-3"
/>
) : (
<Loader relative={true} background={false} />
)}
</Dialog>
</form>
</div>
<Dialog
isOpen={dialogIsOpen}
label="withdraw-modal"
onCloseDialog={this.onCloseDialog}
shouldCloseOnOverlayClick={dialogOtpOpen}
theme={activeTheme}
showCloseText={false}
>
{dialogOtpOpen ? (
<OtpForm
onSubmit={this.onSubmitOtp}
onClickHelp={openContactForm}
/>
) : !submitting ? (
<ReviewModalContent
coins={coins}
currency={currency}
data={data}
price={currentPrice}
onClickAccept={this.onAcceptDialog}
onClickCancel={this.onCloseDialog}
hasDestinationTag={hasDestinationTag}
/>
) : (
<Loader relative={true} background={false} />
)}
</Dialog>
</form>
</SmartTarget>
);
} else if (coinObject && coinObject.type === 'fiat') {
return (
Expand Down

0 comments on commit 3b4eece

Please sign in to comment.