@agg-build/sdk 2.4.7 → 2.5.1

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
@@ -27,10 +27,19 @@ declare function isVenueActive(venue: string): boolean;
27
27
  /** Whether a venue is intentionally retained only for wind-down/history flows. */
28
28
  declare function isVenueInactive(venue: string): boolean;
29
29
  /**
30
- * Merge app-specific disabled venues with the compile-time retired set.
31
- * Results use the canonical {@link VENUES} order and ignore unknown values.
30
+ * Data-plane visibility (listings/search/orderbook DISPLAY). Distinct from
31
+ * {@link isVenueActive} (execution/routing) this predicate never affects
32
+ * whether a venue can trade. `dataVisibleOverride` un-hides specific venues
33
+ * for DATA surfaces only; callers pass an env-derived list.
32
34
  */
33
- declare function getEffectiveDisabledVenues(disabledVenues?: readonly (Venue | string)[]): Venue[];
35
+ declare function isVenueDataVisible(venue: string, dataVisibleOverride?: readonly Venue[]): boolean;
36
+ /**
37
+ * Merge app-specific disabled venues with the compile-time retired set, then
38
+ * remove any venue explicitly opted into data visibility via
39
+ * `dataVisibleVenues` (see {@link isVenueDataVisible}). Results use the
40
+ * canonical {@link VENUES} order and ignore unknown values.
41
+ */
42
+ declare function getEffectiveDisabledVenues(disabledVenues?: readonly (Venue | string)[], dataVisibleVenues?: readonly Venue[]): Venue[];
34
43
 
35
44
  declare enum ImageSize {
36
45
  sm = 44,
@@ -437,6 +446,17 @@ type WalletTokenBalance = {
437
446
  }[];
438
447
  };
439
448
  type PriceSource = "orderbook" | "cached" | "entry" | "settled";
449
+ /**
450
+ * Health of the orderbook a position was marked against — passthrough of
451
+ * the engine's `BookQuality` verdict. `priceSource` says where a mark came
452
+ * from; this says whether that source was trustworthy. Anything other than
453
+ * `healthy` is a low-confidence mark.
454
+ *
455
+ * Read `priceSource` first — this only qualifies book-derived marks. A
456
+ * `settled` position is exact (1/0) and consults no book, so it reports
457
+ * `empty`; that is not a confidence signal.
458
+ */
459
+ type BookQuality = "healthy" | "wide_spread" | "bid_only" | "ask_only" | "endpoint_stub" | "crossed" | "empty";
440
460
  type VenuePositionBalance = {
441
461
  venue: Venue;
442
462
  balance: number;
@@ -444,6 +464,7 @@ type VenuePositionBalance = {
444
464
  unrealizedPnl: number;
445
465
  realizedPnl: number;
446
466
  priceSource: PriceSource;
467
+ bookQuality: BookQuality;
447
468
  };
448
469
  type UnifiedBalanceResponse = {
449
470
  cash: {
@@ -530,6 +551,20 @@ type OrderListItem = {
530
551
  venue: Venue;
531
552
  side: string;
532
553
  amountRaw: string;
554
+ orderType?: "market" | "limit" | undefined;
555
+ limitPriceRaw: string | null;
556
+ limitSizeRaw?: string | null | undefined;
557
+ timeInForce: TimeInForce | null;
558
+ postOnly?: boolean | undefined;
559
+ expiresAt: Date | string | null;
560
+ reservedCostRaw?: string | null | undefined;
561
+ filledSizeRaw?: string | null | undefined;
562
+ filledCostRaw?: string | null | undefined;
563
+ remainingSizeRaw?: string | null | undefined;
564
+ averageFillPriceRaw?: string | null | undefined;
565
+ venueOrderId?: string | null | undefined;
566
+ cancelRequestedAt?: Date | string | null | undefined;
567
+ cancelledAt?: Date | string | null | undefined;
533
568
  slippageBps: number | null;
534
569
  quotedPriceRaw: string | null;
535
570
  quotedCostRaw: string | null;
@@ -592,6 +627,7 @@ type PositionGroup = {
592
627
  totalValue: number;
593
628
  unrealizedPnlPercent: number;
594
629
  priceSource: PriceSource;
630
+ bookQuality: BookQuality;
595
631
  }[];
596
632
  };
597
633
  targetMarketId: string;
@@ -1010,92 +1046,6 @@ type WithdrawalSource = {
1010
1046
  type SyncBalancesResponse = {
1011
1047
  synced: true;
1012
1048
  };
1013
- type MatchingReport = {
1014
- summary: {
1015
- events: {
1016
- pending: number;
1017
- total: number;
1018
- unmatched: number;
1019
- review: number;
1020
- matched: number;
1021
- verified: number;
1022
- rejected: number;
1023
- };
1024
- markets: {
1025
- pending: number;
1026
- total: number;
1027
- unmatched: number;
1028
- review: number;
1029
- matched: number;
1030
- verified: number;
1031
- rejected: number;
1032
- };
1033
- crossVenue: {
1034
- events: number;
1035
- markets: number;
1036
- };
1037
- matchTypes: {
1038
- manual: number;
1039
- llm: number;
1040
- dome: number;
1041
- };
1042
- llm: {
1043
- pending: number;
1044
- total: number;
1045
- matched: number;
1046
- rejected: number;
1047
- resolved: number;
1048
- failed: number;
1049
- avgConfidenceMatched: number | null;
1050
- avgConfidenceRelated: number | null;
1051
- avgConfidenceNoMatch: number | null;
1052
- avgLatencyMs: number | null;
1053
- };
1054
- };
1055
- matchDistribution: {
1056
- events: {
1057
- min: number;
1058
- max: number;
1059
- avg: number;
1060
- };
1061
- markets: {
1062
- min: number;
1063
- max: number;
1064
- avg: number;
1065
- };
1066
- };
1067
- byCategory: {
1068
- total: number;
1069
- unmatched: number;
1070
- matched: number;
1071
- categoryId: string;
1072
- categoryName: string;
1073
- byVenue: Record<string, number>;
1074
- }[];
1075
- byVenue: {
1076
- venue: string;
1077
- events: {
1078
- total: number;
1079
- matched: number;
1080
- verified: number;
1081
- rejected: number;
1082
- };
1083
- markets: {
1084
- total: number;
1085
- matched: number;
1086
- verified: number;
1087
- rejected: number;
1088
- };
1089
- }[];
1090
- timeSeries: {
1091
- date: string;
1092
- matchedEvents: number;
1093
- matchedMarkets: number;
1094
- llmTotal: number;
1095
- llmMatched: number;
1096
- llmRejected: number;
1097
- }[];
1098
- };
1099
1049
 
1100
1050
  /**
1101
1051
  * API response-boundary formatters for market display fields.
@@ -1264,9 +1214,8 @@ declare const sortVenues: <T extends string>(venues: readonly T[]) => T[];
1264
1214
  /**
1265
1215
  * Build an external URL to a venue's event/market page.
1266
1216
  *
1267
- * Single source of truth — used by API services (market-intel digests,
1268
- * gap-alerts) AND by the admin Matched Events page to deep-link rows out
1269
- * to the venue's UI.
1217
+ * Single source of truth — used by API services AND by the admin Matched
1218
+ * Events page to deep-link rows out to the venue's UI.
1270
1219
  *
1271
1220
  * Returns `null` when there isn't enough data to construct a working URL.
1272
1221
  * Callers should hide the link button rather than render a broken href.
@@ -2568,6 +2517,29 @@ interface ExecuteManagedResponse {
2568
2517
  redeemId?: string;
2569
2518
  message?: string;
2570
2519
  }
2520
+ type LimitOrderTimeInForce = "GTC" | "GTD" | "FOK" | "FAK" | "IOC" | "ALO";
2521
+ interface PlaceLimitOrderParams {
2522
+ venue: Venue;
2523
+ venueMarketOutcomeId: string;
2524
+ side: "buy" | "sell";
2525
+ limitPriceRaw: string;
2526
+ sizeRaw: string;
2527
+ timeInForce: LimitOrderTimeInForce;
2528
+ postOnly?: boolean;
2529
+ expiresAt?: string;
2530
+ clientOrderId?: string;
2531
+ }
2532
+ interface PlaceLimitOrderResponse {
2533
+ orderId: string;
2534
+ status: "pending" | "open" | "partially_filled_open" | "filled" | "cancelled" | "expired" | "failed";
2535
+ venue: Venue;
2536
+ venueOrderId?: string | null;
2537
+ reservedCostRaw?: string | null;
2538
+ limitPriceRaw: string;
2539
+ limitSizeRaw: string;
2540
+ filledSizeRaw: string;
2541
+ remainingSizeRaw: string;
2542
+ }
2571
2543
  interface ValidateManagedParams {
2572
2544
  venueMarketOutcomeIds: string[];
2573
2545
  side: "buy" | "sell";
@@ -3352,9 +3324,9 @@ interface SmartRouteResponse {
3352
3324
  side?: SmartRouteSide;
3353
3325
  }
3354
3326
  interface CancelManagedExecutionResponse {
3355
- quoteId: string;
3327
+ quoteId: string | null;
3356
3328
  orderIds: string[];
3357
- status: "cancelled";
3329
+ status: "cancelled" | "cancel_pending";
3358
3330
  }
3359
3331
  type PositionRedeemStatus = "eligible" | "pending" | "redeemed" | "ineligible";
3360
3332
  type RedeemLegStatus = "submitted" | "confirmed" | "ineligible" | "rejected";
@@ -3997,6 +3969,8 @@ declare class AggClient {
3997
3969
  quoteManaged(params: QuoteManagedParams): Promise<QuoteManagedResponse>;
3998
3970
  /** Execute a previously quoted managed trade. Returns pending order IDs. */
3999
3971
  executeManaged(params: ExecuteManagedParams): Promise<ExecuteManagedResponse>;
3972
+ /** Place a managed limit order. Returns the venue-backed order state. */
3973
+ placeLimitOrder(params: PlaceLimitOrderParams): Promise<PlaceLimitOrderResponse>;
4000
3974
  /** Redeem resolved winning positions by venue market outcome ids. */
4001
3975
  redeem(body: RedeemRequest): Promise<RedeemResponse>;
4002
3976
  /** Withdraw funds from managed wallets to an external address. */
@@ -4121,4 +4095,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
4121
4095
 
4122
4096
  declare function createAggClient(options: AggClientOptions): AggClient;
4123
4097
 
4124
- export { ACTIVE_VENUES, 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, INACTIVE_VENUES, 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 SettlementDiff, type SettlementDifference, 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, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isVenueActive, isVenueInactive, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
4098
+ export { ACTIVE_VENUES, 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 BookQuality, 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, INACTIVE_VENUES, ImageSize, type LimitOrderTimeInForce, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, 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 PlaceLimitOrderParams, type PlaceLimitOrderResponse, 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 SettlementDiff, type SettlementDifference, 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, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isVenueActive, isVenueDataVisible, isVenueInactive, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
package/dist/index.d.ts CHANGED
@@ -27,10 +27,19 @@ declare function isVenueActive(venue: string): boolean;
27
27
  /** Whether a venue is intentionally retained only for wind-down/history flows. */
28
28
  declare function isVenueInactive(venue: string): boolean;
29
29
  /**
30
- * Merge app-specific disabled venues with the compile-time retired set.
31
- * Results use the canonical {@link VENUES} order and ignore unknown values.
30
+ * Data-plane visibility (listings/search/orderbook DISPLAY). Distinct from
31
+ * {@link isVenueActive} (execution/routing) this predicate never affects
32
+ * whether a venue can trade. `dataVisibleOverride` un-hides specific venues
33
+ * for DATA surfaces only; callers pass an env-derived list.
32
34
  */
33
- declare function getEffectiveDisabledVenues(disabledVenues?: readonly (Venue | string)[]): Venue[];
35
+ declare function isVenueDataVisible(venue: string, dataVisibleOverride?: readonly Venue[]): boolean;
36
+ /**
37
+ * Merge app-specific disabled venues with the compile-time retired set, then
38
+ * remove any venue explicitly opted into data visibility via
39
+ * `dataVisibleVenues` (see {@link isVenueDataVisible}). Results use the
40
+ * canonical {@link VENUES} order and ignore unknown values.
41
+ */
42
+ declare function getEffectiveDisabledVenues(disabledVenues?: readonly (Venue | string)[], dataVisibleVenues?: readonly Venue[]): Venue[];
34
43
 
35
44
  declare enum ImageSize {
36
45
  sm = 44,
@@ -437,6 +446,17 @@ type WalletTokenBalance = {
437
446
  }[];
438
447
  };
439
448
  type PriceSource = "orderbook" | "cached" | "entry" | "settled";
449
+ /**
450
+ * Health of the orderbook a position was marked against — passthrough of
451
+ * the engine's `BookQuality` verdict. `priceSource` says where a mark came
452
+ * from; this says whether that source was trustworthy. Anything other than
453
+ * `healthy` is a low-confidence mark.
454
+ *
455
+ * Read `priceSource` first — this only qualifies book-derived marks. A
456
+ * `settled` position is exact (1/0) and consults no book, so it reports
457
+ * `empty`; that is not a confidence signal.
458
+ */
459
+ type BookQuality = "healthy" | "wide_spread" | "bid_only" | "ask_only" | "endpoint_stub" | "crossed" | "empty";
440
460
  type VenuePositionBalance = {
441
461
  venue: Venue;
442
462
  balance: number;
@@ -444,6 +464,7 @@ type VenuePositionBalance = {
444
464
  unrealizedPnl: number;
445
465
  realizedPnl: number;
446
466
  priceSource: PriceSource;
467
+ bookQuality: BookQuality;
447
468
  };
448
469
  type UnifiedBalanceResponse = {
449
470
  cash: {
@@ -530,6 +551,20 @@ type OrderListItem = {
530
551
  venue: Venue;
531
552
  side: string;
532
553
  amountRaw: string;
554
+ orderType?: "market" | "limit" | undefined;
555
+ limitPriceRaw: string | null;
556
+ limitSizeRaw?: string | null | undefined;
557
+ timeInForce: TimeInForce | null;
558
+ postOnly?: boolean | undefined;
559
+ expiresAt: Date | string | null;
560
+ reservedCostRaw?: string | null | undefined;
561
+ filledSizeRaw?: string | null | undefined;
562
+ filledCostRaw?: string | null | undefined;
563
+ remainingSizeRaw?: string | null | undefined;
564
+ averageFillPriceRaw?: string | null | undefined;
565
+ venueOrderId?: string | null | undefined;
566
+ cancelRequestedAt?: Date | string | null | undefined;
567
+ cancelledAt?: Date | string | null | undefined;
533
568
  slippageBps: number | null;
534
569
  quotedPriceRaw: string | null;
535
570
  quotedCostRaw: string | null;
@@ -592,6 +627,7 @@ type PositionGroup = {
592
627
  totalValue: number;
593
628
  unrealizedPnlPercent: number;
594
629
  priceSource: PriceSource;
630
+ bookQuality: BookQuality;
595
631
  }[];
596
632
  };
597
633
  targetMarketId: string;
@@ -1010,92 +1046,6 @@ type WithdrawalSource = {
1010
1046
  type SyncBalancesResponse = {
1011
1047
  synced: true;
1012
1048
  };
1013
- type MatchingReport = {
1014
- summary: {
1015
- events: {
1016
- pending: number;
1017
- total: number;
1018
- unmatched: number;
1019
- review: number;
1020
- matched: number;
1021
- verified: number;
1022
- rejected: number;
1023
- };
1024
- markets: {
1025
- pending: number;
1026
- total: number;
1027
- unmatched: number;
1028
- review: number;
1029
- matched: number;
1030
- verified: number;
1031
- rejected: number;
1032
- };
1033
- crossVenue: {
1034
- events: number;
1035
- markets: number;
1036
- };
1037
- matchTypes: {
1038
- manual: number;
1039
- llm: number;
1040
- dome: number;
1041
- };
1042
- llm: {
1043
- pending: number;
1044
- total: number;
1045
- matched: number;
1046
- rejected: number;
1047
- resolved: number;
1048
- failed: number;
1049
- avgConfidenceMatched: number | null;
1050
- avgConfidenceRelated: number | null;
1051
- avgConfidenceNoMatch: number | null;
1052
- avgLatencyMs: number | null;
1053
- };
1054
- };
1055
- matchDistribution: {
1056
- events: {
1057
- min: number;
1058
- max: number;
1059
- avg: number;
1060
- };
1061
- markets: {
1062
- min: number;
1063
- max: number;
1064
- avg: number;
1065
- };
1066
- };
1067
- byCategory: {
1068
- total: number;
1069
- unmatched: number;
1070
- matched: number;
1071
- categoryId: string;
1072
- categoryName: string;
1073
- byVenue: Record<string, number>;
1074
- }[];
1075
- byVenue: {
1076
- venue: string;
1077
- events: {
1078
- total: number;
1079
- matched: number;
1080
- verified: number;
1081
- rejected: number;
1082
- };
1083
- markets: {
1084
- total: number;
1085
- matched: number;
1086
- verified: number;
1087
- rejected: number;
1088
- };
1089
- }[];
1090
- timeSeries: {
1091
- date: string;
1092
- matchedEvents: number;
1093
- matchedMarkets: number;
1094
- llmTotal: number;
1095
- llmMatched: number;
1096
- llmRejected: number;
1097
- }[];
1098
- };
1099
1049
 
1100
1050
  /**
1101
1051
  * API response-boundary formatters for market display fields.
@@ -1264,9 +1214,8 @@ declare const sortVenues: <T extends string>(venues: readonly T[]) => T[];
1264
1214
  /**
1265
1215
  * Build an external URL to a venue's event/market page.
1266
1216
  *
1267
- * Single source of truth — used by API services (market-intel digests,
1268
- * gap-alerts) AND by the admin Matched Events page to deep-link rows out
1269
- * to the venue's UI.
1217
+ * Single source of truth — used by API services AND by the admin Matched
1218
+ * Events page to deep-link rows out to the venue's UI.
1270
1219
  *
1271
1220
  * Returns `null` when there isn't enough data to construct a working URL.
1272
1221
  * Callers should hide the link button rather than render a broken href.
@@ -2568,6 +2517,29 @@ interface ExecuteManagedResponse {
2568
2517
  redeemId?: string;
2569
2518
  message?: string;
2570
2519
  }
2520
+ type LimitOrderTimeInForce = "GTC" | "GTD" | "FOK" | "FAK" | "IOC" | "ALO";
2521
+ interface PlaceLimitOrderParams {
2522
+ venue: Venue;
2523
+ venueMarketOutcomeId: string;
2524
+ side: "buy" | "sell";
2525
+ limitPriceRaw: string;
2526
+ sizeRaw: string;
2527
+ timeInForce: LimitOrderTimeInForce;
2528
+ postOnly?: boolean;
2529
+ expiresAt?: string;
2530
+ clientOrderId?: string;
2531
+ }
2532
+ interface PlaceLimitOrderResponse {
2533
+ orderId: string;
2534
+ status: "pending" | "open" | "partially_filled_open" | "filled" | "cancelled" | "expired" | "failed";
2535
+ venue: Venue;
2536
+ venueOrderId?: string | null;
2537
+ reservedCostRaw?: string | null;
2538
+ limitPriceRaw: string;
2539
+ limitSizeRaw: string;
2540
+ filledSizeRaw: string;
2541
+ remainingSizeRaw: string;
2542
+ }
2571
2543
  interface ValidateManagedParams {
2572
2544
  venueMarketOutcomeIds: string[];
2573
2545
  side: "buy" | "sell";
@@ -3352,9 +3324,9 @@ interface SmartRouteResponse {
3352
3324
  side?: SmartRouteSide;
3353
3325
  }
3354
3326
  interface CancelManagedExecutionResponse {
3355
- quoteId: string;
3327
+ quoteId: string | null;
3356
3328
  orderIds: string[];
3357
- status: "cancelled";
3329
+ status: "cancelled" | "cancel_pending";
3358
3330
  }
3359
3331
  type PositionRedeemStatus = "eligible" | "pending" | "redeemed" | "ineligible";
3360
3332
  type RedeemLegStatus = "submitted" | "confirmed" | "ineligible" | "rejected";
@@ -3997,6 +3969,8 @@ declare class AggClient {
3997
3969
  quoteManaged(params: QuoteManagedParams): Promise<QuoteManagedResponse>;
3998
3970
  /** Execute a previously quoted managed trade. Returns pending order IDs. */
3999
3971
  executeManaged(params: ExecuteManagedParams): Promise<ExecuteManagedResponse>;
3972
+ /** Place a managed limit order. Returns the venue-backed order state. */
3973
+ placeLimitOrder(params: PlaceLimitOrderParams): Promise<PlaceLimitOrderResponse>;
4000
3974
  /** Redeem resolved winning positions by venue market outcome ids. */
4001
3975
  redeem(body: RedeemRequest): Promise<RedeemResponse>;
4002
3976
  /** Withdraw funds from managed wallets to an external address. */
@@ -4121,4 +4095,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
4121
4095
 
4122
4096
  declare function createAggClient(options: AggClientOptions): AggClient;
4123
4097
 
4124
- export { ACTIVE_VENUES, 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, INACTIVE_VENUES, 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 SettlementDiff, type SettlementDifference, 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, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isVenueActive, isVenueInactive, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
4098
+ export { ACTIVE_VENUES, 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 BookQuality, 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, INACTIVE_VENUES, ImageSize, type LimitOrderTimeInForce, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, 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 PlaceLimitOrderParams, type PlaceLimitOrderResponse, 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 SettlementDiff, type SettlementDifference, 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, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isVenueActive, isVenueDataVisible, isVenueInactive, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
package/dist/index.js CHANGED
@@ -109,6 +109,7 @@ __export(index_exports, {
109
109
  isFiniteNonNeg: () => isFiniteNonNeg,
110
110
  isNonEmptyString: () => isNonEmptyString,
111
111
  isVenueActive: () => isVenueActive,
112
+ isVenueDataVisible: () => isVenueDataVisible,
112
113
  isVenueInactive: () => isVenueInactive,
113
114
  mergeCandles: () => mergeCandles,
114
115
  mergeClosedCandles: () => mergeClosedCandles,
@@ -170,10 +171,16 @@ function isVenueInactive(venue) {
170
171
  if (ACTIVE_VENUE_SET.has(venue)) return false;
171
172
  return INACTIVE_VENUE_SET.has(normalizeVenue(venue));
172
173
  }
173
- function getEffectiveDisabledVenues(disabledVenues = []) {
174
- if (disabledVenues.length === 0) return [...INACTIVE_VENUES];
174
+ function isVenueDataVisible(venue, dataVisibleOverride = []) {
175
+ if (isVenueActive(venue)) return true;
176
+ const n = normalizeVenue(venue);
177
+ return dataVisibleOverride.some((v) => normalizeVenue(v) === n);
178
+ }
179
+ function getEffectiveDisabledVenues(disabledVenues = [], dataVisibleVenues = []) {
180
+ if (disabledVenues.length === 0 && dataVisibleVenues.length === 0) return [...INACTIVE_VENUES];
175
181
  const disabled = new Set(disabledVenues.map(normalizeVenue));
176
182
  for (const venue of INACTIVE_VENUES) disabled.add(venue);
183
+ for (const venue of dataVisibleVenues) disabled.delete(normalizeVenue(venue));
177
184
  return VENUES.filter((venue) => disabled.has(venue));
178
185
  }
179
186
 
@@ -2975,6 +2982,15 @@ Issued At: ${issuedAt}`;
2975
2982
  });
2976
2983
  });
2977
2984
  }
2985
+ /** Place a managed limit order. Returns the venue-backed order state. */
2986
+ placeLimitOrder(params) {
2987
+ return __async(this, null, function* () {
2988
+ return this.request("/execution/limit-orders", {
2989
+ method: "POST",
2990
+ body: JSON.stringify(params)
2991
+ });
2992
+ });
2993
+ }
2978
2994
  /** Redeem resolved winning positions by venue market outcome ids. */
2979
2995
  redeem(body) {
2980
2996
  return __async(this, null, function* () {
@@ -3357,6 +3373,7 @@ function createAggClient(options) {
3357
3373
  isFiniteNonNeg,
3358
3374
  isNonEmptyString,
3359
3375
  isVenueActive,
3376
+ isVenueDataVisible,
3360
3377
  isVenueInactive,
3361
3378
  mergeCandles,
3362
3379
  mergeClosedCandles,
package/dist/index.mjs CHANGED
@@ -52,10 +52,16 @@ function isVenueInactive(venue) {
52
52
  if (ACTIVE_VENUE_SET.has(venue)) return false;
53
53
  return INACTIVE_VENUE_SET.has(normalizeVenue(venue));
54
54
  }
55
- function getEffectiveDisabledVenues(disabledVenues = []) {
56
- if (disabledVenues.length === 0) return [...INACTIVE_VENUES];
55
+ function isVenueDataVisible(venue, dataVisibleOverride = []) {
56
+ if (isVenueActive(venue)) return true;
57
+ const n = normalizeVenue(venue);
58
+ return dataVisibleOverride.some((v) => normalizeVenue(v) === n);
59
+ }
60
+ function getEffectiveDisabledVenues(disabledVenues = [], dataVisibleVenues = []) {
61
+ if (disabledVenues.length === 0 && dataVisibleVenues.length === 0) return [...INACTIVE_VENUES];
57
62
  const disabled = new Set(disabledVenues.map(normalizeVenue));
58
63
  for (const venue of INACTIVE_VENUES) disabled.add(venue);
64
+ for (const venue of dataVisibleVenues) disabled.delete(normalizeVenue(venue));
59
65
  return VENUES.filter((venue) => disabled.has(venue));
60
66
  }
61
67
 
@@ -2857,6 +2863,15 @@ Issued At: ${issuedAt}`;
2857
2863
  });
2858
2864
  });
2859
2865
  }
2866
+ /** Place a managed limit order. Returns the venue-backed order state. */
2867
+ placeLimitOrder(params) {
2868
+ return __async(this, null, function* () {
2869
+ return this.request("/execution/limit-orders", {
2870
+ method: "POST",
2871
+ body: JSON.stringify(params)
2872
+ });
2873
+ });
2874
+ }
2860
2875
  /** Redeem resolved winning positions by venue market outcome ids. */
2861
2876
  redeem(body) {
2862
2877
  return __async(this, null, function* () {
@@ -3238,6 +3253,7 @@ export {
3238
3253
  isFiniteNonNeg,
3239
3254
  isNonEmptyString,
3240
3255
  isVenueActive,
3256
+ isVenueDataVisible,
3241
3257
  isVenueInactive,
3242
3258
  mergeCandles,
3243
3259
  mergeClosedCandles,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/sdk",
3
- "version": "2.4.7",
3
+ "version": "2.5.1",
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",