@agg-build/hooks 4.16.0 → 4.17.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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __async,
3
3
  useAggClient
4
- } from "./chunk-7J4DFAKD.mjs";
4
+ } from "./chunk-KQ5TOPNY.mjs";
5
5
 
6
6
  // src/use-ramp-quotes.ts
7
7
  import { useMutation } from "@tanstack/react-query";
@@ -11,7 +11,7 @@ import {
11
11
  useOnWithdrawalLifecycle,
12
12
  useSyncBalances,
13
13
  useWithdrawManaged
14
- } from "./chunk-7J4DFAKD.mjs";
14
+ } from "./chunk-KQ5TOPNY.mjs";
15
15
 
16
16
  // src/withdraw/use-withdraw-flow.ts
17
17
  import { useCallback, useEffect, useMemo, useState } from "react";
@@ -545,7 +545,7 @@ var enUsLabels = {
545
545
  activity: "Activity"
546
546
  },
547
547
  balance: {
548
- availableBalance: "Withdrawable Balance",
548
+ availableBalance: "Balance",
549
549
  manage: "Manage",
550
550
  reservedForOpenOrders: (amount) => `${amount} reserved for open orders`,
551
551
  positionsValue: "Positions Value",
@@ -641,6 +641,9 @@ var enUsLabels = {
641
641
  filledShort: "Filled",
642
642
  totalShort: "Total",
643
643
  expirationHeader: "Expiration",
644
+ buy: "Buy",
645
+ sell: "Sell",
646
+ nowPrefix: "now",
644
647
  goodTilCanceled: "Good 'til canceled",
645
648
  expired: "Expired",
646
649
  cancel: "Cancel",
@@ -947,7 +950,8 @@ var enUsLabels = {
947
950
  error: "We couldn't confirm your verification."
948
951
  }
949
952
  },
950
- connectKalshi: "Connect to trade Kalshi",
953
+ connectKalshi: "Connect Kalshi to trade",
954
+ requiresKalshiAccount: "Requires Kalshi account",
951
955
  tradingAccessVenues: "Venues",
952
956
  tradingAccessAvailable: "Available",
953
957
  tradingAccessAddKalshiAccount: "Add Kalshi Account",
@@ -1173,11 +1177,6 @@ var enUsLabels = {
1173
1177
  privateKeyLabel: "Private Key",
1174
1178
  privateKeyPlaceholder: "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASC..."
1175
1179
  },
1176
- help: {
1177
- label: "Having trouble?",
1178
- docsLinkLabel: "View Kalshi docs",
1179
- tutorialLinkLabel: "Watch tutorial video"
1180
- },
1181
1180
  actions: {
1182
1181
  cancel: "Cancel",
1183
1182
  verifyConnection: "Verify Connection"
package/dist/deposit.js CHANGED
@@ -459,7 +459,7 @@ var enUsLabels = {
459
459
  activity: "Activity"
460
460
  },
461
461
  balance: {
462
- availableBalance: "Withdrawable Balance",
462
+ availableBalance: "Balance",
463
463
  manage: "Manage",
464
464
  reservedForOpenOrders: (amount) => `${amount} reserved for open orders`,
465
465
  positionsValue: "Positions Value",
@@ -555,6 +555,9 @@ var enUsLabels = {
555
555
  filledShort: "Filled",
556
556
  totalShort: "Total",
557
557
  expirationHeader: "Expiration",
558
+ buy: "Buy",
559
+ sell: "Sell",
560
+ nowPrefix: "now",
558
561
  goodTilCanceled: "Good 'til canceled",
559
562
  expired: "Expired",
560
563
  cancel: "Cancel",
@@ -861,7 +864,8 @@ var enUsLabels = {
861
864
  error: "We couldn't confirm your verification."
862
865
  }
863
866
  },
864
- connectKalshi: "Connect to trade Kalshi",
867
+ connectKalshi: "Connect Kalshi to trade",
868
+ requiresKalshiAccount: "Requires Kalshi account",
865
869
  tradingAccessVenues: "Venues",
866
870
  tradingAccessAvailable: "Available",
867
871
  tradingAccessAddKalshiAccount: "Add Kalshi Account",
@@ -1087,11 +1091,6 @@ var enUsLabels = {
1087
1091
  privateKeyLabel: "Private Key",
1088
1092
  privateKeyPlaceholder: "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASC..."
1089
1093
  },
1090
- help: {
1091
- label: "Having trouble?",
1092
- docsLinkLabel: "View Kalshi docs",
1093
- tutorialLinkLabel: "Watch tutorial video"
1094
- },
1095
1094
  actions: {
1096
1095
  cancel: "Cancel",
1097
1096
  verifyConnection: "Verify Connection"
package/dist/deposit.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  useRampQuotes,
3
3
  useRampSession
4
- } from "./chunk-O5D5ISR3.mjs";
4
+ } from "./chunk-BBAKQDOH.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-7J4DFAKD.mjs";
14
+ } from "./chunk-KQ5TOPNY.mjs";
15
15
 
16
16
  // src/deposit/normalize-wallet-error.ts
17
17
  function normalizeWalletError(error, supportedChains) {
package/dist/index.d.mts CHANGED
@@ -250,6 +250,51 @@ type OrderListItem = {
250
250
  * or a venue-specific tag.
251
251
  */
252
252
  partialFillReason: string | null;
253
+ /**
254
+ * Fee breakdown. Optional so paper-trading orders, which have no venue
255
+ * fees, no bridges and no app-fee charge, stay valid without fabricating
256
+ * a zeroed breakdown that would read as "this trade was free".
257
+ *
258
+ * `quoted` is what the route promised at accept time; `actual` is money
259
+ * that moved. `actual.appFee` and `actual.bridge` are TRADE-level and
260
+ * shared by every order under one `actual.dagRunId` — group by it before
261
+ * summing. `quoted.venueFeeRaw` and `actual.venueFeeRaw` are per-leg.
262
+ */
263
+ fees?: {
264
+ /**
265
+ * How the venue charges: `"fill"`, `"fill_in_game_only"`,
266
+ * `"winnings"`, `"exit"`, or null when the schedule cannot be
267
+ * expressed as a rate. Decides what the venue-fee figures mean.
268
+ */
269
+ venueFeeBasis: string | null;
270
+ quoted: {
271
+ /** 6-dec USD atoms. Null when the router emitted no fee for this leg. */
272
+ venueFeeRaw: string | null;
273
+ /** Worst-case partner fee if the route fills 100%. */
274
+ appFeeRaw: string | null;
275
+ appFeeBips: number | null;
276
+ };
277
+ actual: {
278
+ /** Null until the order reaches a DAG run. */
279
+ dagRunId: string | null;
280
+ /** Venue-reported fee, 6-dec USD atoms. Null = unknown, never free. */
281
+ venueFeeRaw: string | null;
282
+ appFee: {
283
+ bips: number;
284
+ /** floor(filled × bips / 10_000). */
285
+ dueRaw: string;
286
+ /** Below `dueRaw` on `under_collected`, "0" on skips. */
287
+ collectedRaw: string;
288
+ status: string;
289
+ } | null;
290
+ bridge: {
291
+ relayFeeUsd: string | null;
292
+ originGasCostUsd: string | null;
293
+ operationCount: number;
294
+ pricedOperationCount: number;
295
+ } | null;
296
+ };
297
+ } | undefined;
253
298
  txHash: string | null;
254
299
  errorMessage: string | null;
255
300
  dagRunId: string | null;
@@ -966,6 +1011,9 @@ interface AggUiLabels {
966
1011
  filledShort: string;
967
1012
  totalShort: string;
968
1013
  expirationHeader: string;
1014
+ buy: string;
1015
+ sell: string;
1016
+ nowPrefix: string;
969
1017
  goodTilCanceled: string;
970
1018
  expired: string;
971
1019
  cancel: string;
@@ -1305,6 +1353,8 @@ interface AggUiLabels {
1305
1353
  };
1306
1354
  };
1307
1355
  connectKalshi: string;
1356
+ /** Route card hint when Kalshi is quoted but the user has no Kalshi account connected. */
1357
+ requiresKalshiAccount: string;
1308
1358
  tradingAccessVenues: string;
1309
1359
  tradingAccessAvailable: string;
1310
1360
  tradingAccessAddKalshiAccount: string;
@@ -1511,11 +1561,6 @@ interface AggUiLabels {
1511
1561
  privateKeyLabel: string;
1512
1562
  privateKeyPlaceholder: string;
1513
1563
  };
1514
- help: {
1515
- label: string;
1516
- docsLinkLabel: string;
1517
- tutorialLinkLabel: string;
1518
- };
1519
1564
  actions: {
1520
1565
  cancel: string;
1521
1566
  verifyConnection: string;
package/dist/index.d.ts CHANGED
@@ -250,6 +250,51 @@ type OrderListItem = {
250
250
  * or a venue-specific tag.
251
251
  */
252
252
  partialFillReason: string | null;
253
+ /**
254
+ * Fee breakdown. Optional so paper-trading orders, which have no venue
255
+ * fees, no bridges and no app-fee charge, stay valid without fabricating
256
+ * a zeroed breakdown that would read as "this trade was free".
257
+ *
258
+ * `quoted` is what the route promised at accept time; `actual` is money
259
+ * that moved. `actual.appFee` and `actual.bridge` are TRADE-level and
260
+ * shared by every order under one `actual.dagRunId` — group by it before
261
+ * summing. `quoted.venueFeeRaw` and `actual.venueFeeRaw` are per-leg.
262
+ */
263
+ fees?: {
264
+ /**
265
+ * How the venue charges: `"fill"`, `"fill_in_game_only"`,
266
+ * `"winnings"`, `"exit"`, or null when the schedule cannot be
267
+ * expressed as a rate. Decides what the venue-fee figures mean.
268
+ */
269
+ venueFeeBasis: string | null;
270
+ quoted: {
271
+ /** 6-dec USD atoms. Null when the router emitted no fee for this leg. */
272
+ venueFeeRaw: string | null;
273
+ /** Worst-case partner fee if the route fills 100%. */
274
+ appFeeRaw: string | null;
275
+ appFeeBips: number | null;
276
+ };
277
+ actual: {
278
+ /** Null until the order reaches a DAG run. */
279
+ dagRunId: string | null;
280
+ /** Venue-reported fee, 6-dec USD atoms. Null = unknown, never free. */
281
+ venueFeeRaw: string | null;
282
+ appFee: {
283
+ bips: number;
284
+ /** floor(filled × bips / 10_000). */
285
+ dueRaw: string;
286
+ /** Below `dueRaw` on `under_collected`, "0" on skips. */
287
+ collectedRaw: string;
288
+ status: string;
289
+ } | null;
290
+ bridge: {
291
+ relayFeeUsd: string | null;
292
+ originGasCostUsd: string | null;
293
+ operationCount: number;
294
+ pricedOperationCount: number;
295
+ } | null;
296
+ };
297
+ } | undefined;
253
298
  txHash: string | null;
254
299
  errorMessage: string | null;
255
300
  dagRunId: string | null;
@@ -966,6 +1011,9 @@ interface AggUiLabels {
966
1011
  filledShort: string;
967
1012
  totalShort: string;
968
1013
  expirationHeader: string;
1014
+ buy: string;
1015
+ sell: string;
1016
+ nowPrefix: string;
969
1017
  goodTilCanceled: string;
970
1018
  expired: string;
971
1019
  cancel: string;
@@ -1305,6 +1353,8 @@ interface AggUiLabels {
1305
1353
  };
1306
1354
  };
1307
1355
  connectKalshi: string;
1356
+ /** Route card hint when Kalshi is quoted but the user has no Kalshi account connected. */
1357
+ requiresKalshiAccount: string;
1308
1358
  tradingAccessVenues: string;
1309
1359
  tradingAccessAvailable: string;
1310
1360
  tradingAccessAddKalshiAccount: string;
@@ -1511,11 +1561,6 @@ interface AggUiLabels {
1511
1561
  privateKeyLabel: string;
1512
1562
  privateKeyPlaceholder: string;
1513
1563
  };
1514
- help: {
1515
- label: string;
1516
- docsLinkLabel: string;
1517
- tutorialLinkLabel: string;
1518
- };
1519
1564
  actions: {
1520
1565
  cancel: string;
1521
1566
  verifyConnection: string;
package/dist/index.js CHANGED
@@ -902,7 +902,7 @@ var enUsLabels = {
902
902
  activity: "Activity"
903
903
  },
904
904
  balance: {
905
- availableBalance: "Withdrawable Balance",
905
+ availableBalance: "Balance",
906
906
  manage: "Manage",
907
907
  reservedForOpenOrders: (amount) => `${amount} reserved for open orders`,
908
908
  positionsValue: "Positions Value",
@@ -998,6 +998,9 @@ var enUsLabels = {
998
998
  filledShort: "Filled",
999
999
  totalShort: "Total",
1000
1000
  expirationHeader: "Expiration",
1001
+ buy: "Buy",
1002
+ sell: "Sell",
1003
+ nowPrefix: "now",
1001
1004
  goodTilCanceled: "Good 'til canceled",
1002
1005
  expired: "Expired",
1003
1006
  cancel: "Cancel",
@@ -1304,7 +1307,8 @@ var enUsLabels = {
1304
1307
  error: "We couldn't confirm your verification."
1305
1308
  }
1306
1309
  },
1307
- connectKalshi: "Connect to trade Kalshi",
1310
+ connectKalshi: "Connect Kalshi to trade",
1311
+ requiresKalshiAccount: "Requires Kalshi account",
1308
1312
  tradingAccessVenues: "Venues",
1309
1313
  tradingAccessAvailable: "Available",
1310
1314
  tradingAccessAddKalshiAccount: "Add Kalshi Account",
@@ -1530,11 +1534,6 @@ var enUsLabels = {
1530
1534
  privateKeyLabel: "Private Key",
1531
1535
  privateKeyPlaceholder: "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASC..."
1532
1536
  },
1533
- help: {
1534
- label: "Having trouble?",
1535
- docsLinkLabel: "View Kalshi docs",
1536
- tutorialLinkLabel: "Watch tutorial video"
1537
- },
1538
1537
  actions: {
1539
1538
  cancel: "Cancel",
1540
1539
  verifyConnection: "Verify Connection"
@@ -8788,22 +8787,28 @@ var RECURRING_MARKET_STATUSES = [
8788
8787
  var RECURRING_DURATION_MS = {
8789
8788
  PT5M: 5 * 6e4,
8790
8789
  PT15M: 15 * 6e4,
8790
+ PT30M: 30 * 6e4,
8791
8791
  PT1H: 60 * 6e4,
8792
+ PT4H: 4 * 60 * 6e4,
8792
8793
  P1D: 24 * 60 * 6e4
8793
8794
  };
8794
8795
  var RECURRING_SLUG_DURATION = {
8795
8796
  "5m": "PT5M",
8796
8797
  "15m": "PT15M",
8798
+ "30m": "PT30M",
8797
8799
  "1h": "PT1H",
8800
+ "4h": "PT4H",
8798
8801
  "1d": "P1D"
8799
8802
  };
8800
8803
  var RECURRING_DURATION_AGG_KEY_SEGMENT = {
8801
8804
  PT5M: "5m",
8802
8805
  PT15M: "15m",
8803
- PT1H: "1h"
8806
+ PT30M: "30m",
8807
+ PT1H: "1h",
8808
+ PT4H: "4h"
8804
8809
  };
8805
- var RECURRING_CRYPTO_SLUG_PATTERN = /^([a-z0-9]+)-updown-(5m|15m|1h|1d)-(\d+)$/i;
8806
- var RECURRING_CRYPTO_AGG_KEY_PATTERN = /^agg_ud_([a-z0-9]+)_(5m|15m|1h)_(\d{2})(\d{2})(\d{2})T(\d{2})(\d{2})$/i;
8810
+ var RECURRING_CRYPTO_SLUG_PATTERN = /^([a-z0-9]+)-updown-(5m|15m|30m|1h|4h|1d)-(\d+)$/i;
8811
+ var RECURRING_CRYPTO_AGG_KEY_PATTERN = /^agg_ud_([a-z0-9]+)_(5m|15m|30m|1h|4h)_(\d{2})(\d{2})(\d{2})T(\d{2})(\d{2})$/i;
8807
8812
  var RECURRING_CRYPTO_DAILY_AGG_KEY_PATTERN = /^agg_ud_([a-z0-9]+)_1d_(\d{2})(\d{2})(\d{2})$/i;
8808
8813
  var isRecurringCryptoDuration = (value) => value != null && Object.prototype.hasOwnProperty.call(RECURRING_DURATION_MS, value);
8809
8814
  var parseTimestamp = (value) => {
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  useRampQuotes,
3
3
  useRampSession
4
- } from "./chunk-O5D5ISR3.mjs";
4
+ } from "./chunk-BBAKQDOH.mjs";
5
5
  import {
6
6
  useWithdrawEstimate,
7
7
  useWithdrawFlow,
8
8
  useWithdrawPreview,
9
9
  useWithdrawalLifecycle
10
- } from "./chunk-FX7UHERV.mjs";
10
+ } from "./chunk-IVUHIMRY.mjs";
11
11
  import {
12
12
  AggAuthContext,
13
13
  AggBalanceProvider,
@@ -101,7 +101,7 @@ import {
101
101
  useSyncBalances,
102
102
  useWithdrawManaged,
103
103
  userActivityQueryKeys
104
- } from "./chunk-7J4DFAKD.mjs";
104
+ } from "./chunk-KQ5TOPNY.mjs";
105
105
 
106
106
  // src/index.ts
107
107
  import { QueryClient as QueryClient4, QueryClientProvider, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
@@ -2789,22 +2789,28 @@ var RECURRING_MARKET_STATUSES = [
2789
2789
  var RECURRING_DURATION_MS = {
2790
2790
  PT5M: 5 * 6e4,
2791
2791
  PT15M: 15 * 6e4,
2792
+ PT30M: 30 * 6e4,
2792
2793
  PT1H: 60 * 6e4,
2794
+ PT4H: 4 * 60 * 6e4,
2793
2795
  P1D: 24 * 60 * 6e4
2794
2796
  };
2795
2797
  var RECURRING_SLUG_DURATION = {
2796
2798
  "5m": "PT5M",
2797
2799
  "15m": "PT15M",
2800
+ "30m": "PT30M",
2798
2801
  "1h": "PT1H",
2802
+ "4h": "PT4H",
2799
2803
  "1d": "P1D"
2800
2804
  };
2801
2805
  var RECURRING_DURATION_AGG_KEY_SEGMENT = {
2802
2806
  PT5M: "5m",
2803
2807
  PT15M: "15m",
2804
- PT1H: "1h"
2808
+ PT30M: "30m",
2809
+ PT1H: "1h",
2810
+ PT4H: "4h"
2805
2811
  };
2806
- var RECURRING_CRYPTO_SLUG_PATTERN = /^([a-z0-9]+)-updown-(5m|15m|1h|1d)-(\d+)$/i;
2807
- var RECURRING_CRYPTO_AGG_KEY_PATTERN = /^agg_ud_([a-z0-9]+)_(5m|15m|1h)_(\d{2})(\d{2})(\d{2})T(\d{2})(\d{2})$/i;
2812
+ var RECURRING_CRYPTO_SLUG_PATTERN = /^([a-z0-9]+)-updown-(5m|15m|30m|1h|4h|1d)-(\d+)$/i;
2813
+ var RECURRING_CRYPTO_AGG_KEY_PATTERN = /^agg_ud_([a-z0-9]+)_(5m|15m|30m|1h|4h)_(\d{2})(\d{2})(\d{2})T(\d{2})(\d{2})$/i;
2808
2814
  var RECURRING_CRYPTO_DAILY_AGG_KEY_PATTERN = /^agg_ud_([a-z0-9]+)_1d_(\d{2})(\d{2})(\d{2})$/i;
2809
2815
  var isRecurringCryptoDuration = (value) => value != null && Object.prototype.hasOwnProperty.call(RECURRING_DURATION_MS, value);
2810
2816
  var parseTimestamp = (value) => {
package/dist/withdraw.js CHANGED
@@ -389,7 +389,7 @@ var enUsLabels = {
389
389
  activity: "Activity"
390
390
  },
391
391
  balance: {
392
- availableBalance: "Withdrawable Balance",
392
+ availableBalance: "Balance",
393
393
  manage: "Manage",
394
394
  reservedForOpenOrders: (amount) => `${amount} reserved for open orders`,
395
395
  positionsValue: "Positions Value",
@@ -485,6 +485,9 @@ var enUsLabels = {
485
485
  filledShort: "Filled",
486
486
  totalShort: "Total",
487
487
  expirationHeader: "Expiration",
488
+ buy: "Buy",
489
+ sell: "Sell",
490
+ nowPrefix: "now",
488
491
  goodTilCanceled: "Good 'til canceled",
489
492
  expired: "Expired",
490
493
  cancel: "Cancel",
@@ -791,7 +794,8 @@ var enUsLabels = {
791
794
  error: "We couldn't confirm your verification."
792
795
  }
793
796
  },
794
- connectKalshi: "Connect to trade Kalshi",
797
+ connectKalshi: "Connect Kalshi to trade",
798
+ requiresKalshiAccount: "Requires Kalshi account",
795
799
  tradingAccessVenues: "Venues",
796
800
  tradingAccessAvailable: "Available",
797
801
  tradingAccessAddKalshiAccount: "Add Kalshi Account",
@@ -1017,11 +1021,6 @@ var enUsLabels = {
1017
1021
  privateKeyLabel: "Private Key",
1018
1022
  privateKeyPlaceholder: "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASC..."
1019
1023
  },
1020
- help: {
1021
- label: "Having trouble?",
1022
- docsLinkLabel: "View Kalshi docs",
1023
- tutorialLinkLabel: "Watch tutorial video"
1024
- },
1025
1024
  actions: {
1026
1025
  cancel: "Cancel",
1027
1026
  verifyConnection: "Verify Connection"
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-IVUHIMRY.mjs";
7
7
  import {
8
8
  useDepositAddresses,
9
9
  useManagedBalances,
10
10
  useWithdrawManaged
11
- } from "./chunk-7J4DFAKD.mjs";
11
+ } from "./chunk-KQ5TOPNY.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.16.0",
3
+ "version": "4.17.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.16.0"
86
+ "@agg-build/sdk": "^4.17.1"
87
87
  },
88
88
  "peerDependenciesMeta": {
89
89
  "@solana/wallet-adapter-react": {