@agg-build/hooks 2.2.1 → 2.4.4

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __async,
3
3
  useAggClient
4
- } from "./chunk-R7C4J345.mjs";
4
+ } from "./chunk-STOMNDHO.mjs";
5
5
 
6
6
  // src/use-ramp-quotes.ts
7
7
  import { useMutation } from "@tanstack/react-query";
@@ -11,7 +11,7 @@ import {
11
11
  useOnWithdrawalLifecycle,
12
12
  useSyncBalances,
13
13
  useWithdrawManaged
14
- } from "./chunk-R7C4J345.mjs";
14
+ } from "./chunk-STOMNDHO.mjs";
15
15
 
16
16
  // src/withdraw/use-withdraw-flow.ts
17
17
  import { useCallback, useEffect, useMemo, useState } from "react";
@@ -596,6 +596,7 @@ var enUsLabels = {
596
596
  venuePlural: "Venues",
597
597
  matched: "Matched",
598
598
  matchedCount: (count) => `${count} ${count === 1 ? "Match" : "Matches"}`,
599
+ remainingMarkets: (count) => `+${count} ${count === 1 ? "market" : "markets"}`,
599
600
  priceGap: "Price Gap"
600
601
  },
601
602
  eventItemDetails: {
@@ -620,7 +621,7 @@ var enUsLabels = {
620
621
  marketSelectEmpty: "No markets found"
621
622
  },
622
623
  settlementSummary: {
623
- title: "Settlement",
624
+ title: "Settlement differences",
624
625
  readFullDetails: "Read full details",
625
626
  showLess: "Show less"
626
627
  },
@@ -687,6 +688,8 @@ var enUsLabels = {
687
688
  trading: {
688
689
  settlementSection: "Settlement",
689
690
  settlementDifferencesTitle: "Key differences across venues",
691
+ settlementCriticalDifferenceLabel: "Critical",
692
+ settlementValueUnavailable: "Not provided",
690
693
  settlementLoading: "Loading settlement",
691
694
  settlementDetailsAria: (venueLabel) => `${venueLabel} settlement details`,
692
695
  settlementShowMoreAria: (ctaLabel, venueLabel) => `${ctaLabel} for ${venueLabel}`,
package/dist/deposit.js CHANGED
@@ -533,6 +533,7 @@ var enUsLabels = {
533
533
  venuePlural: "Venues",
534
534
  matched: "Matched",
535
535
  matchedCount: (count) => `${count} ${count === 1 ? "Match" : "Matches"}`,
536
+ remainingMarkets: (count) => `+${count} ${count === 1 ? "market" : "markets"}`,
536
537
  priceGap: "Price Gap"
537
538
  },
538
539
  eventItemDetails: {
@@ -557,7 +558,7 @@ var enUsLabels = {
557
558
  marketSelectEmpty: "No markets found"
558
559
  },
559
560
  settlementSummary: {
560
- title: "Settlement",
561
+ title: "Settlement differences",
561
562
  readFullDetails: "Read full details",
562
563
  showLess: "Show less"
563
564
  },
@@ -624,6 +625,8 @@ var enUsLabels = {
624
625
  trading: {
625
626
  settlementSection: "Settlement",
626
627
  settlementDifferencesTitle: "Key differences across venues",
628
+ settlementCriticalDifferenceLabel: "Critical",
629
+ settlementValueUnavailable: "Not provided",
627
630
  settlementLoading: "Loading settlement",
628
631
  settlementDetailsAria: (venueLabel) => `${venueLabel} settlement details`,
629
632
  settlementShowMoreAria: (ctaLabel, venueLabel) => `${ctaLabel} for ${venueLabel}`,
package/dist/deposit.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  useRampQuotes,
3
3
  useRampSession
4
- } from "./chunk-UYM2TJOM.mjs";
4
+ } from "./chunk-KVMLKTGS.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-R7C4J345.mjs";
14
+ } from "./chunk-STOMNDHO.mjs";
15
15
 
16
16
  // src/deposit/normalize-wallet-error.ts
17
17
  function normalizeWalletError(error, supportedChains) {
package/dist/index.d.mts CHANGED
@@ -363,6 +363,8 @@ type VenueEvent = {
363
363
  structureType?: "candidate" | "sport" | "axis" | "dates" | null | undefined;
364
364
  /** Canonical sport slug for sports events (e.g. "basketball", "soccer"); null for non-sports. */
365
365
  sport?: string | null | undefined;
366
+ /** Structured per-venue settlement key-differences for this event's cluster. */
367
+ settlementDiff?: SettlementDiff | null | undefined;
366
368
  };
367
369
  type Orderbook = {
368
370
  bids: {
@@ -403,6 +405,16 @@ type VenueMarketOutcome = {
403
405
  type VenueEventWithMarkets = VenueEvent & {
404
406
  venueMarkets: VenueMarket[];
405
407
  };
408
+ type SettlementDifference = {
409
+ type: string;
410
+ title: string;
411
+ perVenue: Record<string, string>;
412
+ summary?: string | undefined;
413
+ };
414
+ type SettlementDiff = {
415
+ sharedSummary: string;
416
+ differences: SettlementDifference[];
417
+ };
406
418
 
407
419
  declare function getWalletAddressFromUserProfile(user: UserProfile | undefined): string | undefined;
408
420
 
@@ -842,6 +854,7 @@ interface AggUiLabels {
842
854
  venuePlural: string;
843
855
  matched: string;
844
856
  matchedCount: (count: number) => string;
857
+ remainingMarkets: (count: number) => string;
845
858
  priceGap: string;
846
859
  };
847
860
  eventItemDetails: {
@@ -933,6 +946,8 @@ interface AggUiLabels {
933
946
  trading: {
934
947
  settlementSection: string;
935
948
  settlementDifferencesTitle: string;
949
+ settlementCriticalDifferenceLabel: string;
950
+ settlementValueUnavailable: string;
936
951
  settlementLoading: string;
937
952
  settlementDetailsAria: (venueLabel: string) => string;
938
953
  settlementShowMoreAria: (ctaLabel: string, venueLabel: string) => string;
@@ -4036,6 +4051,8 @@ interface UseSearchOptions {
4036
4051
  type: "events" | "markets";
4037
4052
  /** Optional category ID filter. */
4038
4053
  categoryIds?: string[];
4054
+ /** Filter by status — pass ["open"] for tradeable-only results. */
4055
+ status?: MarketStatus[];
4039
4056
  /** Page size. Default 20. */
4040
4057
  limit?: number;
4041
4058
  /** If provided, enable/disable the query. Defaults to true. */
@@ -4083,6 +4100,8 @@ interface UseMarketSearchOptions {
4083
4100
  type: "events" | "markets";
4084
4101
  /** Optional category ID filter. */
4085
4102
  categoryIds?: string[];
4103
+ /** Filter by status — pass ["open"] for tradeable-only results. */
4104
+ status?: MarketStatus[];
4086
4105
  /** Page size for both modes. Default 20. */
4087
4106
  limit?: number;
4088
4107
  /**
@@ -5704,4 +5723,4 @@ declare function useAppConfig(): UseAppConfigResult;
5704
5723
  */
5705
5724
  declare function useCachedAppConfig(): UseAppConfigResult;
5706
5725
 
5707
- export { AUTH_CHOOSER_OPEN_EVENT, type AggAuthContextValue, type AggAuthSignInOptions, type AggBalanceContextValue, AggBalanceProvider, AggProvider, type AggProviderProps, AggProvider as AggSdkProvider, type AggProviderProps as AggSdkProviderProps, type AggUiConfig, type AggUiConfigInput, type AggUiLabels, type AggUiLabelsInput, AggUiProvider, type AggUiTradingExecutionMode, CHART_TIME_RANGES, CONFIRMED_MATCH_STATUSES, type ChartTimeRange, type ClosedPositionTotals, type ComputePriceGapsOptions, DEFAULT_AGG_ROOT_CLASS_NAME, type DagStepProgress, type EventListStateContextValue, EventListStateProvider, type EventListStateSnapshot, type EventTradingContextValue, type EventTradingState, type ExecutionProgressPhase, type ExecutionTerminalOrderEvent, type GeoBlockState, type GetOrdersQuery, type GetPositionsQuery, type InvalidateUserActivityOptions, type InvalidateUserMoneyStateOptions, type LiveBestPriceCandidate, type LiveBestPriceCandidates, type LiveBestPrices, type LiveCandle, MAX_PRICE_GAP_PCT, MIN_PRICE_GAP_PCT, type MarketChartCandle, type MarketChartData, type MarketChartVenueData, type MarketOrderbookData, type MarketOrderbookIntegrity, MarketStatus, type MarketTradingState, MatchStatus, MatchType, type OrderEligibility, type OrderEligibilityReason, type OrderListItem, type OrderbookResult, type PositionGroup, type PriceGapValue, type RedeemEvent, type RedeemLegLifecycle, type RedeemLifecycleState, RedeemRejectedError, type RollingChartWindow, type ScaledCandlePoint, type SdkUiConfig, type SdkUiConfigInput, type SdkUiProviderProps, type SmartRouteLoadingReason, type ThemeMode, TradeSide, type TradingAction, type TradingState, type TradingStateBase, type TradingStateKind, type UseAggAuthOptions, type UseAggAuthReturn, type UseAppConfigResult, type UseArbFeedResult, type UseCategoriesOptions, type UseCategoryChildrenOptions, type UseEnrichedVenueEventOptions, type UseExecuteManagedOptions, type UseExecutionOrdersOptions, type UseExecutionPositionsOptions, type UseExecutionProgressOptions, type UseExecutionProgressResult, type UseExternalIdOptions, type UseExternalIdReturn, type UseLinkAccountReturn, type UseLiveCandleOverlayOptions, type UseLiveCandleOverlayResult, type UseLiveCandlesOptions, type UseLiveCandlesResult, type UseLiveMarketResult, type UseMarketArbResult, type UseMarketChartOptions, type UseMarketChartResult, type UseMarketOrderbookOptions, type UseMarketOrderbookResult, type UseMarketOrderbookVenueOutcome, type UseMarketSearchOptions, type UseMidpointsOptions, type UseMidpointsResult, type UseOrderBookOptions, type UseOrderbookQuoteOptions, type UseOrderbookQuoteResult, type UseOrdersOptions, type UsePositionsOptions, type UseQuoteManagedOptions, type UseRedeemLifecycleInput, type UseRollingChartWindowOptions, type UseSearchOptions, type UseSmartRouteOptions, type UseSmartRouteResult, type UseUserActivityOptions, type UseUserHoldingsOptions, type UseVenueEventOptions, type UseVenueEventsOptions, type UseVenueMarketMidpointsOptions, type UseVenueMarketsOptions, type UseViewportMidpointsOptions, type UseVisibleIdsOptions, type UseVisibleIdsResult, type UserActivityInvalidationStrategy, Venue, type VenueAvailabilityState, type VenueEvent, type VenueEventWithMarkets, type VenueMarket, type VenueMarketOutcome, type WalletActionSendTokenParams, type WalletActions, buildLiveBestPriceCandidates, computeClosedPositionTotals, computePriceGaps, defaultAggUiConfig, defaultAggUiConfig as defaultSdkUiConfig, executionKeys, extractOutcomeBestCandidate, findLivePriceById, getBuilder, getOrCreateBuilder, getVenueAvailabilityState, getVisibleVenueIdsByConfig, getVisibleVenuesByConfig, getWalletAddressFromUserProfile, invalidateBalanceQueries, invalidatePositionQueries, invalidateUserActivityQueries, invalidateUserClaimState, invalidateUserMoneyState, isVenueDisabledByConfig, mergeBestPricesPreferringLive, normalizeVenueId, optimizedImageUrl, parseEmail, parseEmailStrict, rangeToSeconds, requestAggAuthChooserOpen, resolveAggUiLabels, resolveDefaultMarket as resolveDefaultTradingMarket, resolveEventTradingState, resolveMarketTradingState, resolveMarketWinningOutcome, resolveOrderEligibility, resolveRollingWindow, resolveTradingStateKind, sortVenues, timeRangeToInterval, tradingReducer, useAggAuth, useAggAuthContext, useAggAuthState, useAggBalance, useAggBalanceContext, useAggBalanceState, useAggClient, useAggLabels, useAggUiConfig, useAggWebSocket, useAppConfig, useArbFeed, useCachedAppConfig, useCategories, useCategoryChildren, useDebouncedValue, useEnrichedVenueEvent, useEventListState, useEventOrderbookData, useEventTradingContext, useExecuteManaged, useExecutionOrders, useExecutionPositions, useExecutionProgress, useExternalId, useGeoBlock, useLabels, useLinkAccount, useLiveBestPriceCandidates, useLiveBestPrices, useLiveCandleOverlay, useLiveCandles, useLiveMarket, useLiveMarketStores, useLiveOutcomePrices, useLiveTrades, useMarketArb, useMarketChart, useMarketOrderbook, useMarketSearch, useMidpoints, useOnBalanceUpdate, useOnOrderEvent, useOnOrderSubmitted, useOnRedeemEvent, useOnWithdrawalLifecycle, useOptionalAggClient, useOrderBook, useOrderbookQuote, useOrders, usePositions, useQuoteManaged, useRampQuotes, useRampSession, useRedeem, useRedeemEligibleCount, useRedeemLifecycle, useRedeemLifecycles, useRollingChartWindow, useSdkLabels, useSdkUiConfig, useSearch, useSmartRoute, useUserActivity, useUserHoldings, useVenueEvent, useVenueEvents, useVenueMarketMidpoints, useVenueMarkets, useViewportMidpoints, useVisibleIds, userActivityQueryKeys };
5726
+ export { AUTH_CHOOSER_OPEN_EVENT, type AggAuthContextValue, type AggAuthSignInOptions, type AggBalanceContextValue, AggBalanceProvider, AggProvider, type AggProviderProps, AggProvider as AggSdkProvider, type AggProviderProps as AggSdkProviderProps, type AggUiConfig, type AggUiConfigInput, type AggUiLabels, type AggUiLabelsInput, AggUiProvider, type AggUiTradingExecutionMode, CHART_TIME_RANGES, CONFIRMED_MATCH_STATUSES, type ChartTimeRange, type ClosedPositionTotals, type ComputePriceGapsOptions, DEFAULT_AGG_ROOT_CLASS_NAME, type DagStepProgress, type EventListStateContextValue, EventListStateProvider, type EventListStateSnapshot, type EventTradingContextValue, type EventTradingState, type ExecutionProgressPhase, type ExecutionTerminalOrderEvent, type GeoBlockState, type GetOrdersQuery, type GetPositionsQuery, type InvalidateUserActivityOptions, type InvalidateUserMoneyStateOptions, type LiveBestPriceCandidate, type LiveBestPriceCandidates, type LiveBestPrices, type LiveCandle, MAX_PRICE_GAP_PCT, MIN_PRICE_GAP_PCT, type MarketChartCandle, type MarketChartData, type MarketChartVenueData, type MarketOrderbookData, type MarketOrderbookIntegrity, MarketStatus, type MarketTradingState, MatchStatus, MatchType, type OrderEligibility, type OrderEligibilityReason, type OrderListItem, type OrderbookResult, type PositionGroup, type PriceGapValue, type RedeemEvent, type RedeemLegLifecycle, type RedeemLifecycleState, RedeemRejectedError, type RollingChartWindow, type ScaledCandlePoint, type SdkUiConfig, type SdkUiConfigInput, type SdkUiProviderProps, type SettlementDiff, type SettlementDifference, type SmartRouteLoadingReason, type ThemeMode, TradeSide, type TradingAction, type TradingState, type TradingStateBase, type TradingStateKind, type UseAggAuthOptions, type UseAggAuthReturn, type UseAppConfigResult, type UseArbFeedResult, type UseCategoriesOptions, type UseCategoryChildrenOptions, type UseEnrichedVenueEventOptions, type UseExecuteManagedOptions, type UseExecutionOrdersOptions, type UseExecutionPositionsOptions, type UseExecutionProgressOptions, type UseExecutionProgressResult, type UseExternalIdOptions, type UseExternalIdReturn, type UseLinkAccountReturn, type UseLiveCandleOverlayOptions, type UseLiveCandleOverlayResult, type UseLiveCandlesOptions, type UseLiveCandlesResult, type UseLiveMarketResult, type UseMarketArbResult, type UseMarketChartOptions, type UseMarketChartResult, type UseMarketOrderbookOptions, type UseMarketOrderbookResult, type UseMarketOrderbookVenueOutcome, type UseMarketSearchOptions, type UseMidpointsOptions, type UseMidpointsResult, type UseOrderBookOptions, type UseOrderbookQuoteOptions, type UseOrderbookQuoteResult, type UseOrdersOptions, type UsePositionsOptions, type UseQuoteManagedOptions, type UseRedeemLifecycleInput, type UseRollingChartWindowOptions, type UseSearchOptions, type UseSmartRouteOptions, type UseSmartRouteResult, type UseUserActivityOptions, type UseUserHoldingsOptions, type UseVenueEventOptions, type UseVenueEventsOptions, type UseVenueMarketMidpointsOptions, type UseVenueMarketsOptions, type UseViewportMidpointsOptions, type UseVisibleIdsOptions, type UseVisibleIdsResult, type UserActivityInvalidationStrategy, Venue, type VenueAvailabilityState, type VenueEvent, type VenueEventWithMarkets, type VenueMarket, type VenueMarketOutcome, type WalletActionSendTokenParams, type WalletActions, buildLiveBestPriceCandidates, computeClosedPositionTotals, computePriceGaps, defaultAggUiConfig, defaultAggUiConfig as defaultSdkUiConfig, executionKeys, extractOutcomeBestCandidate, findLivePriceById, getBuilder, getOrCreateBuilder, getVenueAvailabilityState, getVisibleVenueIdsByConfig, getVisibleVenuesByConfig, getWalletAddressFromUserProfile, invalidateBalanceQueries, invalidatePositionQueries, invalidateUserActivityQueries, invalidateUserClaimState, invalidateUserMoneyState, isVenueDisabledByConfig, mergeBestPricesPreferringLive, normalizeVenueId, optimizedImageUrl, parseEmail, parseEmailStrict, rangeToSeconds, requestAggAuthChooserOpen, resolveAggUiLabels, resolveDefaultMarket as resolveDefaultTradingMarket, resolveEventTradingState, resolveMarketTradingState, resolveMarketWinningOutcome, resolveOrderEligibility, resolveRollingWindow, resolveTradingStateKind, sortVenues, timeRangeToInterval, tradingReducer, useAggAuth, useAggAuthContext, useAggAuthState, useAggBalance, useAggBalanceContext, useAggBalanceState, useAggClient, useAggLabels, useAggUiConfig, useAggWebSocket, useAppConfig, useArbFeed, useCachedAppConfig, useCategories, useCategoryChildren, useDebouncedValue, useEnrichedVenueEvent, useEventListState, useEventOrderbookData, useEventTradingContext, useExecuteManaged, useExecutionOrders, useExecutionPositions, useExecutionProgress, useExternalId, useGeoBlock, useLabels, useLinkAccount, useLiveBestPriceCandidates, useLiveBestPrices, useLiveCandleOverlay, useLiveCandles, useLiveMarket, useLiveMarketStores, useLiveOutcomePrices, useLiveTrades, useMarketArb, useMarketChart, useMarketOrderbook, useMarketSearch, useMidpoints, useOnBalanceUpdate, useOnOrderEvent, useOnOrderSubmitted, useOnRedeemEvent, useOnWithdrawalLifecycle, useOptionalAggClient, useOrderBook, useOrderbookQuote, useOrders, usePositions, useQuoteManaged, useRampQuotes, useRampSession, useRedeem, useRedeemEligibleCount, useRedeemLifecycle, useRedeemLifecycles, useRollingChartWindow, useSdkLabels, useSdkUiConfig, useSearch, useSmartRoute, useUserActivity, useUserHoldings, useVenueEvent, useVenueEvents, useVenueMarketMidpoints, useVenueMarkets, useViewportMidpoints, useVisibleIds, userActivityQueryKeys };
package/dist/index.d.ts CHANGED
@@ -363,6 +363,8 @@ type VenueEvent = {
363
363
  structureType?: "candidate" | "sport" | "axis" | "dates" | null | undefined;
364
364
  /** Canonical sport slug for sports events (e.g. "basketball", "soccer"); null for non-sports. */
365
365
  sport?: string | null | undefined;
366
+ /** Structured per-venue settlement key-differences for this event's cluster. */
367
+ settlementDiff?: SettlementDiff | null | undefined;
366
368
  };
367
369
  type Orderbook = {
368
370
  bids: {
@@ -403,6 +405,16 @@ type VenueMarketOutcome = {
403
405
  type VenueEventWithMarkets = VenueEvent & {
404
406
  venueMarkets: VenueMarket[];
405
407
  };
408
+ type SettlementDifference = {
409
+ type: string;
410
+ title: string;
411
+ perVenue: Record<string, string>;
412
+ summary?: string | undefined;
413
+ };
414
+ type SettlementDiff = {
415
+ sharedSummary: string;
416
+ differences: SettlementDifference[];
417
+ };
406
418
 
407
419
  declare function getWalletAddressFromUserProfile(user: UserProfile | undefined): string | undefined;
408
420
 
@@ -842,6 +854,7 @@ interface AggUiLabels {
842
854
  venuePlural: string;
843
855
  matched: string;
844
856
  matchedCount: (count: number) => string;
857
+ remainingMarkets: (count: number) => string;
845
858
  priceGap: string;
846
859
  };
847
860
  eventItemDetails: {
@@ -933,6 +946,8 @@ interface AggUiLabels {
933
946
  trading: {
934
947
  settlementSection: string;
935
948
  settlementDifferencesTitle: string;
949
+ settlementCriticalDifferenceLabel: string;
950
+ settlementValueUnavailable: string;
936
951
  settlementLoading: string;
937
952
  settlementDetailsAria: (venueLabel: string) => string;
938
953
  settlementShowMoreAria: (ctaLabel: string, venueLabel: string) => string;
@@ -4036,6 +4051,8 @@ interface UseSearchOptions {
4036
4051
  type: "events" | "markets";
4037
4052
  /** Optional category ID filter. */
4038
4053
  categoryIds?: string[];
4054
+ /** Filter by status — pass ["open"] for tradeable-only results. */
4055
+ status?: MarketStatus[];
4039
4056
  /** Page size. Default 20. */
4040
4057
  limit?: number;
4041
4058
  /** If provided, enable/disable the query. Defaults to true. */
@@ -4083,6 +4100,8 @@ interface UseMarketSearchOptions {
4083
4100
  type: "events" | "markets";
4084
4101
  /** Optional category ID filter. */
4085
4102
  categoryIds?: string[];
4103
+ /** Filter by status — pass ["open"] for tradeable-only results. */
4104
+ status?: MarketStatus[];
4086
4105
  /** Page size for both modes. Default 20. */
4087
4106
  limit?: number;
4088
4107
  /**
@@ -5704,4 +5723,4 @@ declare function useAppConfig(): UseAppConfigResult;
5704
5723
  */
5705
5724
  declare function useCachedAppConfig(): UseAppConfigResult;
5706
5725
 
5707
- export { AUTH_CHOOSER_OPEN_EVENT, type AggAuthContextValue, type AggAuthSignInOptions, type AggBalanceContextValue, AggBalanceProvider, AggProvider, type AggProviderProps, AggProvider as AggSdkProvider, type AggProviderProps as AggSdkProviderProps, type AggUiConfig, type AggUiConfigInput, type AggUiLabels, type AggUiLabelsInput, AggUiProvider, type AggUiTradingExecutionMode, CHART_TIME_RANGES, CONFIRMED_MATCH_STATUSES, type ChartTimeRange, type ClosedPositionTotals, type ComputePriceGapsOptions, DEFAULT_AGG_ROOT_CLASS_NAME, type DagStepProgress, type EventListStateContextValue, EventListStateProvider, type EventListStateSnapshot, type EventTradingContextValue, type EventTradingState, type ExecutionProgressPhase, type ExecutionTerminalOrderEvent, type GeoBlockState, type GetOrdersQuery, type GetPositionsQuery, type InvalidateUserActivityOptions, type InvalidateUserMoneyStateOptions, type LiveBestPriceCandidate, type LiveBestPriceCandidates, type LiveBestPrices, type LiveCandle, MAX_PRICE_GAP_PCT, MIN_PRICE_GAP_PCT, type MarketChartCandle, type MarketChartData, type MarketChartVenueData, type MarketOrderbookData, type MarketOrderbookIntegrity, MarketStatus, type MarketTradingState, MatchStatus, MatchType, type OrderEligibility, type OrderEligibilityReason, type OrderListItem, type OrderbookResult, type PositionGroup, type PriceGapValue, type RedeemEvent, type RedeemLegLifecycle, type RedeemLifecycleState, RedeemRejectedError, type RollingChartWindow, type ScaledCandlePoint, type SdkUiConfig, type SdkUiConfigInput, type SdkUiProviderProps, type SmartRouteLoadingReason, type ThemeMode, TradeSide, type TradingAction, type TradingState, type TradingStateBase, type TradingStateKind, type UseAggAuthOptions, type UseAggAuthReturn, type UseAppConfigResult, type UseArbFeedResult, type UseCategoriesOptions, type UseCategoryChildrenOptions, type UseEnrichedVenueEventOptions, type UseExecuteManagedOptions, type UseExecutionOrdersOptions, type UseExecutionPositionsOptions, type UseExecutionProgressOptions, type UseExecutionProgressResult, type UseExternalIdOptions, type UseExternalIdReturn, type UseLinkAccountReturn, type UseLiveCandleOverlayOptions, type UseLiveCandleOverlayResult, type UseLiveCandlesOptions, type UseLiveCandlesResult, type UseLiveMarketResult, type UseMarketArbResult, type UseMarketChartOptions, type UseMarketChartResult, type UseMarketOrderbookOptions, type UseMarketOrderbookResult, type UseMarketOrderbookVenueOutcome, type UseMarketSearchOptions, type UseMidpointsOptions, type UseMidpointsResult, type UseOrderBookOptions, type UseOrderbookQuoteOptions, type UseOrderbookQuoteResult, type UseOrdersOptions, type UsePositionsOptions, type UseQuoteManagedOptions, type UseRedeemLifecycleInput, type UseRollingChartWindowOptions, type UseSearchOptions, type UseSmartRouteOptions, type UseSmartRouteResult, type UseUserActivityOptions, type UseUserHoldingsOptions, type UseVenueEventOptions, type UseVenueEventsOptions, type UseVenueMarketMidpointsOptions, type UseVenueMarketsOptions, type UseViewportMidpointsOptions, type UseVisibleIdsOptions, type UseVisibleIdsResult, type UserActivityInvalidationStrategy, Venue, type VenueAvailabilityState, type VenueEvent, type VenueEventWithMarkets, type VenueMarket, type VenueMarketOutcome, type WalletActionSendTokenParams, type WalletActions, buildLiveBestPriceCandidates, computeClosedPositionTotals, computePriceGaps, defaultAggUiConfig, defaultAggUiConfig as defaultSdkUiConfig, executionKeys, extractOutcomeBestCandidate, findLivePriceById, getBuilder, getOrCreateBuilder, getVenueAvailabilityState, getVisibleVenueIdsByConfig, getVisibleVenuesByConfig, getWalletAddressFromUserProfile, invalidateBalanceQueries, invalidatePositionQueries, invalidateUserActivityQueries, invalidateUserClaimState, invalidateUserMoneyState, isVenueDisabledByConfig, mergeBestPricesPreferringLive, normalizeVenueId, optimizedImageUrl, parseEmail, parseEmailStrict, rangeToSeconds, requestAggAuthChooserOpen, resolveAggUiLabels, resolveDefaultMarket as resolveDefaultTradingMarket, resolveEventTradingState, resolveMarketTradingState, resolveMarketWinningOutcome, resolveOrderEligibility, resolveRollingWindow, resolveTradingStateKind, sortVenues, timeRangeToInterval, tradingReducer, useAggAuth, useAggAuthContext, useAggAuthState, useAggBalance, useAggBalanceContext, useAggBalanceState, useAggClient, useAggLabels, useAggUiConfig, useAggWebSocket, useAppConfig, useArbFeed, useCachedAppConfig, useCategories, useCategoryChildren, useDebouncedValue, useEnrichedVenueEvent, useEventListState, useEventOrderbookData, useEventTradingContext, useExecuteManaged, useExecutionOrders, useExecutionPositions, useExecutionProgress, useExternalId, useGeoBlock, useLabels, useLinkAccount, useLiveBestPriceCandidates, useLiveBestPrices, useLiveCandleOverlay, useLiveCandles, useLiveMarket, useLiveMarketStores, useLiveOutcomePrices, useLiveTrades, useMarketArb, useMarketChart, useMarketOrderbook, useMarketSearch, useMidpoints, useOnBalanceUpdate, useOnOrderEvent, useOnOrderSubmitted, useOnRedeemEvent, useOnWithdrawalLifecycle, useOptionalAggClient, useOrderBook, useOrderbookQuote, useOrders, usePositions, useQuoteManaged, useRampQuotes, useRampSession, useRedeem, useRedeemEligibleCount, useRedeemLifecycle, useRedeemLifecycles, useRollingChartWindow, useSdkLabels, useSdkUiConfig, useSearch, useSmartRoute, useUserActivity, useUserHoldings, useVenueEvent, useVenueEvents, useVenueMarketMidpoints, useVenueMarkets, useViewportMidpoints, useVisibleIds, userActivityQueryKeys };
5726
+ export { AUTH_CHOOSER_OPEN_EVENT, type AggAuthContextValue, type AggAuthSignInOptions, type AggBalanceContextValue, AggBalanceProvider, AggProvider, type AggProviderProps, AggProvider as AggSdkProvider, type AggProviderProps as AggSdkProviderProps, type AggUiConfig, type AggUiConfigInput, type AggUiLabels, type AggUiLabelsInput, AggUiProvider, type AggUiTradingExecutionMode, CHART_TIME_RANGES, CONFIRMED_MATCH_STATUSES, type ChartTimeRange, type ClosedPositionTotals, type ComputePriceGapsOptions, DEFAULT_AGG_ROOT_CLASS_NAME, type DagStepProgress, type EventListStateContextValue, EventListStateProvider, type EventListStateSnapshot, type EventTradingContextValue, type EventTradingState, type ExecutionProgressPhase, type ExecutionTerminalOrderEvent, type GeoBlockState, type GetOrdersQuery, type GetPositionsQuery, type InvalidateUserActivityOptions, type InvalidateUserMoneyStateOptions, type LiveBestPriceCandidate, type LiveBestPriceCandidates, type LiveBestPrices, type LiveCandle, MAX_PRICE_GAP_PCT, MIN_PRICE_GAP_PCT, type MarketChartCandle, type MarketChartData, type MarketChartVenueData, type MarketOrderbookData, type MarketOrderbookIntegrity, MarketStatus, type MarketTradingState, MatchStatus, MatchType, type OrderEligibility, type OrderEligibilityReason, type OrderListItem, type OrderbookResult, type PositionGroup, type PriceGapValue, type RedeemEvent, type RedeemLegLifecycle, type RedeemLifecycleState, RedeemRejectedError, type RollingChartWindow, type ScaledCandlePoint, type SdkUiConfig, type SdkUiConfigInput, type SdkUiProviderProps, type SettlementDiff, type SettlementDifference, type SmartRouteLoadingReason, type ThemeMode, TradeSide, type TradingAction, type TradingState, type TradingStateBase, type TradingStateKind, type UseAggAuthOptions, type UseAggAuthReturn, type UseAppConfigResult, type UseArbFeedResult, type UseCategoriesOptions, type UseCategoryChildrenOptions, type UseEnrichedVenueEventOptions, type UseExecuteManagedOptions, type UseExecutionOrdersOptions, type UseExecutionPositionsOptions, type UseExecutionProgressOptions, type UseExecutionProgressResult, type UseExternalIdOptions, type UseExternalIdReturn, type UseLinkAccountReturn, type UseLiveCandleOverlayOptions, type UseLiveCandleOverlayResult, type UseLiveCandlesOptions, type UseLiveCandlesResult, type UseLiveMarketResult, type UseMarketArbResult, type UseMarketChartOptions, type UseMarketChartResult, type UseMarketOrderbookOptions, type UseMarketOrderbookResult, type UseMarketOrderbookVenueOutcome, type UseMarketSearchOptions, type UseMidpointsOptions, type UseMidpointsResult, type UseOrderBookOptions, type UseOrderbookQuoteOptions, type UseOrderbookQuoteResult, type UseOrdersOptions, type UsePositionsOptions, type UseQuoteManagedOptions, type UseRedeemLifecycleInput, type UseRollingChartWindowOptions, type UseSearchOptions, type UseSmartRouteOptions, type UseSmartRouteResult, type UseUserActivityOptions, type UseUserHoldingsOptions, type UseVenueEventOptions, type UseVenueEventsOptions, type UseVenueMarketMidpointsOptions, type UseVenueMarketsOptions, type UseViewportMidpointsOptions, type UseVisibleIdsOptions, type UseVisibleIdsResult, type UserActivityInvalidationStrategy, Venue, type VenueAvailabilityState, type VenueEvent, type VenueEventWithMarkets, type VenueMarket, type VenueMarketOutcome, type WalletActionSendTokenParams, type WalletActions, buildLiveBestPriceCandidates, computeClosedPositionTotals, computePriceGaps, defaultAggUiConfig, defaultAggUiConfig as defaultSdkUiConfig, executionKeys, extractOutcomeBestCandidate, findLivePriceById, getBuilder, getOrCreateBuilder, getVenueAvailabilityState, getVisibleVenueIdsByConfig, getVisibleVenuesByConfig, getWalletAddressFromUserProfile, invalidateBalanceQueries, invalidatePositionQueries, invalidateUserActivityQueries, invalidateUserClaimState, invalidateUserMoneyState, isVenueDisabledByConfig, mergeBestPricesPreferringLive, normalizeVenueId, optimizedImageUrl, parseEmail, parseEmailStrict, rangeToSeconds, requestAggAuthChooserOpen, resolveAggUiLabels, resolveDefaultMarket as resolveDefaultTradingMarket, resolveEventTradingState, resolveMarketTradingState, resolveMarketWinningOutcome, resolveOrderEligibility, resolveRollingWindow, resolveTradingStateKind, sortVenues, timeRangeToInterval, tradingReducer, useAggAuth, useAggAuthContext, useAggAuthState, useAggBalance, useAggBalanceContext, useAggBalanceState, useAggClient, useAggLabels, useAggUiConfig, useAggWebSocket, useAppConfig, useArbFeed, useCachedAppConfig, useCategories, useCategoryChildren, useDebouncedValue, useEnrichedVenueEvent, useEventListState, useEventOrderbookData, useEventTradingContext, useExecuteManaged, useExecutionOrders, useExecutionPositions, useExecutionProgress, useExternalId, useGeoBlock, useLabels, useLinkAccount, useLiveBestPriceCandidates, useLiveBestPrices, useLiveCandleOverlay, useLiveCandles, useLiveMarket, useLiveMarketStores, useLiveOutcomePrices, useLiveTrades, useMarketArb, useMarketChart, useMarketOrderbook, useMarketSearch, useMidpoints, useOnBalanceUpdate, useOnOrderEvent, useOnOrderSubmitted, useOnRedeemEvent, useOnWithdrawalLifecycle, useOptionalAggClient, useOrderBook, useOrderbookQuote, useOrders, usePositions, useQuoteManaged, useRampQuotes, useRampSession, useRedeem, useRedeemEligibleCount, useRedeemLifecycle, useRedeemLifecycles, useRollingChartWindow, useSdkLabels, useSdkUiConfig, useSearch, useSmartRoute, useUserActivity, useUserHoldings, useVenueEvent, useVenueEvents, useVenueMarketMidpoints, useVenueMarkets, useViewportMidpoints, useVisibleIds, userActivityQueryKeys };
package/dist/index.js CHANGED
@@ -918,6 +918,7 @@ var enUsLabels = {
918
918
  venuePlural: "Venues",
919
919
  matched: "Matched",
920
920
  matchedCount: (count) => `${count} ${count === 1 ? "Match" : "Matches"}`,
921
+ remainingMarkets: (count) => `+${count} ${count === 1 ? "market" : "markets"}`,
921
922
  priceGap: "Price Gap"
922
923
  },
923
924
  eventItemDetails: {
@@ -942,7 +943,7 @@ var enUsLabels = {
942
943
  marketSelectEmpty: "No markets found"
943
944
  },
944
945
  settlementSummary: {
945
- title: "Settlement",
946
+ title: "Settlement differences",
946
947
  readFullDetails: "Read full details",
947
948
  showLess: "Show less"
948
949
  },
@@ -1009,6 +1010,8 @@ var enUsLabels = {
1009
1010
  trading: {
1010
1011
  settlementSection: "Settlement",
1011
1012
  settlementDifferencesTitle: "Key differences across venues",
1013
+ settlementCriticalDifferenceLabel: "Critical",
1014
+ settlementValueUnavailable: "Not provided",
1012
1015
  settlementLoading: "Loading settlement",
1013
1016
  settlementDetailsAria: (venueLabel) => `${venueLabel} settlement details`,
1014
1017
  settlementShowMoreAria: (ctaLabel, venueLabel) => `${ctaLabel} for ${venueLabel}`,
@@ -6521,6 +6524,18 @@ var normalizeVenueMarketIds = (venueMarkets) => {
6521
6524
  var normalizeOutcomeLabel = (label) => {
6522
6525
  return typeof label === "string" ? label.trim().toLowerCase() : "";
6523
6526
  };
6527
+ var normalizeSemanticOutcomeLabel = (label) => {
6528
+ const normalizedLabel = normalizeOutcomeLabel(label);
6529
+ if (!normalizedLabel) return "";
6530
+ if (normalizedLabel === "y") return "yes";
6531
+ if (normalizedLabel === "n") return "no";
6532
+ return normalizedLabel;
6533
+ };
6534
+ var outcomeMatchesSemanticSide = (left, right) => {
6535
+ const leftCandidates = [left.label, left.title].map((value) => normalizeSemanticOutcomeLabel(value)).filter(Boolean);
6536
+ const rightCandidates = [right.label, right.title].map((value) => normalizeSemanticOutcomeLabel(value)).filter(Boolean);
6537
+ return leftCandidates.some((candidate) => rightCandidates.includes(candidate));
6538
+ };
6524
6539
  var resolveBestMidpointCandidateOutcomeIds = (venueMarkets) => {
6525
6540
  var _a, _b;
6526
6541
  if (!(venueMarkets == null ? void 0 : venueMarkets.length)) return [];
@@ -6550,6 +6565,31 @@ var resolveSiblingOutcomeMidpoint = (matched, ref) => {
6550
6565
  if ((sibOutcome == null ? void 0 : sibOutcome.midpoint) == null) return null;
6551
6566
  return { midpoint: sibOutcome.midpoint, venue: (_b = sibling.venue) != null ? _b : null };
6552
6567
  };
6568
+ var resolveSemanticFallbackMidpoint = ({
6569
+ marketById,
6570
+ outcome,
6571
+ matched
6572
+ }) => {
6573
+ var _a;
6574
+ if (!(matched == null ? void 0 : matched.length)) return null;
6575
+ let best = null;
6576
+ for (const sibling of matched) {
6577
+ const siblingMarket = marketById.get(sibling.venueMarketId);
6578
+ if (!((_a = siblingMarket == null ? void 0 : siblingMarket.venueMarketOutcomes) == null ? void 0 : _a.length)) continue;
6579
+ for (const siblingOutcome of siblingMarket.venueMarketOutcomes) {
6580
+ if (!outcomeMatchesSemanticSide(outcome, siblingOutcome)) continue;
6581
+ const candidate = resolveSiblingOutcomeMidpoint(matched, {
6582
+ venueMarketId: sibling.venueMarketId,
6583
+ venueMarketOutcomeId: siblingOutcome.id
6584
+ });
6585
+ if (candidate == null) continue;
6586
+ if (best == null || candidate.midpoint < best.midpoint) {
6587
+ best = candidate;
6588
+ }
6589
+ }
6590
+ }
6591
+ return best;
6592
+ };
6553
6593
  var extractBestPrices = (data, venueMarkets) => {
6554
6594
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
6555
6595
  const bestPrices = /* @__PURE__ */ new Map();
@@ -6658,11 +6698,12 @@ function useMidpoints(venueMarkets, options) {
6658
6698
  refetchOnReconnect: false
6659
6699
  });
6660
6700
  const result = (0, import_react28.useMemo)(() => {
6661
- var _a2, _b, _c, _d, _e;
6701
+ var _a2, _b, _c, _d, _e, _f;
6662
6702
  const map = /* @__PURE__ */ new Map();
6663
6703
  const venueMap = /* @__PURE__ */ new Map();
6664
6704
  if (!(data == null ? void 0 : data.data) || !venueMarkets) return { map, venueMap };
6665
6705
  const itemByMarketId = new Map(data.data.map((item) => [item.venueMarketId, item]));
6706
+ const marketById = new Map(venueMarkets.map((market) => [market.id, market]));
6666
6707
  for (const item of data.data) {
6667
6708
  if (!((_a2 = item.outcomes) == null ? void 0 : _a2.length)) continue;
6668
6709
  for (const o of item.outcomes) {
@@ -6676,15 +6717,26 @@ function useMidpoints(venueMarkets, options) {
6676
6717
  if (!item) continue;
6677
6718
  for (const outcome of market.venueMarketOutcomes) {
6678
6719
  const refs = (_b = outcome.matchedVenueMarketOutcomes) != null ? _b : [];
6679
- if (!refs.length) continue;
6680
6720
  let best = (_c = map.get(outcome.id)) != null ? _c : null;
6681
6721
  let bestVenue = (_d = item.venue) != null ? _d : null;
6682
- for (const ref of refs) {
6683
- const sib = resolveSiblingOutcomeMidpoint(item.matched, ref);
6684
- if (sib == null) continue;
6685
- if (best == null || sib.midpoint < best) {
6686
- best = sib.midpoint;
6687
- bestVenue = (_e = sib.venue) != null ? _e : bestVenue;
6722
+ if (refs.length > 0) {
6723
+ for (const ref of refs) {
6724
+ const sib = resolveSiblingOutcomeMidpoint(item.matched, ref);
6725
+ if (sib == null) continue;
6726
+ if (best == null || sib.midpoint < best) {
6727
+ best = sib.midpoint;
6728
+ bestVenue = (_e = sib.venue) != null ? _e : bestVenue;
6729
+ }
6730
+ }
6731
+ } else if (best == null) {
6732
+ const fallback = resolveSemanticFallbackMidpoint({
6733
+ marketById,
6734
+ outcome,
6735
+ matched: item.matched
6736
+ });
6737
+ if (fallback != null) {
6738
+ best = fallback.midpoint;
6739
+ bestVenue = (_f = fallback.venue) != null ? _f : bestVenue;
6688
6740
  }
6689
6741
  }
6690
6742
  if (best != null) {
@@ -7135,11 +7187,11 @@ function useOrders(options = {}) {
7135
7187
  var import_react_query31 = require("@tanstack/react-query");
7136
7188
  var import_react31 = require("react");
7137
7189
  function useSearch(options) {
7138
- var _a, _b, _c;
7190
+ var _a, _b, _c, _d;
7139
7191
  const client = (0, import_react31.useContext)(AggClientContext);
7140
7192
  const queryClient = (0, import_react31.useContext)(import_react_query31.QueryClientContext);
7141
7193
  const [fallbackQueryClient] = (0, import_react31.useState)(() => new import_react_query31.QueryClient());
7142
- const { q, type, categoryIds, limit = 20, enabled = true, deep = false } = options;
7194
+ const { q, type, categoryIds, status, limit = 20, enabled = true, deep = false } = options;
7143
7195
  const isEnabled = enabled && q.length > 0;
7144
7196
  (0, import_react31.useEffect)(() => {
7145
7197
  if (queryClient) return void 0;
@@ -7155,7 +7207,15 @@ function useSearch(options) {
7155
7207
  {
7156
7208
  // deep is part of the key — TanStack treats deep vs light as
7157
7209
  // independent queries so users can have both modes cached side-by-side.
7158
- queryKey: ["search", q, type, (_a = categoryIds == null ? void 0 : categoryIds.join(",")) != null ? _a : "", limit, deep],
7210
+ queryKey: [
7211
+ "search",
7212
+ q,
7213
+ type,
7214
+ (_a = categoryIds == null ? void 0 : categoryIds.join(",")) != null ? _a : "",
7215
+ (_b = status == null ? void 0 : status.join(",")) != null ? _b : "",
7216
+ limit,
7217
+ deep
7218
+ ],
7159
7219
  queryFn: (_0) => __async(null, [_0], function* ({ pageParam }) {
7160
7220
  if (!client) {
7161
7221
  throw new Error("useSearch must be used within an <AggProvider>");
@@ -7164,6 +7224,7 @@ function useSearch(options) {
7164
7224
  q,
7165
7225
  type,
7166
7226
  categoryIds,
7227
+ status,
7167
7228
  limit,
7168
7229
  cursor: pageParam,
7169
7230
  deep
@@ -7181,7 +7242,7 @@ function useSearch(options) {
7181
7242
  },
7182
7243
  queryClient != null ? queryClient : fallbackQueryClient
7183
7244
  );
7184
- const data = (_c = (_b = query.data) == null ? void 0 : _b.pages.flatMap((page) => page.data)) != null ? _c : [];
7245
+ const data = (_d = (_c = query.data) == null ? void 0 : _c.pages.flatMap((page) => page.data)) != null ? _d : [];
7185
7246
  return {
7186
7247
  data,
7187
7248
  isLoading: query.isLoading,
@@ -7201,6 +7262,7 @@ function useMarketSearch(options) {
7201
7262
  const {
7202
7263
  type,
7203
7264
  categoryIds,
7265
+ status,
7204
7266
  limit = 20,
7205
7267
  debounceMs = 200,
7206
7268
  enableSuggestions = true,
@@ -7215,6 +7277,7 @@ function useMarketSearch(options) {
7215
7277
  q: trimmedDebounced,
7216
7278
  type,
7217
7279
  categoryIds,
7280
+ status,
7218
7281
  limit,
7219
7282
  enabled: suggestionsEnabled,
7220
7283
  deep: false
@@ -7224,6 +7287,7 @@ function useMarketSearch(options) {
7224
7287
  q: submittedQ,
7225
7288
  type,
7226
7289
  categoryIds,
7290
+ status,
7227
7291
  limit,
7228
7292
  enabled: submittedQ.length > 0,
7229
7293
  deep: true
@@ -7537,6 +7601,19 @@ var import_react34 = require("react");
7537
7601
 
7538
7602
  // src/use-venue-event.ts
7539
7603
  var import_react_query34 = require("@tanstack/react-query");
7604
+ var RESOLUTION_POLL_MS = 15e3;
7605
+ var RESOLUTION_POLL_MAX_PAST_END_MS = 60 * 6e4;
7606
+ function resolutionPollInterval(event) {
7607
+ var _a;
7608
+ if (!((_a = event == null ? void 0 : event.venueMarkets) == null ? void 0 : _a.length)) return false;
7609
+ const now = Date.now();
7610
+ const shouldPoll = event.venueMarkets.some((market) => {
7611
+ if (market.status !== "open" /* open */ || !market.endDate) return false;
7612
+ const endsAt = new Date(market.endDate).getTime();
7613
+ return Number.isFinite(endsAt) && now > endsAt && now < endsAt + RESOLUTION_POLL_MAX_PAST_END_MS;
7614
+ });
7615
+ return shouldPoll ? RESOLUTION_POLL_MS : false;
7616
+ }
7540
7617
  function useVenueEvent(options) {
7541
7618
  var _a;
7542
7619
  const client = useAggClient();
@@ -7552,6 +7629,7 @@ function useVenueEvent(options) {
7552
7629
  refetchOnWindowFocus: true,
7553
7630
  refetchOnReconnect: true,
7554
7631
  refetchOnMount: true,
7632
+ refetchInterval: (query2) => resolutionPollInterval(query2.state.data),
7555
7633
  retry: 1
7556
7634
  });
7557
7635
  return __spreadProps(__spreadValues({}, query), {
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  useRampQuotes,
3
3
  useRampSession
4
- } from "./chunk-UYM2TJOM.mjs";
4
+ } from "./chunk-KVMLKTGS.mjs";
5
5
  import {
6
6
  useWithdrawEstimate,
7
7
  useWithdrawFlow,
8
8
  useWithdrawPreview,
9
9
  useWithdrawalLifecycle
10
- } from "./chunk-TILXL4NI.mjs";
10
+ } from "./chunk-RMGSLCL3.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-R7C4J345.mjs";
98
+ } from "./chunk-STOMNDHO.mjs";
99
99
 
100
100
  // src/index.ts
101
101
  import { QueryClient as QueryClient4, QueryClientProvider, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
@@ -1322,6 +1322,18 @@ var normalizeVenueMarketIds = (venueMarkets) => {
1322
1322
  var normalizeOutcomeLabel = (label) => {
1323
1323
  return typeof label === "string" ? label.trim().toLowerCase() : "";
1324
1324
  };
1325
+ var normalizeSemanticOutcomeLabel = (label) => {
1326
+ const normalizedLabel = normalizeOutcomeLabel(label);
1327
+ if (!normalizedLabel) return "";
1328
+ if (normalizedLabel === "y") return "yes";
1329
+ if (normalizedLabel === "n") return "no";
1330
+ return normalizedLabel;
1331
+ };
1332
+ var outcomeMatchesSemanticSide = (left, right) => {
1333
+ const leftCandidates = [left.label, left.title].map((value) => normalizeSemanticOutcomeLabel(value)).filter(Boolean);
1334
+ const rightCandidates = [right.label, right.title].map((value) => normalizeSemanticOutcomeLabel(value)).filter(Boolean);
1335
+ return leftCandidates.some((candidate) => rightCandidates.includes(candidate));
1336
+ };
1325
1337
  var resolveBestMidpointCandidateOutcomeIds = (venueMarkets) => {
1326
1338
  var _a, _b;
1327
1339
  if (!(venueMarkets == null ? void 0 : venueMarkets.length)) return [];
@@ -1351,6 +1363,31 @@ var resolveSiblingOutcomeMidpoint = (matched, ref) => {
1351
1363
  if ((sibOutcome == null ? void 0 : sibOutcome.midpoint) == null) return null;
1352
1364
  return { midpoint: sibOutcome.midpoint, venue: (_b = sibling.venue) != null ? _b : null };
1353
1365
  };
1366
+ var resolveSemanticFallbackMidpoint = ({
1367
+ marketById,
1368
+ outcome,
1369
+ matched
1370
+ }) => {
1371
+ var _a;
1372
+ if (!(matched == null ? void 0 : matched.length)) return null;
1373
+ let best = null;
1374
+ for (const sibling of matched) {
1375
+ const siblingMarket = marketById.get(sibling.venueMarketId);
1376
+ if (!((_a = siblingMarket == null ? void 0 : siblingMarket.venueMarketOutcomes) == null ? void 0 : _a.length)) continue;
1377
+ for (const siblingOutcome of siblingMarket.venueMarketOutcomes) {
1378
+ if (!outcomeMatchesSemanticSide(outcome, siblingOutcome)) continue;
1379
+ const candidate = resolveSiblingOutcomeMidpoint(matched, {
1380
+ venueMarketId: sibling.venueMarketId,
1381
+ venueMarketOutcomeId: siblingOutcome.id
1382
+ });
1383
+ if (candidate == null) continue;
1384
+ if (best == null || candidate.midpoint < best.midpoint) {
1385
+ best = candidate;
1386
+ }
1387
+ }
1388
+ }
1389
+ return best;
1390
+ };
1354
1391
  var extractBestPrices = (data, venueMarkets) => {
1355
1392
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
1356
1393
  const bestPrices = /* @__PURE__ */ new Map();
@@ -1459,11 +1496,12 @@ function useMidpoints(venueMarkets, options) {
1459
1496
  refetchOnReconnect: false
1460
1497
  });
1461
1498
  const result = useMemo8(() => {
1462
- var _a2, _b, _c, _d, _e;
1499
+ var _a2, _b, _c, _d, _e, _f;
1463
1500
  const map = /* @__PURE__ */ new Map();
1464
1501
  const venueMap = /* @__PURE__ */ new Map();
1465
1502
  if (!(data == null ? void 0 : data.data) || !venueMarkets) return { map, venueMap };
1466
1503
  const itemByMarketId = new Map(data.data.map((item) => [item.venueMarketId, item]));
1504
+ const marketById = new Map(venueMarkets.map((market) => [market.id, market]));
1467
1505
  for (const item of data.data) {
1468
1506
  if (!((_a2 = item.outcomes) == null ? void 0 : _a2.length)) continue;
1469
1507
  for (const o of item.outcomes) {
@@ -1477,15 +1515,26 @@ function useMidpoints(venueMarkets, options) {
1477
1515
  if (!item) continue;
1478
1516
  for (const outcome of market.venueMarketOutcomes) {
1479
1517
  const refs = (_b = outcome.matchedVenueMarketOutcomes) != null ? _b : [];
1480
- if (!refs.length) continue;
1481
1518
  let best = (_c = map.get(outcome.id)) != null ? _c : null;
1482
1519
  let bestVenue = (_d = item.venue) != null ? _d : null;
1483
- for (const ref of refs) {
1484
- const sib = resolveSiblingOutcomeMidpoint(item.matched, ref);
1485
- if (sib == null) continue;
1486
- if (best == null || sib.midpoint < best) {
1487
- best = sib.midpoint;
1488
- bestVenue = (_e = sib.venue) != null ? _e : bestVenue;
1520
+ if (refs.length > 0) {
1521
+ for (const ref of refs) {
1522
+ const sib = resolveSiblingOutcomeMidpoint(item.matched, ref);
1523
+ if (sib == null) continue;
1524
+ if (best == null || sib.midpoint < best) {
1525
+ best = sib.midpoint;
1526
+ bestVenue = (_e = sib.venue) != null ? _e : bestVenue;
1527
+ }
1528
+ }
1529
+ } else if (best == null) {
1530
+ const fallback = resolveSemanticFallbackMidpoint({
1531
+ marketById,
1532
+ outcome,
1533
+ matched: item.matched
1534
+ });
1535
+ if (fallback != null) {
1536
+ best = fallback.midpoint;
1537
+ bestVenue = (_f = fallback.venue) != null ? _f : bestVenue;
1489
1538
  }
1490
1539
  }
1491
1540
  if (best != null) {
@@ -1941,11 +1990,11 @@ import {
1941
1990
  } from "@tanstack/react-query";
1942
1991
  import { useContext as useContext2, useEffect as useEffect7, useState as useState6 } from "react";
1943
1992
  function useSearch(options) {
1944
- var _a, _b, _c;
1993
+ var _a, _b, _c, _d;
1945
1994
  const client = useContext2(AggClientContext);
1946
1995
  const queryClient = useContext2(QueryClientContext);
1947
1996
  const [fallbackQueryClient] = useState6(() => new QueryClient());
1948
- const { q, type, categoryIds, limit = 20, enabled = true, deep = false } = options;
1997
+ const { q, type, categoryIds, status, limit = 20, enabled = true, deep = false } = options;
1949
1998
  const isEnabled = enabled && q.length > 0;
1950
1999
  useEffect7(() => {
1951
2000
  if (queryClient) return void 0;
@@ -1961,7 +2010,15 @@ function useSearch(options) {
1961
2010
  {
1962
2011
  // deep is part of the key — TanStack treats deep vs light as
1963
2012
  // independent queries so users can have both modes cached side-by-side.
1964
- queryKey: ["search", q, type, (_a = categoryIds == null ? void 0 : categoryIds.join(",")) != null ? _a : "", limit, deep],
2013
+ queryKey: [
2014
+ "search",
2015
+ q,
2016
+ type,
2017
+ (_a = categoryIds == null ? void 0 : categoryIds.join(",")) != null ? _a : "",
2018
+ (_b = status == null ? void 0 : status.join(",")) != null ? _b : "",
2019
+ limit,
2020
+ deep
2021
+ ],
1965
2022
  queryFn: (_0) => __async(null, [_0], function* ({ pageParam }) {
1966
2023
  if (!client) {
1967
2024
  throw new Error("useSearch must be used within an <AggProvider>");
@@ -1970,6 +2027,7 @@ function useSearch(options) {
1970
2027
  q,
1971
2028
  type,
1972
2029
  categoryIds,
2030
+ status,
1973
2031
  limit,
1974
2032
  cursor: pageParam,
1975
2033
  deep
@@ -1987,7 +2045,7 @@ function useSearch(options) {
1987
2045
  },
1988
2046
  queryClient != null ? queryClient : fallbackQueryClient
1989
2047
  );
1990
- const data = (_c = (_b = query.data) == null ? void 0 : _b.pages.flatMap((page) => page.data)) != null ? _c : [];
2048
+ const data = (_d = (_c = query.data) == null ? void 0 : _c.pages.flatMap((page) => page.data)) != null ? _d : [];
1991
2049
  return {
1992
2050
  data,
1993
2051
  isLoading: query.isLoading,
@@ -2007,6 +2065,7 @@ function useMarketSearch(options) {
2007
2065
  const {
2008
2066
  type,
2009
2067
  categoryIds,
2068
+ status,
2010
2069
  limit = 20,
2011
2070
  debounceMs = 200,
2012
2071
  enableSuggestions = true,
@@ -2021,6 +2080,7 @@ function useMarketSearch(options) {
2021
2080
  q: trimmedDebounced,
2022
2081
  type,
2023
2082
  categoryIds,
2083
+ status,
2024
2084
  limit,
2025
2085
  enabled: suggestionsEnabled,
2026
2086
  deep: false
@@ -2030,6 +2090,7 @@ function useMarketSearch(options) {
2030
2090
  q: submittedQ,
2031
2091
  type,
2032
2092
  categoryIds,
2093
+ status,
2033
2094
  limit,
2034
2095
  enabled: submittedQ.length > 0,
2035
2096
  deep: true
@@ -2343,6 +2404,19 @@ import { useMemo as useMemo10 } from "react";
2343
2404
 
2344
2405
  // src/use-venue-event.ts
2345
2406
  import { useQuery as useQuery7 } from "@tanstack/react-query";
2407
+ var RESOLUTION_POLL_MS = 15e3;
2408
+ var RESOLUTION_POLL_MAX_PAST_END_MS = 60 * 6e4;
2409
+ function resolutionPollInterval(event) {
2410
+ var _a;
2411
+ if (!((_a = event == null ? void 0 : event.venueMarkets) == null ? void 0 : _a.length)) return false;
2412
+ const now = Date.now();
2413
+ const shouldPoll = event.venueMarkets.some((market) => {
2414
+ if (market.status !== "open" /* open */ || !market.endDate) return false;
2415
+ const endsAt = new Date(market.endDate).getTime();
2416
+ return Number.isFinite(endsAt) && now > endsAt && now < endsAt + RESOLUTION_POLL_MAX_PAST_END_MS;
2417
+ });
2418
+ return shouldPoll ? RESOLUTION_POLL_MS : false;
2419
+ }
2346
2420
  function useVenueEvent(options) {
2347
2421
  var _a;
2348
2422
  const client = useAggClient();
@@ -2358,6 +2432,7 @@ function useVenueEvent(options) {
2358
2432
  refetchOnWindowFocus: true,
2359
2433
  refetchOnReconnect: true,
2360
2434
  refetchOnMount: true,
2435
+ refetchInterval: (query2) => resolutionPollInterval(query2.state.data),
2361
2436
  retry: 1
2362
2437
  });
2363
2438
  return __spreadProps(__spreadValues({}, query), {
package/dist/withdraw.js CHANGED
@@ -463,6 +463,7 @@ var enUsLabels = {
463
463
  venuePlural: "Venues",
464
464
  matched: "Matched",
465
465
  matchedCount: (count) => `${count} ${count === 1 ? "Match" : "Matches"}`,
466
+ remainingMarkets: (count) => `+${count} ${count === 1 ? "market" : "markets"}`,
466
467
  priceGap: "Price Gap"
467
468
  },
468
469
  eventItemDetails: {
@@ -487,7 +488,7 @@ var enUsLabels = {
487
488
  marketSelectEmpty: "No markets found"
488
489
  },
489
490
  settlementSummary: {
490
- title: "Settlement",
491
+ title: "Settlement differences",
491
492
  readFullDetails: "Read full details",
492
493
  showLess: "Show less"
493
494
  },
@@ -554,6 +555,8 @@ var enUsLabels = {
554
555
  trading: {
555
556
  settlementSection: "Settlement",
556
557
  settlementDifferencesTitle: "Key differences across venues",
558
+ settlementCriticalDifferenceLabel: "Critical",
559
+ settlementValueUnavailable: "Not provided",
557
560
  settlementLoading: "Loading settlement",
558
561
  settlementDetailsAria: (venueLabel) => `${venueLabel} settlement details`,
559
562
  settlementShowMoreAria: (ctaLabel, venueLabel) => `${ctaLabel} for ${venueLabel}`,
package/dist/withdraw.mjs CHANGED
@@ -3,12 +3,12 @@ import {
3
3
  useWithdrawFlow,
4
4
  useWithdrawPreview,
5
5
  useWithdrawalLifecycle
6
- } from "./chunk-TILXL4NI.mjs";
6
+ } from "./chunk-RMGSLCL3.mjs";
7
7
  import {
8
8
  useDepositAddresses,
9
9
  useManagedBalances,
10
10
  useWithdrawManaged
11
- } from "./chunk-R7C4J345.mjs";
11
+ } from "./chunk-STOMNDHO.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.1",
3
+ "version": "2.4.4",
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.1"
86
+ "@agg-build/sdk": "^2.3.0"
87
87
  },
88
88
  "peerDependenciesMeta": {
89
89
  "@solana/wallet-adapter-react": {