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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user