tardis-machine
Advanced tools
Comparing version 3.12.2 to 3.13.0
@@ -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 |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
186608
3241
Updatedtardis-dev@^13.11.0