hollaex-node-lib 1.2.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,47 +1,53 @@
1
1
  # hollaex-node-lib
2
2
 
3
- HollaEx crypto exchange nodejs library
3
+ Nodejs library for HollaEx Kit enabled exchanges.
4
+
5
+ **This library is specifically for end users and traders to connect to HollaEx Kit exchanges. It connects to [HollaEx Pro](https://pro.hollaex.com/trade/xht-usdt) by default.**
4
6
 
5
7
  ## Usage
6
8
 
7
- ```node
8
- const HollaEx = require('hollaex-node-lib');
9
+ ```javascript
10
+ const hollaex = require('hollaex-node-lib');
9
11
 
10
- var client = new HollaEx();
12
+ const client = new hollaex();
11
13
  ```
12
14
 
13
15
  You can pass the `apiURL` and `baseURL` of the HollaEx-Enabled exchange to connect to. You can also pass your `apiKey` and `apiSecret` generated from the HollaEx-Enabled exchange.
14
16
 
15
- ```node
16
- var client = new HollaEx({
17
- apiURL: <EXCHANGE_API_URL>,
18
- baseURL: <EXCHANGE_BASE_URL>,
19
- apiKey: <MY_API_KEY>,
20
- apiSecret: <MY_API_SECRET>
17
+ ```javascript
18
+ const client = new hollaex({
19
+ apiURL: '<EXCHANGE_API_URL>',
20
+ baseURL: '<EXCHANGE_BASE_URL>',
21
+ apiKey: '<MY_API_KEY>',
22
+ apiSecret: '<MY_API_SECRET>'
21
23
  });
22
24
  ```
23
25
 
24
26
  You can also pass the field `apiExpiresAfter` which is the length of time in seconds each request is valid for. The default value is `60`.
25
27
 
26
- There is a list of functions you can call which will be added later and they are not at this point implemented yet.
27
-
28
- > - **Note**: v1 has a new authentication mechanism using HMAC signature. HollaEx previously was using JSON Web Token (JWT) which is now changed to HMAC authentication.
29
-
30
28
  ### Example:
31
29
 
32
- ```node
33
- var client = new HollaEx({
34
- apiURL: <EXCHANGE_API_URL>,
35
- baseURL: <EXCHANGE_BASE_URL>,
36
- apiKey: <MY_API_KEY>,
37
- apiSecret: <MY_API_SECRET>
30
+ ```javascript
31
+ const client = new hollaex({
32
+ apiURL: '<EXCHANGE_API_URL>',
33
+ baseURL: '<EXCHANGE_BASE_URL>',
34
+ apiKey: '<MY_API_KEY>',
35
+ apiSecret: '<MY_API_SECRET>'
38
36
  });
39
37
 
40
38
  client
41
39
  .getTicker('xht-usdt')
42
40
  .then((res) => {
43
- let data = JSON.parse(res);
44
- console.log('The volume is', data.volume);
41
+ console.log('The volume is: ', res.volume);
42
+ })
43
+ .catch((err) => {
44
+ console.log(err);
45
+ });
46
+
47
+ client
48
+ .getTrades({ symbol: 'xht-usdt' })
49
+ .then((res) => {
50
+ console.log('Public trades: ', res);
45
51
  })
46
52
  .catch((err) => {
47
53
  console.log(err);
@@ -50,305 +56,264 @@ client
50
56
 
51
57
  ### Available functions:
52
58
 
53
- | Command | Parameters | Description |
54
- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
55
- | `getTicker` | **symbol** e.g. `xht-usdt` | Last, high, low, open and close price and volume within the last 24 hours |
56
- | `getOrderbook` | **symbol** (_optional_) e.g. `xht-usdt` | Orderbook containing list of bids and asks |
57
- | `getTrade` | **symbol** (_optional_) e.g. `xht-usdt` | List of last trades |
58
- | `getConstant` | | Tick size, min price, max price, min size and max size of each symbol pair |
59
- | `getUser` | | User's personal information |
60
- | `getBalance` | | User's wallet balance |
61
- | `getDeposit` | **currency** (_optional_), **limit** (_default_=`50`, _max_=`100`), **page** (_default_=`1`), **orderBy** (_optional_) e.g. `amount`, **order** (_asc_ or _desc_, _default_=`asc`) | User's list of all deposits |
62
- | `getWithdrawal` | **currency** (_optional_), **limit** (_default_=`50`, _max_=`100`), **page** (_default_=`1`), **orderBy** (_optional_) e.g. `amount`, **order** (_asc_ or _desc_, _default_=`asc`) | User's list of all withdrawals |
63
- | `requestWithdrawal` | **currency**, **amount**, **address** (_receipient's_) | Create a new withdrawal request. **Disable Two-Factor Authentication to be able to use this function. Must confirm within 5 minutes via email to complete withdrawal** |
64
- | `getUserTrade` | **symbol** (_optional_), **limit** (_default_=`50`, _max_=`100`), **page** (_default_=`1`) | User's list of all trades |
65
- | `getOrder` | **orderId** | Get specific information about a certain order |
66
- | `getAllOrder` | **symbol** (_optional_) e.g. `xht-usdt` | Get the list of all user orders. It can be filter by passing the symbol |
67
- | `createOrder` | **symbol**, **side** (_buy_ or _sell_), **size** (amount), **type** (_market_ or _limit_), **price** | Create a new order |
68
- | `cancelOrder` | **orderId** | Cancel a specific order with its ID |
69
- | `cancelAllOrder` | **symbol** (_optional_) e.g. `xht-usdt` | Cancel all open order. It can be filter by passing the symbol |
59
+ | Command | Parameters | Description |
60
+ | - | - | - |
61
+ | `getKit` | | Get exchange information e.g. name, valid languages, description, etc. |
62
+ | `getConstants` | | Tick size, min price, max price, min size and max size of each symbol pair and coin |
63
+ | `getTicker` | <ul><li>**symbol**: HollaEx trading symbol e.g. `xht-usdt`</li></ul> | Last, high, low, open and close price and volume within the last 24 hours |
64
+ | `getTickers` | | Last, high, low, open and close price and volume within the last 24 hours for all symbols |
65
+ | `getOrderbook` | <ul><li>**symbol**: HollaEx trading symbol e.g. `xht-usdt`</li></ul> | Orderbook containing list of bids and asks |
66
+ | `getOrderbooks` | | Orderbook containing list of bids and asks for all symbols |
67
+ | `getTrades` | <ul><li>**opts**: Object with additional params</li><li>**opts.symbol**: (_optional_) HollaEx trading symbol e.g. `xht-usdt`</li></ul> | List of last trades |
68
+ | `getUser` | | User's personal information |
69
+ | `getBalance` | | User's wallet balance |
70
+ | `getDeposits` | <ul><li>**opts**: Object with additional params</li><li>**opts.currency**: (_optional_) Filter data set by asset</li><li>**opts.status**: (_optional_) Filter data set `status`</li><li>**opts.dismissed**: (_optional_) Filter data set `dismissed`</li><li>**opts.rejected**: (_optional_) Filter data set `rejected`</li><li>**opts.processing**: (_optional_) Filter data set `processing`</li><li>**opts.waiting**: (_optional_) Filter data set `waiting`</li><li>**opts.limit**: (_optional_, _default_=`50`, _max_=`50`) Number of items to get</li><li>**opts.page**: (_optional_, _default_=`1`) Page number of data</li><li>**opts.orderBy**: (_optional_) Field to order data by</li><li>**opts.order**: (_optional_, _enum_=[`asc`, `desc`]) Specify ascending or descending order</li><li>**opts.startDate**: (_optional_, _format_=`ISO8601`) Start date of data set</li><li>**opts.endDate**: (_optional_, _format_=`ISO8601`) End date of data set</li><li>**opts.transactionId**: (_optional_) Filter data set by TXID</li><li>**opts.address**: (_optional_) Filter data set by address</li></ul> | User's list of all deposits |
71
+ | `getWithdrawals` | <ul><li>**opts**: Object with additional params</li><li>**opts.currency**: (_optional_) Filter data set by asset</li><li>**opts.status**: (_optional_) Filter data set `status`</li><li>**opts.dismissed**: (_optional_) Filter data set `dismissed`</li><li>**opts.rejected**: (_optional_) Filter data set `rejected`</li><li>**opts.processing**: (_optional_) Filter data set `processing`</li><li>**opts.waiting**: (_optional_) Filter data set `waiting`</li><li>**opts.limit**: (_optional_, _default_=`50`, _max_=`50`) Number of items to get</li><li>**opts.page**: (_optional_, _default_=`1`) Page number of data</li><li>**opts.orderBy**: (_optional_) Field to order data by</li><li>**opts.order**: (_optional_, _enum_=[`asc`, `desc`]) Specify ascending or descending order</li><li>**opts.startDate**: (_optional_, _format_=`ISO8601`) Start date of data set</li><li>**opts.endDate**: (_optional_, _format_=`ISO8601`) End date of data set</li><li>**opts.transactionId**: (_optional_) Filter data set by TXID</li><li>**opts.address**: (_optional_) Filter data set by address</li></ul> | User's list of all withdrawals |
72
+ | `requestWithdrawal` | <ul><li>**currency**: Currency code e.g. `xht`</li><li>**amount**: Withdrawal amount</li><li>**address**: Address to withdrawal to</li><li>**opts**: Object with additional params</li><li>**opts.network**: (_required if asset has multiple networks_) Blockchain network to create address for e.g. `trx`</li><li>**opts.otpCode**: (_required if user has otp enabled_) User otp code</li></ul> | Create a new withdrawal request |
73
+ | `getUserTrades` | <ul><li>**opts**: Object with additional params</li><li>**opts.symbol**: (_optional_) HollaEx trading symbol e.g. `xht-usdt`</li><li>**opts.limit**: (_optional_, _default_=`50`, _max_=`50`) Number of items to get</li><li>**opts.page**: (_optional_, _default_=`1`) Page number of data</li><li>**opts.orderBy**: (_optional_) Field to order data by</li><li>**opts.order**: (_optional_, _enum_=[`asc`, `desc`]) Specify ascending or descending order</li><li>**opts.startDate**: (_optional_, _format_=`ISO8601`) Start date of data set</li><li>**opts.endDate**: (_optional_, _format_=`ISO8601`) End date of data set</li></ul> | User's list of all trades |
74
+ | `getOrder` | <ul><li>**orderId**: HollaEx Network Order ID</li></ul> | Get specific information about a certain order |
75
+ | `getOrders` | <ul><li>**opts**: Object with additional params</li><li>**opts.symbol**: (_optional_) HollaEx trading symbol e.g. `xht-usdt`</li><li>**opts.side**: (_optional_, _enum_=[`buy`, `sell`]) Order side</li><li>**opts.status**: (_optional_) Filter data set `status`</li><li>**opts.limit**: (_optional_, _default_=`50`, _max_=`50`) Number of items to get</li><li>**opts.page**: (_optional_, _default_=`1`) Page number of data</li><li>**opts.orderBy**: (_optional_) Field to order data by</li><li>**opts.order**: (_optional_, _enum_=[`asc`, `desc`])</li><li>**opts.startDate**: (_optional_, _format_=`ISO8601`) Start date of data set</li><li>**opts.endDate**: (_optional_, _format_=`ISO8601`) End date of data set</li></ul> | Get the list of all user orders. It can be filter by passing the symbol |
76
+ | `createOrder` | <ul><li>**symbol**: HollaEx trading symbol e.g. `xht-usdt`</li><li>**side** (_enum_=[`buy`, `sell`]): Order side</li><li>**size**: Size of order to place</li><li>**type**: (_enum_=[`market`, `limit`] Order type</li><li>**price**: (_required if limit order type_) Order price</li><li>**opts**: Object with additional params</li><li>**opts.stop**: (_optional_) Stop price for order</li><li>**opts.meta**: (_optional_) Object with additional meta configurations</li><li>**opts.meta.post_only**: (_optional_, _default_=`false`) Make post only order </li><li>**opts.meta.note**: (_optional_) Custom note for order</li></ul> | Create a new order |
77
+ | `cancelOrder` | <ul><li>**orderId**: HollaEx Network order ID</li></ul> | Cancel a specific order with its ID |
78
+ | `cancelAllOrders` | <ul><li>**symbol**: HollaEx trading symbol e.g. `xht-usdt`</li></ul> | Cancel all the active orders of a user, filtered by currency pair symbol |
70
79
 
71
80
  ### Websocket
72
81
 
73
- #### Connecting
82
+ #### Functions
74
83
 
75
84
  You can connect and subscribe to different websocket channels for realtime updates.
76
85
 
77
- To connect, use the `connect` function with the channel you want to subscribe to as the parameter.
86
+ To connect, use the `connect` function with the channels you want to subscribe to in an array as the parameter. The connection will reconnect on it's own unless you call `disconnect`.
78
87
 
79
- ```node
80
- const socket = client.connect('orderbook');
88
+ ```javascript
89
+ client.connect(['orderbook', 'trade']);
81
90
  ```
82
91
 
83
- To disconnect the websocket, call `disconnect` on the socket connection.
92
+ To disconnect the websocket, call `disconnect`.
84
93
 
85
- ```node
86
- socket.disconnect();
94
+ ```javascript
95
+ client.disconnect();
87
96
  ```
88
97
 
89
- #### Channels
98
+ To subscribe to more channels after connection, use `subscribe`.
90
99
 
91
- Here is the list of channels you can subscribe to:
92
-
93
- - `orderbook`
94
- - `trades`
95
- - `user` (Private updates for the user such as balance, user orders etc as explained below)
96
- - `all` (Subscribes to all events)
97
-
98
- For public channels (`orderbook`, `trades`), you can subscribe to specific symbols as follows:
99
- `orderbook:xht-usdt`, `trades:xht-usdt`.
100
-
101
- #### Events
100
+ ```javascript
101
+ client.subscribe(['order', 'wallet']);
102
+ ```
102
103
 
103
- After connecting to the websocket, you can listen for events coming from the server by using the `on` function.
104
+ To unsubscribe from channels after connection, use `unsubscribe`.
104
105
 
105
- ```node
106
- socket.on(<EVENT>, (data) => {
107
- console.log(data);
108
- });
106
+ ```javascript
107
+ client.unsubscribe(['orderbook']);
109
108
  ```
110
109
 
111
- Public channels (`orderbook`, `trades`) emit events named after the respective channel. For example, the `orderbook` channel emits the event `orderbook`.
110
+ #### Channels
112
111
 
113
- The private channel `user` emits the events `userInfo`, `userOrder`, `userTrade`, `userWallet`, and `userUpdate`.
112
+ Here is the list of channels you can subscribe to:
114
113
 
115
- Each channel also emits a `disconnect`, `reconnect`, `error`, `connect_error`, and `connect_timeout` event.
116
- - `disconnect` is emitted once when the websocket connection is disconnected from the server.
117
- - `reconnect` is emitted once when the server connection is reconnected.
118
- - `error` is emitted when there is an error thrown by the socket connection.
119
- - `connect_error` is emitted when there is an error while the socket connects.
120
- - `connect_timeout` is emitted when the socket connection times out.
114
+ - `orderbook`
115
+ - `trades`
116
+ - `order` (Only available with authentication. Receive order updates)
117
+ - `wallet` (Only available with authentication. Receive balance updates)
121
118
 
122
- ##### Private Events
119
+ For public channels (`orderbook`, `trade`), you can subscribe to specific symbols as follows:
120
+ `orderbook:xht-usdt`, `trade:xht-usdt`. Not passing a symbol will subscribe to all symbols.
123
121
 
124
- When you subscribe to private updates on user you should listen for the events as follows:
122
+ #### Events
125
123
 
126
- ```node
127
- const socket = client.connect('user');
124
+ After connecting to the websocket, you can listen for events coming from the server by using the `on` function for the `ws` property of the client.
125
+ The events available are default websocket events e.g. `message`, `open`, `close`, `error`, `unexpected-response`, etc.
128
126
 
129
- socket.on('userInfo', (data) => {
130
- console.log(data);
131
- });
132
- socket.on('userOrder', (data) => {
133
- console.log(data);
134
- });
135
- socket.on('userTrade', (data) => {
136
- console.log(data);
137
- });
138
- socket.on('userWallet', (data) => {
139
- console.log(data);
140
- });
141
- socket.on('userUpdate', (data) => {
127
+ ```javascript
128
+ client.ws.on('message', (data) => {
129
+ data = JSON.parse(data);
142
130
  console.log(data);
143
131
  });
144
132
  ```
145
133
 
146
- `userInfo`, `userOrder`, and `userTrade` are only `partial` and send data once. These sockets are similar to GET requests and you should not expect any updates after you receive the first set of data.
147
-
148
- `userWallet` gives updates on changes in the user's wallet
149
-
150
- `userUpdate` is what is used for all updates on user's private data.
151
-
152
- These are list of `userUpdate` client gets after subscription.
153
-
154
- - **userUpdate**: Updates related to the user's private information are as follows:
155
-
156
- - _order_queued_: When user's order is added to the matching engine queue.
157
-
158
- ```json
159
- {
160
- "action": "update",
161
- "type": "order_queued",
162
- "data": {
163
- "side": "sell",
164
- "type": "limit",
165
- "price": 0.2,
166
- "size": 2,
167
- "symbol": "xht-usdt",
168
- "id": "ac7717d4-04e9-4430-a21b-08d32b2c34cd",
169
- "created_by": 79,
170
- "filled": 0
171
- }
172
- }
173
- ```
174
-
175
- - _order_processed_: When user's order is processed in the matching engine queue.
176
-
177
- ```json
178
- {
179
- "action": "update",
180
- "type": "order_processed",
181
- "data": { "id": "ac7717d4-04e9-4430-a21b-08d32b2c34cd" }
182
- }
183
- ```
184
-
185
- - _order_canceled_: When user's order is rejected in the queue, so it has not been added to the orderbook.
186
-
187
- ```json
188
- {
189
- "action": "update",
190
- "type": "order_canceled",
191
- "data": {
192
- "id": "ac7717d4-04e9-4430-a21b-08d32b2c34cd",
193
- "message": "Insufficient balance to perform the order."
194
- }
195
- }
196
- ```
197
-
198
- - _order_added_: When user's order is added to the orderbook.
199
-
200
- ```json
201
- {
202
- "action": "update",
203
- "type": "order_added",
204
- "data": {
205
- "side": "sell",
206
- "type": "limit",
207
- "price": 0.2,
208
- "size": 2,
209
- "symbol": "xht-usdt",
210
- "id": "ac7717d4-04e9-4430-a21b-08d32b2c34cd",
211
- "created_by": 79,
212
- "filled": 0
213
- }
214
- }
215
- ```
216
-
217
- - _order_partialy_filled_: When user's order is updated because it was taken some part by another order.
218
-
219
- ```json
220
- {
221
- "action": "update",
222
- "type": "order_partialy_filled",
223
- "data": {
224
- "id": "ac7717d4-04e9-4430-a21b-08d32b2c34cd",
225
- "filled": 0.1,
226
- "created_by": 79,
227
- "side": "sell",
228
- "type": "limit",
229
- "size": 2,
230
- "price": 0.2,
231
- "symbol": "xht-usdt"
232
- }
233
- }
234
- ```
235
-
236
- - _order_filled_: When user's order is taken by another order in a trade.
237
-
238
- ```json
239
- {
240
- "action": "update",
241
- "type": "order_filled",
242
- "data": [
243
- {
244
- "id": "ac7717d4-04e9-4430-a21b-08d32b2c34cd"
245
- },
246
- {
247
- "id": "bc7717d4-04e9-4430-a21b-08d32b2c34cd"
248
- },
249
- ...
250
- ]
251
- }
252
- ```
253
-
254
- - _order_updated_: When user updates the order.
255
-
256
- ```json
257
- {
258
- "type": "order_updated",
259
- "data": {
260
- "id": "ac7717d4-04e9-4430-a21b-08d32b2c34cd",
261
- "created_by": 79,
262
- "price": 0.2,
263
- "side": "sell",
264
- "size": 2,
265
- "type": "limit"
266
- }
267
- }
268
- ```
269
-
270
- - _order_removed_: When user's order is taken or user cancels order/orders.
271
-
272
- ```json
273
- {
274
- "action": "update",
275
- "type": "order_removed",
276
- "data": [
277
- {
278
- "id": "ac7717d4-04e9-4430-a21b-08d32b2c34cd"
279
- },
280
- {
281
- "id": "bc7717d4-04e9-4430-a21b-08d32b2c34cd"
282
- },
283
- ...
284
- ]
285
- }
286
- ```
287
-
288
- - _trade_: When a trade happens.
289
-
290
- ```json
291
- {
292
- "action": "update",
293
- "type": "trade",
294
- "data": [
295
- {
296
- "id": "1efd30b6-fcb5-44da-82c1-82d9def2ddbd",
297
- "side": "sell",
298
- "symbol": "xht-usdt",
299
- "size": 2,
300
- "price": 0.2,
301
- "timestamp": "2017-07-26T13:20:40.464Z",
302
- "fee": 0,
303
- },
304
- ...
305
- ]
306
- }
307
- ```
308
-
309
- - _deposit_: When user gets a deposit. Status = pending or completed
310
-
311
- ```json
312
- {
313
- "action": "update",
314
- "type": "deposit",
315
- "data": {
316
- "amount": 3000,
317
- "currency": "usdt",
318
- "status": false
319
- },
320
- "balance": {
321
- "usdt_balance": 0,
322
- "xht_balance": 300000,
323
- "updated_at": "2017-07-26T13:20:40.464Z"
324
- }
325
- }
326
- ```
327
-
328
- - _withdrawal_: When user performs a withdrawal in his account. Status = pending or completed
329
-
330
- ```json
331
- {
332
- "action": "update",
333
- "type": "withdrawal",
334
- "data": {
335
- "amount": 5000,
336
- "currency": "xht",
337
- "status": true
338
- },
339
- "balance": {
340
- "usdt_balance": 0,
341
- "xht_balance": 300000,
342
- "updated_at": "2017-07-26T13:20:40.464Z"
343
- }
344
- }
345
- ```
346
-
134
+ These are exapmles of data responses from the server.
135
+
136
+ - **orderbook**: Updates related to the user's private information are as follows:
137
+
138
+ ```json
139
+ {
140
+ "topic": "orderbook",
141
+ "action": "partial",
142
+ "symbol": "xht-usdt",
143
+ "data": {
144
+ "bids": [
145
+ [0.1, 0.1],
146
+ ...
147
+ ],
148
+ "asks": [
149
+ [1, 1],
150
+ ...
151
+ ],
152
+ "timestamp": "2020-12-15T06:45:27.766Z"
153
+ },
154
+ "time": 1608015328
155
+ }
156
+ ```
157
+
158
+ - **trade**: Updates related to the user's private information are as follows:
159
+
160
+ ```json
161
+ {
162
+ "topic": "trade",
163
+ "action": "partial",
164
+ "symbol": "xht-usdt",
165
+ "data": [
166
+ {
167
+ "size": 0.012,
168
+ "price": 300,
169
+ "side": "buy",
170
+ "timestamp": "2020-12-15T07:25:28.887Z"
171
+ },
172
+ ...
173
+ ],
174
+ "time": 1608015328
175
+ }
176
+ ```
177
+
178
+ - **wallet**: Updates related to the user's private information are as follows:
179
+
180
+ ```json
181
+ {
182
+ "topic": "wallet",
183
+ "action": "partial",
184
+ "user_id": 1,
185
+ "data": {
186
+ "usdt_balance": 1,
187
+ "usdt_available": 1,
188
+ "xht_balance": 1,
189
+ "xht_available": 1,
190
+ "xmr_balance": 1,
191
+ "xmr_available": 1,
192
+ "btc_balance": 1,
193
+ "btc_available": 1,
194
+ "eth_balance": 1,
195
+ "eth_available": 1,
196
+ ...,
197
+ "updated_at": "2020-12-15T08:41:24.048Z"
198
+ },
199
+ "time": 1608021684
200
+ }
201
+ ```
202
+
203
+ - **order**: Websocket messages relating the the user's orders.
204
+ - The `status` of the order can be `new`, `pfilled`, `filled`, and `canceled`.
205
+ - The `action` of the data determines what caused it to happen. All three are explained below:
206
+
207
+ - `partial`: All previous and current orders. Is the first order data received when connecting. Max: 50. Descending order.
208
+
209
+ ```json
210
+ {
211
+ "topic": "order",
212
+ "action": "partial",
213
+ "user_id": 1,
214
+ "data": [
215
+ {
216
+ "id": "7d3d9545-b7e6-4e7f-84a0-a39efa4cb173",
217
+ "side": "buy",
218
+ "symbol": "xht-usdt",
219
+ "type": "limit",
220
+ "size": 0.1,
221
+ "filled": 0,
222
+ "price": 1,
223
+ "stop": null,
224
+ "status": "new",
225
+ "fee": 0,
226
+ "fee_coin": "xht",
227
+ "meta": {},
228
+ "fee_structure": {
229
+ "maker": 0.1,
230
+ "taker": 0.1
231
+ },
232
+ "created_at": "2020-11-30T07:45:43.819Z",
233
+ "created_by": 1
234
+ },
235
+ ...
236
+ ],
237
+ "time": 1608022610
238
+ }
239
+ ```
240
+
241
+ - `insert`: When user's order is added. The status of the order can be either `new`, `pfilled`, or `filled`.
242
+
243
+ ```json
244
+ {
245
+ "topic": "order",
246
+ "action": "insert",
247
+ "user_id": 1,
248
+ "symbol": "xht-usdt",
249
+ "data": [
250
+ {
251
+ "id": "7d3d9545-b7e6-4e7f-84a0-a39efa4cb173",
252
+ "side": "buy",
253
+ "symbol": "xht-usdt",
254
+ "type": "limit",
255
+ "size": 0.1,
256
+ "filled": 0,
257
+ "price": 1,
258
+ "stop": null,
259
+ "status": "new",
260
+ "fee": 0,
261
+ "fee_coin": "xht",
262
+ "meta": {},
263
+ "fee_structure": {
264
+ "maker": 0.1,
265
+ "taker": 0.1
266
+ },
267
+ "created_at": "2020-11-30T07:45:43.819Z",
268
+ "updated_at": "2020-12-15T08:56:45.066Z",
269
+ "created_by": 1
270
+ },
271
+ ...
272
+ ],
273
+ "time": 1608022610
274
+ }
275
+ ```
276
+
277
+ - `update`: When user's order status is updated. Status can be `pfilled`, `filled`, and `canceled`.
278
+
279
+ ```json
280
+ {
281
+ "topic": "order",
282
+ "action": "insert",
283
+ "user_id": 1,
284
+ "symbol": "xht-usdt",
285
+ "data": [
286
+ {
287
+ "id": "7d3d9545-b7e6-4e7f-84a0-a39efa4cb173",
288
+ "side": "buy",
289
+ "symbol": "xht-usdt",
290
+ "type": "limit",
291
+ "size": 0.1,
292
+ "filled": 0,
293
+ "price": 1,
294
+ "stop": null,
295
+ "status": "new",
296
+ "fee": 0,
297
+ "fee_coin": "xht",
298
+ "meta": {},
299
+ "fee_structure": {
300
+ "maker": 0.1,
301
+ "taker": 0.1
302
+ },
303
+ "created_at": "2020-11-30T07:45:43.819Z",
304
+ "updated_at": "2020-12-15T08:56:45.066Z",
305
+ "created_by": 1
306
+ },
307
+ ...
308
+ ],
309
+ "time": 1608022610
310
+ }
311
+ ```
347
312
  ## Example
348
313
 
349
314
  You can run the example by going to example folder and running:
350
315
 
351
- ```node
316
+ ```bash
352
317
  node example/hollaex.js
353
318
  ```
354
319