Time synchronization with server

- wrapper for /v2/public/time rest endpoint
- synchronize time before trying to authenticate a request in order
  to avoid invalid authentication because prevented replay attacks.

Resolves #1
This commit is contained in:
Stefan Aebischer
2019-09-16 14:17:48 +02:00
parent ed28d14171
commit b6d2803a49
4 changed files with 47 additions and 6 deletions

View File

@@ -121,4 +121,12 @@ module.exports = class RestClient {
async getLatestInformation() {
return await this.request.get('/v2/public/tickers');
}
async getServerTime() {
return await this.request.get('/v2/public/time');
}
async getTimeOffset() {
return await this.request.getTimeOffset();
}
}