Skip to content

feat(perps): expose server time - #273

Open
kartojal wants to merge 2 commits into
mainfrom
feature/dev-467-plan-integrate-server-time-from-v1infotime-into-perps
Open

feat(perps): expose server time#273
kartojal wants to merge 2 commits into
mainfrom
feature/dev-467-plan-integrate-server-time-from-v1infotime-into-perps

Conversation

@kartojal

@kartojal kartojal commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

DEV-467: Exposes the Perps server clock.

Tests: lint/format, typecheck, build, unit PASS; public live PASS.


Note

Low Risk
Additive experimental read-only API with no auth or trading-path changes; main risk is callers depending on strict epoch-ms parsing behavior.

Overview
Adds get_server_time() on AsyncPublicClient and AsyncSecureClient, backed by a new Perps public action that calls GET /v1/info/time and returns an timezone-aware UTC datetime.

The JSON time field is parsed through a small response model that accepts epoch milliseconds only (reusing _require_epoch_ms); invalid shapes raise UnexpectedResponseError. datetime imports were moved out of TYPE_CHECKING so the public return type is runtime-resolvable.

Coverage includes mocked unit tests for parsing/endpoint path and a live integration test that the clock is within a few seconds of local UTC.

Reviewed by Cursor Bugbot for commit 00423d9. Bugbot is set up for automated code reviews on this repo. Configure here.

@kartojal
kartojal marked this pull request as ready for review August 14, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant