22[ ![ Build Status] ( https://travis-ci.org/bausmeier/node-bitx.png )] ( https://travis-ci.org/bausmeier/node-bitx )
33[ ![ codecov] ( https://codecov.io/gh/bausmeier/node-bitx/branch/master/graph/badge.svg )] ( https://codecov.io/gh/bausmeier/node-bitx )
44
5- A simple wrapper for the Luno API.
5+ A simple wrapper for the Luno API. The module supports promise and callbacks.
66
77## Usage
88Add bitx as a dependency:
@@ -14,7 +14,7 @@ $ npm install --save bitx
1414### BitX([ keyId, keySecret, ] [ options ] )
1515To 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
17- The optional options argument can be used to override the default options. The default options are equivalent to:
17+ The optional ` options ` argument can be used to override the default options. The default options are equivalent to:
1818
1919``` javascript
2020{
@@ -32,9 +32,11 @@ For details about the API endpoints see https://www.luno.com/en/developers/api.
3232The arguments passed to the callback function for each method are:
3333
34341 . An error or ` null ` if no error occurred.
35- 1 . An object containing the data returned by the BitX API.
35+ 1 . An object containing the data returned by the Luno API.
3636
37- ### getTicker([ options, ] callback)
37+ The ` callback ` function is optional. If the ` callback ` is not provided, the methods return a promise.
38+
39+ ### getTicker([ options, ] [ callback ] )
3840GET https://api.luno.com/api/1/ticker/XBTZAR
3941
4042Default options:
@@ -51,7 +53,7 @@ Example:
5153bitx .getTicker (function (err , ticker ) {});
5254```
5355
54- ### getAllTickers(callback)
56+ ### getAllTickers([ callback] )
5557GET https://api.luno.com/api/1/tickers
5658
5759Example:
@@ -60,7 +62,7 @@ Example:
6062bitx .getAllTickers (function (err , tickers ) {});
6163```
6264
63- ### getOrderBook([ options, ] callback)
65+ ### getOrderBook([ options, ] [ callback ] )
6466GET https://api.luno.com/api/1/orderbook
6567
6668Default options:
@@ -77,7 +79,7 @@ Example:
7779bitx .getOrderBook (function (err , orderBook ) {});
7880```
7981
80- ### getTrades([ options, ] callback)
82+ ### getTrades([ options, ] [ callback ] )
8183GET https://api.luno.com/api/1/trades
8284
8385Default options:
@@ -94,7 +96,7 @@ Example:
9496bitx .getTrades (function (err , trades ) {});
9597```
9698
97- ### getTradeList([ options, ] callback)
99+ ### getTradeList([ options, ] [ callback ] )
98100GET https://api.luno.com/api/1/listtrades
99101
100102Default options:
@@ -111,7 +113,7 @@ Example:
111113bitx .getTradeList ({sort_desc: true , limit: 10 }, function (err , tradeList ) {});
112114```
113115
114- ### getOrderList([ options, ] callback)
116+ ### getOrderList([ options, ] [ callback ] )
115117GET https://api.luno.com/api/1/listorders
116118
117119Default options:
@@ -129,7 +131,7 @@ Example:
129131bitx .getOrderList ({state: ' PENDING' }, function (err , orderList ) {});
130132```
131133
132- ### getBalance([ asset, ] callback)
134+ ### getBalance([ asset, ] [ callback ] )
133135GET https://api.luno.com/api/1/balance
134136
135137Example:
@@ -138,7 +140,7 @@ Example:
138140bitx .getBalance (' ZAR' , function (err , balance ) {});
139141```
140142
141- ### getFundingAddress(asset, [ options, ] callback)
143+ ### getFundingAddress(asset, [ options, ] [ callback ] )
142144GET https://api.luno.com/api/1/funding_address
143145
144146Default options:
@@ -155,7 +157,7 @@ Example:
155157bitx .getFundingAddress (' XBT' , {address: ' B1tC0InExAMPL3fundIN6AdDreS5t0Use' }, function (err , fundingAddress ) {});
156158```
157159
158- ### createFundingAddress(asset, callback)
160+ ### createFundingAddress(asset, [ callback] )
159161POST https://api.luno.com/api/1/funding_address
160162
161163Example:
@@ -164,7 +166,7 @@ Example:
164166bitx .createFundingAddress (' XBT' , function (err , fundingAddress ) {});
165167```
166168
167- ### getFeeInfo([ options, ] callback)
169+ ### getFeeInfo([ options, ] [ callback ] )
168170GET https://api.luno.com/api/1/fee_info
169171
170172Default options:
@@ -181,7 +183,7 @@ Example:
181183bitx .getFeeInfo ({pair: ' XBTZAR' }, function (err , feeInfo ) {});
182184```
183185
184- ### postBuyOrder(volume, price, [ options, ] callback)
186+ ### postBuyOrder(volume, price, [ options, ] [ callback ] )
185187POST https://api.luno.com/api/1/postorder
186188
187189Example:
@@ -190,7 +192,7 @@ Example:
190192bitx .postBuyOrder (9999.99 , 0.01 , function (err , order ) {});
191193```
192194
193- ### postSellOrder(volume, price, [ options, ] callback)
195+ ### postSellOrder(volume, price, [ options, ] [ callback ] )
194196POST https://api.luno.com/api/1/postorder
195197
196198Example:
@@ -199,7 +201,7 @@ Example:
199201bitx .postSellOrder (0.01 , 9999.99 , function (err , order ) {});
200202```
201203
202- ### postMarketBuyOrder(volume, [ options, ] callback)
204+ ### postMarketBuyOrder(volume, [ options, ] [ callback ] )
203205POST https://api.luno.com/api/1/marketorder
204206
205207Example:
@@ -208,7 +210,7 @@ Example:
208210bitx .postMarketBuyOrder (0.01 , function (err , order ) {});
209211```
210212
211- ### postMarketSellOrder(volume, [ options, ] callback)
213+ ### postMarketSellOrder(volume, [ options, ] [ callback ] )
212214POST https://api.luno.com/api/1/marketorder
213215
214216Example:
@@ -217,7 +219,7 @@ Example:
217219bitx .postMarketSellOrder (0.01 , function (err , order ) {});
218220```
219221
220- ### stopOrder(orderId, callback)
222+ ### stopOrder(orderId, [ callback] )
221223POST https://api.luno.com/api/1/stoporder
222224
223225Example:
@@ -226,7 +228,7 @@ Example:
226228bitx .stopOrder (' BXMC2CJ7HNB88U4' , function (err , result ) {});
227229```
228230
229- ### getOrder(orderId, callback)
231+ ### getOrder(orderId, [ callback] )
230232GET https://api.luno.com/api/1/orders/{orderId}
231233
232234Example:
@@ -235,7 +237,7 @@ Example:
235237bitx .getOrder (' BXHW6PFRRXKFSB4' , function (err , result ) {});
236238```
237239
238- ### getTransactions(asset, [ options, ] callback)
240+ ### getTransactions(asset, [ options, ] [ callback ] )
239241GET https://api.luno.com/api/1/transactions
240242
241243Default options:
@@ -252,7 +254,7 @@ Example:
252254bitx .getTransactions (' XBT' , {offset: 5 , limit: 20 }, function (err , transactions ) {});
253255```
254256
255- ### getWithdrawals(callback)
257+ ### getWithdrawals([ callback] )
256258GET https://api.luno.com/api/1/withdrawals
257259
258260Example:
@@ -261,7 +263,7 @@ Example:
261263bitx .getWithdrawals (function (err , withdrawals ) {});
262264```
263265
264- ### getWithdrawal(withdrawalId, callback)
266+ ### getWithdrawal(withdrawalId, [ callback] )
265267GET https://api.luno.com/api/1/withdrawals/{withdrawalId}
266268
267269Example:
@@ -270,7 +272,7 @@ Example:
270272bitx .getWithdrawal (' 1212' , function (err , withdrawal ) {});
271273```
272274
273- ### requestWithdrawal(type, amount, callback)
275+ ### requestWithdrawal(type, amount, [ callback] )
274276POST https://api.luno.com/api/1/withdrawals
275277
276278Example:
@@ -279,7 +281,7 @@ Example:
279281bitx .requestWithdrawal (' ZAR_EFT' , 1000 , function (err , withdrawal ) {});
280282```
281283
282- ### cancelWithdrawal(withdrawalId, callback)
284+ ### cancelWithdrawal(withdrawalId, [ callback] )
283285DELETE https://api.luno.com/api/1/withdrawals/{withdrawalId}
284286
285287Example:
0 commit comments