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

tardis-machine

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tardis-machine - npm Package Compare versions

Comparing version 3.12.2 to 3.13.0

29

dist/ws/subscriptionsmappers.js

@@ -471,2 +471,28 @@ "use strict";

};
const bitnomialMapper = {
canHandle: (message) => {
return message.type === 'subscribe';
},
map: (message) => {
const topLevelSymbols = message.product_codes;
const finalChannels = [];
const channelMappings = {
book: ['book', 'levels'],
trade: ['trade'],
block: ['block']
};
message.channels.forEach((channel) => {
const channelName = typeof channel == 'string' ? channel : channel.name;
const symbols = typeof channel == 'string' ? topLevelSymbols : channel.product_codes;
const mappedChannels = channelMappings[channelName];
mappedChannels.forEach((channel) => {
finalChannels.push({
channel,
symbols
});
});
});
return finalChannels;
}
};
exports.subscriptionsMappers = {

@@ -519,4 +545,5 @@ bitmex: bitmexMapper,

'crypto-com-derivatives': cryptoComMapper,
kucoin: kucoinMapper
kucoin: kucoinMapper,
bitnomial: bitnomialMapper
};
//# sourceMappingURL=subscriptionsmappers.js.map

4

package.json
{
"name": "tardis-machine",
"version": "3.12.2",
"version": "3.13.0",
"engines": {

@@ -62,3 +62,3 @@ "node": ">=12"

"is-docker": "^2.2.1",
"tardis-dev": "^13.10.2",
"tardis-dev": "^13.11.0",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.10.0",

@@ -65,0 +65,0 @@ "yargs": "^17.5.1"

@@ -546,2 +546,34 @@ import { Exchange, Filter } from 'tardis-dev'

const bitnomialMapper: SubscriptionMapper = {
canHandle: (message: any) => {
return message.type === 'subscribe'
},
map: (message: any) => {
const topLevelSymbols = message.product_codes
const finalChannels: Filter<any>[] = []
const channelMappings = {
book: ['book', 'levels'],
trade: ['trade'],
block: ['block']
}
message.channels.forEach((channel: any) => {
const channelName = typeof channel == 'string' ? channel : channel.name
const symbols = typeof channel == 'string' ? topLevelSymbols : channel.product_codes
const mappedChannels = (channelMappings as any)[channelName]
mappedChannels.forEach((channel: string) => {
finalChannels.push({
channel,
symbols
})
})
})
return finalChannels
}
}
export const subscriptionsMappers: { [key in Exchange]: SubscriptionMapper } = {

@@ -594,3 +626,4 @@ bitmex: bitmexMapper,

'crypto-com-derivatives': cryptoComMapper,
kucoin: kucoinMapper
kucoin: kucoinMapper,
bitnomial: bitnomialMapper
}

@@ -597,0 +630,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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