
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
candlestick-convert
Advanced tools
This package allows you to batch OHLCV candlesticks or create them from trade (tick) datasets.
Version 7.x introduces many breaking changes compared to version 6.x.x.
[[time,open,high,low,close,volume]][{time: number,open: number, high: number, low: number close: number, volume: number}][{price: number, quantity: number, time:number}][{price: number, quantity: number, time:number, side: number}]npm install candlestick-convert
import {batchCandles, batchCandlesWithCustomInterval, batchCandlesJSON, batchTicksToCandle, ticksToTickChart} from "candlestick-convert";
batchCandles(candledata: OHLCV[], baseInterval = 60, targetInterval = 300, includeOpenCandle = false)
//return OHLCV[]
batchCandlesWithCustomInterval(candleData: OHLCV[], intervalFunction: IntervalFunction, includeOpenCandle = false)
//return OHLCV[]
batchCandlesJSON(candledata: IOHLCV [], baseInterval = 60, argetInterval = 300)
// return IOHLCV[]
batchTicksToCandle(tradedata: TradeTick[], interval = 60, includeOpenCandle = false)
// return IOHLCV[]
ticksToTickChart(tradedata: TradeTick[], numberOfTicks = 5)
// return IOHLCV[]
batchTradeToExtCandle(tradedata: Trade[], interval = 60, includeOpenCandle = false)
// return ExtIOHLCV[]
** includeOpenCandle allow non-complete candles in the result, useful for not normalized input data
export type IOHLCV = {
time: number,
open: number,
high: number,
low: number,
close: number,
volume: number,
};
export type ExtIOHLCV = {
time: number,
open: number,
high: number,
low: number,
close: number,
volume: number,
buyVolume: number,
tx: number,
buyTx: number,
};
export const TradeSide = {
BUY: 0,
SELL: 1,
};
export type TradeTick = {
price: number;
quantity: number;
time: number;
};
export type Trade = {
price: number;
quantity: number;
time: number;
side: number;
};
export enum OHLCVField {
TIME = 0,
OPEN = 1,
HIGH = 2,
LOW = 3,
CLOSE = 4,
VOLUME = 5,
}
CCXT OHLCV:
import { batchCandleJSON } from "candlestick-convert";
const link_btc_1m = [
{
time: 1563625680000,
open: 0.00024824,
high: 0.00024851,
low: 0.00024798,
close: 0.00024831,
volume: 2264,
},
{
time: 1563625740000,
open: 0.00024817,
high: 0.00024832,
low: 0.00024795,
close: 0.00024828,
volume: 3145,
},
];
const baseFrame = 60; // 60 seconds
const newFrame = 120; // 120 seconds
// Convert to 2m Candles
const link_btc_2m = batchCandleJSON(link_btc_1m, baseFrame, newFrame);
Extended Candles from Trades:
import { batchTradeToExtCandle, Trade } from "candlestick-convert";
const adabnb_trades = [
{
time: "1564502620356",
side: "sell",
quantity: "4458",
price: "0.00224",
tradeId: "1221272",
},
{
time: "1564503133949",
side: "sell",
quantity: "3480",
price: "0.002242",
tradeId: "1221273",
},
{
time: "1564503134553",
side: "buy",
quantity: "51",
price: "0.002248",
tradeId: "1221274",
},
// ... more data
];
const filtered_adabnb_trades: Trade[] = adabnb_trades.map((trade: any) => ({
time: trade.time,
quantity: trade.quantity,
price: trade.price,
side: trade.side === "buy" ? 0 : 1,
}));
// 1 minute (60 second) Candles
const candles1m = batchTradeToExtCandle(filtered_adabnb_trades, 60);
/* Result:
[
{
time: 1564502580000, // 2019-07-30T16:03:00.000Z
open: 0.00224,
high: 0.00224,
low: 0.00224,
close: 0.00224,
volume: 4458,
buyVolume: 0,
tx: 1,
buyTx: 0,
},
{
time: 1564503120000,
open: 0.00224,
high: 0.002248,
low: 0.002242,
close: 0.002248,
volume: 4949,
buyVolume: 103,
tx: 3,
buyTx: 2,
}
]
FAQs
OHLCV Candlestick converter and batcher with Typescript support
We found that candlestick-convert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.