Skip to content

Commit

Permalink
update domain to api.luno.com
Browse files Browse the repository at this point in the history
  • Loading branch information
dutu committed Jul 4, 2020
1 parent eb4e173 commit 945aff5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### 1.7.1

* Parse Luno API errors
* Update domain to `api.luno.com`

### 1.7.0

Expand Down
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Build Status](https://travis-ci.org/bausmeier/node-bitx.png)](https://travis-ci.org/bausmeier/node-bitx)
[![codecov](https://codecov.io/gh/bausmeier/node-bitx/branch/master/graph/badge.svg)](https://codecov.io/gh/bausmeier/node-bitx)

A simple wrapper for the BitX API.
A simple wrapper for the Luno API.

## Usage
Add bitx as a dependency:
Expand All @@ -12,21 +12,21 @@ $ npm install --save bitx
```

### BitX([keyId, keySecret, ][options])
To access the private BitX 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.
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.

The optional options argument can be used to override the default options. The default options are equivalent to:

```javascript
{
hostname: 'api.mybitx.com',
hostname: 'api.luno.com',
port: 443,
ca: undefined,
pair: 'XBTZAR'
}
```

## Methods
For details about the API endpoints see https://api.mybitx.com/api.
For details about the API endpoints see https://www.luno.com/en/developers/api.

### Callbacks
The arguments passed to the callback function for each method are:
Expand All @@ -35,7 +35,7 @@ The arguments passed to the callback function for each method are:
1. An object containing the data returned by the BitX API.

### getTicker([options, ]callback)
GET https://api.mybitx.com/api/1/ticker
GET https://api.luno.com/api/1/ticker/XBTZAR

Default options:

Expand All @@ -52,7 +52,7 @@ bitx.getTicker(function(err, ticker) {});
```

### getAllTickers(callback)
GET https://api.mybitx.com/api/1/tickers
GET https://api.luno.com/api/1/tickers

Example:

Expand All @@ -61,7 +61,7 @@ bitx.getAllTickers(function(err, tickers) {});
```

### getOrderBook([options, ]callback)
GET https://api.mybitx.com/api/1/orderbook
GET https://api.luno.com/api/1/orderbook

Default options:

Expand All @@ -78,7 +78,7 @@ bitx.getOrderBook(function(err, orderBook) {});
```

### getTrades([options, ]callback)
GET https://api.mybitx.com/api/1/trades
GET https://api.luno.com/api/1/trades

Default options:

Expand All @@ -95,7 +95,7 @@ bitx.getTrades(function(err, trades) {});
```

### getTradeList([options, ]callback)
GET https://api.mybitx.com/api/1/listtrades
GET https://api.luno.com/api/1/listtrades

Default options:

Expand All @@ -112,7 +112,7 @@ bitx.getTradeList({sort_desc: true, limit: 10}, function(err, tradeList) {});
```

### getOrderList([options, ]callback)
GET https://api.mybitx.com/api/1/listorders
GET https://api.luno.com/api/1/listorders

Default options:

Expand All @@ -130,7 +130,7 @@ bitx.getOrderList({state: 'PENDING'}, function(err, orderList) {});
```

### getBalance([asset, ]callback)
GET https://api.mybitx.com/api/1/balance
GET https://api.luno.com/api/1/balance

Example:

Expand All @@ -139,7 +139,7 @@ bitx.getBalance('ZAR', function(err, balance) {});
```

### getFundingAddress(asset, [options, ]callback)
GET https://api.mybitx.com/api/1/funding_address
GET https://api.luno.com/api/1/funding_address

Default options:

Expand All @@ -156,7 +156,7 @@ bitx.getFundingAddress('XBT', {address: 'B1tC0InExAMPL3fundIN6AdDreS5t0Use'}, fu
```

### createFundingAddress(asset, callback)
POST https://api.mybitx.com/api/1/funding_address
POST https://api.luno.com/api/1/funding_address

Example:

Expand All @@ -165,7 +165,7 @@ bitx.createFundingAddress('XBT', function(err, fundingAddress) {});
```

### getFeeInfo([options, ]callback)
GET https://api.mybitx.com/api/1/fee_info
GET https://api.luno.com/api/1/fee_info

Default options:

Expand All @@ -182,7 +182,7 @@ bitx.getFeeInfo({pair: 'XBTZAR'}, function(err, feeInfo) {});
```

### postBuyOrder(volume, price, [options, ]callback)
POST https://api.mybitx.com/api/1/postorder
POST https://api.luno.com/api/1/postorder

Example:

Expand All @@ -191,7 +191,7 @@ bitx.postBuyOrder(9999.99, 0.01, function(err, order) {});
```

### postSellOrder(volume, price, [options, ]callback)
POST https://api.mybitx.com/api/1/postorder
POST https://api.luno.com/api/1/postorder

Example:

Expand All @@ -200,7 +200,7 @@ bitx.postSellOrder(0.01, 9999.99, function(err, order) {});
```

### postMarketBuyOrder(volume, [options, ]callback)
POST https://api.mybitx.com/api/1/marketorder
POST https://api.luno.com/api/1/marketorder

Example:

Expand All @@ -209,7 +209,7 @@ bitx.postMarketBuyOrder(0.01, function(err, order) {});
```

### postMarketSellOrder(volume, [options, ]callback)
POST https://api.mybitx.com/api/1/marketorder
POST https://api.luno.com/api/1/marketorder

Example:

Expand All @@ -218,7 +218,7 @@ bitx.postMarketSellOrder(0.01, function(err, order) {});
```

### stopOrder(orderId, callback)
POST https://api.mybitx.com/api/1/stoporder
POST https://api.luno.com/api/1/stoporder

Example:

Expand All @@ -227,7 +227,7 @@ bitx.stopOrder('BXMC2CJ7HNB88U4', function(err, result) {});
```

### getOrder(orderId, callback)
GET https://api.mybitx.com/api/1/orders/{orderId}
GET https://api.luno.com/api/1/orders/{orderId}

Example:

Expand All @@ -236,7 +236,7 @@ bitx.getOrder('BXHW6PFRRXKFSB4', function(err, result) {});
```

### getTransactions(asset, [options, ]callback)
GET https://api.mybitx.com/api/1/transactions
GET https://api.luno.com/api/1/transactions

Default options:
```javascript
Expand All @@ -253,7 +253,7 @@ bitx.getTransactions('XBT', {offset: 5, limit: 20}, function(err, transactions)
```

### getWithdrawals(callback)
GET https://api.mybitx.com/api/1/withdrawals
GET https://api.luno.com/api/1/withdrawals

Example:

Expand All @@ -262,7 +262,7 @@ bitx.getWithdrawals(function(err, withdrawals) {});
```

### getWithdrawal(withdrawalId, callback)
GET https://api.mybitx.com/api/1/withdrawals/{withdrawalId}
GET https://api.luno.com/api/1/withdrawals/{withdrawalId}

Example:

Expand All @@ -271,7 +271,7 @@ bitx.getWithdrawal('1212', function(err, withdrawal) {});
```

### requestWithdrawal(type, amount, callback)
POST https://api.mybitx.com/api/1/withdrawals
POST https://api.luno.com/api/1/withdrawals

Example:

Expand All @@ -280,7 +280,7 @@ bitx.requestWithdrawal('ZAR_EFT', 1000, function(err, withdrawal) {});
```

### cancelWithdrawal(withdrawalId, callback)
DELETE https://api.mybitx.com/api/1/withdrawals/{withdrawalId}
DELETE https://api.luno.com/api/1/withdrawals/{withdrawalId}

Example:

Expand Down
2 changes: 1 addition & 1 deletion lib/BitX.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function BitX (keyId, keySecret, options) {
options = keyId
}
options = options || {}
this.hostname = options.hostname || 'api.mybitx.com'
this.hostname = options.hostname || 'api.luno.com'
this.port = options.port || 443
this.ca = options.ca
this.pair = options.pair || 'XBTZAR'
Expand Down
4 changes: 2 additions & 2 deletions test/UnitTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tap.test('BitX constructor', {autoend: true}, function (t) {

tap.test('should have default options', function (tt) {
var bitx = new BitX()
tt.equal(bitx.hostname, 'api.mybitx.com')
tt.equal(bitx.hostname, 'api.luno.com')
tt.equal(bitx.port, 443)
tt.equal(bitx.pair, 'XBTZAR')
tt.end()
Expand Down Expand Up @@ -67,7 +67,7 @@ tap.test('Internal', {autoend: true}, function (t) {
'Accept': 'application/json',
'Accept-Charset': 'utf-8'
},
hostname: 'api.mybitx.com',
hostname: 'api.luno.com',
path: '/api/1/' + path,
port: 443,
auth: keyId + ':' + keySecret
Expand Down

0 comments on commit 945aff5

Please sign in to comment.