Skip to content

fix(bindings): normalize perps order side#162

Open
cesarenaldi wants to merge 1 commit into
mainfrom
fix/perps-order-side
Open

fix(bindings): normalize perps order side#162
cesarenaldi wants to merge 1 commit into
mainfrom
fix/perps-order-side

Conversation

@cesarenaldi

@cesarenaldi cesarenaldi commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • normalize Perps order reads and order update events from upstream buy into SDK side: OrderSide
  • add binding coverage for HTTP order reads and websocket order updates
  • add a patch changeset for @polymarket/bindings and @polymarket/client

Verification

  • pnpm test:bindings -- packages/bindings/src/perps/orders.test.ts
  • pnpm lint
  • pnpm typecheck

Note

Medium Risk
This is a breaking shape change for any code reading buy on PerpsOrder or order updates; downstream client usage must switch to side.

Overview
Perps HTTP order reads (PerpsOrderSchema) and websocket order updates (PerpsOrderUpdateSchema) no longer expose upstream buy: boolean on parsed objects. Both schemas now map buy to side: OrderSide (BUY / SELL) during Zod transforms, aligning perps orders with the shared SDK order-side type.

Tests assert side for REST-shaped orders and compact WS update payloads. A patch changeset covers @polymarket/bindings and @polymarket/client.

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

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