fix(types): OrderBookSummary.tick_size should be TickSize, not string#53
Open
MackDing wants to merge 1 commit intoPolymarket:mainfrom
Open
fix(types): OrderBookSummary.tick_size should be TickSize, not string#53MackDing wants to merge 1 commit intoPolymarket:mainfrom
MackDing wants to merge 1 commit intoPolymarket:mainfrom
Conversation
Closes Polymarket#50 The OrderBookSummary interface declared tick_size as string, but the TickSize literal union ('0.1' | '0.01' | '0.001' | '0.0001') already exists and is used consistently elsewhere (CreateOrderOptions.tickSize, TickSizes map, isTickSizeSmaller/priceValid helpers). Returning string forces consumers to cast or re-validate before feeding the value back into any API that expects TickSize. Tightening the type restores type-safety end-to-end; the API contract itself is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #50
Problem
OrderBookSummary.tick_sizewas typed asstring, but theTickSizeliteral union already exists in the same file:Consumers who want to feed an order book's tick size back into anything that expects
TickSize(CreateOrderOptions.tickSize,isTickSizeSmaller,priceValid, theTickSizesmap) have to cast or re-validate — which is exactly what #50 reports.Change
One-line tightening of the type in
OrderBookSummary:No runtime change, no API contract change. Just restores end-to-end type safety.
Why this is safe
TickSize; this alignsOrderBookSummarywith the rest of the codebase.Note
Low Risk
Low risk: this is a TypeScript type tightening only (no runtime/codepath changes) and may only surface compile-time errors for consumers previously treating
tick_sizeas an arbitrary string.Overview
Updates
OrderBookSummary.tick_sizeinsrc/types/clob.tsfromstringto the existingTickSizeliteral union, aligning order book responses with the rest of the tick-size-typed API surfaces and improving end-to-end type safety for consumers.Reviewed by Cursor Bugbot for commit 8e5a349. Bugbot is set up for automated code reviews on this repo. Configure here.