Skip to content

Commit 2ce0110

Browse files
committed
added methods getOrderListV2, getOrderV2, getOrderV3
1 parent 16e6a72 commit 2ce0110

File tree

5 files changed

+139
-79
lines changed

5 files changed

+139
-79
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 1.9.0 (2021-12-06)
2+
3+
* Add methods getOrderListV2, getOrderV2, getOrderV3
4+
15
### 1.8.0 (2020-10-13)
26

37
* Add promise support for all methods. When `callback` parameter is not provided, the methods return a promise

README.md

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Add bitx as a dependency:
1111
$ npm install --save bitx
1212
```
1313

14-
### BitX([keyId, keySecret, ][options])
14+
### BitX([keyId, keySecret][options])
1515
To access the private Luno API methods you must supply your key id and key secret as the first two arguments. If you are only accessing the public API endpoints you can leave these two arguments out.
1616

1717
The optional `options` argument can be used to override the default options. The default options are equivalent to:
@@ -36,7 +36,7 @@ The arguments passed to the callback function for each method are:
3636

3737
The `callback` function is optional. If the `callback` is not provided, the methods return a promise.
3838

39-
### getTicker([options, ][callback])
39+
### getTicker([options][, callback])
4040
GET https://api.luno.com/api/1/ticker/XBTZAR
4141

4242
Default options:
@@ -62,7 +62,7 @@ Example:
6262
bitx.getAllTickers(function(err, tickers) {});
6363
```
6464

65-
### getOrderBook([options, ][callback])
65+
### getOrderBook([options][, callback])
6666
GET https://api.luno.com/api/1/orderbook
6767

6868
Default options:
@@ -79,7 +79,7 @@ Example:
7979
bitx.getOrderBook(function(err, orderBook) {});
8080
```
8181

82-
### getTrades([options, ][callback])
82+
### getTrades([options][, callback])
8383
GET https://api.luno.com/api/1/trades
8484

8585
Default options:
@@ -96,7 +96,7 @@ Example:
9696
bitx.getTrades(function(err, trades) {});
9797
```
9898

99-
### getTradeList([options, ][callback])
99+
### getTradeList([options][, callback])
100100
GET https://api.luno.com/api/1/listtrades
101101

102102
Default options:
@@ -113,7 +113,7 @@ Example:
113113
bitx.getTradeList({sort_desc: true, limit: 10}, function(err, tradeList) {});
114114
```
115115

116-
### getOrderList([options, ][callback])
116+
### getOrderList([options][, callback])
117117
GET https://api.luno.com/api/1/listorders
118118

119119
Default options:
@@ -131,7 +131,34 @@ Example:
131131
bitx.getOrderList({state: 'PENDING'}, function(err, orderList) {});
132132
```
133133

134-
### getBalance([asset, ][callback])
134+
### getOrderListV2([options][, callback])
135+
GET https://api.luno.com/api/exchange/2/listorders
136+
137+
Default options:
138+
139+
```javascript
140+
{
141+
pair: bitx.pair,
142+
state: undefined
143+
}
144+
```
145+
146+
Example:
147+
148+
```javascript
149+
bitx.getOrderListV2({ closed: true }, function(err, orderList) {});
150+
```
151+
152+
### getOrderListV3(options[, callback])
153+
GET https://api.luno.com/api/exchange/3/order
154+
155+
Example:
156+
157+
```javascript
158+
bitx.getOrderListV3({id: 'BXMC2CJ7HNB88U4' }, function(err, orderList) {});
159+
```
160+
161+
### getBalance([asset][, callback])
135162
GET https://api.luno.com/api/1/balance
136163

137164
Example:
@@ -140,7 +167,7 @@ Example:
140167
bitx.getBalance('ZAR', function(err, balance) {});
141168
```
142169

143-
### getFundingAddress(asset, [options, ][callback])
170+
### getFundingAddress(asset[, options][, callback])
144171
GET https://api.luno.com/api/1/funding_address
145172

146173
Default options:
@@ -157,7 +184,7 @@ Example:
157184
bitx.getFundingAddress('XBT', {address: 'B1tC0InExAMPL3fundIN6AdDreS5t0Use'}, function(err, fundingAddress) {});
158185
```
159186

160-
### createFundingAddress(asset, [callback])
187+
### createFundingAddress(asset[, callback])
161188
POST https://api.luno.com/api/1/funding_address
162189

163190
Example:
@@ -166,7 +193,7 @@ Example:
166193
bitx.createFundingAddress('XBT', function(err, fundingAddress) {});
167194
```
168195

169-
### getFeeInfo([options, ][callback])
196+
### getFeeInfo([options][, callback])
170197
GET https://api.luno.com/api/1/fee_info
171198

172199
Default options:
@@ -183,7 +210,7 @@ Example:
183210
bitx.getFeeInfo({pair: 'XBTZAR'}, function(err, feeInfo) {});
184211
```
185212

186-
### postBuyOrder(volume, price, [options, ][callback])
213+
### postBuyOrder(volume, price[, options][, callback])
187214
POST https://api.luno.com/api/1/postorder
188215

189216
Example:
@@ -192,7 +219,7 @@ Example:
192219
bitx.postBuyOrder(9999.99, 0.01, function(err, order) {});
193220
```
194221

195-
### postSellOrder(volume, price, [options, ][callback])
222+
### postSellOrder(volume, price[, options][, callback])
196223
POST https://api.luno.com/api/1/postorder
197224

198225
Example:
@@ -201,7 +228,7 @@ Example:
201228
bitx.postSellOrder(0.01, 9999.99, function(err, order) {});
202229
```
203230

204-
### postMarketBuyOrder(volume, [options, ][callback])
231+
### postMarketBuyOrder(volume[, options][, callback])
205232
POST https://api.luno.com/api/1/marketorder
206233

207234
Example:
@@ -210,7 +237,7 @@ Example:
210237
bitx.postMarketBuyOrder(0.01, function(err, order) {});
211238
```
212239

213-
### postMarketSellOrder(volume, [options, ][callback])
240+
### postMarketSellOrder(volume[, options][, callback])
214241
POST https://api.luno.com/api/1/marketorder
215242

216243
Example:
@@ -219,7 +246,7 @@ Example:
219246
bitx.postMarketSellOrder(0.01, function(err, order) {});
220247
```
221248

222-
### stopOrder(orderId, [callback])
249+
### stopOrder(orderId[, callback])
223250
POST https://api.luno.com/api/1/stoporder
224251

225252
Example:
@@ -228,7 +255,7 @@ Example:
228255
bitx.stopOrder('BXMC2CJ7HNB88U4', function(err, result) {});
229256
```
230257

231-
### getOrder(orderId, [callback])
258+
### getOrder(orderId[, callback])
232259
GET https://api.luno.com/api/1/orders/{orderId}
233260

234261
Example:
@@ -237,7 +264,16 @@ Example:
237264
bitx.getOrder('BXHW6PFRRXKFSB4', function(err, result) {});
238265
```
239266

240-
### getTransactions(asset, [options, ][callback])
267+
### getOrderV2(orderId[, callback])
268+
GET https://api.luno.com/api/exchange/2/orders/{orderId}
269+
270+
Example:
271+
272+
```javascript
273+
bitx.getOrder('BXHW6PFRRXKFSB4', function(err, result) {});
274+
```
275+
276+
### getTransactions(asset[, options][, callback])
241277
GET https://api.luno.com/api/1/transactions
242278

243279
Default options:
@@ -263,7 +299,7 @@ Example:
263299
bitx.getWithdrawals(function(err, withdrawals) {});
264300
```
265301

266-
### getWithdrawal(withdrawalId, [callback])
302+
### getWithdrawal(withdrawalId[, callback])
267303
GET https://api.luno.com/api/1/withdrawals/{withdrawalId}
268304

269305
Example:
@@ -272,7 +308,7 @@ Example:
272308
bitx.getWithdrawal('1212', function(err, withdrawal) {});
273309
```
274310

275-
### requestWithdrawal(type, amount, [callback])
311+
### requestWithdrawal(type, amount[, callback])
276312
POST https://api.luno.com/api/1/withdrawals
277313

278314
Example:
@@ -281,7 +317,7 @@ Example:
281317
bitx.requestWithdrawal('ZAR_EFT', 1000, function(err, withdrawal) {});
282318
```
283319

284-
### cancelWithdrawal(withdrawalId, [callback])
320+
### cancelWithdrawal(withdrawalId[, callback])
285321
DELETE https://api.luno.com/api/1/withdrawals/{withdrawalId}
286322

287323
Example:

0 commit comments

Comments
 (0)