Socket
Socket
Sign inDemoInstall

tradingview-ws

Package Overview
Dependencies
8
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.2 to 0.0.3

CHANGELOG.md

5

dist/index.js

@@ -122,4 +122,5 @@ "use strict";

// loaded all requested candles
if (event.name === 'series_completed') {
if (currentSymCandles.length % batchSize === 0 && (!amount || currentSymCandles.length < amount)) {
if (['series_completed', 'symbol_error'].includes(event.name)) {
const loadedCount = currentSymCandles.length;
if (loadedCount > 0 && loadedCount % batchSize === 0 && (!amount || loadedCount < amount)) {
connection.send('request_more_data', [chartSession, 'sds_1', batchSize]);

@@ -126,0 +127,0 @@ return;

2

package.json
{
"name": "tradingview-ws",
"version": "0.0.2",
"version": "0.0.3",
"description": "Tradingview websocket API",

@@ -5,0 +5,0 @@ "repository": "https://github.com/endenwer/tradingview-ws.git",

@@ -54,4 +54,4 @@ ## Tradingview websockets integration

* `subscribe: (handler: Subscriber) => Unsubscriber` - subscribe to wesockets events
* `send: (name: string, params: any[]) => void` - send command to websocket
* `subscribe: (handler: Subscriber) => Unsubscriber` - subscribe to websockets events
* `send: (name: string, params: any[]) => void` - send command to websockets
* `close: () => Promise<void>` - close the connection

@@ -34,2 +34,14 @@ import { expect } from 'chai'

})
it('returns empty candles for incorrect symbol', async function() {
const connection = await connect()
const candles = await getCandles({
connection,
symbols: ['FX:AUDCAD', 'UNKNOWN'],
})
await connection.close()
expect(candles[0].length).to.gt(10_000)
expect(candles[1].length).to.eq(0)
})
})

@@ -169,4 +169,5 @@ import axios from 'axios'

// loaded all requested candles
if (event.name === 'series_completed') {
if (currentSymCandles.length % batchSize === 0 && (!amount || currentSymCandles.length < amount)) {
if (['series_completed', 'symbol_error'].includes(event.name)) {
const loadedCount = currentSymCandles.length
if (loadedCount > 0 && loadedCount % batchSize === 0 && (!amount || loadedCount < amount)) {
connection.send('request_more_data', [chartSession, 'sds_1', batchSize])

@@ -173,0 +174,0 @@ return

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc