Skip to content

Latest commit

 

History

History
239 lines (198 loc) · 7.64 KB

DOCS.md

File metadata and controls

239 lines (198 loc) · 7.64 KB

BitfinexWS

Kind: global class

new BitfinexWS(APIKey, APISecret)

Handles communitaction with Bitfinex WebSocket API.

Param Type
APIKey sting
APISecret string

bitfinexWS.subscribeOrderBook([pair], [precision], [length])

Subscribe to Order book updates. Snapshot will be sended as multiple updates. Event will be emited as PAIRNAME_book.

Kind: instance method of BitfinexWS
See: http://docs.bitfinex.com/#order-books

Param Type Description
[pair] string BTCUSD, LTCUSD or LTCBTC. Default BTCUSD
[precision] string Level of price aggregation (P0, P1, P2, P3). The default is P0.
[length] string Number of price points. 25 (default) or 100.

bitfinexWS.subscribeTrades([pair])

Subscribe to trades. Snapshot will be sended as multiple updates. Event will be emited as PAIRNAME_trades.

Kind: instance method of BitfinexWS
See: http://docs.bitfinex.com/#trades75

Param Type Description
[pair] string BTCUSD, LTCUSD or LTCBTC. Default BTCUSD

bitfinexWS.subscribeTicker([pair])

Subscribe to ticker updates. The ticker is a high level overview of the state of the market. It shows you the current best bid and ask, as well as the last trade price.

Event will be emited as PAIRNAME_ticker.

Kind: instance method of BitfinexWS
See: http://docs.bitfinex.com/#ticker76

Param Type Description
[pair] string BTCUSD, LTCUSD or LTCBTC. Default BTCUSD

bitfinexWS.unsubscribe(chanId)

Unsubscribe to a channel.

Kind: instance method of BitfinexWS

Param Type Description
chanId number ID of the channel received on subscribed event.

bitfinexWS.auth()

Autenticate the user. Will receive executed traded updates.

Kind: instance method of BitfinexWS
See: http://docs.bitfinex.com/#wallet-updates

"message"

Kind: event emitted by BitfinexWS

"open"

WebSocket connection is open. Ready to send.

Kind: event emitted by BitfinexWS

"error"

Kind: event emitted by BitfinexWS

"close"

WebSocket connection is closed.

Kind: event emitted by BitfinexWS

"subscribed"

Kind: event emitted by BitfinexWS
Properties

Name Type Description
channel string Channel type
pair string Currency pair.
chanId number Channel ID sended by Bitfinex

"auth"

Kind: event emitted by BitfinexWS

"ps"

position snapshot

Kind: event emitted by BitfinexWS

"pn"

new position

Kind: event emitted by BitfinexWS

"pu"

position update

Kind: event emitted by BitfinexWS

"pc"

position close

Kind: event emitted by BitfinexWS

"ws"

wallet snapshot

Kind: event emitted by BitfinexWS

"ws"

wallet snapshot

Kind: event emitted by BitfinexWS

"os"

order snapshot

Kind: event emitted by BitfinexWS

"on"

new order

Kind: event emitted by BitfinexWS

"ou"

order update

Kind: event emitted by BitfinexWS

"oc"

order cancel

Kind: event emitted by BitfinexWS

"te"

trade executed

Kind: event emitted by BitfinexWS

"tu"

trade execution update

Kind: event emitted by BitfinexWS

"ticker"

Kind: event emitted by BitfinexWS
Properties

Name Type
bid number
bidSize number
ask number
askSize number
dailyChange number
dailyChangePerc number
lastPrice number
volume number
high number
low number

"trade"

Kind: event emitted by BitfinexWS
See: http://docs.bitfinex.com/#trades75
Properties

Name Type
seq string
timestamp number
price number
amount number

"orderbook"

Kind: event emitted by BitfinexWS
See: http://docs.bitfinex.com/#order-books
Properties

Name Type
price string
count number
amount number

BitfinexWS.WebSocketURI : String

Kind: static constant of BitfinexWS