Skip to content

Commit b7fc949

Browse files
f3rnoJacobPlaster
authored andcommitted
(feature) normalize docs, bump to 2.0.11
1 parent 846d2c9 commit b7fc949

File tree

11 files changed

+634
-1094
lines changed

11 files changed

+634
-1094
lines changed

.github/PULL_REQUEST_TEMPLATE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
### PR status:
1414
- [ ] Version bumped
1515
- [ ] Change-log updated
16+
- [ ] Documentation updated

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
3.0.1
2+
- docs: update
3+
14
3.0.0
25
- Updates function rest2.withdraw to v2 functionality
36
- Updates function rest2.transfer to v2 functionality

README.md

Lines changed: 27 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,40 @@
1-
# Bitfinex Trading API for Node.JS. Bitcoin, Ether and Litecoin trading
1+
# Bitfinex WSv2 Trading API for Node.JS
22

33
[![Build Status](https://travis-ci.org/bitfinexcom/bitfinex-api-node.svg?branch=master)](https://travis-ci.org/bitfinexcom/bitfinex-api-node)
44

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

7+
### Features
8+
79
* Official implementation
810
* REST v2 API
911
* WebSockets v2 API
12+
* WebSockets v1 API
1013

11-
Documentation at [https://docs.bitfinex.com/v2/reference](https://docs.bitfinex.com/v2/reference)
1214

1315
## Installation
1416
```bash
15-
npm i bitfinex-api-node
17+
npm i --save bitfinex-api-node
1618
```
1719

18-
See `doc/` for REST2 and WS2 API methods.
19-
20-
## Usage
21-
22-
Version 2.0.0 of `bitfinex-api-node` supports the v2 REST and WebSocket APIs. The clients for v1 of those APIs are maintained for backwards compatibility, but deprecated.
23-
24-
To minimize the data sent over the network the transmitted data is structured in arrays. In order to reconstruct key / value pairs, set `opts.transform` to `true` when creating an interface.
25-
26-
The BFX constructor returns a client manager, which can be used to create clients for v1 & v2 of the REST and WebSocket APIs via `.rest()` and `.ws()`. The options for the clients can be defined here, or passed in later
20+
### Quickstart
2721

2822
```js
29-
const BFX = require('bitfinex-api-node')
30-
31-
const bfx = new BFX({
32-
apiKey: '...',
33-
apiSecret: '...',
23+
const { WSv2 } = require('bitfinex-api-node')
24+
const ws = new WSv2({ transform: true })
3425

35-
ws: {
36-
autoReconnect: true,
37-
seqAudit: true,
38-
packetWDDelay: 10 * 1000
39-
}
40-
})
26+
// do something with ws client
4127
```
4228

43-
The clients are cached per version/options pair, and default to version 2:
29+
### Docs
4430

45-
```js
46-
let ws2 = bfx.ws() //
47-
ws2 = bfx.ws(2) // same client
48-
const ws1 = bfx.ws(1)
31+
See `docs/ws2.md` for WS2 API methods, and `docs/usage.md` for a basic usage guide. For executable examples, refer to the `examples/` folder.
4932

50-
const rest2 = bfx.rest(2, {
51-
// options
52-
})
53-
```
33+
Official API documentation at [https://docs.bitfinex.com/v2/reference](https://docs.bitfinex.com/v2/reference)
5434

55-
The websocket client is recommended for receiving realtime data & notifications
56-
on completed actions.
57-
58-
For more examples, check the `examples/` folder.
59-
60-
### NOTE: v1 REST and WS clients
61-
62-
Both v1 client classes & server APIs have been deprecated, and will be removed. In the meantime, some methods available via `RESTv1` have been exposed on `RESTv2` to prevent future migration issues. Although the underlying implementation of these methods is likely to change once they are fully ported to v2, the signatures should remain the same.
63-
64-
## WS2 Example: Sending an order & tracking status
35+
### Examples
6536

37+
Sending an order & tracking status:
6638
```js
6739
const ws = bfx.ws()
6840

@@ -100,10 +72,9 @@ ws.once('auth', () => {
10072
ws.open()
10173
```
10274

103-
## WS2 Example: Cancel all open orders
104-
75+
Cancel all open orders
10576
```js
106-
const ws = bfx.ws()
77+
const ws = bfx.ws(2)
10778

10879
ws.on('error', (err) => console.log(err))
10980
ws.on('open', ws.auth.bind(ws))
@@ -124,10 +95,9 @@ ws.onOrderSnapshot({}, (orders) => {
12495
ws.open()
12596
```
12697

127-
## WS2 Example: Subscribe to trades by pair
128-
98+
Subscribe to trades by pair
12999
```js
130-
const ws = bfx.ws()
100+
const ws = bfx.ws(2)
131101

132102
ws.on('error', (err) => console.log(err))
133103
ws.on('open', () => {
@@ -214,4 +184,12 @@ If you enable sequencing on v2 of the WS API, each incoming packet will have a p
214184

215185
### What is the difference between R* and P* order books?
216186

217-
Order books with precision `R0` are considered 'raw' and contain entries for each order submitted to the book, whereas `P*` books contain entries for each price level (which aggregate orders).
187+
Order books with precision `R0` are considered 'raw' and contain entries for each order submitted to the book, whereas `P*` books contain entries for each price level (which aggregate orders).
188+
189+
### Contributing
190+
191+
1. Fork it
192+
2. Create your feature branch (`git checkout -b my-new-feature`)
193+
3. Commit your changes (`git commit -am 'Add some feature'`)
194+
4. Push to the branch (`git push origin my-new-feature`)
195+
5. Create a new Pull Request

doc/order.md

Lines changed: 0 additions & 160 deletions
This file was deleted.

0 commit comments

Comments
 (0)