@agg-build/ui 2.2.0 → 2.2.3

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 (42) hide show
  1. package/dist/{chunk-5MRFY5ZQ.mjs → chunk-4QGZ3FWI.mjs} +1 -1
  2. package/dist/{chunk-73MO7MYG.mjs → chunk-JOZPXDNZ.mjs} +30 -7
  3. package/dist/{chunk-TR7HUVY7.mjs → chunk-LPIAEKSZ.mjs} +82 -2
  4. package/dist/{chunk-BTRFSEPC.mjs → chunk-QM3WWPCV.mjs} +107 -29
  5. package/dist/{chunk-DTOI4V6P.mjs → chunk-TDLI6F55.mjs} +1155 -954
  6. package/dist/{chunk-MIAAL7BL.mjs → chunk-UTXQUOU3.mjs} +98 -4
  7. package/dist/{chunk-HNLA44SY.mjs → chunk-ZRYHWHTD.mjs} +2 -2
  8. package/dist/events.js +277 -31
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +2003 -1534
  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 +1375 -908
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +4 -3
  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 +114 -6
  21. package/dist/trading.mjs +4 -4
  22. package/dist/types/events/item/event-list-item.types.d.mts +4 -0
  23. package/dist/types/events/item/event-list-item.types.d.ts +4 -0
  24. package/dist/types/events/item/event-list-item.utils.d.mts +1 -1
  25. package/dist/types/events/item/event-list-item.utils.d.ts +1 -1
  26. package/dist/types/events/item-details/event-list-item-details.types.d.mts +0 -5
  27. package/dist/types/events/item-details/event-list-item-details.types.d.ts +0 -5
  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/shared/event-trading-state.utils.d.mts +4 -2
  31. package/dist/types/events/shared/event-trading-state.utils.d.ts +4 -2
  32. package/dist/types/pages/event-market/sports-event-market.utils.d.mts +1 -1
  33. package/dist/types/pages/event-market/sports-event-market.utils.d.ts +1 -1
  34. package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.mts +8 -0
  35. package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.ts +8 -0
  36. package/dist/types/pages/user-profile/index.d.mts +1 -1
  37. package/dist/types/pages/user-profile/index.d.ts +1 -1
  38. package/dist/types/pages/user-profile/user-profile.types.d.mts +14 -0
  39. package/dist/types/pages/user-profile/user-profile.types.d.ts +14 -0
  40. package/dist/types/shared/utils.d.mts +16 -0
  41. package/dist/types/shared/utils.d.ts +16 -0
  42. 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",
@@ -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,
@@ -10765,7 +10870,7 @@ function useResolvedMarketClaim(options = {}) {
10765
10870
  }, executionMode === "paper" ? { mode: "paper" } : {}));
10766
10871
  const claimWinnings = useClaimWinnings();
10767
10872
  return (0, import_react13.useMemo)(() => {
10768
- var _a2, _b, _c;
10873
+ var _a2;
10769
10874
  if (!shouldFetch || !marketId) return void 0;
10770
10875
  const group = positions.find(
10771
10876
  (candidate) => candidate.targetMarketId === marketId
@@ -10777,7 +10882,10 @@ function useResolvedMarketClaim(options = {}) {
10777
10882
  if (winningOutcomes.length === 0) return void 0;
10778
10883
  const totals = (0, import_hooks33.computeClosedPositionTotals)(group);
10779
10884
  const winningShares = winningOutcomes.reduce((sum, outcome) => sum + outcome.totalSize, 0);
10780
- 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 : "";
10781
10889
  const claimKey = group.targetMarketId;
10782
10890
  const canClaim = group.redeemStatus === "eligible" && totals.winningOutcomeIds.length > 0;
10783
10891
  return {
package/dist/trading.mjs CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  parseVenue,
9
9
  useClaimWinnings,
10
10
  useResolvedMarketClaim
11
- } from "./chunk-73MO7MYG.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-TR7HUVY7.mjs";
27
- import "./chunk-5MRFY5ZQ.mjs";
28
- import "./chunk-MIAAL7BL.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,
@@ -25,6 +25,8 @@ export type EventListItemBaseProps = {
25
25
  arbitrageByOutcomeId?: Record<string, number | undefined>;
26
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. */
@@ -70,4 +72,6 @@ export type EventListItemContentProps = EventListItemBaseProps & {
70
72
  event: EventListItemEvent;
71
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
  };
@@ -25,6 +25,8 @@ export type EventListItemBaseProps = {
25
25
  arbitrageByOutcomeId?: Record<string, number | undefined>;
26
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. */
@@ -70,4 +72,6 @@ export type EventListItemContentProps = EventListItemBaseProps & {
70
72
  event: EventListItemEvent;
71
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,7 +6,7 @@ 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
11
  export declare const sortOutcomesWithPrices: (outcomes: VenueMarketOutcome[], priceByOutcomeId?: ReadonlyMap<string, number>) => VenueMarketOutcome[];
12
12
  export type EventListItemVisibleOutcome = {
@@ -6,7 +6,7 @@ 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
11
  export declare const sortOutcomesWithPrices: (outcomes: VenueMarketOutcome[], priceByOutcomeId?: ReadonlyMap<string, number>) => VenueMarketOutcome[];
12
12
  export type EventListItemVisibleOutcome = {
@@ -117,11 +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
- */
124
- wsLivePrices: Map<string, number>;
125
120
  /**
126
121
  * REST cross-venue best prices keyed by outcome ID. Used for the outcome
127
122
  * selector switch so it shows the lowest available price across venues rather
@@ -117,11 +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
- */
124
- wsLivePrices: Map<string, number>;
125
120
  /**
126
121
  * REST cross-venue best prices keyed by outcome ID. Used for the outcome
127
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;
@@ -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
@@ -1,6 +1,17 @@
1
1
  export type ClassValue = string | false | null | undefined;
2
2
  export type Falsy = false | 0 | "" | null | undefined;
3
3
  export { AGG_ROOT_CLASS_NAME as aggRootClassName } from "../constants";
4
+ type ResolvedOutcomeMarketLike = {
5
+ sportsMarketType?: string | null;
6
+ marketGroup?: string | null;
7
+ lineValue?: number | null;
8
+ question?: string | null;
9
+ shortTitle?: string | null;
10
+ };
11
+ type ResolvedOutcomeLike = {
12
+ label: string;
13
+ title?: string | null;
14
+ };
4
15
  export declare const isTruthy: <T>(x: T | Falsy) => x is T;
5
16
  export declare const cn: (...values: ClassValue[]) => string;
6
17
  export declare const getMotionClassName: (enabled: boolean, ...values: ClassValue[]) => string | undefined;
@@ -22,3 +33,8 @@ export declare const formatTokenAmount: (amount: number, symbol: string, options
22
33
  }) => string;
23
34
  /** Format a raw numeric string for the amount input (adds locale grouping). */
24
35
  export declare const formatAmountDisplay: (value: string) => string;
36
+ export declare const resolveResolvedOutcomeLabel: ({ market, outcome, allowSportsMoneylineMarketFallback, }: {
37
+ market?: ResolvedOutcomeMarketLike | null;
38
+ outcome?: ResolvedOutcomeLike | null;
39
+ allowSportsMoneylineMarketFallback?: boolean;
40
+ }) => string | null;
@@ -1,6 +1,17 @@
1
1
  export type ClassValue = string | false | null | undefined;
2
2
  export type Falsy = false | 0 | "" | null | undefined;
3
3
  export { AGG_ROOT_CLASS_NAME as aggRootClassName } from "../constants";
4
+ type ResolvedOutcomeMarketLike = {
5
+ sportsMarketType?: string | null;
6
+ marketGroup?: string | null;
7
+ lineValue?: number | null;
8
+ question?: string | null;
9
+ shortTitle?: string | null;
10
+ };
11
+ type ResolvedOutcomeLike = {
12
+ label: string;
13
+ title?: string | null;
14
+ };
4
15
  export declare const isTruthy: <T>(x: T | Falsy) => x is T;
5
16
  export declare const cn: (...values: ClassValue[]) => string;
6
17
  export declare const getMotionClassName: (enabled: boolean, ...values: ClassValue[]) => string | undefined;
@@ -22,3 +33,8 @@ export declare const formatTokenAmount: (amount: number, symbol: string, options
22
33
  }) => string;
23
34
  /** Format a raw numeric string for the amount input (adds locale grouping). */
24
35
  export declare const formatAmountDisplay: (value: string) => string;
36
+ export declare const resolveResolvedOutcomeLabel: ({ market, outcome, allowSportsMoneylineMarketFallback, }: {
37
+ market?: ResolvedOutcomeMarketLike | null;
38
+ outcome?: ResolvedOutcomeLike | null;
39
+ allowSportsMoneylineMarketFallback?: boolean;
40
+ }) => string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/ui",
3
- "version": "2.2.0",
3
+ "version": "2.2.3",
4
4
  "description": "Pre-built React component library for the AGG prediction market aggregator. Tailwind-based, themeable, with primitives, event surfaces, trading flows, full pages, and modals.",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -100,8 +100,8 @@
100
100
  "liveline": "^0.0.7",
101
101
  "react": "^18.0.0 || ^19.0.0",
102
102
  "react-dom": "^18.0.0 || ^19.0.0",
103
- "@agg-build/hooks": "^2.2.0",
104
- "@agg-build/sdk": "^2.2.0"
103
+ "@agg-build/hooks": "^2.2.1",
104
+ "@agg-build/sdk": "^2.2.1"
105
105
  },
106
106
  "dependencies": {
107
107
  "@number-flow/react": "^0.6.0",