fix prefixes

This commit is contained in:
tiagosiebler
2020-06-17 10:56:18 +01:00
parent 165faac7f4
commit e70d811654

View File

@@ -44,14 +44,14 @@ module.exports = class Request {
async getTimeOffset() { async getTimeOffset() {
const start = Date.now(); const start = Date.now();
const result = await this.get('/v2/public/time'); const result = await this.get('v2/public/time');
const end = Date.now(); const end = Date.now();
return Math.ceil((result.time_now * 1000) - end + ((end - start) / 2)); return Math.ceil((result.time_now * 1000) - end + ((end - start) / 2));
} }
async _call(method, endpoint, params) { async _call(method, endpoint, params) {
const publicEndpoint = endpoint.startsWith('/v2/public'); const publicEndpoint = endpoint.startsWith('v2/public');
if(!publicEndpoint) { if(!publicEndpoint) {
if(!this.key || !this.secret) throw new Error('Private endpoints require api and private keys set'); if(!this.key || !this.secret) throw new Error('Private endpoints require api and private keys set');