Skip to content

Commit ffd74f7

Browse files
Herklosclaude
andcommitted
feat(polymarket): CLOB V2 migration — hard-cut to V2 contracts and EIP-712 struct
Implements full Polymarket CLOB V2 cutover (go-live 2026-04-28 ~11:00 UTC): - EIP-712 Order struct: drop taker/nonce/feeRateBps/expiration from signed types; add timestamp(uint256 ms), metadata(bytes32), builder(bytes32) - Domain version '1' → '2' (mainnet only; Amoy testnet keeps '1' for V1 contracts) - V2 mainnet exchange/negRiskExchange contracts + pUSD/usdce/onramp/offramp addresses - expiration kept in POST /order wire body only (excluded from signed struct per V2 spec) - feeSchedule parsing from Gamma market payload (Mar 31 2026 change) - Keyset cursor pagination in fetchMarkets/fetchOrders/fetchTrades (Apr 10 2026) - wrapCollateral(): thin helper to wrap USDC.e → pUSD via CollateralOnramp.wrap() - builderCode bytes32 pass-through + length validation (66 chars, 0x-prefixed) - getSignatureType(): honour caller params.signatureType/signature_type override - Fix extend() order in fetchOrders/fetchTrades so loop cursor wins over params - salt = orderTimestamp (unified from separate milliseconds() calls) - pro/polymarket.ts: declare missing marketUpdates property Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6e1d536 commit ffd74f7

5 files changed

Lines changed: 258 additions & 131 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ccxt",
3-
"version": "4.5.40",
3+
"version": "4.5.41",
44
"description": "A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go",
55
"unpkg": "dist/ccxt.browser.min.js",
66
"type": "module",

ts/src/abstract/polymarket.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ import { Exchange as _Exchange } from '../base/Exchange.js';
1010

1111
interface Exchange {
1212
gammaPublicGetMarkets (params?: {}): Promise<implicitReturnType>;
13+
gammaPublicGetMarketsKeyset (params?: {}): Promise<implicitReturnType>;
1314
gammaPublicGetMarketsId (params?: {}): Promise<implicitReturnType>;
1415
gammaPublicGetMarketsIdTags (params?: {}): Promise<implicitReturnType>;
1516
gammaPublicGetMarketsSlugSlug (params?: {}): Promise<implicitReturnType>;
1617
gammaPublicGetEvents (params?: {}): Promise<implicitReturnType>;
18+
gammaPublicGetEventsKeyset (params?: {}): Promise<implicitReturnType>;
1719
gammaPublicGetEventsId (params?: {}): Promise<implicitReturnType>;
1820
gammaPublicGetSeries (params?: {}): Promise<implicitReturnType>;
1921
gammaPublicGetSeriesId (params?: {}): Promise<implicitReturnType>;

0 commit comments

Comments
 (0)