Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function publicClient() {
if (!publicClientCon) publicClientCon = new ccxt.binance({ apiKey: '', secret: '' })
return publicClientCon
}
function authedClient() {
if (!authedClientCon) {
if (!conf.binance || !conf.binance.key || conf.binance.key === 'YOUR-API-KEY') {
throw new Error('please configure your Binance credentials in ' + path.resolve(__dirname, 'conf.js'))
}
authedClientCon = new ccxt.binance({ apiKey: conf.binance.key, secret: conf.binance.secret })
}
return authedClientCon
}
constructor () {
const binance = new ccxt.binance()
super(binance)
}
function authedClient () {
if (!authed_client) {
if (!conf.binance || !conf.binance.key || conf.binance.key === 'YOUR-API-KEY') {
throw new Error('please configure your Binance credentials in ' + path.resolve(__dirname, 'conf.js'))
}
authed_client = new ccxt.binance({ 'apiKey': conf.binance.key, 'secret': conf.binance.secret, 'options': { 'adjustForTimeDifference': true }, enableRateLimit: true })
}
return authed_client
}
function publicClient () {
if (!public_client) public_client = new ccxt.binance({ 'apiKey': '', 'secret': '', 'options': { 'adjustForTimeDifference': true } })
return public_client
}