btc-api-node 1.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of btc-api-node might be problematic. Click here for more details.
- package/.istanbul.yml +53 -0
- package/.travis.yml +5 -0
- package/CHANGELOG +33 -0
- package/LICENSE.md +21 -0
- package/README.md +211 -0
- package/doc/order.md +160 -0
- package/doc/rest2.md +573 -0
- package/doc/ws2.md +925 -0
- package/examples/bfx.js +26 -0
- package/examples/rest2/order_history.js +29 -0
- package/examples/rest2/symbols.js +15 -0
- package/examples/rest2/tickers.js +24 -0
- package/examples/rest2/trade_history.js +28 -0
- package/examples/ws2/auth.js +31 -0
- package/examples/ws2/calc.js +33 -0
- package/examples/ws2/cancel_all.js +35 -0
- package/examples/ws2/cancel_all_buf.js +39 -0
- package/examples/ws2/candles.js +36 -0
- package/examples/ws2/info_events.js +40 -0
- package/examples/ws2/oc_multi.js +50 -0
- package/examples/ws2/order_books.js +37 -0
- package/examples/ws2/orders.js +67 -0
- package/examples/ws2/ox_multi.js +61 -0
- package/examples/ws2/sequencing.js +23 -0
- package/examples/ws2/ticker.js +20 -0
- package/examples/ws2/trades.js +27 -0
- package/index.js +24 -0
- package/lib/model.js +25 -0
- package/lib/models/alert.js +25 -0
- package/lib/models/balance_info.js +21 -0
- package/lib/models/candle.js +33 -0
- package/lib/models/funding_credit.js +61 -0
- package/lib/models/funding_info.js +16 -0
- package/lib/models/funding_loan.js +64 -0
- package/lib/models/funding_offer.js +60 -0
- package/lib/models/funding_trade.js +33 -0
- package/lib/models/index.js +23 -0
- package/lib/models/margin_info.js +29 -0
- package/lib/models/notification.js +31 -0
- package/lib/models/order.js +288 -0
- package/lib/models/order_book.js +214 -0
- package/lib/models/position.js +43 -0
- package/lib/models/tick.js +83 -0
- package/lib/models/trade.js +43 -0
- package/lib/models/trade_tick.js +29 -0
- package/lib/models/wallet.js +34 -0
- package/lib/transports/rest.js +391 -0
- package/lib/transports/rest2.js +597 -0
- package/lib/transports/ws.js +323 -0
- package/lib/transports/ws2.js +1729 -0
- package/lib/util/gen_auth_sig.js +23 -0
- package/lib/util/index.js +11 -0
- package/lib/util/is_snapshot.js +5 -0
- package/lib/util/nonce.js +5 -0
- package/package.json +39 -0
- package/test/fixtures/response-ticker-funding.json +1 -0
- package/test/fixtures/response-ticker-pairs.json +1 -0
- package/test/fixtures/response-trades-funding.json +1 -0
- package/test/fixtures/response-trades-pairs.json +1 -0
- package/test/fixtures/response-ws-1-orderbook-R0.json +51 -0
- package/test/fixtures/response-ws2-server-order-book-P0.json +1 -0
- package/test/fixtures/response-ws2-server-order-book-P1.json +1 -0
- package/test/fixtures/response-ws2-server-order-book-R0.json +1 -0
- package/test/fixtures/response-ws2-server-ticker-funding.json +1 -0
- package/test/fixtures/response-ws2-server-trades.json +1 -0
- package/test/helpers/test_model.js +71 -0
- package/test/index.js +131 -0
- package/test/lib/models/alert.js +12 -0
- package/test/lib/models/balance_info.js +12 -0
- package/test/lib/models/candle.js +12 -0
- package/test/lib/models/funding_credit.js +17 -0
- package/test/lib/models/funding_info.js +7 -0
- package/test/lib/models/funding_loan.js +17 -0
- package/test/lib/models/funding_offer.js +17 -0
- package/test/lib/models/funding_trade.js +15 -0
- package/test/lib/models/margin_info.js +15 -0
- package/test/lib/models/notification.js +14 -0
- package/test/lib/models/order.js +395 -0
- package/test/lib/models/order_book.js +188 -0
- package/test/lib/models/position.js +15 -0
- package/test/lib/models/tick.js +34 -0
- package/test/lib/models/trade.js +16 -0
- package/test/lib/models/trade_tick.js +14 -0
- package/test/lib/models/wallet.js +14 -0
- package/test/lib/transports/rest-1-integration.js +131 -0
- package/test/lib/transports/rest-2-integration.js +80 -0
- package/test/lib/transports/rest-2-issue-80-argument-length.js +61 -0
- package/test/lib/transports/rest-2-smoke-test.js +49 -0
- package/test/lib/transports/rest-2-unit.js +26 -0
- package/test/lib/transports/rest1.js +152 -0
- package/test/lib/transports/ws-1-handle-channel.js +83 -0
- package/test/lib/transports/ws-1-parsing.js +40 -0
- package/test/lib/transports/ws-1-test.js +275 -0
- package/test/lib/transports/ws2-integration.js +259 -0
- package/test/lib/transports/ws2-unit.js +1295 -0
- package/test/lib/util/is_snapshot.js +20 -0
- package/test/lib/util/nonce.js +20 -0
package/doc/ws2.md
ADDED
|
@@ -0,0 +1,925 @@
|
|
|
1
|
+
<a name="WSv2"></a>
|
|
2
|
+
|
|
3
|
+
## WSv2
|
|
4
|
+
Communicates with v2 of the Bitfinex WebSocket API
|
|
5
|
+
|
|
6
|
+
**Kind**: global class
|
|
7
|
+
|
|
8
|
+
* [WSv2](#WSv2)
|
|
9
|
+
* [new WSv2()](#new_WSv2_new)
|
|
10
|
+
* [.open()](#WSv2+open) ⇒ <code>Promise</code>
|
|
11
|
+
* [.close(code, reason)](#WSv2+close) ⇒ <code>Promise</code>
|
|
12
|
+
* [.auth(calc)](#WSv2+auth) ⇒ <code>Promise</code>
|
|
13
|
+
* [.reconnect()](#WSv2+reconnect) ⇒ <code>Promise</code>
|
|
14
|
+
* [.getOB(symbol)](#WSv2+getOB) ⇒ <code>OrderBook</code>
|
|
15
|
+
* [.getCandles(key)](#WSv2+getCandles) ⇒ <code>Array</code>
|
|
16
|
+
* [.managedSubscribe(channel, identifier, payload)](#WSv2+managedSubscribe) ⇒ <code>boolean</code>
|
|
17
|
+
* [.managedUnsubscribe(channel, identifier)](#WSv2+managedUnsubscribe) ⇒ <code>boolean</code>
|
|
18
|
+
* [.getChannelData(opts)](#WSv2+getChannelData) ⇒ <code>Object</code>
|
|
19
|
+
* [.send(msg)](#WSv2+send)
|
|
20
|
+
* [.enableSequencing(args)](#WSv2+enableSequencing)
|
|
21
|
+
* [.onServerRestart(cb)](#WSv2+onServerRestart)
|
|
22
|
+
* [.onMaintenanceStart(cb)](#WSv2+onMaintenanceStart)
|
|
23
|
+
* [.onMaintenanceEnd(cb)](#WSv2+onMaintenanceEnd)
|
|
24
|
+
* [.subscribe(channel, payload)](#WSv2+subscribe)
|
|
25
|
+
* [.subscribeTicker(symbol)](#WSv2+subscribeTicker) ⇒ <code>boolean</code>
|
|
26
|
+
* [.subscribeTrades(symbol)](#WSv2+subscribeTrades) ⇒ <code>boolean</code>
|
|
27
|
+
* [.subscribeOrderBook(symbol, prec, len)](#WSv2+subscribeOrderBook) ⇒ <code>boolean</code>
|
|
28
|
+
* [.subscribeCandles(key)](#WSv2+subscribeCandles) ⇒ <code>boolean</code>
|
|
29
|
+
* [.unsubscribe(chanId)](#WSv2+unsubscribe)
|
|
30
|
+
* [.unsubscribeTicker(symbol)](#WSv2+unsubscribeTicker) ⇒ <code>boolean</code>
|
|
31
|
+
* [.unsubscribeTrades(symbol)](#WSv2+unsubscribeTrades) ⇒ <code>boolean</code>
|
|
32
|
+
* [.unsubscribeOrderBook(symbol, prec, len)](#WSv2+unsubscribeOrderBook) ⇒ <code>boolean</code>
|
|
33
|
+
* [.unsubscribeCandles(symbol, frame)](#WSv2+unsubscribeCandles) ⇒ <code>boolean</code>
|
|
34
|
+
* [.removeListeners(cbGID)](#WSv2+removeListeners)
|
|
35
|
+
* [.requestCalc(prefixes)](#WSv2+requestCalc)
|
|
36
|
+
* [.submitOrder(order)](#WSv2+submitOrder) ⇒ <code>Promise</code>
|
|
37
|
+
* [.cancelOrder(order)](#WSv2+cancelOrder) ⇒ <code>Promise</code>
|
|
38
|
+
* [.cancelOrders(orders)](#WSv2+cancelOrders) ⇒ <code>Promise</code>
|
|
39
|
+
* [.submitOrderMultiOp(opPayloads)](#WSv2+submitOrderMultiOp) ⇒ <code>Promise</code>
|
|
40
|
+
* [.isAuthenticated()](#WSv2+isAuthenticated) ⇒ <code>boolean</code>
|
|
41
|
+
* [.isOpen()](#WSv2+isOpen) ⇒ <code>boolean</code>
|
|
42
|
+
* [.onInfoMessage(code, cb)](#WSv2+onInfoMessage)
|
|
43
|
+
* [.onMessage(opts, cb)](#WSv2+onMessage)
|
|
44
|
+
* [.onCandle(opts, cb)](#WSv2+onCandle)
|
|
45
|
+
* [.onOrderBook(opts, cb)](#WSv2+onOrderBook)
|
|
46
|
+
* [.onTrades(opts, cb)](#WSv2+onTrades)
|
|
47
|
+
* [.onTicker(opts, cb)](#WSv2+onTicker)
|
|
48
|
+
* [.onOrderSnapshot(opts, cb)](#WSv2+onOrderSnapshot)
|
|
49
|
+
* [.onOrderNew(opts, cb)](#WSv2+onOrderNew)
|
|
50
|
+
* [.onOrderUpdate(opts, cb)](#WSv2+onOrderUpdate)
|
|
51
|
+
* [.onOrderClose(opts, cb)](#WSv2+onOrderClose)
|
|
52
|
+
* [.onPositionSnapshot(opts, cb)](#WSv2+onPositionSnapshot)
|
|
53
|
+
* [.onPositionNew(opts, cb)](#WSv2+onPositionNew)
|
|
54
|
+
* [.onPositionUpdate(opts, cb)](#WSv2+onPositionUpdate)
|
|
55
|
+
* [.onPositionClose(opts, cb)](#WSv2+onPositionClose)
|
|
56
|
+
* [.onTradeEntry(opts, cb)](#WSv2+onTradeEntry)
|
|
57
|
+
* [.onTradeUpdate(opts, cb)](#WSv2+onTradeUpdate)
|
|
58
|
+
* [.onFundingOfferSnapshot(opts, cb)](#WSv2+onFundingOfferSnapshot)
|
|
59
|
+
* [.onFundingOfferNew(opts, cb)](#WSv2+onFundingOfferNew)
|
|
60
|
+
* [.onFundingOfferUpdate(opts, cb)](#WSv2+onFundingOfferUpdate)
|
|
61
|
+
* [.onFundingOfferClose(opts, cb)](#WSv2+onFundingOfferClose)
|
|
62
|
+
* [.onFundingCreditSnapshot(opts, cb)](#WSv2+onFundingCreditSnapshot)
|
|
63
|
+
* [.onFundingCreditNew(opts, cb)](#WSv2+onFundingCreditNew)
|
|
64
|
+
* [.onFundingCreditUpdate(opts, cb)](#WSv2+onFundingCreditUpdate)
|
|
65
|
+
* [.onFundingCreditClose(opts, cb)](#WSv2+onFundingCreditClose)
|
|
66
|
+
* [.onFundingLoanSnapshot(opts, cb)](#WSv2+onFundingLoanSnapshot)
|
|
67
|
+
* [.onFundingLoanNew(opts, cb)](#WSv2+onFundingLoanNew)
|
|
68
|
+
* [.onFundingLoanUpdate(opts, cb)](#WSv2+onFundingLoanUpdate)
|
|
69
|
+
* [.onFundingLoanClose(opts, cb)](#WSv2+onFundingLoanClose)
|
|
70
|
+
* [.onWalletSnapshot(opts, cb)](#WSv2+onWalletSnapshot)
|
|
71
|
+
* [.onWalletUpdate(opts, cb)](#WSv2+onWalletUpdate)
|
|
72
|
+
* [.onBalanceInfoUpdate(opts, cb)](#WSv2+onBalanceInfoUpdate)
|
|
73
|
+
* [.onMarginInfoUpdate(opts, cb)](#WSv2+onMarginInfoUpdate)
|
|
74
|
+
* [.onFundingInfoUpdate(opts, cb)](#WSv2+onFundingInfoUpdate)
|
|
75
|
+
* [.onFundingTradeEntry(opts, cb)](#WSv2+onFundingTradeEntry)
|
|
76
|
+
* [.onFundingTradeUpdate(opts, cb)](#WSv2+onFundingTradeUpdate)
|
|
77
|
+
* [.onNotification(opts, cb)](#WSv2+onNotification)
|
|
78
|
+
|
|
79
|
+
<a name="new_WSv2_new"></a>
|
|
80
|
+
|
|
81
|
+
### new WSv2()
|
|
82
|
+
Instantiate a new ws2 transport. Does not auto-open
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
| Param | Type | Description |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| opts.apiKey | <code>string</code> | |
|
|
88
|
+
| opts.apiSecret | <code>string</code> | |
|
|
89
|
+
| opts.url | <code>string</code> | ws connection url |
|
|
90
|
+
| opts.orderOpBufferDelay | <code>number</code> | multi-order op batching timeout |
|
|
91
|
+
| opts.transform | <code>boolean</code> | if true, packets are converted to models |
|
|
92
|
+
| opts.agent | <code>Object</code> | optional node agent for ws connection (proxy) |
|
|
93
|
+
| opts.manageOrderBooks | <code>boolean</code> | enable local OB persistence |
|
|
94
|
+
| opts.manageCandles | <code>boolean</code> | enable local candle persistence |
|
|
95
|
+
| opts.seqAudit | <code>boolean</code> | enable sequence numbers & verification |
|
|
96
|
+
| opts.autoReconnect | <code>boolean</code> | if true, we will reconnect on close |
|
|
97
|
+
| opts.reconnectDelay | <code>number</code> | optional, defaults to 1000 (ms) |
|
|
98
|
+
| opts.packetWDDelay | <code>number</code> | watch-dog forced reconnection delay |
|
|
99
|
+
|
|
100
|
+
<a name="WSv2+open"></a>
|
|
101
|
+
|
|
102
|
+
### wSv2.open() ⇒ <code>Promise</code>
|
|
103
|
+
Opens a connection to the API server. Rejects with an error if a
|
|
104
|
+
connection is already open. Resolves on success
|
|
105
|
+
|
|
106
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
107
|
+
**Returns**: <code>Promise</code> - p
|
|
108
|
+
<a name="WSv2+close"></a>
|
|
109
|
+
|
|
110
|
+
### wSv2.close(code, reason) ⇒ <code>Promise</code>
|
|
111
|
+
Closes the active connection. If there is none, rejects with a promise.
|
|
112
|
+
Resolves on success
|
|
113
|
+
|
|
114
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
115
|
+
|
|
116
|
+
| Param | Type | Description |
|
|
117
|
+
| --- | --- | --- |
|
|
118
|
+
| code | <code>number</code> | passed to ws |
|
|
119
|
+
| reason | <code>string</code> | passed to ws |
|
|
120
|
+
|
|
121
|
+
<a name="WSv2+auth"></a>
|
|
122
|
+
|
|
123
|
+
### wSv2.auth(calc) ⇒ <code>Promise</code>
|
|
124
|
+
Generates & sends an authentication packet to the server; if already
|
|
125
|
+
authenticated, rejects with an error. Resolves on success
|
|
126
|
+
|
|
127
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
128
|
+
**Returns**: <code>Promise</code> - p
|
|
129
|
+
|
|
130
|
+
| Param | Type | Default | Description |
|
|
131
|
+
| --- | --- | --- | --- |
|
|
132
|
+
| calc | <code>number</code> | <code>0</code> | optional, default is 0 |
|
|
133
|
+
|
|
134
|
+
<a name="WSv2+reconnect"></a>
|
|
135
|
+
|
|
136
|
+
### wSv2.reconnect() ⇒ <code>Promise</code>
|
|
137
|
+
Utility method to close & re-open the ws connection. Re-authenticates if
|
|
138
|
+
previously authenticated
|
|
139
|
+
|
|
140
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
141
|
+
**Returns**: <code>Promise</code> - p - resolves on completion
|
|
142
|
+
<a name="WSv2+getOB"></a>
|
|
143
|
+
|
|
144
|
+
### wSv2.getOB(symbol) ⇒ <code>OrderBook</code>
|
|
145
|
+
Returns an up-to-date copy of the order book for the specified symbol, or
|
|
146
|
+
null if no OB is managed for that symbol.
|
|
147
|
+
Set `manageOrderBooks: true` in the constructor to use.
|
|
148
|
+
|
|
149
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
150
|
+
**Returns**: <code>OrderBook</code> - ob - null if not found
|
|
151
|
+
|
|
152
|
+
| Param | Type |
|
|
153
|
+
| --- | --- |
|
|
154
|
+
| symbol | <code>string</code> |
|
|
155
|
+
|
|
156
|
+
<a name="WSv2+getCandles"></a>
|
|
157
|
+
|
|
158
|
+
### wSv2.getCandles(key) ⇒ <code>Array</code>
|
|
159
|
+
Fetch a reference to the full set of synced candles for the specified key.
|
|
160
|
+
Set `manageCandles: true` in the constructor to use.
|
|
161
|
+
|
|
162
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
163
|
+
**Returns**: <code>Array</code> - candles - empty array if none exist
|
|
164
|
+
|
|
165
|
+
| Param | Type |
|
|
166
|
+
| --- | --- |
|
|
167
|
+
| key | <code>string</code> |
|
|
168
|
+
|
|
169
|
+
<a name="WSv2+managedSubscribe"></a>
|
|
170
|
+
|
|
171
|
+
### wSv2.managedSubscribe(channel, identifier, payload) ⇒ <code>boolean</code>
|
|
172
|
+
Subscribes and tracks subscriptions per channel/identifier pair. If
|
|
173
|
+
already subscribed to the specified pair, nothing happens.
|
|
174
|
+
|
|
175
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
176
|
+
**Returns**: <code>boolean</code> - subSent
|
|
177
|
+
|
|
178
|
+
| Param | Type | Description |
|
|
179
|
+
| --- | --- | --- |
|
|
180
|
+
| channel | <code>string</code> | |
|
|
181
|
+
| identifier | <code>string</code> | for uniquely identifying the ref count |
|
|
182
|
+
| payload | <code>Object</code> | merged with sub packet |
|
|
183
|
+
|
|
184
|
+
<a name="WSv2+managedUnsubscribe"></a>
|
|
185
|
+
|
|
186
|
+
### wSv2.managedUnsubscribe(channel, identifier) ⇒ <code>boolean</code>
|
|
187
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
188
|
+
**Returns**: <code>boolean</code> - unsubSent
|
|
189
|
+
|
|
190
|
+
| Param | Type |
|
|
191
|
+
| --- | --- |
|
|
192
|
+
| channel | <code>string</code> |
|
|
193
|
+
| identifier | <code>string</code> |
|
|
194
|
+
|
|
195
|
+
<a name="WSv2+getChannelData"></a>
|
|
196
|
+
|
|
197
|
+
### wSv2.getChannelData(opts) ⇒ <code>Object</code>
|
|
198
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
199
|
+
**Returns**: <code>Object</code> - chanData - null if not found
|
|
200
|
+
|
|
201
|
+
| Param | Type | Description |
|
|
202
|
+
| --- | --- | --- |
|
|
203
|
+
| opts | <code>Object</code> | |
|
|
204
|
+
| opts.chanId | <code>number</code> | |
|
|
205
|
+
| opts.channel | <code>string</code> | optional |
|
|
206
|
+
| opts.symbol | <code>string</code> | optional |
|
|
207
|
+
| opts.key | <code>string</code> | optional |
|
|
208
|
+
|
|
209
|
+
<a name="WSv2+send"></a>
|
|
210
|
+
|
|
211
|
+
### wSv2.send(msg)
|
|
212
|
+
Send a packet to the WS server
|
|
213
|
+
|
|
214
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
215
|
+
|
|
216
|
+
| Param | Type | Description |
|
|
217
|
+
| --- | --- | --- |
|
|
218
|
+
| msg | <code>\*</code> | packet, gets stringified |
|
|
219
|
+
|
|
220
|
+
<a name="WSv2+enableSequencing"></a>
|
|
221
|
+
|
|
222
|
+
### wSv2.enableSequencing(args)
|
|
223
|
+
Configures the seq flag to enable sequencing (packet number) for this
|
|
224
|
+
connection. When enabled, the seq number will be the last value of
|
|
225
|
+
channel packet arrays.
|
|
226
|
+
|
|
227
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
228
|
+
|
|
229
|
+
| Param | Type | Description |
|
|
230
|
+
| --- | --- | --- |
|
|
231
|
+
| args | <code>Object</code> | |
|
|
232
|
+
| args.audit | <code>boolean</code> | if true, an error is emitted on invalid seq |
|
|
233
|
+
|
|
234
|
+
<a name="WSv2+onServerRestart"></a>
|
|
235
|
+
|
|
236
|
+
### wSv2.onServerRestart(cb)
|
|
237
|
+
Register a callback in case of a ws server restart message; Use this to
|
|
238
|
+
call reconnect() if needed. (code 20051)
|
|
239
|
+
|
|
240
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
241
|
+
|
|
242
|
+
| Param | Type |
|
|
243
|
+
| --- | --- |
|
|
244
|
+
| cb | <code>method</code> |
|
|
245
|
+
|
|
246
|
+
<a name="WSv2+onMaintenanceStart"></a>
|
|
247
|
+
|
|
248
|
+
### wSv2.onMaintenanceStart(cb)
|
|
249
|
+
Register a callback in case of a 'maintenance started' message from the
|
|
250
|
+
server. This is a good time to pause server packets until maintenance ends
|
|
251
|
+
|
|
252
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
253
|
+
|
|
254
|
+
| Param | Type |
|
|
255
|
+
| --- | --- |
|
|
256
|
+
| cb | <code>method</code> |
|
|
257
|
+
|
|
258
|
+
<a name="WSv2+onMaintenanceEnd"></a>
|
|
259
|
+
|
|
260
|
+
### wSv2.onMaintenanceEnd(cb)
|
|
261
|
+
Register a callback to be notified of a maintenance period ending
|
|
262
|
+
|
|
263
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
264
|
+
|
|
265
|
+
| Param | Type |
|
|
266
|
+
| --- | --- |
|
|
267
|
+
| cb | <code>method</code> |
|
|
268
|
+
|
|
269
|
+
<a name="WSv2+subscribe"></a>
|
|
270
|
+
|
|
271
|
+
### wSv2.subscribe(channel, payload)
|
|
272
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
273
|
+
|
|
274
|
+
| Param | Type | Description |
|
|
275
|
+
| --- | --- | --- |
|
|
276
|
+
| channel | <code>string</code> | |
|
|
277
|
+
| payload | <code>Object</code> | optional extra packet data |
|
|
278
|
+
|
|
279
|
+
<a name="WSv2+subscribeTicker"></a>
|
|
280
|
+
|
|
281
|
+
### wSv2.subscribeTicker(symbol) ⇒ <code>boolean</code>
|
|
282
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
283
|
+
**Returns**: <code>boolean</code> - subscribed
|
|
284
|
+
|
|
285
|
+
| Param | Type |
|
|
286
|
+
| --- | --- |
|
|
287
|
+
| symbol | <code>string</code> |
|
|
288
|
+
|
|
289
|
+
<a name="WSv2+subscribeTrades"></a>
|
|
290
|
+
|
|
291
|
+
### wSv2.subscribeTrades(symbol) ⇒ <code>boolean</code>
|
|
292
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
293
|
+
**Returns**: <code>boolean</code> - subscribed
|
|
294
|
+
|
|
295
|
+
| Param | Type |
|
|
296
|
+
| --- | --- |
|
|
297
|
+
| symbol | <code>string</code> |
|
|
298
|
+
|
|
299
|
+
<a name="WSv2+subscribeOrderBook"></a>
|
|
300
|
+
|
|
301
|
+
### wSv2.subscribeOrderBook(symbol, prec, len) ⇒ <code>boolean</code>
|
|
302
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
303
|
+
**Returns**: <code>boolean</code> - subscribed
|
|
304
|
+
|
|
305
|
+
| Param | Type | Default | Description |
|
|
306
|
+
| --- | --- | --- | --- |
|
|
307
|
+
| symbol | <code>string</code> | | |
|
|
308
|
+
| prec | <code>string</code> | <code>"P0"</code> | P0, P1, P2, or P3 (default P0) |
|
|
309
|
+
| len | <code>string</code> | <code>"25"</code> | 25 or 100 (default 25) |
|
|
310
|
+
|
|
311
|
+
<a name="WSv2+subscribeCandles"></a>
|
|
312
|
+
|
|
313
|
+
### wSv2.subscribeCandles(key) ⇒ <code>boolean</code>
|
|
314
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
315
|
+
**Returns**: <code>boolean</code> - subscribed
|
|
316
|
+
|
|
317
|
+
| Param | Type |
|
|
318
|
+
| --- | --- |
|
|
319
|
+
| key | <code>string</code> |
|
|
320
|
+
|
|
321
|
+
<a name="WSv2+unsubscribe"></a>
|
|
322
|
+
|
|
323
|
+
### wSv2.unsubscribe(chanId)
|
|
324
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
325
|
+
|
|
326
|
+
| Param | Type |
|
|
327
|
+
| --- | --- |
|
|
328
|
+
| chanId | <code>number</code> |
|
|
329
|
+
|
|
330
|
+
<a name="WSv2+unsubscribeTicker"></a>
|
|
331
|
+
|
|
332
|
+
### wSv2.unsubscribeTicker(symbol) ⇒ <code>boolean</code>
|
|
333
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
334
|
+
**Returns**: <code>boolean</code> - unsubscribed
|
|
335
|
+
|
|
336
|
+
| Param | Type |
|
|
337
|
+
| --- | --- |
|
|
338
|
+
| symbol | <code>string</code> |
|
|
339
|
+
|
|
340
|
+
<a name="WSv2+unsubscribeTrades"></a>
|
|
341
|
+
|
|
342
|
+
### wSv2.unsubscribeTrades(symbol) ⇒ <code>boolean</code>
|
|
343
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
344
|
+
**Returns**: <code>boolean</code> - unsubscribed
|
|
345
|
+
|
|
346
|
+
| Param | Type |
|
|
347
|
+
| --- | --- |
|
|
348
|
+
| symbol | <code>string</code> |
|
|
349
|
+
|
|
350
|
+
<a name="WSv2+unsubscribeOrderBook"></a>
|
|
351
|
+
|
|
352
|
+
### wSv2.unsubscribeOrderBook(symbol, prec, len) ⇒ <code>boolean</code>
|
|
353
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
354
|
+
**Returns**: <code>boolean</code> - unsubscribed
|
|
355
|
+
|
|
356
|
+
| Param | Type | Default | Description |
|
|
357
|
+
| --- | --- | --- | --- |
|
|
358
|
+
| symbol | <code>string</code> | | |
|
|
359
|
+
| prec | <code>string</code> | <code>"P0"</code> | P0, P1, P2, or P3 (default P0) |
|
|
360
|
+
| len | <code>string</code> | <code>"25"</code> | 25 or 100 (default 25) |
|
|
361
|
+
|
|
362
|
+
<a name="WSv2+unsubscribeCandles"></a>
|
|
363
|
+
|
|
364
|
+
### wSv2.unsubscribeCandles(symbol, frame) ⇒ <code>boolean</code>
|
|
365
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
366
|
+
**Returns**: <code>boolean</code> - unsubscribed
|
|
367
|
+
|
|
368
|
+
| Param | Type | Description |
|
|
369
|
+
| --- | --- | --- |
|
|
370
|
+
| symbol | <code>string</code> | |
|
|
371
|
+
| frame | <code>string</code> | time frame |
|
|
372
|
+
|
|
373
|
+
<a name="WSv2+removeListeners"></a>
|
|
374
|
+
|
|
375
|
+
### wSv2.removeListeners(cbGID)
|
|
376
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
377
|
+
|
|
378
|
+
| Param | Type |
|
|
379
|
+
| --- | --- |
|
|
380
|
+
| cbGID | <code>string</code> |
|
|
381
|
+
|
|
382
|
+
<a name="WSv2+requestCalc"></a>
|
|
383
|
+
|
|
384
|
+
### wSv2.requestCalc(prefixes)
|
|
385
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
386
|
+
|
|
387
|
+
| Param | Type |
|
|
388
|
+
| --- | --- |
|
|
389
|
+
| prefixes | <code>Array.<string></code> |
|
|
390
|
+
|
|
391
|
+
<a name="WSv2+submitOrder"></a>
|
|
392
|
+
|
|
393
|
+
### wSv2.submitOrder(order) ⇒ <code>Promise</code>
|
|
394
|
+
Sends a new order to the server and resolves the returned promise once the
|
|
395
|
+
order submit is confirmed. Emits an error if not authenticated. The order
|
|
396
|
+
can be either an array, key/value map, or Order object instance.
|
|
397
|
+
|
|
398
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
399
|
+
**Returns**: <code>Promise</code> - p - resolves on submit notification
|
|
400
|
+
|
|
401
|
+
| Param | Type |
|
|
402
|
+
| --- | --- |
|
|
403
|
+
| order | <code>Object</code> | <code>Array</code> |
|
|
404
|
+
|
|
405
|
+
<a name="WSv2+cancelOrder"></a>
|
|
406
|
+
|
|
407
|
+
### wSv2.cancelOrder(order) ⇒ <code>Promise</code>
|
|
408
|
+
Cancels an order by ID and resolves the returned promise once the cancel is
|
|
409
|
+
confirmed. Emits an error if not authenticated. The ID can be passed as a
|
|
410
|
+
number, or taken from an order array/object.
|
|
411
|
+
|
|
412
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
413
|
+
**Returns**: <code>Promise</code> - p
|
|
414
|
+
|
|
415
|
+
| Param | Type |
|
|
416
|
+
| --- | --- |
|
|
417
|
+
| order | <code>Object</code> | <code>Array</code> | <code>number</code> |
|
|
418
|
+
|
|
419
|
+
<a name="WSv2+cancelOrders"></a>
|
|
420
|
+
|
|
421
|
+
### wSv2.cancelOrders(orders) ⇒ <code>Promise</code>
|
|
422
|
+
Cancels multiple orders, returns a promise that resolves once all
|
|
423
|
+
operations are confirmed.
|
|
424
|
+
|
|
425
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
426
|
+
**Returns**: <code>Promise</code> - p
|
|
427
|
+
**See**: cancelOrder
|
|
428
|
+
|
|
429
|
+
| Param | Type |
|
|
430
|
+
| --- | --- |
|
|
431
|
+
| orders | <code>Array.<Object></code> | <code>Array.<Array></code> | <code>Array.<number></code> |
|
|
432
|
+
|
|
433
|
+
<a name="WSv2+submitOrderMultiOp"></a>
|
|
434
|
+
|
|
435
|
+
### wSv2.submitOrderMultiOp(opPayloads) ⇒ <code>Promise</code>
|
|
436
|
+
Sends the op payloads to the server as an 'ox_multi' command. A promise is
|
|
437
|
+
returned and resolves immediately if authenticated, as no confirmation is
|
|
438
|
+
available for this message type.
|
|
439
|
+
|
|
440
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
441
|
+
**Returns**: <code>Promise</code> - p - rejects if not authenticated
|
|
442
|
+
|
|
443
|
+
| Param | Type |
|
|
444
|
+
| --- | --- |
|
|
445
|
+
| opPayloads | <code>Array.<Object></code> |
|
|
446
|
+
|
|
447
|
+
<a name="WSv2+isAuthenticated"></a>
|
|
448
|
+
|
|
449
|
+
### wSv2.isAuthenticated() ⇒ <code>boolean</code>
|
|
450
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
451
|
+
**Returns**: <code>boolean</code> - authenticated
|
|
452
|
+
<a name="WSv2+isOpen"></a>
|
|
453
|
+
|
|
454
|
+
### wSv2.isOpen() ⇒ <code>boolean</code>
|
|
455
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
456
|
+
**Returns**: <code>boolean</code> - open
|
|
457
|
+
<a name="WSv2+onInfoMessage"></a>
|
|
458
|
+
|
|
459
|
+
### wSv2.onInfoMessage(code, cb)
|
|
460
|
+
Registers a new callback to be called when a matching info message is
|
|
461
|
+
received.
|
|
462
|
+
|
|
463
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
464
|
+
|
|
465
|
+
| Param | Type | Description |
|
|
466
|
+
| --- | --- | --- |
|
|
467
|
+
| code | <code>number</code> | from WSv2.info.* |
|
|
468
|
+
| cb | <code>method</code> | |
|
|
469
|
+
|
|
470
|
+
<a name="WSv2+onMessage"></a>
|
|
471
|
+
|
|
472
|
+
### wSv2.onMessage(opts, cb)
|
|
473
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
474
|
+
|
|
475
|
+
| Param | Type | Description |
|
|
476
|
+
| --- | --- | --- |
|
|
477
|
+
| opts | <code>Object</code> | |
|
|
478
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
479
|
+
| cb | <code>Method</code> | |
|
|
480
|
+
|
|
481
|
+
<a name="WSv2+onCandle"></a>
|
|
482
|
+
|
|
483
|
+
### wSv2.onCandle(opts, cb)
|
|
484
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
485
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-public-candle
|
|
486
|
+
|
|
487
|
+
| Param | Type | Description |
|
|
488
|
+
| --- | --- | --- |
|
|
489
|
+
| opts | <code>Object</code> | |
|
|
490
|
+
| opts.key | <code>string</code> | candle set key, i.e. trade:30m:tBTCUSD |
|
|
491
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
492
|
+
| cb | <code>Method</code> | |
|
|
493
|
+
|
|
494
|
+
<a name="WSv2+onOrderBook"></a>
|
|
495
|
+
|
|
496
|
+
### wSv2.onOrderBook(opts, cb)
|
|
497
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
498
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-public-order-books
|
|
499
|
+
|
|
500
|
+
| Param | Type | Description |
|
|
501
|
+
| --- | --- | --- |
|
|
502
|
+
| opts | <code>Object</code> | |
|
|
503
|
+
| opts.symbol | <code>string</code> | |
|
|
504
|
+
| opts.prec | <code>string</code> | |
|
|
505
|
+
| opts.len | <code>string</code> | |
|
|
506
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
507
|
+
| cb | <code>Method</code> | |
|
|
508
|
+
|
|
509
|
+
<a name="WSv2+onTrades"></a>
|
|
510
|
+
|
|
511
|
+
### wSv2.onTrades(opts, cb)
|
|
512
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
513
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-public-trades
|
|
514
|
+
|
|
515
|
+
| Param | Type | Description |
|
|
516
|
+
| --- | --- | --- |
|
|
517
|
+
| opts | <code>Object</code> | |
|
|
518
|
+
| opts.pair | <code>string</code> | |
|
|
519
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
520
|
+
| cb | <code>Method</code> | |
|
|
521
|
+
|
|
522
|
+
<a name="WSv2+onTicker"></a>
|
|
523
|
+
|
|
524
|
+
### wSv2.onTicker(opts, cb)
|
|
525
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
526
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-public-ticker
|
|
527
|
+
|
|
528
|
+
| Param | Type | Description |
|
|
529
|
+
| --- | --- | --- |
|
|
530
|
+
| opts | <code>Object</code> | |
|
|
531
|
+
| opts.symbol | <code>string</code> | |
|
|
532
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
533
|
+
| cb | <code>Method</code> | |
|
|
534
|
+
|
|
535
|
+
<a name="WSv2+onOrderSnapshot"></a>
|
|
536
|
+
|
|
537
|
+
### wSv2.onOrderSnapshot(opts, cb)
|
|
538
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
539
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-orders
|
|
540
|
+
|
|
541
|
+
| Param | Type | Description |
|
|
542
|
+
| --- | --- | --- |
|
|
543
|
+
| opts | <code>Object</code> | |
|
|
544
|
+
| opts.symbol | <code>string</code> | |
|
|
545
|
+
| opts.gid | <code>number</code> | |
|
|
546
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
547
|
+
| cb | <code>Method</code> | |
|
|
548
|
+
|
|
549
|
+
<a name="WSv2+onOrderNew"></a>
|
|
550
|
+
|
|
551
|
+
### wSv2.onOrderNew(opts, cb)
|
|
552
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
553
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-orders
|
|
554
|
+
|
|
555
|
+
| Param | Type | Description |
|
|
556
|
+
| --- | --- | --- |
|
|
557
|
+
| opts | <code>Object</code> | |
|
|
558
|
+
| opts.symbol | <code>string</code> | |
|
|
559
|
+
| opts.gid | <code>number</code> | |
|
|
560
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
561
|
+
| cb | <code>Method</code> | |
|
|
562
|
+
|
|
563
|
+
<a name="WSv2+onOrderUpdate"></a>
|
|
564
|
+
|
|
565
|
+
### wSv2.onOrderUpdate(opts, cb)
|
|
566
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
567
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-orders
|
|
568
|
+
|
|
569
|
+
| Param | Type | Description |
|
|
570
|
+
| --- | --- | --- |
|
|
571
|
+
| opts | <code>Object</code> | |
|
|
572
|
+
| opts.symbol | <code>string</code> | |
|
|
573
|
+
| opts.gid | <code>number</code> | |
|
|
574
|
+
| opts.cid | <code>number</code> | |
|
|
575
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
576
|
+
| cb | <code>Method</code> | |
|
|
577
|
+
|
|
578
|
+
<a name="WSv2+onOrderClose"></a>
|
|
579
|
+
|
|
580
|
+
### wSv2.onOrderClose(opts, cb)
|
|
581
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
582
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-orders
|
|
583
|
+
|
|
584
|
+
| Param | Type | Description |
|
|
585
|
+
| --- | --- | --- |
|
|
586
|
+
| opts | <code>Object</code> | |
|
|
587
|
+
| opts.symbol | <code>string</code> | |
|
|
588
|
+
| opts.gid | <code>number</code> | |
|
|
589
|
+
| opts.cid | <code>number</code> | |
|
|
590
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
591
|
+
| cb | <code>Method</code> | |
|
|
592
|
+
|
|
593
|
+
<a name="WSv2+onPositionSnapshot"></a>
|
|
594
|
+
|
|
595
|
+
### wSv2.onPositionSnapshot(opts, cb)
|
|
596
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
597
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-position
|
|
598
|
+
|
|
599
|
+
| Param | Type | Description |
|
|
600
|
+
| --- | --- | --- |
|
|
601
|
+
| opts | <code>Object</code> | |
|
|
602
|
+
| opts.symbol | <code>string</code> | |
|
|
603
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
604
|
+
| cb | <code>Method</code> | |
|
|
605
|
+
|
|
606
|
+
<a name="WSv2+onPositionNew"></a>
|
|
607
|
+
|
|
608
|
+
### wSv2.onPositionNew(opts, cb)
|
|
609
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
610
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-position
|
|
611
|
+
|
|
612
|
+
| Param | Type | Description |
|
|
613
|
+
| --- | --- | --- |
|
|
614
|
+
| opts | <code>Object</code> | |
|
|
615
|
+
| opts.symbol | <code>string</code> | |
|
|
616
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
617
|
+
| cb | <code>Method</code> | |
|
|
618
|
+
|
|
619
|
+
<a name="WSv2+onPositionUpdate"></a>
|
|
620
|
+
|
|
621
|
+
### wSv2.onPositionUpdate(opts, cb)
|
|
622
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
623
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-position
|
|
624
|
+
|
|
625
|
+
| Param | Type | Description |
|
|
626
|
+
| --- | --- | --- |
|
|
627
|
+
| opts | <code>Object</code> | |
|
|
628
|
+
| opts.symbol | <code>string</code> | |
|
|
629
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
630
|
+
| cb | <code>Method</code> | |
|
|
631
|
+
|
|
632
|
+
<a name="WSv2+onPositionClose"></a>
|
|
633
|
+
|
|
634
|
+
### wSv2.onPositionClose(opts, cb)
|
|
635
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
636
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-position
|
|
637
|
+
|
|
638
|
+
| Param | Type | Description |
|
|
639
|
+
| --- | --- | --- |
|
|
640
|
+
| opts | <code>Object</code> | |
|
|
641
|
+
| opts.symbol | <code>string</code> | |
|
|
642
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
643
|
+
| cb | <code>Method</code> | |
|
|
644
|
+
|
|
645
|
+
<a name="WSv2+onTradeEntry"></a>
|
|
646
|
+
|
|
647
|
+
### wSv2.onTradeEntry(opts, cb)
|
|
648
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
649
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-trades
|
|
650
|
+
|
|
651
|
+
| Param | Type | Description |
|
|
652
|
+
| --- | --- | --- |
|
|
653
|
+
| opts | <code>Object</code> | |
|
|
654
|
+
| opts.pair | <code>string</code> | |
|
|
655
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
656
|
+
| cb | <code>Method</code> | |
|
|
657
|
+
|
|
658
|
+
<a name="WSv2+onTradeUpdate"></a>
|
|
659
|
+
|
|
660
|
+
### wSv2.onTradeUpdate(opts, cb)
|
|
661
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
662
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-trades
|
|
663
|
+
|
|
664
|
+
| Param | Type | Description |
|
|
665
|
+
| --- | --- | --- |
|
|
666
|
+
| opts | <code>Object</code> | |
|
|
667
|
+
| opts.pair | <code>string</code> | |
|
|
668
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
669
|
+
| cb | <code>Method</code> | |
|
|
670
|
+
|
|
671
|
+
<a name="WSv2+onFundingOfferSnapshot"></a>
|
|
672
|
+
|
|
673
|
+
### wSv2.onFundingOfferSnapshot(opts, cb)
|
|
674
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
675
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-offers
|
|
676
|
+
|
|
677
|
+
| Param | Type | Description |
|
|
678
|
+
| --- | --- | --- |
|
|
679
|
+
| opts | <code>Object</code> | |
|
|
680
|
+
| opts.symbol | <code>string</code> | |
|
|
681
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
682
|
+
| cb | <code>Method</code> | |
|
|
683
|
+
|
|
684
|
+
<a name="WSv2+onFundingOfferNew"></a>
|
|
685
|
+
|
|
686
|
+
### wSv2.onFundingOfferNew(opts, cb)
|
|
687
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
688
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-offers
|
|
689
|
+
|
|
690
|
+
| Param | Type | Description |
|
|
691
|
+
| --- | --- | --- |
|
|
692
|
+
| opts | <code>Object</code> | |
|
|
693
|
+
| opts.symbol | <code>string</code> | |
|
|
694
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
695
|
+
| cb | <code>Method</code> | |
|
|
696
|
+
|
|
697
|
+
<a name="WSv2+onFundingOfferUpdate"></a>
|
|
698
|
+
|
|
699
|
+
### wSv2.onFundingOfferUpdate(opts, cb)
|
|
700
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
701
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-offers
|
|
702
|
+
|
|
703
|
+
| Param | Type | Description |
|
|
704
|
+
| --- | --- | --- |
|
|
705
|
+
| opts | <code>Object</code> | |
|
|
706
|
+
| opts.symbol | <code>string</code> | |
|
|
707
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
708
|
+
| cb | <code>Method</code> | |
|
|
709
|
+
|
|
710
|
+
<a name="WSv2+onFundingOfferClose"></a>
|
|
711
|
+
|
|
712
|
+
### wSv2.onFundingOfferClose(opts, cb)
|
|
713
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
714
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-offers
|
|
715
|
+
|
|
716
|
+
| Param | Type | Description |
|
|
717
|
+
| --- | --- | --- |
|
|
718
|
+
| opts | <code>Object</code> | |
|
|
719
|
+
| opts.symbol | <code>string</code> | |
|
|
720
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
721
|
+
| cb | <code>Method</code> | |
|
|
722
|
+
|
|
723
|
+
<a name="WSv2+onFundingCreditSnapshot"></a>
|
|
724
|
+
|
|
725
|
+
### wSv2.onFundingCreditSnapshot(opts, cb)
|
|
726
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
727
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-credits
|
|
728
|
+
|
|
729
|
+
| Param | Type | Description |
|
|
730
|
+
| --- | --- | --- |
|
|
731
|
+
| opts | <code>Object</code> | |
|
|
732
|
+
| opts.symbol | <code>string</code> | |
|
|
733
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
734
|
+
| cb | <code>Method</code> | |
|
|
735
|
+
|
|
736
|
+
<a name="WSv2+onFundingCreditNew"></a>
|
|
737
|
+
|
|
738
|
+
### wSv2.onFundingCreditNew(opts, cb)
|
|
739
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
740
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-credits
|
|
741
|
+
|
|
742
|
+
| Param | Type | Description |
|
|
743
|
+
| --- | --- | --- |
|
|
744
|
+
| opts | <code>Object</code> | |
|
|
745
|
+
| opts.symbol | <code>string</code> | |
|
|
746
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
747
|
+
| cb | <code>Method</code> | |
|
|
748
|
+
|
|
749
|
+
<a name="WSv2+onFundingCreditUpdate"></a>
|
|
750
|
+
|
|
751
|
+
### wSv2.onFundingCreditUpdate(opts, cb)
|
|
752
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
753
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-credits
|
|
754
|
+
|
|
755
|
+
| Param | Type | Description |
|
|
756
|
+
| --- | --- | --- |
|
|
757
|
+
| opts | <code>Object</code> | |
|
|
758
|
+
| opts.symbol | <code>string</code> | |
|
|
759
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
760
|
+
| cb | <code>Method</code> | |
|
|
761
|
+
|
|
762
|
+
<a name="WSv2+onFundingCreditClose"></a>
|
|
763
|
+
|
|
764
|
+
### wSv2.onFundingCreditClose(opts, cb)
|
|
765
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
766
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-credits
|
|
767
|
+
|
|
768
|
+
| Param | Type | Description |
|
|
769
|
+
| --- | --- | --- |
|
|
770
|
+
| opts | <code>Object</code> | |
|
|
771
|
+
| opts.symbol | <code>string</code> | |
|
|
772
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
773
|
+
| cb | <code>Method</code> | |
|
|
774
|
+
|
|
775
|
+
<a name="WSv2+onFundingLoanSnapshot"></a>
|
|
776
|
+
|
|
777
|
+
### wSv2.onFundingLoanSnapshot(opts, cb)
|
|
778
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
779
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-loans
|
|
780
|
+
|
|
781
|
+
| Param | Type | Description |
|
|
782
|
+
| --- | --- | --- |
|
|
783
|
+
| opts | <code>Object</code> | |
|
|
784
|
+
| opts.symbol | <code>string</code> | |
|
|
785
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
786
|
+
| cb | <code>Method</code> | |
|
|
787
|
+
|
|
788
|
+
<a name="WSv2+onFundingLoanNew"></a>
|
|
789
|
+
|
|
790
|
+
### wSv2.onFundingLoanNew(opts, cb)
|
|
791
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
792
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-loans
|
|
793
|
+
|
|
794
|
+
| Param | Type | Description |
|
|
795
|
+
| --- | --- | --- |
|
|
796
|
+
| opts | <code>Object</code> | |
|
|
797
|
+
| opts.symbol | <code>string</code> | |
|
|
798
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
799
|
+
| cb | <code>Method</code> | |
|
|
800
|
+
|
|
801
|
+
<a name="WSv2+onFundingLoanUpdate"></a>
|
|
802
|
+
|
|
803
|
+
### wSv2.onFundingLoanUpdate(opts, cb)
|
|
804
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
805
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-loans
|
|
806
|
+
|
|
807
|
+
| Param | Type | Description |
|
|
808
|
+
| --- | --- | --- |
|
|
809
|
+
| opts | <code>Object</code> | |
|
|
810
|
+
| opts.symbol | <code>string</code> | |
|
|
811
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
812
|
+
| cb | <code>Method</code> | |
|
|
813
|
+
|
|
814
|
+
<a name="WSv2+onFundingLoanClose"></a>
|
|
815
|
+
|
|
816
|
+
### wSv2.onFundingLoanClose(opts, cb)
|
|
817
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
818
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-loans
|
|
819
|
+
|
|
820
|
+
| Param | Type | Description |
|
|
821
|
+
| --- | --- | --- |
|
|
822
|
+
| opts | <code>Object</code> | |
|
|
823
|
+
| opts.symbol | <code>string</code> | |
|
|
824
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
825
|
+
| cb | <code>Method</code> | |
|
|
826
|
+
|
|
827
|
+
<a name="WSv2+onWalletSnapshot"></a>
|
|
828
|
+
|
|
829
|
+
### wSv2.onWalletSnapshot(opts, cb)
|
|
830
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
831
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-wallets
|
|
832
|
+
|
|
833
|
+
| Param | Type | Description |
|
|
834
|
+
| --- | --- | --- |
|
|
835
|
+
| opts | <code>Object</code> | |
|
|
836
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
837
|
+
| cb | <code>Method</code> | |
|
|
838
|
+
|
|
839
|
+
<a name="WSv2+onWalletUpdate"></a>
|
|
840
|
+
|
|
841
|
+
### wSv2.onWalletUpdate(opts, cb)
|
|
842
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
843
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-wallets
|
|
844
|
+
|
|
845
|
+
| Param | Type | Description |
|
|
846
|
+
| --- | --- | --- |
|
|
847
|
+
| opts | <code>Object</code> | |
|
|
848
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
849
|
+
| cb | <code>Method</code> | |
|
|
850
|
+
|
|
851
|
+
<a name="WSv2+onBalanceInfoUpdate"></a>
|
|
852
|
+
|
|
853
|
+
### wSv2.onBalanceInfoUpdate(opts, cb)
|
|
854
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
855
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-balance
|
|
856
|
+
|
|
857
|
+
| Param | Type | Description |
|
|
858
|
+
| --- | --- | --- |
|
|
859
|
+
| opts | <code>Object</code> | |
|
|
860
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
861
|
+
| cb | <code>Method</code> | |
|
|
862
|
+
|
|
863
|
+
<a name="WSv2+onMarginInfoUpdate"></a>
|
|
864
|
+
|
|
865
|
+
### wSv2.onMarginInfoUpdate(opts, cb)
|
|
866
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
867
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-margin
|
|
868
|
+
|
|
869
|
+
| Param | Type | Description |
|
|
870
|
+
| --- | --- | --- |
|
|
871
|
+
| opts | <code>Object</code> | |
|
|
872
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
873
|
+
| cb | <code>Method</code> | |
|
|
874
|
+
|
|
875
|
+
<a name="WSv2+onFundingInfoUpdate"></a>
|
|
876
|
+
|
|
877
|
+
### wSv2.onFundingInfoUpdate(opts, cb)
|
|
878
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
879
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-funding
|
|
880
|
+
|
|
881
|
+
| Param | Type | Description |
|
|
882
|
+
| --- | --- | --- |
|
|
883
|
+
| opts | <code>Object</code> | |
|
|
884
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
885
|
+
| cb | <code>Method</code> | |
|
|
886
|
+
|
|
887
|
+
<a name="WSv2+onFundingTradeEntry"></a>
|
|
888
|
+
|
|
889
|
+
### wSv2.onFundingTradeEntry(opts, cb)
|
|
890
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
891
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-funding-trades
|
|
892
|
+
|
|
893
|
+
| Param | Type | Description |
|
|
894
|
+
| --- | --- | --- |
|
|
895
|
+
| opts | <code>Object</code> | |
|
|
896
|
+
| opts.symbol | <code>string</code> | |
|
|
897
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
898
|
+
| cb | <code>Method</code> | |
|
|
899
|
+
|
|
900
|
+
<a name="WSv2+onFundingTradeUpdate"></a>
|
|
901
|
+
|
|
902
|
+
### wSv2.onFundingTradeUpdate(opts, cb)
|
|
903
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
904
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-funding-trades
|
|
905
|
+
|
|
906
|
+
| Param | Type | Description |
|
|
907
|
+
| --- | --- | --- |
|
|
908
|
+
| opts | <code>Object</code> | |
|
|
909
|
+
| opts.symbol | <code>string</code> | |
|
|
910
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
911
|
+
| cb | <code>Method</code> | |
|
|
912
|
+
|
|
913
|
+
<a name="WSv2+onNotification"></a>
|
|
914
|
+
|
|
915
|
+
### wSv2.onNotification(opts, cb)
|
|
916
|
+
**Kind**: instance method of <code>[WSv2](#WSv2)</code>
|
|
917
|
+
**See**: https://docs.bitfinex.com/v2/reference#ws-auth-notifications
|
|
918
|
+
|
|
919
|
+
| Param | Type | Description |
|
|
920
|
+
| --- | --- | --- |
|
|
921
|
+
| opts | <code>Object</code> | |
|
|
922
|
+
| opts.type | <code>string</code> | |
|
|
923
|
+
| opts.cbGID | <code>string</code> | callback group id |
|
|
924
|
+
| cb | <code>Method</code> | |
|
|
925
|
+
|