A supervised clock with a Binance server-time offset.
Supply clock: fn -> BinanceElixir.Clock.now(clock) end when constructing a
client. Synchronize before signed requests and periodically thereafter.
Summary
Functions
Returns a specification to start this module under a supervisor.
Reads /api/v3/time and applies the midpoint offset estimate.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec now(GenServer.server()) :: non_neg_integer()
@spec offset_ms(GenServer.server()) :: integer()
@spec start_link(keyword()) :: GenServer.on_start()
@spec synchronize(BinanceElixir.t(), GenServer.server()) :: {:ok, integer()} | {:error, BinanceElixir.Error.t()}
Reads /api/v3/time and applies the midpoint offset estimate.