Skip to content

Commit c0c9d0e

Browse files
committed
v2.0.0
1 parent 380e7b0 commit c0c9d0e

File tree

10 files changed

+302
-330
lines changed

10 files changed

+302
-330
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
### 2.0.0 (2022-07-13)
1+
### 2.0.0 (2022-07-14)
22

33
* Repository detached from original (and the fork is now stand alone)
4-
* Add `apiCallRate` value to the error message, when an `ErrTooManyRequests` occurs
4+
* all Bitx usages renamed to Luno
5+
* Add `apiCallRate` value to the error message, when an `ErrTooManyRequests` occurs
6+
* remove method `getLimits()`
57

68
### 1.10.0 (2022-06-20)
79

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013, 2014 Brett Ausmeier
3+
Copyright (c) dutu@protonmail.com
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

README.md

Lines changed: 39 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
1-
# bitx-api-node
1+
# luno-api-node
22

33
A simple wrapper for the Luno API. The module supports promise and callbacks.
44

5-
> This module is forked from https://github.com/bausmeier/node-bitx.
6-
> Since the original repository seems not to be maintained anymore, starting with version v1.10.1 this fork has been detached from original repository, and it is now stand alone. Contributions starting with v1.10.1 are not pull-requested to original repository.
5+
> This module is forked from https://github.com/bausmeier/node-luno.
6+
> Since the original repository seems not to be maintained anymore, starting with version v1.10.1 this fork has been detached from original repository, and it is now stand alone. Contributions are not pull-requested to original repository.
77
88
## Usage
9-
Add bitx as a dependency:
9+
Add luno as a dependency:
1010

1111
```bash
12-
$ npm install --save bitx-api-node
13-
```
14-
or
15-
```bash
16-
$ npm install --save "git+https://github.com/dutu/bitx-api-node"
12+
$ npm install --save luno-api-node
1713
```
1814

1915

20-
### BitX([keyId, keySecret][options])
16+
### Luno([keyId, keySecret][options])
2117
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.
2218

2319
The optional `options` argument can be used to override the default options. The default options are equivalent to:
@@ -44,7 +40,7 @@ See Luno API documentation for applicable rate limitations: https://www.luno.com
4440
Example:
4541

4642
```javascript
47-
console.log(bitx.apiCallRate)
43+
console.log(luno.apiCallRate)
4844
```
4945

5046

@@ -66,14 +62,14 @@ Default options:
6662

6763
```javascript
6864
{
69-
pair: bitx.pair
65+
pair: luno.pair
7066
}
7167
```
7268

7369
Example:
7470

7571
```javascript
76-
bitx.getTicker(function(err, ticker) {});
72+
luno.getTicker(function(err, ticker) {});
7773
```
7874

7975
### getAllTickers([callback])
@@ -82,7 +78,7 @@ GET https://api.luno.com/api/1/tickers
8278
Example:
8379

8480
```javascript
85-
bitx.getAllTickers(function(err, tickers) {});
81+
luno.getAllTickers(function(err, tickers) {});
8682
```
8783

8884
### getOrderBook([options][, callback])
@@ -92,14 +88,14 @@ Default options:
9288

9389
```javascript
9490
{
95-
pair: bitx.pair
91+
pair: luno.pair
9692
}
9793
```
9894

9995
Example:
10096

10197
```javascript
102-
bitx.getOrderBook(function(err, orderBook) {});
98+
luno.getOrderBook(function(err, orderBook) {});
10399
```
104100

105101
### getTrades([options][, callback])
@@ -109,14 +105,14 @@ Default options:
109105

110106
```javascript
111107
{
112-
pair: bitx.pair
108+
pair: luno.pair
113109
}
114110
```
115111

116112
Example:
117113

118114
```javascript
119-
bitx.getTrades(function(err, trades) {});
115+
luno.getTrades(function(err, trades) {});
120116
```
121117

122118
### getTradeList([options][, callback])
@@ -126,14 +122,14 @@ Default options:
126122

127123
```javascript
128124
{
129-
pair: bitx.pair
125+
pair: luno.pair
130126
}
131127
```
132128

133129
Example:
134130

135131
```javascript
136-
bitx.getTradeList({sort_desc: true, limit: 10}, function(err, tradeList) {});
132+
luno.getTradeList({sort_desc: true, limit: 10}, function(err, tradeList) {});
137133
```
138134

139135
### getOrderList([options][, callback])
@@ -143,15 +139,15 @@ Default options:
143139

144140
```javascript
145141
{
146-
pair: bitx.pair,
142+
pair: luno.pair,
147143
state: undefined
148144
}
149145
```
150146

151147
Example:
152148

153149
```javascript
154-
bitx.getOrderList({state: 'PENDING'}, function(err, orderList) {});
150+
luno.getOrderList({state: 'PENDING'}, function(err, orderList) {});
155151
```
156152

157153
### getOrderListV2([options][, callback])
@@ -161,15 +157,15 @@ Default options:
161157

162158
```javascript
163159
{
164-
pair: bitx.pair,
160+
pair: luno.pair,
165161
state: undefined
166162
}
167163
```
168164

169165
Example:
170166

171167
```javascript
172-
bitx.getOrderListV2({ closed: true }, function(err, orderList) {});
168+
luno.getOrderListV2({ closed: true }, function(err, orderList) {});
173169
```
174170

175171
### getOrderListV3(options[, callback])
@@ -178,7 +174,7 @@ GET https://api.luno.com/api/exchange/3/order
178174
Example:
179175

180176
```javascript
181-
bitx.getOrderListV3({id: 'BXMC2CJ7HNB88U4' }, function(err, orderList) {});
177+
luno.getOrderListV3({id: 'BXMC2CJ7HNB88U4' }, function(err, orderList) {});
182178
```
183179

184180
### getBalance([asset][, callback])
@@ -187,7 +183,7 @@ GET https://api.luno.com/api/1/balance
187183
Example:
188184

189185
```javascript
190-
bitx.getBalance('ZAR', function(err, balance) {});
186+
luno.getBalance('ZAR', function(err, balance) {});
191187
```
192188

193189
### getFundingAddress(asset[, options][, callback])
@@ -204,7 +200,7 @@ Default options:
204200
Example:
205201

206202
```javascript
207-
bitx.getFundingAddress('XBT', {address: 'B1tC0InExAMPL3fundIN6AdDreS5t0Use'}, function(err, fundingAddress) {});
203+
luno.getFundingAddress('XBT', {address: 'B1tC0InExAMPL3fundIN6AdDreS5t0Use'}, function(err, fundingAddress) {});
208204
```
209205

210206
### createFundingAddress(asset[, callback])
@@ -213,7 +209,7 @@ POST https://api.luno.com/api/1/funding_address
213209
Example:
214210

215211
```javascript
216-
bitx.createFundingAddress('XBT', function(err, fundingAddress) {});
212+
luno.createFundingAddress('XBT', function(err, fundingAddress) {});
217213
```
218214

219215
### getFeeInfo([options][, callback])
@@ -223,14 +219,14 @@ Default options:
223219

224220
```javascript
225221
{
226-
pair: bitx.pair
222+
pair: luno.pair
227223
}
228224
```
229225

230226
Example:
231227

232228
```javascript
233-
bitx.getFeeInfo({pair: 'XBTZAR'}, function(err, feeInfo) {});
229+
luno.getFeeInfo({pair: 'XBTZAR'}, function(err, feeInfo) {});
234230
```
235231

236232
### postBuyOrder(volume, price[, options][, callback])
@@ -239,7 +235,7 @@ POST https://api.luno.com/api/1/postorder
239235
Example:
240236

241237
```javascript
242-
bitx.postBuyOrder(9999.99, 0.01, function(err, order) {});
238+
luno.postBuyOrder(9999.99, 0.01, function(err, order) {});
243239
```
244240

245241
### postSellOrder(volume, price[, options][, callback])
@@ -248,7 +244,7 @@ POST https://api.luno.com/api/1/postorder
248244
Example:
249245

250246
```javascript
251-
bitx.postSellOrder(0.01, 9999.99, function(err, order) {});
247+
luno.postSellOrder(0.01, 9999.99, function(err, order) {});
252248
```
253249

254250
### postMarketBuyOrder(volume[, options][, callback])
@@ -257,7 +253,7 @@ POST https://api.luno.com/api/1/marketorder
257253
Example:
258254

259255
```javascript
260-
bitx.postMarketBuyOrder(0.01, function(err, order) {});
256+
luno.postMarketBuyOrder(0.01, function(err, order) {});
261257
```
262258

263259
### postMarketSellOrder(volume[, options][, callback])
@@ -266,7 +262,7 @@ POST https://api.luno.com/api/1/marketorder
266262
Example:
267263

268264
```javascript
269-
bitx.postMarketSellOrder(0.01, function(err, order) {});
265+
luno.postMarketSellOrder(0.01, function(err, order) {});
270266
```
271267

272268
### stopOrder(orderId[, callback])
@@ -275,7 +271,7 @@ POST https://api.luno.com/api/1/stoporder
275271
Example:
276272

277273
```javascript
278-
bitx.stopOrder('BXMC2CJ7HNB88U4', function(err, result) {});
274+
luno.stopOrder('BXMC2CJ7HNB88U4', function(err, result) {});
279275
```
280276

281277
### getOrder(orderId[, callback])
@@ -284,7 +280,7 @@ GET https://api.luno.com/api/1/orders/{orderId}
284280
Example:
285281

286282
```javascript
287-
bitx.getOrder('BXHW6PFRRXKFSB4', function(err, result) {});
283+
luno.getOrder('BXHW6PFRRXKFSB4', function(err, result) {});
288284
```
289285

290286
### getOrderV2(orderId[, callback])
@@ -293,7 +289,7 @@ GET https://api.luno.com/api/exchange/2/orders/{orderId}
293289
Example:
294290

295291
```javascript
296-
bitx.getOrder('BXHW6PFRRXKFSB4', function(err, result) {});
292+
luno.getOrder('BXHW6PFRRXKFSB4', function(err, result) {});
297293
```
298294

299295
### getTransactions(asset[, options][, callback])
@@ -310,7 +306,7 @@ Default options:
310306
Example:
311307

312308
```javascript
313-
bitx.getTransactions('XBT', {offset: 5, limit: 20}, function(err, transactions) {});
309+
luno.getTransactions('XBT', {offset: 5, limit: 20}, function(err, transactions) {});
314310
```
315311

316312
### getWithdrawals([callback])
@@ -319,7 +315,7 @@ GET https://api.luno.com/api/1/withdrawals
319315
Example:
320316

321317
```javascript
322-
bitx.getWithdrawals(function(err, withdrawals) {});
318+
luno.getWithdrawals(function(err, withdrawals) {});
323319
```
324320

325321
### getWithdrawal(withdrawalId[, callback])
@@ -328,7 +324,7 @@ GET https://api.luno.com/api/1/withdrawals/{withdrawalId}
328324
Example:
329325

330326
```javascript
331-
bitx.getWithdrawal('1212', function(err, withdrawal) {});
327+
luno.getWithdrawal('1212', function(err, withdrawal) {});
332328
```
333329

334330
### requestWithdrawal(type, amount[, callback])
@@ -337,7 +333,7 @@ POST https://api.luno.com/api/1/withdrawals
337333
Example:
338334

339335
```javascript
340-
bitx.requestWithdrawal('ZAR_EFT', 1000, function(err, withdrawal) {});
336+
luno.requestWithdrawal('ZAR_EFT', 1000, function(err, withdrawal) {});
341337
```
342338

343339
### cancelWithdrawal(withdrawalId[, callback])
@@ -346,11 +342,9 @@ DELETE https://api.luno.com/api/1/withdrawals/{withdrawalId}
346342
Example:
347343

348344
```javascript
349-
bitx.cancelWithdrawal('1212', function(err, withdrawal) {});
345+
luno.cancelWithdrawal('1212', function(err, withdrawal) {});
350346
```
351347

352348
## Contributing
353349

354-
Like my work? Please donate **1E1sebnWax5Br2mp8y9dox6oX9Snmf42uz**.
355-
356-
Don't like it? Open a pull request or create an issue and help me improve it.
350+
Open a pull request or create an issue and help me improve it.

examples/ticker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict'
22

3-
var BitX = require('../lib/BitX')
3+
var Luno = require('../lib/luno')
44

5-
var bitx = new BitX()
5+
var luno = new Luno()
66

7-
bitx.getTicker(function (err, ticker) {
7+
luno.getTicker(function (err, ticker) {
88
if (err) {
99
throw err
1010
}

0 commit comments

Comments
 (0)