@agg-build/hooks 2.0.0 → 2.1.0
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/README.md +1 -1
- package/dist/{chunk-OBHXWQ6L.mjs → chunk-DK4YDVPH.mjs} +88 -27
- package/dist/{chunk-KXO3JOXF.mjs → chunk-QKVR32KC.mjs} +1 -1
- package/dist/{chunk-VLYLQSDD.mjs → chunk-V7VCT62L.mjs} +18 -10
- package/dist/deposit.d.mts +5 -1
- package/dist/deposit.d.ts +5 -1
- package/dist/deposit.js +233 -179
- package/dist/deposit.mjs +176 -131
- package/dist/index.d.mts +33 -4
- package/dist/index.d.ts +33 -4
- package/dist/index.js +212 -137
- package/dist/index.mjs +48 -40
- package/dist/withdraw.d.mts +31 -2
- package/dist/withdraw.d.ts +31 -2
- package/dist/withdraw.js +94 -26
- package/dist/withdraw.mjs +4 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import * as _agg_build_sdk from '@agg-build/sdk';
|
|
|
5
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, Category, UserActivityQuery, UserActivityItem, PaginatedResponse, CandleInterval, OrderbookState, OrderbookQuoteResponse, OrderListQuery, TradeExecutorOrder, SmartRouteSide, ExecutionMode, SmartRouteResponse, RecurrenceFilter, MidpointRow, BatchMidpointsResponse, AppClientConfigResponse } from '@agg-build/sdk';
|
|
6
6
|
export { TurnstileChallengeError } from '@agg-build/sdk';
|
|
7
7
|
import React, { ReactNode } from 'react';
|
|
8
|
-
export { UseManagedBalancesOptions, UseWithdrawEstimateParams, UseWithdrawFlowOptions, UseWithdrawFlowResult, UseWithdrawManagedOptions, UseWithdrawalLifecycleResult, WithdrawFeeEstimate, WithdrawalLifecycleState, useManagedBalances, useWithdrawEstimate, useWithdrawFlow, useWithdrawManaged, useWithdrawalLifecycle } from './withdraw.js';
|
|
8
|
+
export { UseManagedBalancesOptions, UseWithdrawEstimateParams, UseWithdrawFlowOptions, UseWithdrawFlowResult, UseWithdrawManagedOptions, UseWithdrawPreviewParams, UseWithdrawalLifecycleResult, WithdrawFeeEstimate, WithdrawalLifecycleState, useManagedBalances, useWithdrawEstimate, useWithdrawFlow, useWithdrawManaged, useWithdrawPreview, useWithdrawalLifecycle } from './withdraw.js';
|
|
9
9
|
export { U as UseDepositAddressesOptions, g as getDepositAddress, u as useDepositAddresses } from './use-deposit-addresses-B9ICS-3U.js';
|
|
10
10
|
export { U as UseSyncBalancesOptions, u as useSyncBalances } from './use-sync-balances-CeD8qZWP.js';
|
|
11
11
|
|
|
@@ -313,6 +313,8 @@ type VenueEvent = {
|
|
|
313
313
|
displayName: string | null;
|
|
314
314
|
parentId: string | null;
|
|
315
315
|
eventCount: number;
|
|
316
|
+
volume24hr: number;
|
|
317
|
+
volume: number;
|
|
316
318
|
};
|
|
317
319
|
}[];
|
|
318
320
|
status?: MarketStatus | undefined;
|
|
@@ -433,6 +435,8 @@ interface AggUiLabels {
|
|
|
433
435
|
errorPrefix: string;
|
|
434
436
|
tabsAria: string;
|
|
435
437
|
hiddenTabsAria: string;
|
|
438
|
+
scrollTabsLeft: string;
|
|
439
|
+
scrollTabsRight: string;
|
|
436
440
|
selectAria: string;
|
|
437
441
|
lineChartAria: string;
|
|
438
442
|
candlestickChartAria: string;
|
|
@@ -586,6 +590,7 @@ interface AggUiLabels {
|
|
|
586
590
|
networkReserveTooltipLineTwo: string;
|
|
587
591
|
youReceive: string;
|
|
588
592
|
confirm: string;
|
|
593
|
+
calculatingFees: string;
|
|
589
594
|
successTitle: string;
|
|
590
595
|
successDescription: (tokenSymbol: string) => string;
|
|
591
596
|
successTitleCompleted: string;
|
|
@@ -1041,6 +1046,9 @@ interface AggUiLabels {
|
|
|
1041
1046
|
buyingOutcome: (label: string) => string;
|
|
1042
1047
|
sellingOutcome: (label: string) => string;
|
|
1043
1048
|
findingBestRoute: string;
|
|
1049
|
+
findingBestOdds: string;
|
|
1050
|
+
updatingRoute: string;
|
|
1051
|
+
refreshingQuotes: string;
|
|
1044
1052
|
checkingBalance: string;
|
|
1045
1053
|
submittingOrderProgress: string;
|
|
1046
1054
|
orderSubmittedProgress: (orderId: string) => string;
|
|
@@ -1321,6 +1329,11 @@ type AggUiFeatureFlagsConfigInput = Partial<AggUiFeatureFlagsConfig>;
|
|
|
1321
1329
|
interface AggUiMarketConfig {
|
|
1322
1330
|
/** Arbitrage threshold for the UI */
|
|
1323
1331
|
arbitrageThreshold: number;
|
|
1332
|
+
/**
|
|
1333
|
+
* Maximum venue market IDs sent in each REST `/midpoints` request.
|
|
1334
|
+
* Lower this when proxy/CDN URL limits are stricter than AGG's backend cap.
|
|
1335
|
+
*/
|
|
1336
|
+
maxMidpointIdsPerRequest: number;
|
|
1324
1337
|
}
|
|
1325
1338
|
type AggUiMarketConfigInput = Partial<AggUiMarketConfig>;
|
|
1326
1339
|
interface AggUiChartConfig {
|
|
@@ -3359,6 +3372,9 @@ declare function mergeBestPricesPreferringLive(rest: ReadonlyMap<string, {
|
|
|
3359
3372
|
*/
|
|
3360
3373
|
declare function useLiveTrades(canonicalMarketId: string | null): WsTrade[];
|
|
3361
3374
|
|
|
3375
|
+
interface UseMidpointsOptions {
|
|
3376
|
+
maxMidpointIdsPerRequest?: number;
|
|
3377
|
+
}
|
|
3362
3378
|
interface UseMidpointsResult {
|
|
3363
3379
|
/** Map of outcomeId → price. Empty while loading. */
|
|
3364
3380
|
prices: Map<string, number>;
|
|
@@ -3419,7 +3435,7 @@ interface UseMidpointsResult {
|
|
|
3419
3435
|
* sides because MVMO links same-side counterparts regardless of label
|
|
3420
3436
|
* inversion. No label heuristics; no `1 - midpoint` flips.
|
|
3421
3437
|
*/
|
|
3422
|
-
declare function useMidpoints(venueMarkets: VenueMarket[] | null | undefined): UseMidpointsResult;
|
|
3438
|
+
declare function useMidpoints(venueMarkets: VenueMarket[] | null | undefined, options?: UseMidpointsOptions): UseMidpointsResult;
|
|
3423
3439
|
|
|
3424
3440
|
interface UseTradableVenuesResult {
|
|
3425
3441
|
/**
|
|
@@ -4056,12 +4072,21 @@ interface UseSmartRouteOptions {
|
|
|
4056
4072
|
/** Cache freshness and polling interval in milliseconds. Defaults to SMART_ROUTE_STALE_TIME_MS. */
|
|
4057
4073
|
staleTimeMs?: number;
|
|
4058
4074
|
}
|
|
4075
|
+
/**
|
|
4076
|
+
* Why the smart route query is currently loading.
|
|
4077
|
+
* - `"finding-best-odds"` — first fetch, no prior data in cache
|
|
4078
|
+
* - `"updating-route"` — query key changed (e.g. amount changed), placeholder data shown
|
|
4079
|
+
* - `"refreshing-quotes"` — background poll/revalidation with existing data
|
|
4080
|
+
*/
|
|
4081
|
+
type SmartRouteLoadingReason = "finding-best-odds" | "updating-route" | "refreshing-quotes";
|
|
4059
4082
|
interface UseSmartRouteResult {
|
|
4060
4083
|
data: SmartRouteResponse | null;
|
|
4061
4084
|
isLoading: boolean;
|
|
4062
4085
|
isFetching: boolean;
|
|
4063
4086
|
error: Error | null;
|
|
4064
4087
|
refetch: () => Promise<unknown>;
|
|
4088
|
+
/** Null when not loading. See {@link SmartRouteLoadingReason}. */
|
|
4089
|
+
loadingReason: SmartRouteLoadingReason | null;
|
|
4065
4090
|
}
|
|
4066
4091
|
/**
|
|
4067
4092
|
* Compute optimal order routing across venues via the MILP solver.
|
|
@@ -5176,6 +5201,7 @@ declare function useVenueMarkets(options?: UseVenueMarketsOptions): {
|
|
|
5176
5201
|
interface UseVenueMarketMidpointsOptions {
|
|
5177
5202
|
venueMarketIds: string[];
|
|
5178
5203
|
enabled?: boolean;
|
|
5204
|
+
maxMidpointIdsPerRequest?: number;
|
|
5179
5205
|
}
|
|
5180
5206
|
declare function useVenueMarketMidpoints(options: UseVenueMarketMidpointsOptions): {
|
|
5181
5207
|
midpointRows: (MidpointRow & {
|
|
@@ -5405,7 +5431,10 @@ declare const computePriceGaps: ({ markets, midpointsByVenueMarketId, }: Compute
|
|
|
5405
5431
|
* outcome — semantically correct for both Yes and No sides because MVMO
|
|
5406
5432
|
* links same-side counterparts regardless of label inversion.
|
|
5407
5433
|
*/
|
|
5408
|
-
|
|
5434
|
+
interface UseViewportMidpointsOptions {
|
|
5435
|
+
maxMidpointIdsPerRequest?: number;
|
|
5436
|
+
}
|
|
5437
|
+
declare function useViewportMidpoints(visibleMarkets: VenueMarket[], options?: UseViewportMidpointsOptions): {
|
|
5409
5438
|
prices: Map<string, number>;
|
|
5410
5439
|
/**
|
|
5411
5440
|
* Map of outcomeId → venue name that provided the price in `prices`.
|
|
@@ -5458,4 +5487,4 @@ declare function useAppConfig(): UseAppConfigResult;
|
|
|
5458
5487
|
*/
|
|
5459
5488
|
declare function useCachedAppConfig(): UseAppConfigResult;
|
|
5460
5489
|
|
|
5461
|
-
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 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 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 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 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 VenueAvailabilityState, type VenueEvent, type VenueEventWithMarkets, type VenueMarket, type VenueMarketOutcome, type WalletActionSendTokenParams, type WalletActions, computeClosedPositionTotals, computePriceGaps, defaultAggUiConfig, defaultAggUiConfig as defaultSdkUiConfig, executionKeys, 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, 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, useTradableVenues, useUserActivity, useUserHoldings, useVenueEvent, useVenueEvents, useVenueMarketMidpoints, useVenueMarkets, useViewportMidpoints, useVisibleIds, userActivityQueryKeys };
|
|
5490
|
+
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 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 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 UseTradableVenuesResult, 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, computeClosedPositionTotals, computePriceGaps, defaultAggUiConfig, defaultAggUiConfig as defaultSdkUiConfig, executionKeys, 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, 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, useTradableVenues, useUserActivity, useUserHoldings, useVenueEvent, useVenueEvents, useVenueMarketMidpoints, useVenueMarkets, useViewportMidpoints, useVisibleIds, userActivityQueryKeys };
|