@agg-build/ui 2.1.5 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/{chunk-T4YZGAYS.mjs → chunk-4QGZ3FWI.mjs} +1 -1
  2. package/dist/{chunk-XUBIJI4R.mjs → chunk-JGBEQ4IV.mjs} +1079 -872
  3. package/dist/{chunk-BW7S2YR3.mjs → chunk-JOZPXDNZ.mjs} +48 -21
  4. package/dist/{chunk-R2YNZJZ3.mjs → chunk-LPIAEKSZ.mjs} +82 -2
  5. package/dist/{chunk-TBZWRUFB.mjs → chunk-QM3WWPCV.mjs} +201 -87
  6. package/dist/{chunk-VP76G6PN.mjs → chunk-UTXQUOU3.mjs} +177 -27
  7. package/dist/{chunk-XHE2VO3S.mjs → chunk-ZRYHWHTD.mjs} +2 -2
  8. package/dist/events.js +369 -82
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +2180 -1621
  11. package/dist/index.mjs +9 -7
  12. package/dist/modals.js +2 -2
  13. package/dist/modals.mjs +3 -3
  14. package/dist/pages.js +1552 -995
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +74 -26
  17. package/dist/primitives.mjs +1 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +131 -20
  21. package/dist/trading.mjs +4 -4
  22. package/dist/types/events/item/event-list-item.types.d.mts +6 -2
  23. package/dist/types/events/item/event-list-item.types.d.ts +6 -2
  24. package/dist/types/events/item/event-list-item.utils.d.mts +3 -2
  25. package/dist/types/events/item/event-list-item.utils.d.ts +3 -2
  26. package/dist/types/events/item-details/event-list-item-details.types.d.mts +0 -6
  27. package/dist/types/events/item-details/event-list-item-details.types.d.ts +0 -6
  28. package/dist/types/events/item-details/event-list-item-details.utils.d.mts +9 -0
  29. package/dist/types/events/item-details/event-list-item-details.utils.d.ts +9 -0
  30. package/dist/types/events/market-details/market-details.types.d.mts +1 -0
  31. package/dist/types/events/market-details/market-details.types.d.ts +1 -0
  32. package/dist/types/events/shared/chart-venue-selection.d.mts +2 -1
  33. package/dist/types/events/shared/chart-venue-selection.d.ts +2 -1
  34. package/dist/types/events/shared/event-trading-state.utils.d.mts +4 -2
  35. package/dist/types/events/shared/event-trading-state.utils.d.ts +4 -2
  36. package/dist/types/pages/event-market/sports-event-market.utils.d.mts +1 -1
  37. package/dist/types/pages/event-market/sports-event-market.utils.d.ts +1 -1
  38. package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.mts +8 -0
  39. package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.ts +8 -0
  40. package/dist/types/pages/user-profile/index.d.mts +1 -1
  41. package/dist/types/pages/user-profile/index.d.ts +1 -1
  42. package/dist/types/pages/user-profile/user-profile.types.d.mts +14 -0
  43. package/dist/types/pages/user-profile/user-profile.types.d.ts +14 -0
  44. package/dist/types/primitives/search/search.types.d.mts +1 -0
  45. package/dist/types/primitives/search/search.types.d.ts +1 -0
  46. package/dist/types/primitives/search/search.utils.d.mts +4 -1
  47. package/dist/types/primitives/search/search.utils.d.ts +4 -1
  48. package/dist/types/shared/utils.d.mts +16 -0
  49. package/dist/types/shared/utils.d.ts +16 -0
  50. package/dist/types/trading/types.d.mts +2 -1
  51. package/dist/types/trading/types.d.ts +2 -1
  52. package/package.json +3 -3
package/dist/trading.js CHANGED
@@ -138,6 +138,92 @@ var formatUsd = (value, options) => {
138
138
  maximumFractionDigits
139
139
  });
140
140
  };
141
+ var GENERIC_BINARY_OUTCOME_LABELS = /* @__PURE__ */ new Set(["yes", "no"]);
142
+ var TOTAL_OUTCOME_LABELS = /* @__PURE__ */ new Set(["over", "under"]);
143
+ var DIRECTIONAL_OUTCOME_LABELS = /* @__PURE__ */ new Set(["up", "down"]);
144
+ var NUMERIC_TOKEN_RE = /[-+]?\d+(?:\.\d+)?/;
145
+ var UP_OR_DOWN_QUESTION_RE = /\bup or down\b/i;
146
+ var normalizeResolvedOutcomeLabel = (value) => {
147
+ const trimmedValue = value == null ? void 0 : value.trim();
148
+ return trimmedValue ? trimmedValue : null;
149
+ };
150
+ var readOutcomeMetadataLabel = (outcome) => {
151
+ const outcomeRecord = outcome;
152
+ for (const key of ["displayName", "name", "title"]) {
153
+ const value = outcomeRecord[key];
154
+ if (typeof value !== "string") continue;
155
+ const normalizedValue = normalizeResolvedOutcomeLabel(value);
156
+ if (normalizedValue) return normalizedValue;
157
+ }
158
+ return null;
159
+ };
160
+ var formatLineValue = (value) => {
161
+ return Number.isInteger(value) ? String(value) : String(value);
162
+ };
163
+ var readMarketLabel = (market) => {
164
+ var _a;
165
+ const rawLabel = (_a = normalizeResolvedOutcomeLabel(market == null ? void 0 : market.shortTitle)) != null ? _a : normalizeResolvedOutcomeLabel(market == null ? void 0 : market.question);
166
+ if (!rawLabel) return null;
167
+ if (/^draw\s*\(/i.test(rawLabel)) return "Draw";
168
+ return rawLabel;
169
+ };
170
+ var deriveTotalOutcomeLabel = (outcome, metadataLabel) => {
171
+ const normalizedMetadataLabel = metadataLabel == null ? void 0 : metadataLabel.trim().toLowerCase();
172
+ if (normalizedMetadataLabel && TOTAL_OUTCOME_LABELS.has(normalizedMetadataLabel)) {
173
+ return metadataLabel;
174
+ }
175
+ const normalizedRawLabel = outcome.label.trim().toLowerCase();
176
+ if (normalizedRawLabel === "yes") return "Over";
177
+ if (normalizedRawLabel === "no") return "Under";
178
+ return metadataLabel;
179
+ };
180
+ var resolveResolvedOutcomeLabel = ({
181
+ market,
182
+ outcome,
183
+ allowSportsMoneylineMarketFallback = true
184
+ }) => {
185
+ var _a;
186
+ if (!outcome) return null;
187
+ const rawLabel = normalizeResolvedOutcomeLabel(outcome.label);
188
+ const metadataLabel = readOutcomeMetadataLabel(outcome);
189
+ const normalizedRawLabel = (_a = rawLabel == null ? void 0 : rawLabel.toLowerCase()) != null ? _a : "";
190
+ const isGenericBinary = GENERIC_BINARY_OUTCOME_LABELS.has(normalizedRawLabel);
191
+ const isSportsMarket = Boolean(
192
+ (market == null ? void 0 : market.sportsMarketType) || (market == null ? void 0 : market.marketGroup) || (market == null ? void 0 : market.lineValue) != null
193
+ );
194
+ if (!isSportsMarket) {
195
+ const isDirectionalBinaryMarket = Boolean((market == null ? void 0 : market.question) && UP_OR_DOWN_QUESTION_RE.test(market.question)) && Boolean(metadataLabel && DIRECTIONAL_OUTCOME_LABELS.has(metadataLabel.trim().toLowerCase()));
196
+ if (isDirectionalBinaryMarket) return metadataLabel;
197
+ if (isGenericBinary) return rawLabel;
198
+ return metadataLabel != null ? metadataLabel : rawLabel;
199
+ }
200
+ const lineValue = typeof (market == null ? void 0 : market.lineValue) === "number" ? market.lineValue : null;
201
+ const isMoneylineMarket = (market == null ? void 0 : market.sportsMarketType) === "moneyline" || (market == null ? void 0 : market.marketGroup) === "game_lines";
202
+ const isTotalMarket = (market == null ? void 0 : market.sportsMarketType) === "total" || (market == null ? void 0 : market.marketGroup) === "totals";
203
+ if (isMoneylineMarket && metadataLabel) return metadataLabel;
204
+ if (allowSportsMoneylineMarketFallback && isMoneylineMarket && isGenericBinary) {
205
+ const marketLabel = readMarketLabel(market);
206
+ if (marketLabel) return marketLabel;
207
+ }
208
+ if (isTotalMarket) {
209
+ const totalLabel = deriveTotalOutcomeLabel(outcome, metadataLabel);
210
+ if (totalLabel && lineValue != null && !NUMERIC_TOKEN_RE.test(totalLabel)) {
211
+ return `${totalLabel} ${formatLineValue(Math.abs(lineValue))}`;
212
+ }
213
+ if (totalLabel) return totalLabel;
214
+ }
215
+ const isSpreadMarket = (market == null ? void 0 : market.sportsMarketType) === "spread" || (market == null ? void 0 : market.marketGroup) === "spreads";
216
+ if (isSpreadMarket && metadataLabel) {
217
+ if (lineValue != null && !NUMERIC_TOKEN_RE.test(metadataLabel)) {
218
+ const resolvedLineValue = normalizedRawLabel === "no" ? Math.abs(lineValue) : lineValue;
219
+ const formattedLineValue = resolvedLineValue > 0 ? `+${formatLineValue(resolvedLineValue)}` : formatLineValue(resolvedLineValue);
220
+ return `${metadataLabel} ${formattedLineValue}`;
221
+ }
222
+ return metadataLabel;
223
+ }
224
+ if (metadataLabel) return metadataLabel;
225
+ return rawLabel;
226
+ };
141
227
 
142
228
  // src/trading/utils.ts
143
229
  var defaultLabels = (0, import_hooks.resolveAggUiLabels)("en-US");
@@ -1710,7 +1796,7 @@ var sizeClasses = {
1710
1796
  var lineColorByVenue = {
1711
1797
  light: {
1712
1798
  [import_sdk10.Venue.kalshi]: "#00D295",
1713
- [import_sdk10.Venue.limitless]: "#000000",
1799
+ [import_sdk10.Venue.limitless]: "#C4FF00",
1714
1800
  [import_sdk10.Venue.opinion]: "#000000",
1715
1801
  [import_sdk10.Venue.polymarket]: "#2E5CFF",
1716
1802
  [import_sdk10.Venue.predict]: "#6D57F8",
@@ -1720,7 +1806,7 @@ var lineColorByVenue = {
1720
1806
  },
1721
1807
  dark: {
1722
1808
  [import_sdk10.Venue.kalshi]: "#00D295",
1723
- [import_sdk10.Venue.limitless]: "#FFFFFF",
1809
+ [import_sdk10.Venue.limitless]: "#C4FF00",
1724
1810
  [import_sdk10.Venue.opinion]: "#FFFFFF",
1725
1811
  [import_sdk10.Venue.polymarket]: "#2E5CFF",
1726
1812
  [import_sdk10.Venue.predict]: "#6D57F8",
@@ -6724,7 +6810,7 @@ var mapVenueMarketOutcomesToPlaceOrderOutcomes = (venueMarketOutcomes) => {
6724
6810
  label: outcome.label,
6725
6811
  title: (_a = outcome.title) != null ? _a : null,
6726
6812
  price: outcome.price,
6727
- priceLabel: getTradingPriceLabel(outcome.price)
6813
+ priceLabel: outcome.price != null ? getTradingPriceLabel(outcome.price) : ""
6728
6814
  };
6729
6815
  });
6730
6816
  };
@@ -8389,7 +8475,7 @@ var PlaceOrderResolvedView = ({
8389
8475
  className,
8390
8476
  isSportsEvent = false
8391
8477
  }) => {
8392
- var _a;
8478
+ var _a, _b;
8393
8479
  const labels = (0, import_hooks30.useLabels)();
8394
8480
  const tradingLabels = labels.trading;
8395
8481
  const resolvingTimestamp = (_a = resolutionTimestamp != null ? resolutionTimestamp : tradingState.resolvesAt) != null ? _a : tradingState.endsAt;
@@ -8467,7 +8553,16 @@ var PlaceOrderResolvedView = ({
8467
8553
  ),
8468
8554
  children: [
8469
8555
  tradingState.market ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Typography, { variant: "body", className: "text-center", children: tradingState.market.question }) : null,
8470
- tradingState.winningOutcome ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Typography, { variant: "body-large-strong", children: tradingLabels.outcome(tradingState.winningOutcome.label) }) : null
8556
+ tradingState.winningOutcome ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Typography, { variant: "body-large-strong", children: tradingLabels.outcome(
8557
+ shouldUseRawResolvedPlaceOrderOutcomeLabel(
8558
+ tradingState.market,
8559
+ tradingState.winningOutcome
8560
+ ) ? tradingState.winningOutcome.label : (_b = resolveResolvedOutcomeLabel({
8561
+ market: tradingState.market,
8562
+ outcome: tradingState.winningOutcome,
8563
+ allowSportsMoneylineMarketFallback: false
8564
+ })) != null ? _b : tradingState.winningOutcome.label
8565
+ ) }) : null
8471
8566
  ]
8472
8567
  }
8473
8568
  )
@@ -8529,6 +8624,16 @@ var renderRouteBreakdownRow = (row) => {
8529
8624
  rowKey
8530
8625
  );
8531
8626
  };
8627
+ var SIDE_NAMED_MONEYLINE_QUESTION_RE = /\s(?:vs\.?|@|at)\s/i;
8628
+ var shouldUseRawResolvedPlaceOrderOutcomeLabel = (market, outcome) => {
8629
+ var _a, _b;
8630
+ if (!market || !outcome) return false;
8631
+ const isSportsMoneylineMarket = (market.sportsMarketType === "moneyline" || market.marketGroup === "game_lines") && (outcome.label.trim().toLowerCase() === "yes" || outcome.label.trim().toLowerCase() === "no");
8632
+ if (!isSportsMoneylineMarket) return false;
8633
+ const marketLabel = ((_b = (_a = market.shortTitle) != null ? _a : market.question) != null ? _b : "").trim();
8634
+ if (!marketLabel) return false;
8635
+ return !SIDE_NAMED_MONEYLINE_QUESTION_RE.test(marketLabel);
8636
+ };
8532
8637
  var renderRouteCard = ({
8533
8638
  card,
8534
8639
  enableAnimations,
@@ -8944,16 +9049,10 @@ var PlaceOrder = ({
8944
9049
  scopedSelectedMarket ? [scopedSelectedMarket] : void 0
8945
9050
  );
8946
9051
  const wsBestPrices = (0, import_hooks30.useLiveBestPrices)(scopedSelectedMarket ? [scopedSelectedMarket] : void 0);
8947
- const clusterMidpointResult = midpointsResult != null ? midpointsResult : {
8948
- prices: /* @__PURE__ */ new Map(),
8949
- bestMidpointsByOutcomeId: /* @__PURE__ */ new Map(),
8950
- venueByOutcomeId: /* @__PURE__ */ new Map(),
8951
- bestPrices: /* @__PURE__ */ new Map(),
8952
- bestPriceVenuesByOutcomeId: /* @__PURE__ */ new Map(),
8953
- isLoading: false,
8954
- bestMidpoint: void 0,
8955
- bestMidpointVenue: void 0
8956
- };
9052
+ const fetchedClusterMidpointResult = (0, import_hooks30.useMidpoints)(
9053
+ midpointsResult ? [] : scopedSelectedMarket ? [scopedSelectedMarket] : []
9054
+ );
9055
+ const clusterMidpointResult = midpointsResult != null ? midpointsResult : fetchedClusterMidpointResult;
8957
9056
  const clusterBestMidpointsByOutcomeId = (_i = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _i : clusterMidpointResult.prices;
8958
9057
  const clusterBestMidpoint = clusterMidpointResult.bestMidpoint;
8959
9058
  const clusterBestPricesRest = clusterMidpointResult.bestPrices;
@@ -10136,11 +10235,11 @@ var PlaceOrder = ({
10136
10235
  bestPrices: clusterBestPrices,
10137
10236
  bestMidpoint: clusterBestMidpoint,
10138
10237
  bestMidpointsByOutcomeId: clusterBestMidpointsByOutcomeId,
10139
- livePrices,
10140
- fallbackPrice: outcome.price
10238
+ livePrices
10141
10239
  });
10142
10240
  const isActive = outcome.id === scopedSelectedOutcomeId;
10143
10241
  const isPositive = resolveIsPositiveOutcome(outcome, index);
10242
+ const isPriceLoading = clusterMidpointResult.isLoading && price == null;
10144
10243
  return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
10145
10244
  "button",
10146
10245
  {
@@ -10170,7 +10269,16 @@ var PlaceOrder = ({
10170
10269
  children: (_c2 = outcome.title) != null ? _c2 : outcome.label
10171
10270
  }
10172
10271
  ),
10173
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Typography, { as: "span", variant: isActive ? "body-strong" : "body", children: formatProbabilityCents(price) })
10272
+ isPriceLoading ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
10273
+ "span",
10274
+ {
10275
+ "aria-hidden": "true",
10276
+ className: cn(
10277
+ "agg-place-order-outcome-price-loading",
10278
+ "h-4 w-10 shrink-0 rounded-agg-sm bg-agg-separator animate-pulse"
10279
+ )
10280
+ }
10281
+ ) : /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Typography, { as: "span", variant: isActive ? "body-strong" : "body", children: formatProbabilityCents(price) })
10174
10282
  ]
10175
10283
  },
10176
10284
  outcome.id
@@ -10762,7 +10870,7 @@ function useResolvedMarketClaim(options = {}) {
10762
10870
  }, executionMode === "paper" ? { mode: "paper" } : {}));
10763
10871
  const claimWinnings = useClaimWinnings();
10764
10872
  return (0, import_react13.useMemo)(() => {
10765
- var _a2, _b, _c;
10873
+ var _a2;
10766
10874
  if (!shouldFetch || !marketId) return void 0;
10767
10875
  const group = positions.find(
10768
10876
  (candidate) => candidate.targetMarketId === marketId
@@ -10774,7 +10882,10 @@ function useResolvedMarketClaim(options = {}) {
10774
10882
  if (winningOutcomes.length === 0) return void 0;
10775
10883
  const totals = (0, import_hooks33.computeClosedPositionTotals)(group);
10776
10884
  const winningShares = winningOutcomes.reduce((sum, outcome) => sum + outcome.totalSize, 0);
10777
- const winningOutcomeLabel = ((_b = (_a2 = winningOutcomes[0]) == null ? void 0 : _a2.title) == null ? void 0 : _b.trim()) || ((_c = winningOutcomes[0]) == null ? void 0 : _c.label) || "";
10885
+ const winningOutcomeLabel = (_a2 = resolveResolvedOutcomeLabel({
10886
+ market: market != null ? market : group.venueMarket,
10887
+ outcome: winningOutcomes[0]
10888
+ })) != null ? _a2 : "";
10778
10889
  const claimKey = group.targetMarketId;
10779
10890
  const canClaim = group.redeemStatus === "eligible" && totals.winningOutcomeIds.length > 0;
10780
10891
  return {
package/dist/trading.mjs CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  parseVenue,
9
9
  useClaimWinnings,
10
10
  useResolvedMarketClaim
11
- } from "./chunk-BW7S2YR3.mjs";
11
+ } from "./chunk-JOZPXDNZ.mjs";
12
12
  import {
13
13
  SETTLEMENT_SECTION_ID,
14
14
  Settlement,
@@ -23,9 +23,9 @@ import {
23
23
  getTradingValueLabel,
24
24
  getTradingVenueLabel,
25
25
  useEventTradingContext
26
- } from "./chunk-R2YNZJZ3.mjs";
27
- import "./chunk-T4YZGAYS.mjs";
28
- import "./chunk-VP76G6PN.mjs";
26
+ } from "./chunk-LPIAEKSZ.mjs";
27
+ import "./chunk-4QGZ3FWI.mjs";
28
+ import "./chunk-UTXQUOU3.mjs";
29
29
  export {
30
30
  PlaceOrder,
31
31
  PlaceOrderFailureView,
@@ -23,8 +23,10 @@ export type EventListItemBaseProps = {
23
23
  venueInfo?: EventListItemVenueInfoMap;
24
24
  /** Optional arbitrage values keyed by outcome ID for badge rendering. */
25
25
  arbitrageByOutcomeId?: Record<string, number | undefined>;
26
- /** Live midpoint-derived prices keyed by outcome ID. Falls back to outcome.price when absent. */
26
+ /** Live midpoint-derived prices keyed by outcome ID. */
27
27
  midpointPrices?: Map<string, number>;
28
+ /** Shared midpoint rows keyed by venueMarketId/matched rows for price-gap display. */
29
+ midpointRows?: readonly unknown[];
28
30
  /** True while midpoints are being fetched — show skeleton on price badges. */
29
31
  midpointsLoading?: boolean;
30
32
  /** Called when the event card body is clicked. */
@@ -68,6 +70,8 @@ export type EventListItemProps = EventListItemLoadingProps | EventListItemWithEv
68
70
  export type EventListItemContentProps = EventListItemBaseProps & {
69
71
  /** Resolved event content rendered by the presentational item body. */
70
72
  event: EventListItemEvent;
71
- /** Live midpoint-derived prices keyed by outcome ID. Falls back to outcome.price when absent. */
73
+ /** Live midpoint-derived prices keyed by outcome ID. */
72
74
  midpointPrices?: Map<string, number>;
75
+ /** Shared midpoint rows keyed by venueMarketId/matched rows for price-gap display. */
76
+ midpointRows?: readonly unknown[];
73
77
  };
@@ -23,8 +23,10 @@ export type EventListItemBaseProps = {
23
23
  venueInfo?: EventListItemVenueInfoMap;
24
24
  /** Optional arbitrage values keyed by outcome ID for badge rendering. */
25
25
  arbitrageByOutcomeId?: Record<string, number | undefined>;
26
- /** Live midpoint-derived prices keyed by outcome ID. Falls back to outcome.price when absent. */
26
+ /** Live midpoint-derived prices keyed by outcome ID. */
27
27
  midpointPrices?: Map<string, number>;
28
+ /** Shared midpoint rows keyed by venueMarketId/matched rows for price-gap display. */
29
+ midpointRows?: readonly unknown[];
28
30
  /** True while midpoints are being fetched — show skeleton on price badges. */
29
31
  midpointsLoading?: boolean;
30
32
  /** Called when the event card body is clicked. */
@@ -68,6 +70,8 @@ export type EventListItemProps = EventListItemLoadingProps | EventListItemWithEv
68
70
  export type EventListItemContentProps = EventListItemBaseProps & {
69
71
  /** Resolved event content rendered by the presentational item body. */
70
72
  event: EventListItemEvent;
71
- /** Live midpoint-derived prices keyed by outcome ID. Falls back to outcome.price when absent. */
73
+ /** Live midpoint-derived prices keyed by outcome ID. */
72
74
  midpointPrices?: Map<string, number>;
75
+ /** Shared midpoint rows keyed by venueMarketId/matched rows for price-gap display. */
76
+ midpointRows?: readonly unknown[];
73
77
  };
@@ -6,15 +6,16 @@ export declare const isYesLabel: (label: string) => boolean;
6
6
  export declare const resolveYesOutcome: (market: Pick<VenueMarket, "venueMarketOutcomes">) => VenueMarketOutcome | undefined;
7
7
  export declare const resolveYesOutcomeProbability: (market: Pick<VenueMarket, "venueMarketOutcomes">) => number | undefined;
8
8
  export declare const formatMarketProbabilityPercent: (value: number | null | undefined, formatPercent?: (value: number) => string) => string;
9
- export declare const formatPriceGapPercent: (value: number | null | undefined) => string | undefined;
9
+ export declare const formatPriceGapPercent: (value: number | null | undefined, mode?: "fraction" | "percent") => string | undefined;
10
10
  export declare const sortOutcomes: (outcomes: VenueMarketOutcome[]) => VenueMarketOutcome[];
11
+ export declare const sortOutcomesWithPrices: (outcomes: VenueMarketOutcome[], priceByOutcomeId?: ReadonlyMap<string, number>) => VenueMarketOutcome[];
11
12
  export type EventListItemVisibleOutcome = {
12
13
  venue: VenueMarket["venue"];
13
14
  market: VenueMarket;
14
15
  outcome: VenueMarketOutcome;
15
16
  title: string;
16
17
  };
17
- export declare const resolveVisibleOutcomes: (venueMarkets: VenueMarket[]) => EventListItemVisibleOutcome[];
18
+ export declare const resolveVisibleOutcomes: (venueMarkets: VenueMarket[], priceByOutcomeId?: ReadonlyMap<string, number>) => EventListItemVisibleOutcome[];
18
19
  /**
19
20
  * Dedupe venue markets while collapsing matched-cluster siblings to a single
20
21
  * row. Walks left-to-right; for each market we see, mark its own id AND every
@@ -6,15 +6,16 @@ export declare const isYesLabel: (label: string) => boolean;
6
6
  export declare const resolveYesOutcome: (market: Pick<VenueMarket, "venueMarketOutcomes">) => VenueMarketOutcome | undefined;
7
7
  export declare const resolveYesOutcomeProbability: (market: Pick<VenueMarket, "venueMarketOutcomes">) => number | undefined;
8
8
  export declare const formatMarketProbabilityPercent: (value: number | null | undefined, formatPercent?: (value: number) => string) => string;
9
- export declare const formatPriceGapPercent: (value: number | null | undefined) => string | undefined;
9
+ export declare const formatPriceGapPercent: (value: number | null | undefined, mode?: "fraction" | "percent") => string | undefined;
10
10
  export declare const sortOutcomes: (outcomes: VenueMarketOutcome[]) => VenueMarketOutcome[];
11
+ export declare const sortOutcomesWithPrices: (outcomes: VenueMarketOutcome[], priceByOutcomeId?: ReadonlyMap<string, number>) => VenueMarketOutcome[];
11
12
  export type EventListItemVisibleOutcome = {
12
13
  venue: VenueMarket["venue"];
13
14
  market: VenueMarket;
14
15
  outcome: VenueMarketOutcome;
15
16
  title: string;
16
17
  };
17
- export declare const resolveVisibleOutcomes: (venueMarkets: VenueMarket[]) => EventListItemVisibleOutcome[];
18
+ export declare const resolveVisibleOutcomes: (venueMarkets: VenueMarket[], priceByOutcomeId?: ReadonlyMap<string, number>) => EventListItemVisibleOutcome[];
18
19
  /**
19
20
  * Dedupe venue markets while collapsing matched-cluster siblings to a single
20
21
  * row. Walks left-to-right; for each market we see, mark its own id AND every
@@ -117,12 +117,6 @@ export type EventListItemDetailsGraphSectionProps = {
117
117
  * prices for contexts where per-venue accuracy or availability doesn't matter.
118
118
  */
119
119
  livePrices: Map<string, number>;
120
- /**
121
- * WS-only prices keyed by outcome ID. Used for chart venue badges so each
122
- * badge shows its own venue's price rather than the cross-venue best.
123
- * Falls back to `outcome.price` when a venue has no WS data yet.
124
- */
125
- wsLivePrices: Map<string, number>;
126
120
  /**
127
121
  * REST cross-venue best prices keyed by outcome ID. Used for the outcome
128
122
  * selector switch so it shows the lowest available price across venues rather
@@ -117,12 +117,6 @@ export type EventListItemDetailsGraphSectionProps = {
117
117
  * prices for contexts where per-venue accuracy or availability doesn't matter.
118
118
  */
119
119
  livePrices: Map<string, number>;
120
- /**
121
- * WS-only prices keyed by outcome ID. Used for chart venue badges so each
122
- * badge shows its own venue's price rather than the cross-venue best.
123
- * Falls back to `outcome.price` when a venue has no WS data yet.
124
- */
125
- wsLivePrices: Map<string, number>;
126
120
  /**
127
121
  * REST cross-venue best prices keyed by outcome ID. Used for the outcome
128
122
  * selector switch so it shows the lowest available price across venues rather
@@ -25,6 +25,15 @@ export declare const getTimeWindowByRange: (range: ChartTimeRange) => {
25
25
  endTs: number;
26
26
  intervalMinutes: number;
27
27
  };
28
+ export declare const resolveInitialEventDetailsChartRange: ({ chartData, event, fallbackRange, nowSec, selectedMarket, }: {
29
+ chartData?: MarketChartData | null;
30
+ event: Pick<VenueMarket, "status" | "startDate" | "endDate" | "creationDate"> & {
31
+ venueMarkets: Array<Pick<VenueMarket, "status" | "startDate" | "endDate" | "creationDate" | "resolutionDate">>;
32
+ };
33
+ fallbackRange?: ChartTimeRange;
34
+ nowSec?: number;
35
+ selectedMarket?: Pick<VenueMarket, "status" | "startDate" | "endDate" | "creationDate" | "resolutionDate"> | null;
36
+ }) => ChartTimeRange | null;
28
37
  export declare const resolveOutcomeLabels: (venueMarkets: VenueMarket[]) => string[];
29
38
  export declare const resolveOutcomeSelectorItems: (venueMarkets: VenueMarket[]) => OutcomeSelectorItem[];
30
39
  export declare const resolveDefaultOutcomeLabel: (outcomeLabels: string[]) => string | undefined;
@@ -25,6 +25,15 @@ export declare const getTimeWindowByRange: (range: ChartTimeRange) => {
25
25
  endTs: number;
26
26
  intervalMinutes: number;
27
27
  };
28
+ export declare const resolveInitialEventDetailsChartRange: ({ chartData, event, fallbackRange, nowSec, selectedMarket, }: {
29
+ chartData?: MarketChartData | null;
30
+ event: Pick<VenueMarket, "status" | "startDate" | "endDate" | "creationDate"> & {
31
+ venueMarkets: Array<Pick<VenueMarket, "status" | "startDate" | "endDate" | "creationDate" | "resolutionDate">>;
32
+ };
33
+ fallbackRange?: ChartTimeRange;
34
+ nowSec?: number;
35
+ selectedMarket?: Pick<VenueMarket, "status" | "startDate" | "endDate" | "creationDate" | "resolutionDate"> | null;
36
+ }) => ChartTimeRange | null;
28
37
  export declare const resolveOutcomeLabels: (venueMarkets: VenueMarket[]) => string[];
29
38
  export declare const resolveOutcomeSelectorItems: (venueMarkets: VenueMarket[]) => OutcomeSelectorItem[];
30
39
  export declare const resolveDefaultOutcomeLabel: (outcomeLabels: string[]) => string | undefined;
@@ -181,6 +181,7 @@ export type MarketDetailsHeaderOutcomeItem = {
181
181
  label: string;
182
182
  title?: string | null;
183
183
  probability: number | undefined;
184
+ isPriceLoading?: boolean;
184
185
  tone: MarketDetailsOutcomeTone;
185
186
  venue: VenueLogoName;
186
187
  variant?: "outcome" | "line" | "yes_no";
@@ -181,6 +181,7 @@ export type MarketDetailsHeaderOutcomeItem = {
181
181
  label: string;
182
182
  title?: string | null;
183
183
  probability: number | undefined;
184
+ isPriceLoading?: boolean;
184
185
  tone: MarketDetailsOutcomeTone;
185
186
  venue: VenueLogoName;
186
187
  variant?: "outcome" | "line" | "yes_no";
@@ -3,7 +3,8 @@ type ChartVenueOutcomeLike = {
3
3
  venue: string;
4
4
  outcome: {
5
5
  id: string;
6
- price: number;
6
+ /** No longer returned by discovery endpoints; live prices win when present. */
7
+ price?: number | undefined;
7
8
  };
8
9
  };
9
10
  type LivePriceLookup = {
@@ -3,7 +3,8 @@ type ChartVenueOutcomeLike = {
3
3
  venue: string;
4
4
  outcome: {
5
5
  id: string;
6
- price: number;
6
+ /** No longer returned by discovery endpoints; live prices win when present. */
7
+ price?: number | undefined;
7
8
  };
8
9
  };
9
10
  type LivePriceLookup = {
@@ -1,4 +1,4 @@
1
- import type { AggUiLabels, OrderEligibilityReason, TradingStateBase, TradingStateKind } from "@agg-build/hooks";
1
+ import type { AggUiLabels, OrderEligibilityReason, TradingStateBase, TradingStateKind, VenueMarket } from "@agg-build/hooks";
2
2
  export type TradingStatePresentation = {
3
3
  badgeLabel: string;
4
4
  title: string;
@@ -8,7 +8,9 @@ export type TradingStatePresentation = {
8
8
  winningOutcomeLabel: string | null;
9
9
  };
10
10
  export declare const resolveTradingStateTimestampLabel: (labels: AggUiLabels, state: TradingStateBase) => string | null;
11
- export declare const resolveTradingStatePresentation: (labels: AggUiLabels, state: TradingStateBase) => TradingStatePresentation;
11
+ export declare const resolveTradingStatePresentation: (labels: AggUiLabels, state: TradingStateBase & {
12
+ market?: VenueMarket | null;
13
+ }) => TradingStatePresentation;
12
14
  export declare const resolveTradingStateBadgeClassName: (kind: TradingStateKind) => string;
13
15
  export declare const resolveTradingStatePanelClassName: (kind: TradingStateKind) => string;
14
16
  export declare const resolveOrderEligibilityMessage: (labels: AggUiLabels, reason: OrderEligibilityReason) => string | null;
@@ -1,4 +1,4 @@
1
- import type { AggUiLabels, OrderEligibilityReason, TradingStateBase, TradingStateKind } from "@agg-build/hooks";
1
+ import type { AggUiLabels, OrderEligibilityReason, TradingStateBase, TradingStateKind, VenueMarket } from "@agg-build/hooks";
2
2
  export type TradingStatePresentation = {
3
3
  badgeLabel: string;
4
4
  title: string;
@@ -8,7 +8,9 @@ export type TradingStatePresentation = {
8
8
  winningOutcomeLabel: string | null;
9
9
  };
10
10
  export declare const resolveTradingStateTimestampLabel: (labels: AggUiLabels, state: TradingStateBase) => string | null;
11
- export declare const resolveTradingStatePresentation: (labels: AggUiLabels, state: TradingStateBase) => TradingStatePresentation;
11
+ export declare const resolveTradingStatePresentation: (labels: AggUiLabels, state: TradingStateBase & {
12
+ market?: VenueMarket | null;
13
+ }) => TradingStatePresentation;
12
14
  export declare const resolveTradingStateBadgeClassName: (kind: TradingStateKind) => string;
13
15
  export declare const resolveTradingStatePanelClassName: (kind: TradingStateKind) => string;
14
16
  export declare const resolveOrderEligibilityMessage: (labels: AggUiLabels, reason: OrderEligibilityReason) => string | null;
@@ -81,7 +81,7 @@ export declare const normalizeSportsMarketGroup: (value: string | null | undefin
81
81
  * recognizable grouping metadata, so the page can fall back to the default,
82
82
  * ungrouped market list instead of inventing an empty tab.
83
83
  */
84
- export declare const resolveMarketSectionTabKey: (market: Pick<VenueMarket, "marketGroup" | "marketCategory">) => SportsSectionTabKey | null;
84
+ export declare const resolveMarketSectionTabKey: (market: Pick<VenueMarket, "marketGroup" | "marketCategory" | "marketSubtype" | "question">) => SportsSectionTabKey | null;
85
85
  export declare const resolveSportsSectionFilters: (key: SportsSectionTabKey) => {
86
86
  marketGroup?: SportsMarketGroupKey[];
87
87
  marketCategory?: SportsMarketCategoryKey[];
@@ -81,7 +81,7 @@ export declare const normalizeSportsMarketGroup: (value: string | null | undefin
81
81
  * recognizable grouping metadata, so the page can fall back to the default,
82
82
  * ungrouped market list instead of inventing an empty tab.
83
83
  */
84
- export declare const resolveMarketSectionTabKey: (market: Pick<VenueMarket, "marketGroup" | "marketCategory">) => SportsSectionTabKey | null;
84
+ export declare const resolveMarketSectionTabKey: (market: Pick<VenueMarket, "marketGroup" | "marketCategory" | "marketSubtype" | "question">) => SportsSectionTabKey | null;
85
85
  export declare const resolveSportsSectionFilters: (key: SportsSectionTabKey) => {
86
86
  marketGroup?: SportsMarketGroupKey[];
87
87
  marketCategory?: SportsMarketCategoryKey[];
@@ -0,0 +1,8 @@
1
+ import type { UserProfileRedeemActivity } from "../user-profile.types";
2
+ type ClaimActivityBreakdownModalProps = {
3
+ activity: UserProfileRedeemActivity | null;
4
+ onOpenChange: (open: boolean) => void;
5
+ onTransactionSelect: (activity: UserProfileRedeemActivity["transactions"][number]) => void;
6
+ };
7
+ export declare const ClaimActivityBreakdownModal: ({ activity, onOpenChange, onTransactionSelect, }: ClaimActivityBreakdownModalProps) => JSX.Element;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { UserProfileRedeemActivity } from "../user-profile.types";
2
+ type ClaimActivityBreakdownModalProps = {
3
+ activity: UserProfileRedeemActivity | null;
4
+ onOpenChange: (open: boolean) => void;
5
+ onTransactionSelect: (activity: UserProfileRedeemActivity["transactions"][number]) => void;
6
+ };
7
+ export declare const ClaimActivityBreakdownModal: ({ activity, onOpenChange, onTransactionSelect, }: ClaimActivityBreakdownModalProps) => JSX.Element;
8
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { UserProfilePageProps } from "./user-profile.types";
2
- export type { UserProfileActivity, UserProfileActivityStatus, UserProfileBalance, UserProfileConnectedExchange, UserProfileConnectedWallet, UserProfileInfo, UserProfilePageClassNames, UserProfilePageProps, UserProfilePosition, UserProfilePositionFilter, UserProfilePositionVenueShare, UserProfileSocialLink, UserProfileTransferStatus, UserProfileVenueBalance, } from "./user-profile.types";
2
+ export type { UserProfileActivity, UserProfileActivityStatus, UserProfileBalance, UserProfileConnectedExchange, UserProfileConnectedWallet, UserProfileInfo, UserProfilePageClassNames, UserProfilePageProps, UserProfilePosition, UserProfilePositionFilter, UserProfilePositionVenueShare, UserProfileRedeemTransaction, UserProfileSocialLink, UserProfileTransferStatus, UserProfileVenueBalance, } from "./user-profile.types";
3
3
  export { USER_PROFILE_TAB_ACTIVITY, USER_PROFILE_TAB_OPEN_ORDERS, USER_PROFILE_TAB_POSITIONS, } from "./user-profile.constants";
4
4
  export type { UserProfileTabValue } from "./user-profile.constants";
5
5
  export { buildAggTxExplorerHref } from "./transaction-explorer";
@@ -1,5 +1,5 @@
1
1
  import type { UserProfilePageProps } from "./user-profile.types";
2
- export type { UserProfileActivity, UserProfileActivityStatus, UserProfileBalance, UserProfileConnectedExchange, UserProfileConnectedWallet, UserProfileInfo, UserProfilePageClassNames, UserProfilePageProps, UserProfilePosition, UserProfilePositionFilter, UserProfilePositionVenueShare, UserProfileSocialLink, UserProfileTransferStatus, UserProfileVenueBalance, } from "./user-profile.types";
2
+ export type { UserProfileActivity, UserProfileActivityStatus, UserProfileBalance, UserProfileConnectedExchange, UserProfileConnectedWallet, UserProfileInfo, UserProfilePageClassNames, UserProfilePageProps, UserProfilePosition, UserProfilePositionFilter, UserProfilePositionVenueShare, UserProfileRedeemTransaction, UserProfileSocialLink, UserProfileTransferStatus, UserProfileVenueBalance, } from "./user-profile.types";
3
3
  export { USER_PROFILE_TAB_ACTIVITY, USER_PROFILE_TAB_OPEN_ORDERS, USER_PROFILE_TAB_POSITIONS, } from "./user-profile.constants";
4
4
  export type { UserProfileTabValue } from "./user-profile.constants";
5
5
  export { buildAggTxExplorerHref } from "./transaction-explorer";
@@ -182,6 +182,20 @@ export interface UserProfileRedeemActivity {
182
182
  amountLabel: string;
183
183
  /** Time label, e.g. "3d ago". */
184
184
  timeLabel: string;
185
+ /** Per-transaction breakdown for multi-leg claims. */
186
+ transactions: UserProfileRedeemTransaction[];
187
+ }
188
+ export interface UserProfileRedeemTransaction {
189
+ id: string;
190
+ venue: VenueLogoName;
191
+ chainId?: string;
192
+ txHash?: string;
193
+ marketTitle: string;
194
+ outcomeLabel: string;
195
+ amountLabel: string;
196
+ transactionLabel: string;
197
+ errorMessage?: string;
198
+ hasError?: boolean;
185
199
  }
186
200
  /**
187
201
  * Normalized UI state for activity rows. Backend statuses collapse into
@@ -182,6 +182,20 @@ export interface UserProfileRedeemActivity {
182
182
  amountLabel: string;
183
183
  /** Time label, e.g. "3d ago". */
184
184
  timeLabel: string;
185
+ /** Per-transaction breakdown for multi-leg claims. */
186
+ transactions: UserProfileRedeemTransaction[];
187
+ }
188
+ export interface UserProfileRedeemTransaction {
189
+ id: string;
190
+ venue: VenueLogoName;
191
+ chainId?: string;
192
+ txHash?: string;
193
+ marketTitle: string;
194
+ outcomeLabel: string;
195
+ amountLabel: string;
196
+ transactionLabel: string;
197
+ errorMessage?: string;
198
+ hasError?: boolean;
185
199
  }
186
200
  /**
187
201
  * Normalized UI state for activity rows. Backend statuses collapse into
@@ -12,6 +12,7 @@ export type SearchResultItem = {
12
12
  marketSummaryLabel: string;
13
13
  volumeLabel: string;
14
14
  valueLabel: string;
15
+ isValueLoading?: boolean;
15
16
  contextLabel: string;
16
17
  };
17
18
  export type SearchClassNames = {
@@ -12,6 +12,7 @@ export type SearchResultItem = {
12
12
  marketSummaryLabel: string;
13
13
  volumeLabel: string;
14
14
  valueLabel: string;
15
+ isValueLoading?: boolean;
15
16
  contextLabel: string;
16
17
  };
17
18
  export type SearchClassNames = {
@@ -1,4 +1,7 @@
1
1
  import type { AggUiLabels } from "@agg-build/hooks";
2
2
  import type { VenueEventWithMarkets } from "../../events/item";
3
3
  import type { SearchResultItem } from "./search.types";
4
- export declare const mapVenueEventToSearchResult: (event: VenueEventWithMarkets, labels: AggUiLabels, formatPercent: (value: number) => string, formatCompactCurrency: (value: number) => string) => SearchResultItem | null;
4
+ export declare const mapVenueEventToSearchResult: (event: VenueEventWithMarkets, labels: AggUiLabels, formatPercent: (value: number) => string, formatCompactCurrency: (value: number) => string, options?: {
5
+ priceByOutcomeId?: ReadonlyMap<string, number>;
6
+ isPriceLoading?: boolean;
7
+ }) => SearchResultItem | null;
@@ -1,4 +1,7 @@
1
1
  import type { AggUiLabels } from "@agg-build/hooks";
2
2
  import type { VenueEventWithMarkets } from "../../events/item";
3
3
  import type { SearchResultItem } from "./search.types";
4
- export declare const mapVenueEventToSearchResult: (event: VenueEventWithMarkets, labels: AggUiLabels, formatPercent: (value: number) => string, formatCompactCurrency: (value: number) => string) => SearchResultItem | null;
4
+ export declare const mapVenueEventToSearchResult: (event: VenueEventWithMarkets, labels: AggUiLabels, formatPercent: (value: number) => string, formatCompactCurrency: (value: number) => string, options?: {
5
+ priceByOutcomeId?: ReadonlyMap<string, number>;
6
+ isPriceLoading?: boolean;
7
+ }) => SearchResultItem | null;