npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bitmex-socket

v3.0.2

Published

Connect and emit data from BitMEX Websocket API.

Downloads

5

Readme

bitmex-socket

All-in-one solution to handling connection and data send/receive to BitMEX. See DOCS.md for examples.

If you like my work, please let me know:
[email protected]
Find me in the BitMEX trollbox as notwilson

A jesture of notice or a token of appreciation:

  • ETH: 0xd9979f482da58b4432d0f52eb456f7dd1f4897e6
  • BTC: 1HzR3Vyu231E8SsGLUbNYSb92bn6MGLEaV
  • LTC: LTBHggmnrMACoB3JAH8rMy9r8hGxum7ZSw
  • XRP: rBgnUKAEiFhCRLPoYNPPe3JUWayRjP6Ayg (destination tag: 536785858)

Changelog

3.X

  • 3.0.2

    • Re-re-re-re-re-added in ping-pong timer. Child sockets will also send ping/pongs through their parent sockets and BitMEX side is cool with that.
    • Started adding proper notation for functions.
    • Bug Fix: this in place of variable refernce in function.
  • 3.0.1

    • Bug Fix: standalone: true ignored the autoconn: true option.
  • 3.0.0

    • Added DOCS.md
    • Another Complete rewrite. Five minutes into a bot and the flaws of the last one were apparent.

2.X

  • 2.1.0
    • Added full object breakdown for the objects this library exports.
    • Removed stream.reply() and socket.command() in lieu of internal event messages _download and _upload. stream.on('_download', type, reply) for all raw messages received on the socket. To send commands back stream.emit('_upload', { }) with the object being a valid message to BitMEX. { op: "subscribe", args: "trade" } for example. To change the message type, add a type item to the object. { type: 2 } sends an empty dc message.
    • Subscriptions to specific channels (trade:XBTUSD) now emit their events under the global table and emit a second param for the channel. stream.on('subscribe', (table, channel) => {}) If channel is omitted, it's the global table subscribe(table), otherwise it's a specific one subscribe(table:symbol).
    • Added REST API to BitmexStream object. stream.send(dir, type = 'GET', data = {}). Streams that have authenticated on the socket may also perform private REST functions such as making new orders or whatever other permissions the API key allows.
  • 2.0.2
    • Fixed bug in stream.on('partial|insert|update|delete', (table, data, row) => {}): data was sending wrong data object.
    • Added force param to stream.authenticate(key, secret, force = false): stream.authenticate() won't add the authenticate message to socket queue if stream isn't already connected unless force is true. It will however add the supplied key/secret to the secureContext for authentication later if connect() is called manually.
    • Added changelog.
  • 2.0.1
    • Added ping/pong back for main socket.
    • Improved docs somewhat with examples on disconnect() and connect()
  • 2.0.0
    • Complete rewrite and simplification of base library.