@agg-build/sdk 2.5.0 → 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 +56 -95
- package/dist/index.d.ts +56 -95
- package/dist/index.js +19 -2
- package/dist/index.mjs +18 -2
- package/package.json +1 -1
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
|
-
*
|
|
31
|
-
*
|
|
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
|
|
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,
|
|
@@ -542,6 +551,20 @@ type OrderListItem = {
|
|
|
542
551
|
venue: Venue;
|
|
543
552
|
side: string;
|
|
544
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;
|
|
545
568
|
slippageBps: number | null;
|
|
546
569
|
quotedPriceRaw: string | null;
|
|
547
570
|
quotedCostRaw: string | null;
|
|
@@ -1023,92 +1046,6 @@ type WithdrawalSource = {
|
|
|
1023
1046
|
type SyncBalancesResponse = {
|
|
1024
1047
|
synced: true;
|
|
1025
1048
|
};
|
|
1026
|
-
type MatchingReport = {
|
|
1027
|
-
summary: {
|
|
1028
|
-
events: {
|
|
1029
|
-
pending: number;
|
|
1030
|
-
total: number;
|
|
1031
|
-
unmatched: number;
|
|
1032
|
-
review: number;
|
|
1033
|
-
matched: number;
|
|
1034
|
-
verified: number;
|
|
1035
|
-
rejected: number;
|
|
1036
|
-
};
|
|
1037
|
-
markets: {
|
|
1038
|
-
pending: number;
|
|
1039
|
-
total: number;
|
|
1040
|
-
unmatched: number;
|
|
1041
|
-
review: number;
|
|
1042
|
-
matched: number;
|
|
1043
|
-
verified: number;
|
|
1044
|
-
rejected: number;
|
|
1045
|
-
};
|
|
1046
|
-
crossVenue: {
|
|
1047
|
-
events: number;
|
|
1048
|
-
markets: number;
|
|
1049
|
-
};
|
|
1050
|
-
matchTypes: {
|
|
1051
|
-
manual: number;
|
|
1052
|
-
llm: number;
|
|
1053
|
-
dome: number;
|
|
1054
|
-
};
|
|
1055
|
-
llm: {
|
|
1056
|
-
pending: number;
|
|
1057
|
-
total: number;
|
|
1058
|
-
matched: number;
|
|
1059
|
-
rejected: number;
|
|
1060
|
-
resolved: number;
|
|
1061
|
-
failed: number;
|
|
1062
|
-
avgConfidenceMatched: number | null;
|
|
1063
|
-
avgConfidenceRelated: number | null;
|
|
1064
|
-
avgConfidenceNoMatch: number | null;
|
|
1065
|
-
avgLatencyMs: number | null;
|
|
1066
|
-
};
|
|
1067
|
-
};
|
|
1068
|
-
matchDistribution: {
|
|
1069
|
-
events: {
|
|
1070
|
-
min: number;
|
|
1071
|
-
max: number;
|
|
1072
|
-
avg: number;
|
|
1073
|
-
};
|
|
1074
|
-
markets: {
|
|
1075
|
-
min: number;
|
|
1076
|
-
max: number;
|
|
1077
|
-
avg: number;
|
|
1078
|
-
};
|
|
1079
|
-
};
|
|
1080
|
-
byCategory: {
|
|
1081
|
-
total: number;
|
|
1082
|
-
unmatched: number;
|
|
1083
|
-
matched: number;
|
|
1084
|
-
categoryId: string;
|
|
1085
|
-
categoryName: string;
|
|
1086
|
-
byVenue: Record<string, number>;
|
|
1087
|
-
}[];
|
|
1088
|
-
byVenue: {
|
|
1089
|
-
venue: string;
|
|
1090
|
-
events: {
|
|
1091
|
-
total: number;
|
|
1092
|
-
matched: number;
|
|
1093
|
-
verified: number;
|
|
1094
|
-
rejected: number;
|
|
1095
|
-
};
|
|
1096
|
-
markets: {
|
|
1097
|
-
total: number;
|
|
1098
|
-
matched: number;
|
|
1099
|
-
verified: number;
|
|
1100
|
-
rejected: number;
|
|
1101
|
-
};
|
|
1102
|
-
}[];
|
|
1103
|
-
timeSeries: {
|
|
1104
|
-
date: string;
|
|
1105
|
-
matchedEvents: number;
|
|
1106
|
-
matchedMarkets: number;
|
|
1107
|
-
llmTotal: number;
|
|
1108
|
-
llmMatched: number;
|
|
1109
|
-
llmRejected: number;
|
|
1110
|
-
}[];
|
|
1111
|
-
};
|
|
1112
1049
|
|
|
1113
1050
|
/**
|
|
1114
1051
|
* API response-boundary formatters for market display fields.
|
|
@@ -1277,9 +1214,8 @@ declare const sortVenues: <T extends string>(venues: readonly T[]) => T[];
|
|
|
1277
1214
|
/**
|
|
1278
1215
|
* Build an external URL to a venue's event/market page.
|
|
1279
1216
|
*
|
|
1280
|
-
* Single source of truth — used by API services
|
|
1281
|
-
*
|
|
1282
|
-
* 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.
|
|
1283
1219
|
*
|
|
1284
1220
|
* Returns `null` when there isn't enough data to construct a working URL.
|
|
1285
1221
|
* Callers should hide the link button rather than render a broken href.
|
|
@@ -2581,6 +2517,29 @@ interface ExecuteManagedResponse {
|
|
|
2581
2517
|
redeemId?: string;
|
|
2582
2518
|
message?: string;
|
|
2583
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
|
+
}
|
|
2584
2543
|
interface ValidateManagedParams {
|
|
2585
2544
|
venueMarketOutcomeIds: string[];
|
|
2586
2545
|
side: "buy" | "sell";
|
|
@@ -3365,9 +3324,9 @@ interface SmartRouteResponse {
|
|
|
3365
3324
|
side?: SmartRouteSide;
|
|
3366
3325
|
}
|
|
3367
3326
|
interface CancelManagedExecutionResponse {
|
|
3368
|
-
quoteId: string;
|
|
3327
|
+
quoteId: string | null;
|
|
3369
3328
|
orderIds: string[];
|
|
3370
|
-
status: "cancelled";
|
|
3329
|
+
status: "cancelled" | "cancel_pending";
|
|
3371
3330
|
}
|
|
3372
3331
|
type PositionRedeemStatus = "eligible" | "pending" | "redeemed" | "ineligible";
|
|
3373
3332
|
type RedeemLegStatus = "submitted" | "confirmed" | "ineligible" | "rejected";
|
|
@@ -4010,6 +3969,8 @@ declare class AggClient {
|
|
|
4010
3969
|
quoteManaged(params: QuoteManagedParams): Promise<QuoteManagedResponse>;
|
|
4011
3970
|
/** Execute a previously quoted managed trade. Returns pending order IDs. */
|
|
4012
3971
|
executeManaged(params: ExecuteManagedParams): Promise<ExecuteManagedResponse>;
|
|
3972
|
+
/** Place a managed limit order. Returns the venue-backed order state. */
|
|
3973
|
+
placeLimitOrder(params: PlaceLimitOrderParams): Promise<PlaceLimitOrderResponse>;
|
|
4013
3974
|
/** Redeem resolved winning positions by venue market outcome ids. */
|
|
4014
3975
|
redeem(body: RedeemRequest): Promise<RedeemResponse>;
|
|
4015
3976
|
/** Withdraw funds from managed wallets to an external address. */
|
|
@@ -4134,4 +4095,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
|
|
|
4134
4095
|
|
|
4135
4096
|
declare function createAggClient(options: AggClientOptions): AggClient;
|
|
4136
4097
|
|
|
4137
|
-
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 ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type
|
|
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
|
-
*
|
|
31
|
-
*
|
|
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
|
|
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,
|
|
@@ -542,6 +551,20 @@ type OrderListItem = {
|
|
|
542
551
|
venue: Venue;
|
|
543
552
|
side: string;
|
|
544
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;
|
|
545
568
|
slippageBps: number | null;
|
|
546
569
|
quotedPriceRaw: string | null;
|
|
547
570
|
quotedCostRaw: string | null;
|
|
@@ -1023,92 +1046,6 @@ type WithdrawalSource = {
|
|
|
1023
1046
|
type SyncBalancesResponse = {
|
|
1024
1047
|
synced: true;
|
|
1025
1048
|
};
|
|
1026
|
-
type MatchingReport = {
|
|
1027
|
-
summary: {
|
|
1028
|
-
events: {
|
|
1029
|
-
pending: number;
|
|
1030
|
-
total: number;
|
|
1031
|
-
unmatched: number;
|
|
1032
|
-
review: number;
|
|
1033
|
-
matched: number;
|
|
1034
|
-
verified: number;
|
|
1035
|
-
rejected: number;
|
|
1036
|
-
};
|
|
1037
|
-
markets: {
|
|
1038
|
-
pending: number;
|
|
1039
|
-
total: number;
|
|
1040
|
-
unmatched: number;
|
|
1041
|
-
review: number;
|
|
1042
|
-
matched: number;
|
|
1043
|
-
verified: number;
|
|
1044
|
-
rejected: number;
|
|
1045
|
-
};
|
|
1046
|
-
crossVenue: {
|
|
1047
|
-
events: number;
|
|
1048
|
-
markets: number;
|
|
1049
|
-
};
|
|
1050
|
-
matchTypes: {
|
|
1051
|
-
manual: number;
|
|
1052
|
-
llm: number;
|
|
1053
|
-
dome: number;
|
|
1054
|
-
};
|
|
1055
|
-
llm: {
|
|
1056
|
-
pending: number;
|
|
1057
|
-
total: number;
|
|
1058
|
-
matched: number;
|
|
1059
|
-
rejected: number;
|
|
1060
|
-
resolved: number;
|
|
1061
|
-
failed: number;
|
|
1062
|
-
avgConfidenceMatched: number | null;
|
|
1063
|
-
avgConfidenceRelated: number | null;
|
|
1064
|
-
avgConfidenceNoMatch: number | null;
|
|
1065
|
-
avgLatencyMs: number | null;
|
|
1066
|
-
};
|
|
1067
|
-
};
|
|
1068
|
-
matchDistribution: {
|
|
1069
|
-
events: {
|
|
1070
|
-
min: number;
|
|
1071
|
-
max: number;
|
|
1072
|
-
avg: number;
|
|
1073
|
-
};
|
|
1074
|
-
markets: {
|
|
1075
|
-
min: number;
|
|
1076
|
-
max: number;
|
|
1077
|
-
avg: number;
|
|
1078
|
-
};
|
|
1079
|
-
};
|
|
1080
|
-
byCategory: {
|
|
1081
|
-
total: number;
|
|
1082
|
-
unmatched: number;
|
|
1083
|
-
matched: number;
|
|
1084
|
-
categoryId: string;
|
|
1085
|
-
categoryName: string;
|
|
1086
|
-
byVenue: Record<string, number>;
|
|
1087
|
-
}[];
|
|
1088
|
-
byVenue: {
|
|
1089
|
-
venue: string;
|
|
1090
|
-
events: {
|
|
1091
|
-
total: number;
|
|
1092
|
-
matched: number;
|
|
1093
|
-
verified: number;
|
|
1094
|
-
rejected: number;
|
|
1095
|
-
};
|
|
1096
|
-
markets: {
|
|
1097
|
-
total: number;
|
|
1098
|
-
matched: number;
|
|
1099
|
-
verified: number;
|
|
1100
|
-
rejected: number;
|
|
1101
|
-
};
|
|
1102
|
-
}[];
|
|
1103
|
-
timeSeries: {
|
|
1104
|
-
date: string;
|
|
1105
|
-
matchedEvents: number;
|
|
1106
|
-
matchedMarkets: number;
|
|
1107
|
-
llmTotal: number;
|
|
1108
|
-
llmMatched: number;
|
|
1109
|
-
llmRejected: number;
|
|
1110
|
-
}[];
|
|
1111
|
-
};
|
|
1112
1049
|
|
|
1113
1050
|
/**
|
|
1114
1051
|
* API response-boundary formatters for market display fields.
|
|
@@ -1277,9 +1214,8 @@ declare const sortVenues: <T extends string>(venues: readonly T[]) => T[];
|
|
|
1277
1214
|
/**
|
|
1278
1215
|
* Build an external URL to a venue's event/market page.
|
|
1279
1216
|
*
|
|
1280
|
-
* Single source of truth — used by API services
|
|
1281
|
-
*
|
|
1282
|
-
* 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.
|
|
1283
1219
|
*
|
|
1284
1220
|
* Returns `null` when there isn't enough data to construct a working URL.
|
|
1285
1221
|
* Callers should hide the link button rather than render a broken href.
|
|
@@ -2581,6 +2517,29 @@ interface ExecuteManagedResponse {
|
|
|
2581
2517
|
redeemId?: string;
|
|
2582
2518
|
message?: string;
|
|
2583
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
|
+
}
|
|
2584
2543
|
interface ValidateManagedParams {
|
|
2585
2544
|
venueMarketOutcomeIds: string[];
|
|
2586
2545
|
side: "buy" | "sell";
|
|
@@ -3365,9 +3324,9 @@ interface SmartRouteResponse {
|
|
|
3365
3324
|
side?: SmartRouteSide;
|
|
3366
3325
|
}
|
|
3367
3326
|
interface CancelManagedExecutionResponse {
|
|
3368
|
-
quoteId: string;
|
|
3327
|
+
quoteId: string | null;
|
|
3369
3328
|
orderIds: string[];
|
|
3370
|
-
status: "cancelled";
|
|
3329
|
+
status: "cancelled" | "cancel_pending";
|
|
3371
3330
|
}
|
|
3372
3331
|
type PositionRedeemStatus = "eligible" | "pending" | "redeemed" | "ineligible";
|
|
3373
3332
|
type RedeemLegStatus = "submitted" | "confirmed" | "ineligible" | "rejected";
|
|
@@ -4010,6 +3969,8 @@ declare class AggClient {
|
|
|
4010
3969
|
quoteManaged(params: QuoteManagedParams): Promise<QuoteManagedResponse>;
|
|
4011
3970
|
/** Execute a previously quoted managed trade. Returns pending order IDs. */
|
|
4012
3971
|
executeManaged(params: ExecuteManagedParams): Promise<ExecuteManagedResponse>;
|
|
3972
|
+
/** Place a managed limit order. Returns the venue-backed order state. */
|
|
3973
|
+
placeLimitOrder(params: PlaceLimitOrderParams): Promise<PlaceLimitOrderResponse>;
|
|
4013
3974
|
/** Redeem resolved winning positions by venue market outcome ids. */
|
|
4014
3975
|
redeem(body: RedeemRequest): Promise<RedeemResponse>;
|
|
4015
3976
|
/** Withdraw funds from managed wallets to an external address. */
|
|
@@ -4134,4 +4095,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
|
|
|
4134
4095
|
|
|
4135
4096
|
declare function createAggClient(options: AggClientOptions): AggClient;
|
|
4136
4097
|
|
|
4137
|
-
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 ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type
|
|
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
|
|
174
|
-
if (
|
|
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
|
|
56
|
-
if (
|
|
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.5.
|
|
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",
|