Skip to content

Commit d290c3a

Browse files
committed
Merge remote-tracking branch 'origin/main' into sync/hosted-docs
2 parents 9f1aa66 + bb341da commit d290c3a

75 files changed

Lines changed: 6109 additions & 8000 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [2.48.6] - 2026-06-04
6+
7+
### Fixed
8+
9+
- **Opinion**: `resolutionDate` on Opinion markets no longer collapses to `1970-01-01T00:00:00Z` when the upstream `cutoffAt` is missing or `0`. Root cause: `toMillis(0)` returned `0`, which the normalizer then wrapped in `new Date(0)` and emitted as a valid-looking past date. Categorical child markets (e.g. `2026 FIFA World Cup Winner - Spain`) are the common case — Opinion publishes `cutoffAt` only on the parent, not on each child — so every child silently inherited epoch and was filtered out by any downstream `closes_at > now()` guard. Concretely, hosted-pmxt's `fetchMarketMatches` was dropping all Opinion ↔ Polymarket pairs (407 in the catalog, 13 FIFA-specific) because the Opinion side looked already-closed.
10+
- **Opinion**: `normalizeChildMarket` now inherits `parent.cutoffAt` via `child.cutoffAt || parent.cutoffAt`, so the fallback introduced in commit `6ac8cd1` actually fires for the `cutoffAt = 0` case (the upstream literal, not a missing field).
11+
- **Core**: `toMillis(ts)` in `opinion/utils.ts` now returns `null` for falsy input instead of `0`, so callers can distinguish "no timestamp" from "epoch" and stop materializing bogus 1970 dates. Trade/order normalizers preserve old behavior with `?? 0`.
12+
- **Core**: `UnifiedMarket.resolutionDate` is now `?: Date`. Not every venue publishes a resolution date on every market, and the optional type lets normalizers emit `undefined` instead of fabricating an epoch sentinel. `BaseExchange.filterByCriteria` and the Baozi normalizer handle the optional case (markets without a known resolution date pass an `active`-status filter, fail a `closed`-status filter, and sort last under `sort=newest`).
13+
514
## [2.48.5] - 2026-06-02
615

716
### Fixed

core/api-doc-config.generated.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"_generated": "Auto-generated by extract-jsdoc.js on 2026-06-02T00:34:44.916Z. Do not edit manually.",
2+
"_generated": "Auto-generated by extract-jsdoc.js on 2026-06-08T08:31:38.004Z. Do not edit manually.",
33
"methods": {
44
"has": {
55
"summary": "HTTP verb for the endpoint (e.g. GET, POST). */",
@@ -566,7 +566,7 @@
566566
"type": "UnifiedEvent[]",
567567
"description": "Filtered array of events"
568568
},
569-
"source": "BaseExchange.ts:1317"
569+
"source": "BaseExchange.ts:1318"
570570
},
571571
"watchOrderBook": {
572572
"summary": "Watch order book updates in real-time via WebSocket.",
@@ -595,7 +595,7 @@
595595
"type": "OrderBook",
596596
"description": "Promise that resolves with the current orderbook state"
597597
},
598-
"source": "BaseExchange.ts:1413"
598+
"source": "BaseExchange.ts:1414"
599599
},
600600
"watchOrderBooks": {
601601
"summary": "Watch multiple order books simultaneously via WebSocket.",
@@ -624,7 +624,7 @@
624624
"type": "Record<string, OrderBook>",
625625
"description": "Promise that resolves with order books keyed by ID"
626626
},
627-
"source": "BaseExchange.ts:1426"
627+
"source": "BaseExchange.ts:1427"
628628
},
629629
"unwatchOrderBook": {
630630
"summary": "Unsubscribe from a previously watched order book stream.",
@@ -641,7 +641,7 @@
641641
"type": "void",
642642
"description": "Result"
643643
},
644-
"source": "BaseExchange.ts:1454"
644+
"source": "BaseExchange.ts:1455"
645645
},
646646
"watchTrades": {
647647
"summary": "Watch trade executions in real-time via WebSocket.",
@@ -676,7 +676,7 @@
676676
"type": "Trade[]",
677677
"description": "Promise that resolves with recent trades"
678678
},
679-
"source": "BaseExchange.ts:1467"
679+
"source": "BaseExchange.ts:1468"
680680
},
681681
"watchAddress": {
682682
"summary": "Stream activity for a public wallet address",
@@ -699,7 +699,7 @@
699699
"type": "SubscribedAddressSnapshot",
700700
"description": "Promise that resolves with the latest SubscribedAddressSnapshot snapshot"
701701
},
702-
"source": "BaseExchange.ts:1481"
702+
"source": "BaseExchange.ts:1482"
703703
},
704704
"unwatchAddress": {
705705
"summary": "Stop watching a previously registered wallet address and release its resource updates.",
@@ -716,7 +716,7 @@
716716
"type": "void",
717717
"description": "Result"
718718
},
719-
"source": "BaseExchange.ts:1494"
719+
"source": "BaseExchange.ts:1495"
720720
},
721721
"close": {
722722
"summary": "Close all WebSocket connections and clean up resources.",
@@ -726,7 +726,7 @@
726726
"type": "void",
727727
"description": "Result"
728728
},
729-
"source": "BaseExchange.ts:1503"
729+
"source": "BaseExchange.ts:1504"
730730
},
731731
"fetchMarketMatches": {
732732
"summary": "Find the same or related market on other venues. Two modes:",
@@ -743,7 +743,7 @@
743743
"type": "MatchResult[]",
744744
"description": "Array of matched markets with relation and confidence"
745745
},
746-
"source": "BaseExchange.ts:1517"
746+
"source": "BaseExchange.ts:1518"
747747
},
748748
"fetchMatches": {
749749
"summary": "fetchMatches",
@@ -760,7 +760,7 @@
760760
"type": "MatchResult[]",
761761
"description": "Result"
762762
},
763-
"source": "BaseExchange.ts:1533"
763+
"source": "BaseExchange.ts:1534"
764764
},
765765
"fetchEventMatches": {
766766
"summary": "Find the same or related event on other venues. Two modes:",
@@ -777,7 +777,7 @@
777777
"type": "EventMatchResult[]",
778778
"description": "Array of matched events with market-level match details"
779779
},
780-
"source": "BaseExchange.ts:1541"
780+
"source": "BaseExchange.ts:1542"
781781
},
782782
"compareMarketPrices": {
783783
"summary": "Compare live prices for the same market across venues. Finds identity matches and returns side-by-side best bid/ask prices so you can spot price differences at a glance.",
@@ -794,7 +794,7 @@
794794
"type": "PriceComparison[]",
795795
"description": "Array of price comparisons across venues"
796796
},
797-
"source": "BaseExchange.ts:1557"
797+
"source": "BaseExchange.ts:1558"
798798
},
799799
"fetchRelatedMarkets": {
800800
"summary": "Find related markets across venues. Discovers subset/superset market relationships",
@@ -811,7 +811,7 @@
811811
"type": "PriceComparison[]",
812812
"description": "Array of subset/superset matches with live prices"
813813
},
814-
"source": "BaseExchange.ts:1567"
814+
"source": "BaseExchange.ts:1568"
815815
},
816816
"fetchMatchedMarkets": {
817817
"summary": "fetchMatchedMarkets",
@@ -828,7 +828,7 @@
828828
"type": "MatchedMarketPair[]",
829829
"description": "Result"
830830
},
831-
"source": "BaseExchange.ts:1578"
831+
"source": "BaseExchange.ts:1579"
832832
},
833833
"fetchMatchedPrices": {
834834
"summary": "fetchMatchedPrices",
@@ -845,7 +845,7 @@
845845
"type": "MatchedPricePair[]",
846846
"description": "Array of matched market pairs with prices from each venue"
847847
},
848-
"source": "BaseExchange.ts:1586"
848+
"source": "BaseExchange.ts:1587"
849849
},
850850
"fetchHedges": {
851851
"summary": "fetchHedges",
@@ -862,7 +862,7 @@
862862
"type": "PriceComparison[]",
863863
"description": "Array of subset/superset matches with live prices"
864864
},
865-
"source": "BaseExchange.ts:1597"
865+
"source": "BaseExchange.ts:1598"
866866
},
867867
"fetchArbitrage": {
868868
"summary": "fetchArbitrage",
@@ -879,7 +879,7 @@
879879
"type": "ArbitrageOpportunity[]",
880880
"description": "Array of arbitrage opportunities sorted by spread"
881881
},
882-
"source": "BaseExchange.ts:1607"
882+
"source": "BaseExchange.ts:1608"
883883
},
884884
"watchPrices": {
885885
"summary": "Watch AMM price updates for a market address (Limitless only).",
@@ -950,7 +950,7 @@
950950
"description": "Result"
951951
},
952952
"exchangeOnly": "polymarket",
953-
"source": "index.ts:143"
953+
"source": "index.ts:144"
954954
},
955955
"preWarmMarket": {
956956
"summary": "Pre-warm the SDK's internal caches for a market outcome.",
@@ -968,7 +968,7 @@
968968
"description": "Result"
969969
},
970970
"exchangeOnly": "polymarket",
971-
"source": "index.ts:209"
971+
"source": "index.ts:210"
972972
},
973973
"getEventById": {
974974
"summary": "Fetch a single event by its numeric ID (Probable only).",

0 commit comments

Comments
 (0)