
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
bfx-api-node-plugin-managed-candles
Advanced tools
Maintains local candle datasets for the Bitfinex Node API
This plugin maintains a full sorted candle set on its internal state, and emits it with every candle update with the event name data:managed:candles
. The internal dataset is populated when receiving data from candle channels.
Note that the manager proxies the event as managed:candles
. If subscribing on a socket instance (wsState.ev.on(...)
) use the internal event name, otherwise use the manager name with manager.onWS(...)
.
npm i --save bfx-api-node-plugin-managed-candles
const { Manager } = require('bfx-api-node-core')
const ManagedCandlesPlugin = require('bfx-api-node-plugin-managed-candles')
const mgr = new Manager({
plugins: [ManagedCandlesPlugin()]
})
// set up a connection, event listeners, etc
mgr.onWS('managed:candles', {}, (candles) => {
debug(JSON.stringify(candles.toJS(), null, 2))
})
For an executable example, see examples/usage.js
const debug = require('debug')('bfx:api:plugins:managed-candles:example')
const { Manager, subscribe } = require('bfx-api-node-core')
const ManagedCandlesPlugin = require('../')
const SYMBOL = 'tBTCUSD'
const mgr = new Manager({
transform: true,
plugins: [ManagedCandlesPlugin()]
})
mgr.onWS('open', {}, () => debug('connection open'))
// Receive updated dataset
mgr.onWS('managed:candles', {}, (candles) => {
debug('updated dataset for %s contains %d candles', SYMBOL, candles.length)
debug('latest candle follows')
debug(JSON.stringify(candles[0].toJS(), null, 2))
})
const wsState = mgr.openWS()
subscribe(wsState, 'candles', { key: `trade:1m:${SYMBOL}` })
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Maintains local candle datasets for the Bitfinex Node API
The npm package bfx-api-node-plugin-managed-candles receives a total of 37 weekly downloads. As such, bfx-api-node-plugin-managed-candles popularity was classified as not popular.
We found that bfx-api-node-plugin-managed-candles demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.