Skip to content

Commit 11e469a

Browse files
f3rnoJacobPlaster
authored andcommitted
(refactor) rm vestigial comments + lint
1 parent b4e7ee9 commit 11e469a

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
A Node.JS reference implementation of the Bitfinex API
66

7-
### Features
7+
## Features
88

99
* Official implementation
1010
* REST v2 API
1111
* WebSockets v2 API
1212
* WebSockets v1 API
1313

14-
1514
## Installation
15+
1616
```bash
1717
npm i --save bitfinex-api-node
1818
```
@@ -35,6 +35,7 @@ Official API documentation at [https://docs.bitfinex.com/v2/reference](https://d
3535
### Examples
3636

3737
Sending an order & tracking status:
38+
3839
```js
3940
const ws = bfx.ws()
4041

@@ -73,6 +74,7 @@ ws.open()
7374
```
7475

7576
Cancel all open orders
77+
7678
```js
7779
const ws = bfx.ws(2)
7880

@@ -96,6 +98,7 @@ ws.open()
9698
```
9799

98100
Subscribe to trades by pair
101+
99102
```js
100103
const ws = bfx.ws(2)
101104

@@ -114,9 +117,9 @@ ws.onTradeEntry({ symbol: 'tBTCUSD' }, (trades) => {
114117
ws.open()
115118
```
116119

117-
## Version 2.0.0 Breaking changes:
120+
## Version 2.0.0 Breaking changes
118121

119-
### constructor takes only an options object now, including the API keys.
122+
### constructor takes only an options object now, including the API keys
120123

121124
Old:
122125

examples/rest2/order-history.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const rest = bfx.rest(2, { transform: true })
1616
const pair = String(args[2])
1717
const symbol = pair[0] === 't' ? pair : `t${pair}`
1818

19-
// TODO: natural lang start/end query args (a library must exist)
2019
const START = Date.now() - (30 * 24 * 60 * 60 * 1000 * 1000)
2120
const END = Date.now()
2221
const LIMIT = 25

examples/rest2/trade-history.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const rest = bfx.rest(2, { transform: true })
1616
const pair = String(args[2])
1717
const symbol = pair[0] === 't' ? pair : `t${pair}`
1818

19-
// TODO: natural lang start/end query args (a library must exist)
2019
const START = Date.now() - (30 * 24 * 60 * 60 * 1000 * 1000)
2120
const END = Date.now()
2221
const LIMIT = 25

index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,20 @@ class BFX {
4848
}
4949
}
5050

51+
/**
52+
* Returns an arguments map ready to pass to a transport constructor
53+
*
54+
* @param {Object} extraOpts - options to pass to transport
55+
*/
5156
_getTransportPayload (extraOpts) {
52-
return Object.assign({
57+
return {
5358
apiKey: this._apiKey,
5459
apiSecret: this._apiSecret,
5560
authToken: this._authToken,
5661
company: this._company,
57-
transform: this._transform
58-
}, extraOpts)
62+
transform: this._transform,
63+
...extraOpts
64+
}
5965
}
6066

6167
/**

lib/transports/ws2.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ class WSv2 extends EventEmitter {
481481
* @private
482482
*/
483483
_onWSOpen () {
484-
// TODO: Add _resetState() method for this, see _onWSClose
485484
this._isOpen = true
486485
this._isReconnecting = false
487486
this._packetWDLastTS = Date.now()
@@ -640,7 +639,7 @@ class WSv2 extends EventEmitter {
640639
}
641640

642641
if (msg.length < 2) return
643-
if (msg[1] === 'hb') return // TODO: optionally track seq
642+
if (msg[1] === 'hb') return
644643

645644
if (channelData.channel === 'book') {
646645
if (type === 'cs') {

0 commit comments

Comments
 (0)