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

@@ -64,6 +64,14 @@ If you only use the [public endpoints](#public-endpoints) you can ommit key and
#### async getLatestInformation()
[See bybit documentation](https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md#latest-information-for-symbol)
#### async getServerTime()
[See bybit documentation](https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md#server-time)
#### async getTimeOffset()
Returns the time offset in ms to the server time retrieved by [`async getServerTime`](#async-getservertime).
If positive the time on the server is ahead of the clients time, if negative the time on the server is behind the clients time.
## Example