@agg-build/sdk 2.1.2 → 2.2.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/README.md CHANGED
@@ -255,6 +255,8 @@ Call `client.destroy()` when you no longer need the client to release internal r
255
255
  | `quoteManaged(params)` | Request a 2-min TTL quote with execution steps |
256
256
  | `executeManaged(params)` | Execute a previously quoted trade |
257
257
  | `withdrawManaged(params)` | Withdraw from managed wallets to an external address |
258
+ | `withdrawPreview(params)` | Preview withdrawal receive amount and route fees |
259
+ | `getWithdrawalQuote(params)` | Quote the maximum deliverable withdrawal amount |
258
260
  | `syncManagedBalances()` | Trigger on-chain balance sync |
259
261
  | `cancelManagedOrder(orderId)` | Cancel a pending managed execution order |
260
262
  | `getVenueBalances(venues)` | Get balances across venues |
package/dist/index.d.mts CHANGED
@@ -408,6 +408,7 @@ type WalletTokenBalance = {
408
408
  chains: {
409
409
  chainId: number;
410
410
  tokenAddress: string;
411
+ tokenSymbol?: string | undefined;
411
412
  balanceRaw: string;
412
413
  heldRaw?: string | undefined;
413
414
  availableRaw?: string | undefined;
@@ -434,6 +435,7 @@ type UnifiedBalanceResponse = {
434
435
  chains: {
435
436
  chainId: number;
436
437
  tokenAddress: string;
438
+ tokenSymbol?: string | undefined;
437
439
  balanceRaw: string;
438
440
  heldRaw?: string | undefined;
439
441
  availableRaw?: string | undefined;
@@ -584,7 +586,8 @@ type VenueMarket = {
584
586
  question: string;
585
587
  venueMarketOutcomes: {
586
588
  id: string;
587
- price: number;
589
+ /** REMOVED — no longer returned; use GET /midpoints for live prices. */
590
+ price?: number | undefined;
588
591
  venueMarketId: string;
589
592
  label: string;
590
593
  title?: string | null | undefined;
@@ -623,6 +626,10 @@ type VenueMarket = {
623
626
  period?: string | null | undefined;
624
627
  /** Normalized subject category for prop-tab grouping (e.g., game_lines, exact_score, etc.). */
625
628
  marketCategory?: string | null | undefined;
629
+ /** Section/tab grouping key for sports markets (e.g. "player_props", "totals"). */
630
+ marketGroup?: string | null | undefined;
631
+ /** Fine-grained sub-classification within a marketGroup (e.g. "moneyline", "rushing_yards"). */
632
+ marketSubtype?: string | null | undefined;
626
633
  /** Line value for spread/total markets (e.g., 2.5 for totals, 3 for spreads). */
627
634
  lineValue?: number | null | undefined;
628
635
  matchedVenueMarkets?: {
@@ -634,7 +641,8 @@ type VenueMarket = {
634
641
  conditionId?: string | null | undefined;
635
642
  venueMarketOutcomes?: {
636
643
  id: string;
637
- price: number;
644
+ /** REMOVED — no longer returned; use GET /midpoints for live prices. */
645
+ price?: number | undefined;
638
646
  venueMarketId: string;
639
647
  label: string;
640
648
  winner?: boolean | null | undefined;
@@ -698,8 +706,12 @@ type VenueEvent = {
698
706
  * enum values.
699
707
  */
700
708
  recurrence?: string | null | undefined;
709
+ /** Deterministic game-level canonical key for cross-venue sports detail loading. */
710
+ aggKey?: string | null | undefined;
701
711
  /** Type-aware structure classification used to sort markets under this event. */
702
712
  structureType?: "candidate" | "sport" | "axis" | "dates" | null | undefined;
713
+ /** Canonical sport slug for sports events (e.g. "basketball", "soccer"); null for non-sports. */
714
+ sport?: string | null | undefined;
703
715
  };
704
716
  type Orderbook = {
705
717
  bids: {
@@ -802,7 +814,12 @@ type MatchedVenueMarketOutcomeRef = {
802
814
  };
803
815
  type VenueMarketOutcome = {
804
816
  id: string;
805
- price: number;
817
+ /**
818
+ * REMOVED — /venue-events and /venue-markets no longer return outcome
819
+ * prices. Fetch live prices from GET /midpoints (or the live-price hooks),
820
+ * keyed by this outcome's `id`.
821
+ */
822
+ price?: number | undefined;
806
823
  venueMarketId: string;
807
824
  label: string;
808
825
  title?: string | null | undefined;
@@ -1477,12 +1494,16 @@ interface WsArbMarketUpdate {
1477
1494
  venueEventId: string | null;
1478
1495
  arbReturn: number;
1479
1496
  ts: number;
1497
+ liquidityUsd?: number;
1498
+ liquidityTier?: "deep" | "shallow";
1480
1499
  }
1481
1500
  interface WsArbFeedEntry {
1482
1501
  marketId: string;
1483
1502
  venueEventId: string | null;
1484
1503
  arbReturn: number;
1485
1504
  ts: number;
1505
+ liquidityUsd?: number;
1506
+ liquidityTier?: "deep" | "shallow";
1486
1507
  }
1487
1508
  interface WsArbFeedBatch {
1488
1509
  type: "arb_feed_batch";
@@ -1765,6 +1786,10 @@ interface AppClientConfigResponse {
1765
1786
  earlyAccessEnabled: boolean;
1766
1787
  authOptions: AppClientAuthOption[];
1767
1788
  }
1789
+ interface RpcTokenResponse {
1790
+ token: string;
1791
+ expiresAt: number;
1792
+ }
1768
1793
  type AggAuthProviderType = "siwe" | "siws" | "google" | "twitter" | "apple" | "email";
1769
1794
  interface AppClientAuthOption {
1770
1795
  provider: AggAuthProviderType;
@@ -2025,6 +2050,36 @@ interface ListRecurringCryptoMarketsOptions {
2025
2050
  includeOrderbookPrices?: boolean;
2026
2051
  includeReferencePrices?: boolean;
2027
2052
  includeDirectVenueMarkets?: boolean;
2053
+ includeOrderbookDepth?: boolean;
2054
+ orderbookDepth?: number;
2055
+ orderbookDepthAmountUsd?: number;
2056
+ }
2057
+ interface RecurringCryptoOrderbookDepthLevel {
2058
+ price: number;
2059
+ size: number;
2060
+ notionalUsd: number;
2061
+ cumulativeSize: number;
2062
+ cumulativeNotionalUsd: number;
2063
+ fillSize: number | null;
2064
+ fillNotionalUsd: number | null;
2065
+ }
2066
+ interface RecurringCryptoOrderbookDepthSide {
2067
+ levels: RecurringCryptoOrderbookDepthLevel[];
2068
+ totalSize: number;
2069
+ totalNotionalUsd: number;
2070
+ requestedNotionalUsd: number | null;
2071
+ filledSize: number | null;
2072
+ filledNotionalUsd: number | null;
2073
+ unfilledNotionalUsd: number | null;
2074
+ avgPrice: number | null;
2075
+ worstPrice: number | null;
2076
+ fillsComplete: boolean | null;
2077
+ }
2078
+ interface RecurringCryptoOutcomeOrderbookDepth {
2079
+ currency: "USD";
2080
+ amountUsd: number | null;
2081
+ buy: RecurringCryptoOrderbookDepthSide;
2082
+ sell: RecurringCryptoOrderbookDepthSide;
2028
2083
  }
2029
2084
  interface RecurringCryptoOutcome {
2030
2085
  /**
@@ -2045,6 +2100,7 @@ interface RecurringCryptoOutcome {
2045
2100
  bestAsk: number | null;
2046
2101
  markSource: MarkSource | string | null;
2047
2102
  lastKnownPrice: number | null;
2103
+ orderbookDepth: RecurringCryptoOutcomeOrderbookDepth | null;
2048
2104
  }
2049
2105
  interface RecurringCryptoMarketMetrics {
2050
2106
  volume: number | null;
@@ -2422,6 +2478,8 @@ interface ExecuteManagedResponse {
2422
2478
  quoteId: string;
2423
2479
  orderIds: string[];
2424
2480
  status: "pending";
2481
+ redeemId?: string;
2482
+ message?: string;
2425
2483
  }
2426
2484
  interface ValidateManagedParams {
2427
2485
  venueMarketOutcomeIds: string[];
@@ -2441,9 +2499,9 @@ interface WithdrawManagedParams {
2441
2499
  /** Positive integer string in the token's native decimals (e.g. "100000" = 0.1 USDC). */
2442
2500
  amountRaw: string;
2443
2501
  tokenSymbol: WithdrawTokenSymbol;
2444
- /** EVM 0x-prefixed 20-byte recipient address. */
2502
+ /** Recipient address. EVM destinations use 0x-prefixed 20-byte hex; Solana uses base58. */
2445
2503
  destinationAddress: string;
2446
- /** EVM chain ID where the recipient should receive funds. Required as of v2026.04. */
2504
+ /** Chain ID where the recipient should receive funds. Required as of v2026.04. */
2447
2505
  destinationChainId: number;
2448
2506
  /**
2449
2507
  * When `true`, the server caps the withdrawal to the maximum deliverable amount
@@ -2495,6 +2553,17 @@ interface WithdrawalExpected {
2495
2553
  }
2496
2554
  /** Body for POST /execution/withdraw/preview — identical to a withdraw request. */
2497
2555
  type WithdrawPreviewParams = WithdrawManagedParams;
2556
+ interface WithdrawalQuoteParams {
2557
+ tokenSymbol: WithdrawTokenSymbol;
2558
+ destinationChainId: number;
2559
+ }
2560
+ interface WithdrawalQuoteResponse {
2561
+ tokenSymbol: WithdrawTokenSymbol;
2562
+ destinationChainId: number;
2563
+ maxDeliverableRaw: string;
2564
+ rawBalanceRaw: string;
2565
+ decimals: number;
2566
+ }
2498
2567
  /** Response from POST /execution/withdraw/preview. All amounts are raw strings in destination-token native decimals. */
2499
2568
  interface WithdrawPreviewResponse {
2500
2569
  receiveAmountRaw: string | null;
@@ -2591,6 +2660,60 @@ type ExecutionOrdersQuery = GetOrdersQuery & {
2591
2660
  mode?: ExecutionMode;
2592
2661
  };
2593
2662
  type ExecutionOrderItem = OrderListItem;
2663
+ type ExecutionStatusQuery = {
2664
+ quoteId: string;
2665
+ mode?: ExecutionMode;
2666
+ };
2667
+ type ExecutionOverallState = "created" | "routing" | "quoting" | "placing" | "confirming" | "filled" | "partially_filled" | "failed" | "cancelled" | "expired";
2668
+ interface ExecutionDagProgress {
2669
+ dagRunId: string;
2670
+ totalSteps: number;
2671
+ currentSequence: number;
2672
+ currentStepType: string | null;
2673
+ completedSequences: number[];
2674
+ stepTypes: Record<number, string>;
2675
+ status: "running" | "completed" | "failed";
2676
+ errorReason: string | null;
2677
+ }
2678
+ interface ExecutionStatusStep {
2679
+ sequence: number;
2680
+ stepType: string;
2681
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2682
+ attempt: number;
2683
+ startedAt: string | null;
2684
+ completedAt: string | null;
2685
+ errorReason: string | null;
2686
+ }
2687
+ interface ExecutionStatusOrder {
2688
+ orderId: string;
2689
+ venue: string;
2690
+ status: string;
2691
+ event: "filled" | "partial_fill" | "failed" | null;
2692
+ filledAmountRaw?: string;
2693
+ remainingAmountRaw?: string;
2694
+ quotedSharesRaw?: string;
2695
+ actualSharesRaw?: string;
2696
+ quotedToWinRaw?: string;
2697
+ actualToWinRaw?: string;
2698
+ quotedPriceRaw?: string;
2699
+ executionPriceRaw?: string;
2700
+ partialFillReason?: string;
2701
+ errorReason?: string;
2702
+ txHash?: string;
2703
+ updatedAt: string;
2704
+ }
2705
+ interface ExecutionStatusResponse {
2706
+ executionId: string | null;
2707
+ quoteId: string;
2708
+ orderIds: string[];
2709
+ overallState: ExecutionOverallState;
2710
+ terminal: boolean;
2711
+ errorReason: string | null;
2712
+ pollAfterMs: number | null;
2713
+ dagProgress: ExecutionDagProgress | null;
2714
+ steps: ExecutionStatusStep[];
2715
+ orders: ExecutionStatusOrder[];
2716
+ }
2594
2717
  type ExecutionPositionsQuery = GetPositionsQuery & {
2595
2718
  mode?: ExecutionMode;
2596
2719
  };
@@ -2606,6 +2729,9 @@ interface PaperTradingListParams {
2606
2729
  limit?: number;
2607
2730
  cursor?: string;
2608
2731
  }
2732
+ interface PaperTradingAccountListParams extends PaperTradingListParams {
2733
+ externalId?: string;
2734
+ }
2609
2735
  interface CreatePaperTradingAccountParams {
2610
2736
  name?: string;
2611
2737
  externalId?: string;
@@ -3058,6 +3184,24 @@ interface SmartRouteFeeBreakdown {
3058
3184
  appFeeCategory?: string;
3059
3185
  }
3060
3186
  /** Response from GET /orderbook/:venueMarketOutcomeId/route. */
3187
+ interface SmartRouteSettlementLeg {
3188
+ action: "redeem";
3189
+ venue: string;
3190
+ venueMarketId: string;
3191
+ venueMarketOutcomeId: string;
3192
+ positionId: string;
3193
+ size: string;
3194
+ redeemPath: "evm" | "svm";
3195
+ }
3196
+ interface SmartRouteSettlementPlan {
3197
+ redeemId: string;
3198
+ status: "redeem_only" | "partial_redeem";
3199
+ message: string;
3200
+ totalRedeemableShares: number;
3201
+ totalRedeemShares: number;
3202
+ totalSellShares: number;
3203
+ redeemLegs: SmartRouteSettlementLeg[];
3204
+ }
3061
3205
  interface SmartRouteResponse {
3062
3206
  quoteId: string;
3063
3207
  venueMarketOutcomeId: string;
@@ -3082,6 +3226,7 @@ interface SmartRouteResponse {
3082
3226
  }>;
3083
3227
  error?: string;
3084
3228
  message?: string;
3229
+ settlementPlan?: SmartRouteSettlementPlan;
3085
3230
  warnings?: Array<{
3086
3231
  venue: string;
3087
3232
  venueMarketOutcomeId: string;
@@ -3334,14 +3479,24 @@ interface CorrelatedMarketsStatus {
3334
3479
  interface CorrelatedMarketQueryResult {
3335
3480
  venueMarketId: string;
3336
3481
  marketQuestion: string;
3482
+ marketStatus: MarketStatus;
3483
+ marketStartDate: string;
3484
+ marketEndDate: string | null;
3337
3485
  eventTitle: string;
3486
+ eventStatus: MarketStatus;
3487
+ eventStartDate: string;
3488
+ eventEndDate: string | null;
3338
3489
  score: number;
3339
3490
  matchedSignal: CorrelatedMarketSignal;
3491
+ matchSource: "signal" | "title_fallback";
3340
3492
  venue: string;
3341
3493
  }
3342
3494
  interface CorrelatedMarketCascadeItem {
3343
3495
  venueEventId: string;
3344
3496
  eventTitle: string;
3497
+ eventStatus: MarketStatus;
3498
+ eventStartDate: string;
3499
+ eventEndDate: string | null;
3345
3500
  score: number;
3346
3501
  action: string;
3347
3502
  reason: string;
@@ -3413,6 +3568,7 @@ declare class AggClient {
3413
3568
  private paperTradingAccountsPath;
3414
3569
  private paperTradingAccountPath;
3415
3570
  private paperTradingListQuery;
3571
+ private paperTradingAccountListQuery;
3416
3572
  private withAuthPayload;
3417
3573
  private restoreSession;
3418
3574
  private persistSession;
@@ -3532,6 +3688,8 @@ declare class AggClient {
3532
3688
  * rollup (total cost, share-weighted avg price, to-win).
3533
3689
  */
3534
3690
  getExecutionOrders(params?: ExecutionOrdersQuery): Promise<PaginatedResponse<ExecutionOrderItem>>;
3691
+ /** Get quote-scoped execution progress, DAG step state, and order leg terminal status. */
3692
+ getExecutionStatus(params: ExecutionStatusQuery): Promise<ExecutionStatusResponse>;
3535
3693
  /** Unified user activity feed (trades, deposits, withdrawals, bridges, wallet ops). */
3536
3694
  getUserActivity(params?: UserActivityQuery): Promise<PaginatedResponse<UserActivityItem>>;
3537
3695
  /** List execution positions for the authenticated user (cursor pagination). */
@@ -3541,7 +3699,7 @@ declare class AggClient {
3541
3699
  /** Create a server-managed paper trading account for an app. Requires adminKey or apiKey. */
3542
3700
  createPaperTradingAccount(params: CreatePaperTradingAccountParams, options?: PaperTradingAppOptions): Promise<PaperTradingAccount>;
3543
3701
  /** List server-managed paper trading accounts for an app. Requires adminKey or apiKey. */
3544
- listPaperTradingAccounts(params?: PaperTradingListParams & PaperTradingAppOptions): Promise<PaperTradingAccountsPage>;
3702
+ listPaperTradingAccounts(params?: PaperTradingAccountListParams & PaperTradingAppOptions): Promise<PaperTradingAccountsPage>;
3545
3703
  /** Fetch a server-managed paper trading account. Requires adminKey or apiKey. */
3546
3704
  getPaperTradingAccount(accountId: string, options?: PaperTradingAppOptions): Promise<PaperTradingAccount>;
3547
3705
  /** Set a paper trading account cash balance. Requires adminKey or apiKey. */
@@ -3576,6 +3734,13 @@ declare class AggClient {
3576
3734
  maxYesPrice?: number;
3577
3735
  /** ISO-8601 timestamp. Hides events with endDate <= this value. NULL-endDate events are kept. */
3578
3736
  endDateFrom?: string;
3737
+ /**
3738
+ * When true, fold same-venue companion events into one tile per game
3739
+ * (`groupParentId IS NULL`). Sent as `grouped=true`; omitted when false/absent
3740
+ * (default = ungrouped). Consumers showing one tile per game need a detail
3741
+ * view that loads the folded companions via aggKey.
3742
+ */
3743
+ grouped?: boolean;
3579
3744
  }): Promise<PaginatedResponse<VenueEvent>>;
3580
3745
  /** Get a single venue event by ID. Requires appId or admin auth. */
3581
3746
  getVenueEventById(id: string, options?: {
@@ -3595,10 +3760,16 @@ declare class AggClient {
3595
3760
  matchStatus?: MatchStatus;
3596
3761
  status?: MarketStatus;
3597
3762
  categoryIds?: string[];
3763
+ aggKey?: string[];
3764
+ sportsMarketType?: string[];
3765
+ period?: string[];
3766
+ marketCategory?: string[];
3767
+ marketGroup?: string[];
3598
3768
  limit?: number;
3599
3769
  cursor?: string;
3600
3770
  sortBy?: "volume" | "volume24hr" | "createdAt" | "yesPrice" | "updatedAt";
3601
3771
  sortDir?: "asc" | "desc";
3772
+ context?: "list" | "detail";
3602
3773
  }): Promise<PaginatedResponse<VenueMarket>>;
3603
3774
  /** Get categories with cursor-based pagination. Requires appId. */
3604
3775
  getCategories(options?: {
@@ -3608,6 +3779,8 @@ declare class AggClient {
3608
3779
  }): Promise<PaginatedResponse<Category>>;
3609
3780
  /** Get per-app UI config (disabled venues + category presets). Requires appId. */
3610
3781
  getAppConfig(init?: RequestInit): Promise<AppClientConfigResponse>;
3782
+ /** Get a temporary Alchemy JWT token for RPC connections. */
3783
+ getRpcToken(init?: RequestInit): Promise<RpcTokenResponse>;
3611
3784
  private buildNewsFeedQuery;
3612
3785
  /** List available market news feeds and item counts. */
3613
3786
  getNewsFeeds(options?: {
@@ -3652,6 +3825,8 @@ declare class AggClient {
3652
3825
  text: string;
3653
3826
  limit?: number;
3654
3827
  includeResolved?: boolean;
3828
+ direction?: "more_likely" | "less_likely";
3829
+ balanced?: boolean;
3655
3830
  }, options?: {
3656
3831
  signal?: AbortSignal;
3657
3832
  }): Promise<{
@@ -3738,6 +3913,8 @@ declare class AggClient {
3738
3913
  * integrating against the SDK can ignore this entirely.
3739
3914
  */
3740
3915
  withdrawPreview(params: WithdrawPreviewParams): Promise<WithdrawPreviewResponse>;
3916
+ /** Quote maximum deliverable withdrawal amount for a token and destination chain. */
3917
+ getWithdrawalQuote(params: WithdrawalQuoteParams): Promise<WithdrawalQuoteResponse>;
3741
3918
  /**
3742
3919
  * Read the current persisted state of a withdrawal. Used as a backfill for
3743
3920
  * the WS lifecycle channel: the client polls this on hook mount and on WS
@@ -3850,4 +4027,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
3850
4027
 
3851
4028
  declare function createAggClient(options: AggClientOptions): AggClient;
3852
4029
 
3853
- export { type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionPositionGroup, type ExecutionPositionsQuery, type GetBalanceQuery, type GetBalanceResponse, type GetCryptoReferencePricesOptions, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, ImageSize, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type MatchingReport, type MidpointItem, type MidpointRow, type NewsFeedArticleFeedItem, type NewsFeedArticleFeedResponse, type NewsFeedArticleWithSummary, type NewsFeedLinkedMarket, type NewsFeedListResponse, type NewsFeedMarketFeedArticle, type NewsFeedMarketFeedItem, type NewsFeedMarketFeedResponse, type NewsFeedMarketNewsParams, type NewsFeedMarketNewsResponse, type NewsFeedMarketNewsResult, type NewsFeedPageOptions, type NewsFeedStatusResponse, type NonceResponse, type OrderListItem, type OrderListQuery, OrderStatus, OrderType, type Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, type OrderbookHistoryPoint, type OrderbookHistoryResponse, type OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, type OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PaperTradingAccount, type PaperTradingAccountsPage, type PaperTradingAppOptions, type PaperTradingBalanceAdjustment, type PaperTradingBalanceResponse, type PaperTradingLiquidityStatus, type PaperTradingListParams, type PaperTradingMarkSource, type PaperTradingOrder, type PaperTradingOrdersPage, type PaperTradingPortfolio, type PaperTradingPosition, type PaperTradingPositionsPage, type PersistedAuthSnapshot, type PlacePaperTradingOrderParams, type PositionGroup, type PositionRedeemStatus, type PricePoint, type PriceSource, type PricesHistoryResponse, type QuoteManagedParams, type QuoteManagedRequest, type QuoteManagedResponse, type QuoteManagedSplit, type QuoteManagedStep, type QuoteSplit, type QuoteStep, RECURRENCE_CADENCES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOutcome, type RecurringCryptoPriceComparison, type RecurringCryptoReferencePrice, type RecurringCryptoResolution, type RecurringCryptoSourceConfidence, type RecurringCryptoVenueMarket, type RecurringCryptoWindowComparisons, type RecurringCryptoWindowMarket, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RequestedOrderbookMarket, type ResetPaperTradingAccountParams, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SetPaperTradingBalanceParams, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SyncBalancesResponse, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateUserBody, type UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, type UserHolding, type UserProfile, VENUES, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueKeySummary, type VenueMarket, type VenueMarketClusterNode, type VenueMarketListItem, type VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, type VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, type VerifyBody, type VerifyResponse, type WalletChainBalance, type WalletTokenBalance, type WithdrawManagedParams, type WithdrawManagedRequest, type WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawPreviewParams, type WithdrawPreviewResponse, type WithdrawTokenSymbol, type WithdrawalExpected, type WithdrawalLeg, type WithdrawalLegStatus, type WithdrawalLegType, type WithdrawalLifecycleStatus, type WithdrawalSource, type WithdrawalSourceItem, type WithdrawalSourceStatus, type WithdrawalSourceTokenSymbol, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsClientMessage, type WsConnected, type WsError, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsServerMessage, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
4030
+ export { type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionDagProgress, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionOverallState, type ExecutionPositionGroup, type ExecutionPositionsQuery, type ExecutionStatusOrder, type ExecutionStatusQuery, type ExecutionStatusResponse, type ExecutionStatusStep, type GetBalanceQuery, type GetBalanceResponse, type GetCryptoReferencePricesOptions, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, ImageSize, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type MatchingReport, type MidpointItem, type MidpointRow, type NewsFeedArticleFeedItem, type NewsFeedArticleFeedResponse, type NewsFeedArticleWithSummary, type NewsFeedLinkedMarket, type NewsFeedListResponse, type NewsFeedMarketFeedArticle, type NewsFeedMarketFeedItem, type NewsFeedMarketFeedResponse, type NewsFeedMarketNewsParams, type NewsFeedMarketNewsResponse, type NewsFeedMarketNewsResult, type NewsFeedPageOptions, type NewsFeedStatusResponse, type NonceResponse, type OrderListItem, type OrderListQuery, OrderStatus, OrderType, type Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, type OrderbookHistoryPoint, type OrderbookHistoryResponse, type OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, type OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PaperTradingAccount, type PaperTradingAccountsPage, type PaperTradingAppOptions, type PaperTradingBalanceAdjustment, type PaperTradingBalanceResponse, type PaperTradingLiquidityStatus, type PaperTradingListParams, type PaperTradingMarkSource, type PaperTradingOrder, type PaperTradingOrdersPage, type PaperTradingPortfolio, type PaperTradingPosition, type PaperTradingPositionsPage, type PersistedAuthSnapshot, type PlacePaperTradingOrderParams, type PositionGroup, type PositionRedeemStatus, type PricePoint, type PriceSource, type PricesHistoryResponse, type QuoteManagedParams, type QuoteManagedRequest, type QuoteManagedResponse, type QuoteManagedSplit, type QuoteManagedStep, type QuoteSplit, type QuoteStep, RECURRENCE_CADENCES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOrderbookDepthLevel, type RecurringCryptoOrderbookDepthSide, type RecurringCryptoOutcome, type RecurringCryptoOutcomeOrderbookDepth, type RecurringCryptoPriceComparison, type RecurringCryptoReferencePrice, type RecurringCryptoResolution, type RecurringCryptoSourceConfidence, type RecurringCryptoVenueMarket, type RecurringCryptoWindowComparisons, type RecurringCryptoWindowMarket, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RequestedOrderbookMarket, type ResetPaperTradingAccountParams, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type RpcTokenResponse, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SetPaperTradingBalanceParams, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSettlementLeg, type SmartRouteSettlementPlan, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SyncBalancesResponse, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateUserBody, type UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, type UserHolding, type UserProfile, VENUES, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueKeySummary, type VenueMarket, type VenueMarketClusterNode, type VenueMarketListItem, type VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, type VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, type VerifyBody, type VerifyResponse, type WalletChainBalance, type WalletTokenBalance, type WithdrawManagedParams, type WithdrawManagedRequest, type WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawPreviewParams, type WithdrawPreviewResponse, type WithdrawTokenSymbol, type WithdrawalExpected, type WithdrawalLeg, type WithdrawalLegStatus, type WithdrawalLegType, type WithdrawalLifecycleStatus, type WithdrawalQuoteParams, type WithdrawalQuoteResponse, type WithdrawalSource, type WithdrawalSourceItem, type WithdrawalSourceStatus, type WithdrawalSourceTokenSymbol, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsClientMessage, type WsConnected, type WsError, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsServerMessage, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
package/dist/index.d.ts CHANGED
@@ -408,6 +408,7 @@ type WalletTokenBalance = {
408
408
  chains: {
409
409
  chainId: number;
410
410
  tokenAddress: string;
411
+ tokenSymbol?: string | undefined;
411
412
  balanceRaw: string;
412
413
  heldRaw?: string | undefined;
413
414
  availableRaw?: string | undefined;
@@ -434,6 +435,7 @@ type UnifiedBalanceResponse = {
434
435
  chains: {
435
436
  chainId: number;
436
437
  tokenAddress: string;
438
+ tokenSymbol?: string | undefined;
437
439
  balanceRaw: string;
438
440
  heldRaw?: string | undefined;
439
441
  availableRaw?: string | undefined;
@@ -584,7 +586,8 @@ type VenueMarket = {
584
586
  question: string;
585
587
  venueMarketOutcomes: {
586
588
  id: string;
587
- price: number;
589
+ /** REMOVED — no longer returned; use GET /midpoints for live prices. */
590
+ price?: number | undefined;
588
591
  venueMarketId: string;
589
592
  label: string;
590
593
  title?: string | null | undefined;
@@ -623,6 +626,10 @@ type VenueMarket = {
623
626
  period?: string | null | undefined;
624
627
  /** Normalized subject category for prop-tab grouping (e.g., game_lines, exact_score, etc.). */
625
628
  marketCategory?: string | null | undefined;
629
+ /** Section/tab grouping key for sports markets (e.g. "player_props", "totals"). */
630
+ marketGroup?: string | null | undefined;
631
+ /** Fine-grained sub-classification within a marketGroup (e.g. "moneyline", "rushing_yards"). */
632
+ marketSubtype?: string | null | undefined;
626
633
  /** Line value for spread/total markets (e.g., 2.5 for totals, 3 for spreads). */
627
634
  lineValue?: number | null | undefined;
628
635
  matchedVenueMarkets?: {
@@ -634,7 +641,8 @@ type VenueMarket = {
634
641
  conditionId?: string | null | undefined;
635
642
  venueMarketOutcomes?: {
636
643
  id: string;
637
- price: number;
644
+ /** REMOVED — no longer returned; use GET /midpoints for live prices. */
645
+ price?: number | undefined;
638
646
  venueMarketId: string;
639
647
  label: string;
640
648
  winner?: boolean | null | undefined;
@@ -698,8 +706,12 @@ type VenueEvent = {
698
706
  * enum values.
699
707
  */
700
708
  recurrence?: string | null | undefined;
709
+ /** Deterministic game-level canonical key for cross-venue sports detail loading. */
710
+ aggKey?: string | null | undefined;
701
711
  /** Type-aware structure classification used to sort markets under this event. */
702
712
  structureType?: "candidate" | "sport" | "axis" | "dates" | null | undefined;
713
+ /** Canonical sport slug for sports events (e.g. "basketball", "soccer"); null for non-sports. */
714
+ sport?: string | null | undefined;
703
715
  };
704
716
  type Orderbook = {
705
717
  bids: {
@@ -802,7 +814,12 @@ type MatchedVenueMarketOutcomeRef = {
802
814
  };
803
815
  type VenueMarketOutcome = {
804
816
  id: string;
805
- price: number;
817
+ /**
818
+ * REMOVED — /venue-events and /venue-markets no longer return outcome
819
+ * prices. Fetch live prices from GET /midpoints (or the live-price hooks),
820
+ * keyed by this outcome's `id`.
821
+ */
822
+ price?: number | undefined;
806
823
  venueMarketId: string;
807
824
  label: string;
808
825
  title?: string | null | undefined;
@@ -1477,12 +1494,16 @@ interface WsArbMarketUpdate {
1477
1494
  venueEventId: string | null;
1478
1495
  arbReturn: number;
1479
1496
  ts: number;
1497
+ liquidityUsd?: number;
1498
+ liquidityTier?: "deep" | "shallow";
1480
1499
  }
1481
1500
  interface WsArbFeedEntry {
1482
1501
  marketId: string;
1483
1502
  venueEventId: string | null;
1484
1503
  arbReturn: number;
1485
1504
  ts: number;
1505
+ liquidityUsd?: number;
1506
+ liquidityTier?: "deep" | "shallow";
1486
1507
  }
1487
1508
  interface WsArbFeedBatch {
1488
1509
  type: "arb_feed_batch";
@@ -1765,6 +1786,10 @@ interface AppClientConfigResponse {
1765
1786
  earlyAccessEnabled: boolean;
1766
1787
  authOptions: AppClientAuthOption[];
1767
1788
  }
1789
+ interface RpcTokenResponse {
1790
+ token: string;
1791
+ expiresAt: number;
1792
+ }
1768
1793
  type AggAuthProviderType = "siwe" | "siws" | "google" | "twitter" | "apple" | "email";
1769
1794
  interface AppClientAuthOption {
1770
1795
  provider: AggAuthProviderType;
@@ -2025,6 +2050,36 @@ interface ListRecurringCryptoMarketsOptions {
2025
2050
  includeOrderbookPrices?: boolean;
2026
2051
  includeReferencePrices?: boolean;
2027
2052
  includeDirectVenueMarkets?: boolean;
2053
+ includeOrderbookDepth?: boolean;
2054
+ orderbookDepth?: number;
2055
+ orderbookDepthAmountUsd?: number;
2056
+ }
2057
+ interface RecurringCryptoOrderbookDepthLevel {
2058
+ price: number;
2059
+ size: number;
2060
+ notionalUsd: number;
2061
+ cumulativeSize: number;
2062
+ cumulativeNotionalUsd: number;
2063
+ fillSize: number | null;
2064
+ fillNotionalUsd: number | null;
2065
+ }
2066
+ interface RecurringCryptoOrderbookDepthSide {
2067
+ levels: RecurringCryptoOrderbookDepthLevel[];
2068
+ totalSize: number;
2069
+ totalNotionalUsd: number;
2070
+ requestedNotionalUsd: number | null;
2071
+ filledSize: number | null;
2072
+ filledNotionalUsd: number | null;
2073
+ unfilledNotionalUsd: number | null;
2074
+ avgPrice: number | null;
2075
+ worstPrice: number | null;
2076
+ fillsComplete: boolean | null;
2077
+ }
2078
+ interface RecurringCryptoOutcomeOrderbookDepth {
2079
+ currency: "USD";
2080
+ amountUsd: number | null;
2081
+ buy: RecurringCryptoOrderbookDepthSide;
2082
+ sell: RecurringCryptoOrderbookDepthSide;
2028
2083
  }
2029
2084
  interface RecurringCryptoOutcome {
2030
2085
  /**
@@ -2045,6 +2100,7 @@ interface RecurringCryptoOutcome {
2045
2100
  bestAsk: number | null;
2046
2101
  markSource: MarkSource | string | null;
2047
2102
  lastKnownPrice: number | null;
2103
+ orderbookDepth: RecurringCryptoOutcomeOrderbookDepth | null;
2048
2104
  }
2049
2105
  interface RecurringCryptoMarketMetrics {
2050
2106
  volume: number | null;
@@ -2422,6 +2478,8 @@ interface ExecuteManagedResponse {
2422
2478
  quoteId: string;
2423
2479
  orderIds: string[];
2424
2480
  status: "pending";
2481
+ redeemId?: string;
2482
+ message?: string;
2425
2483
  }
2426
2484
  interface ValidateManagedParams {
2427
2485
  venueMarketOutcomeIds: string[];
@@ -2441,9 +2499,9 @@ interface WithdrawManagedParams {
2441
2499
  /** Positive integer string in the token's native decimals (e.g. "100000" = 0.1 USDC). */
2442
2500
  amountRaw: string;
2443
2501
  tokenSymbol: WithdrawTokenSymbol;
2444
- /** EVM 0x-prefixed 20-byte recipient address. */
2502
+ /** Recipient address. EVM destinations use 0x-prefixed 20-byte hex; Solana uses base58. */
2445
2503
  destinationAddress: string;
2446
- /** EVM chain ID where the recipient should receive funds. Required as of v2026.04. */
2504
+ /** Chain ID where the recipient should receive funds. Required as of v2026.04. */
2447
2505
  destinationChainId: number;
2448
2506
  /**
2449
2507
  * When `true`, the server caps the withdrawal to the maximum deliverable amount
@@ -2495,6 +2553,17 @@ interface WithdrawalExpected {
2495
2553
  }
2496
2554
  /** Body for POST /execution/withdraw/preview — identical to a withdraw request. */
2497
2555
  type WithdrawPreviewParams = WithdrawManagedParams;
2556
+ interface WithdrawalQuoteParams {
2557
+ tokenSymbol: WithdrawTokenSymbol;
2558
+ destinationChainId: number;
2559
+ }
2560
+ interface WithdrawalQuoteResponse {
2561
+ tokenSymbol: WithdrawTokenSymbol;
2562
+ destinationChainId: number;
2563
+ maxDeliverableRaw: string;
2564
+ rawBalanceRaw: string;
2565
+ decimals: number;
2566
+ }
2498
2567
  /** Response from POST /execution/withdraw/preview. All amounts are raw strings in destination-token native decimals. */
2499
2568
  interface WithdrawPreviewResponse {
2500
2569
  receiveAmountRaw: string | null;
@@ -2591,6 +2660,60 @@ type ExecutionOrdersQuery = GetOrdersQuery & {
2591
2660
  mode?: ExecutionMode;
2592
2661
  };
2593
2662
  type ExecutionOrderItem = OrderListItem;
2663
+ type ExecutionStatusQuery = {
2664
+ quoteId: string;
2665
+ mode?: ExecutionMode;
2666
+ };
2667
+ type ExecutionOverallState = "created" | "routing" | "quoting" | "placing" | "confirming" | "filled" | "partially_filled" | "failed" | "cancelled" | "expired";
2668
+ interface ExecutionDagProgress {
2669
+ dagRunId: string;
2670
+ totalSteps: number;
2671
+ currentSequence: number;
2672
+ currentStepType: string | null;
2673
+ completedSequences: number[];
2674
+ stepTypes: Record<number, string>;
2675
+ status: "running" | "completed" | "failed";
2676
+ errorReason: string | null;
2677
+ }
2678
+ interface ExecutionStatusStep {
2679
+ sequence: number;
2680
+ stepType: string;
2681
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2682
+ attempt: number;
2683
+ startedAt: string | null;
2684
+ completedAt: string | null;
2685
+ errorReason: string | null;
2686
+ }
2687
+ interface ExecutionStatusOrder {
2688
+ orderId: string;
2689
+ venue: string;
2690
+ status: string;
2691
+ event: "filled" | "partial_fill" | "failed" | null;
2692
+ filledAmountRaw?: string;
2693
+ remainingAmountRaw?: string;
2694
+ quotedSharesRaw?: string;
2695
+ actualSharesRaw?: string;
2696
+ quotedToWinRaw?: string;
2697
+ actualToWinRaw?: string;
2698
+ quotedPriceRaw?: string;
2699
+ executionPriceRaw?: string;
2700
+ partialFillReason?: string;
2701
+ errorReason?: string;
2702
+ txHash?: string;
2703
+ updatedAt: string;
2704
+ }
2705
+ interface ExecutionStatusResponse {
2706
+ executionId: string | null;
2707
+ quoteId: string;
2708
+ orderIds: string[];
2709
+ overallState: ExecutionOverallState;
2710
+ terminal: boolean;
2711
+ errorReason: string | null;
2712
+ pollAfterMs: number | null;
2713
+ dagProgress: ExecutionDagProgress | null;
2714
+ steps: ExecutionStatusStep[];
2715
+ orders: ExecutionStatusOrder[];
2716
+ }
2594
2717
  type ExecutionPositionsQuery = GetPositionsQuery & {
2595
2718
  mode?: ExecutionMode;
2596
2719
  };
@@ -2606,6 +2729,9 @@ interface PaperTradingListParams {
2606
2729
  limit?: number;
2607
2730
  cursor?: string;
2608
2731
  }
2732
+ interface PaperTradingAccountListParams extends PaperTradingListParams {
2733
+ externalId?: string;
2734
+ }
2609
2735
  interface CreatePaperTradingAccountParams {
2610
2736
  name?: string;
2611
2737
  externalId?: string;
@@ -3058,6 +3184,24 @@ interface SmartRouteFeeBreakdown {
3058
3184
  appFeeCategory?: string;
3059
3185
  }
3060
3186
  /** Response from GET /orderbook/:venueMarketOutcomeId/route. */
3187
+ interface SmartRouteSettlementLeg {
3188
+ action: "redeem";
3189
+ venue: string;
3190
+ venueMarketId: string;
3191
+ venueMarketOutcomeId: string;
3192
+ positionId: string;
3193
+ size: string;
3194
+ redeemPath: "evm" | "svm";
3195
+ }
3196
+ interface SmartRouteSettlementPlan {
3197
+ redeemId: string;
3198
+ status: "redeem_only" | "partial_redeem";
3199
+ message: string;
3200
+ totalRedeemableShares: number;
3201
+ totalRedeemShares: number;
3202
+ totalSellShares: number;
3203
+ redeemLegs: SmartRouteSettlementLeg[];
3204
+ }
3061
3205
  interface SmartRouteResponse {
3062
3206
  quoteId: string;
3063
3207
  venueMarketOutcomeId: string;
@@ -3082,6 +3226,7 @@ interface SmartRouteResponse {
3082
3226
  }>;
3083
3227
  error?: string;
3084
3228
  message?: string;
3229
+ settlementPlan?: SmartRouteSettlementPlan;
3085
3230
  warnings?: Array<{
3086
3231
  venue: string;
3087
3232
  venueMarketOutcomeId: string;
@@ -3334,14 +3479,24 @@ interface CorrelatedMarketsStatus {
3334
3479
  interface CorrelatedMarketQueryResult {
3335
3480
  venueMarketId: string;
3336
3481
  marketQuestion: string;
3482
+ marketStatus: MarketStatus;
3483
+ marketStartDate: string;
3484
+ marketEndDate: string | null;
3337
3485
  eventTitle: string;
3486
+ eventStatus: MarketStatus;
3487
+ eventStartDate: string;
3488
+ eventEndDate: string | null;
3338
3489
  score: number;
3339
3490
  matchedSignal: CorrelatedMarketSignal;
3491
+ matchSource: "signal" | "title_fallback";
3340
3492
  venue: string;
3341
3493
  }
3342
3494
  interface CorrelatedMarketCascadeItem {
3343
3495
  venueEventId: string;
3344
3496
  eventTitle: string;
3497
+ eventStatus: MarketStatus;
3498
+ eventStartDate: string;
3499
+ eventEndDate: string | null;
3345
3500
  score: number;
3346
3501
  action: string;
3347
3502
  reason: string;
@@ -3413,6 +3568,7 @@ declare class AggClient {
3413
3568
  private paperTradingAccountsPath;
3414
3569
  private paperTradingAccountPath;
3415
3570
  private paperTradingListQuery;
3571
+ private paperTradingAccountListQuery;
3416
3572
  private withAuthPayload;
3417
3573
  private restoreSession;
3418
3574
  private persistSession;
@@ -3532,6 +3688,8 @@ declare class AggClient {
3532
3688
  * rollup (total cost, share-weighted avg price, to-win).
3533
3689
  */
3534
3690
  getExecutionOrders(params?: ExecutionOrdersQuery): Promise<PaginatedResponse<ExecutionOrderItem>>;
3691
+ /** Get quote-scoped execution progress, DAG step state, and order leg terminal status. */
3692
+ getExecutionStatus(params: ExecutionStatusQuery): Promise<ExecutionStatusResponse>;
3535
3693
  /** Unified user activity feed (trades, deposits, withdrawals, bridges, wallet ops). */
3536
3694
  getUserActivity(params?: UserActivityQuery): Promise<PaginatedResponse<UserActivityItem>>;
3537
3695
  /** List execution positions for the authenticated user (cursor pagination). */
@@ -3541,7 +3699,7 @@ declare class AggClient {
3541
3699
  /** Create a server-managed paper trading account for an app. Requires adminKey or apiKey. */
3542
3700
  createPaperTradingAccount(params: CreatePaperTradingAccountParams, options?: PaperTradingAppOptions): Promise<PaperTradingAccount>;
3543
3701
  /** List server-managed paper trading accounts for an app. Requires adminKey or apiKey. */
3544
- listPaperTradingAccounts(params?: PaperTradingListParams & PaperTradingAppOptions): Promise<PaperTradingAccountsPage>;
3702
+ listPaperTradingAccounts(params?: PaperTradingAccountListParams & PaperTradingAppOptions): Promise<PaperTradingAccountsPage>;
3545
3703
  /** Fetch a server-managed paper trading account. Requires adminKey or apiKey. */
3546
3704
  getPaperTradingAccount(accountId: string, options?: PaperTradingAppOptions): Promise<PaperTradingAccount>;
3547
3705
  /** Set a paper trading account cash balance. Requires adminKey or apiKey. */
@@ -3576,6 +3734,13 @@ declare class AggClient {
3576
3734
  maxYesPrice?: number;
3577
3735
  /** ISO-8601 timestamp. Hides events with endDate <= this value. NULL-endDate events are kept. */
3578
3736
  endDateFrom?: string;
3737
+ /**
3738
+ * When true, fold same-venue companion events into one tile per game
3739
+ * (`groupParentId IS NULL`). Sent as `grouped=true`; omitted when false/absent
3740
+ * (default = ungrouped). Consumers showing one tile per game need a detail
3741
+ * view that loads the folded companions via aggKey.
3742
+ */
3743
+ grouped?: boolean;
3579
3744
  }): Promise<PaginatedResponse<VenueEvent>>;
3580
3745
  /** Get a single venue event by ID. Requires appId or admin auth. */
3581
3746
  getVenueEventById(id: string, options?: {
@@ -3595,10 +3760,16 @@ declare class AggClient {
3595
3760
  matchStatus?: MatchStatus;
3596
3761
  status?: MarketStatus;
3597
3762
  categoryIds?: string[];
3763
+ aggKey?: string[];
3764
+ sportsMarketType?: string[];
3765
+ period?: string[];
3766
+ marketCategory?: string[];
3767
+ marketGroup?: string[];
3598
3768
  limit?: number;
3599
3769
  cursor?: string;
3600
3770
  sortBy?: "volume" | "volume24hr" | "createdAt" | "yesPrice" | "updatedAt";
3601
3771
  sortDir?: "asc" | "desc";
3772
+ context?: "list" | "detail";
3602
3773
  }): Promise<PaginatedResponse<VenueMarket>>;
3603
3774
  /** Get categories with cursor-based pagination. Requires appId. */
3604
3775
  getCategories(options?: {
@@ -3608,6 +3779,8 @@ declare class AggClient {
3608
3779
  }): Promise<PaginatedResponse<Category>>;
3609
3780
  /** Get per-app UI config (disabled venues + category presets). Requires appId. */
3610
3781
  getAppConfig(init?: RequestInit): Promise<AppClientConfigResponse>;
3782
+ /** Get a temporary Alchemy JWT token for RPC connections. */
3783
+ getRpcToken(init?: RequestInit): Promise<RpcTokenResponse>;
3611
3784
  private buildNewsFeedQuery;
3612
3785
  /** List available market news feeds and item counts. */
3613
3786
  getNewsFeeds(options?: {
@@ -3652,6 +3825,8 @@ declare class AggClient {
3652
3825
  text: string;
3653
3826
  limit?: number;
3654
3827
  includeResolved?: boolean;
3828
+ direction?: "more_likely" | "less_likely";
3829
+ balanced?: boolean;
3655
3830
  }, options?: {
3656
3831
  signal?: AbortSignal;
3657
3832
  }): Promise<{
@@ -3738,6 +3913,8 @@ declare class AggClient {
3738
3913
  * integrating against the SDK can ignore this entirely.
3739
3914
  */
3740
3915
  withdrawPreview(params: WithdrawPreviewParams): Promise<WithdrawPreviewResponse>;
3916
+ /** Quote maximum deliverable withdrawal amount for a token and destination chain. */
3917
+ getWithdrawalQuote(params: WithdrawalQuoteParams): Promise<WithdrawalQuoteResponse>;
3741
3918
  /**
3742
3919
  * Read the current persisted state of a withdrawal. Used as a backfill for
3743
3920
  * the WS lifecycle channel: the client polls this on hook mount and on WS
@@ -3850,4 +4027,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
3850
4027
 
3851
4028
  declare function createAggClient(options: AggClientOptions): AggClient;
3852
4029
 
3853
- export { type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionPositionGroup, type ExecutionPositionsQuery, type GetBalanceQuery, type GetBalanceResponse, type GetCryptoReferencePricesOptions, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, ImageSize, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type MatchingReport, type MidpointItem, type MidpointRow, type NewsFeedArticleFeedItem, type NewsFeedArticleFeedResponse, type NewsFeedArticleWithSummary, type NewsFeedLinkedMarket, type NewsFeedListResponse, type NewsFeedMarketFeedArticle, type NewsFeedMarketFeedItem, type NewsFeedMarketFeedResponse, type NewsFeedMarketNewsParams, type NewsFeedMarketNewsResponse, type NewsFeedMarketNewsResult, type NewsFeedPageOptions, type NewsFeedStatusResponse, type NonceResponse, type OrderListItem, type OrderListQuery, OrderStatus, OrderType, type Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, type OrderbookHistoryPoint, type OrderbookHistoryResponse, type OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, type OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PaperTradingAccount, type PaperTradingAccountsPage, type PaperTradingAppOptions, type PaperTradingBalanceAdjustment, type PaperTradingBalanceResponse, type PaperTradingLiquidityStatus, type PaperTradingListParams, type PaperTradingMarkSource, type PaperTradingOrder, type PaperTradingOrdersPage, type PaperTradingPortfolio, type PaperTradingPosition, type PaperTradingPositionsPage, type PersistedAuthSnapshot, type PlacePaperTradingOrderParams, type PositionGroup, type PositionRedeemStatus, type PricePoint, type PriceSource, type PricesHistoryResponse, type QuoteManagedParams, type QuoteManagedRequest, type QuoteManagedResponse, type QuoteManagedSplit, type QuoteManagedStep, type QuoteSplit, type QuoteStep, RECURRENCE_CADENCES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOutcome, type RecurringCryptoPriceComparison, type RecurringCryptoReferencePrice, type RecurringCryptoResolution, type RecurringCryptoSourceConfidence, type RecurringCryptoVenueMarket, type RecurringCryptoWindowComparisons, type RecurringCryptoWindowMarket, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RequestedOrderbookMarket, type ResetPaperTradingAccountParams, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SetPaperTradingBalanceParams, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SyncBalancesResponse, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateUserBody, type UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, type UserHolding, type UserProfile, VENUES, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueKeySummary, type VenueMarket, type VenueMarketClusterNode, type VenueMarketListItem, type VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, type VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, type VerifyBody, type VerifyResponse, type WalletChainBalance, type WalletTokenBalance, type WithdrawManagedParams, type WithdrawManagedRequest, type WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawPreviewParams, type WithdrawPreviewResponse, type WithdrawTokenSymbol, type WithdrawalExpected, type WithdrawalLeg, type WithdrawalLegStatus, type WithdrawalLegType, type WithdrawalLifecycleStatus, type WithdrawalSource, type WithdrawalSourceItem, type WithdrawalSourceStatus, type WithdrawalSourceTokenSymbol, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsClientMessage, type WsConnected, type WsError, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsServerMessage, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
4030
+ export { type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionDagProgress, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionOverallState, type ExecutionPositionGroup, type ExecutionPositionsQuery, type ExecutionStatusOrder, type ExecutionStatusQuery, type ExecutionStatusResponse, type ExecutionStatusStep, type GetBalanceQuery, type GetBalanceResponse, type GetCryptoReferencePricesOptions, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, ImageSize, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type MatchingReport, type MidpointItem, type MidpointRow, type NewsFeedArticleFeedItem, type NewsFeedArticleFeedResponse, type NewsFeedArticleWithSummary, type NewsFeedLinkedMarket, type NewsFeedListResponse, type NewsFeedMarketFeedArticle, type NewsFeedMarketFeedItem, type NewsFeedMarketFeedResponse, type NewsFeedMarketNewsParams, type NewsFeedMarketNewsResponse, type NewsFeedMarketNewsResult, type NewsFeedPageOptions, type NewsFeedStatusResponse, type NonceResponse, type OrderListItem, type OrderListQuery, OrderStatus, OrderType, type Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, type OrderbookHistoryPoint, type OrderbookHistoryResponse, type OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, type OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PaperTradingAccount, type PaperTradingAccountsPage, type PaperTradingAppOptions, type PaperTradingBalanceAdjustment, type PaperTradingBalanceResponse, type PaperTradingLiquidityStatus, type PaperTradingListParams, type PaperTradingMarkSource, type PaperTradingOrder, type PaperTradingOrdersPage, type PaperTradingPortfolio, type PaperTradingPosition, type PaperTradingPositionsPage, type PersistedAuthSnapshot, type PlacePaperTradingOrderParams, type PositionGroup, type PositionRedeemStatus, type PricePoint, type PriceSource, type PricesHistoryResponse, type QuoteManagedParams, type QuoteManagedRequest, type QuoteManagedResponse, type QuoteManagedSplit, type QuoteManagedStep, type QuoteSplit, type QuoteStep, RECURRENCE_CADENCES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOrderbookDepthLevel, type RecurringCryptoOrderbookDepthSide, type RecurringCryptoOutcome, type RecurringCryptoOutcomeOrderbookDepth, type RecurringCryptoPriceComparison, type RecurringCryptoReferencePrice, type RecurringCryptoResolution, type RecurringCryptoSourceConfidence, type RecurringCryptoVenueMarket, type RecurringCryptoWindowComparisons, type RecurringCryptoWindowMarket, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RequestedOrderbookMarket, type ResetPaperTradingAccountParams, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type RpcTokenResponse, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SetPaperTradingBalanceParams, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSettlementLeg, type SmartRouteSettlementPlan, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SyncBalancesResponse, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateUserBody, type UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, type UserHolding, type UserProfile, VENUES, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueKeySummary, type VenueMarket, type VenueMarketClusterNode, type VenueMarketListItem, type VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, type VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, type VerifyBody, type VerifyResponse, type WalletChainBalance, type WalletTokenBalance, type WithdrawManagedParams, type WithdrawManagedRequest, type WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawPreviewParams, type WithdrawPreviewResponse, type WithdrawTokenSymbol, type WithdrawalExpected, type WithdrawalLeg, type WithdrawalLegStatus, type WithdrawalLegType, type WithdrawalLifecycleStatus, type WithdrawalQuoteParams, type WithdrawalQuoteResponse, type WithdrawalSource, type WithdrawalSourceItem, type WithdrawalSourceStatus, type WithdrawalSourceTokenSymbol, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsClientMessage, type WsConnected, type WsError, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsServerMessage, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
package/dist/index.js CHANGED
@@ -1703,6 +1703,12 @@ var AggClient = class {
1703
1703
  if (params.cursor) query.cursor = params.cursor;
1704
1704
  return Object.keys(query).length ? query : void 0;
1705
1705
  }
1706
+ paperTradingAccountListQuery(params = {}) {
1707
+ var _a;
1708
+ const query = (_a = this.paperTradingListQuery(params)) != null ? _a : {};
1709
+ if (params.externalId) query.externalId = params.externalId;
1710
+ return Object.keys(query).length ? query : void 0;
1711
+ }
1706
1712
  withAuthPayload(payload) {
1707
1713
  var _a, _b, _c;
1708
1714
  if (typeof payload.earlyAccessCode === "string" && payload.earlyAccessCode.trim().length > 0) {
@@ -2297,6 +2303,14 @@ Issued At: ${issuedAt}`;
2297
2303
  });
2298
2304
  });
2299
2305
  }
2306
+ /** Get quote-scoped execution progress, DAG step state, and order leg terminal status. */
2307
+ getExecutionStatus(params) {
2308
+ return __async(this, null, function* () {
2309
+ const query = { quoteId: params.quoteId };
2310
+ if (params.mode) query.mode = params.mode;
2311
+ return this.request("/execution/status", { query });
2312
+ });
2313
+ }
2300
2314
  /** Unified user activity feed (trades, deposits, withdrawals, bridges, wallet ops). */
2301
2315
  getUserActivity() {
2302
2316
  return __async(this, arguments, function* (params = {}) {
@@ -2346,7 +2360,7 @@ Issued At: ${issuedAt}`;
2346
2360
  return __async(this, arguments, function* (params = {}) {
2347
2361
  const _a = params, { appId } = _a, listParams = __objRest(_a, ["appId"]);
2348
2362
  return this.request(this.paperTradingAccountsPath(appId), {
2349
- query: this.paperTradingListQuery(listParams)
2363
+ query: this.paperTradingAccountListQuery(listParams)
2350
2364
  });
2351
2365
  });
2352
2366
  }
@@ -2460,6 +2474,7 @@ Issued At: ${issuedAt}`;
2460
2474
  if ((options == null ? void 0 : options.minYesPrice) != null) query.minYesPrice = String(options.minYesPrice);
2461
2475
  if ((options == null ? void 0 : options.maxYesPrice) != null) query.maxYesPrice = String(options.maxYesPrice);
2462
2476
  if (options == null ? void 0 : options.endDateFrom) query.endDateFrom = options.endDateFrom;
2477
+ if (options == null ? void 0 : options.grouped) query.grouped = "true";
2463
2478
  return this.request("/venue-events", {
2464
2479
  query: Object.keys(query).length > 0 ? query : void 0
2465
2480
  });
@@ -2469,6 +2484,10 @@ Issued At: ${issuedAt}`;
2469
2484
  getVenueEventById(id, options) {
2470
2485
  return __async(this, null, function* () {
2471
2486
  return this.request(`/venue-events/${encodeURIComponent(id)}`, {
2487
+ // Opt into the lean response (no embedded `venueMarkets`) — markets are
2488
+ // fetched separately via GET /venue-markets. Empty `expand` (no `markets`
2489
+ // token) tells the API to omit the deprecated embedded array.
2490
+ query: { expand: "" },
2472
2491
  signal: options == null ? void 0 : options.signal
2473
2492
  });
2474
2493
  });
@@ -2496,6 +2515,15 @@ Issued At: ${issuedAt}`;
2496
2515
  if ((options == null ? void 0 : options.includeDirectVenueMarkets) != null) {
2497
2516
  query.includeDirectVenueMarkets = String(options.includeDirectVenueMarkets);
2498
2517
  }
2518
+ if ((options == null ? void 0 : options.includeOrderbookDepth) != null) {
2519
+ query.includeOrderbookDepth = String(options.includeOrderbookDepth);
2520
+ }
2521
+ if ((options == null ? void 0 : options.orderbookDepth) != null) {
2522
+ query.orderbookDepth = String(options.orderbookDepth);
2523
+ }
2524
+ if ((options == null ? void 0 : options.orderbookDepthAmountUsd) != null) {
2525
+ query.orderbookDepthAmountUsd = String(options.orderbookDepthAmountUsd);
2526
+ }
2499
2527
  return this.request("/crypto/recurring-markets", {
2500
2528
  query: Object.keys(query).length > 0 ? query : void 0,
2501
2529
  signal: options == null ? void 0 : options.signal
@@ -2571,10 +2599,22 @@ Issued At: ${issuedAt}`;
2571
2599
  if (options == null ? void 0 : options.status) query.status = options.status;
2572
2600
  if ((options == null ? void 0 : options.categoryIds) && options.categoryIds.length > 0)
2573
2601
  query.categoryIds = options.categoryIds;
2602
+ if ((options == null ? void 0 : options.aggKey) && options.aggKey.length > 0) query.aggKey = options.aggKey;
2603
+ if ((options == null ? void 0 : options.sportsMarketType) && options.sportsMarketType.length > 0) {
2604
+ query.sportsMarketType = options.sportsMarketType;
2605
+ }
2606
+ if ((options == null ? void 0 : options.period) && options.period.length > 0) query.period = options.period;
2607
+ if ((options == null ? void 0 : options.marketCategory) && options.marketCategory.length > 0) {
2608
+ query.marketCategory = options.marketCategory;
2609
+ }
2610
+ if ((options == null ? void 0 : options.marketGroup) && options.marketGroup.length > 0) {
2611
+ query.marketGroup = options.marketGroup;
2612
+ }
2574
2613
  if ((options == null ? void 0 : options.limit) != null) query.limit = String(options.limit);
2575
2614
  if (options == null ? void 0 : options.cursor) query.cursor = options.cursor;
2576
2615
  if (options == null ? void 0 : options.sortBy) query.sortBy = options.sortBy;
2577
2616
  if (options == null ? void 0 : options.sortDir) query.sortDir = options.sortDir;
2617
+ if (options == null ? void 0 : options.context) query.context = options.context;
2578
2618
  return this.request("/venue-markets", {
2579
2619
  query: Object.keys(query).length > 0 ? query : void 0
2580
2620
  });
@@ -2598,6 +2638,12 @@ Issued At: ${issuedAt}`;
2598
2638
  return this.request("/app/config", init);
2599
2639
  });
2600
2640
  }
2641
+ /** Get a temporary Alchemy JWT token for RPC connections. */
2642
+ getRpcToken(init) {
2643
+ return __async(this, null, function* () {
2644
+ return this.request("/app/rpc-tokens/alchemy", init);
2645
+ });
2646
+ }
2601
2647
  buildNewsFeedQuery(options) {
2602
2648
  const query = {};
2603
2649
  if (options == null ? void 0 : options.cursor) query.cursor = options.cursor;
@@ -2901,6 +2947,15 @@ Issued At: ${issuedAt}`;
2901
2947
  });
2902
2948
  });
2903
2949
  }
2950
+ /** Quote maximum deliverable withdrawal amount for a token and destination chain. */
2951
+ getWithdrawalQuote(params) {
2952
+ return __async(this, null, function* () {
2953
+ return this.request("/execution/withdrawable/quote", {
2954
+ method: "POST",
2955
+ body: JSON.stringify(params)
2956
+ });
2957
+ });
2958
+ }
2904
2959
  /**
2905
2960
  * Read the current persisted state of a withdrawal. Used as a backfill for
2906
2961
  * the WS lifecycle channel: the client polls this on hook mount and on WS
package/dist/index.mjs CHANGED
@@ -1590,6 +1590,12 @@ var AggClient = class {
1590
1590
  if (params.cursor) query.cursor = params.cursor;
1591
1591
  return Object.keys(query).length ? query : void 0;
1592
1592
  }
1593
+ paperTradingAccountListQuery(params = {}) {
1594
+ var _a;
1595
+ const query = (_a = this.paperTradingListQuery(params)) != null ? _a : {};
1596
+ if (params.externalId) query.externalId = params.externalId;
1597
+ return Object.keys(query).length ? query : void 0;
1598
+ }
1593
1599
  withAuthPayload(payload) {
1594
1600
  var _a, _b, _c;
1595
1601
  if (typeof payload.earlyAccessCode === "string" && payload.earlyAccessCode.trim().length > 0) {
@@ -2184,6 +2190,14 @@ Issued At: ${issuedAt}`;
2184
2190
  });
2185
2191
  });
2186
2192
  }
2193
+ /** Get quote-scoped execution progress, DAG step state, and order leg terminal status. */
2194
+ getExecutionStatus(params) {
2195
+ return __async(this, null, function* () {
2196
+ const query = { quoteId: params.quoteId };
2197
+ if (params.mode) query.mode = params.mode;
2198
+ return this.request("/execution/status", { query });
2199
+ });
2200
+ }
2187
2201
  /** Unified user activity feed (trades, deposits, withdrawals, bridges, wallet ops). */
2188
2202
  getUserActivity() {
2189
2203
  return __async(this, arguments, function* (params = {}) {
@@ -2233,7 +2247,7 @@ Issued At: ${issuedAt}`;
2233
2247
  return __async(this, arguments, function* (params = {}) {
2234
2248
  const _a = params, { appId } = _a, listParams = __objRest(_a, ["appId"]);
2235
2249
  return this.request(this.paperTradingAccountsPath(appId), {
2236
- query: this.paperTradingListQuery(listParams)
2250
+ query: this.paperTradingAccountListQuery(listParams)
2237
2251
  });
2238
2252
  });
2239
2253
  }
@@ -2347,6 +2361,7 @@ Issued At: ${issuedAt}`;
2347
2361
  if ((options == null ? void 0 : options.minYesPrice) != null) query.minYesPrice = String(options.minYesPrice);
2348
2362
  if ((options == null ? void 0 : options.maxYesPrice) != null) query.maxYesPrice = String(options.maxYesPrice);
2349
2363
  if (options == null ? void 0 : options.endDateFrom) query.endDateFrom = options.endDateFrom;
2364
+ if (options == null ? void 0 : options.grouped) query.grouped = "true";
2350
2365
  return this.request("/venue-events", {
2351
2366
  query: Object.keys(query).length > 0 ? query : void 0
2352
2367
  });
@@ -2356,6 +2371,10 @@ Issued At: ${issuedAt}`;
2356
2371
  getVenueEventById(id, options) {
2357
2372
  return __async(this, null, function* () {
2358
2373
  return this.request(`/venue-events/${encodeURIComponent(id)}`, {
2374
+ // Opt into the lean response (no embedded `venueMarkets`) — markets are
2375
+ // fetched separately via GET /venue-markets. Empty `expand` (no `markets`
2376
+ // token) tells the API to omit the deprecated embedded array.
2377
+ query: { expand: "" },
2359
2378
  signal: options == null ? void 0 : options.signal
2360
2379
  });
2361
2380
  });
@@ -2383,6 +2402,15 @@ Issued At: ${issuedAt}`;
2383
2402
  if ((options == null ? void 0 : options.includeDirectVenueMarkets) != null) {
2384
2403
  query.includeDirectVenueMarkets = String(options.includeDirectVenueMarkets);
2385
2404
  }
2405
+ if ((options == null ? void 0 : options.includeOrderbookDepth) != null) {
2406
+ query.includeOrderbookDepth = String(options.includeOrderbookDepth);
2407
+ }
2408
+ if ((options == null ? void 0 : options.orderbookDepth) != null) {
2409
+ query.orderbookDepth = String(options.orderbookDepth);
2410
+ }
2411
+ if ((options == null ? void 0 : options.orderbookDepthAmountUsd) != null) {
2412
+ query.orderbookDepthAmountUsd = String(options.orderbookDepthAmountUsd);
2413
+ }
2386
2414
  return this.request("/crypto/recurring-markets", {
2387
2415
  query: Object.keys(query).length > 0 ? query : void 0,
2388
2416
  signal: options == null ? void 0 : options.signal
@@ -2458,10 +2486,22 @@ Issued At: ${issuedAt}`;
2458
2486
  if (options == null ? void 0 : options.status) query.status = options.status;
2459
2487
  if ((options == null ? void 0 : options.categoryIds) && options.categoryIds.length > 0)
2460
2488
  query.categoryIds = options.categoryIds;
2489
+ if ((options == null ? void 0 : options.aggKey) && options.aggKey.length > 0) query.aggKey = options.aggKey;
2490
+ if ((options == null ? void 0 : options.sportsMarketType) && options.sportsMarketType.length > 0) {
2491
+ query.sportsMarketType = options.sportsMarketType;
2492
+ }
2493
+ if ((options == null ? void 0 : options.period) && options.period.length > 0) query.period = options.period;
2494
+ if ((options == null ? void 0 : options.marketCategory) && options.marketCategory.length > 0) {
2495
+ query.marketCategory = options.marketCategory;
2496
+ }
2497
+ if ((options == null ? void 0 : options.marketGroup) && options.marketGroup.length > 0) {
2498
+ query.marketGroup = options.marketGroup;
2499
+ }
2461
2500
  if ((options == null ? void 0 : options.limit) != null) query.limit = String(options.limit);
2462
2501
  if (options == null ? void 0 : options.cursor) query.cursor = options.cursor;
2463
2502
  if (options == null ? void 0 : options.sortBy) query.sortBy = options.sortBy;
2464
2503
  if (options == null ? void 0 : options.sortDir) query.sortDir = options.sortDir;
2504
+ if (options == null ? void 0 : options.context) query.context = options.context;
2465
2505
  return this.request("/venue-markets", {
2466
2506
  query: Object.keys(query).length > 0 ? query : void 0
2467
2507
  });
@@ -2485,6 +2525,12 @@ Issued At: ${issuedAt}`;
2485
2525
  return this.request("/app/config", init);
2486
2526
  });
2487
2527
  }
2528
+ /** Get a temporary Alchemy JWT token for RPC connections. */
2529
+ getRpcToken(init) {
2530
+ return __async(this, null, function* () {
2531
+ return this.request("/app/rpc-tokens/alchemy", init);
2532
+ });
2533
+ }
2488
2534
  buildNewsFeedQuery(options) {
2489
2535
  const query = {};
2490
2536
  if (options == null ? void 0 : options.cursor) query.cursor = options.cursor;
@@ -2788,6 +2834,15 @@ Issued At: ${issuedAt}`;
2788
2834
  });
2789
2835
  });
2790
2836
  }
2837
+ /** Quote maximum deliverable withdrawal amount for a token and destination chain. */
2838
+ getWithdrawalQuote(params) {
2839
+ return __async(this, null, function* () {
2840
+ return this.request("/execution/withdrawable/quote", {
2841
+ method: "POST",
2842
+ body: JSON.stringify(params)
2843
+ });
2844
+ });
2845
+ }
2791
2846
  /**
2792
2847
  * Read the current persisted state of a withdrawal. Used as a backfill for
2793
2848
  * the WS lifecycle channel: the client polls this on hook mount and on WS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/sdk",
3
- "version": "2.1.2",
3
+ "version": "2.2.0",
4
4
  "description": "Vanilla TypeScript client for the AGG prediction market aggregator (auth, markets, orderbooks, charts, trading, managed execution, WebSockets). Works in browsers, Node.js, and React Native.",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -62,8 +62,8 @@
62
62
  }
63
63
  },
64
64
  "dependencies": {
65
- "@polymarket/builder-signing-sdk": "^0.0.8",
66
- "@polymarket/clob-client": "^5.2.3",
65
+ "@polymarket/builder-signing-sdk": "^1.0.0",
66
+ "@polymarket/clob-client": "^5.8.1",
67
67
  "ethers": "^5.7.2",
68
68
  "viem": "^2.46.2"
69
69
  },