bitfinexws1
bitfinex websocket, v1 , a better , self reconnecting, parsing all responses.
this websocket handels reconnection, and heartbeat, parses and handles all events, allows authentication. parses all messages into objects,
you use send method to subscribe to chnnels as described in the bitfinex api v1 manual,
and this library handles and parses the response, on events you specified it returnes the parsed responses in easy to use objects.
i did my best to parse all messages.
donate bitcoins to: 1QJybGtq3wA3vz8izWvDMRTsrQL3RVDK9T
BitfinexWS1(API_KEY,API_SECRET,channels_and_events,subscribe,parsers)
this is a factory method it returns an object with some access to settings and other things. one useful thing is the status of it bitfinexws.ready (bool)
to use without authentication put "" in API_KEY and in API_SECRET.
the main channel (0) called account.
the event names are as described in the documentation
the api described at https://docs.bitfinex.com/v1/reference
look at the parsers to know the names of the parameters or just try it...
// example: var BitfinexWS1=;var bitfinexws=;
idea:
is possible to inherit from BitfinexWS1.better_parsers to modify just a part of it:
var myparsers= book_snapshot: BitfinexWS1parsersno_parse;myparsers__proto__=BitfinexWS1better_parsers;
parser
update parser receives an array of arguments.
snapshot parser recevies the array of objects.
is possible to put reference to your parsers methods like i did, i made with better parsers
in the examplpe it uses all the parses i like it is defined here: (look for line ' module.exports.better_parsers={ ' ) https://github.com/shimondoodkin/bitfinexws1/blob/master/index.js#L1123
to see all the parsers look in the code each function parser function is defined here: (look for line ' ///parsers ' ) https://github.com/shimondoodkin/bitfinexws1/blob/master/index.js#L508