spacylabs-rhino
Version:
16 lines (13 loc) • 340 B
JavaScript
const { get } = require('request-promise')
module.exports = async dvf => {
// avoid browser cache with timestamp as querystring
const t = Date.now()
const url = `${dvf.config.api}/v1/trading/r/estimatedNextBatchTime?t=${t}`
try {
const data = await get(url)
return JSON.parse(data)
}
catch(e) {
return null;
}
}