ccxws
Version:
Websocket client for 37 cryptocurrency exchanges
38 lines (36 loc) • 1.11 kB
text/typescript
import { BinanceBase, BinanceClientOptions } from "./BinanceBase";
export class BinanceClient extends BinanceBase {
constructor({
useAggTrades = true,
requestSnapshot = true,
socketBatchSize = 200,
socketThrottleMs = 1000,
restThrottleMs = 1000,
testNet = false,
wssPath = "wss://stream.binance.com:9443/stream",
restL2SnapshotPath = "https://api.binance.com/api/v1/depth",
watcherMs,
l2updateSpeed,
l2snapshotSpeed,
batchTickers,
}: BinanceClientOptions = {}) {
if (testNet) {
wssPath = "wss://testnet.binance.vision/stream";
restL2SnapshotPath = "https://testnet.binance.vision/api/v1/depth";
}
super({
name: "Binance",
restL2SnapshotPath,
wssPath,
useAggTrades,
requestSnapshot,
socketBatchSize,
socketThrottleMs,
restThrottleMs,
watcherMs,
l2updateSpeed,
l2snapshotSpeed,
batchTickers,
});
}
}