Skip to content

Commit 8b17b4a

Browse files
committed
v2.2.0
1 parent ce51c84 commit 8b17b4a

File tree

5 files changed

+61
-28
lines changed

5 files changed

+61
-28
lines changed

CHANGELOG.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
### 2.2.0 (2022-12-21)
2+
3+
* add method `listTransfers()`
4+
* fix url path for `getMove()`, `move()`, `listMoves()` and `updateAccountName()`
5+
* update documentation
6+
17
### 2.1.0 (2022-12-02)
28

3-
* add sub-account methods: `createAccount`, `updateAccountName`, `listAccountPendingTransactions`, `listAccountTransactions`, `listAccountBalances`, `getMove`, `move`, `listMoves`
9+
* add sub-account methods: `createAccount()`, `updateAccountName()`, `listAccountPendingTransactions()`, `listAccountTransactions()`, `listAccountBalances()`, `getMove()`, `move()`, `listMoves()`
410
* fix method `getBalance()` to take optional parameter `asset` as string or array
511
* remove method `getTransaction()`, which was deprecated
612
* update tests
@@ -27,7 +33,7 @@
2733

2834
### 1.9.0 (2021-12-06)
2935

30-
* Add methods getOrderListV2, getOrderV2, getOrderV3
36+
* Add methods `getOrderListV2()`, `getOrderV2()`, `getOrderV3()`
3137

3238
### 1.8.0 (2020-10-13)
3339

@@ -44,55 +50,55 @@
4450

4551
### 1.6.0
4652

47-
* Add options to postBuyOrder, postMarketBuyOrder, postSellOrder and postMarketSellOrder
48-
* Add getFeeInfo method
53+
* Add options to `postBuyOrder()`, `postMarketBuyOrder()`, `postSellOrder()` and `postMarketSellOrder()`
54+
* Add `getFeeInfo()` method
4955

5056
### 1.5.1
5157

5258
* Fix an issue with GET requests sent after POST requests
5359

5460
### 1.5.0
5561

56-
* Add getOrder method
62+
* Add `getOrder()` method
5763

5864
### 1.4.2
5965

60-
* Make asset parameter optional for getBalance
66+
* Make `asset` parameter optional for `getBalance()`
6167

6268
### 1.4.1
6369

6470
* Only catch JSON.parse errors (#6)
6571

6672
### 1.4.0
6773

68-
* Add pair option to getTicker, getOrderBook and getTrades
69-
* Add getAllTickers method
74+
* Add `pair` option to `getTicker()`, `getOrderBook()` and `getTrades()`
75+
* Add `getAllTickers()` method
7076

7177
### 1.3.0
7278

73-
* Add createFundingAddress method
74-
* Add getTransactions method
75-
* Accept address option for getFundingAddress
76-
* Accept state option for getOrderList
77-
* Add getWithdrawals method
78-
* Add getWithdrawal method
79-
* Add requestWithdrawal method
80-
* Add cancelWithdrawal method
79+
* Add `createFundingAddress()` method
80+
* Add `getTransactions()` method
81+
* Accept `address` option for `getFundingAddress()`
82+
* Accept `state` option for `getOrderList()`
83+
* Add `getWithdrawals()` method
84+
* Add `getWithdrawal()` method
85+
* Add `requestWithdrawal()` method
86+
* Add `cancelWithdrawal()` method
8187

8288
### 1.2.1
8389

8490
* Fix path bug (#1)
8591

8692
### 1.2.0
8793

88-
* Add getFundingAddress method
94+
* Add `getFundingAddress()` method
8995

9096
### 1.1.0
9197

9298
* Support multiple currency pairs
93-
* BitX.getLimits is now deprecated (use BitX.getBalance instead).
99+
* `BitX.getLimits()` is now deprecated (use `BitX.getBalance()` instead).
94100
* Updated to the latest BitX API.
95-
* Added BitX.getBalance method.
101+
* Added `BitX.getBalance()` method.
96102

97103
### 1.0.1
98104

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Example:
104104
luno.listAccountBalances(['XBT', 'ETH'], function (err, response) {})
105105
```
106106

107-
### getMove([options][, callback])
107+
### getMove(options[, callback])
108108
GET https://api.luno.com/api/exchange/1/move
109109

110110
Example:
@@ -366,7 +366,17 @@ GET https://api.luno.com/api/exchange/2/orders/{orderId}
366366
Example:
367367

368368
```javascript
369-
luno.getOrder('BXHW6PFRRXKFSB4', function (err, result) {})
369+
luno.getOrderV2('BXHW6PFRRXKFSB4', function (err, result) {})
370+
```
371+
372+
### getOrderV3(options[, callback])
373+
GET https://api.luno.com/api/exchange/3/orders/{orderId}
374+
375+
Example:
376+
377+
```javascript
378+
luno.getOrderV3({ id: 'BXMC2CJ7HNB88U4' }, function (err, result) {})
379+
luno.getOrderV3({ client_order_id: 'lmt-53960812' }, function (err, result) {})
370380
```
371381

372382
### getTransactions(asset[, options][, callback])
@@ -422,6 +432,15 @@ Example:
422432
luno.cancelWithdrawal('1212', function (err, withdrawal) {})
423433
```
424434

435+
### listTransfers(id[, options][, callback])
436+
GET https://api.luno.com/api/exchange/1/transfers
437+
438+
Example:
439+
440+
```javascript
441+
luno.listTransfers(1212, { limit: 986 }, function (err, data) {})
442+
```
443+
425444
## Contributing
426445

427446
Open a pull request or create an issue and help me improve it.

lib/luno.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Luno.prototype.createAccount = function (currency, name, callback) {
210210

211211
Luno.prototype.updateAccountName = function (id, name, callback) {
212212
let params = { name }
213-
return this._request('PUT', `/api/1/accounts/${id}`, params, callback)
213+
return this._request('PUT', `/api/1/accounts/${id}/name`, params, callback)
214214
}
215215

216216
Luno.prototype.listAccountPendingTransactions = function (id, callback) {
@@ -228,7 +228,7 @@ Luno.prototype.listAccountBalances = function (assets = [], callback) {
228228
}
229229

230230
Luno.prototype.getMove = function (options, callback) {
231-
return this._request('GET', `/api/1/move`, options, callback)
231+
return this._request('GET', `/api/exchange/1/move`, options, callback)
232232
}
233233

234234
Luno.prototype.move = function (amount, debit_account_id, credit_account_id, options, callback) {
@@ -238,11 +238,11 @@ Luno.prototype.move = function (amount, debit_account_id, credit_account_id, opt
238238
credit_account_id,
239239
}, options, callback)
240240

241-
return this._request('POST', `/api/1/move`, params, cb)
241+
return this._request('POST', `/api/exchange/1/move`, params, cb)
242242
}
243243

244244
Luno.prototype.listMoves = function (options, callback) {
245-
return this._request('GET', `/api/1/move/list_moves`, options, callback)
245+
return this._request('GET', `/api/exchange/1/move/list_moves`, options, callback)
246246
}
247247

248248
Luno.prototype.getTicker = function (options, callback) {
@@ -422,4 +422,12 @@ Luno.prototype.cancelWithdrawal = function (id, callback) {
422422
return this._request('DELETE', `/api/1/withdrawals/${id}`, null, callback)
423423
}
424424

425+
Luno.prototype.listTransfers = function (id, options, callback) {
426+
let [params, cb] = defaults({
427+
account_id: id,
428+
}, options, callback)
429+
430+
return this._request('GET', '/api/exchange/1/transfers', params, cb)
431+
}
432+
425433
module.exports = Luno

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "luno-api-node",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"author": "dutu@protonmail.com",
55
"description": "A simple wrapper for the Luno API.",
66
"license": "MIT",

0 commit comments

Comments
 (0)