@agg-build/hooks 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-DK4YDVPH.mjs → chunk-5P53A3NQ.mjs} +1 -1
- package/dist/{chunk-QKVR32KC.mjs → chunk-AFZD3GIQ.mjs} +1 -1
- package/dist/{chunk-V7VCT62L.mjs → chunk-FYEPQHKO.mjs} +25 -5
- package/dist/deposit.js +12 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.d.mts +18 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +25 -5
- package/dist/index.mjs +3 -3
- package/dist/withdraw.js +12 -2
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useOnWithdrawalLifecycle,
|
|
12
12
|
useSyncBalances,
|
|
13
13
|
useWithdrawManaged
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FYEPQHKO.mjs";
|
|
15
15
|
|
|
16
16
|
// src/withdraw/use-withdraw-flow.ts
|
|
17
17
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
@@ -463,6 +463,13 @@ var enUsLabels = {
|
|
|
463
463
|
categoryTabsAria: "Home page category tabs"
|
|
464
464
|
},
|
|
465
465
|
userProfile: {
|
|
466
|
+
balance: {
|
|
467
|
+
availableBalance: "Available Balance",
|
|
468
|
+
balanceByNetwork: "Balance by network",
|
|
469
|
+
paperModeNetwork: "Paper",
|
|
470
|
+
paperModeWarning: "Paper mode is enabled. These are simulated funds for paper trading.",
|
|
471
|
+
networkTooltipDescription: "Funds are stored across networks. We handle routing automatically, but keeping funds on the right network enables faster trades and lower fees. When depositing, you can choose your preferred network."
|
|
472
|
+
},
|
|
466
473
|
activity: {
|
|
467
474
|
depositType: "Deposit",
|
|
468
475
|
redeemType: "Claim",
|
|
@@ -1147,7 +1154,10 @@ var defaultAggUiConfig = {
|
|
|
1147
1154
|
}
|
|
1148
1155
|
},
|
|
1149
1156
|
formatting: defaultFormatters,
|
|
1150
|
-
search: defaultAggUiSearchConfig
|
|
1157
|
+
search: defaultAggUiSearchConfig,
|
|
1158
|
+
trading: {
|
|
1159
|
+
executionMode: "live"
|
|
1160
|
+
}
|
|
1151
1161
|
};
|
|
1152
1162
|
var mergeAggUiSearchConfig = (config) => {
|
|
1153
1163
|
var _a, _b, _c;
|
|
@@ -1162,7 +1172,7 @@ var mergeAggUiSearchConfig = (config) => {
|
|
|
1162
1172
|
};
|
|
1163
1173
|
};
|
|
1164
1174
|
var mergeAggUiConfig = (persisted, config) => {
|
|
1165
|
-
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, _S, _T, _U, _V;
|
|
1175
|
+
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, _S, _T, _U, _V, _W, _X;
|
|
1166
1176
|
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;
|
|
1167
1177
|
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;
|
|
1168
1178
|
const formatters = createFormatters(locale);
|
|
@@ -1203,6 +1213,9 @@ var mergeAggUiConfig = (persisted, config) => {
|
|
|
1203
1213
|
formatDate: (_V = (_U = config == null ? void 0 : config.formatting) == null ? void 0 : _U.formatDate) != null ? _V : formatters.formatDate
|
|
1204
1214
|
},
|
|
1205
1215
|
search: mergeAggUiSearchConfig(config == null ? void 0 : config.search),
|
|
1216
|
+
trading: {
|
|
1217
|
+
executionMode: (_X = (_W = config == null ? void 0 : config.trading) == null ? void 0 : _W.executionMode) != null ? _X : defaultAggUiConfig.trading.executionMode
|
|
1218
|
+
},
|
|
1206
1219
|
walletActions: config == null ? void 0 : config.walletActions,
|
|
1207
1220
|
solanaRpcUrl: config == null ? void 0 : config.solanaRpcUrl
|
|
1208
1221
|
};
|
|
@@ -1232,7 +1245,7 @@ var balanceQueryKeys = {
|
|
|
1232
1245
|
execution: () => executionKeys.balances(),
|
|
1233
1246
|
// Kept as an alias for backward compatibility with existing callers.
|
|
1234
1247
|
// The balance provider now uses the same canonical execution balances key.
|
|
1235
|
-
provider: () => executionKeys.balances(),
|
|
1248
|
+
provider: (mode) => executionKeys.balances(mode),
|
|
1236
1249
|
venue: (venuesKey) => ["venue-balances", venuesKey],
|
|
1237
1250
|
venuePrefix: () => ["venue-balances"]
|
|
1238
1251
|
};
|
|
@@ -1318,6 +1331,7 @@ var AggBalanceContext = createContext(null);
|
|
|
1318
1331
|
// src/core/providers/balance-provider.tsx
|
|
1319
1332
|
import { jsx } from "react/jsx-runtime";
|
|
1320
1333
|
var CHAIN_LABELS = {
|
|
1334
|
+
0: "Paper",
|
|
1321
1335
|
1: "Ethereum",
|
|
1322
1336
|
10: "Optimism",
|
|
1323
1337
|
56: "BNB",
|
|
@@ -1349,17 +1363,23 @@ var EMPTY_MANAGED_BALANCES = {
|
|
|
1349
1363
|
function AggBalanceProvider({ children }) {
|
|
1350
1364
|
const client = useContext(AggClientContext);
|
|
1351
1365
|
const authContext = useContext(AggAuthContext);
|
|
1366
|
+
const {
|
|
1367
|
+
trading: { executionMode }
|
|
1368
|
+
} = useContext(AggUiContext);
|
|
1352
1369
|
if (!authContext) {
|
|
1353
1370
|
throw new Error("AggBalanceProvider must be used within an <AggAuthProvider>");
|
|
1354
1371
|
}
|
|
1355
1372
|
const { isAuthenticated } = authContext;
|
|
1373
|
+
const queryExecutionMode = executionMode === "paper" ? "paper" : void 0;
|
|
1356
1374
|
const balancesQuery = useQuery({
|
|
1357
|
-
queryKey: balanceQueryKeys.provider(),
|
|
1375
|
+
queryKey: balanceQueryKeys.provider(queryExecutionMode),
|
|
1358
1376
|
queryFn: () => __async(null, null, function* () {
|
|
1359
1377
|
if (!client || !isAuthenticated) {
|
|
1360
1378
|
return EMPTY_MANAGED_BALANCES;
|
|
1361
1379
|
}
|
|
1362
|
-
return client.getManagedBalances(
|
|
1380
|
+
return client.getManagedBalances(
|
|
1381
|
+
queryExecutionMode ? { mode: queryExecutionMode } : void 0
|
|
1382
|
+
);
|
|
1363
1383
|
}),
|
|
1364
1384
|
enabled: Boolean(client && isAuthenticated),
|
|
1365
1385
|
staleTime: 60 * 1e3,
|
package/dist/deposit.js
CHANGED
|
@@ -397,6 +397,13 @@ var enUsLabels = {
|
|
|
397
397
|
categoryTabsAria: "Home page category tabs"
|
|
398
398
|
},
|
|
399
399
|
userProfile: {
|
|
400
|
+
balance: {
|
|
401
|
+
availableBalance: "Available Balance",
|
|
402
|
+
balanceByNetwork: "Balance by network",
|
|
403
|
+
paperModeNetwork: "Paper",
|
|
404
|
+
paperModeWarning: "Paper mode is enabled. These are simulated funds for paper trading.",
|
|
405
|
+
networkTooltipDescription: "Funds are stored across networks. We handle routing automatically, but keeping funds on the right network enables faster trades and lower fees. When depositing, you can choose your preferred network."
|
|
406
|
+
},
|
|
400
407
|
activity: {
|
|
401
408
|
depositType: "Deposit",
|
|
402
409
|
redeemType: "Claim",
|
|
@@ -1061,7 +1068,10 @@ var defaultAggUiConfig = {
|
|
|
1061
1068
|
}
|
|
1062
1069
|
},
|
|
1063
1070
|
formatting: defaultFormatters,
|
|
1064
|
-
search: defaultAggUiSearchConfig
|
|
1071
|
+
search: defaultAggUiSearchConfig,
|
|
1072
|
+
trading: {
|
|
1073
|
+
executionMode: "live"
|
|
1074
|
+
}
|
|
1065
1075
|
};
|
|
1066
1076
|
|
|
1067
1077
|
// src/core/providers/contexts.ts
|
|
@@ -1095,7 +1105,7 @@ var balanceQueryKeys = {
|
|
|
1095
1105
|
execution: () => executionKeys.balances(),
|
|
1096
1106
|
// Kept as an alias for backward compatibility with existing callers.
|
|
1097
1107
|
// The balance provider now uses the same canonical execution balances key.
|
|
1098
|
-
provider: () => executionKeys.balances(),
|
|
1108
|
+
provider: (mode) => executionKeys.balances(mode),
|
|
1099
1109
|
venue: (venuesKey) => ["venue-balances", venuesKey],
|
|
1100
1110
|
venuePrefix: () => ["venue-balances"]
|
|
1101
1111
|
};
|
package/dist/deposit.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useRampQuotes,
|
|
3
3
|
useRampSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AFZD3GIQ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__async,
|
|
7
7
|
useAggAuthState,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
useAggUiConfig,
|
|
11
11
|
useDepositAddresses,
|
|
12
12
|
useSyncBalances
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FYEPQHKO.mjs";
|
|
14
14
|
|
|
15
15
|
// src/deposit/normalize-wallet-error.ts
|
|
16
16
|
function normalizeWalletError(error, supportedChains) {
|
package/dist/index.d.mts
CHANGED
|
@@ -676,6 +676,13 @@ interface AggUiLabels {
|
|
|
676
676
|
categoryTabsAria: string;
|
|
677
677
|
};
|
|
678
678
|
userProfile: {
|
|
679
|
+
balance: {
|
|
680
|
+
availableBalance: string;
|
|
681
|
+
balanceByNetwork: string;
|
|
682
|
+
paperModeNetwork: string;
|
|
683
|
+
paperModeWarning: string;
|
|
684
|
+
networkTooltipDescription: string;
|
|
685
|
+
};
|
|
679
686
|
activity: {
|
|
680
687
|
depositType: string;
|
|
681
688
|
redeemType: string;
|
|
@@ -1290,6 +1297,7 @@ declare const resolveAggUiLabels: (locale: string) => AggUiLabels;
|
|
|
1290
1297
|
|
|
1291
1298
|
type ThemeMode = "light" | "dark";
|
|
1292
1299
|
type ChartTimeRange = "1H" | "6H" | "1D" | "1W" | "1M" | "ALL";
|
|
1300
|
+
type AggUiTradingExecutionMode = "live" | "paper";
|
|
1293
1301
|
interface AggUiGeneralConfig {
|
|
1294
1302
|
/** Locale for number and date formatting */
|
|
1295
1303
|
locale: string;
|
|
@@ -1376,6 +1384,11 @@ interface AggUiSearchConfig {
|
|
|
1376
1384
|
isShowingAllResults: boolean;
|
|
1377
1385
|
}
|
|
1378
1386
|
type AggUiSearchConfigInput = Partial<AggUiSearchConfig>;
|
|
1387
|
+
interface AggUiTradingConfig {
|
|
1388
|
+
/** Default execution mode used by trading surfaces unless a component prop overrides it. */
|
|
1389
|
+
executionMode: AggUiTradingExecutionMode;
|
|
1390
|
+
}
|
|
1391
|
+
type AggUiTradingConfigInput = Partial<AggUiTradingConfig>;
|
|
1379
1392
|
interface AggUiConfig {
|
|
1380
1393
|
/** Enable AGG development logs */
|
|
1381
1394
|
enableLogs: boolean;
|
|
@@ -1399,6 +1412,8 @@ interface AggUiConfig {
|
|
|
1399
1412
|
formatting: AggUiFormattingConfig;
|
|
1400
1413
|
/** Search configuration */
|
|
1401
1414
|
search: AggUiSearchConfig;
|
|
1415
|
+
/** Trading configuration */
|
|
1416
|
+
trading: AggUiTradingConfig;
|
|
1402
1417
|
/**
|
|
1403
1418
|
* Optional wallet action implementations.
|
|
1404
1419
|
* When walletActions.sendToken is provided, DepositModal uses it for the
|
|
@@ -1432,6 +1447,8 @@ interface AggUiConfigInput {
|
|
|
1432
1447
|
formatting?: AggUiFormattingConfigInput;
|
|
1433
1448
|
/** Search config overrides */
|
|
1434
1449
|
search?: AggUiSearchConfigInput;
|
|
1450
|
+
/** Trading config overrides */
|
|
1451
|
+
trading?: AggUiTradingConfigInput;
|
|
1435
1452
|
/**
|
|
1436
1453
|
* Optional wallet action implementations for deposit flows.
|
|
1437
1454
|
* Provide this once at the provider level for plug-and-play deposit UX.
|
|
@@ -5487,4 +5504,4 @@ declare function useAppConfig(): UseAppConfigResult;
|
|
|
5487
5504
|
*/
|
|
5488
5505
|
declare function useCachedAppConfig(): UseAppConfigResult;
|
|
5489
5506
|
|
|
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 };
|
|
5507
|
+
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 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -676,6 +676,13 @@ interface AggUiLabels {
|
|
|
676
676
|
categoryTabsAria: string;
|
|
677
677
|
};
|
|
678
678
|
userProfile: {
|
|
679
|
+
balance: {
|
|
680
|
+
availableBalance: string;
|
|
681
|
+
balanceByNetwork: string;
|
|
682
|
+
paperModeNetwork: string;
|
|
683
|
+
paperModeWarning: string;
|
|
684
|
+
networkTooltipDescription: string;
|
|
685
|
+
};
|
|
679
686
|
activity: {
|
|
680
687
|
depositType: string;
|
|
681
688
|
redeemType: string;
|
|
@@ -1290,6 +1297,7 @@ declare const resolveAggUiLabels: (locale: string) => AggUiLabels;
|
|
|
1290
1297
|
|
|
1291
1298
|
type ThemeMode = "light" | "dark";
|
|
1292
1299
|
type ChartTimeRange = "1H" | "6H" | "1D" | "1W" | "1M" | "ALL";
|
|
1300
|
+
type AggUiTradingExecutionMode = "live" | "paper";
|
|
1293
1301
|
interface AggUiGeneralConfig {
|
|
1294
1302
|
/** Locale for number and date formatting */
|
|
1295
1303
|
locale: string;
|
|
@@ -1376,6 +1384,11 @@ interface AggUiSearchConfig {
|
|
|
1376
1384
|
isShowingAllResults: boolean;
|
|
1377
1385
|
}
|
|
1378
1386
|
type AggUiSearchConfigInput = Partial<AggUiSearchConfig>;
|
|
1387
|
+
interface AggUiTradingConfig {
|
|
1388
|
+
/** Default execution mode used by trading surfaces unless a component prop overrides it. */
|
|
1389
|
+
executionMode: AggUiTradingExecutionMode;
|
|
1390
|
+
}
|
|
1391
|
+
type AggUiTradingConfigInput = Partial<AggUiTradingConfig>;
|
|
1379
1392
|
interface AggUiConfig {
|
|
1380
1393
|
/** Enable AGG development logs */
|
|
1381
1394
|
enableLogs: boolean;
|
|
@@ -1399,6 +1412,8 @@ interface AggUiConfig {
|
|
|
1399
1412
|
formatting: AggUiFormattingConfig;
|
|
1400
1413
|
/** Search configuration */
|
|
1401
1414
|
search: AggUiSearchConfig;
|
|
1415
|
+
/** Trading configuration */
|
|
1416
|
+
trading: AggUiTradingConfig;
|
|
1402
1417
|
/**
|
|
1403
1418
|
* Optional wallet action implementations.
|
|
1404
1419
|
* When walletActions.sendToken is provided, DepositModal uses it for the
|
|
@@ -1432,6 +1447,8 @@ interface AggUiConfigInput {
|
|
|
1432
1447
|
formatting?: AggUiFormattingConfigInput;
|
|
1433
1448
|
/** Search config overrides */
|
|
1434
1449
|
search?: AggUiSearchConfigInput;
|
|
1450
|
+
/** Trading config overrides */
|
|
1451
|
+
trading?: AggUiTradingConfigInput;
|
|
1435
1452
|
/**
|
|
1436
1453
|
* Optional wallet action implementations for deposit flows.
|
|
1437
1454
|
* Provide this once at the provider level for plug-and-play deposit UX.
|
|
@@ -5487,4 +5504,4 @@ declare function useAppConfig(): UseAppConfigResult;
|
|
|
5487
5504
|
*/
|
|
5488
5505
|
declare function useCachedAppConfig(): UseAppConfigResult;
|
|
5489
5506
|
|
|
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 };
|
|
5507
|
+
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 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 };
|
package/dist/index.js
CHANGED
|
@@ -783,6 +783,13 @@ var enUsLabels = {
|
|
|
783
783
|
categoryTabsAria: "Home page category tabs"
|
|
784
784
|
},
|
|
785
785
|
userProfile: {
|
|
786
|
+
balance: {
|
|
787
|
+
availableBalance: "Available Balance",
|
|
788
|
+
balanceByNetwork: "Balance by network",
|
|
789
|
+
paperModeNetwork: "Paper",
|
|
790
|
+
paperModeWarning: "Paper mode is enabled. These are simulated funds for paper trading.",
|
|
791
|
+
networkTooltipDescription: "Funds are stored across networks. We handle routing automatically, but keeping funds on the right network enables faster trades and lower fees. When depositing, you can choose your preferred network."
|
|
792
|
+
},
|
|
786
793
|
activity: {
|
|
787
794
|
depositType: "Deposit",
|
|
788
795
|
redeemType: "Claim",
|
|
@@ -1467,7 +1474,10 @@ var defaultAggUiConfig = {
|
|
|
1467
1474
|
}
|
|
1468
1475
|
},
|
|
1469
1476
|
formatting: defaultFormatters,
|
|
1470
|
-
search: defaultAggUiSearchConfig
|
|
1477
|
+
search: defaultAggUiSearchConfig,
|
|
1478
|
+
trading: {
|
|
1479
|
+
executionMode: "live"
|
|
1480
|
+
}
|
|
1471
1481
|
};
|
|
1472
1482
|
var mergeAggUiSearchConfig = (config) => {
|
|
1473
1483
|
var _a, _b, _c;
|
|
@@ -1482,7 +1492,7 @@ var mergeAggUiSearchConfig = (config) => {
|
|
|
1482
1492
|
};
|
|
1483
1493
|
};
|
|
1484
1494
|
var mergeAggUiConfig = (persisted, config) => {
|
|
1485
|
-
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, _S, _T, _U, _V;
|
|
1495
|
+
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, _S, _T, _U, _V, _W, _X;
|
|
1486
1496
|
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;
|
|
1487
1497
|
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;
|
|
1488
1498
|
const formatters = createFormatters(locale);
|
|
@@ -1523,6 +1533,9 @@ var mergeAggUiConfig = (persisted, config) => {
|
|
|
1523
1533
|
formatDate: (_V = (_U = config == null ? void 0 : config.formatting) == null ? void 0 : _U.formatDate) != null ? _V : formatters.formatDate
|
|
1524
1534
|
},
|
|
1525
1535
|
search: mergeAggUiSearchConfig(config == null ? void 0 : config.search),
|
|
1536
|
+
trading: {
|
|
1537
|
+
executionMode: (_X = (_W = config == null ? void 0 : config.trading) == null ? void 0 : _W.executionMode) != null ? _X : defaultAggUiConfig.trading.executionMode
|
|
1538
|
+
},
|
|
1526
1539
|
walletActions: config == null ? void 0 : config.walletActions,
|
|
1527
1540
|
solanaRpcUrl: config == null ? void 0 : config.solanaRpcUrl
|
|
1528
1541
|
};
|
|
@@ -1797,7 +1810,7 @@ var balanceQueryKeys = {
|
|
|
1797
1810
|
execution: () => executionKeys.balances(),
|
|
1798
1811
|
// Kept as an alias for backward compatibility with existing callers.
|
|
1799
1812
|
// The balance provider now uses the same canonical execution balances key.
|
|
1800
|
-
provider: () => executionKeys.balances(),
|
|
1813
|
+
provider: (mode) => executionKeys.balances(mode),
|
|
1801
1814
|
venue: (venuesKey) => ["venue-balances", venuesKey],
|
|
1802
1815
|
venuePrefix: () => ["venue-balances"]
|
|
1803
1816
|
};
|
|
@@ -1871,6 +1884,7 @@ var invalidateUserClaimState = (queryClient, options) => {
|
|
|
1871
1884
|
// src/core/providers/balance-provider.tsx
|
|
1872
1885
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
1873
1886
|
var CHAIN_LABELS = {
|
|
1887
|
+
0: "Paper",
|
|
1874
1888
|
1: "Ethereum",
|
|
1875
1889
|
10: "Optimism",
|
|
1876
1890
|
56: "BNB",
|
|
@@ -1902,17 +1916,23 @@ var EMPTY_MANAGED_BALANCES = {
|
|
|
1902
1916
|
function AggBalanceProvider({ children }) {
|
|
1903
1917
|
const client = (0, import_react3.useContext)(AggClientContext);
|
|
1904
1918
|
const authContext = (0, import_react3.useContext)(AggAuthContext);
|
|
1919
|
+
const {
|
|
1920
|
+
trading: { executionMode }
|
|
1921
|
+
} = (0, import_react3.useContext)(AggUiContext);
|
|
1905
1922
|
if (!authContext) {
|
|
1906
1923
|
throw new Error("AggBalanceProvider must be used within an <AggAuthProvider>");
|
|
1907
1924
|
}
|
|
1908
1925
|
const { isAuthenticated } = authContext;
|
|
1926
|
+
const queryExecutionMode = executionMode === "paper" ? "paper" : void 0;
|
|
1909
1927
|
const balancesQuery = (0, import_react_query2.useQuery)({
|
|
1910
|
-
queryKey: balanceQueryKeys.provider(),
|
|
1928
|
+
queryKey: balanceQueryKeys.provider(queryExecutionMode),
|
|
1911
1929
|
queryFn: () => __async(null, null, function* () {
|
|
1912
1930
|
if (!client || !isAuthenticated) {
|
|
1913
1931
|
return EMPTY_MANAGED_BALANCES;
|
|
1914
1932
|
}
|
|
1915
|
-
return client.getManagedBalances(
|
|
1933
|
+
return client.getManagedBalances(
|
|
1934
|
+
queryExecutionMode ? { mode: queryExecutionMode } : void 0
|
|
1935
|
+
);
|
|
1916
1936
|
}),
|
|
1917
1937
|
enabled: Boolean(client && isAuthenticated),
|
|
1918
1938
|
staleTime: 60 * 1e3,
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useRampQuotes,
|
|
3
3
|
useRampSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AFZD3GIQ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useWithdrawEstimate,
|
|
7
7
|
useWithdrawFlow,
|
|
8
8
|
useWithdrawPreview,
|
|
9
9
|
useWithdrawalLifecycle
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5P53A3NQ.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-
|
|
98
|
+
} from "./chunk-FYEPQHKO.mjs";
|
|
99
99
|
|
|
100
100
|
// src/index.ts
|
|
101
101
|
import { QueryClient as QueryClient4, QueryClientProvider, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
|
package/dist/withdraw.js
CHANGED
|
@@ -330,6 +330,13 @@ var enUsLabels = {
|
|
|
330
330
|
categoryTabsAria: "Home page category tabs"
|
|
331
331
|
},
|
|
332
332
|
userProfile: {
|
|
333
|
+
balance: {
|
|
334
|
+
availableBalance: "Available Balance",
|
|
335
|
+
balanceByNetwork: "Balance by network",
|
|
336
|
+
paperModeNetwork: "Paper",
|
|
337
|
+
paperModeWarning: "Paper mode is enabled. These are simulated funds for paper trading.",
|
|
338
|
+
networkTooltipDescription: "Funds are stored across networks. We handle routing automatically, but keeping funds on the right network enables faster trades and lower fees. When depositing, you can choose your preferred network."
|
|
339
|
+
},
|
|
333
340
|
activity: {
|
|
334
341
|
depositType: "Deposit",
|
|
335
342
|
redeemType: "Claim",
|
|
@@ -994,7 +1001,10 @@ var defaultAggUiConfig = {
|
|
|
994
1001
|
}
|
|
995
1002
|
},
|
|
996
1003
|
formatting: defaultFormatters,
|
|
997
|
-
search: defaultAggUiSearchConfig
|
|
1004
|
+
search: defaultAggUiSearchConfig,
|
|
1005
|
+
trading: {
|
|
1006
|
+
executionMode: "live"
|
|
1007
|
+
}
|
|
998
1008
|
};
|
|
999
1009
|
|
|
1000
1010
|
// src/core/providers/contexts.ts
|
|
@@ -1028,7 +1038,7 @@ var balanceQueryKeys = {
|
|
|
1028
1038
|
execution: () => executionKeys.balances(),
|
|
1029
1039
|
// Kept as an alias for backward compatibility with existing callers.
|
|
1030
1040
|
// The balance provider now uses the same canonical execution balances key.
|
|
1031
|
-
provider: () => executionKeys.balances(),
|
|
1041
|
+
provider: (mode) => executionKeys.balances(mode),
|
|
1032
1042
|
venue: (venuesKey) => ["venue-balances", venuesKey],
|
|
1033
1043
|
venuePrefix: () => ["venue-balances"]
|
|
1034
1044
|
};
|
package/dist/withdraw.mjs
CHANGED
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
useWithdrawFlow,
|
|
4
4
|
useWithdrawPreview,
|
|
5
5
|
useWithdrawalLifecycle
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5P53A3NQ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useDepositAddresses,
|
|
9
9
|
useManagedBalances,
|
|
10
10
|
useWithdrawManaged
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FYEPQHKO.mjs";
|
|
12
12
|
export {
|
|
13
13
|
useDepositAddresses,
|
|
14
14
|
useManagedBalances,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agg-build/hooks",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "React hooks and providers for the AGG prediction market aggregator. Wraps @agg-build/sdk with TanStack Query, shared session state, and live WebSocket data.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|