Socket
Socket
Sign inDemoInstall

bitmex-realtime-api

Package Overview
Dependencies
42
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.0 to 0.4.0

18

lib/createSocket.js

@@ -85,12 +85,12 @@ 'use strict';

// By looking at what we're subscribed to, we can save time by only emitting those events.
const matchingStreams = emitter._listenerTree[table];
const symbolData = _.mapValues(matchingStreams, () => []);
// Generate data by symbol
const symbolData = data.data.reduce((accumulator, currentValue) => {
if (accumulator.hasOwnProperty(currentValue[filterKey])) {
accumulator[currentValue[filterKey]].push(currentValue);
} else {
accumulator[currentValue[filterKey]] = [currentValue];
}
return accumulator;
}, {});
// This is similar to _groupBy, but faster.
for (let i = 0; i < data.data.length; i++) {
const d = data.data[i];
if (symbolData[d[filterKey]]) symbolData[d[filterKey]].push(d);
}
Object.keys(symbolData).forEach((symbol) => {

@@ -97,0 +97,0 @@ const key = `${table}:${action}:${symbol}`;

{
"name": "bitmex-realtime-api",
"version": "0.3.0",
"version": "0.4.0",
"description": "A library for interacting with BitMEX's websocket API.",

@@ -23,8 +23,8 @@ "main": "index.js",

"dependencies": {
"debug": "^2.6.6",
"eventemitter2": "^4.1.0",
"lodash": "^4.17.4",
"superagent": "^3.5.2",
"ws": "^2.3.1"
"debug": "^3.1.0",
"eventemitter2": "^5.0.1",
"lodash": "^4.17.10",
"superagent": "^3.8.3",
"ws": "^6.0.0"
}
}

@@ -116,4 +116,3 @@ ### Node.JS Adapter for BitMEX Realtime Data

The following streams require authentication via an API key. Use
[this Python script](https://github.com/BitMEX/market-maker/blob/master/generate-api-key.py) to easily create a key.
The following streams require authentication via an API key.

@@ -120,0 +119,0 @@ ```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc