Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitmex-orderbook

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitmex-orderbook - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

2

package.json
{
"name": "bitmex-orderbook",
"version": "1.1.1",
"version": "1.2.0",
"description": "BitMEX WebSocket-driven Orderbook",

@@ -5,0 +5,0 @@ "main": "src/OrderBook.js",

@@ -6,12 +6,13 @@ const crypto = require("crypto");

class BitMEXClient {
constructor(options = {}) {
this.socket = options.socket || null;
constructor({ socket, endpoint, apiKey, apiSecret, testmode, heartbeat, ...socketOptions } = {}) {
this.socketOptions = socketOptions;
this.socket = socket || null;
this.connected = this.socket && this.socket.readyState === WebSocket.OPEN;
this.apiKey = options.apiKey || null;
this.apiSecret = options.apiSecret || null;
this.testmode = options.testmode === true || options.testmode === "true";
this.apiKey = apiKey || null;
this.apiSecret = apiSecret || null;
this.testmode = testmode === true || testmode === "true";
this.endpoint =
options.endpoint ||
endpoint ||
(this.testmode ? "wss://testnet.bitmex.com/realtime" : "wss://www.bitmex.com/realtime");
this.heartbeat = options.heartbeat || 15 * 1000;
this.heartbeat = heartbeat || 15 * 1000;
this.subscriptions = new Set();

@@ -23,8 +24,6 @@ this.lastError = null;

return new Promise((resolve, reject) => {
if (this.socket) {
return resolve(true);
if (!this.socket) {
this.socket = new WebSocket(this.endpoint, this.socketOptions);
}
this.socket = new WebSocket(this.endpoint);
let heartbeatInterval;

@@ -31,0 +30,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc