@agg-build/hooks 2.1.3 → 2.2.1

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.
@@ -474,6 +474,8 @@ var enUsLabels = {
474
474
  depositType: "Deposit",
475
475
  redeemType: "Claim",
476
476
  withdrawalType: "Withdrawal",
477
+ claimBreakdownModalAriaLabel: "Claim activity breakdown",
478
+ claimBreakdownTransactionLinkAria: (venue) => `Open ${venue} claim transaction`,
477
479
  redeemStatusTitles: {
478
480
  pending: "Processing claim",
479
481
  completed: "Successful claim",
@@ -11,7 +11,7 @@ import {
11
11
  useOnWithdrawalLifecycle,
12
12
  useSyncBalances,
13
13
  useWithdrawManaged
14
- } from "./chunk-56RISN73.mjs";
14
+ } from "./chunk-R7C4J345.mjs";
15
15
 
16
16
  // src/withdraw/use-withdraw-flow.ts
17
17
  import { useCallback, useEffect, useMemo, useState } from "react";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __async,
3
3
  useAggClient
4
- } from "./chunk-56RISN73.mjs";
4
+ } from "./chunk-R7C4J345.mjs";
5
5
 
6
6
  // src/use-ramp-quotes.ts
7
7
  import { useMutation } from "@tanstack/react-query";
package/dist/deposit.js CHANGED
@@ -411,6 +411,8 @@ var enUsLabels = {
411
411
  depositType: "Deposit",
412
412
  redeemType: "Claim",
413
413
  withdrawalType: "Withdrawal",
414
+ claimBreakdownModalAriaLabel: "Claim activity breakdown",
415
+ claimBreakdownTransactionLinkAria: (venue) => `Open ${venue} claim transaction`,
414
416
  redeemStatusTitles: {
415
417
  pending: "Processing claim",
416
418
  completed: "Successful claim",
package/dist/deposit.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  useRampQuotes,
3
3
  useRampSession
4
- } from "./chunk-SN4AO5D7.mjs";
4
+ } from "./chunk-UYM2TJOM.mjs";
5
5
  import {
6
6
  __async,
7
7
  useAggAuthState,
@@ -11,7 +11,7 @@ import {
11
11
  useDepositAddresses,
12
12
  useOptionalAggClient,
13
13
  useSyncBalances
14
- } from "./chunk-56RISN73.mjs";
14
+ } from "./chunk-R7C4J345.mjs";
15
15
 
16
16
  // src/deposit/normalize-wallet-error.ts
17
17
  function normalizeWalletError(error, supportedChains) {
package/dist/index.d.mts CHANGED
@@ -237,7 +237,8 @@ type VenueMarket = {
237
237
  question: string;
238
238
  venueMarketOutcomes: {
239
239
  id: string;
240
- price: number;
240
+ /** REMOVED — no longer returned; use GET /midpoints for live prices. */
241
+ price?: number | undefined;
241
242
  venueMarketId: string;
242
243
  label: string;
243
244
  title?: string | null | undefined;
@@ -291,7 +292,8 @@ type VenueMarket = {
291
292
  conditionId?: string | null | undefined;
292
293
  venueMarketOutcomes?: {
293
294
  id: string;
294
- price: number;
295
+ /** REMOVED — no longer returned; use GET /midpoints for live prices. */
296
+ price?: number | undefined;
295
297
  venueMarketId: string;
296
298
  label: string;
297
299
  winner?: boolean | null | undefined;
@@ -383,7 +385,12 @@ type MatchedVenueMarketOutcomeRef = {
383
385
  };
384
386
  type VenueMarketOutcome = {
385
387
  id: string;
386
- price: number;
388
+ /**
389
+ * REMOVED — /venue-events and /venue-markets no longer return outcome
390
+ * prices. Fetch live prices from GET /midpoints (or the live-price hooks),
391
+ * keyed by this outcome's `id`.
392
+ */
393
+ price?: number | undefined;
387
394
  venueMarketId: string;
388
395
  label: string;
389
396
  title?: string | null | undefined;
@@ -710,6 +717,8 @@ interface AggUiLabels {
710
717
  depositType: string;
711
718
  redeemType: string;
712
719
  withdrawalType: string;
720
+ claimBreakdownModalAriaLabel: string;
721
+ claimBreakdownTransactionLinkAria: (venue: string) => string;
713
722
  redeemStatusTitles: {
714
723
  pending: string;
715
724
  completed: string;
@@ -3416,9 +3425,6 @@ declare function useLiveMarketStores(venueMarketIds: string[]): CandleBuilder[];
3416
3425
  * on `agg.orderbook.outcome`). The midpoint from each outcome's book is its
3417
3426
  * price — no complement derivation needed.
3418
3427
  *
3419
- * Falls back to the static `outcome.price` from the event payload when no
3420
- * live data is available.
3421
- *
3422
3428
  * Returns a stable Map<outcomeId, price> that updates only when cache entries
3423
3429
  * change.
3424
3430
  */
@@ -3727,7 +3733,15 @@ interface UseMarketOrderbookVenueOutcome {
3727
3733
  venueMarketOutcomeId: string;
3728
3734
  }
3729
3735
  interface UseMarketOrderbookOptions {
3730
- marketId: string | null;
3736
+ /**
3737
+ * The venueMarketOutcomeId to subscribe to (the `outcomes[].id` on REST
3738
+ * market responses). Orderbooks are keyed per-outcome on the WS gateway —
3739
+ * a venueMarketId here will never resolve to a book.
3740
+ */
3741
+ venueMarketOutcomeId?: string | null;
3742
+ /** @deprecated Misleading name — this has always been a venueMarketOutcomeId.
3743
+ * Use `venueMarketOutcomeId` instead. */
3744
+ marketId?: string | null;
3731
3745
  depth?: number;
3732
3746
  enabled?: boolean;
3733
3747
  venueOutcomes?: UseMarketOrderbookVenueOutcome[];
@@ -5362,8 +5376,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5362
5376
  midpointRows: (MidpointRow & {
5363
5377
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5364
5378
  matched: MidpointRow[];
5379
+ arbReturn?: number | null;
5380
+ marketStatus?: _agg_build_sdk.MarketStatus;
5381
+ error?: {
5382
+ code: "market_resolved" | "market_not_found";
5383
+ message: string;
5384
+ retryable: boolean;
5385
+ };
5365
5386
  })[];
5366
5387
  midpointsByVenueMarketId: Map<string, number | null>;
5388
+ arbReturnByVenueMarketId: Map<string, number | null>;
5367
5389
  requestedVenueMarketIds: string[];
5368
5390
  data: BatchMidpointsResponse;
5369
5391
  error: Error;
@@ -5395,8 +5417,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5395
5417
  midpointRows: (MidpointRow & {
5396
5418
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5397
5419
  matched: MidpointRow[];
5420
+ arbReturn?: number | null;
5421
+ marketStatus?: _agg_build_sdk.MarketStatus;
5422
+ error?: {
5423
+ code: "market_resolved" | "market_not_found";
5424
+ message: string;
5425
+ retryable: boolean;
5426
+ };
5398
5427
  })[];
5399
5428
  midpointsByVenueMarketId: Map<string, number | null>;
5429
+ arbReturnByVenueMarketId: Map<string, number | null>;
5400
5430
  requestedVenueMarketIds: string[];
5401
5431
  data: BatchMidpointsResponse;
5402
5432
  error: null;
@@ -5428,8 +5458,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5428
5458
  midpointRows: (MidpointRow & {
5429
5459
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5430
5460
  matched: MidpointRow[];
5461
+ arbReturn?: number | null;
5462
+ marketStatus?: _agg_build_sdk.MarketStatus;
5463
+ error?: {
5464
+ code: "market_resolved" | "market_not_found";
5465
+ message: string;
5466
+ retryable: boolean;
5467
+ };
5431
5468
  })[];
5432
5469
  midpointsByVenueMarketId: Map<string, number | null>;
5470
+ arbReturnByVenueMarketId: Map<string, number | null>;
5433
5471
  requestedVenueMarketIds: string[];
5434
5472
  data: undefined;
5435
5473
  error: Error;
@@ -5461,8 +5499,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5461
5499
  midpointRows: (MidpointRow & {
5462
5500
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5463
5501
  matched: MidpointRow[];
5502
+ arbReturn?: number | null;
5503
+ marketStatus?: _agg_build_sdk.MarketStatus;
5504
+ error?: {
5505
+ code: "market_resolved" | "market_not_found";
5506
+ message: string;
5507
+ retryable: boolean;
5508
+ };
5464
5509
  })[];
5465
5510
  midpointsByVenueMarketId: Map<string, number | null>;
5511
+ arbReturnByVenueMarketId: Map<string, number | null>;
5466
5512
  requestedVenueMarketIds: string[];
5467
5513
  data: undefined;
5468
5514
  error: null;
@@ -5494,8 +5540,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5494
5540
  midpointRows: (MidpointRow & {
5495
5541
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5496
5542
  matched: MidpointRow[];
5543
+ arbReturn?: number | null;
5544
+ marketStatus?: _agg_build_sdk.MarketStatus;
5545
+ error?: {
5546
+ code: "market_resolved" | "market_not_found";
5547
+ message: string;
5548
+ retryable: boolean;
5549
+ };
5497
5550
  })[];
5498
5551
  midpointsByVenueMarketId: Map<string, number | null>;
5552
+ arbReturnByVenueMarketId: Map<string, number | null>;
5499
5553
  requestedVenueMarketIds: string[];
5500
5554
  data: undefined;
5501
5555
  error: null;
@@ -5527,8 +5581,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5527
5581
  midpointRows: (MidpointRow & {
5528
5582
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5529
5583
  matched: MidpointRow[];
5584
+ arbReturn?: number | null;
5585
+ marketStatus?: _agg_build_sdk.MarketStatus;
5586
+ error?: {
5587
+ code: "market_resolved" | "market_not_found";
5588
+ message: string;
5589
+ retryable: boolean;
5590
+ };
5530
5591
  })[];
5531
5592
  midpointsByVenueMarketId: Map<string, number | null>;
5593
+ arbReturnByVenueMarketId: Map<string, number | null>;
5532
5594
  requestedVenueMarketIds: string[];
5533
5595
  data: BatchMidpointsResponse;
5534
5596
  isError: false;
package/dist/index.d.ts CHANGED
@@ -237,7 +237,8 @@ type VenueMarket = {
237
237
  question: string;
238
238
  venueMarketOutcomes: {
239
239
  id: string;
240
- price: number;
240
+ /** REMOVED — no longer returned; use GET /midpoints for live prices. */
241
+ price?: number | undefined;
241
242
  venueMarketId: string;
242
243
  label: string;
243
244
  title?: string | null | undefined;
@@ -291,7 +292,8 @@ type VenueMarket = {
291
292
  conditionId?: string | null | undefined;
292
293
  venueMarketOutcomes?: {
293
294
  id: string;
294
- price: number;
295
+ /** REMOVED — no longer returned; use GET /midpoints for live prices. */
296
+ price?: number | undefined;
295
297
  venueMarketId: string;
296
298
  label: string;
297
299
  winner?: boolean | null | undefined;
@@ -383,7 +385,12 @@ type MatchedVenueMarketOutcomeRef = {
383
385
  };
384
386
  type VenueMarketOutcome = {
385
387
  id: string;
386
- price: number;
388
+ /**
389
+ * REMOVED — /venue-events and /venue-markets no longer return outcome
390
+ * prices. Fetch live prices from GET /midpoints (or the live-price hooks),
391
+ * keyed by this outcome's `id`.
392
+ */
393
+ price?: number | undefined;
387
394
  venueMarketId: string;
388
395
  label: string;
389
396
  title?: string | null | undefined;
@@ -710,6 +717,8 @@ interface AggUiLabels {
710
717
  depositType: string;
711
718
  redeemType: string;
712
719
  withdrawalType: string;
720
+ claimBreakdownModalAriaLabel: string;
721
+ claimBreakdownTransactionLinkAria: (venue: string) => string;
713
722
  redeemStatusTitles: {
714
723
  pending: string;
715
724
  completed: string;
@@ -3416,9 +3425,6 @@ declare function useLiveMarketStores(venueMarketIds: string[]): CandleBuilder[];
3416
3425
  * on `agg.orderbook.outcome`). The midpoint from each outcome's book is its
3417
3426
  * price — no complement derivation needed.
3418
3427
  *
3419
- * Falls back to the static `outcome.price` from the event payload when no
3420
- * live data is available.
3421
- *
3422
3428
  * Returns a stable Map<outcomeId, price> that updates only when cache entries
3423
3429
  * change.
3424
3430
  */
@@ -3727,7 +3733,15 @@ interface UseMarketOrderbookVenueOutcome {
3727
3733
  venueMarketOutcomeId: string;
3728
3734
  }
3729
3735
  interface UseMarketOrderbookOptions {
3730
- marketId: string | null;
3736
+ /**
3737
+ * The venueMarketOutcomeId to subscribe to (the `outcomes[].id` on REST
3738
+ * market responses). Orderbooks are keyed per-outcome on the WS gateway —
3739
+ * a venueMarketId here will never resolve to a book.
3740
+ */
3741
+ venueMarketOutcomeId?: string | null;
3742
+ /** @deprecated Misleading name — this has always been a venueMarketOutcomeId.
3743
+ * Use `venueMarketOutcomeId` instead. */
3744
+ marketId?: string | null;
3731
3745
  depth?: number;
3732
3746
  enabled?: boolean;
3733
3747
  venueOutcomes?: UseMarketOrderbookVenueOutcome[];
@@ -5362,8 +5376,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5362
5376
  midpointRows: (MidpointRow & {
5363
5377
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5364
5378
  matched: MidpointRow[];
5379
+ arbReturn?: number | null;
5380
+ marketStatus?: _agg_build_sdk.MarketStatus;
5381
+ error?: {
5382
+ code: "market_resolved" | "market_not_found";
5383
+ message: string;
5384
+ retryable: boolean;
5385
+ };
5365
5386
  })[];
5366
5387
  midpointsByVenueMarketId: Map<string, number | null>;
5388
+ arbReturnByVenueMarketId: Map<string, number | null>;
5367
5389
  requestedVenueMarketIds: string[];
5368
5390
  data: BatchMidpointsResponse;
5369
5391
  error: Error;
@@ -5395,8 +5417,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5395
5417
  midpointRows: (MidpointRow & {
5396
5418
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5397
5419
  matched: MidpointRow[];
5420
+ arbReturn?: number | null;
5421
+ marketStatus?: _agg_build_sdk.MarketStatus;
5422
+ error?: {
5423
+ code: "market_resolved" | "market_not_found";
5424
+ message: string;
5425
+ retryable: boolean;
5426
+ };
5398
5427
  })[];
5399
5428
  midpointsByVenueMarketId: Map<string, number | null>;
5429
+ arbReturnByVenueMarketId: Map<string, number | null>;
5400
5430
  requestedVenueMarketIds: string[];
5401
5431
  data: BatchMidpointsResponse;
5402
5432
  error: null;
@@ -5428,8 +5458,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5428
5458
  midpointRows: (MidpointRow & {
5429
5459
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5430
5460
  matched: MidpointRow[];
5461
+ arbReturn?: number | null;
5462
+ marketStatus?: _agg_build_sdk.MarketStatus;
5463
+ error?: {
5464
+ code: "market_resolved" | "market_not_found";
5465
+ message: string;
5466
+ retryable: boolean;
5467
+ };
5431
5468
  })[];
5432
5469
  midpointsByVenueMarketId: Map<string, number | null>;
5470
+ arbReturnByVenueMarketId: Map<string, number | null>;
5433
5471
  requestedVenueMarketIds: string[];
5434
5472
  data: undefined;
5435
5473
  error: Error;
@@ -5461,8 +5499,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5461
5499
  midpointRows: (MidpointRow & {
5462
5500
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5463
5501
  matched: MidpointRow[];
5502
+ arbReturn?: number | null;
5503
+ marketStatus?: _agg_build_sdk.MarketStatus;
5504
+ error?: {
5505
+ code: "market_resolved" | "market_not_found";
5506
+ message: string;
5507
+ retryable: boolean;
5508
+ };
5464
5509
  })[];
5465
5510
  midpointsByVenueMarketId: Map<string, number | null>;
5511
+ arbReturnByVenueMarketId: Map<string, number | null>;
5466
5512
  requestedVenueMarketIds: string[];
5467
5513
  data: undefined;
5468
5514
  error: null;
@@ -5494,8 +5540,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5494
5540
  midpointRows: (MidpointRow & {
5495
5541
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5496
5542
  matched: MidpointRow[];
5543
+ arbReturn?: number | null;
5544
+ marketStatus?: _agg_build_sdk.MarketStatus;
5545
+ error?: {
5546
+ code: "market_resolved" | "market_not_found";
5547
+ message: string;
5548
+ retryable: boolean;
5549
+ };
5497
5550
  })[];
5498
5551
  midpointsByVenueMarketId: Map<string, number | null>;
5552
+ arbReturnByVenueMarketId: Map<string, number | null>;
5499
5553
  requestedVenueMarketIds: string[];
5500
5554
  data: undefined;
5501
5555
  error: null;
@@ -5527,8 +5581,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5527
5581
  midpointRows: (MidpointRow & {
5528
5582
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5529
5583
  matched: MidpointRow[];
5584
+ arbReturn?: number | null;
5585
+ marketStatus?: _agg_build_sdk.MarketStatus;
5586
+ error?: {
5587
+ code: "market_resolved" | "market_not_found";
5588
+ message: string;
5589
+ retryable: boolean;
5590
+ };
5530
5591
  })[];
5531
5592
  midpointsByVenueMarketId: Map<string, number | null>;
5593
+ arbReturnByVenueMarketId: Map<string, number | null>;
5532
5594
  requestedVenueMarketIds: string[];
5533
5595
  data: BatchMidpointsResponse;
5534
5596
  isError: false;
package/dist/index.js CHANGED
@@ -796,6 +796,8 @@ var enUsLabels = {
796
796
  depositType: "Deposit",
797
797
  redeemType: "Claim",
798
798
  withdrawalType: "Withdrawal",
799
+ claimBreakdownModalAriaLabel: "Claim activity breakdown",
800
+ claimBreakdownTransactionLinkAria: (venue) => `Open ${venue} claim transaction`,
799
801
  redeemStatusTitles: {
800
802
  pending: "Processing claim",
801
803
  completed: "Successful claim",
@@ -6178,7 +6180,6 @@ function useLiveOutcomePrices(venueMarkets) {
6178
6180
  for (const vm of venueMarkets) {
6179
6181
  for (const outcome of (_d = vm.venueMarketOutcomes) != null ? _d : []) {
6180
6182
  if (!enableLiveUpdates) {
6181
- prices.set(outcome.id, outcome.price);
6182
6183
  continue;
6183
6184
  }
6184
6185
  const liveMidpoint = liveByOutcomeId.get(outcome.id);
@@ -6781,18 +6782,19 @@ var useRollingChartWindow = (options) => {
6781
6782
  // src/use-market-orderbook.ts
6782
6783
  var import_react_query27 = require("@tanstack/react-query");
6783
6784
  function useMarketOrderbook(options) {
6784
- var _a, _b, _c, _d, _e, _f, _g;
6785
+ var _a, _b, _c, _d, _e, _f, _g, _h;
6785
6786
  const queryClient = (0, import_react_query27.useQueryClient)();
6786
6787
  const ws = useAggWebSocket();
6787
6788
  const isConnected = useAggWebSocketConnectionState();
6788
6789
  const {
6789
6790
  features: { enableLiveUpdates }
6790
6791
  } = useAggUiConfig();
6791
- const { marketId, depth, enabled = true, venueOutcomes, live } = options;
6792
+ const { venueMarketOutcomeId, marketId, depth, enabled = true, venueOutcomes, live } = options;
6793
+ const selectedId = (_a = venueMarketOutcomeId != null ? venueMarketOutcomeId : marketId) != null ? _a : null;
6792
6794
  const liveEnabled = live != null ? live : enableLiveUpdates;
6793
6795
  const outcomeIds = venueOutcomes == null ? void 0 : venueOutcomes.map((v) => v.venueMarketOutcomeId).filter(Boolean);
6794
- const subscriptionIds = (outcomeIds == null ? void 0 : outcomeIds.length) ? [...new Set(outcomeIds)] : marketId ? [marketId] : [];
6795
- const selectedOutcomeId = (_a = subscriptionIds[0]) != null ? _a : null;
6796
+ const subscriptionIds = (outcomeIds == null ? void 0 : outcomeIds.length) ? [...new Set(outcomeIds)] : selectedId ? [selectedId] : [];
6797
+ const selectedOutcomeId = (_b = subscriptionIds[0]) != null ? _b : null;
6796
6798
  useMarketDataSubscription({
6797
6799
  marketId: selectedOutcomeId,
6798
6800
  additionalMarketIds: subscriptionIds.slice(1),
@@ -6814,8 +6816,8 @@ function useMarketOrderbook(options) {
6814
6816
  var _a2, _b2;
6815
6817
  return (_b2 = (_a2 = liveQueries[index]) == null ? void 0 : _a2.data) != null ? _b2 : createMarketLiveState(subscriptionId);
6816
6818
  });
6817
- const primaryOrderbook = (_c = (_b = liveStates[0]) == null ? void 0 : _b.orderbook) != null ? _c : null;
6818
- const primarySnapshotVersion = (_e = (_d = liveStates[0]) == null ? void 0 : _d.orderbookSnapshotVersion) != null ? _e : 0;
6819
+ const primaryOrderbook = (_d = (_c = liveStates[0]) == null ? void 0 : _c.orderbook) != null ? _d : null;
6820
+ const primarySnapshotVersion = (_f = (_e = liveStates[0]) == null ? void 0 : _e.orderbookSnapshotVersion) != null ? _f : 0;
6819
6821
  const data = primaryOrderbook ? applyOrderbookDepth(
6820
6822
  createMarketOrderbookDataFromState(primaryOrderbook, {
6821
6823
  snapshotVersion: primarySnapshotVersion
@@ -6839,9 +6841,9 @@ function useMarketOrderbook(options) {
6839
6841
  })
6840
6842
  );
6841
6843
  const hasAnyOrderbook = liveStates.some((liveState) => liveState.orderbook != null);
6842
- const liveOrderbookErrorMessage = enabled && liveEnabled && !hasAnyOrderbook ? (_g = (_f = liveStates.find(
6844
+ const liveOrderbookErrorMessage = enabled && liveEnabled && !hasAnyOrderbook ? (_h = (_g = liveStates.find(
6843
6845
  (liveState) => typeof liveState.orderbookError === "string" && liveState.orderbookError.length > 0
6844
- )) == null ? void 0 : _f.orderbookError) != null ? _g : null : null;
6846
+ )) == null ? void 0 : _g.orderbookError) != null ? _h : null : null;
6845
6847
  return {
6846
6848
  data,
6847
6849
  dataById,
@@ -7665,11 +7667,11 @@ function mergeEventWithFullMarkets(event, fullMarkets) {
7665
7667
  return __spreadProps(__spreadValues({}, event), { venueMarkets: mergedMarkets });
7666
7668
  }
7667
7669
  function useEnrichedVenueEvent(options) {
7668
- var _b;
7670
+ var _b, _c;
7669
7671
  const _a = useVenueEvent(options), { event, isLoading, error } = _a, rest = __objRest(_a, ["event", "isLoading", "error"]);
7670
7672
  const eventEndedAt = (event == null ? void 0 : event.endDate) && Number.isFinite(Date.parse(event.endDate)) ? Date.parse(event.endDate) : null;
7671
7673
  const shouldFetchOnlyOpenMarkets = eventEndedAt == null || eventEndedAt >= Date.now();
7672
- const { markets, isLoading: isEnriching } = useVenueMarkets({
7674
+ const { markets: openMarkets, isLoading: isEnrichingOpenMarkets } = useVenueMarkets({
7673
7675
  venueEventId: options.eventId,
7674
7676
  enabled: ((_b = options.enabled) != null ? _b : true) && !!event,
7675
7677
  status: shouldFetchOnlyOpenMarkets ? "open" /* open */ : void 0
@@ -7678,6 +7680,16 @@ function useEnrichedVenueEvent(options) {
7678
7680
  // MarketDetailsList preserves the shared React Query cache key and the
7679
7681
  // event-type ordering.
7680
7682
  });
7683
+ const shouldFetchAllMarketsFallback = ((_c = options.enabled) != null ? _c : true) && !!event && shouldFetchOnlyOpenMarkets && !isEnrichingOpenMarkets && openMarkets.length === 0;
7684
+ const { markets: fallbackMarkets, isLoading: isEnrichingFallbackMarkets } = useVenueMarkets({
7685
+ venueEventId: options.eventId,
7686
+ enabled: shouldFetchAllMarketsFallback
7687
+ // No status filter on fallback: if an active event temporarily has only
7688
+ // closed/resolved markets, still render the event page instead of the
7689
+ // unavailable state.
7690
+ });
7691
+ const markets = fallbackMarkets.length > 0 ? fallbackMarkets : openMarkets;
7692
+ const isEnriching = isEnrichingOpenMarkets || isEnrichingFallbackMarkets;
7681
7693
  const enrichedEvent = (0, import_react34.useMemo)(() => {
7682
7694
  if (!event) return void 0;
7683
7695
  if (markets.length === 0) return event;
@@ -7831,6 +7843,19 @@ var mapMidpointsByVenueMarketId = (rows) => {
7831
7843
  });
7832
7844
  return mappedMidpoints;
7833
7845
  };
7846
+ var mapArbReturnByVenueMarketId = (rows) => {
7847
+ const mappedArbReturns = /* @__PURE__ */ new Map();
7848
+ rows.forEach((row) => {
7849
+ var _a;
7850
+ mappedArbReturns.set(row.venueMarketId, (_a = row.arbReturn) != null ? _a : null);
7851
+ row.matched.forEach((matchedRow) => {
7852
+ var _a2;
7853
+ if (mappedArbReturns.has(matchedRow.venueMarketId)) return;
7854
+ mappedArbReturns.set(matchedRow.venueMarketId, (_a2 = matchedRow.arbReturn) != null ? _a2 : null);
7855
+ });
7856
+ });
7857
+ return mappedArbReturns;
7858
+ };
7834
7859
  function useVenueMarketMidpoints(options) {
7835
7860
  var _a, _b, _c, _d;
7836
7861
  const client = useAggClient();
@@ -7860,9 +7885,11 @@ function useVenueMarketMidpoints(options) {
7860
7885
  });
7861
7886
  const midpointRows = (_d = (_c = query.data) == null ? void 0 : _c.data) != null ? _d : [];
7862
7887
  const midpointsByVenueMarketId = mapMidpointsByVenueMarketId(midpointRows);
7888
+ const arbReturnByVenueMarketId = mapArbReturnByVenueMarketId(midpointRows);
7863
7889
  return __spreadProps(__spreadValues({}, query), {
7864
7890
  midpointRows,
7865
7891
  midpointsByVenueMarketId,
7892
+ arbReturnByVenueMarketId,
7866
7893
  requestedVenueMarketIds
7867
7894
  });
7868
7895
  }
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  useRampQuotes,
3
3
  useRampSession
4
- } from "./chunk-SN4AO5D7.mjs";
4
+ } from "./chunk-UYM2TJOM.mjs";
5
5
  import {
6
6
  useWithdrawEstimate,
7
7
  useWithdrawFlow,
8
8
  useWithdrawPreview,
9
9
  useWithdrawalLifecycle
10
- } from "./chunk-NZEXGOFC.mjs";
10
+ } from "./chunk-TILXL4NI.mjs";
11
11
  import {
12
12
  AggAuthContext,
13
13
  AggBalanceProvider,
@@ -95,7 +95,7 @@ import {
95
95
  useSyncBalances,
96
96
  useWithdrawManaged,
97
97
  userActivityQueryKeys
98
- } from "./chunk-56RISN73.mjs";
98
+ } from "./chunk-R7C4J345.mjs";
99
99
 
100
100
  // src/index.ts
101
101
  import { QueryClient as QueryClient4, QueryClientProvider, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
@@ -981,7 +981,6 @@ function useLiveOutcomePrices(venueMarkets) {
981
981
  for (const vm of venueMarkets) {
982
982
  for (const outcome of (_d = vm.venueMarketOutcomes) != null ? _d : []) {
983
983
  if (!enableLiveUpdates) {
984
- prices.set(outcome.id, outcome.price);
985
984
  continue;
986
985
  }
987
986
  const liveMidpoint = liveByOutcomeId.get(outcome.id);
@@ -1584,18 +1583,19 @@ var useRollingChartWindow = (options) => {
1584
1583
  // src/use-market-orderbook.ts
1585
1584
  import { useQueries as useQueries5, useQueryClient } from "@tanstack/react-query";
1586
1585
  function useMarketOrderbook(options) {
1587
- var _a, _b, _c, _d, _e, _f, _g;
1586
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1588
1587
  const queryClient = useQueryClient();
1589
1588
  const ws = useAggWebSocket();
1590
1589
  const isConnected = useAggWebSocketConnectionState();
1591
1590
  const {
1592
1591
  features: { enableLiveUpdates }
1593
1592
  } = useAggUiConfig();
1594
- const { marketId, depth, enabled = true, venueOutcomes, live } = options;
1593
+ const { venueMarketOutcomeId, marketId, depth, enabled = true, venueOutcomes, live } = options;
1594
+ const selectedId = (_a = venueMarketOutcomeId != null ? venueMarketOutcomeId : marketId) != null ? _a : null;
1595
1595
  const liveEnabled = live != null ? live : enableLiveUpdates;
1596
1596
  const outcomeIds = venueOutcomes == null ? void 0 : venueOutcomes.map((v) => v.venueMarketOutcomeId).filter(Boolean);
1597
- const subscriptionIds = (outcomeIds == null ? void 0 : outcomeIds.length) ? [...new Set(outcomeIds)] : marketId ? [marketId] : [];
1598
- const selectedOutcomeId = (_a = subscriptionIds[0]) != null ? _a : null;
1597
+ const subscriptionIds = (outcomeIds == null ? void 0 : outcomeIds.length) ? [...new Set(outcomeIds)] : selectedId ? [selectedId] : [];
1598
+ const selectedOutcomeId = (_b = subscriptionIds[0]) != null ? _b : null;
1599
1599
  useMarketDataSubscription({
1600
1600
  marketId: selectedOutcomeId,
1601
1601
  additionalMarketIds: subscriptionIds.slice(1),
@@ -1617,8 +1617,8 @@ function useMarketOrderbook(options) {
1617
1617
  var _a2, _b2;
1618
1618
  return (_b2 = (_a2 = liveQueries[index]) == null ? void 0 : _a2.data) != null ? _b2 : createMarketLiveState(subscriptionId);
1619
1619
  });
1620
- const primaryOrderbook = (_c = (_b = liveStates[0]) == null ? void 0 : _b.orderbook) != null ? _c : null;
1621
- const primarySnapshotVersion = (_e = (_d = liveStates[0]) == null ? void 0 : _d.orderbookSnapshotVersion) != null ? _e : 0;
1620
+ const primaryOrderbook = (_d = (_c = liveStates[0]) == null ? void 0 : _c.orderbook) != null ? _d : null;
1621
+ const primarySnapshotVersion = (_f = (_e = liveStates[0]) == null ? void 0 : _e.orderbookSnapshotVersion) != null ? _f : 0;
1622
1622
  const data = primaryOrderbook ? applyOrderbookDepth(
1623
1623
  createMarketOrderbookDataFromState(primaryOrderbook, {
1624
1624
  snapshotVersion: primarySnapshotVersion
@@ -1642,9 +1642,9 @@ function useMarketOrderbook(options) {
1642
1642
  })
1643
1643
  );
1644
1644
  const hasAnyOrderbook = liveStates.some((liveState) => liveState.orderbook != null);
1645
- const liveOrderbookErrorMessage = enabled && liveEnabled && !hasAnyOrderbook ? (_g = (_f = liveStates.find(
1645
+ const liveOrderbookErrorMessage = enabled && liveEnabled && !hasAnyOrderbook ? (_h = (_g = liveStates.find(
1646
1646
  (liveState) => typeof liveState.orderbookError === "string" && liveState.orderbookError.length > 0
1647
- )) == null ? void 0 : _f.orderbookError) != null ? _g : null : null;
1647
+ )) == null ? void 0 : _g.orderbookError) != null ? _h : null : null;
1648
1648
  return {
1649
1649
  data,
1650
1650
  dataById,
@@ -2473,11 +2473,11 @@ function mergeEventWithFullMarkets(event, fullMarkets) {
2473
2473
  return __spreadProps(__spreadValues({}, event), { venueMarkets: mergedMarkets });
2474
2474
  }
2475
2475
  function useEnrichedVenueEvent(options) {
2476
- var _b;
2476
+ var _b, _c;
2477
2477
  const _a = useVenueEvent(options), { event, isLoading, error } = _a, rest = __objRest(_a, ["event", "isLoading", "error"]);
2478
2478
  const eventEndedAt = (event == null ? void 0 : event.endDate) && Number.isFinite(Date.parse(event.endDate)) ? Date.parse(event.endDate) : null;
2479
2479
  const shouldFetchOnlyOpenMarkets = eventEndedAt == null || eventEndedAt >= Date.now();
2480
- const { markets, isLoading: isEnriching } = useVenueMarkets({
2480
+ const { markets: openMarkets, isLoading: isEnrichingOpenMarkets } = useVenueMarkets({
2481
2481
  venueEventId: options.eventId,
2482
2482
  enabled: ((_b = options.enabled) != null ? _b : true) && !!event,
2483
2483
  status: shouldFetchOnlyOpenMarkets ? "open" /* open */ : void 0
@@ -2486,6 +2486,16 @@ function useEnrichedVenueEvent(options) {
2486
2486
  // MarketDetailsList preserves the shared React Query cache key and the
2487
2487
  // event-type ordering.
2488
2488
  });
2489
+ const shouldFetchAllMarketsFallback = ((_c = options.enabled) != null ? _c : true) && !!event && shouldFetchOnlyOpenMarkets && !isEnrichingOpenMarkets && openMarkets.length === 0;
2490
+ const { markets: fallbackMarkets, isLoading: isEnrichingFallbackMarkets } = useVenueMarkets({
2491
+ venueEventId: options.eventId,
2492
+ enabled: shouldFetchAllMarketsFallback
2493
+ // No status filter on fallback: if an active event temporarily has only
2494
+ // closed/resolved markets, still render the event page instead of the
2495
+ // unavailable state.
2496
+ });
2497
+ const markets = fallbackMarkets.length > 0 ? fallbackMarkets : openMarkets;
2498
+ const isEnriching = isEnrichingOpenMarkets || isEnrichingFallbackMarkets;
2489
2499
  const enrichedEvent = useMemo10(() => {
2490
2500
  if (!event) return void 0;
2491
2501
  if (markets.length === 0) return event;
@@ -2644,6 +2654,19 @@ var mapMidpointsByVenueMarketId = (rows) => {
2644
2654
  });
2645
2655
  return mappedMidpoints;
2646
2656
  };
2657
+ var mapArbReturnByVenueMarketId = (rows) => {
2658
+ const mappedArbReturns = /* @__PURE__ */ new Map();
2659
+ rows.forEach((row) => {
2660
+ var _a;
2661
+ mappedArbReturns.set(row.venueMarketId, (_a = row.arbReturn) != null ? _a : null);
2662
+ row.matched.forEach((matchedRow) => {
2663
+ var _a2;
2664
+ if (mappedArbReturns.has(matchedRow.venueMarketId)) return;
2665
+ mappedArbReturns.set(matchedRow.venueMarketId, (_a2 = matchedRow.arbReturn) != null ? _a2 : null);
2666
+ });
2667
+ });
2668
+ return mappedArbReturns;
2669
+ };
2647
2670
  function useVenueMarketMidpoints(options) {
2648
2671
  var _a, _b, _c, _d;
2649
2672
  const client = useAggClient();
@@ -2673,9 +2696,11 @@ function useVenueMarketMidpoints(options) {
2673
2696
  });
2674
2697
  const midpointRows = (_d = (_c = query.data) == null ? void 0 : _c.data) != null ? _d : [];
2675
2698
  const midpointsByVenueMarketId = mapMidpointsByVenueMarketId(midpointRows);
2699
+ const arbReturnByVenueMarketId = mapArbReturnByVenueMarketId(midpointRows);
2676
2700
  return __spreadProps(__spreadValues({}, query), {
2677
2701
  midpointRows,
2678
2702
  midpointsByVenueMarketId,
2703
+ arbReturnByVenueMarketId,
2679
2704
  requestedVenueMarketIds
2680
2705
  });
2681
2706
  }
package/dist/withdraw.js CHANGED
@@ -341,6 +341,8 @@ var enUsLabels = {
341
341
  depositType: "Deposit",
342
342
  redeemType: "Claim",
343
343
  withdrawalType: "Withdrawal",
344
+ claimBreakdownModalAriaLabel: "Claim activity breakdown",
345
+ claimBreakdownTransactionLinkAria: (venue) => `Open ${venue} claim transaction`,
344
346
  redeemStatusTitles: {
345
347
  pending: "Processing claim",
346
348
  completed: "Successful claim",
package/dist/withdraw.mjs CHANGED
@@ -3,12 +3,12 @@ import {
3
3
  useWithdrawFlow,
4
4
  useWithdrawPreview,
5
5
  useWithdrawalLifecycle
6
- } from "./chunk-NZEXGOFC.mjs";
6
+ } from "./chunk-TILXL4NI.mjs";
7
7
  import {
8
8
  useDepositAddresses,
9
9
  useManagedBalances,
10
10
  useWithdrawManaged
11
- } from "./chunk-56RISN73.mjs";
11
+ } from "./chunk-R7C4J345.mjs";
12
12
  export {
13
13
  useDepositAddresses,
14
14
  useManagedBalances,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/hooks",
3
- "version": "2.1.3",
3
+ "version": "2.2.1",
4
4
  "description": "React hooks and providers for the AGG prediction market aggregator. Wraps @agg-build/sdk with TanStack Query, shared session state, and live WebSocket data.",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -83,7 +83,7 @@
83
83
  "react": "^18.0.0 || ^19.0.0",
84
84
  "viem": "^2.0.0",
85
85
  "wagmi": "^3.0.0 || ^2.0.0",
86
- "@agg-build/sdk": "^2.1.3"
86
+ "@agg-build/sdk": "^2.2.1"
87
87
  },
88
88
  "peerDependenciesMeta": {
89
89
  "@solana/wallet-adapter-react": {