@agg-build/hooks 2.4.4 → 2.4.6
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-KVMLKTGS.mjs → chunk-4IRZFXAC.mjs} +1 -1
- package/dist/{chunk-STOMNDHO.mjs → chunk-CAG2RCHR.mjs} +34 -0
- package/dist/{chunk-RMGSLCL3.mjs → chunk-X32MRBHC.mjs} +1 -1
- package/dist/deposit.js +2 -0
- package/dist/deposit.mjs +2 -2
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +34 -0
- package/dist/index.mjs +3 -3
- package/dist/withdraw.js +2 -0
- package/dist/withdraw.mjs +2 -2
- package/package.json +2 -2
|
@@ -63,6 +63,18 @@ var Venue = /* @__PURE__ */ ((Venue2) => {
|
|
|
63
63
|
Venue2["hyperliquid"] = "hyperliquid";
|
|
64
64
|
return Venue2;
|
|
65
65
|
})(Venue || {});
|
|
66
|
+
var ACTIVE_VENUES = [
|
|
67
|
+
"polymarket" /* polymarket */,
|
|
68
|
+
"limitless" /* limitless */,
|
|
69
|
+
"opinion" /* opinion */,
|
|
70
|
+
"predict" /* predict */,
|
|
71
|
+
"probable" /* probable */,
|
|
72
|
+
"myriad" /* myriad */,
|
|
73
|
+
"hyperliquid" /* hyperliquid */
|
|
74
|
+
];
|
|
75
|
+
var INACTIVE_VENUES = ["kalshi" /* kalshi */];
|
|
76
|
+
var ACTIVE_VENUE_SET = new Set(ACTIVE_VENUES);
|
|
77
|
+
var INACTIVE_VENUE_SET = new Set(INACTIVE_VENUES);
|
|
66
78
|
|
|
67
79
|
// ../common/src/enums/market-status.ts
|
|
68
80
|
var MatchStatus = /* @__PURE__ */ ((MatchStatus2) => {
|
|
@@ -688,6 +700,7 @@ var enUsLabels = {
|
|
|
688
700
|
trading: {
|
|
689
701
|
settlementSection: "Settlement",
|
|
690
702
|
settlementDifferencesTitle: "Key differences across venues",
|
|
703
|
+
settlementFullRulesTitle: "Full rules by venue",
|
|
691
704
|
settlementCriticalDifferenceLabel: "Critical",
|
|
692
705
|
settlementValueUnavailable: "Not provided",
|
|
693
706
|
settlementLoading: "Loading settlement",
|
|
@@ -744,6 +757,7 @@ var enUsLabels = {
|
|
|
744
757
|
orderDisabledNoOutcome: "Select an outcome to place an order.",
|
|
745
758
|
orderDisabledNoEvent: "No event selected.",
|
|
746
759
|
insufficientBalance: "Insufficient balance",
|
|
760
|
+
lowLiquidityWarning: "This market has low liquidity, which may impact execution price for larger orders.",
|
|
747
761
|
refreshQuote: "Refresh Quote",
|
|
748
762
|
confirmOrder: "Confirm Order",
|
|
749
763
|
withdrawSubmitted: "Withdrawal submitted",
|
|
@@ -3395,11 +3409,17 @@ var parseAuthCallbackCode = (callbackUrl) => {
|
|
|
3395
3409
|
const resolvedUrl = resolveAuthCallbackUrl(callbackUrl);
|
|
3396
3410
|
return (_a = resolvedUrl == null ? void 0 : resolvedUrl.searchParams.get("code")) != null ? _a : null;
|
|
3397
3411
|
};
|
|
3412
|
+
var parseLinkConfirmToken = (callbackUrl) => {
|
|
3413
|
+
var _a;
|
|
3414
|
+
const resolvedUrl = resolveAuthCallbackUrl(callbackUrl);
|
|
3415
|
+
return (_a = resolvedUrl == null ? void 0 : resolvedUrl.searchParams.get("link_confirm_token")) != null ? _a : null;
|
|
3416
|
+
};
|
|
3398
3417
|
var getAuthCallbackCleanupPath = (callbackUrl) => {
|
|
3399
3418
|
const resolvedUrl = resolveAuthCallbackUrl(callbackUrl);
|
|
3400
3419
|
if (!resolvedUrl) return null;
|
|
3401
3420
|
const params = new URLSearchParams(resolvedUrl.search);
|
|
3402
3421
|
params.delete("code");
|
|
3422
|
+
params.delete("link_confirm_token");
|
|
3403
3423
|
const search = params.toString();
|
|
3404
3424
|
return `${resolvedUrl.pathname}${search ? `?${search}` : ""}`;
|
|
3405
3425
|
};
|
|
@@ -3412,6 +3432,12 @@ var exchangeAuthCallbackCode = (client, callbackUrl) => __async(null, null, func
|
|
|
3412
3432
|
user: result.user
|
|
3413
3433
|
};
|
|
3414
3434
|
});
|
|
3435
|
+
var confirmLinkAccountCallback = (client, callbackUrl) => __async(null, null, function* () {
|
|
3436
|
+
const token = parseLinkConfirmToken(callbackUrl);
|
|
3437
|
+
if (!token) return null;
|
|
3438
|
+
yield client.linkAccountConfirm(token);
|
|
3439
|
+
return { cleanupPath: getAuthCallbackCleanupPath(callbackUrl) };
|
|
3440
|
+
});
|
|
3415
3441
|
var parseAuthCallbackTokens = (callbackUrl) => {
|
|
3416
3442
|
var _a, _b;
|
|
3417
3443
|
const resolvedUrl = resolveAuthCallbackUrl(callbackUrl);
|
|
@@ -3658,6 +3684,14 @@ function AggAuthProvider({ children }) {
|
|
|
3658
3684
|
}
|
|
3659
3685
|
return resolvedUser2;
|
|
3660
3686
|
}
|
|
3687
|
+
const confirmedLink = yield confirmLinkAccountCallback(client, callbackUrl);
|
|
3688
|
+
if (confirmedLink) {
|
|
3689
|
+
const resolvedUser2 = yield refreshCurrentUser(client);
|
|
3690
|
+
if (callbackUrl === void 0) {
|
|
3691
|
+
replaceAuthCallbackUrl(confirmedLink.cleanupPath);
|
|
3692
|
+
}
|
|
3693
|
+
return resolvedUser2;
|
|
3694
|
+
}
|
|
3661
3695
|
const tokens = parseAuthCallbackTokens(callbackUrl);
|
|
3662
3696
|
if (!tokens) return null;
|
|
3663
3697
|
client.setSession(createAuthCallbackSession(tokens));
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useOnWithdrawalLifecycle,
|
|
12
12
|
useSyncBalances,
|
|
13
13
|
useWithdrawManaged
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CAG2RCHR.mjs";
|
|
15
15
|
|
|
16
16
|
// src/withdraw/use-withdraw-flow.ts
|
|
17
17
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
package/dist/deposit.js
CHANGED
|
@@ -625,6 +625,7 @@ var enUsLabels = {
|
|
|
625
625
|
trading: {
|
|
626
626
|
settlementSection: "Settlement",
|
|
627
627
|
settlementDifferencesTitle: "Key differences across venues",
|
|
628
|
+
settlementFullRulesTitle: "Full rules by venue",
|
|
628
629
|
settlementCriticalDifferenceLabel: "Critical",
|
|
629
630
|
settlementValueUnavailable: "Not provided",
|
|
630
631
|
settlementLoading: "Loading settlement",
|
|
@@ -681,6 +682,7 @@ var enUsLabels = {
|
|
|
681
682
|
orderDisabledNoOutcome: "Select an outcome to place an order.",
|
|
682
683
|
orderDisabledNoEvent: "No event selected.",
|
|
683
684
|
insufficientBalance: "Insufficient balance",
|
|
685
|
+
lowLiquidityWarning: "This market has low liquidity, which may impact execution price for larger orders.",
|
|
684
686
|
refreshQuote: "Refresh Quote",
|
|
685
687
|
confirmOrder: "Confirm Order",
|
|
686
688
|
withdrawSubmitted: "Withdrawal submitted",
|
package/dist/deposit.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useRampQuotes,
|
|
3
3
|
useRampSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4IRZFXAC.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__async,
|
|
7
7
|
useAggAuthState,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useDepositAddresses,
|
|
12
12
|
useOptionalAggClient,
|
|
13
13
|
useSyncBalances
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CAG2RCHR.mjs";
|
|
15
15
|
|
|
16
16
|
// src/deposit/normalize-wallet-error.ts
|
|
17
17
|
function normalizeWalletError(error, supportedChains) {
|
package/dist/index.d.mts
CHANGED
|
@@ -290,6 +290,9 @@ type VenueMarket = {
|
|
|
290
290
|
externalIdentifier: string;
|
|
291
291
|
status?: MarketStatus | undefined;
|
|
292
292
|
conditionId?: string | null | undefined;
|
|
293
|
+
description?: string | null | undefined;
|
|
294
|
+
rulesPrimary?: string | null | undefined;
|
|
295
|
+
rulesSecondary?: string | null | undefined;
|
|
293
296
|
venueMarketOutcomes?: {
|
|
294
297
|
id: string;
|
|
295
298
|
/** REMOVED — no longer returned; use GET /midpoints for live prices. */
|
|
@@ -946,6 +949,7 @@ interface AggUiLabels {
|
|
|
946
949
|
trading: {
|
|
947
950
|
settlementSection: string;
|
|
948
951
|
settlementDifferencesTitle: string;
|
|
952
|
+
settlementFullRulesTitle: string;
|
|
949
953
|
settlementCriticalDifferenceLabel: string;
|
|
950
954
|
settlementValueUnavailable: string;
|
|
951
955
|
settlementLoading: string;
|
|
@@ -996,6 +1000,7 @@ interface AggUiLabels {
|
|
|
996
1000
|
orderDisabledNoOutcome: string;
|
|
997
1001
|
orderDisabledNoEvent: string;
|
|
998
1002
|
insufficientBalance: string;
|
|
1003
|
+
lowLiquidityWarning: string;
|
|
999
1004
|
refreshQuote: string;
|
|
1000
1005
|
confirmOrder: string;
|
|
1001
1006
|
withdrawSubmitted: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -290,6 +290,9 @@ type VenueMarket = {
|
|
|
290
290
|
externalIdentifier: string;
|
|
291
291
|
status?: MarketStatus | undefined;
|
|
292
292
|
conditionId?: string | null | undefined;
|
|
293
|
+
description?: string | null | undefined;
|
|
294
|
+
rulesPrimary?: string | null | undefined;
|
|
295
|
+
rulesSecondary?: string | null | undefined;
|
|
293
296
|
venueMarketOutcomes?: {
|
|
294
297
|
id: string;
|
|
295
298
|
/** REMOVED — no longer returned; use GET /midpoints for live prices. */
|
|
@@ -946,6 +949,7 @@ interface AggUiLabels {
|
|
|
946
949
|
trading: {
|
|
947
950
|
settlementSection: string;
|
|
948
951
|
settlementDifferencesTitle: string;
|
|
952
|
+
settlementFullRulesTitle: string;
|
|
949
953
|
settlementCriticalDifferenceLabel: string;
|
|
950
954
|
settlementValueUnavailable: string;
|
|
951
955
|
settlementLoading: string;
|
|
@@ -996,6 +1000,7 @@ interface AggUiLabels {
|
|
|
996
1000
|
orderDisabledNoOutcome: string;
|
|
997
1001
|
orderDisabledNoEvent: string;
|
|
998
1002
|
insufficientBalance: string;
|
|
1003
|
+
lowLiquidityWarning: string;
|
|
999
1004
|
refreshQuote: string;
|
|
1000
1005
|
confirmOrder: string;
|
|
1001
1006
|
withdrawSubmitted: string;
|
package/dist/index.js
CHANGED
|
@@ -225,6 +225,18 @@ var Venue = /* @__PURE__ */ ((Venue2) => {
|
|
|
225
225
|
Venue2["hyperliquid"] = "hyperliquid";
|
|
226
226
|
return Venue2;
|
|
227
227
|
})(Venue || {});
|
|
228
|
+
var ACTIVE_VENUES = [
|
|
229
|
+
"polymarket" /* polymarket */,
|
|
230
|
+
"limitless" /* limitless */,
|
|
231
|
+
"opinion" /* opinion */,
|
|
232
|
+
"predict" /* predict */,
|
|
233
|
+
"probable" /* probable */,
|
|
234
|
+
"myriad" /* myriad */,
|
|
235
|
+
"hyperliquid" /* hyperliquid */
|
|
236
|
+
];
|
|
237
|
+
var INACTIVE_VENUES = ["kalshi" /* kalshi */];
|
|
238
|
+
var ACTIVE_VENUE_SET = new Set(ACTIVE_VENUES);
|
|
239
|
+
var INACTIVE_VENUE_SET = new Set(INACTIVE_VENUES);
|
|
228
240
|
|
|
229
241
|
// ../common/src/enums/market-status.ts
|
|
230
242
|
var MatchStatus = /* @__PURE__ */ ((MatchStatus2) => {
|
|
@@ -437,11 +449,17 @@ var parseAuthCallbackCode = (callbackUrl) => {
|
|
|
437
449
|
const resolvedUrl = resolveAuthCallbackUrl(callbackUrl);
|
|
438
450
|
return (_a = resolvedUrl == null ? void 0 : resolvedUrl.searchParams.get("code")) != null ? _a : null;
|
|
439
451
|
};
|
|
452
|
+
var parseLinkConfirmToken = (callbackUrl) => {
|
|
453
|
+
var _a;
|
|
454
|
+
const resolvedUrl = resolveAuthCallbackUrl(callbackUrl);
|
|
455
|
+
return (_a = resolvedUrl == null ? void 0 : resolvedUrl.searchParams.get("link_confirm_token")) != null ? _a : null;
|
|
456
|
+
};
|
|
440
457
|
var getAuthCallbackCleanupPath = (callbackUrl) => {
|
|
441
458
|
const resolvedUrl = resolveAuthCallbackUrl(callbackUrl);
|
|
442
459
|
if (!resolvedUrl) return null;
|
|
443
460
|
const params = new URLSearchParams(resolvedUrl.search);
|
|
444
461
|
params.delete("code");
|
|
462
|
+
params.delete("link_confirm_token");
|
|
445
463
|
const search = params.toString();
|
|
446
464
|
return `${resolvedUrl.pathname}${search ? `?${search}` : ""}`;
|
|
447
465
|
};
|
|
@@ -454,6 +472,12 @@ var exchangeAuthCallbackCode = (client, callbackUrl) => __async(null, null, func
|
|
|
454
472
|
user: result.user
|
|
455
473
|
};
|
|
456
474
|
});
|
|
475
|
+
var confirmLinkAccountCallback = (client, callbackUrl) => __async(null, null, function* () {
|
|
476
|
+
const token = parseLinkConfirmToken(callbackUrl);
|
|
477
|
+
if (!token) return null;
|
|
478
|
+
yield client.linkAccountConfirm(token);
|
|
479
|
+
return { cleanupPath: getAuthCallbackCleanupPath(callbackUrl) };
|
|
480
|
+
});
|
|
457
481
|
var parseAuthCallbackTokens = (callbackUrl) => {
|
|
458
482
|
var _a, _b;
|
|
459
483
|
const resolvedUrl = resolveAuthCallbackUrl(callbackUrl);
|
|
@@ -1010,6 +1034,7 @@ var enUsLabels = {
|
|
|
1010
1034
|
trading: {
|
|
1011
1035
|
settlementSection: "Settlement",
|
|
1012
1036
|
settlementDifferencesTitle: "Key differences across venues",
|
|
1037
|
+
settlementFullRulesTitle: "Full rules by venue",
|
|
1013
1038
|
settlementCriticalDifferenceLabel: "Critical",
|
|
1014
1039
|
settlementValueUnavailable: "Not provided",
|
|
1015
1040
|
settlementLoading: "Loading settlement",
|
|
@@ -1066,6 +1091,7 @@ var enUsLabels = {
|
|
|
1066
1091
|
orderDisabledNoOutcome: "Select an outcome to place an order.",
|
|
1067
1092
|
orderDisabledNoEvent: "No event selected.",
|
|
1068
1093
|
insufficientBalance: "Insufficient balance",
|
|
1094
|
+
lowLiquidityWarning: "This market has low liquidity, which may impact execution price for larger orders.",
|
|
1069
1095
|
refreshQuote: "Refresh Quote",
|
|
1070
1096
|
confirmOrder: "Confirm Order",
|
|
1071
1097
|
withdrawSubmitted: "Withdrawal submitted",
|
|
@@ -1779,6 +1805,14 @@ function AggAuthProvider({ children }) {
|
|
|
1779
1805
|
}
|
|
1780
1806
|
return resolvedUser2;
|
|
1781
1807
|
}
|
|
1808
|
+
const confirmedLink = yield confirmLinkAccountCallback(client, callbackUrl);
|
|
1809
|
+
if (confirmedLink) {
|
|
1810
|
+
const resolvedUser2 = yield refreshCurrentUser(client);
|
|
1811
|
+
if (callbackUrl === void 0) {
|
|
1812
|
+
replaceAuthCallbackUrl(confirmedLink.cleanupPath);
|
|
1813
|
+
}
|
|
1814
|
+
return resolvedUser2;
|
|
1815
|
+
}
|
|
1782
1816
|
const tokens = parseAuthCallbackTokens(callbackUrl);
|
|
1783
1817
|
if (!tokens) return null;
|
|
1784
1818
|
client.setSession(createAuthCallbackSession(tokens));
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useRampQuotes,
|
|
3
3
|
useRampSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4IRZFXAC.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useWithdrawEstimate,
|
|
7
7
|
useWithdrawFlow,
|
|
8
8
|
useWithdrawPreview,
|
|
9
9
|
useWithdrawalLifecycle
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-X32MRBHC.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-CAG2RCHR.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
|
@@ -555,6 +555,7 @@ var enUsLabels = {
|
|
|
555
555
|
trading: {
|
|
556
556
|
settlementSection: "Settlement",
|
|
557
557
|
settlementDifferencesTitle: "Key differences across venues",
|
|
558
|
+
settlementFullRulesTitle: "Full rules by venue",
|
|
558
559
|
settlementCriticalDifferenceLabel: "Critical",
|
|
559
560
|
settlementValueUnavailable: "Not provided",
|
|
560
561
|
settlementLoading: "Loading settlement",
|
|
@@ -611,6 +612,7 @@ var enUsLabels = {
|
|
|
611
612
|
orderDisabledNoOutcome: "Select an outcome to place an order.",
|
|
612
613
|
orderDisabledNoEvent: "No event selected.",
|
|
613
614
|
insufficientBalance: "Insufficient balance",
|
|
615
|
+
lowLiquidityWarning: "This market has low liquidity, which may impact execution price for larger orders.",
|
|
614
616
|
refreshQuote: "Refresh Quote",
|
|
615
617
|
confirmOrder: "Confirm Order",
|
|
616
618
|
withdrawSubmitted: "Withdrawal submitted",
|
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-X32MRBHC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useDepositAddresses,
|
|
9
9
|
useManagedBalances,
|
|
10
10
|
useWithdrawManaged
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CAG2RCHR.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.4.
|
|
3
|
+
"version": "2.4.6",
|
|
4
4
|
"description": "React hooks and providers for the AGG prediction market aggregator. Wraps @agg-build/sdk with TanStack Query, shared session state, and live WebSocket data.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"react": "^18.0.0 || ^19.0.0",
|
|
84
84
|
"viem": "^2.0.0",
|
|
85
85
|
"wagmi": "^3.0.0 || ^2.0.0",
|
|
86
|
-
"@agg-build/sdk": "^2.
|
|
86
|
+
"@agg-build/sdk": "^2.4.6"
|
|
87
87
|
},
|
|
88
88
|
"peerDependenciesMeta": {
|
|
89
89
|
"@solana/wallet-adapter-react": {
|