@agg-build/hooks 4.16.0 → 4.17.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/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;
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;
package/dist/index.js CHANGED
@@ -8788,22 +8788,28 @@ var RECURRING_MARKET_STATUSES = [
8788
8788
  var RECURRING_DURATION_MS = {
8789
8789
  PT5M: 5 * 6e4,
8790
8790
  PT15M: 15 * 6e4,
8791
+ PT30M: 30 * 6e4,
8791
8792
  PT1H: 60 * 6e4,
8793
+ PT4H: 4 * 60 * 6e4,
8792
8794
  P1D: 24 * 60 * 6e4
8793
8795
  };
8794
8796
  var RECURRING_SLUG_DURATION = {
8795
8797
  "5m": "PT5M",
8796
8798
  "15m": "PT15M",
8799
+ "30m": "PT30M",
8797
8800
  "1h": "PT1H",
8801
+ "4h": "PT4H",
8798
8802
  "1d": "P1D"
8799
8803
  };
8800
8804
  var RECURRING_DURATION_AGG_KEY_SEGMENT = {
8801
8805
  PT5M: "5m",
8802
8806
  PT15M: "15m",
8803
- PT1H: "1h"
8807
+ PT30M: "30m",
8808
+ PT1H: "1h",
8809
+ PT4H: "4h"
8804
8810
  };
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;
8811
+ var RECURRING_CRYPTO_SLUG_PATTERN = /^([a-z0-9]+)-updown-(5m|15m|30m|1h|4h|1d)-(\d+)$/i;
8812
+ 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
8813
  var RECURRING_CRYPTO_DAILY_AGG_KEY_PATTERN = /^agg_ud_([a-z0-9]+)_1d_(\d{2})(\d{2})(\d{2})$/i;
8808
8814
  var isRecurringCryptoDuration = (value) => value != null && Object.prototype.hasOwnProperty.call(RECURRING_DURATION_MS, value);
8809
8815
  var parseTimestamp = (value) => {
package/dist/index.mjs CHANGED
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/hooks",
3
- "version": "4.16.0",
3
+ "version": "4.17.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.16.0"
86
+ "@agg-build/sdk": "^4.17.0"
87
87
  },
88
88
  "peerDependenciesMeta": {
89
89
  "@solana/wallet-adapter-react": {