@agg-build/hooks 4.17.0 → 4.18.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.
@@ -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.
@@ -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",
@@ -389,16 +395,80 @@ var enUsLabels = {
389
395
  activity: "Activity"
390
396
  },
391
397
  balance: {
392
- availableBalance: "Withdrawable Balance",
398
+ availableBalance: "Balance",
393
399
  manage: "Manage",
394
400
  reservedForOpenOrders: (amount) => `${amount} reserved for open orders`,
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",
@@ -485,6 +555,9 @@ var enUsLabels = {
485
555
  filledShort: "Filled",
486
556
  totalShort: "Total",
487
557
  expirationHeader: "Expiration",
558
+ buy: "Buy",
559
+ sell: "Sell",
560
+ nowPrefix: "now",
488
561
  goodTilCanceled: "Good 'til canceled",
489
562
  expired: "Expired",
490
563
  cancel: "Cancel",
@@ -549,6 +622,17 @@ var enUsLabels = {
549
622
  priceGap: "Price Gap"
550
623
  },
551
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",
552
636
  loading: "Loading market details",
553
637
  unavailableAria: "Market details unavailable",
554
638
  unavailableTitle: "Market details unavailable",
@@ -654,6 +738,7 @@ var enUsLabels = {
654
738
  settlementCriticalDifferenceLabel: "Critical",
655
739
  settlementValueUnavailable: "Not provided",
656
740
  settlementLoading: "Loading settlement",
741
+ settlementDetailsLoadError: "Settlement details could not be loaded.",
657
742
  settlementDetailsAria: (venueLabel) => `${venueLabel} settlement details`,
658
743
  settlementShowMoreAria: (ctaLabel, venueLabel) => `${ctaLabel} for ${venueLabel}`,
659
744
  settlementDescriptionLabel: "Description",
@@ -675,6 +760,9 @@ var enUsLabels = {
675
760
  maximumFractionDigits: 2
676
761
  })}\xA2 avg. price`,
677
762
  balance: (value) => `Balance ${value}`,
763
+ betdexBalance: (value) => `BETDEX balance ${value}`,
764
+ betdexBalanceUnavailable: "BETDEX balance unavailable",
765
+ manageBetdexAccount: "Manage BETDEX account",
678
766
  shares: (value) => `${value.toLocaleString("en-US", {
679
767
  minimumFractionDigits: Number.isInteger(value) ? 0 : 1,
680
768
  maximumFractionDigits: 2
@@ -791,7 +879,12 @@ var enUsLabels = {
791
879
  error: "We couldn't confirm your verification."
792
880
  }
793
881
  },
794
- connectKalshi: "Connect to trade Kalshi",
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",
887
+ requiresKalshiAccount: "Requires Kalshi account",
795
888
  tradingAccessVenues: "Venues",
796
889
  tradingAccessAvailable: "Available",
797
890
  tradingAccessAddKalshiAccount: "Add Kalshi Account",
@@ -839,6 +932,7 @@ var enUsLabels = {
839
932
  verified: "Verified",
840
933
  platformFee: "0% platform fees",
841
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.",
842
936
  executionReserve: "Execution reserve",
843
937
  executionReserveTooltipAria: "Why funds are reserved",
844
938
  executionReserveDescription: "Held for price movement or possible venue charges, not a confirmed fee. Unused funds are returned after execution.",
@@ -902,6 +996,11 @@ var enUsLabels = {
902
996
  orderFullyFilled: "Order fully filled",
903
997
  orderPartiallyFilled: "Order partially filled",
904
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",
905
1004
  orderComplete: "Order complete",
906
1005
  orderFilledAtPrice: (venueLabel, priceLabel) => `${venueLabel} order filled at ${priceLabel}`,
907
1006
  orderFilledAtPriceWithAmount: (venueLabel, priceLabel, amountLabel) => `${venueLabel} order filled at ${priceLabel} (${amountLabel})`,
@@ -984,6 +1083,22 @@ var enUsLabels = {
984
1083
  cancel: "Cancel",
985
1084
  fallbackError: "Signature declined. Please try again."
986
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
+ },
987
1102
  connectKalshiModal: {
988
1103
  ariaLabel: "Connect Kalshi Account",
989
1104
  title: "Connect Kalshi Account",
@@ -1017,11 +1132,6 @@ var enUsLabels = {
1017
1132
  privateKeyLabel: "Private Key",
1018
1133
  privateKeyPlaceholder: "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASC..."
1019
1134
  },
1020
- help: {
1021
- label: "Having trouble?",
1022
- docsLinkLabel: "View Kalshi docs",
1023
- tutorialLinkLabel: "Watch tutorial video"
1024
- },
1025
1135
  actions: {
1026
1136
  cancel: "Cancel",
1027
1137
  verifyConnection: "Verify Connection"
@@ -1035,6 +1145,20 @@ var enUsLabels = {
1035
1145
  }
1036
1146
  },
1037
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
+ },
1038
1162
  unavailableAria: "Event market page unavailable",
1039
1163
  unavailableTitle: "Something went wrong",
1040
1164
  unavailableDescription: "We're having trouble loading this event right now.\nTry refreshing or check back later.",
@@ -1322,7 +1446,7 @@ var AggBalanceContext = (0, import_react.createContext)(null);
1322
1446
  // src/execution/query-keys.ts
1323
1447
  var executionKeys = {
1324
1448
  all: () => ["execution"],
1325
- 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"],
1326
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],
1327
1451
  positionsPrefix: () => ["execution", "positions"],
1328
1452
  claimablePositionsCount: () => ["execution", "positions", "claimable-count"],
@@ -1368,6 +1492,7 @@ var invalidateBalanceQueries = (queryClient, options) => {
1368
1492
  queryKey: balanceQueryKeys.venuePrefix(),
1369
1493
  refetchType
1370
1494
  });
1495
+ queryClient.invalidateQueries({ queryKey: ["agg", "hosted-venue-account"], refetchType });
1371
1496
  };
1372
1497
  var invalidatePositionQueries = (queryClient, options) => {
1373
1498
  var _a;
@@ -1466,10 +1591,11 @@ function useWithdrawManaged(options) {
1466
1591
  var import_react_query3 = require("@tanstack/react-query");
1467
1592
  function useManagedBalances(options) {
1468
1593
  const client = useAggClient();
1469
- 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 } : {});
1470
1596
  const query = (0, import_react_query3.useQuery)({
1471
- queryKey: executionKeys.balances(mode),
1472
- queryFn: () => client.getManagedBalances(mode ? { mode } : void 0),
1597
+ queryKey: executionKeys.balances(mode, custody),
1598
+ queryFn: () => client.getManagedBalances(Object.keys(params).length ? params : void 0),
1473
1599
  enabled,
1474
1600
  staleTime: 1e4,
1475
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-FX7UHERV.mjs";
6
+ } from "./chunk-5B2F3GMC.mjs";
7
7
  import {
8
8
  useDepositAddresses,
9
9
  useManagedBalances,
10
10
  useWithdrawManaged
11
- } from "./chunk-7J4DFAKD.mjs";
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.17.0",
3
+ "version": "4.18.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.17.0"
86
+ "@agg-build/sdk": "^4.18.0"
87
87
  },
88
88
  "peerDependenciesMeta": {
89
89
  "@solana/wallet-adapter-react": {