@agg-build/hooks 1.2.11 → 1.2.12
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.
- package/dist/{chunk-553OI6M2.mjs → chunk-2C7JR5OH.mjs} +106 -16
- package/dist/{chunk-JWPZNCGY.mjs → chunk-R6VANZRA.mjs} +1 -1
- package/dist/{chunk-CWEJLBYY.mjs → chunk-V34QGQBO.mjs} +1 -1
- package/dist/deposit.js +77 -1
- package/dist/deposit.mjs +2 -2
- package/dist/index.d.mts +137 -2
- package/dist/index.d.ts +137 -2
- package/dist/index.js +120 -23
- package/dist/index.mjs +19 -10
- package/dist/withdraw.js +77 -1
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _tanstack_react_query from '@tanstack/react-query';
|
|
|
2
2
|
import { QueryClient } from '@tanstack/react-query';
|
|
3
3
|
export { QueryClient, QueryClientProvider, useQueryClient } from '@tanstack/react-query';
|
|
4
4
|
import * as _agg_build_sdk from '@agg-build/sdk';
|
|
5
|
-
import { CandleBuilder, AggAuthStartBody, AggAuthStartResult, AggClientSessionInput, AggClient, RampQuote, RampQuoteRequest, RampWidgetSession, RampSessionRequest, QuoteManagedResponse, QuoteManagedParams, ExecuteManagedResponse, ExecuteManagedParams, GetPositionsParams, WsOrderSubmitted, WsBalanceUpdate, RedeemResponse, RedeemRequest, WsRedeemEvent, AggWebSocket, WsWithdrawalLifecycleEvent, WsCandleInterval, WsTrade, AggregatedOrderbookResponse, AggLinkAccountBody, AggLinkAccountResult, AggLinkAccountConfirmResult, UserActivityQuery, UserActivityItem, PaginatedResponse, CandleInterval, OrderbookState, OrderbookQuoteResponse, OrderListQuery, TradeExecutorOrder, SmartRouteSide, SmartRouteResponse, MidpointRow, BatchMidpointsResponse, AppClientConfigResponse } from '@agg-build/sdk';
|
|
5
|
+
import { CandleBuilder, AggAuthStartBody, AggAuthStartResult, AggClientSessionInput, AggClient, RampQuote, RampQuoteRequest, RampWidgetSession, RampSessionRequest, QuoteManagedResponse, QuoteManagedParams, ExecuteManagedResponse, ExecuteManagedParams, GetPositionsParams, WsOrderSubmitted, WsBalanceUpdate, RedeemResponse, RedeemRequest, WsRedeemEvent, AggWebSocket, WsOrderEvent, WsWithdrawalLifecycleEvent, WsCandleInterval, WsTrade, AggregatedOrderbookResponse, AggLinkAccountBody, AggLinkAccountResult, AggLinkAccountConfirmResult, UserActivityQuery, UserActivityItem, PaginatedResponse, CandleInterval, OrderbookState, OrderbookQuoteResponse, OrderListQuery, TradeExecutorOrder, SmartRouteSide, SmartRouteResponse, MidpointRow, BatchMidpointsResponse, AppClientConfigResponse } from '@agg-build/sdk';
|
|
6
6
|
export { TurnstileChallengeError } from '@agg-build/sdk';
|
|
7
7
|
import React, { ReactNode } from 'react';
|
|
8
8
|
export { UseManagedBalancesOptions, UseWithdrawEstimateParams, UseWithdrawFlowOptions, UseWithdrawFlowResult, UseWithdrawManagedOptions, UseWithdrawalLifecycleResult, WithdrawFeeEstimate, WithdrawalLifecycleState, useManagedBalances, useWithdrawEstimate, useWithdrawFlow, useWithdrawManaged, useWithdrawalLifecycle } from './withdraw.js';
|
|
@@ -730,6 +730,15 @@ interface AggUiLabels {
|
|
|
730
730
|
eventList: {
|
|
731
731
|
matchedTab: string;
|
|
732
732
|
allTab: string;
|
|
733
|
+
sortByLabel: string;
|
|
734
|
+
sortBy24hVolume: string;
|
|
735
|
+
sortByTopArbitrage: string;
|
|
736
|
+
sortByTotalVolume: string;
|
|
737
|
+
sortByEndingSoon: string;
|
|
738
|
+
subcategoriesLabel: string;
|
|
739
|
+
subcategoriesAll: string;
|
|
740
|
+
subcategoriesOpenAria: string;
|
|
741
|
+
subcategoriesCloseAria: string;
|
|
733
742
|
loading: (title: string) => string;
|
|
734
743
|
tabsAria: (title: string) => string;
|
|
735
744
|
emptyAria: string;
|
|
@@ -911,6 +920,60 @@ interface AggUiLabels {
|
|
|
911
920
|
noOrderbooks: string;
|
|
912
921
|
quoteUnavailable: string;
|
|
913
922
|
quoteBalanceMismatch: string;
|
|
923
|
+
serviceTemporarilyUnavailable: string;
|
|
924
|
+
orderDeadlineExpiredBeforeSubmission: string;
|
|
925
|
+
/**
|
|
926
|
+
* Venue rejected a SELL because the user's on-chain position is
|
|
927
|
+
* zero (VMP overstated, prior sell/redeem, transfer out, etc.).
|
|
928
|
+
* Default: "You don't currently hold any on-chain shares of this
|
|
929
|
+
* outcome. If you just sold or redeemed elsewhere, your position
|
|
930
|
+
* display will refresh shortly — try again after that."
|
|
931
|
+
*/
|
|
932
|
+
sellNoOnchainPosition: string;
|
|
933
|
+
/**
|
|
934
|
+
* Venue couldn't fill at the quoted price (Limitless simulation
|
|
935
|
+
* failed, Myriad walk produced no in-tolerance levels, Hyperliquid
|
|
936
|
+
* `could not immediately match`, etc.).
|
|
937
|
+
*/
|
|
938
|
+
venueQuoteUnfillable: string;
|
|
939
|
+
/**
|
|
940
|
+
* Bare-minimum venue order-size violation (Limitless 0.01-share
|
|
941
|
+
* floor, Polymarket post-fee dust, Hyperliquid min-notional).
|
|
942
|
+
*/
|
|
943
|
+
venueMinOrderSize: string;
|
|
944
|
+
/**
|
|
945
|
+
* Source-chain balance changed between quote and submit. Covers
|
|
946
|
+
* Limitless Base USDC, Polymarket pUSD, Solana SPL InsufficientFunds,
|
|
947
|
+
* BNB BEP20 transfer-exceeds-balance.
|
|
948
|
+
*/
|
|
949
|
+
sourceBalanceChanged: string;
|
|
950
|
+
/**
|
|
951
|
+
* Venue market resolved / closed between quote and submit.
|
|
952
|
+
*/
|
|
953
|
+
venueMarketResolved: string;
|
|
954
|
+
/**
|
|
955
|
+
* dFlow wallet KYC required (verify at dflow.net/proof).
|
|
956
|
+
*/
|
|
957
|
+
dflowWalletUnverified: string;
|
|
958
|
+
/**
|
|
959
|
+
* No active quote path on the matcher right now (dFlow
|
|
960
|
+
* route_not_found, etc.).
|
|
961
|
+
*/
|
|
962
|
+
venueNoQuotePath: string;
|
|
963
|
+
/**
|
|
964
|
+
* Solana blockhash expired before the tx landed — re-quote needed.
|
|
965
|
+
*/
|
|
966
|
+
solanaBlockhashExpired: string;
|
|
967
|
+
/**
|
|
968
|
+
* Venue / aggregator API is rate-limited; retry shortly.
|
|
969
|
+
*/
|
|
970
|
+
venueRateLimited: string;
|
|
971
|
+
/**
|
|
972
|
+
* Service-side bug surfaced at admission time (DagValidationError,
|
|
973
|
+
* Duplicate step ID, etc.). Retrying the same quote will hit the
|
|
974
|
+
* same bug; user should contact support.
|
|
975
|
+
*/
|
|
976
|
+
serviceBlockedOrder: string;
|
|
914
977
|
selectedVenueUnavailable: string;
|
|
915
978
|
engineUnavailable: string;
|
|
916
979
|
insufficientInputAmount: string;
|
|
@@ -924,6 +987,7 @@ interface AggUiLabels {
|
|
|
924
987
|
deposit: string;
|
|
925
988
|
kycRequired: string;
|
|
926
989
|
kycNotVerifiedTooltip: string;
|
|
990
|
+
kycVerify: string;
|
|
927
991
|
kycVerifyModalTitle: string;
|
|
928
992
|
kycVerifyModalDescription: string;
|
|
929
993
|
kycStartVerification: string;
|
|
@@ -937,6 +1001,7 @@ interface AggUiLabels {
|
|
|
937
1001
|
splitOrderDescription: string;
|
|
938
1002
|
viewAllRoutes: (count: number) => string;
|
|
939
1003
|
venueUnavailableInRegion: string;
|
|
1004
|
+
verified: string;
|
|
940
1005
|
platformFee: string;
|
|
941
1006
|
estimatedFees: string;
|
|
942
1007
|
estimatedFeesTooltipAria: string;
|
|
@@ -1115,6 +1180,58 @@ interface AggUiLabels {
|
|
|
1115
1180
|
bannerAria: string;
|
|
1116
1181
|
logoAria: string;
|
|
1117
1182
|
};
|
|
1183
|
+
/**
|
|
1184
|
+
* Copy for the global notification bridge (`AggNotificationEventsProvider`).
|
|
1185
|
+
* Each leaf is read from a websocket / activity-feed lifecycle event and
|
|
1186
|
+
* rendered into the existing toast primitive. Keep these terse — the toast
|
|
1187
|
+
* footprint is small and detail lines wrap awkwardly past two lines.
|
|
1188
|
+
*/
|
|
1189
|
+
notifications: {
|
|
1190
|
+
order: {
|
|
1191
|
+
filledTitle: string;
|
|
1192
|
+
filledMessage: (params: {
|
|
1193
|
+
venueLabel?: string;
|
|
1194
|
+
sideLabel?: string;
|
|
1195
|
+
amountLabel?: string;
|
|
1196
|
+
priceLabel?: string;
|
|
1197
|
+
}) => string;
|
|
1198
|
+
partialFilledTitle: string;
|
|
1199
|
+
partialFilledMessage: (params: {
|
|
1200
|
+
venueLabel?: string;
|
|
1201
|
+
sideLabel?: string;
|
|
1202
|
+
amountLabel?: string;
|
|
1203
|
+
priceLabel?: string;
|
|
1204
|
+
}) => string;
|
|
1205
|
+
failedTitle: string;
|
|
1206
|
+
failedMessage: (errorReason?: string) => string;
|
|
1207
|
+
};
|
|
1208
|
+
deposit: {
|
|
1209
|
+
completedTitle: string;
|
|
1210
|
+
completedMessage: (params: {
|
|
1211
|
+
amountLabel?: string;
|
|
1212
|
+
tokenLabel?: string;
|
|
1213
|
+
}) => string;
|
|
1214
|
+
failedTitle: string;
|
|
1215
|
+
failedMessage: (params: {
|
|
1216
|
+
amountLabel?: string;
|
|
1217
|
+
tokenLabel?: string;
|
|
1218
|
+
}) => string;
|
|
1219
|
+
};
|
|
1220
|
+
withdrawal: {
|
|
1221
|
+
completedTitle: string;
|
|
1222
|
+
completedMessage: (params: {
|
|
1223
|
+
amountLabel?: string;
|
|
1224
|
+
tokenLabel?: string;
|
|
1225
|
+
}) => string;
|
|
1226
|
+
partialTitle: string;
|
|
1227
|
+
partialMessage: (params: {
|
|
1228
|
+
amountLabel?: string;
|
|
1229
|
+
tokenLabel?: string;
|
|
1230
|
+
}) => string;
|
|
1231
|
+
failedTitle: string;
|
|
1232
|
+
failedMessage: (errorReason?: string) => string;
|
|
1233
|
+
};
|
|
1234
|
+
};
|
|
1118
1235
|
}
|
|
1119
1236
|
type DeepPartial<TValue> = {
|
|
1120
1237
|
[TKey in keyof TValue]?: TValue[TKey] extends (...args: infer TArgs) => infer TReturn ? (...args: TArgs) => TReturn : TValue[TKey] extends object ? DeepPartial<TValue[TKey]> : TValue[TKey];
|
|
@@ -1147,6 +1264,15 @@ interface AggUiFeatureFlagsConfig {
|
|
|
1147
1264
|
showFeesBreakdown: boolean;
|
|
1148
1265
|
/** Enable gradients */
|
|
1149
1266
|
enableGradients: boolean;
|
|
1267
|
+
/** Enable venue-events discovery filters UI and query wiring. */
|
|
1268
|
+
enableVenueEventDiscoveryFilters: boolean;
|
|
1269
|
+
/**
|
|
1270
|
+
* Enable the global notification bridge that emits toasts for order /
|
|
1271
|
+
* deposit / withdrawal lifecycle events. Defaults to `true`. Set to
|
|
1272
|
+
* `false` to suppress those toasts (the toast surface itself stays mounted
|
|
1273
|
+
* for ad-hoc partner-fired toasts).
|
|
1274
|
+
*/
|
|
1275
|
+
enableNotifications: boolean;
|
|
1150
1276
|
}
|
|
1151
1277
|
type AggUiFeatureFlagsConfigInput = Partial<AggUiFeatureFlagsConfig>;
|
|
1152
1278
|
interface AggUiMarketConfig {
|
|
@@ -1387,6 +1513,8 @@ declare const DEFAULT_AGG_ROOT_CLASS_NAME = "agg-root";
|
|
|
1387
1513
|
declare const CHART_TIME_RANGES: ChartTimeRange[];
|
|
1388
1514
|
|
|
1389
1515
|
declare const useAggClient: () => AggClient;
|
|
1516
|
+
/** Like {@link useAggClient}, but returns `null` when no `<AggProvider>` is mounted. */
|
|
1517
|
+
declare const useOptionalAggClient: () => AggClient | null;
|
|
1390
1518
|
declare const useAggUiConfig: () => AggUiConfig;
|
|
1391
1519
|
declare const useAggLabels: () => AggUiLabels;
|
|
1392
1520
|
declare const useAggAuthContext: () => AggAuthContextValue;
|
|
@@ -1950,6 +2078,7 @@ declare function useRedeemLifecycle(input: UseRedeemLifecycleInput | null): Rede
|
|
|
1950
2078
|
declare function useAggWebSocket(): AggWebSocket | null;
|
|
1951
2079
|
declare function useOnOrderSubmitted(callback: ((msg: WsOrderSubmitted) => void) | null): void;
|
|
1952
2080
|
declare function useOnBalanceUpdate(callback: ((msg: WsBalanceUpdate) => void) | null): void;
|
|
2081
|
+
declare function useOnOrderEvent(callback: ((msg: WsOrderEvent) => void) | null): void;
|
|
1953
2082
|
declare function useOnWithdrawalLifecycle(callback: ((msg: WsWithdrawalLifecycleEvent) => void) | null): void;
|
|
1954
2083
|
|
|
1955
2084
|
interface MarketChartCandle {
|
|
@@ -2061,6 +2190,10 @@ declare const AUTH_CHOOSER_OPEN_EVENT = "agg-auth:open-chooser";
|
|
|
2061
2190
|
declare const requestAggAuthChooserOpen: () => void;
|
|
2062
2191
|
|
|
2063
2192
|
interface UseCategoriesOptions {
|
|
2193
|
+
/** Optional query-key scope to isolate caches across different surfaces. */
|
|
2194
|
+
queryKeyScope?: string;
|
|
2195
|
+
/** Fetch child categories for a parent category id. Omit for top-level categories. */
|
|
2196
|
+
parentId?: string | null;
|
|
2064
2197
|
enabled?: boolean;
|
|
2065
2198
|
/** Page size when using cursor pagination. Default 20. */
|
|
2066
2199
|
limit?: number;
|
|
@@ -4408,6 +4541,8 @@ interface UseVenueEventsOptions {
|
|
|
4408
4541
|
sortBy?: string;
|
|
4409
4542
|
/** Sort direction: "asc" or "desc". */
|
|
4410
4543
|
sortDir?: string;
|
|
4544
|
+
/** Recurrence filter (for venue events that support recurrence dimensions). */
|
|
4545
|
+
recurrence?: string;
|
|
4411
4546
|
/** If provided, enable the query. */
|
|
4412
4547
|
enabled?: boolean;
|
|
4413
4548
|
/** Page size when using cursor pagination. Default 20. */
|
|
@@ -5189,4 +5324,4 @@ interface UseAppConfigResult {
|
|
|
5189
5324
|
*/
|
|
5190
5325
|
declare function useAppConfig(): UseAppConfigResult;
|
|
5191
5326
|
|
|
5192
|
-
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, CHART_TIME_RANGES, CONFIRMED_MATCH_STATUSES, type ChartTimeRange, type ClosedPositionTotals, type ComputePriceGapsInput, 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 LiveBestPrices, type LiveCandle, 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 PriceGapMarket, type RedeemEvent, type RedeemLegLifecycle, type RedeemLifecycleState, RedeemRejectedError, type RollingChartWindow, type ScaledCandlePoint, type SdkUiConfig, type SdkUiConfigInput, type SdkUiProviderProps, type ThemeMode, TradeSide, type TradingAction, type TradingState, type TradingStateBase, type TradingStateKind, type UseAggAuthOptions, type UseAggAuthReturn, type UseAppConfigResult, type UseCategoriesOptions, 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 UseMarketChartOptions, type UseMarketChartResult, type UseMarketOrderbookOptions, type UseMarketOrderbookResult, type UseMarketOrderbookVenueOutcome, type UseMarketSearchOptions, 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 UseTradableVenuesResult, type UseUserActivityOptions, type UseUserHoldingsOptions, type UseVenueEventOptions, type UseVenueEventsOptions, type UseVenueMarketMidpointsOptions, type UseVenueMarketsOptions, type UseVisibleIdsOptions, type UseVisibleIdsResult, type UserActivityInvalidationStrategy, Venue, type VenueEvent, type VenueEventWithMarkets, type VenueMarket, type VenueMarketOutcome, type WalletActionSendTokenParams, type WalletActions, computeClosedPositionTotals, computePriceGaps, defaultAggUiConfig, defaultAggUiConfig as defaultSdkUiConfig, executionKeys, findLivePriceById, getBuilder, getOrCreateBuilder, getWalletAddressFromUserProfile, invalidateBalanceQueries, invalidatePositionQueries, invalidateUserActivityQueries, invalidateUserMoneyState, mergeBestPricesPreferringLive, 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, useCategories, useDebouncedValue, useEnrichedVenueEvent, useEventListState, useEventOrderbookData, useEventTradingContext, useExecuteManaged, useExecutionOrders, useExecutionPositions, useExecutionProgress, useExternalId, useGeoBlock, useLabels, useLinkAccount, useLiveBestPrices, useLiveCandleOverlay, useLiveCandles, useLiveMarket, useLiveMarketStores, useLiveOutcomePrices, useLiveTrades, useMarketChart, useMarketOrderbook, useMarketSearch, useMidpoints, useOnBalanceUpdate, useOnOrderSubmitted, useOnRedeemEvent, useOnWithdrawalLifecycle, useOrderBook, useOrderbookQuote, useOrders, usePositions, useQuoteManaged, useRampQuotes, useRampSession, useRedeem, useRedeemEligibleCount, useRedeemLifecycle, useRedeemLifecycles, useRollingChartWindow, useSdkLabels, useSdkUiConfig, useSearch, useSmartRoute, useTradableVenues, useUserActivity, useUserHoldings, useVenueEvent, useVenueEvents, useVenueMarketMidpoints, useVenueMarkets, useViewportMidpoints, useVisibleIds, userActivityQueryKeys };
|
|
5327
|
+
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, CHART_TIME_RANGES, CONFIRMED_MATCH_STATUSES, type ChartTimeRange, type ClosedPositionTotals, type ComputePriceGapsInput, 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 LiveBestPrices, type LiveCandle, 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 PriceGapMarket, type RedeemEvent, type RedeemLegLifecycle, type RedeemLifecycleState, RedeemRejectedError, type RollingChartWindow, type ScaledCandlePoint, type SdkUiConfig, type SdkUiConfigInput, type SdkUiProviderProps, type ThemeMode, TradeSide, type TradingAction, type TradingState, type TradingStateBase, type TradingStateKind, type UseAggAuthOptions, type UseAggAuthReturn, type UseAppConfigResult, type UseCategoriesOptions, 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 UseMarketChartOptions, type UseMarketChartResult, type UseMarketOrderbookOptions, type UseMarketOrderbookResult, type UseMarketOrderbookVenueOutcome, type UseMarketSearchOptions, 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 UseTradableVenuesResult, type UseUserActivityOptions, type UseUserHoldingsOptions, type UseVenueEventOptions, type UseVenueEventsOptions, type UseVenueMarketMidpointsOptions, type UseVenueMarketsOptions, type UseVisibleIdsOptions, type UseVisibleIdsResult, type UserActivityInvalidationStrategy, Venue, type VenueEvent, type VenueEventWithMarkets, type VenueMarket, type VenueMarketOutcome, type WalletActionSendTokenParams, type WalletActions, computeClosedPositionTotals, computePriceGaps, defaultAggUiConfig, defaultAggUiConfig as defaultSdkUiConfig, executionKeys, findLivePriceById, getBuilder, getOrCreateBuilder, getWalletAddressFromUserProfile, invalidateBalanceQueries, invalidatePositionQueries, invalidateUserActivityQueries, invalidateUserMoneyState, mergeBestPricesPreferringLive, 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, useCategories, useDebouncedValue, useEnrichedVenueEvent, useEventListState, useEventOrderbookData, useEventTradingContext, useExecuteManaged, useExecutionOrders, useExecutionPositions, useExecutionProgress, useExternalId, useGeoBlock, useLabels, useLinkAccount, useLiveBestPrices, useLiveCandleOverlay, useLiveCandles, useLiveMarket, useLiveMarketStores, useLiveOutcomePrices, useLiveTrades, 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, useTradableVenues, useUserActivity, useUserHoldings, useVenueEvent, useVenueEvents, useVenueMarketMidpoints, useVenueMarkets, useViewportMidpoints, useVisibleIds, userActivityQueryKeys };
|
package/dist/index.js
CHANGED
|
@@ -158,9 +158,11 @@ __export(src_exports, {
|
|
|
158
158
|
useMarketSearch: () => useMarketSearch,
|
|
159
159
|
useMidpoints: () => useMidpoints,
|
|
160
160
|
useOnBalanceUpdate: () => useOnBalanceUpdate,
|
|
161
|
+
useOnOrderEvent: () => useOnOrderEvent,
|
|
161
162
|
useOnOrderSubmitted: () => useOnOrderSubmitted,
|
|
162
163
|
useOnRedeemEvent: () => useOnRedeemEvent2,
|
|
163
164
|
useOnWithdrawalLifecycle: () => useOnWithdrawalLifecycle,
|
|
165
|
+
useOptionalAggClient: () => useOptionalAggClient,
|
|
164
166
|
useOrderBook: () => useOrderBook,
|
|
165
167
|
useOrderbookQuote: () => useOrderbookQuote,
|
|
166
168
|
useOrders: () => useOrders,
|
|
@@ -830,6 +832,15 @@ var enUsLabels = {
|
|
|
830
832
|
eventList: {
|
|
831
833
|
matchedTab: "Matched",
|
|
832
834
|
allTab: "All",
|
|
835
|
+
sortByLabel: "Sort by",
|
|
836
|
+
sortBy24hVolume: "24h volume",
|
|
837
|
+
sortByTopArbitrage: "Top arbitrage",
|
|
838
|
+
sortByTotalVolume: "Total volume",
|
|
839
|
+
sortByEndingSoon: "Ending soon",
|
|
840
|
+
subcategoriesLabel: "Subcategories",
|
|
841
|
+
subcategoriesAll: "All",
|
|
842
|
+
subcategoriesOpenAria: "Open subcategories",
|
|
843
|
+
subcategoriesCloseAria: "Close subcategories",
|
|
833
844
|
loading: (title) => `Loading ${title}`,
|
|
834
845
|
tabsAria: (title) => `${title} tabs`,
|
|
835
846
|
emptyAria: "No events found",
|
|
@@ -1017,6 +1028,18 @@ var enUsLabels = {
|
|
|
1017
1028
|
noOrderbooks: "No live orderbooks are available for this market right now.",
|
|
1018
1029
|
quoteUnavailable: "Quote temporarily unavailable. Please try again.",
|
|
1019
1030
|
quoteBalanceMismatch: "Quote balance mismatch. Try a different amount.",
|
|
1031
|
+
serviceTemporarilyUnavailable: "Service temporarily unavailable. Please try again in a moment.",
|
|
1032
|
+
orderDeadlineExpiredBeforeSubmission: "Order deadline expired before submission. Please try again.",
|
|
1033
|
+
sellNoOnchainPosition: "You don't currently hold any on-chain shares of this outcome. If you just sold or redeemed elsewhere, your position display will refresh shortly \u2014 try again after that.",
|
|
1034
|
+
venueQuoteUnfillable: "The venue couldn't fill this order at the quoted price right now. Try a smaller size, a higher slippage tolerance, or wait a moment and re-quote.",
|
|
1035
|
+
venueMinOrderSize: "Order size is below the venue minimum. Try a larger amount.",
|
|
1036
|
+
sourceBalanceChanged: "Your balance changed since the quote. Refresh and try again, or pick a smaller amount.",
|
|
1037
|
+
venueMarketResolved: "This market just resolved. Pick a different market or wait for the next round.",
|
|
1038
|
+
dflowWalletUnverified: "Your Solana wallet needs to be verified with dFlow before you can trade Kalshi markets. Verify at https://dflow.net/proof, then try again.",
|
|
1039
|
+
venueNoQuotePath: "No active quote path for this market right now. Try a different size, or wait a moment and re-quote.",
|
|
1040
|
+
solanaBlockhashExpired: "Solana transaction expired before submission. Please re-quote and try again.",
|
|
1041
|
+
venueRateLimited: "The venue is rate-limiting requests right now. Please wait a moment and try again.",
|
|
1042
|
+
serviceBlockedOrder: "Something on our side blocked this order. Please contact support if it keeps happening \u2014 retrying with the same quote will hit the same issue.",
|
|
1020
1043
|
selectedVenueUnavailable: "The venue you selected is no longer available on this route. Review the updated options and try again.",
|
|
1021
1044
|
engineUnavailable: "The routing engine is temporarily unavailable. Please try again in a moment.",
|
|
1022
1045
|
insufficientInputAmount: "Trade amount is too small to cover bridging and execution costs. Increase your spend or deposit funds on the destination chain.",
|
|
@@ -1030,6 +1053,7 @@ var enUsLabels = {
|
|
|
1030
1053
|
deposit: "Deposit",
|
|
1031
1054
|
kycRequired: "Verify to trade Kalshi",
|
|
1032
1055
|
kycNotVerifiedTooltip: "You have not been verified yet",
|
|
1056
|
+
kycVerify: "Verify Identity",
|
|
1033
1057
|
kycVerifyModalTitle: "Verify Your Identity",
|
|
1034
1058
|
kycVerifyModalDescription: "To start trading on Kalshi, you'll need to complete identity verification through dFlow. It only takes a few minutes and helps us stay compliant with regulations.",
|
|
1035
1059
|
kycStartVerification: "Start Verification",
|
|
@@ -1043,6 +1067,7 @@ var enUsLabels = {
|
|
|
1043
1067
|
splitOrderDescription: "We split your order for the best price:",
|
|
1044
1068
|
viewAllRoutes: (count) => `View all (${count})`,
|
|
1045
1069
|
venueUnavailableInRegion: "Unavailable in your region",
|
|
1070
|
+
verified: "Verified",
|
|
1046
1071
|
platformFee: "0% platform fees",
|
|
1047
1072
|
estimatedFees: "Estimated fees",
|
|
1048
1073
|
estimatedFeesTooltipAria: "Estimated fees breakdown",
|
|
@@ -1234,6 +1259,57 @@ var enUsLabels = {
|
|
|
1234
1259
|
header: {
|
|
1235
1260
|
bannerAria: "Site header",
|
|
1236
1261
|
logoAria: "Home"
|
|
1262
|
+
},
|
|
1263
|
+
notifications: {
|
|
1264
|
+
order: {
|
|
1265
|
+
filledTitle: "Order filled",
|
|
1266
|
+
filledMessage: ({ venueLabel, sideLabel, amountLabel, priceLabel }) => {
|
|
1267
|
+
const action = sideLabel ? `${sideLabel} filled` : "Filled";
|
|
1268
|
+
const amount = amountLabel ? ` ${amountLabel}` : "";
|
|
1269
|
+
const price = priceLabel ? ` at ${priceLabel}` : "";
|
|
1270
|
+
const venue = venueLabel ? ` on ${venueLabel}` : "";
|
|
1271
|
+
return `${action}${amount}${price}${venue}`.trim();
|
|
1272
|
+
},
|
|
1273
|
+
partialFilledTitle: "Order partially filled",
|
|
1274
|
+
partialFilledMessage: ({ venueLabel, sideLabel, amountLabel, priceLabel }) => {
|
|
1275
|
+
const action = sideLabel ? `${sideLabel} partially filled` : "Partially filled";
|
|
1276
|
+
const amount = amountLabel ? ` ${amountLabel}` : "";
|
|
1277
|
+
const price = priceLabel ? ` at ${priceLabel}` : "";
|
|
1278
|
+
const venue = venueLabel ? ` on ${venueLabel}` : "";
|
|
1279
|
+
return `${action}${amount}${price}${venue}`.trim();
|
|
1280
|
+
},
|
|
1281
|
+
failedTitle: "Order failed",
|
|
1282
|
+
failedMessage: (errorReason) => errorReason && errorReason.length > 0 ? errorReason : "Your order could not be completed. Please try again."
|
|
1283
|
+
},
|
|
1284
|
+
deposit: {
|
|
1285
|
+
completedTitle: "Deposit complete",
|
|
1286
|
+
completedMessage: ({ amountLabel, tokenLabel }) => {
|
|
1287
|
+
if (amountLabel && tokenLabel) return `${amountLabel} ${tokenLabel} added to your balance.`;
|
|
1288
|
+
if (tokenLabel) return `Your ${tokenLabel} has been added to your balance.`;
|
|
1289
|
+
return "Your funds have been added to your balance.";
|
|
1290
|
+
},
|
|
1291
|
+
failedTitle: "Deposit failed",
|
|
1292
|
+
failedMessage: ({ amountLabel, tokenLabel }) => {
|
|
1293
|
+
const what = amountLabel && tokenLabel ? `${amountLabel} ${tokenLabel}` : "deposit";
|
|
1294
|
+
return `We couldn't complete your ${what}.`;
|
|
1295
|
+
}
|
|
1296
|
+
},
|
|
1297
|
+
withdrawal: {
|
|
1298
|
+
completedTitle: "Withdrawal complete",
|
|
1299
|
+
completedMessage: ({ amountLabel, tokenLabel }) => {
|
|
1300
|
+
if (amountLabel && tokenLabel) return `${amountLabel} ${tokenLabel} sent to your wallet.`;
|
|
1301
|
+
if (tokenLabel) return `Your ${tokenLabel} has been sent to your wallet.`;
|
|
1302
|
+
return "Your withdrawal has been sent to your wallet.";
|
|
1303
|
+
},
|
|
1304
|
+
partialTitle: "Withdrawal partially completed",
|
|
1305
|
+
partialMessage: ({ amountLabel, tokenLabel }) => {
|
|
1306
|
+
if (amountLabel && tokenLabel)
|
|
1307
|
+
return `Part of your ${tokenLabel} was sent. The remainder was returned to your balance.`;
|
|
1308
|
+
return "Part of your withdrawal was sent. The remainder was returned to your balance.";
|
|
1309
|
+
},
|
|
1310
|
+
failedTitle: "Withdrawal failed",
|
|
1311
|
+
failedMessage: (errorReason) => errorReason && errorReason.length > 0 ? errorReason : "Your funds have been returned to your balance."
|
|
1312
|
+
}
|
|
1237
1313
|
}
|
|
1238
1314
|
};
|
|
1239
1315
|
var defaultAggUiLabelsByLocale = {
|
|
@@ -1324,7 +1400,9 @@ var defaultAggUiConfig = {
|
|
|
1324
1400
|
enableAnimations: true,
|
|
1325
1401
|
enableLiveUpdates: true,
|
|
1326
1402
|
showFeesBreakdown: false,
|
|
1327
|
-
enableGradients: false
|
|
1403
|
+
enableGradients: false,
|
|
1404
|
+
enableVenueEventDiscoveryFilters: false,
|
|
1405
|
+
enableNotifications: true
|
|
1328
1406
|
},
|
|
1329
1407
|
market: {
|
|
1330
1408
|
arbitrageThreshold: 0
|
|
@@ -1351,7 +1429,7 @@ var mergeAggUiSearchConfig = (config) => {
|
|
|
1351
1429
|
};
|
|
1352
1430
|
};
|
|
1353
1431
|
var mergeAggUiConfig = (persisted, config) => {
|
|
1354
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N;
|
|
1432
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R;
|
|
1355
1433
|
const locale = (_d = (_c = (_a = config == null ? void 0 : config.general) == null ? void 0 : _a.locale) != null ? _c : (_b = persisted.general) == null ? void 0 : _b.locale) != null ? _d : DEFAULT_LOCALE;
|
|
1356
1434
|
const theme = (_h = (_g = (_e = config == null ? void 0 : config.general) == null ? void 0 : _e.theme) != null ? _g : (_f = persisted.general) == null ? void 0 : _f.theme) != null ? _h : defaultAggUiConfig.general.theme;
|
|
1357
1435
|
const formatters = createFormatters(locale);
|
|
@@ -1370,22 +1448,24 @@ var mergeAggUiConfig = (persisted, config) => {
|
|
|
1370
1448
|
enableAnimations: (_p = (_o = config == null ? void 0 : config.features) == null ? void 0 : _o.enableAnimations) != null ? _p : defaultAggUiConfig.features.enableAnimations,
|
|
1371
1449
|
enableLiveUpdates: (_r = (_q = config == null ? void 0 : config.features) == null ? void 0 : _q.enableLiveUpdates) != null ? _r : defaultAggUiConfig.features.enableLiveUpdates,
|
|
1372
1450
|
showFeesBreakdown: (_t = (_s = config == null ? void 0 : config.features) == null ? void 0 : _s.showFeesBreakdown) != null ? _t : defaultAggUiConfig.features.showFeesBreakdown,
|
|
1373
|
-
enableGradients: (_v = (_u = config == null ? void 0 : config.features) == null ? void 0 : _u.enableGradients) != null ? _v : defaultAggUiConfig.features.enableGradients
|
|
1451
|
+
enableGradients: (_v = (_u = config == null ? void 0 : config.features) == null ? void 0 : _u.enableGradients) != null ? _v : defaultAggUiConfig.features.enableGradients,
|
|
1452
|
+
enableVenueEventDiscoveryFilters: (_x = (_w = config == null ? void 0 : config.features) == null ? void 0 : _w.enableVenueEventDiscoveryFilters) != null ? _x : defaultAggUiConfig.features.enableVenueEventDiscoveryFilters,
|
|
1453
|
+
enableNotifications: (_z = (_y = config == null ? void 0 : config.features) == null ? void 0 : _y.enableNotifications) != null ? _z : defaultAggUiConfig.features.enableNotifications
|
|
1374
1454
|
},
|
|
1375
1455
|
market: {
|
|
1376
|
-
arbitrageThreshold: (
|
|
1456
|
+
arbitrageThreshold: (_B = (_A = config == null ? void 0 : config.market) == null ? void 0 : _A.arbitrageThreshold) != null ? _B : defaultAggUiConfig.market.arbitrageThreshold
|
|
1377
1457
|
},
|
|
1378
1458
|
chart: {
|
|
1379
|
-
defaultChartTimeRange: (
|
|
1380
|
-
selectedChartTimeRange: (
|
|
1459
|
+
defaultChartTimeRange: (_D = (_C = config == null ? void 0 : config.chart) == null ? void 0 : _C.defaultChartTimeRange) != null ? _D : defaultAggUiConfig.chart.defaultChartTimeRange,
|
|
1460
|
+
selectedChartTimeRange: (_H = (_G = (_E = persisted.chart) == null ? void 0 : _E.selectedChartTimeRange) != null ? _G : (_F = config == null ? void 0 : config.chart) == null ? void 0 : _F.defaultChartTimeRange) != null ? _H : defaultAggUiConfig.chart.defaultChartTimeRange,
|
|
1381
1461
|
setSelectedChartTimeRange: defaultAggUiConfig.chart.setSelectedChartTimeRange
|
|
1382
1462
|
},
|
|
1383
1463
|
formatting: {
|
|
1384
|
-
formatNumber: (
|
|
1385
|
-
formatPercent: (
|
|
1386
|
-
formatCurrency: (
|
|
1387
|
-
formatCompactCurrency: (
|
|
1388
|
-
formatDate: (
|
|
1464
|
+
formatNumber: (_J = (_I = config == null ? void 0 : config.formatting) == null ? void 0 : _I.formatNumber) != null ? _J : formatters.formatNumber,
|
|
1465
|
+
formatPercent: (_L = (_K = config == null ? void 0 : config.formatting) == null ? void 0 : _K.formatPercent) != null ? _L : formatters.formatPercent,
|
|
1466
|
+
formatCurrency: (_N = (_M = config == null ? void 0 : config.formatting) == null ? void 0 : _M.formatCurrency) != null ? _N : formatters.formatCurrency,
|
|
1467
|
+
formatCompactCurrency: (_P = (_O = config == null ? void 0 : config.formatting) == null ? void 0 : _O.formatCompactCurrency) != null ? _P : formatters.formatCompactCurrency,
|
|
1468
|
+
formatDate: (_R = (_Q = config == null ? void 0 : config.formatting) == null ? void 0 : _Q.formatDate) != null ? _R : formatters.formatDate
|
|
1389
1469
|
},
|
|
1390
1470
|
search: mergeAggUiSearchConfig(config == null ? void 0 : config.search),
|
|
1391
1471
|
walletActions: config == null ? void 0 : config.walletActions,
|
|
@@ -2372,6 +2452,9 @@ var useAggClient = () => {
|
|
|
2372
2452
|
}
|
|
2373
2453
|
return client;
|
|
2374
2454
|
};
|
|
2455
|
+
var useOptionalAggClient = () => {
|
|
2456
|
+
return (0, import_react5.useContext)(AggClientContext);
|
|
2457
|
+
};
|
|
2375
2458
|
var useAggUiConfig = () => {
|
|
2376
2459
|
return (0, import_react5.useContext)(AggUiContext);
|
|
2377
2460
|
};
|
|
@@ -3695,12 +3778,18 @@ function useSyncBalances(options) {
|
|
|
3695
3778
|
|
|
3696
3779
|
// src/execution/use-execution-progress.ts
|
|
3697
3780
|
var import_react10 = require("react");
|
|
3698
|
-
var TERMINAL_ORDER_STATUSES = /* @__PURE__ */ new Set([
|
|
3781
|
+
var TERMINAL_ORDER_STATUSES = /* @__PURE__ */ new Set([
|
|
3782
|
+
"filled",
|
|
3783
|
+
"partial_fill",
|
|
3784
|
+
"failed",
|
|
3785
|
+
"cancelled",
|
|
3786
|
+
"expired"
|
|
3787
|
+
]);
|
|
3699
3788
|
var ORDER_POLL_INTERVAL_MS = 5e3;
|
|
3700
3789
|
function mapOrderStatusToTerminalEvent(status) {
|
|
3701
3790
|
if (status === "filled") return "filled";
|
|
3702
3791
|
if (status === "partial_fill") return "partial_fill";
|
|
3703
|
-
if (status === "failed" || status === "cancelled") return "failed";
|
|
3792
|
+
if (status === "failed" || status === "cancelled" || status === "expired") return "failed";
|
|
3704
3793
|
return null;
|
|
3705
3794
|
}
|
|
3706
3795
|
function useExecutionProgress({
|
|
@@ -3756,12 +3845,13 @@ function useExecutionProgress({
|
|
|
3756
3845
|
submittedOrderVenueByIdRef.current.set(msg.orderId, trimmedVenue);
|
|
3757
3846
|
}
|
|
3758
3847
|
const { event } = msg;
|
|
3759
|
-
if (event === "filled" || event === "partial_fill" || event === "failed" || event === "bridge_ws_subscribe_failed") {
|
|
3760
|
-
const mappedEvent = event === "
|
|
3848
|
+
if (event === "filled" || event === "partial_fill" || event === "failed" || event === "bridge_ws_subscribe_failed" || event === "expired" || event === "dag_cancelled") {
|
|
3849
|
+
const mappedEvent = event === "filled" || event === "partial_fill" ? event : "failed";
|
|
3761
3850
|
const resolvedVenue = trimmedVenue || submittedOrderVenueByIdRef.current.get(msg.orderId) || "";
|
|
3762
3851
|
if (resolvedVenue) {
|
|
3763
3852
|
submittedOrderVenueByIdRef.current.set(msg.orderId, resolvedVenue);
|
|
3764
3853
|
}
|
|
3854
|
+
const fallbackErrorReason = event === "bridge_ws_subscribe_failed" ? "Bridge event subscription failed." : event === "expired" ? "Order expired before it could be submitted." : event === "dag_cancelled" ? "Order was cancelled before submission." : void 0;
|
|
3765
3855
|
const nextTerminalEvent = {
|
|
3766
3856
|
orderId: msg.orderId,
|
|
3767
3857
|
venue: resolvedVenue,
|
|
@@ -3774,7 +3864,7 @@ function useExecutionProgress({
|
|
|
3774
3864
|
quotedToWinRaw: msg.quotedToWinRaw,
|
|
3775
3865
|
executionPriceRaw: msg.executionPriceRaw,
|
|
3776
3866
|
quotedPriceRaw: msg.quotedPriceRaw,
|
|
3777
|
-
errorReason:
|
|
3867
|
+
errorReason: (_a = msg.errorReason) != null ? _a : fallbackErrorReason,
|
|
3778
3868
|
timestamp: msg.timestamp
|
|
3779
3869
|
};
|
|
3780
3870
|
setTerminalOrderEvents((prev) => {
|
|
@@ -4743,17 +4833,19 @@ var requestAggAuthChooserOpen = () => {
|
|
|
4743
4833
|
// src/use-categories.ts
|
|
4744
4834
|
var import_react_query16 = require("@tanstack/react-query");
|
|
4745
4835
|
function useCategories(options) {
|
|
4746
|
-
var _a, _b, _c, _d;
|
|
4836
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4747
4837
|
const client = useAggClient();
|
|
4748
|
-
const
|
|
4749
|
-
const
|
|
4838
|
+
const queryKeyScope = (_a = options == null ? void 0 : options.queryKeyScope) != null ? _a : "categories";
|
|
4839
|
+
const parentId = (_b = options == null ? void 0 : options.parentId) != null ? _b : null;
|
|
4840
|
+
const enabled = (_c = options == null ? void 0 : options.enabled) != null ? _c : true;
|
|
4841
|
+
const limit = (_d = options == null ? void 0 : options.limit) != null ? _d : 20;
|
|
4750
4842
|
const query = (0, import_react_query16.useInfiniteQuery)({
|
|
4751
|
-
queryKey: ["
|
|
4843
|
+
queryKey: [queryKeyScope, "parent", parentId != null ? parentId : "__root__", limit],
|
|
4752
4844
|
queryFn: (_0) => __async(null, [_0], function* ({ pageParam }) {
|
|
4753
|
-
const res = yield client.getCategories({
|
|
4845
|
+
const res = yield client.getCategories(__spreadValues({
|
|
4754
4846
|
limit,
|
|
4755
4847
|
cursor: pageParam
|
|
4756
|
-
});
|
|
4848
|
+
}, parentId != null ? { parentId } : {}));
|
|
4757
4849
|
return res;
|
|
4758
4850
|
}),
|
|
4759
4851
|
initialPageParam: void 0,
|
|
@@ -4763,7 +4855,7 @@ function useCategories(options) {
|
|
|
4763
4855
|
},
|
|
4764
4856
|
enabled
|
|
4765
4857
|
});
|
|
4766
|
-
const categories = (
|
|
4858
|
+
const categories = (_f = (_e = query.data) == null ? void 0 : _e.pages.flatMap((p) => p.data)) != null ? _f : [];
|
|
4767
4859
|
const hasNextPage = !!query.hasNextPage;
|
|
4768
4860
|
return __spreadProps(__spreadValues({}, query), {
|
|
4769
4861
|
categories,
|
|
@@ -6602,6 +6694,7 @@ function useVenueEvents(options) {
|
|
|
6602
6694
|
const status = options == null ? void 0 : options.status;
|
|
6603
6695
|
const sortBy = options == null ? void 0 : options.sortBy;
|
|
6604
6696
|
const sortDir = options == null ? void 0 : options.sortDir;
|
|
6697
|
+
const recurrence = options == null ? void 0 : options.recurrence;
|
|
6605
6698
|
const queryKeyScope = (_d = options == null ? void 0 : options.queryKeyScope) != null ? _d : "events";
|
|
6606
6699
|
const minYesPrice = options == null ? void 0 : options.minYesPrice;
|
|
6607
6700
|
const maxYesPrice = options == null ? void 0 : options.maxYesPrice;
|
|
@@ -6628,6 +6721,7 @@ function useVenueEvents(options) {
|
|
|
6628
6721
|
(_g = status == null ? void 0 : status.join(",")) != null ? _g : "",
|
|
6629
6722
|
sortBy != null ? sortBy : "",
|
|
6630
6723
|
sortDir != null ? sortDir : "",
|
|
6724
|
+
recurrence != null ? recurrence : "",
|
|
6631
6725
|
minYesPrice != null ? minYesPrice : "",
|
|
6632
6726
|
maxYesPrice != null ? maxYesPrice : "",
|
|
6633
6727
|
endDateFrom != null ? endDateFrom : "",
|
|
@@ -6645,6 +6739,7 @@ function useVenueEvents(options) {
|
|
|
6645
6739
|
status,
|
|
6646
6740
|
sortBy,
|
|
6647
6741
|
sortDir,
|
|
6742
|
+
recurrence,
|
|
6648
6743
|
limit,
|
|
6649
6744
|
minYesPrice,
|
|
6650
6745
|
maxYesPrice,
|
|
@@ -7087,9 +7182,11 @@ function useAppConfig() {
|
|
|
7087
7182
|
useMarketSearch,
|
|
7088
7183
|
useMidpoints,
|
|
7089
7184
|
useOnBalanceUpdate,
|
|
7185
|
+
useOnOrderEvent,
|
|
7090
7186
|
useOnOrderSubmitted,
|
|
7091
7187
|
useOnRedeemEvent,
|
|
7092
7188
|
useOnWithdrawalLifecycle,
|
|
7189
|
+
useOptionalAggClient,
|
|
7093
7190
|
useOrderBook,
|
|
7094
7191
|
useOrderbookQuote,
|
|
7095
7192
|
useOrders,
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useRampQuotes,
|
|
3
3
|
useRampSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-R6VANZRA.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useWithdrawEstimate,
|
|
7
7
|
useWithdrawFlow,
|
|
8
8
|
useWithdrawalLifecycle
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-V34QGQBO.mjs";
|
|
10
10
|
import {
|
|
11
11
|
AggAuthContext,
|
|
12
12
|
AggBalanceProvider,
|
|
@@ -77,9 +77,11 @@ import {
|
|
|
77
77
|
useLabels,
|
|
78
78
|
useManagedBalances,
|
|
79
79
|
useOnBalanceUpdate,
|
|
80
|
+
useOnOrderEvent,
|
|
80
81
|
useOnOrderSubmitted,
|
|
81
82
|
useOnRedeemEvent,
|
|
82
83
|
useOnWithdrawalLifecycle,
|
|
84
|
+
useOptionalAggClient,
|
|
83
85
|
usePositions,
|
|
84
86
|
useQuoteManaged,
|
|
85
87
|
useRedeem,
|
|
@@ -91,7 +93,7 @@ import {
|
|
|
91
93
|
useSyncBalances,
|
|
92
94
|
useWithdrawManaged,
|
|
93
95
|
userActivityQueryKeys
|
|
94
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-2C7JR5OH.mjs";
|
|
95
97
|
|
|
96
98
|
// src/index.ts
|
|
97
99
|
import { QueryClient as QueryClient4, QueryClientProvider, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
@@ -187,17 +189,19 @@ var requestAggAuthChooserOpen = () => {
|
|
|
187
189
|
// src/use-categories.ts
|
|
188
190
|
import { useInfiniteQuery } from "@tanstack/react-query";
|
|
189
191
|
function useCategories(options) {
|
|
190
|
-
var _a, _b, _c, _d;
|
|
192
|
+
var _a, _b, _c, _d, _e, _f;
|
|
191
193
|
const client = useAggClient();
|
|
192
|
-
const
|
|
193
|
-
const
|
|
194
|
+
const queryKeyScope = (_a = options == null ? void 0 : options.queryKeyScope) != null ? _a : "categories";
|
|
195
|
+
const parentId = (_b = options == null ? void 0 : options.parentId) != null ? _b : null;
|
|
196
|
+
const enabled = (_c = options == null ? void 0 : options.enabled) != null ? _c : true;
|
|
197
|
+
const limit = (_d = options == null ? void 0 : options.limit) != null ? _d : 20;
|
|
194
198
|
const query = useInfiniteQuery({
|
|
195
|
-
queryKey: ["
|
|
199
|
+
queryKey: [queryKeyScope, "parent", parentId != null ? parentId : "__root__", limit],
|
|
196
200
|
queryFn: (_0) => __async(null, [_0], function* ({ pageParam }) {
|
|
197
|
-
const res = yield client.getCategories({
|
|
201
|
+
const res = yield client.getCategories(__spreadValues({
|
|
198
202
|
limit,
|
|
199
203
|
cursor: pageParam
|
|
200
|
-
});
|
|
204
|
+
}, parentId != null ? { parentId } : {}));
|
|
201
205
|
return res;
|
|
202
206
|
}),
|
|
203
207
|
initialPageParam: void 0,
|
|
@@ -207,7 +211,7 @@ function useCategories(options) {
|
|
|
207
211
|
},
|
|
208
212
|
enabled
|
|
209
213
|
});
|
|
210
|
-
const categories = (
|
|
214
|
+
const categories = (_f = (_e = query.data) == null ? void 0 : _e.pages.flatMap((p) => p.data)) != null ? _f : [];
|
|
211
215
|
const hasNextPage = !!query.hasNextPage;
|
|
212
216
|
return __spreadProps(__spreadValues({}, query), {
|
|
213
217
|
categories,
|
|
@@ -2056,6 +2060,7 @@ function useVenueEvents(options) {
|
|
|
2056
2060
|
const status = options == null ? void 0 : options.status;
|
|
2057
2061
|
const sortBy = options == null ? void 0 : options.sortBy;
|
|
2058
2062
|
const sortDir = options == null ? void 0 : options.sortDir;
|
|
2063
|
+
const recurrence = options == null ? void 0 : options.recurrence;
|
|
2059
2064
|
const queryKeyScope = (_d = options == null ? void 0 : options.queryKeyScope) != null ? _d : "events";
|
|
2060
2065
|
const minYesPrice = options == null ? void 0 : options.minYesPrice;
|
|
2061
2066
|
const maxYesPrice = options == null ? void 0 : options.maxYesPrice;
|
|
@@ -2082,6 +2087,7 @@ function useVenueEvents(options) {
|
|
|
2082
2087
|
(_g = status == null ? void 0 : status.join(",")) != null ? _g : "",
|
|
2083
2088
|
sortBy != null ? sortBy : "",
|
|
2084
2089
|
sortDir != null ? sortDir : "",
|
|
2090
|
+
recurrence != null ? recurrence : "",
|
|
2085
2091
|
minYesPrice != null ? minYesPrice : "",
|
|
2086
2092
|
maxYesPrice != null ? maxYesPrice : "",
|
|
2087
2093
|
endDateFrom != null ? endDateFrom : "",
|
|
@@ -2099,6 +2105,7 @@ function useVenueEvents(options) {
|
|
|
2099
2105
|
status,
|
|
2100
2106
|
sortBy,
|
|
2101
2107
|
sortDir,
|
|
2108
|
+
recurrence,
|
|
2102
2109
|
limit,
|
|
2103
2110
|
minYesPrice,
|
|
2104
2111
|
maxYesPrice,
|
|
@@ -2540,9 +2547,11 @@ export {
|
|
|
2540
2547
|
useMarketSearch,
|
|
2541
2548
|
useMidpoints,
|
|
2542
2549
|
useOnBalanceUpdate,
|
|
2550
|
+
useOnOrderEvent,
|
|
2543
2551
|
useOnOrderSubmitted,
|
|
2544
2552
|
useOnRedeemEvent,
|
|
2545
2553
|
useOnWithdrawalLifecycle,
|
|
2554
|
+
useOptionalAggClient,
|
|
2546
2555
|
useOrderBook,
|
|
2547
2556
|
useOrderbookQuote,
|
|
2548
2557
|
useOrders,
|