@agg-build/hooks 4.18.0 → 4.19.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 +9 -8
- package/dist/{chunk-ESDA4NZI.mjs → chunk-4TVA4XJ5.mjs} +25 -0
- package/dist/{chunk-SBGLJDPJ.mjs → chunk-H4RVA4SH.mjs} +1 -1
- package/dist/{chunk-5B2F3GMC.mjs → chunk-XETRWNX5.mjs} +1 -1
- package/dist/deposit.js +25 -0
- package/dist/deposit.mjs +2 -2
- package/dist/index.d.mts +278 -2
- package/dist/index.d.ts +278 -2
- package/dist/index.js +175 -69
- package/dist/index.mjs +108 -31
- package/dist/withdraw.js +25 -0
- package/dist/withdraw.mjs +2 -2
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useRampQuotes,
|
|
3
3
|
useRampSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-H4RVA4SH.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useWithdrawEstimate,
|
|
7
7
|
useWithdrawFlow,
|
|
8
8
|
useWithdrawPreview,
|
|
9
9
|
useWithdrawalLifecycle
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XETRWNX5.mjs";
|
|
11
11
|
import {
|
|
12
12
|
AggAuthContext,
|
|
13
13
|
AggBalanceProvider,
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
useSyncBalances,
|
|
99
99
|
useWithdrawManaged,
|
|
100
100
|
userActivityQueryKeys
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-4TVA4XJ5.mjs";
|
|
102
102
|
|
|
103
103
|
// src/index.ts
|
|
104
104
|
import { QueryClient as QueryClient4, QueryClientProvider, useQueryClient as useQueryClient5 } from "@tanstack/react-query";
|
|
@@ -656,6 +656,56 @@ function useUserActivity(options = {}) {
|
|
|
656
656
|
});
|
|
657
657
|
}
|
|
658
658
|
|
|
659
|
+
// src/use-leaderboard.ts
|
|
660
|
+
import { keepPreviousData as keepPreviousData2, useInfiniteQuery as useInfiniteQuery4 } from "@tanstack/react-query";
|
|
661
|
+
var LEADERBOARD_PERIODS = ["1d", "7d", "30d", "all"];
|
|
662
|
+
var utcDayKey = (d) => d.toISOString().slice(0, 10);
|
|
663
|
+
function leaderboardRange(period, now = /* @__PURE__ */ new Date()) {
|
|
664
|
+
if (period === "all") return {};
|
|
665
|
+
const spanDays = period === "1d" ? 0 : period === "7d" ? 6 : 29;
|
|
666
|
+
const from = new Date(
|
|
667
|
+
Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() - spanDays)
|
|
668
|
+
);
|
|
669
|
+
return { from: utcDayKey(from), to: utcDayKey(now) };
|
|
670
|
+
}
|
|
671
|
+
var leaderboardQueryKeys = {
|
|
672
|
+
all: () => ["leaderboard"],
|
|
673
|
+
list: (period, metric, limit) => ["leaderboard", period, metric, limit]
|
|
674
|
+
};
|
|
675
|
+
var LEADERBOARD_STALE_TIME_MS = 6e4;
|
|
676
|
+
function useLeaderboard(options = {}) {
|
|
677
|
+
var _a, _b;
|
|
678
|
+
const client = useAggClient();
|
|
679
|
+
const { period = "30d", metric = "realizedPnl", limit = 50, enabled = true } = options;
|
|
680
|
+
const query = useInfiniteQuery4({
|
|
681
|
+
queryKey: leaderboardQueryKeys.list(period, metric, limit),
|
|
682
|
+
queryFn: ({ pageParam }) => client.getLeaderboard(__spreadProps(__spreadValues({}, leaderboardRange(period)), {
|
|
683
|
+
metric,
|
|
684
|
+
limit,
|
|
685
|
+
cursor: pageParam
|
|
686
|
+
})),
|
|
687
|
+
initialPageParam: void 0,
|
|
688
|
+
getNextPageParam: (lastPage) => {
|
|
689
|
+
var _a2;
|
|
690
|
+
return lastPage.hasMore ? (_a2 = lastPage.nextCursor) != null ? _a2 : void 0 : void 0;
|
|
691
|
+
},
|
|
692
|
+
enabled,
|
|
693
|
+
// Keep the previous list on screen while a period/metric switch loads.
|
|
694
|
+
placeholderData: keepPreviousData2,
|
|
695
|
+
staleTime: LEADERBOARD_STALE_TIME_MS
|
|
696
|
+
});
|
|
697
|
+
const seen = /* @__PURE__ */ new Set();
|
|
698
|
+
const rows = ((_b = (_a = query.data) == null ? void 0 : _a.pages.flatMap((page) => page.data)) != null ? _b : []).filter((row) => {
|
|
699
|
+
if (seen.has(row.userId)) return false;
|
|
700
|
+
seen.add(row.userId);
|
|
701
|
+
return true;
|
|
702
|
+
});
|
|
703
|
+
return __spreadProps(__spreadValues({}, query), {
|
|
704
|
+
rows,
|
|
705
|
+
hasNextPage: !!query.hasNextPage
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
|
|
659
709
|
// src/use-external-id.ts
|
|
660
710
|
import { useCallback as useCallback4, useState as useState3 } from "react";
|
|
661
711
|
function useExternalId(options = {}) {
|
|
@@ -686,12 +736,12 @@ function useExternalId(options = {}) {
|
|
|
686
736
|
}
|
|
687
737
|
|
|
688
738
|
// src/use-execution-positions.ts
|
|
689
|
-
import { useInfiniteQuery as
|
|
739
|
+
import { useInfiniteQuery as useInfiniteQuery5 } from "@tanstack/react-query";
|
|
690
740
|
function useExecutionPositions(options = {}) {
|
|
691
741
|
var _a, _b;
|
|
692
742
|
const client = useAggClient();
|
|
693
743
|
const { limit = 50, status, mode, enabled = true } = options;
|
|
694
|
-
const query =
|
|
744
|
+
const query = useInfiniteQuery5({
|
|
695
745
|
queryKey: executionKeys.positions(null, limit, status != null ? status : null, mode != null ? mode : null),
|
|
696
746
|
queryFn: ({ pageParam }) => client.getExecutionPositions(__spreadProps(__spreadValues({
|
|
697
747
|
limit,
|
|
@@ -722,7 +772,7 @@ import { useMemo as useMemo4 } from "react";
|
|
|
722
772
|
import { mergeCandles, mergeClosedCandles } from "@agg-build/sdk";
|
|
723
773
|
|
|
724
774
|
// src/use-market-chart.ts
|
|
725
|
-
import { keepPreviousData as
|
|
775
|
+
import { keepPreviousData as keepPreviousData3, useQueries as useQueries3, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
726
776
|
|
|
727
777
|
// src/read-retry.ts
|
|
728
778
|
import { isAggApiError } from "@agg-build/sdk";
|
|
@@ -1246,7 +1296,7 @@ function useMarketChartQueries(options) {
|
|
|
1246
1296
|
},
|
|
1247
1297
|
retryDelay: (_attempt, error) => error instanceof ChartDeliveryError && error.retryAfterMs != null ? Math.min(error.state === "warming" ? 1e3 : 5e3, Math.max(0, error.retryAfterMs)) : 1e3
|
|
1248
1298
|
})), {
|
|
1249
|
-
placeholderData:
|
|
1299
|
+
placeholderData: keepPreviousData3,
|
|
1250
1300
|
refetchInterval: (query) => chartRefetchInterval(
|
|
1251
1301
|
query,
|
|
1252
1302
|
refetchIntervalMs != null && refetchIntervalMs > 0 ? refetchIntervalMs : false
|
|
@@ -2317,6 +2367,21 @@ var normalizeVenueMarketIds = (venueMarkets) => {
|
|
|
2317
2367
|
}
|
|
2318
2368
|
return [...ids].sort((left, right) => left.localeCompare(right));
|
|
2319
2369
|
};
|
|
2370
|
+
var EMPTY_MIDPOINTS_POLL_MS = 5e3;
|
|
2371
|
+
var EMPTY_MIDPOINTS_MAX_FETCHES = 12;
|
|
2372
|
+
var hasUsableMidpoint = (item) => {
|
|
2373
|
+
var _a;
|
|
2374
|
+
if (!item) return false;
|
|
2375
|
+
if (item.midpoint != null) return true;
|
|
2376
|
+
return ((_a = item.outcomes) != null ? _a : []).some(
|
|
2377
|
+
(outcome) => outcome.midpoint != null || outcome.bestBid != null || outcome.bestAsk != null
|
|
2378
|
+
);
|
|
2379
|
+
};
|
|
2380
|
+
var isMidpointResponseComplete = (data, primaryVenueMarketIds) => {
|
|
2381
|
+
if (!(data == null ? void 0 : data.data)) return false;
|
|
2382
|
+
const itemByMarketId = new Map(data.data.map((item) => [item.venueMarketId, item]));
|
|
2383
|
+
return primaryVenueMarketIds.every((id) => hasUsableMidpoint(itemByMarketId.get(id)));
|
|
2384
|
+
};
|
|
2320
2385
|
var normalizeOutcomeLabel = (label) => {
|
|
2321
2386
|
return typeof label === "string" ? label.trim().toLowerCase() : "";
|
|
2322
2387
|
};
|
|
@@ -2483,13 +2548,21 @@ function useMidpoints(venueMarkets, options) {
|
|
|
2483
2548
|
() => resolveBestMidpointCandidateOutcomeIds(venueMarkets),
|
|
2484
2549
|
[venueMarkets]
|
|
2485
2550
|
);
|
|
2551
|
+
const primaryVenueMarketIds = useMemo9(
|
|
2552
|
+
() => (venueMarkets != null ? venueMarkets : []).map((market) => market.id).filter(Boolean),
|
|
2553
|
+
[venueMarkets]
|
|
2554
|
+
);
|
|
2486
2555
|
const { data, isLoading } = useQuery6({
|
|
2487
2556
|
queryKey: ["midpoints", ids, maxMidpointIdsPerRequest],
|
|
2488
2557
|
queryFn: () => client.getMidpoints(ids, { bestPrice: true, maxMidpointIdsPerRequest }),
|
|
2489
2558
|
enabled: ids.length > 0,
|
|
2490
|
-
|
|
2559
|
+
// Complete responses stay cached for the session (unchanged behavior).
|
|
2560
|
+
// Incomplete ones are stale, so a remount refetches them and a short,
|
|
2561
|
+
// bounded poll picks up prices once a cold venue book warms.
|
|
2562
|
+
staleTime: (query) => isMidpointResponseComplete(query.state.data, primaryVenueMarketIds) ? Infinity : 0,
|
|
2563
|
+
refetchInterval: (query) => !isMidpointResponseComplete(query.state.data, primaryVenueMarketIds) && query.state.dataUpdateCount < EMPTY_MIDPOINTS_MAX_FETCHES ? EMPTY_MIDPOINTS_POLL_MS : false,
|
|
2491
2564
|
gcTime: 30 * 6e4,
|
|
2492
|
-
refetchOnMount:
|
|
2565
|
+
refetchOnMount: true,
|
|
2493
2566
|
refetchOnWindowFocus: false,
|
|
2494
2567
|
refetchOnReconnect: false
|
|
2495
2568
|
});
|
|
@@ -2690,7 +2763,7 @@ function useArbFeed() {
|
|
|
2690
2763
|
}
|
|
2691
2764
|
|
|
2692
2765
|
// src/use-order-book.ts
|
|
2693
|
-
import { keepPreviousData as
|
|
2766
|
+
import { keepPreviousData as keepPreviousData4, useQuery as useQuery7 } from "@tanstack/react-query";
|
|
2694
2767
|
var fetchBatchBookQuery = (client, venueMarketIds, { signal }) => client.getOrderbooks({ venueMarketIds }, { signal });
|
|
2695
2768
|
var createBatchBookQuery = (client, venueMarketIds) => fetchBatchBookQuery.bind(null, client, venueMarketIds);
|
|
2696
2769
|
function useOrderBook(options) {
|
|
@@ -2713,7 +2786,7 @@ function useOrderBook(options) {
|
|
|
2713
2786
|
gcTime: 5 * 6e4,
|
|
2714
2787
|
refetchOnWindowFocus: false,
|
|
2715
2788
|
retry: 1,
|
|
2716
|
-
placeholderData:
|
|
2789
|
+
placeholderData: keepPreviousData4
|
|
2717
2790
|
});
|
|
2718
2791
|
const data = (() => {
|
|
2719
2792
|
var _a, _b;
|
|
@@ -2768,7 +2841,7 @@ function useOrderBook(options) {
|
|
|
2768
2841
|
}
|
|
2769
2842
|
|
|
2770
2843
|
// src/use-orderbook-quote.ts
|
|
2771
|
-
import { keepPreviousData as
|
|
2844
|
+
import { keepPreviousData as keepPreviousData5, useQuery as useQuery8 } from "@tanstack/react-query";
|
|
2772
2845
|
var QUOTE_DEBOUNCE_MS = 300;
|
|
2773
2846
|
var createUnavailableOrderbookError = (message, code, retryable) => {
|
|
2774
2847
|
const error = new Error(message);
|
|
@@ -2861,7 +2934,7 @@ function useOrderbookQuote(options) {
|
|
|
2861
2934
|
staleTime: 1e4,
|
|
2862
2935
|
gcTime: 5 * 6e4,
|
|
2863
2936
|
retry: 1,
|
|
2864
|
-
placeholderData:
|
|
2937
|
+
placeholderData: keepPreviousData5
|
|
2865
2938
|
});
|
|
2866
2939
|
return {
|
|
2867
2940
|
data: (_a = query.data) != null ? _a : null,
|
|
@@ -2897,8 +2970,8 @@ function useOrders(options = {}) {
|
|
|
2897
2970
|
import {
|
|
2898
2971
|
QueryClient,
|
|
2899
2972
|
QueryClientContext,
|
|
2900
|
-
keepPreviousData as
|
|
2901
|
-
useInfiniteQuery as
|
|
2973
|
+
keepPreviousData as keepPreviousData6,
|
|
2974
|
+
useInfiniteQuery as useInfiniteQuery6
|
|
2902
2975
|
} from "@tanstack/react-query";
|
|
2903
2976
|
import { useContext as useContext2, useEffect as useEffect9, useState as useState6 } from "react";
|
|
2904
2977
|
function useSearch(options) {
|
|
@@ -2939,7 +3012,7 @@ function useSearch(options) {
|
|
|
2939
3012
|
];
|
|
2940
3013
|
const effectiveQueryClient = queryClient != null ? queryClient : fallbackQueryClient;
|
|
2941
3014
|
const retryOptions = withReadRetry(effectiveQueryClient.defaultQueryOptions({ queryKey }));
|
|
2942
|
-
const query =
|
|
3015
|
+
const query = useInfiniteQuery6(
|
|
2943
3016
|
__spreadProps(__spreadValues({
|
|
2944
3017
|
// deep is part of the key — TanStack treats deep vs light as
|
|
2945
3018
|
// independent queries so users can have both modes cached side-by-side.
|
|
@@ -2969,7 +3042,7 @@ function useSearch(options) {
|
|
|
2969
3042
|
if (!lastPage.hasMore) return void 0;
|
|
2970
3043
|
return (_a2 = lastPage.nextCursor) != null ? _a2 : void 0;
|
|
2971
3044
|
},
|
|
2972
|
-
placeholderData:
|
|
3045
|
+
placeholderData: keepPreviousData6
|
|
2973
3046
|
}, retryOptions), {
|
|
2974
3047
|
enabled: isEnabled && !!client
|
|
2975
3048
|
}),
|
|
@@ -3079,7 +3152,7 @@ function useMarketSearch(options) {
|
|
|
3079
3152
|
}
|
|
3080
3153
|
|
|
3081
3154
|
// src/use-smart-route.ts
|
|
3082
|
-
import { keepPreviousData as
|
|
3155
|
+
import { keepPreviousData as keepPreviousData7, useQuery as useQuery10 } from "@tanstack/react-query";
|
|
3083
3156
|
|
|
3084
3157
|
// src/smart-route-refresh-policy.ts
|
|
3085
3158
|
var THIN_SMART_ROUTE_REFETCH_INTERVAL_MS = 5e3;
|
|
@@ -3306,7 +3379,7 @@ function useSmartRoute(options) {
|
|
|
3306
3379
|
// a different amount or position snapshot. Never expose it under a new
|
|
3307
3380
|
// sell key while the replacement request is in flight. BUY retains the
|
|
3308
3381
|
// existing no-flicker behavior.
|
|
3309
|
-
placeholderData: tradeSide === "sell" ? void 0 :
|
|
3382
|
+
placeholderData: tradeSide === "sell" ? void 0 : keepPreviousData7
|
|
3310
3383
|
});
|
|
3311
3384
|
const error = query.error;
|
|
3312
3385
|
let loadingReason = null;
|
|
@@ -3328,7 +3401,7 @@ function useSmartRoute(options) {
|
|
|
3328
3401
|
}
|
|
3329
3402
|
|
|
3330
3403
|
// src/use-limit-order-venue-quotes.ts
|
|
3331
|
-
import { keepPreviousData as
|
|
3404
|
+
import { keepPreviousData as keepPreviousData8, useQueries as useQueries4, useQuery as useQuery11 } from "@tanstack/react-query";
|
|
3332
3405
|
var getIsDocumentVisible2 = () => {
|
|
3333
3406
|
if (typeof document === "undefined") return true;
|
|
3334
3407
|
return document.visibilityState !== "hidden";
|
|
@@ -3424,7 +3497,7 @@ var useLimitOrderVenueQuotes = (options) => {
|
|
|
3424
3497
|
);
|
|
3425
3498
|
}),
|
|
3426
3499
|
enabled: queryEnabled,
|
|
3427
|
-
placeholderData:
|
|
3500
|
+
placeholderData: keepPreviousData8,
|
|
3428
3501
|
staleTime: staleTimeMs,
|
|
3429
3502
|
refetchInterval: (queryState) => {
|
|
3430
3503
|
var _a2, _b2, _c, _d;
|
|
@@ -3589,12 +3662,12 @@ var useVenueSellQuotes = (options) => {
|
|
|
3589
3662
|
};
|
|
3590
3663
|
|
|
3591
3664
|
// src/use-user-holdings.ts
|
|
3592
|
-
import { useInfiniteQuery as
|
|
3665
|
+
import { useInfiniteQuery as useInfiniteQuery7 } from "@tanstack/react-query";
|
|
3593
3666
|
function useUserHoldings(options) {
|
|
3594
3667
|
var _a, _b;
|
|
3595
3668
|
const client = useAggClient();
|
|
3596
3669
|
const { venue, venueMarketId, venueEventId, enabled = true } = options;
|
|
3597
|
-
const query =
|
|
3670
|
+
const query = useInfiniteQuery7({
|
|
3598
3671
|
queryKey: ["user-holdings", venue, venueMarketId, venueEventId],
|
|
3599
3672
|
queryFn: (_0) => __async(null, [_0], function* ({ pageParam }) {
|
|
3600
3673
|
return client.getUserHoldings({
|
|
@@ -4208,7 +4281,7 @@ function useVenueEvent(options) {
|
|
|
4208
4281
|
}
|
|
4209
4282
|
|
|
4210
4283
|
// src/use-venue-markets.ts
|
|
4211
|
-
import { QueryClient as QueryClient2, QueryClientContext as QueryClientContext2, useInfiniteQuery as
|
|
4284
|
+
import { QueryClient as QueryClient2, QueryClientContext as QueryClientContext2, useInfiniteQuery as useInfiniteQuery8 } from "@tanstack/react-query";
|
|
4212
4285
|
import { useContext as useContext3, useEffect as useEffect10, useState as useState8 } from "react";
|
|
4213
4286
|
function useVenueMarkets(options) {
|
|
4214
4287
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
@@ -4241,7 +4314,7 @@ function useVenueMarkets(options) {
|
|
|
4241
4314
|
if (enabled && !client) {
|
|
4242
4315
|
throw new Error("useVenueMarkets must be used within an <AggProvider>");
|
|
4243
4316
|
}
|
|
4244
|
-
const query =
|
|
4317
|
+
const query = useInfiniteQuery8(
|
|
4245
4318
|
{
|
|
4246
4319
|
queryKey: [
|
|
4247
4320
|
"venue-markets",
|
|
@@ -4376,8 +4449,8 @@ function useEnrichedVenueEvent(options) {
|
|
|
4376
4449
|
import {
|
|
4377
4450
|
QueryClient as QueryClient3,
|
|
4378
4451
|
QueryClientContext as QueryClientContext3,
|
|
4379
|
-
keepPreviousData as
|
|
4380
|
-
useInfiniteQuery as
|
|
4452
|
+
keepPreviousData as keepPreviousData9,
|
|
4453
|
+
useInfiniteQuery as useInfiniteQuery9
|
|
4381
4454
|
} from "@tanstack/react-query";
|
|
4382
4455
|
import { useContext as useContext4, useEffect as useEffect11, useMemo as useMemo12, useRef as useRef7, useState as useState9 } from "react";
|
|
4383
4456
|
function useVenueEvents(options) {
|
|
@@ -4411,7 +4484,7 @@ function useVenueEvents(options) {
|
|
|
4411
4484
|
if (enabled && !client) {
|
|
4412
4485
|
throw new Error("useVenueEvents must be used within an <AggProvider>");
|
|
4413
4486
|
}
|
|
4414
|
-
const query =
|
|
4487
|
+
const query = useInfiniteQuery9(
|
|
4415
4488
|
{
|
|
4416
4489
|
queryKey: [
|
|
4417
4490
|
queryKeyScope,
|
|
@@ -4459,7 +4532,7 @@ function useVenueEvents(options) {
|
|
|
4459
4532
|
return (_a2 = lastPage.nextCursor) != null ? _a2 : void 0;
|
|
4460
4533
|
},
|
|
4461
4534
|
// TODO: RMIK - Comment out to show skeletons on category switch
|
|
4462
|
-
placeholderData:
|
|
4535
|
+
placeholderData: keepPreviousData9,
|
|
4463
4536
|
enabled: enabled && !!client
|
|
4464
4537
|
},
|
|
4465
4538
|
queryClient != null ? queryClient : fallbackQueryClient
|
|
@@ -4547,7 +4620,7 @@ var useSportsLive = (eventIds, enabled = true) => {
|
|
|
4547
4620
|
};
|
|
4548
4621
|
|
|
4549
4622
|
// src/use-venue-market-midpoints.ts
|
|
4550
|
-
import { keepPreviousData as
|
|
4623
|
+
import { keepPreviousData as keepPreviousData10, useQuery as useQuery15 } from "@tanstack/react-query";
|
|
4551
4624
|
var normalizeVenueMarketIds2 = (venueMarketIds) => {
|
|
4552
4625
|
return [
|
|
4553
4626
|
...new Set(venueMarketIds.map((venueMarketId) => venueMarketId.trim()).filter(Boolean))
|
|
@@ -4602,7 +4675,7 @@ function useVenueMarketMidpoints(options) {
|
|
|
4602
4675
|
gcTime: 5 * 6e4,
|
|
4603
4676
|
refetchOnWindowFocus: false,
|
|
4604
4677
|
retry: 1,
|
|
4605
|
-
placeholderData:
|
|
4678
|
+
placeholderData: keepPreviousData10
|
|
4606
4679
|
});
|
|
4607
4680
|
const midpointRows = (_d = (_c = query.data) == null ? void 0 : _c.data) != null ? _d : [];
|
|
4608
4681
|
const midpointsByVenueMarketId = mapMidpointsByVenueMarketId(midpointRows);
|
|
@@ -5105,6 +5178,7 @@ export {
|
|
|
5105
5178
|
CONFIRMED_MATCH_STATUSES,
|
|
5106
5179
|
DEFAULT_AGG_ROOT_CLASS_NAME,
|
|
5107
5180
|
EventListStateProvider,
|
|
5181
|
+
LEADERBOARD_PERIODS,
|
|
5108
5182
|
MAX_ORDER_VENUE_MARKET_IDS_PER_REQUEST,
|
|
5109
5183
|
MAX_PRICE_GAP_PCT,
|
|
5110
5184
|
MIN_PRICE_GAP_PCT,
|
|
@@ -5143,6 +5217,8 @@ export {
|
|
|
5143
5217
|
invalidateUserClaimState,
|
|
5144
5218
|
invalidateUserMoneyState,
|
|
5145
5219
|
isVenueDisabledByConfig,
|
|
5220
|
+
leaderboardQueryKeys,
|
|
5221
|
+
leaderboardRange,
|
|
5146
5222
|
mergeBestPricesPreferringLive,
|
|
5147
5223
|
mergeRecurringCryptoWindows,
|
|
5148
5224
|
normalizeVenueId,
|
|
@@ -5203,6 +5279,7 @@ export {
|
|
|
5203
5279
|
useHostedVenueActivity,
|
|
5204
5280
|
useHostedVenueTransfers,
|
|
5205
5281
|
useLabels,
|
|
5282
|
+
useLeaderboard,
|
|
5206
5283
|
useLimitOrderVenueQuotes,
|
|
5207
5284
|
useLinkAccount,
|
|
5208
5285
|
useLiveBestPriceCandidates,
|
package/dist/withdraw.js
CHANGED
|
@@ -670,6 +670,31 @@ var enUsLabels = {
|
|
|
670
670
|
readFullDetails: "Read full details",
|
|
671
671
|
showLess: "Show less"
|
|
672
672
|
},
|
|
673
|
+
leaderboard: {
|
|
674
|
+
title: "Leaderboard",
|
|
675
|
+
subtitle: (appName, periodLabel) => `Top traders${appName ? ` on ${appName}` : ""} \xB7 ${periodLabel} \xB7 updates every 5 minutes`,
|
|
676
|
+
periodLabel: "Period",
|
|
677
|
+
rankByLabel: "Rank by",
|
|
678
|
+
periods: { "1d": "24h", "7d": "7d", "30d": "30d", all: "All time" },
|
|
679
|
+
metrics: { realizedPnl: "Profit & loss", volume: "Volume" },
|
|
680
|
+
columns: {
|
|
681
|
+
rank: "#",
|
|
682
|
+
trader: "Trader",
|
|
683
|
+
orders: "Trades",
|
|
684
|
+
volume: "Volume",
|
|
685
|
+
realizedPnl: "P&L"
|
|
686
|
+
},
|
|
687
|
+
tradesCount: (count) => `${count} ${count === 1 ? "trade" : "trades"}`,
|
|
688
|
+
anonymousTrader: "Anonymous trader",
|
|
689
|
+
you: "You",
|
|
690
|
+
showMore: "Show more traders",
|
|
691
|
+
loadingAria: "Loading leaderboard",
|
|
692
|
+
emptyTitle: "No trades in this period yet",
|
|
693
|
+
emptyDescription: "Rankings appear once traders place orders. Try a longer period or check back later.",
|
|
694
|
+
errorTitle: "Couldn't load the leaderboard",
|
|
695
|
+
errorDescription: "Something went wrong on our side. Try again in a moment.",
|
|
696
|
+
pnlFootnote: "P&L is realized only: sells and settled markets, before fees. Volume counts both buys and sells. Trades are filled orders. Figures refresh every 5 minutes."
|
|
697
|
+
},
|
|
673
698
|
marketDetails: {
|
|
674
699
|
loading: "Loading market details",
|
|
675
700
|
unavailableAria: "Market details unavailable",
|
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-XETRWNX5.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useDepositAddresses,
|
|
9
9
|
useManagedBalances,
|
|
10
10
|
useWithdrawManaged
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4TVA4XJ5.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": "4.
|
|
3
|
+
"version": "4.19.0",
|
|
4
4
|
"description": "React hooks and providers for the AGG prediction market aggregator. Wraps @agg-build/sdk with TanStack Query, shared session state, and live WebSocket data.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"react": "^18.0.0 || ^19.0.0",
|
|
84
84
|
"viem": "^2.0.0",
|
|
85
85
|
"wagmi": "^3.0.0 || ^2.0.0",
|
|
86
|
-
"@agg-build/sdk": "^4.
|
|
86
|
+
"@agg-build/sdk": "^4.19.0"
|
|
87
87
|
},
|
|
88
88
|
"peerDependenciesMeta": {
|
|
89
89
|
"@solana/wallet-adapter-react": {
|