@agg-build/sdk 2.3.0 → 2.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/index.d.mts +44 -2
- package/dist/index.d.ts +44 -2
- package/dist/index.js +49 -1
- package/dist/index.mjs +44 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -163,7 +163,7 @@ const users = await admin.listUsers("your-app-id", { limit: 50 });
|
|
|
163
163
|
| `wsUrl` | `string` | For WebSocket | WebSocket gateway URL (required by `createWebSocket`) |
|
|
164
164
|
| `authDelivery` | `"body" \| "cookie-refresh"` | No | Token delivery mode (default: `"body"`) |
|
|
165
165
|
| `persistSession` | `boolean` | No | Persist auth hint to localStorage (default: `true`) |
|
|
166
|
-
| `kalshiDemo` | `boolean` | No |
|
|
166
|
+
| `kalshiDemo` | `boolean` | No | Deprecated compatibility option; ignored |
|
|
167
167
|
|
|
168
168
|
Call `client.destroy()` when you no longer need the client to release internal resources
|
|
169
169
|
(BroadcastChannel used for cross-tab auth sync).
|
|
@@ -233,11 +233,11 @@ Call `client.destroy()` when you no longer need the client to release internal r
|
|
|
233
233
|
|
|
234
234
|
#### Trading
|
|
235
235
|
|
|
236
|
-
| Method | Description
|
|
237
|
-
| --------------------- |
|
|
238
|
-
| `validateTrade(body)` | Pre-flight trade validation
|
|
239
|
-
| `executeTrade(body)` | Execute
|
|
240
|
-
| `computeSplits(body)` | Compute best order splits across venues via API
|
|
236
|
+
| Method | Description |
|
|
237
|
+
| --------------------- | ------------------------------------------------------ |
|
|
238
|
+
| `validateTrade(body)` | Pre-flight trade validation |
|
|
239
|
+
| `executeTrade(body)` | Execute supported prediction-market orders via backend |
|
|
240
|
+
| `computeSplits(body)` | Compute best order splits across venues via API |
|
|
241
241
|
|
|
242
242
|
#### Venue keys
|
|
243
243
|
|
package/dist/index.d.mts
CHANGED
|
@@ -11,6 +11,26 @@ declare enum Venue {
|
|
|
11
11
|
}
|
|
12
12
|
/** Single source of truth for venue identifiers. */
|
|
13
13
|
declare const VENUES: readonly [Venue.kalshi, Venue.polymarket, Venue.limitless, Venue.opinion, Venue.predict, Venue.probable, Venue.myriad, Venue.hyperliquid];
|
|
14
|
+
/**
|
|
15
|
+
* Venues that participate in new discovery, market-data, and execution flows.
|
|
16
|
+
*
|
|
17
|
+
* Keep retired venues in {@link Venue} and {@link VENUES}: historical orders,
|
|
18
|
+
* positions, settlement, and redemption still rely on those identifiers.
|
|
19
|
+
* Re-activating a venue is therefore an intentional code change here rather
|
|
20
|
+
* than a runtime configuration toggle.
|
|
21
|
+
*/
|
|
22
|
+
declare const ACTIVE_VENUES: readonly [Venue.polymarket, Venue.limitless, Venue.opinion, Venue.predict, Venue.probable, Venue.myriad, Venue.hyperliquid];
|
|
23
|
+
/** Venues retained for historical/wind-down flows but unavailable for new activity. */
|
|
24
|
+
declare const INACTIVE_VENUES: readonly [Venue.kalshi];
|
|
25
|
+
/** Whether a venue may participate in new user-facing activity. */
|
|
26
|
+
declare function isVenueActive(venue: string): boolean;
|
|
27
|
+
/** Whether a venue is intentionally retained only for wind-down/history flows. */
|
|
28
|
+
declare function isVenueInactive(venue: string): boolean;
|
|
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.
|
|
32
|
+
*/
|
|
33
|
+
declare function getEffectiveDisabledVenues(disabledVenues?: readonly (Venue | string)[]): Venue[];
|
|
14
34
|
|
|
15
35
|
declare enum ImageSize {
|
|
16
36
|
sm = 44,
|
|
@@ -639,6 +659,9 @@ type VenueMarket = {
|
|
|
639
659
|
externalIdentifier: string;
|
|
640
660
|
status?: MarketStatus | undefined;
|
|
641
661
|
conditionId?: string | null | undefined;
|
|
662
|
+
description?: string | null | undefined;
|
|
663
|
+
rulesPrimary?: string | null | undefined;
|
|
664
|
+
rulesSecondary?: string | null | undefined;
|
|
642
665
|
venueMarketOutcomes?: {
|
|
643
666
|
id: string;
|
|
644
667
|
/** REMOVED — no longer returned; use GET /midpoints for live prices. */
|
|
@@ -712,6 +735,8 @@ type VenueEvent = {
|
|
|
712
735
|
structureType?: "candidate" | "sport" | "axis" | "dates" | null | undefined;
|
|
713
736
|
/** Canonical sport slug for sports events (e.g. "basketball", "soccer"); null for non-sports. */
|
|
714
737
|
sport?: string | null | undefined;
|
|
738
|
+
/** Structured per-venue settlement key-differences for this event's cluster. */
|
|
739
|
+
settlementDiff?: SettlementDiff | null | undefined;
|
|
715
740
|
};
|
|
716
741
|
type Orderbook = {
|
|
717
742
|
bids: {
|
|
@@ -908,6 +933,16 @@ type SettlementSource = {
|
|
|
908
933
|
name: string;
|
|
909
934
|
url?: string | null | undefined;
|
|
910
935
|
};
|
|
936
|
+
type SettlementDifference = {
|
|
937
|
+
type: string;
|
|
938
|
+
title: string;
|
|
939
|
+
perVenue: Record<string, string>;
|
|
940
|
+
summary?: string | undefined;
|
|
941
|
+
};
|
|
942
|
+
type SettlementDiff = {
|
|
943
|
+
sharedSummary: string;
|
|
944
|
+
differences: SettlementDifference[];
|
|
945
|
+
};
|
|
911
946
|
type QuoteManagedRequest = {
|
|
912
947
|
venueMarketOutcomeIds: string[];
|
|
913
948
|
side: "buy" | "sell";
|
|
@@ -1500,6 +1535,8 @@ interface WsWithdrawalLifecycleEvent {
|
|
|
1500
1535
|
interface WsArbMarketUpdate {
|
|
1501
1536
|
type: "arb_market_update";
|
|
1502
1537
|
marketId: string;
|
|
1538
|
+
/** Producer assertion that globally inactive venues were excluded. */
|
|
1539
|
+
activeVenuesOnly: true;
|
|
1503
1540
|
venueEventId: string | null;
|
|
1504
1541
|
arbReturn: number;
|
|
1505
1542
|
ts: number;
|
|
@@ -1517,6 +1554,8 @@ interface WsArbFeedEntry {
|
|
|
1517
1554
|
interface WsArbFeedBatch {
|
|
1518
1555
|
type: "arb_feed_batch";
|
|
1519
1556
|
feed: "arb";
|
|
1557
|
+
/** Producer assertion that globally inactive venues were excluded. */
|
|
1558
|
+
activeVenuesOnly: true;
|
|
1520
1559
|
entries: WsArbFeedEntry[];
|
|
1521
1560
|
flushTs: number;
|
|
1522
1561
|
chunk: number;
|
|
@@ -1917,7 +1956,10 @@ interface AggClientOptions {
|
|
|
1917
1956
|
apiKey?: string;
|
|
1918
1957
|
/** WebSocket URL for real-time feeds. Must be set explicitly to use createWebSocket(). */
|
|
1919
1958
|
wsUrl?: string;
|
|
1920
|
-
/**
|
|
1959
|
+
/**
|
|
1960
|
+
* @deprecated Kalshi live discovery and trading are retired. This ignored
|
|
1961
|
+
* compatibility option remains to avoid breaking existing SDK consumers.
|
|
1962
|
+
*/
|
|
1921
1963
|
kalshiDemo?: boolean;
|
|
1922
1964
|
/** Optional auth request hooks used to enrich auth payloads. */
|
|
1923
1965
|
auth?: AggClientAuthOptions;
|
|
@@ -4079,4 +4121,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
|
|
|
4079
4121
|
|
|
4080
4122
|
declare function createAggClient(options: AggClientOptions): AggClient;
|
|
4081
4123
|
|
|
4082
|
-
export { type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionDagProgress, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionOverallState, type ExecutionPositionGroup, type ExecutionPositionsQuery, type ExecutionStatusOrder, type ExecutionStatusQuery, type ExecutionStatusResponse, type ExecutionStatusStep, type GetBalanceQuery, type GetBalanceResponse, type GetCryptoReferencePricesOptions, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, ImageSize, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type MatchingReport, type MidpointItem, type MidpointRow, type NewsFeedArticleFeedItem, type NewsFeedArticleFeedResponse, type NewsFeedArticleWithSummary, type NewsFeedLinkedMarket, type NewsFeedListResponse, type NewsFeedMarketFeedArticle, type NewsFeedMarketFeedItem, type NewsFeedMarketFeedResponse, type NewsFeedMarketNewsParams, type NewsFeedMarketNewsResponse, type NewsFeedMarketNewsResult, type NewsFeedPageOptions, type NewsFeedStatusResponse, type NonceResponse, type OrderListItem, type OrderListQuery, OrderStatus, OrderType, type Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, type OrderbookHistoryPoint, type OrderbookHistoryResponse, type OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, type OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PaperTradingAccount, type PaperTradingAccountsPage, type PaperTradingAppOptions, type PaperTradingBalanceAdjustment, type PaperTradingBalanceResponse, type PaperTradingLiquidityStatus, type PaperTradingListParams, type PaperTradingMarkSource, type PaperTradingOrder, type PaperTradingOrdersPage, type PaperTradingPortfolio, type PaperTradingPosition, type PaperTradingPositionsPage, type PersistedAuthSnapshot, type PlacePaperTradingOrderParams, type PositionGroup, type PositionRedeemStatus, type PricePoint, type PriceSource, type PricesHistoryResponse, type QuoteManagedParams, type QuoteManagedRequest, type QuoteManagedResponse, type QuoteManagedSplit, type QuoteManagedStep, type QuoteSplit, type QuoteStep, RECURRENCE_CADENCES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOrderbookDepthLevel, type RecurringCryptoOrderbookDepthSide, type RecurringCryptoOutcome, type RecurringCryptoOutcomeOrderbookDepth, type RecurringCryptoPriceComparison, type RecurringCryptoReferencePrice, type RecurringCryptoResolution, type RecurringCryptoSourceConfidence, type RecurringCryptoVenueMarket, type RecurringCryptoWindowComparisons, type RecurringCryptoWindowMarket, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RequestedOrderbookMarket, type ResetPaperTradingAccountParams, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type RpcTokenResponse, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SetPaperTradingBalanceParams, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSettlementLeg, type SmartRouteSettlementPlan, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SyncBalancesResponse, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateUserBody, type UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, type UserHolding, type UserProfile, VENUES, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueKeySummary, type VenueMarket, type VenueMarketClusterNode, type VenueMarketListItem, type VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, type VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, type VerifyBody, type VerifyResponse, type WalletChainBalance, type WalletTokenBalance, type WithdrawManagedParams, type WithdrawManagedRequest, type WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawPreviewParams, type WithdrawPreviewResponse, type WithdrawTokenSymbol, type WithdrawalExpected, type WithdrawalLeg, type WithdrawalLegStatus, type WithdrawalLegType, type WithdrawalLifecycleStatus, type WithdrawalQuoteParams, type WithdrawalQuoteResponse, type WithdrawalSource, type WithdrawalSourceItem, type WithdrawalSourceStatus, type WithdrawalSourceTokenSymbol, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsClientMessage, type WsConnected, type WsError, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsServerMessage, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,26 @@ declare enum Venue {
|
|
|
11
11
|
}
|
|
12
12
|
/** Single source of truth for venue identifiers. */
|
|
13
13
|
declare const VENUES: readonly [Venue.kalshi, Venue.polymarket, Venue.limitless, Venue.opinion, Venue.predict, Venue.probable, Venue.myriad, Venue.hyperliquid];
|
|
14
|
+
/**
|
|
15
|
+
* Venues that participate in new discovery, market-data, and execution flows.
|
|
16
|
+
*
|
|
17
|
+
* Keep retired venues in {@link Venue} and {@link VENUES}: historical orders,
|
|
18
|
+
* positions, settlement, and redemption still rely on those identifiers.
|
|
19
|
+
* Re-activating a venue is therefore an intentional code change here rather
|
|
20
|
+
* than a runtime configuration toggle.
|
|
21
|
+
*/
|
|
22
|
+
declare const ACTIVE_VENUES: readonly [Venue.polymarket, Venue.limitless, Venue.opinion, Venue.predict, Venue.probable, Venue.myriad, Venue.hyperliquid];
|
|
23
|
+
/** Venues retained for historical/wind-down flows but unavailable for new activity. */
|
|
24
|
+
declare const INACTIVE_VENUES: readonly [Venue.kalshi];
|
|
25
|
+
/** Whether a venue may participate in new user-facing activity. */
|
|
26
|
+
declare function isVenueActive(venue: string): boolean;
|
|
27
|
+
/** Whether a venue is intentionally retained only for wind-down/history flows. */
|
|
28
|
+
declare function isVenueInactive(venue: string): boolean;
|
|
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.
|
|
32
|
+
*/
|
|
33
|
+
declare function getEffectiveDisabledVenues(disabledVenues?: readonly (Venue | string)[]): Venue[];
|
|
14
34
|
|
|
15
35
|
declare enum ImageSize {
|
|
16
36
|
sm = 44,
|
|
@@ -639,6 +659,9 @@ type VenueMarket = {
|
|
|
639
659
|
externalIdentifier: string;
|
|
640
660
|
status?: MarketStatus | undefined;
|
|
641
661
|
conditionId?: string | null | undefined;
|
|
662
|
+
description?: string | null | undefined;
|
|
663
|
+
rulesPrimary?: string | null | undefined;
|
|
664
|
+
rulesSecondary?: string | null | undefined;
|
|
642
665
|
venueMarketOutcomes?: {
|
|
643
666
|
id: string;
|
|
644
667
|
/** REMOVED — no longer returned; use GET /midpoints for live prices. */
|
|
@@ -712,6 +735,8 @@ type VenueEvent = {
|
|
|
712
735
|
structureType?: "candidate" | "sport" | "axis" | "dates" | null | undefined;
|
|
713
736
|
/** Canonical sport slug for sports events (e.g. "basketball", "soccer"); null for non-sports. */
|
|
714
737
|
sport?: string | null | undefined;
|
|
738
|
+
/** Structured per-venue settlement key-differences for this event's cluster. */
|
|
739
|
+
settlementDiff?: SettlementDiff | null | undefined;
|
|
715
740
|
};
|
|
716
741
|
type Orderbook = {
|
|
717
742
|
bids: {
|
|
@@ -908,6 +933,16 @@ type SettlementSource = {
|
|
|
908
933
|
name: string;
|
|
909
934
|
url?: string | null | undefined;
|
|
910
935
|
};
|
|
936
|
+
type SettlementDifference = {
|
|
937
|
+
type: string;
|
|
938
|
+
title: string;
|
|
939
|
+
perVenue: Record<string, string>;
|
|
940
|
+
summary?: string | undefined;
|
|
941
|
+
};
|
|
942
|
+
type SettlementDiff = {
|
|
943
|
+
sharedSummary: string;
|
|
944
|
+
differences: SettlementDifference[];
|
|
945
|
+
};
|
|
911
946
|
type QuoteManagedRequest = {
|
|
912
947
|
venueMarketOutcomeIds: string[];
|
|
913
948
|
side: "buy" | "sell";
|
|
@@ -1500,6 +1535,8 @@ interface WsWithdrawalLifecycleEvent {
|
|
|
1500
1535
|
interface WsArbMarketUpdate {
|
|
1501
1536
|
type: "arb_market_update";
|
|
1502
1537
|
marketId: string;
|
|
1538
|
+
/** Producer assertion that globally inactive venues were excluded. */
|
|
1539
|
+
activeVenuesOnly: true;
|
|
1503
1540
|
venueEventId: string | null;
|
|
1504
1541
|
arbReturn: number;
|
|
1505
1542
|
ts: number;
|
|
@@ -1517,6 +1554,8 @@ interface WsArbFeedEntry {
|
|
|
1517
1554
|
interface WsArbFeedBatch {
|
|
1518
1555
|
type: "arb_feed_batch";
|
|
1519
1556
|
feed: "arb";
|
|
1557
|
+
/** Producer assertion that globally inactive venues were excluded. */
|
|
1558
|
+
activeVenuesOnly: true;
|
|
1520
1559
|
entries: WsArbFeedEntry[];
|
|
1521
1560
|
flushTs: number;
|
|
1522
1561
|
chunk: number;
|
|
@@ -1917,7 +1956,10 @@ interface AggClientOptions {
|
|
|
1917
1956
|
apiKey?: string;
|
|
1918
1957
|
/** WebSocket URL for real-time feeds. Must be set explicitly to use createWebSocket(). */
|
|
1919
1958
|
wsUrl?: string;
|
|
1920
|
-
/**
|
|
1959
|
+
/**
|
|
1960
|
+
* @deprecated Kalshi live discovery and trading are retired. This ignored
|
|
1961
|
+
* compatibility option remains to avoid breaking existing SDK consumers.
|
|
1962
|
+
*/
|
|
1921
1963
|
kalshiDemo?: boolean;
|
|
1922
1964
|
/** Optional auth request hooks used to enrich auth payloads. */
|
|
1923
1965
|
auth?: AggClientAuthOptions;
|
|
@@ -4079,4 +4121,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
|
|
|
4079
4121
|
|
|
4080
4122
|
declare function createAggClient(options: AggClientOptions): AggClient;
|
|
4081
4123
|
|
|
4082
|
-
export { type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionDagProgress, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionOverallState, type ExecutionPositionGroup, type ExecutionPositionsQuery, type ExecutionStatusOrder, type ExecutionStatusQuery, type ExecutionStatusResponse, type ExecutionStatusStep, type GetBalanceQuery, type GetBalanceResponse, type GetCryptoReferencePricesOptions, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, ImageSize, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type MatchingReport, type MidpointItem, type MidpointRow, type NewsFeedArticleFeedItem, type NewsFeedArticleFeedResponse, type NewsFeedArticleWithSummary, type NewsFeedLinkedMarket, type NewsFeedListResponse, type NewsFeedMarketFeedArticle, type NewsFeedMarketFeedItem, type NewsFeedMarketFeedResponse, type NewsFeedMarketNewsParams, type NewsFeedMarketNewsResponse, type NewsFeedMarketNewsResult, type NewsFeedPageOptions, type NewsFeedStatusResponse, type NonceResponse, type OrderListItem, type OrderListQuery, OrderStatus, OrderType, type Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, type OrderbookHistoryPoint, type OrderbookHistoryResponse, type OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, type OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PaperTradingAccount, type PaperTradingAccountsPage, type PaperTradingAppOptions, type PaperTradingBalanceAdjustment, type PaperTradingBalanceResponse, type PaperTradingLiquidityStatus, type PaperTradingListParams, type PaperTradingMarkSource, type PaperTradingOrder, type PaperTradingOrdersPage, type PaperTradingPortfolio, type PaperTradingPosition, type PaperTradingPositionsPage, type PersistedAuthSnapshot, type PlacePaperTradingOrderParams, type PositionGroup, type PositionRedeemStatus, type PricePoint, type PriceSource, type PricesHistoryResponse, type QuoteManagedParams, type QuoteManagedRequest, type QuoteManagedResponse, type QuoteManagedSplit, type QuoteManagedStep, type QuoteSplit, type QuoteStep, RECURRENCE_CADENCES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOrderbookDepthLevel, type RecurringCryptoOrderbookDepthSide, type RecurringCryptoOutcome, type RecurringCryptoOutcomeOrderbookDepth, type RecurringCryptoPriceComparison, type RecurringCryptoReferencePrice, type RecurringCryptoResolution, type RecurringCryptoSourceConfidence, type RecurringCryptoVenueMarket, type RecurringCryptoWindowComparisons, type RecurringCryptoWindowMarket, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RequestedOrderbookMarket, type ResetPaperTradingAccountParams, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type RpcTokenResponse, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SetPaperTradingBalanceParams, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSettlementLeg, type SmartRouteSettlementPlan, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SyncBalancesResponse, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateUserBody, type UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, type UserHolding, type UserProfile, VENUES, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueKeySummary, type VenueMarket, type VenueMarketClusterNode, type VenueMarketListItem, type VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, type VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, type VerifyBody, type VerifyResponse, type WalletChainBalance, type WalletTokenBalance, type WithdrawManagedParams, type WithdrawManagedRequest, type WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawPreviewParams, type WithdrawPreviewResponse, type WithdrawTokenSymbol, type WithdrawalExpected, type WithdrawalLeg, type WithdrawalLegStatus, type WithdrawalLegType, type WithdrawalLifecycleStatus, type WithdrawalQuoteParams, type WithdrawalQuoteResponse, type WithdrawalSource, type WithdrawalSourceItem, type WithdrawalSourceStatus, type WithdrawalSourceTokenSymbol, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsClientMessage, type WsConnected, type WsError, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsServerMessage, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -69,6 +69,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
69
69
|
// src/index.ts
|
|
70
70
|
var index_exports = {};
|
|
71
71
|
__export(index_exports, {
|
|
72
|
+
ACTIVE_VENUES: () => ACTIVE_VENUES,
|
|
72
73
|
AccountProvider: () => AccountProvider,
|
|
73
74
|
AccountType: () => AccountType,
|
|
74
75
|
AggClient: () => AggClient,
|
|
@@ -77,6 +78,7 @@ __export(index_exports, {
|
|
|
77
78
|
CandleBuilder: () => CandleBuilder,
|
|
78
79
|
Chain: () => Chain,
|
|
79
80
|
IMAGE_SIZES: () => IMAGE_SIZES,
|
|
81
|
+
INACTIVE_VENUES: () => INACTIVE_VENUES,
|
|
80
82
|
ImageSize: () => ImageSize,
|
|
81
83
|
MarketStatus: () => MarketStatus,
|
|
82
84
|
MatchStatus: () => MatchStatus,
|
|
@@ -99,12 +101,15 @@ __export(index_exports, {
|
|
|
99
101
|
formatMarketQuestion: () => formatMarketQuestion,
|
|
100
102
|
formatOutcomeLabel: () => formatOutcomeLabel,
|
|
101
103
|
formatOutcomeTitle: () => formatOutcomeTitle,
|
|
104
|
+
getEffectiveDisabledVenues: () => getEffectiveDisabledVenues,
|
|
102
105
|
getWalletAddressFromUserProfile: () => getWalletAddressFromUserProfile,
|
|
103
106
|
hasShape: () => hasShape,
|
|
104
107
|
isEmail: () => isEmail,
|
|
105
108
|
isEnum: () => isEnum,
|
|
106
109
|
isFiniteNonNeg: () => isFiniteNonNeg,
|
|
107
110
|
isNonEmptyString: () => isNonEmptyString,
|
|
111
|
+
isVenueActive: () => isVenueActive,
|
|
112
|
+
isVenueInactive: () => isVenueInactive,
|
|
108
113
|
mergeCandles: () => mergeCandles,
|
|
109
114
|
mergeClosedCandles: () => mergeClosedCandles,
|
|
110
115
|
normalizeVenueMarketCluster: () => normalizeVenueMarketCluster,
|
|
@@ -140,6 +145,37 @@ var VENUES = [
|
|
|
140
145
|
"myriad" /* myriad */,
|
|
141
146
|
"hyperliquid" /* hyperliquid */
|
|
142
147
|
];
|
|
148
|
+
var ACTIVE_VENUES = [
|
|
149
|
+
"polymarket" /* polymarket */,
|
|
150
|
+
"limitless" /* limitless */,
|
|
151
|
+
"opinion" /* opinion */,
|
|
152
|
+
"predict" /* predict */,
|
|
153
|
+
"probable" /* probable */,
|
|
154
|
+
"myriad" /* myriad */,
|
|
155
|
+
"hyperliquid" /* hyperliquid */
|
|
156
|
+
];
|
|
157
|
+
var INACTIVE_VENUES = ["kalshi" /* kalshi */];
|
|
158
|
+
var ACTIVE_VENUE_SET = new Set(ACTIVE_VENUES);
|
|
159
|
+
var INACTIVE_VENUE_SET = new Set(INACTIVE_VENUES);
|
|
160
|
+
function normalizeVenue(venue) {
|
|
161
|
+
return venue.trim().toLowerCase();
|
|
162
|
+
}
|
|
163
|
+
function isVenueActive(venue) {
|
|
164
|
+
if (ACTIVE_VENUE_SET.has(venue)) return true;
|
|
165
|
+
if (INACTIVE_VENUE_SET.has(venue)) return false;
|
|
166
|
+
return ACTIVE_VENUE_SET.has(normalizeVenue(venue));
|
|
167
|
+
}
|
|
168
|
+
function isVenueInactive(venue) {
|
|
169
|
+
if (INACTIVE_VENUE_SET.has(venue)) return true;
|
|
170
|
+
if (ACTIVE_VENUE_SET.has(venue)) return false;
|
|
171
|
+
return INACTIVE_VENUE_SET.has(normalizeVenue(venue));
|
|
172
|
+
}
|
|
173
|
+
function getEffectiveDisabledVenues(disabledVenues = []) {
|
|
174
|
+
if (disabledVenues.length === 0) return [...INACTIVE_VENUES];
|
|
175
|
+
const disabled = new Set(disabledVenues.map(normalizeVenue));
|
|
176
|
+
for (const venue of INACTIVE_VENUES) disabled.add(venue);
|
|
177
|
+
return VENUES.filter((venue) => disabled.has(venue));
|
|
178
|
+
}
|
|
143
179
|
|
|
144
180
|
// ../common/src/enums/image-size.ts
|
|
145
181
|
var ImageSize = /* @__PURE__ */ ((ImageSize2) => {
|
|
@@ -2121,7 +2157,11 @@ Issued At: ${issuedAt}`;
|
|
|
2121
2157
|
return __async(this, null, function* () {
|
|
2122
2158
|
return this.request(
|
|
2123
2159
|
"/users/me/link-account/start",
|
|
2124
|
-
this.buildAuthRequestInit({
|
|
2160
|
+
this.buildAuthRequestInit({
|
|
2161
|
+
method: "POST",
|
|
2162
|
+
body: JSON.stringify(body),
|
|
2163
|
+
credentials: "include"
|
|
2164
|
+
})
|
|
2125
2165
|
);
|
|
2126
2166
|
});
|
|
2127
2167
|
}
|
|
@@ -2132,6 +2172,9 @@ Issued At: ${issuedAt}`;
|
|
|
2132
2172
|
*/
|
|
2133
2173
|
linkAccountConfirm(token) {
|
|
2134
2174
|
return __async(this, null, function* () {
|
|
2175
|
+
if (!this.accessToken) {
|
|
2176
|
+
yield this.refreshWithDedup();
|
|
2177
|
+
}
|
|
2135
2178
|
return this.request(
|
|
2136
2179
|
"/users/me/link-account/confirm",
|
|
2137
2180
|
this.buildAuthRequestInit({ method: "POST", body: JSON.stringify({ token }) })
|
|
@@ -3274,6 +3317,7 @@ function createAggClient(options) {
|
|
|
3274
3317
|
}
|
|
3275
3318
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3276
3319
|
0 && (module.exports = {
|
|
3320
|
+
ACTIVE_VENUES,
|
|
3277
3321
|
AccountProvider,
|
|
3278
3322
|
AccountType,
|
|
3279
3323
|
AggClient,
|
|
@@ -3282,6 +3326,7 @@ function createAggClient(options) {
|
|
|
3282
3326
|
CandleBuilder,
|
|
3283
3327
|
Chain,
|
|
3284
3328
|
IMAGE_SIZES,
|
|
3329
|
+
INACTIVE_VENUES,
|
|
3285
3330
|
ImageSize,
|
|
3286
3331
|
MarketStatus,
|
|
3287
3332
|
MatchStatus,
|
|
@@ -3304,12 +3349,15 @@ function createAggClient(options) {
|
|
|
3304
3349
|
formatMarketQuestion,
|
|
3305
3350
|
formatOutcomeLabel,
|
|
3306
3351
|
formatOutcomeTitle,
|
|
3352
|
+
getEffectiveDisabledVenues,
|
|
3307
3353
|
getWalletAddressFromUserProfile,
|
|
3308
3354
|
hasShape,
|
|
3309
3355
|
isEmail,
|
|
3310
3356
|
isEnum,
|
|
3311
3357
|
isFiniteNonNeg,
|
|
3312
3358
|
isNonEmptyString,
|
|
3359
|
+
isVenueActive,
|
|
3360
|
+
isVenueInactive,
|
|
3313
3361
|
mergeCandles,
|
|
3314
3362
|
mergeClosedCandles,
|
|
3315
3363
|
normalizeVenueMarketCluster,
|
package/dist/index.mjs
CHANGED
|
@@ -27,6 +27,37 @@ var VENUES = [
|
|
|
27
27
|
"myriad" /* myriad */,
|
|
28
28
|
"hyperliquid" /* hyperliquid */
|
|
29
29
|
];
|
|
30
|
+
var ACTIVE_VENUES = [
|
|
31
|
+
"polymarket" /* polymarket */,
|
|
32
|
+
"limitless" /* limitless */,
|
|
33
|
+
"opinion" /* opinion */,
|
|
34
|
+
"predict" /* predict */,
|
|
35
|
+
"probable" /* probable */,
|
|
36
|
+
"myriad" /* myriad */,
|
|
37
|
+
"hyperliquid" /* hyperliquid */
|
|
38
|
+
];
|
|
39
|
+
var INACTIVE_VENUES = ["kalshi" /* kalshi */];
|
|
40
|
+
var ACTIVE_VENUE_SET = new Set(ACTIVE_VENUES);
|
|
41
|
+
var INACTIVE_VENUE_SET = new Set(INACTIVE_VENUES);
|
|
42
|
+
function normalizeVenue(venue) {
|
|
43
|
+
return venue.trim().toLowerCase();
|
|
44
|
+
}
|
|
45
|
+
function isVenueActive(venue) {
|
|
46
|
+
if (ACTIVE_VENUE_SET.has(venue)) return true;
|
|
47
|
+
if (INACTIVE_VENUE_SET.has(venue)) return false;
|
|
48
|
+
return ACTIVE_VENUE_SET.has(normalizeVenue(venue));
|
|
49
|
+
}
|
|
50
|
+
function isVenueInactive(venue) {
|
|
51
|
+
if (INACTIVE_VENUE_SET.has(venue)) return true;
|
|
52
|
+
if (ACTIVE_VENUE_SET.has(venue)) return false;
|
|
53
|
+
return INACTIVE_VENUE_SET.has(normalizeVenue(venue));
|
|
54
|
+
}
|
|
55
|
+
function getEffectiveDisabledVenues(disabledVenues = []) {
|
|
56
|
+
if (disabledVenues.length === 0) return [...INACTIVE_VENUES];
|
|
57
|
+
const disabled = new Set(disabledVenues.map(normalizeVenue));
|
|
58
|
+
for (const venue of INACTIVE_VENUES) disabled.add(venue);
|
|
59
|
+
return VENUES.filter((venue) => disabled.has(venue));
|
|
60
|
+
}
|
|
30
61
|
|
|
31
62
|
// ../common/src/enums/image-size.ts
|
|
32
63
|
var ImageSize = /* @__PURE__ */ ((ImageSize2) => {
|
|
@@ -2008,7 +2039,11 @@ Issued At: ${issuedAt}`;
|
|
|
2008
2039
|
return __async(this, null, function* () {
|
|
2009
2040
|
return this.request(
|
|
2010
2041
|
"/users/me/link-account/start",
|
|
2011
|
-
this.buildAuthRequestInit({
|
|
2042
|
+
this.buildAuthRequestInit({
|
|
2043
|
+
method: "POST",
|
|
2044
|
+
body: JSON.stringify(body),
|
|
2045
|
+
credentials: "include"
|
|
2046
|
+
})
|
|
2012
2047
|
);
|
|
2013
2048
|
});
|
|
2014
2049
|
}
|
|
@@ -2019,6 +2054,9 @@ Issued At: ${issuedAt}`;
|
|
|
2019
2054
|
*/
|
|
2020
2055
|
linkAccountConfirm(token) {
|
|
2021
2056
|
return __async(this, null, function* () {
|
|
2057
|
+
if (!this.accessToken) {
|
|
2058
|
+
yield this.refreshWithDedup();
|
|
2059
|
+
}
|
|
2022
2060
|
return this.request(
|
|
2023
2061
|
"/users/me/link-account/confirm",
|
|
2024
2062
|
this.buildAuthRequestInit({ method: "POST", body: JSON.stringify({ token }) })
|
|
@@ -3160,6 +3198,7 @@ function createAggClient(options) {
|
|
|
3160
3198
|
return new AggClient(options);
|
|
3161
3199
|
}
|
|
3162
3200
|
export {
|
|
3201
|
+
ACTIVE_VENUES,
|
|
3163
3202
|
AccountProvider,
|
|
3164
3203
|
AccountType,
|
|
3165
3204
|
AggClient,
|
|
@@ -3168,6 +3207,7 @@ export {
|
|
|
3168
3207
|
CandleBuilder,
|
|
3169
3208
|
Chain,
|
|
3170
3209
|
IMAGE_SIZES,
|
|
3210
|
+
INACTIVE_VENUES,
|
|
3171
3211
|
ImageSize,
|
|
3172
3212
|
MarketStatus,
|
|
3173
3213
|
MatchStatus,
|
|
@@ -3190,12 +3230,15 @@ export {
|
|
|
3190
3230
|
formatMarketQuestion,
|
|
3191
3231
|
formatOutcomeLabel,
|
|
3192
3232
|
formatOutcomeTitle,
|
|
3233
|
+
getEffectiveDisabledVenues,
|
|
3193
3234
|
getWalletAddressFromUserProfile,
|
|
3194
3235
|
hasShape,
|
|
3195
3236
|
isEmail,
|
|
3196
3237
|
isEnum,
|
|
3197
3238
|
isFiniteNonNeg,
|
|
3198
3239
|
isNonEmptyString,
|
|
3240
|
+
isVenueActive,
|
|
3241
|
+
isVenueInactive,
|
|
3199
3242
|
mergeCandles,
|
|
3200
3243
|
mergeClosedCandles,
|
|
3201
3244
|
normalizeVenueMarketCluster,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agg-build/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.7",
|
|
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",
|