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

bitmex-simple-ws

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitmex-simple-ws - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

index.js

44

con.js

@@ -5,4 +5,2 @@ const WebSocket = require('ws');

const Book = require('./book');
class Connection extends EventEmitter {

@@ -22,12 +20,2 @@

this.subscription = {};
this.book = {};
this.bookTopics = [
'orderBookL2_25',
'orderBookL2'
];
this.on('wsMessage', m => console.log(new Date, m));
}

@@ -86,19 +74,6 @@

if(this.bookTopics.includes(payload.table)) {
const { symbol } = payload.data[0];
const id = `${payload.table}:${symbol}`;
if(this.book[id]) {
this.book[id].handle(payload);
this.emit(id, this.book[id]);
return;
}
}
this.emit('wsMessage', payload);
this.emit('message', payload);
}
rawSubscribe(topic) {
subscribe(topic) {

@@ -114,19 +89,4 @@ if(this.subscription[topic]) {

watchBook(symbol, topic = 'orderBookL2') {
if(!this.bookTopics.includes(topic)) {
throw new Error('This book topic is not supported');
}
const id = `${topic}:${symbol}`;
if(this.book[id]) {
return;
}
this.book[id] = new Book(id);
this.rawSubscribe(id);
}
}
module.exports = Connection;
{
"name": "bitmex-simple-ws",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -23,3 +23,7 @@ "main": "index.js",

},
"homepage": "https://github.com/askmike/bitmex-simple-ws#readme"
"homepage": "https://github.com/askmike/bitmex-simple-ws#readme",
"dependencies": {
"lodash": "^4.17.11",
"ws": "^7.0.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