Skip to content

Commit

Permalink
v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dutu committed Dec 21, 2022
1 parent ce51c84 commit 8b17b4a
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 28 deletions.
44 changes: 25 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
### 2.2.0 (2022-12-21)

* add method `listTransfers()`
* fix url path for `getMove()`, `move()`, `listMoves()` and `updateAccountName()`
* update documentation

### 2.1.0 (2022-12-02)

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

### 1.9.0 (2021-12-06)

* Add methods getOrderListV2, getOrderV2, getOrderV3
* Add methods `getOrderListV2()`, `getOrderV2()`, `getOrderV3()`

### 1.8.0 (2020-10-13)

Expand All @@ -44,55 +50,55 @@

### 1.6.0

* Add options to postBuyOrder, postMarketBuyOrder, postSellOrder and postMarketSellOrder
* Add getFeeInfo method
* Add options to `postBuyOrder()`, `postMarketBuyOrder()`, `postSellOrder()` and `postMarketSellOrder()`
* Add `getFeeInfo()` method

### 1.5.1

* Fix an issue with GET requests sent after POST requests

### 1.5.0

* Add getOrder method
* Add `getOrder()` method

### 1.4.2

* Make asset parameter optional for getBalance
* Make `asset` parameter optional for `getBalance()`

### 1.4.1

* Only catch JSON.parse errors (#6)

### 1.4.0

* Add pair option to getTicker, getOrderBook and getTrades
* Add getAllTickers method
* Add `pair` option to `getTicker()`, `getOrderBook()` and `getTrades()`
* Add `getAllTickers()` method

### 1.3.0

* Add createFundingAddress method
* Add getTransactions method
* Accept address option for getFundingAddress
* Accept state option for getOrderList
* Add getWithdrawals method
* Add getWithdrawal method
* Add requestWithdrawal method
* Add cancelWithdrawal method
* Add `createFundingAddress()` method
* Add `getTransactions()` method
* Accept `address` option for `getFundingAddress()`
* Accept `state` option for `getOrderList()`
* Add `getWithdrawals()` method
* Add `getWithdrawal()` method
* Add `requestWithdrawal()` method
* Add `cancelWithdrawal()` method

### 1.2.1

* Fix path bug (#1)

### 1.2.0

* Add getFundingAddress method
* Add `getFundingAddress()` method

### 1.1.0

* Support multiple currency pairs
* BitX.getLimits is now deprecated (use BitX.getBalance instead).
* `BitX.getLimits()` is now deprecated (use `BitX.getBalance()` instead).
* Updated to the latest BitX API.
* Added BitX.getBalance method.
* Added `BitX.getBalance()` method.

### 1.0.1

Expand Down
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Example:
luno.listAccountBalances(['XBT', 'ETH'], function (err, response) {})
```

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

Example:
Expand Down Expand Up @@ -366,7 +366,17 @@ GET https://api.luno.com/api/exchange/2/orders/{orderId}
Example:

```javascript
luno.getOrder('BXHW6PFRRXKFSB4', function (err, result) {})
luno.getOrderV2('BXHW6PFRRXKFSB4', function (err, result) {})
```

### getOrderV3(options[, callback])
GET https://api.luno.com/api/exchange/3/orders/{orderId}

Example:

```javascript
luno.getOrderV3({ id: 'BXMC2CJ7HNB88U4' }, function (err, result) {})
luno.getOrderV3({ client_order_id: 'lmt-53960812' }, function (err, result) {})
```

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

### listTransfers(id[, options][, callback])
GET https://api.luno.com/api/exchange/1/transfers

Example:

```javascript
luno.listTransfers(1212, { limit: 986 }, function (err, data) {})
```

## Contributing

Open a pull request or create an issue and help me improve it.
16 changes: 12 additions & 4 deletions lib/luno.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Luno.prototype.createAccount = function (currency, name, callback) {

Luno.prototype.updateAccountName = function (id, name, callback) {
let params = { name }
return this._request('PUT', `/api/1/accounts/${id}`, params, callback)
return this._request('PUT', `/api/1/accounts/${id}/name`, params, callback)
}

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

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

Luno.prototype.move = function (amount, debit_account_id, credit_account_id, options, callback) {
Expand All @@ -238,11 +238,11 @@ Luno.prototype.move = function (amount, debit_account_id, credit_account_id, opt
credit_account_id,
}, options, callback)

return this._request('POST', `/api/1/move`, params, cb)
return this._request('POST', `/api/exchange/1/move`, params, cb)
}

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

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

Luno.prototype.listTransfers = function (id, options, callback) {
let [params, cb] = defaults({
account_id: id,
}, options, callback)

return this._request('GET', '/api/exchange/1/transfers', params, cb)
}

module.exports = Luno
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "luno-api-node",
"version": "2.1.0",
"version": "2.2.0",
"author": "[email protected]",
"description": "A simple wrapper for the Luno API.",
"license": "MIT",
Expand Down

0 comments on commit 8b17b4a

Please sign in to comment.