@agg-build/hooks 1.3.0 → 2.0.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
@@ -2,7 +2,7 @@ import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { QueryClient } from '@tanstack/react-query';
3
3
  export { QueryClient, QueryClientProvider, useQueryClient } from '@tanstack/react-query';
4
4
  import * as _agg_build_sdk from '@agg-build/sdk';
5
- import { CandleBuilder, AggAuthStartBody, AggAuthStartResult, AggClientSessionInput, AggClient, RampQuote, RampQuoteRequest, RampWidgetSession, RampSessionRequest, QuoteManagedResponse, QuoteManagedParams, ExecuteManagedResponse, ExecuteManagedParams, GetPositionsParams, WsOrderSubmitted, WsBalanceUpdate, RedeemResponse, RedeemRequest, WsRedeemEvent, AggWebSocket, WsOrderEvent, WsWithdrawalLifecycleEvent, WsCandleInterval, WsTrade, AggregatedOrderbookResponse, AggLinkAccountBody, AggLinkAccountResult, AggLinkAccountConfirmResult, Category, UserActivityQuery, UserActivityItem, PaginatedResponse, CandleInterval, OrderbookState, OrderbookQuoteResponse, OrderListQuery, TradeExecutorOrder, SmartRouteSide, ExecutionMode, SmartRouteResponse, MidpointRow, BatchMidpointsResponse, AppClientConfigResponse } from '@agg-build/sdk';
5
+ import { CandleBuilder, AggAuthStartBody, AggAuthStartResult, AggClientSessionInput, AggClient, RampQuote, RampQuoteRequest, RampWidgetSession, RampSessionRequest, QuoteManagedResponse, QuoteManagedParams, ExecuteManagedResponse, ExecuteManagedParams, GetPositionsParams, WsOrderSubmitted, WsBalanceUpdate, RedeemResponse, RedeemRequest, WsRedeemEvent, AggWebSocket, WsOrderEvent, WsWithdrawalLifecycleEvent, WsCandleInterval, WsTrade, AggregatedOrderbookResponse, AggLinkAccountBody, AggLinkAccountResult, AggLinkAccountConfirmResult, Category, UserActivityQuery, UserActivityItem, PaginatedResponse, CandleInterval, OrderbookState, OrderbookQuoteResponse, OrderListQuery, TradeExecutorOrder, SmartRouteSide, ExecutionMode, SmartRouteResponse, RecurrenceFilter, MidpointRow, BatchMidpointsResponse, AppClientConfigResponse } from '@agg-build/sdk';
6
6
  export { TurnstileChallengeError } from '@agg-build/sdk';
7
7
  import React, { ReactNode } from 'react';
8
8
  export { UseManagedBalancesOptions, UseWithdrawEstimateParams, UseWithdrawFlowOptions, UseWithdrawFlowResult, UseWithdrawManagedOptions, UseWithdrawalLifecycleResult, WithdrawFeeEstimate, WithdrawalLifecycleState, useManagedBalances, useWithdrawEstimate, useWithdrawFlow, useWithdrawManaged, useWithdrawalLifecycle } from './withdraw.mjs';
@@ -69,8 +69,14 @@ declare enum OrderStatus {
69
69
  pending_bridge = "pending_bridge",
70
70
  submitting = "submitting",
71
71
  submitted = "submitted",
72
+ open = "open",
73
+ partially_filled_open = "partially_filled_open",
74
+ cancel_pending = "cancel_pending",
72
75
  filled = "filled",
73
- partial_fill = "partial_fill"
76
+ partial_fill = "partial_fill",
77
+ failed = "failed",
78
+ expired = "expired",
79
+ cancelled = "cancelled"
74
80
  }
75
81
 
76
82
  /**
@@ -106,11 +112,15 @@ type UnifiedBalanceResponse = {
106
112
  cash: {
107
113
  tokenSymbol: string;
108
114
  totalRaw: string;
115
+ availableRaw?: string | undefined;
116
+ reservedRaw?: string | undefined;
109
117
  decimals: number;
110
118
  chains: {
111
119
  chainId: number;
112
120
  tokenAddress: string;
113
121
  balanceRaw: string;
122
+ heldRaw?: string | undefined;
123
+ availableRaw?: string | undefined;
114
124
  decimals: number;
115
125
  lastSyncedAt: string;
116
126
  }[];
@@ -257,6 +267,10 @@ type VenueMarket = {
257
267
  endDate?: string | null | undefined;
258
268
  creationDate?: string | null | undefined;
259
269
  resolutionDate?: string | null | undefined;
270
+ /** Sports market classification for type-aware sorting (moneyline, spread, total, etc.). */
271
+ sportsMarketType?: string | null | undefined;
272
+ /** Sort rank within a sports section (0=moneyline, 1=spread, 2=total, 3+=other). */
273
+ sectionRank?: number | null | undefined;
260
274
  matchedVenueMarkets?: {
261
275
  id: string;
262
276
  venue: Venue;
@@ -316,10 +330,12 @@ type VenueEvent = {
316
330
  /**
317
331
  * ISO-8601 duration denormalized from Series.recurrence. `null` means
318
332
  * the event has no recurring schedule (one-off). Use this value with
319
- * the `?recurrence=` filter on /venue-events; discover all available
320
- * values via GET /recurrences.
333
+ * the `?recurrence=` filter on /venue-events using public recurrence
334
+ * enum values.
321
335
  */
322
336
  recurrence?: string | null | undefined;
337
+ /** Type-aware structure classification used to sort markets under this event. */
338
+ structureType?: "candidate" | "sport" | "axis" | "dates" | null | undefined;
323
339
  };
324
340
  type Orderbook = {
325
341
  bids: {
@@ -4666,8 +4682,8 @@ interface UseVenueEventsOptions {
4666
4682
  sortBy?: string;
4667
4683
  /** Sort direction: "asc" or "desc". */
4668
4684
  sortDir?: string;
4669
- /** Recurrence filter (for venue events that support recurrence dimensions). */
4670
- recurrence?: string;
4685
+ /** Recurrence filter. Uses public ISO-8601 cadence enum values, or "null" for one-off events. */
4686
+ recurrence?: RecurrenceFilter | RecurrenceFilter[];
4671
4687
  /** If provided, enable the query. */
4672
4688
  enabled?: boolean;
4673
4689
  /** Page size when using cursor pagination. Default 20. */
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { QueryClient } from '@tanstack/react-query';
3
3
  export { QueryClient, QueryClientProvider, useQueryClient } from '@tanstack/react-query';
4
4
  import * as _agg_build_sdk from '@agg-build/sdk';
5
- import { CandleBuilder, AggAuthStartBody, AggAuthStartResult, AggClientSessionInput, AggClient, RampQuote, RampQuoteRequest, RampWidgetSession, RampSessionRequest, QuoteManagedResponse, QuoteManagedParams, ExecuteManagedResponse, ExecuteManagedParams, GetPositionsParams, WsOrderSubmitted, WsBalanceUpdate, RedeemResponse, RedeemRequest, WsRedeemEvent, AggWebSocket, WsOrderEvent, WsWithdrawalLifecycleEvent, WsCandleInterval, WsTrade, AggregatedOrderbookResponse, AggLinkAccountBody, AggLinkAccountResult, AggLinkAccountConfirmResult, Category, UserActivityQuery, UserActivityItem, PaginatedResponse, CandleInterval, OrderbookState, OrderbookQuoteResponse, OrderListQuery, TradeExecutorOrder, SmartRouteSide, ExecutionMode, SmartRouteResponse, MidpointRow, BatchMidpointsResponse, AppClientConfigResponse } from '@agg-build/sdk';
5
+ import { CandleBuilder, AggAuthStartBody, AggAuthStartResult, AggClientSessionInput, AggClient, RampQuote, RampQuoteRequest, RampWidgetSession, RampSessionRequest, QuoteManagedResponse, QuoteManagedParams, ExecuteManagedResponse, ExecuteManagedParams, GetPositionsParams, WsOrderSubmitted, WsBalanceUpdate, RedeemResponse, RedeemRequest, WsRedeemEvent, AggWebSocket, WsOrderEvent, WsWithdrawalLifecycleEvent, WsCandleInterval, WsTrade, AggregatedOrderbookResponse, AggLinkAccountBody, AggLinkAccountResult, AggLinkAccountConfirmResult, Category, UserActivityQuery, UserActivityItem, PaginatedResponse, CandleInterval, OrderbookState, OrderbookQuoteResponse, OrderListQuery, TradeExecutorOrder, SmartRouteSide, ExecutionMode, SmartRouteResponse, RecurrenceFilter, MidpointRow, BatchMidpointsResponse, AppClientConfigResponse } from '@agg-build/sdk';
6
6
  export { TurnstileChallengeError } from '@agg-build/sdk';
7
7
  import React, { ReactNode } from 'react';
8
8
  export { UseManagedBalancesOptions, UseWithdrawEstimateParams, UseWithdrawFlowOptions, UseWithdrawFlowResult, UseWithdrawManagedOptions, UseWithdrawalLifecycleResult, WithdrawFeeEstimate, WithdrawalLifecycleState, useManagedBalances, useWithdrawEstimate, useWithdrawFlow, useWithdrawManaged, useWithdrawalLifecycle } from './withdraw.js';
@@ -69,8 +69,14 @@ declare enum OrderStatus {
69
69
  pending_bridge = "pending_bridge",
70
70
  submitting = "submitting",
71
71
  submitted = "submitted",
72
+ open = "open",
73
+ partially_filled_open = "partially_filled_open",
74
+ cancel_pending = "cancel_pending",
72
75
  filled = "filled",
73
- partial_fill = "partial_fill"
76
+ partial_fill = "partial_fill",
77
+ failed = "failed",
78
+ expired = "expired",
79
+ cancelled = "cancelled"
74
80
  }
75
81
 
76
82
  /**
@@ -106,11 +112,15 @@ type UnifiedBalanceResponse = {
106
112
  cash: {
107
113
  tokenSymbol: string;
108
114
  totalRaw: string;
115
+ availableRaw?: string | undefined;
116
+ reservedRaw?: string | undefined;
109
117
  decimals: number;
110
118
  chains: {
111
119
  chainId: number;
112
120
  tokenAddress: string;
113
121
  balanceRaw: string;
122
+ heldRaw?: string | undefined;
123
+ availableRaw?: string | undefined;
114
124
  decimals: number;
115
125
  lastSyncedAt: string;
116
126
  }[];
@@ -257,6 +267,10 @@ type VenueMarket = {
257
267
  endDate?: string | null | undefined;
258
268
  creationDate?: string | null | undefined;
259
269
  resolutionDate?: string | null | undefined;
270
+ /** Sports market classification for type-aware sorting (moneyline, spread, total, etc.). */
271
+ sportsMarketType?: string | null | undefined;
272
+ /** Sort rank within a sports section (0=moneyline, 1=spread, 2=total, 3+=other). */
273
+ sectionRank?: number | null | undefined;
260
274
  matchedVenueMarkets?: {
261
275
  id: string;
262
276
  venue: Venue;
@@ -316,10 +330,12 @@ type VenueEvent = {
316
330
  /**
317
331
  * ISO-8601 duration denormalized from Series.recurrence. `null` means
318
332
  * the event has no recurring schedule (one-off). Use this value with
319
- * the `?recurrence=` filter on /venue-events; discover all available
320
- * values via GET /recurrences.
333
+ * the `?recurrence=` filter on /venue-events using public recurrence
334
+ * enum values.
321
335
  */
322
336
  recurrence?: string | null | undefined;
337
+ /** Type-aware structure classification used to sort markets under this event. */
338
+ structureType?: "candidate" | "sport" | "axis" | "dates" | null | undefined;
323
339
  };
324
340
  type Orderbook = {
325
341
  bids: {
@@ -4666,8 +4682,8 @@ interface UseVenueEventsOptions {
4666
4682
  sortBy?: string;
4667
4683
  /** Sort direction: "asc" or "desc". */
4668
4684
  sortDir?: string;
4669
- /** Recurrence filter (for venue events that support recurrence dimensions). */
4670
- recurrence?: string;
4685
+ /** Recurrence filter. Uses public ISO-8601 cadence enum values, or "null" for one-off events. */
4686
+ recurrence?: RecurrenceFilter | RecurrenceFilter[];
4671
4687
  /** If provided, enable the query. */
4672
4688
  enabled?: boolean;
4673
4689
  /** Page size when using cursor pagination. Default 20. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/hooks",
3
- "version": "1.3.0",
3
+ "version": "2.0.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": "^1.3.0"
86
+ "@agg-build/sdk": "^2.0.0"
87
87
  },
88
88
  "peerDependenciesMeta": {
89
89
  "@solana/wallet-adapter-react": {