Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.

types(client): return typed order responses instead of any#329

Open
jasonandjay wants to merge 1 commit into
Polymarket:mainfrom
jasonandjay:fix/postorder-return-types
Open

types(client): return typed order responses instead of any#329
jasonandjay wants to merge 1 commit into
Polymarket:mainfrom
jasonandjay:fix/postorder-return-types

Conversation

@jasonandjay
Copy link
Copy Markdown

@jasonandjay jasonandjay commented Mar 15, 2026

Addresses #307

What changed

  • Replaced any return types in order-posting APIs with explicit types:
    • postOrder -> Promise<OrderResponse>
    • postOrders -> Promise<OrderResponse[]>
    • createAndPostOrder -> Promise<OrderResponse>
    • createAndPostMarketOrder -> Promise<OrderResponse>

Why

This improves TypeScript ergonomics and safety for SDK consumers by exposing concrete response shapes instead of any.

Validation

  • pnpm lint
  • pnpm build
  • vitest run tests/utilities.test.ts

Note

Low Risk
Low risk; changes are TypeScript return-type annotations for order-posting methods and should not affect runtime behavior, but may require downstream callers to align with the OrderResponse shape.

Overview
Updates the client order submission APIs to return explicit response types instead of any. postOrder, postOrders, createAndPostOrder, and createAndPostMarketOrder now return OrderResponse/OrderResponse[], exposing a concrete response contract (e.g., success, errorMsg, orderID, transactionsHashes, status, amounts) for SDK consumers.

Written by Cursor Bugbot for commit 436d3c6. This will update automatically on new commits. Configure here.

@jasonandjay jasonandjay requested a review from a team as a code owner March 15, 2026 18:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant