@agg-build/hooks 2.2.0 → 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
@@ -717,6 +717,8 @@ interface AggUiLabels {
717
717
  depositType: string;
718
718
  redeemType: string;
719
719
  withdrawalType: string;
720
+ claimBreakdownModalAriaLabel: string;
721
+ claimBreakdownTransactionLinkAria: (venue: string) => string;
720
722
  redeemStatusTitles: {
721
723
  pending: string;
722
724
  completed: string;
@@ -3731,7 +3733,15 @@ interface UseMarketOrderbookVenueOutcome {
3731
3733
  venueMarketOutcomeId: string;
3732
3734
  }
3733
3735
  interface UseMarketOrderbookOptions {
3734
- 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;
3735
3745
  depth?: number;
3736
3746
  enabled?: boolean;
3737
3747
  venueOutcomes?: UseMarketOrderbookVenueOutcome[];
@@ -5366,8 +5376,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5366
5376
  midpointRows: (MidpointRow & {
5367
5377
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5368
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
+ };
5369
5386
  })[];
5370
5387
  midpointsByVenueMarketId: Map<string, number | null>;
5388
+ arbReturnByVenueMarketId: Map<string, number | null>;
5371
5389
  requestedVenueMarketIds: string[];
5372
5390
  data: BatchMidpointsResponse;
5373
5391
  error: Error;
@@ -5399,8 +5417,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5399
5417
  midpointRows: (MidpointRow & {
5400
5418
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5401
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
+ };
5402
5427
  })[];
5403
5428
  midpointsByVenueMarketId: Map<string, number | null>;
5429
+ arbReturnByVenueMarketId: Map<string, number | null>;
5404
5430
  requestedVenueMarketIds: string[];
5405
5431
  data: BatchMidpointsResponse;
5406
5432
  error: null;
@@ -5432,8 +5458,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5432
5458
  midpointRows: (MidpointRow & {
5433
5459
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5434
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
+ };
5435
5468
  })[];
5436
5469
  midpointsByVenueMarketId: Map<string, number | null>;
5470
+ arbReturnByVenueMarketId: Map<string, number | null>;
5437
5471
  requestedVenueMarketIds: string[];
5438
5472
  data: undefined;
5439
5473
  error: Error;
@@ -5465,8 +5499,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5465
5499
  midpointRows: (MidpointRow & {
5466
5500
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5467
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
+ };
5468
5509
  })[];
5469
5510
  midpointsByVenueMarketId: Map<string, number | null>;
5511
+ arbReturnByVenueMarketId: Map<string, number | null>;
5470
5512
  requestedVenueMarketIds: string[];
5471
5513
  data: undefined;
5472
5514
  error: null;
@@ -5498,8 +5540,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5498
5540
  midpointRows: (MidpointRow & {
5499
5541
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5500
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
+ };
5501
5550
  })[];
5502
5551
  midpointsByVenueMarketId: Map<string, number | null>;
5552
+ arbReturnByVenueMarketId: Map<string, number | null>;
5503
5553
  requestedVenueMarketIds: string[];
5504
5554
  data: undefined;
5505
5555
  error: null;
@@ -5531,8 +5581,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5531
5581
  midpointRows: (MidpointRow & {
5532
5582
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5533
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
+ };
5534
5591
  })[];
5535
5592
  midpointsByVenueMarketId: Map<string, number | null>;
5593
+ arbReturnByVenueMarketId: Map<string, number | null>;
5536
5594
  requestedVenueMarketIds: string[];
5537
5595
  data: BatchMidpointsResponse;
5538
5596
  isError: false;
package/dist/index.d.ts CHANGED
@@ -717,6 +717,8 @@ interface AggUiLabels {
717
717
  depositType: string;
718
718
  redeemType: string;
719
719
  withdrawalType: string;
720
+ claimBreakdownModalAriaLabel: string;
721
+ claimBreakdownTransactionLinkAria: (venue: string) => string;
720
722
  redeemStatusTitles: {
721
723
  pending: string;
722
724
  completed: string;
@@ -3731,7 +3733,15 @@ interface UseMarketOrderbookVenueOutcome {
3731
3733
  venueMarketOutcomeId: string;
3732
3734
  }
3733
3735
  interface UseMarketOrderbookOptions {
3734
- 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;
3735
3745
  depth?: number;
3736
3746
  enabled?: boolean;
3737
3747
  venueOutcomes?: UseMarketOrderbookVenueOutcome[];
@@ -5366,8 +5376,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5366
5376
  midpointRows: (MidpointRow & {
5367
5377
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5368
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
+ };
5369
5386
  })[];
5370
5387
  midpointsByVenueMarketId: Map<string, number | null>;
5388
+ arbReturnByVenueMarketId: Map<string, number | null>;
5371
5389
  requestedVenueMarketIds: string[];
5372
5390
  data: BatchMidpointsResponse;
5373
5391
  error: Error;
@@ -5399,8 +5417,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5399
5417
  midpointRows: (MidpointRow & {
5400
5418
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5401
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
+ };
5402
5427
  })[];
5403
5428
  midpointsByVenueMarketId: Map<string, number | null>;
5429
+ arbReturnByVenueMarketId: Map<string, number | null>;
5404
5430
  requestedVenueMarketIds: string[];
5405
5431
  data: BatchMidpointsResponse;
5406
5432
  error: null;
@@ -5432,8 +5458,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5432
5458
  midpointRows: (MidpointRow & {
5433
5459
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5434
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
+ };
5435
5468
  })[];
5436
5469
  midpointsByVenueMarketId: Map<string, number | null>;
5470
+ arbReturnByVenueMarketId: Map<string, number | null>;
5437
5471
  requestedVenueMarketIds: string[];
5438
5472
  data: undefined;
5439
5473
  error: Error;
@@ -5465,8 +5499,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5465
5499
  midpointRows: (MidpointRow & {
5466
5500
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5467
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
+ };
5468
5509
  })[];
5469
5510
  midpointsByVenueMarketId: Map<string, number | null>;
5511
+ arbReturnByVenueMarketId: Map<string, number | null>;
5470
5512
  requestedVenueMarketIds: string[];
5471
5513
  data: undefined;
5472
5514
  error: null;
@@ -5498,8 +5540,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5498
5540
  midpointRows: (MidpointRow & {
5499
5541
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5500
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
+ };
5501
5550
  })[];
5502
5551
  midpointsByVenueMarketId: Map<string, number | null>;
5552
+ arbReturnByVenueMarketId: Map<string, number | null>;
5503
5553
  requestedVenueMarketIds: string[];
5504
5554
  data: undefined;
5505
5555
  error: null;
@@ -5531,8 +5581,16 @@ declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions
5531
5581
  midpointRows: (MidpointRow & {
5532
5582
  outcomes: _agg_build_sdk.OutcomeMidpointRow[];
5533
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
+ };
5534
5591
  })[];
5535
5592
  midpointsByVenueMarketId: Map<string, number | null>;
5593
+ arbReturnByVenueMarketId: Map<string, number | null>;
5536
5594
  requestedVenueMarketIds: string[];
5537
5595
  data: BatchMidpointsResponse;
5538
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",
@@ -6780,18 +6782,19 @@ var useRollingChartWindow = (options) => {
6780
6782
  // src/use-market-orderbook.ts
6781
6783
  var import_react_query27 = require("@tanstack/react-query");
6782
6784
  function useMarketOrderbook(options) {
6783
- var _a, _b, _c, _d, _e, _f, _g;
6785
+ var _a, _b, _c, _d, _e, _f, _g, _h;
6784
6786
  const queryClient = (0, import_react_query27.useQueryClient)();
6785
6787
  const ws = useAggWebSocket();
6786
6788
  const isConnected = useAggWebSocketConnectionState();
6787
6789
  const {
6788
6790
  features: { enableLiveUpdates }
6789
6791
  } = useAggUiConfig();
6790
- 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;
6791
6794
  const liveEnabled = live != null ? live : enableLiveUpdates;
6792
6795
  const outcomeIds = venueOutcomes == null ? void 0 : venueOutcomes.map((v) => v.venueMarketOutcomeId).filter(Boolean);
6793
- const subscriptionIds = (outcomeIds == null ? void 0 : outcomeIds.length) ? [...new Set(outcomeIds)] : marketId ? [marketId] : [];
6794
- 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;
6795
6798
  useMarketDataSubscription({
6796
6799
  marketId: selectedOutcomeId,
6797
6800
  additionalMarketIds: subscriptionIds.slice(1),
@@ -6813,8 +6816,8 @@ function useMarketOrderbook(options) {
6813
6816
  var _a2, _b2;
6814
6817
  return (_b2 = (_a2 = liveQueries[index]) == null ? void 0 : _a2.data) != null ? _b2 : createMarketLiveState(subscriptionId);
6815
6818
  });
6816
- const primaryOrderbook = (_c = (_b = liveStates[0]) == null ? void 0 : _b.orderbook) != null ? _c : null;
6817
- 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;
6818
6821
  const data = primaryOrderbook ? applyOrderbookDepth(
6819
6822
  createMarketOrderbookDataFromState(primaryOrderbook, {
6820
6823
  snapshotVersion: primarySnapshotVersion
@@ -6838,9 +6841,9 @@ function useMarketOrderbook(options) {
6838
6841
  })
6839
6842
  );
6840
6843
  const hasAnyOrderbook = liveStates.some((liveState) => liveState.orderbook != null);
6841
- const liveOrderbookErrorMessage = enabled && liveEnabled && !hasAnyOrderbook ? (_g = (_f = liveStates.find(
6844
+ const liveOrderbookErrorMessage = enabled && liveEnabled && !hasAnyOrderbook ? (_h = (_g = liveStates.find(
6842
6845
  (liveState) => typeof liveState.orderbookError === "string" && liveState.orderbookError.length > 0
6843
- )) == null ? void 0 : _f.orderbookError) != null ? _g : null : null;
6846
+ )) == null ? void 0 : _g.orderbookError) != null ? _h : null : null;
6844
6847
  return {
6845
6848
  data,
6846
6849
  dataById,
@@ -7840,6 +7843,19 @@ var mapMidpointsByVenueMarketId = (rows) => {
7840
7843
  });
7841
7844
  return mappedMidpoints;
7842
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
+ };
7843
7859
  function useVenueMarketMidpoints(options) {
7844
7860
  var _a, _b, _c, _d;
7845
7861
  const client = useAggClient();
@@ -7869,9 +7885,11 @@ function useVenueMarketMidpoints(options) {
7869
7885
  });
7870
7886
  const midpointRows = (_d = (_c = query.data) == null ? void 0 : _c.data) != null ? _d : [];
7871
7887
  const midpointsByVenueMarketId = mapMidpointsByVenueMarketId(midpointRows);
7888
+ const arbReturnByVenueMarketId = mapArbReturnByVenueMarketId(midpointRows);
7872
7889
  return __spreadProps(__spreadValues({}, query), {
7873
7890
  midpointRows,
7874
7891
  midpointsByVenueMarketId,
7892
+ arbReturnByVenueMarketId,
7875
7893
  requestedVenueMarketIds
7876
7894
  });
7877
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";
@@ -1583,18 +1583,19 @@ var useRollingChartWindow = (options) => {
1583
1583
  // src/use-market-orderbook.ts
1584
1584
  import { useQueries as useQueries5, useQueryClient } from "@tanstack/react-query";
1585
1585
  function useMarketOrderbook(options) {
1586
- var _a, _b, _c, _d, _e, _f, _g;
1586
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1587
1587
  const queryClient = useQueryClient();
1588
1588
  const ws = useAggWebSocket();
1589
1589
  const isConnected = useAggWebSocketConnectionState();
1590
1590
  const {
1591
1591
  features: { enableLiveUpdates }
1592
1592
  } = useAggUiConfig();
1593
- 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;
1594
1595
  const liveEnabled = live != null ? live : enableLiveUpdates;
1595
1596
  const outcomeIds = venueOutcomes == null ? void 0 : venueOutcomes.map((v) => v.venueMarketOutcomeId).filter(Boolean);
1596
- const subscriptionIds = (outcomeIds == null ? void 0 : outcomeIds.length) ? [...new Set(outcomeIds)] : marketId ? [marketId] : [];
1597
- 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;
1598
1599
  useMarketDataSubscription({
1599
1600
  marketId: selectedOutcomeId,
1600
1601
  additionalMarketIds: subscriptionIds.slice(1),
@@ -1616,8 +1617,8 @@ function useMarketOrderbook(options) {
1616
1617
  var _a2, _b2;
1617
1618
  return (_b2 = (_a2 = liveQueries[index]) == null ? void 0 : _a2.data) != null ? _b2 : createMarketLiveState(subscriptionId);
1618
1619
  });
1619
- const primaryOrderbook = (_c = (_b = liveStates[0]) == null ? void 0 : _b.orderbook) != null ? _c : null;
1620
- 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;
1621
1622
  const data = primaryOrderbook ? applyOrderbookDepth(
1622
1623
  createMarketOrderbookDataFromState(primaryOrderbook, {
1623
1624
  snapshotVersion: primarySnapshotVersion
@@ -1641,9 +1642,9 @@ function useMarketOrderbook(options) {
1641
1642
  })
1642
1643
  );
1643
1644
  const hasAnyOrderbook = liveStates.some((liveState) => liveState.orderbook != null);
1644
- const liveOrderbookErrorMessage = enabled && liveEnabled && !hasAnyOrderbook ? (_g = (_f = liveStates.find(
1645
+ const liveOrderbookErrorMessage = enabled && liveEnabled && !hasAnyOrderbook ? (_h = (_g = liveStates.find(
1645
1646
  (liveState) => typeof liveState.orderbookError === "string" && liveState.orderbookError.length > 0
1646
- )) == null ? void 0 : _f.orderbookError) != null ? _g : null : null;
1647
+ )) == null ? void 0 : _g.orderbookError) != null ? _h : null : null;
1647
1648
  return {
1648
1649
  data,
1649
1650
  dataById,
@@ -2653,6 +2654,19 @@ var mapMidpointsByVenueMarketId = (rows) => {
2653
2654
  });
2654
2655
  return mappedMidpoints;
2655
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
+ };
2656
2670
  function useVenueMarketMidpoints(options) {
2657
2671
  var _a, _b, _c, _d;
2658
2672
  const client = useAggClient();
@@ -2682,9 +2696,11 @@ function useVenueMarketMidpoints(options) {
2682
2696
  });
2683
2697
  const midpointRows = (_d = (_c = query.data) == null ? void 0 : _c.data) != null ? _d : [];
2684
2698
  const midpointsByVenueMarketId = mapMidpointsByVenueMarketId(midpointRows);
2699
+ const arbReturnByVenueMarketId = mapArbReturnByVenueMarketId(midpointRows);
2685
2700
  return __spreadProps(__spreadValues({}, query), {
2686
2701
  midpointRows,
2687
2702
  midpointsByVenueMarketId,
2703
+ arbReturnByVenueMarketId,
2688
2704
  requestedVenueMarketIds
2689
2705
  });
2690
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.2.0",
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.2.0"
86
+ "@agg-build/sdk": "^2.2.1"
87
87
  },
88
88
  "peerDependenciesMeta": {
89
89
  "@solana/wallet-adapter-react": {