tensorchart-api
Advanced tools
Comparing version 1.0.2 to 1.0.3
46
index.js
@@ -33,3 +33,3 @@ const { | ||
settings(this.exchange, this.pair).then(info => { | ||
if(definitions == {} || definitions == null){ | ||
if (definitions == {} || definitions == null) { | ||
var tvconf = { | ||
@@ -50,3 +50,3 @@ supports_search: true, | ||
} | ||
}else{ | ||
} else { | ||
var tvconf = { | ||
@@ -68,3 +68,2 @@ supports_search: definitions.search, | ||
} | ||
return resolve(tvconf) | ||
@@ -75,2 +74,43 @@ }) | ||
tradingViewSymbols(definitions = {}) { | ||
return new Promise((resolve, reject) => { | ||
settings(this.exchange, this.pair).then(info => { | ||
if (definitions == {} || definitions == null) { | ||
var tvconf = { | ||
name: this.pair, | ||
description: this.pair, | ||
type: "crypto", | ||
session: "24x7", | ||
timezone: "America/New_York", | ||
ticker: this.pair, | ||
minmov: 1, | ||
pricescale: 100000000, | ||
has_intraday: true, | ||
intraday_multipliers: ["1", "60"], | ||
supported_resolutions: ['1', '3', '5', '15', '30', '60', '120', '240', '360', '720', 'D', 'W', 'M'], | ||
volume_precision: 8, | ||
data_status: "streaming", | ||
} | ||
} else { | ||
var tvconf = { | ||
name: this.pair, | ||
description: this.pair, | ||
type: info.BaseCurrencyLong, | ||
session: "24x7", | ||
timezone: "America/New_York", | ||
ticker: this.pair, | ||
minmov: 1, | ||
pricescale: 100000000, | ||
has_intraday: definitions.has_intraday, | ||
intraday_multipliers: ["1", "60"], | ||
supported_resolutions: ['5', '15', '60', '240', 'D'], | ||
volume_precision: 8, | ||
data_status: "streaming", | ||
} | ||
} | ||
return resolve(tvconf) | ||
}) | ||
}) | ||
} | ||
tradingViewChart(candleTime) { | ||
@@ -77,0 +117,0 @@ return new Promise((resolve, reject) => { |
{ | ||
"name": "tensorchart-api", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "api for https://www.tensorcharts.com/", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -210,2 +210,39 @@ ![logo](https://github.com/victorratts13/tensorChart-api/blob/main/asset/logo.jpg?raw=true) | ||
## get tradingView symbols config | ||
to get symbols definitions for tradingView charts use this format code: | ||
```js | ||
tensor.tradingViewSymbols(null).then(data => { | ||
console.log(data) | ||
}) | ||
``` | ||
and return this | ||
```bash | ||
{ | ||
name: 'BNBBTC', | ||
description: 'BNBBTC', | ||
type: 'crypto', | ||
session: '24x7', | ||
timezone: 'America/New_York', | ||
ticker: 'BNBBTC', | ||
minmov: 1, | ||
pricescale: 100000000, | ||
has_intraday: true, | ||
intraday_multipliers: [ '1', '60' ], | ||
supported_resolutions: [ | ||
'1', '3', '5', | ||
'15', '30', '60', | ||
'120', '240', '360', | ||
'720', 'D', 'W', | ||
'M' | ||
], | ||
volume_precision: 8, | ||
data_status: 'streaming' | ||
} | ||
``` | ||
@@ -14,3 +14,3 @@ const { settings, trades, markets, orderBook, volumeCounters, heatmapCandles } = require("./controllers/requests"); | ||
tensor.tradingViewConfig(null).then(data => { | ||
tensor.tradingViewSymbols(null).then(data => { | ||
console.log(data) | ||
@@ -17,0 +17,0 @@ }) |
264900
283
248