@agg-build/hooks 4.17.2 → 4.18.2
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-IVUHIMRY.mjs → chunk-5B2F3GMC.mjs} +1 -1
- package/dist/{chunk-KQ5TOPNY.mjs → chunk-ESDA4NZI.mjs} +687 -604
- package/dist/{chunk-BBAKQDOH.mjs → chunk-SBGLJDPJ.mjs} +1 -1
- package/dist/deposit.js +128 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.d.mts +983 -26
- package/dist/index.d.ts +983 -26
- package/dist/index.js +2478 -1283
- package/dist/index.mjs +1487 -387
- package/dist/withdraw.d.mts +5 -0
- package/dist/withdraw.d.ts +5 -0
- package/dist/withdraw.js +132 -5
- package/dist/withdraw.mjs +2 -2
- package/package.json +2 -2
package/dist/withdraw.d.mts
CHANGED
|
@@ -169,6 +169,11 @@ declare function useWithdrawManaged(options?: UseWithdrawManagedOptions): _tanst
|
|
|
169
169
|
interface UseManagedBalancesOptions {
|
|
170
170
|
enabled?: boolean;
|
|
171
171
|
mode?: "live" | "paper";
|
|
172
|
+
/**
|
|
173
|
+
* `"self"` fetches the balances of the wallets linked to this account rather
|
|
174
|
+
* than the managed wallet. Its own query key, so both can be held at once.
|
|
175
|
+
*/
|
|
176
|
+
custody?: "managed" | "self";
|
|
172
177
|
}
|
|
173
178
|
/**
|
|
174
179
|
* Query hook for fetching unified managed wallet balances across all chains.
|
package/dist/withdraw.d.ts
CHANGED
|
@@ -169,6 +169,11 @@ declare function useWithdrawManaged(options?: UseWithdrawManagedOptions): _tanst
|
|
|
169
169
|
interface UseManagedBalancesOptions {
|
|
170
170
|
enabled?: boolean;
|
|
171
171
|
mode?: "live" | "paper";
|
|
172
|
+
/**
|
|
173
|
+
* `"self"` fetches the balances of the wallets linked to this account rather
|
|
174
|
+
* than the managed wallet. Its own query key, so both can be held at once.
|
|
175
|
+
*/
|
|
176
|
+
custody?: "managed" | "self";
|
|
172
177
|
}
|
|
173
178
|
/**
|
|
174
179
|
* Query hook for fetching unified managed wallet balances across all chains.
|
package/dist/withdraw.js
CHANGED
|
@@ -88,6 +88,10 @@ var enUsLabels = {
|
|
|
88
88
|
lineChartAria: "Line chart",
|
|
89
89
|
candlestickChartAria: "Candlestick chart",
|
|
90
90
|
lineChartSeriesSwitchAria: "Chart series switch",
|
|
91
|
+
chartSources: (historyVenue, liquidityVenue) => `History: ${historyVenue} \xB7 Resting liquidity: ${liquidityVenue != null ? liquidityVenue : "all venues"}`,
|
|
92
|
+
chartBidLiquidity: (amount) => `Bid ${amount}`,
|
|
93
|
+
chartAskLiquidity: (amount) => `Ask ${amount}`,
|
|
94
|
+
chartEmpty: "No price history in this range",
|
|
91
95
|
lineChartSeriesOptionAria: (seriesLabel) => `Show ${seriesLabel} series`,
|
|
92
96
|
chartTypeSwitchAria: "Chart type switch",
|
|
93
97
|
lineChartType: "Line",
|
|
@@ -99,12 +103,14 @@ var enUsLabels = {
|
|
|
99
103
|
opinion: "Opinion",
|
|
100
104
|
predict: "Predict",
|
|
101
105
|
pred: "PRED",
|
|
106
|
+
tiprun: "Tip Run",
|
|
102
107
|
limitless: "Limitless",
|
|
103
108
|
probable: "Probable",
|
|
104
109
|
myriad: "Myriad",
|
|
105
110
|
hyperliquid: "Hyperliquid",
|
|
106
111
|
novig: "Novig",
|
|
107
|
-
prophetx: "ProphetX"
|
|
112
|
+
prophetx: "ProphetX",
|
|
113
|
+
betdex: "BETDEX"
|
|
108
114
|
},
|
|
109
115
|
auth: {
|
|
110
116
|
connect: (connectorName) => connectorName ? `Sign in with ${connectorName}` : "Sign in",
|
|
@@ -395,10 +401,74 @@ var enUsLabels = {
|
|
|
395
401
|
positionsValue: "Positions Value",
|
|
396
402
|
kalshiBalance: "Kalshi Balance",
|
|
397
403
|
balanceByNetwork: "Balance by network",
|
|
404
|
+
venueAccount: "Venue account",
|
|
405
|
+
balanceUnavailable: "Balance unavailable",
|
|
398
406
|
paperModeNetwork: "Paper",
|
|
399
407
|
paperModeWarning: "Paper mode is enabled. These are simulated funds for paper trading.",
|
|
400
408
|
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."
|
|
401
409
|
},
|
|
410
|
+
hostedBetdex: {
|
|
411
|
+
deposit: "Deposit USDC",
|
|
412
|
+
depositInstructions: {
|
|
413
|
+
production: "Send USDC on Solana to this BETDEX account address.",
|
|
414
|
+
sandbox: "This is a sandbox account. Use sandbox test funds only."
|
|
415
|
+
},
|
|
416
|
+
depositAddress: "BETDEX Solana deposit address",
|
|
417
|
+
transferUnavailable: "This transfer is temporarily unavailable. Check its status before trying again.",
|
|
418
|
+
withdraw: "Withdraw USDC",
|
|
419
|
+
withdrawalAmount: "Amount (USDC)",
|
|
420
|
+
withdrawalDestination: "Your Solana wallet address",
|
|
421
|
+
withdrawalSubmit: "Withdraw from BETDEX",
|
|
422
|
+
withdrawalCheck: "Check withdrawal",
|
|
423
|
+
withdrawalRetry: "Retry the same withdrawal",
|
|
424
|
+
withdrawalNew: "New withdrawal",
|
|
425
|
+
withdrawalUnknown: "The response was not confirmed. Your request is saved; retrying checks the same withdrawal.",
|
|
426
|
+
withdrawalStatuses: {
|
|
427
|
+
processing: "Withdrawal is processing.",
|
|
428
|
+
confirmed: "Withdrawal confirmed.",
|
|
429
|
+
failed: "Withdrawal failed. Funds are available again.",
|
|
430
|
+
flagged: "Withdrawal needs review. Funds remain reserved.",
|
|
431
|
+
review_required: "Withdrawal needs review. Funds remain reserved."
|
|
432
|
+
},
|
|
433
|
+
title: "BETDEX account",
|
|
434
|
+
description: "USDC held with BETDEX, separate from your connected wallets.",
|
|
435
|
+
sandbox: "Sandbox \xB7 simulated funds",
|
|
436
|
+
createAccount: "Set up BETDEX account",
|
|
437
|
+
checkSetup: "Check account setup",
|
|
438
|
+
provisioning: "Account setup is processing. Check again for confirmation.",
|
|
439
|
+
suspended: "This BETDEX account is suspended.",
|
|
440
|
+
unavailable: "BETDEX balance is temporarily unavailable.",
|
|
441
|
+
provisioningUnavailable: "BETDEX account setup is currently unavailable.",
|
|
442
|
+
total: "Total balance",
|
|
443
|
+
available: "Available to trade",
|
|
444
|
+
reserved: "Reserved for open orders",
|
|
445
|
+
refresh: "Refresh account",
|
|
446
|
+
creationFailed: "We could not confirm account setup. Refresh to check its status before trying again.",
|
|
447
|
+
showActivity: "Show account activity",
|
|
448
|
+
hideActivity: "Hide account activity",
|
|
449
|
+
activityTitle: "BETDEX account activity",
|
|
450
|
+
activityDescription: "Observed ledger entries, not spendable balances or per-order fees. A ledger entry alone does not confirm a withdrawal's completion.",
|
|
451
|
+
activityEmpty: "No account activity on this page.",
|
|
452
|
+
activityUnavailable: "BETDEX account activity is temporarily unavailable.",
|
|
453
|
+
activityPrevious: "Previous activity page",
|
|
454
|
+
activityNext: "Next activity page",
|
|
455
|
+
activityRefresh: "Refresh activity",
|
|
456
|
+
activityCodes: {
|
|
457
|
+
Deposit: "Deposit",
|
|
458
|
+
Withdrawal: "Withdrawal",
|
|
459
|
+
TradeCreation: "Trade created",
|
|
460
|
+
TradeVoid: "Trade voided",
|
|
461
|
+
TradeWin: "Trade payout",
|
|
462
|
+
WalletToWallet: "Wallet transfer",
|
|
463
|
+
Commission: "Commission",
|
|
464
|
+
MarketPositionVoid: "Position voided",
|
|
465
|
+
MarketPositionPayout: "Position payout",
|
|
466
|
+
MarketPositionRefund: "Position refund",
|
|
467
|
+
ManualDebit: "Manual debit",
|
|
468
|
+
ManualCredit: "Manual credit",
|
|
469
|
+
SettlementResidual: "Settlement adjustment"
|
|
470
|
+
}
|
|
471
|
+
},
|
|
402
472
|
activity: {
|
|
403
473
|
depositType: "Deposit",
|
|
404
474
|
redeemType: "Claim",
|
|
@@ -552,6 +622,17 @@ var enUsLabels = {
|
|
|
552
622
|
priceGap: "Price Gap"
|
|
553
623
|
},
|
|
554
624
|
eventItemDetails: {
|
|
625
|
+
chartLegend: "Markets on chart",
|
|
626
|
+
selectChartMarkets: "Select a line above to show its history",
|
|
627
|
+
marketHistoryUnavailable: "History unavailable",
|
|
628
|
+
comparisonSource: (venue) => `${venue} \xB7 Outcome probabilities \xB7 Click a line to show or hide it`,
|
|
629
|
+
comparisonSeriesCount: (shown, total) => `Showing ${shown} of ${total} series`,
|
|
630
|
+
comparisonSeriesPage: (page, total) => `Page ${page} of ${total}`,
|
|
631
|
+
comparisonSeriesBudget: (limit) => `Up to ${limit} series are live at once. Change pages to compare others; your selected outcome stays visible.`,
|
|
632
|
+
comparisonPreviousSeries: "Previous series",
|
|
633
|
+
comparisonNextSeries: "Next series",
|
|
634
|
+
comparisonSelectedSeries: "Selected",
|
|
635
|
+
comparisonHiddenSeries: "Hidden",
|
|
555
636
|
loading: "Loading market details",
|
|
556
637
|
unavailableAria: "Market details unavailable",
|
|
557
638
|
unavailableTitle: "Market details unavailable",
|
|
@@ -657,6 +738,7 @@ var enUsLabels = {
|
|
|
657
738
|
settlementCriticalDifferenceLabel: "Critical",
|
|
658
739
|
settlementValueUnavailable: "Not provided",
|
|
659
740
|
settlementLoading: "Loading settlement",
|
|
741
|
+
settlementDetailsLoadError: "Settlement details could not be loaded.",
|
|
660
742
|
settlementDetailsAria: (venueLabel) => `${venueLabel} settlement details`,
|
|
661
743
|
settlementShowMoreAria: (ctaLabel, venueLabel) => `${ctaLabel} for ${venueLabel}`,
|
|
662
744
|
settlementDescriptionLabel: "Description",
|
|
@@ -678,6 +760,9 @@ var enUsLabels = {
|
|
|
678
760
|
maximumFractionDigits: 2
|
|
679
761
|
})}\xA2 avg. price`,
|
|
680
762
|
balance: (value) => `Balance ${value}`,
|
|
763
|
+
betdexBalance: (value) => `BETDEX balance ${value}`,
|
|
764
|
+
betdexBalanceUnavailable: "BETDEX balance unavailable",
|
|
765
|
+
manageBetdexAccount: "Manage BETDEX account",
|
|
681
766
|
shares: (value) => `${value.toLocaleString("en-US", {
|
|
682
767
|
minimumFractionDigits: Number.isInteger(value) ? 0 : 1,
|
|
683
768
|
maximumFractionDigits: 2
|
|
@@ -795,6 +880,10 @@ var enUsLabels = {
|
|
|
795
880
|
}
|
|
796
881
|
},
|
|
797
882
|
connectKalshi: "Connect Kalshi to trade",
|
|
883
|
+
connectProphetx: "Connect ProphetX to trade",
|
|
884
|
+
manageProphetx: "Manage ProphetX connection",
|
|
885
|
+
prophetxFundingNotice: "Manage funds on ProphetX",
|
|
886
|
+
prophetxSettlementNotice: "This position settles on ProphetX",
|
|
798
887
|
requiresKalshiAccount: "Requires Kalshi account",
|
|
799
888
|
tradingAccessVenues: "Venues",
|
|
800
889
|
tradingAccessAvailable: "Available",
|
|
@@ -843,6 +932,7 @@ var enUsLabels = {
|
|
|
843
932
|
verified: "Verified",
|
|
844
933
|
platformFee: "0% platform fees",
|
|
845
934
|
estimatedFees: "Estimated fees",
|
|
935
|
+
betdexSettlementFeeNotice: "BETDEX charges 1% of net profit per market at settlement, not per fill. The final fee depends on all positions in that market.",
|
|
846
936
|
executionReserve: "Execution reserve",
|
|
847
937
|
executionReserveTooltipAria: "Why funds are reserved",
|
|
848
938
|
executionReserveDescription: "Held for price movement or possible venue charges, not a confirmed fee. Unused funds are returned after execution.",
|
|
@@ -906,6 +996,11 @@ var enUsLabels = {
|
|
|
906
996
|
orderFullyFilled: "Order fully filled",
|
|
907
997
|
orderPartiallyFilled: "Order partially filled",
|
|
908
998
|
orderAveragePrice: (priceLabel) => `avg. ${priceLabel}`,
|
|
999
|
+
orderAmount: "Order amount",
|
|
1000
|
+
orderLimitPrice: (priceLabel) => `limit ${priceLabel}`,
|
|
1001
|
+
limitVenueOrder: (venueLabel) => `${venueLabel} limit order`,
|
|
1002
|
+
limitOrderSubmitting: "Submitting limit order...",
|
|
1003
|
+
limitOrderSubmitted: "Limit order submitted",
|
|
909
1004
|
orderComplete: "Order complete",
|
|
910
1005
|
orderFilledAtPrice: (venueLabel, priceLabel) => `${venueLabel} order filled at ${priceLabel}`,
|
|
911
1006
|
orderFilledAtPriceWithAmount: (venueLabel, priceLabel, amountLabel) => `${venueLabel} order filled at ${priceLabel} (${amountLabel})`,
|
|
@@ -988,6 +1083,22 @@ var enUsLabels = {
|
|
|
988
1083
|
cancel: "Cancel",
|
|
989
1084
|
fallbackError: "Signature declined. Please try again."
|
|
990
1085
|
},
|
|
1086
|
+
connectProphetxModal: {
|
|
1087
|
+
disconnect: "Disconnect ProphetX",
|
|
1088
|
+
disconnecting: "Disconnecting\u2026",
|
|
1089
|
+
disconnectError: "Could not disconnect ProphetX. Finish any open orders and try again.",
|
|
1090
|
+
title: "Connect ProphetX Account",
|
|
1091
|
+
description: "Add your ProphetX access key and secret key to trade with your existing account.",
|
|
1092
|
+
fundingNotice: "Trades use your ProphetX balance. Deposits, withdrawals, and transfers are managed on ProphetX, outside AGG.",
|
|
1093
|
+
instructions: "Create an API key in your ProphetX account settings",
|
|
1094
|
+
accessKey: "Access key",
|
|
1095
|
+
secretKey: "Secret key",
|
|
1096
|
+
verify: "Verify connection",
|
|
1097
|
+
verifying: "Verifying\u2026",
|
|
1098
|
+
error: "Could not connect to ProphetX. Check your credentials and try again.",
|
|
1099
|
+
connected: "Your ProphetX account is connected.",
|
|
1100
|
+
done: "Done"
|
|
1101
|
+
},
|
|
991
1102
|
connectKalshiModal: {
|
|
992
1103
|
ariaLabel: "Connect Kalshi Account",
|
|
993
1104
|
title: "Connect Kalshi Account",
|
|
@@ -1034,6 +1145,20 @@ var enUsLabels = {
|
|
|
1034
1145
|
}
|
|
1035
1146
|
},
|
|
1036
1147
|
eventMarketPage: {
|
|
1148
|
+
loadMoreMarkets: "Load more markets",
|
|
1149
|
+
loadingMoreMarkets: "Loading markets\u2026",
|
|
1150
|
+
openOrders: {
|
|
1151
|
+
title: "Open orders",
|
|
1152
|
+
limitPriceHeader: "Limit price",
|
|
1153
|
+
filledHeader: "Filled",
|
|
1154
|
+
totalHeader: "Total",
|
|
1155
|
+
expirationHeader: "Expiration",
|
|
1156
|
+
// Abbreviated forms for the stacked mobile card.
|
|
1157
|
+
limitShort: "Limit",
|
|
1158
|
+
filledShort: "Filled",
|
|
1159
|
+
totalShort: "Tot.",
|
|
1160
|
+
expirationShort: "Exp."
|
|
1161
|
+
},
|
|
1037
1162
|
unavailableAria: "Event market page unavailable",
|
|
1038
1163
|
unavailableTitle: "Something went wrong",
|
|
1039
1164
|
unavailableDescription: "We're having trouble loading this event right now.\nTry refreshing or check back later.",
|
|
@@ -1321,7 +1446,7 @@ var AggBalanceContext = (0, import_react.createContext)(null);
|
|
|
1321
1446
|
// src/execution/query-keys.ts
|
|
1322
1447
|
var executionKeys = {
|
|
1323
1448
|
all: () => ["execution"],
|
|
1324
|
-
balances: (mode) => mode ? ["execution", "balances", mode] : ["execution", "balances"],
|
|
1449
|
+
balances: (mode, custody) => custody && custody !== "managed" ? ["execution", "balances", mode != null ? mode : "live", custody] : mode ? ["execution", "balances", mode] : ["execution", "balances"],
|
|
1325
1450
|
positions: (cursor, limit, status, mode) => mode ? ["execution", "positions", cursor != null ? cursor : null, limit != null ? limit : null, status != null ? status : null, mode] : ["execution", "positions", cursor != null ? cursor : null, limit != null ? limit : null, status != null ? status : null],
|
|
1326
1451
|
positionsPrefix: () => ["execution", "positions"],
|
|
1327
1452
|
claimablePositionsCount: () => ["execution", "positions", "claimable-count"],
|
|
@@ -1367,6 +1492,7 @@ var invalidateBalanceQueries = (queryClient, options) => {
|
|
|
1367
1492
|
queryKey: balanceQueryKeys.venuePrefix(),
|
|
1368
1493
|
refetchType
|
|
1369
1494
|
});
|
|
1495
|
+
queryClient.invalidateQueries({ queryKey: ["agg", "hosted-venue-account"], refetchType });
|
|
1370
1496
|
};
|
|
1371
1497
|
var invalidatePositionQueries = (queryClient, options) => {
|
|
1372
1498
|
var _a;
|
|
@@ -1465,10 +1591,11 @@ function useWithdrawManaged(options) {
|
|
|
1465
1591
|
var import_react_query3 = require("@tanstack/react-query");
|
|
1466
1592
|
function useManagedBalances(options) {
|
|
1467
1593
|
const client = useAggClient();
|
|
1468
|
-
const { enabled = true, mode } = options != null ? options : {};
|
|
1594
|
+
const { enabled = true, mode, custody } = options != null ? options : {};
|
|
1595
|
+
const params = __spreadValues(__spreadValues({}, mode ? { mode } : {}), custody ? { custody } : {});
|
|
1469
1596
|
const query = (0, import_react_query3.useQuery)({
|
|
1470
|
-
queryKey: executionKeys.balances(mode),
|
|
1471
|
-
queryFn: () => client.getManagedBalances(
|
|
1597
|
+
queryKey: executionKeys.balances(mode, custody),
|
|
1598
|
+
queryFn: () => client.getManagedBalances(Object.keys(params).length ? params : void 0),
|
|
1472
1599
|
enabled,
|
|
1473
1600
|
staleTime: 1e4,
|
|
1474
1601
|
// A matched fill can precede settlement and the API's next balance snapshot.
|
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-5B2F3GMC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useDepositAddresses,
|
|
9
9
|
useManagedBalances,
|
|
10
10
|
useWithdrawManaged
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ESDA4NZI.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.18.2",
|
|
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.18.0"
|
|
87
87
|
},
|
|
88
88
|
"peerDependenciesMeta": {
|
|
89
89
|
"@solana/wallet-adapter-react": {
|