@agg-build/sdk 4.8.1 → 4.9.2
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 +64 -32
- package/dist/index.d.ts +64 -32
- package/dist/index.js +27 -11
- package/dist/index.mjs +27 -11
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -23,37 +23,14 @@ declare const VENUE_CHAIN_IDS: Partial<Record<Venue, number>>;
|
|
|
23
23
|
* Re-activating a venue is therefore an intentional code change here rather
|
|
24
24
|
* than a runtime configuration toggle.
|
|
25
25
|
*/
|
|
26
|
-
declare const ACTIVE_VENUES: readonly [Venue.kalshi, Venue.polymarket, Venue.limitless, Venue.opinion, Venue.predict, Venue.probable, Venue.myriad, Venue.hyperliquid, Venue.novig];
|
|
26
|
+
declare const ACTIVE_VENUES: readonly [Venue.kalshi, Venue.polymarket, Venue.limitless, Venue.opinion, Venue.predict, Venue.probable, Venue.myriad, Venue.hyperliquid, Venue.novig, Venue.prophetx];
|
|
27
27
|
/**
|
|
28
|
-
* Venues excluded from new user-facing activity.
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* - `prophetx` — NOT YET LAUNCHED, and SANDBOX-ONLY: production `/auth/login`
|
|
33
|
-
* rejects our credentials, so every ProphetX row is sandbox data. It now has
|
|
34
|
-
* a live orderbook feed and a live aggKey extractor, so it DOES join
|
|
35
|
-
* cross-venue clusters and can reach `VenueEvent.arbReturn`, which is public
|
|
36
|
-
* and sortable. Membership here is therefore load-bearing rather than
|
|
37
|
-
* cosmetic, and it must not reach end users until real credentials exist.
|
|
38
|
-
* `PROPHET_X_DATA_VISIBLE=true` un-hides it on staging for API verification
|
|
39
|
-
* (see `dataVisibleVenues` in `@app/runtime-config`).
|
|
40
|
-
*
|
|
41
|
-
* NOTE this set only applies where there is NO app context. An App row is
|
|
42
|
-
* authoritative, and its `disabledVenues` is stamped from this constant at
|
|
43
|
-
* CREATE time only — an app created before a venue joined this list keeps a
|
|
44
|
-
* list without it, and no restart repairs that (bootstrap deliberately does
|
|
45
|
-
* not clobber an existing row). Adding a venue here needs a one-time
|
|
46
|
-
* `UPDATE "App" SET "disabledVenues" = array_append(...)` to match.
|
|
47
|
-
*
|
|
48
|
-
* Membership here does NOT stop ingestion: the Rust engine gates discovery on
|
|
49
|
-
* credentials, so Novig data keeps flowing into `VenueEvent`/`VenueMarket` and
|
|
50
|
-
* keeps being matched. This set governs the API read layer and execution only.
|
|
51
|
-
*
|
|
52
|
-
* Global activity is separate from partner access: Novig remains in
|
|
53
|
-
* DEFAULT_DISABLED_VENUES and is enabled only by a super-admin removing it
|
|
54
|
-
* from one App.disabledVenues list.
|
|
28
|
+
* Venues excluded from new user-facing activity. The set is currently empty:
|
|
29
|
+
* ProphetX has discovery, live books, and a sandbox clearinghouse execution
|
|
30
|
+
* provider. Partner rollout is controlled separately through
|
|
31
|
+
* DEFAULT_DISABLED_VENUES and App.disabledVenues.
|
|
55
32
|
*/
|
|
56
|
-
declare const INACTIVE_VENUES: readonly [
|
|
33
|
+
declare const INACTIVE_VENUES: readonly [];
|
|
57
34
|
/** Whether a venue may participate in new user-facing activity. */
|
|
58
35
|
declare function isVenueActive(venue: string): boolean;
|
|
59
36
|
/** Whether a venue is intentionally retained only for wind-down/history flows. */
|
|
@@ -535,6 +512,21 @@ type UnifiedBalanceResponse = {
|
|
|
535
512
|
portfolioValueCents?: number | undefined;
|
|
536
513
|
updatedAt: string;
|
|
537
514
|
}[];
|
|
515
|
+
/**
|
|
516
|
+
* Paper-account summary. Present only when the request resolved to paper
|
|
517
|
+
* mode; absent in a live response. Mirrors `UnifiedBalanceResponseSchemaTB`
|
|
518
|
+
* in `typebox/schemas/trading.ts` — keep the two in sync. All dollars.
|
|
519
|
+
*/
|
|
520
|
+
paper?: {
|
|
521
|
+
startingBalance: number;
|
|
522
|
+
cashBalance: number;
|
|
523
|
+
positionsValue: number;
|
|
524
|
+
/** Banked P&L from closed trades — account-level, not summable from positions. */
|
|
525
|
+
realizedPnl: number;
|
|
526
|
+
unrealizedPnl: number;
|
|
527
|
+
/** realized + unrealized. */
|
|
528
|
+
earnings: number;
|
|
529
|
+
};
|
|
538
530
|
};
|
|
539
531
|
type UserHolding = {
|
|
540
532
|
venue: Venue;
|
|
@@ -2021,11 +2013,24 @@ declare class AggWebSocket {
|
|
|
2021
2013
|
private isOrderbookDebugEnabled;
|
|
2022
2014
|
}
|
|
2023
2015
|
|
|
2016
|
+
/** App-level paper/live mode. An app is one or the other, never both. */
|
|
2017
|
+
type AppTradingMode = "live" | "paper";
|
|
2024
2018
|
interface AppClientConfigResponse {
|
|
2025
2019
|
disabledVenues: Venue[];
|
|
2026
2020
|
disabledCategoryPresets: string[];
|
|
2027
2021
|
earlyAccessEnabled: boolean;
|
|
2028
2022
|
authOptions: AppClientAuthOption[];
|
|
2023
|
+
/**
|
|
2024
|
+
* Server-owned execution mode. Prefer this over any locally-configured
|
|
2025
|
+
* `trading.executionMode` — the API enforces it regardless of what the
|
|
2026
|
+
* client sends, and end users cannot change it.
|
|
2027
|
+
*/
|
|
2028
|
+
tradingMode: AppTradingMode;
|
|
2029
|
+
/**
|
|
2030
|
+
* One-time simulated balance granted on first paper use, in dollars.
|
|
2031
|
+
* Interpolate this into paper copy rather than hardcoding a figure.
|
|
2032
|
+
*/
|
|
2033
|
+
paperStartingBalance: number;
|
|
2029
2034
|
}
|
|
2030
2035
|
interface VenueGeoPolicyEntry {
|
|
2031
2036
|
venue: Venue;
|
|
@@ -3631,6 +3636,10 @@ interface SmartRouteFill {
|
|
|
3631
3636
|
}
|
|
3632
3637
|
/** Per-venue routing result with fills and chain info. */
|
|
3633
3638
|
interface SmartRouteVenueFill {
|
|
3639
|
+
/** CH executable price and normalized input, in micro-USDC. */
|
|
3640
|
+
limitPriceMicroUsdc?: string;
|
|
3641
|
+
inAmount?: string;
|
|
3642
|
+
outAmount?: string;
|
|
3634
3643
|
venue: string;
|
|
3635
3644
|
venueMarketId: string;
|
|
3636
3645
|
venueMarketOutcomeId: string;
|
|
@@ -3640,6 +3649,9 @@ interface SmartRouteVenueFill {
|
|
|
3640
3649
|
noPrice: number;
|
|
3641
3650
|
fills: SmartRouteFill[];
|
|
3642
3651
|
venueQty: number;
|
|
3652
|
+
/** Inclusive fee/reserve funding budget. For fee display, use the route's
|
|
3653
|
+
* feeBreakdown.venueFees and executionReserve instead. */
|
|
3654
|
+
venueFee?: number;
|
|
3643
3655
|
}
|
|
3644
3656
|
interface SmartRouteAllocation {
|
|
3645
3657
|
sourceChainId: string;
|
|
@@ -3774,6 +3786,10 @@ interface SmartRouteSetupCostLine {
|
|
|
3774
3786
|
interface SmartRouteFeeBreakdown {
|
|
3775
3787
|
rawExecCost: number;
|
|
3776
3788
|
venueFees: number;
|
|
3789
|
+
/** Additional CH funding reserve for slippage or possible venue charges.
|
|
3790
|
+
* Excluded from venueFees and totalCost; included in funding allocations.
|
|
3791
|
+
* Only the unused portion is released after execution. */
|
|
3792
|
+
executionReserve?: number;
|
|
3777
3793
|
bridgeFees: number;
|
|
3778
3794
|
executionGas: number;
|
|
3779
3795
|
totalCost: number;
|
|
@@ -3913,6 +3929,12 @@ interface RedeemLegResult {
|
|
|
3913
3929
|
}
|
|
3914
3930
|
interface RedeemRequest {
|
|
3915
3931
|
venueMarketOutcomeIds: string[];
|
|
3932
|
+
/**
|
|
3933
|
+
* Trading mode. Defaults to live, matching the other execution methods.
|
|
3934
|
+
* Honoured on a live app; ignored on a paper app, which has no real-money
|
|
3935
|
+
* path and always settles on paper.
|
|
3936
|
+
*/
|
|
3937
|
+
mode?: ExecutionMode;
|
|
3916
3938
|
}
|
|
3917
3939
|
interface RedeemResponse {
|
|
3918
3940
|
redeemId: string;
|
|
@@ -4185,7 +4207,7 @@ type UserAuthResult = {
|
|
|
4185
4207
|
user: UserProfile;
|
|
4186
4208
|
};
|
|
4187
4209
|
declare class AggClient {
|
|
4188
|
-
private
|
|
4210
|
+
private _appId?;
|
|
4189
4211
|
private adminKey?;
|
|
4190
4212
|
private apiKey?;
|
|
4191
4213
|
private baseUrl;
|
|
@@ -4243,6 +4265,12 @@ declare class AggClient {
|
|
|
4243
4265
|
/** Clear the user access token, refresh token, and user info. Broadcasts cross-tab logout. */
|
|
4244
4266
|
clearAccessToken(): void;
|
|
4245
4267
|
private broadcastAuth;
|
|
4268
|
+
/**
|
|
4269
|
+
* The App this client speaks for, or `undefined` for an admin-key-only
|
|
4270
|
+
* client. Exposed so callers can scope per-app caches by it — app config is
|
|
4271
|
+
* app-scoped data, and two clients sharing one cache must not share entries.
|
|
4272
|
+
*/
|
|
4273
|
+
get appId(): string | undefined;
|
|
4246
4274
|
/** Current auth lifecycle status. */
|
|
4247
4275
|
get authStatus(): AuthStatus;
|
|
4248
4276
|
/** Whether a user access token is currently set. */
|
|
@@ -4677,7 +4705,11 @@ declare class AggClient {
|
|
|
4677
4705
|
getRampQuotes(params: RampQuoteRequest): Promise<RampQuote[]>;
|
|
4678
4706
|
/** Create a ramp widget session for checkout. */
|
|
4679
4707
|
createRampSession(params: RampSessionRequest): Promise<RampWidgetSession>;
|
|
4680
|
-
/**
|
|
4708
|
+
/** Authoritative shared Novig/ProphetX KYC status for the current managed wallet. */
|
|
4709
|
+
getSharedKycStatus(): Promise<{
|
|
4710
|
+
verified: boolean;
|
|
4711
|
+
}>;
|
|
4712
|
+
/** Start shared KYC; already-verified wallets need no redirect. Kalshi v2 is not applicable. */
|
|
4681
4713
|
initiateKyc(venue: string, redirectUri: string): Promise<{
|
|
4682
4714
|
status: string;
|
|
4683
4715
|
kycUrl?: string;
|
|
@@ -4808,4 +4840,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
|
|
|
4808
4840
|
|
|
4809
4841
|
declare function createAggClient(options: AggClientOptions): AggClient;
|
|
4810
4842
|
|
|
4811
|
-
export { ACTIVE_VENUES, type Account, AccountProvider, AccountType, AggApiError, type AggApiErrorInit, type AggApiFieldError, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggLinkAccountWalletConfirmBody, 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 BalanceRefillAttempt, type BalanceRefillAttemptStatus, type BalanceRefillPolicy, type BalanceRefillPolicyStatus, 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 CreateBalanceRefillPolicyParams, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, 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 ExecutionDisplayGroupStatus, type ExecutionDisplayStepKind, 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, LIMIT_PRICE_RAW_SCALE, type LimitOrderTimeInForce, type LimitPriceSide, type LimitPriceTickAdjustment, 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 QuoteError, type QuoteErrorCode, 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, SELF_CUSTODY_FILL_TIMEOUT_MS, SELF_CUSTODY_POLL_INTERVAL_MS, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SetPaperTradingBalanceParams, type SettlementDiff, type SettlementDifference, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SignatureRequest, type SignatureRequestType, type SignerFn, 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 SportsGameStatus, type SportsLiveParticipant, type SportsLiveResponse, type SportsLiveState, type SyncBalancesResponse, TERMINAL_EXECUTION_STATES, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateBalanceRefillPolicyParams, 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, VENUE_CHAIN_IDS, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueGeoPolicyEntry, type VenueGeoPolicyResponse, type VenueKeyStatus, 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, adjustLimitPriceRawToTick, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getBalanceRefillMaximumRaw, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isAggApiError, isBalanceRefillWithinDailyCap, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isVenueActive, isVenueDataVisible, isVenueInactive, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues, toChecksumAddress };
|
|
4843
|
+
export { ACTIVE_VENUES, type Account, AccountProvider, AccountType, AggApiError, type AggApiErrorInit, type AggApiFieldError, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggLinkAccountWalletConfirmBody, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AppTradingMode, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BalanceRefillAttempt, type BalanceRefillAttemptStatus, type BalanceRefillPolicy, type BalanceRefillPolicyStatus, 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 CreateBalanceRefillPolicyParams, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, 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 ExecutionDisplayGroupStatus, type ExecutionDisplayStepKind, 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, LIMIT_PRICE_RAW_SCALE, type LimitOrderTimeInForce, type LimitPriceSide, type LimitPriceTickAdjustment, 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 QuoteError, type QuoteErrorCode, 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, SELF_CUSTODY_FILL_TIMEOUT_MS, SELF_CUSTODY_POLL_INTERVAL_MS, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SetPaperTradingBalanceParams, type SettlementDiff, type SettlementDifference, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SignatureRequest, type SignatureRequestType, type SignerFn, 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 SportsGameStatus, type SportsLiveParticipant, type SportsLiveResponse, type SportsLiveState, type SyncBalancesResponse, TERMINAL_EXECUTION_STATES, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateBalanceRefillPolicyParams, 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, VENUE_CHAIN_IDS, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueGeoPolicyEntry, type VenueGeoPolicyResponse, type VenueKeyStatus, 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, adjustLimitPriceRawToTick, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getBalanceRefillMaximumRaw, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isAggApiError, isBalanceRefillWithinDailyCap, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isVenueActive, isVenueDataVisible, isVenueInactive, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues, toChecksumAddress };
|
package/dist/index.d.ts
CHANGED
|
@@ -23,37 +23,14 @@ declare const VENUE_CHAIN_IDS: Partial<Record<Venue, number>>;
|
|
|
23
23
|
* Re-activating a venue is therefore an intentional code change here rather
|
|
24
24
|
* than a runtime configuration toggle.
|
|
25
25
|
*/
|
|
26
|
-
declare const ACTIVE_VENUES: readonly [Venue.kalshi, Venue.polymarket, Venue.limitless, Venue.opinion, Venue.predict, Venue.probable, Venue.myriad, Venue.hyperliquid, Venue.novig];
|
|
26
|
+
declare const ACTIVE_VENUES: readonly [Venue.kalshi, Venue.polymarket, Venue.limitless, Venue.opinion, Venue.predict, Venue.probable, Venue.myriad, Venue.hyperliquid, Venue.novig, Venue.prophetx];
|
|
27
27
|
/**
|
|
28
|
-
* Venues excluded from new user-facing activity.
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* - `prophetx` — NOT YET LAUNCHED, and SANDBOX-ONLY: production `/auth/login`
|
|
33
|
-
* rejects our credentials, so every ProphetX row is sandbox data. It now has
|
|
34
|
-
* a live orderbook feed and a live aggKey extractor, so it DOES join
|
|
35
|
-
* cross-venue clusters and can reach `VenueEvent.arbReturn`, which is public
|
|
36
|
-
* and sortable. Membership here is therefore load-bearing rather than
|
|
37
|
-
* cosmetic, and it must not reach end users until real credentials exist.
|
|
38
|
-
* `PROPHET_X_DATA_VISIBLE=true` un-hides it on staging for API verification
|
|
39
|
-
* (see `dataVisibleVenues` in `@app/runtime-config`).
|
|
40
|
-
*
|
|
41
|
-
* NOTE this set only applies where there is NO app context. An App row is
|
|
42
|
-
* authoritative, and its `disabledVenues` is stamped from this constant at
|
|
43
|
-
* CREATE time only — an app created before a venue joined this list keeps a
|
|
44
|
-
* list without it, and no restart repairs that (bootstrap deliberately does
|
|
45
|
-
* not clobber an existing row). Adding a venue here needs a one-time
|
|
46
|
-
* `UPDATE "App" SET "disabledVenues" = array_append(...)` to match.
|
|
47
|
-
*
|
|
48
|
-
* Membership here does NOT stop ingestion: the Rust engine gates discovery on
|
|
49
|
-
* credentials, so Novig data keeps flowing into `VenueEvent`/`VenueMarket` and
|
|
50
|
-
* keeps being matched. This set governs the API read layer and execution only.
|
|
51
|
-
*
|
|
52
|
-
* Global activity is separate from partner access: Novig remains in
|
|
53
|
-
* DEFAULT_DISABLED_VENUES and is enabled only by a super-admin removing it
|
|
54
|
-
* from one App.disabledVenues list.
|
|
28
|
+
* Venues excluded from new user-facing activity. The set is currently empty:
|
|
29
|
+
* ProphetX has discovery, live books, and a sandbox clearinghouse execution
|
|
30
|
+
* provider. Partner rollout is controlled separately through
|
|
31
|
+
* DEFAULT_DISABLED_VENUES and App.disabledVenues.
|
|
55
32
|
*/
|
|
56
|
-
declare const INACTIVE_VENUES: readonly [
|
|
33
|
+
declare const INACTIVE_VENUES: readonly [];
|
|
57
34
|
/** Whether a venue may participate in new user-facing activity. */
|
|
58
35
|
declare function isVenueActive(venue: string): boolean;
|
|
59
36
|
/** Whether a venue is intentionally retained only for wind-down/history flows. */
|
|
@@ -535,6 +512,21 @@ type UnifiedBalanceResponse = {
|
|
|
535
512
|
portfolioValueCents?: number | undefined;
|
|
536
513
|
updatedAt: string;
|
|
537
514
|
}[];
|
|
515
|
+
/**
|
|
516
|
+
* Paper-account summary. Present only when the request resolved to paper
|
|
517
|
+
* mode; absent in a live response. Mirrors `UnifiedBalanceResponseSchemaTB`
|
|
518
|
+
* in `typebox/schemas/trading.ts` — keep the two in sync. All dollars.
|
|
519
|
+
*/
|
|
520
|
+
paper?: {
|
|
521
|
+
startingBalance: number;
|
|
522
|
+
cashBalance: number;
|
|
523
|
+
positionsValue: number;
|
|
524
|
+
/** Banked P&L from closed trades — account-level, not summable from positions. */
|
|
525
|
+
realizedPnl: number;
|
|
526
|
+
unrealizedPnl: number;
|
|
527
|
+
/** realized + unrealized. */
|
|
528
|
+
earnings: number;
|
|
529
|
+
};
|
|
538
530
|
};
|
|
539
531
|
type UserHolding = {
|
|
540
532
|
venue: Venue;
|
|
@@ -2021,11 +2013,24 @@ declare class AggWebSocket {
|
|
|
2021
2013
|
private isOrderbookDebugEnabled;
|
|
2022
2014
|
}
|
|
2023
2015
|
|
|
2016
|
+
/** App-level paper/live mode. An app is one or the other, never both. */
|
|
2017
|
+
type AppTradingMode = "live" | "paper";
|
|
2024
2018
|
interface AppClientConfigResponse {
|
|
2025
2019
|
disabledVenues: Venue[];
|
|
2026
2020
|
disabledCategoryPresets: string[];
|
|
2027
2021
|
earlyAccessEnabled: boolean;
|
|
2028
2022
|
authOptions: AppClientAuthOption[];
|
|
2023
|
+
/**
|
|
2024
|
+
* Server-owned execution mode. Prefer this over any locally-configured
|
|
2025
|
+
* `trading.executionMode` — the API enforces it regardless of what the
|
|
2026
|
+
* client sends, and end users cannot change it.
|
|
2027
|
+
*/
|
|
2028
|
+
tradingMode: AppTradingMode;
|
|
2029
|
+
/**
|
|
2030
|
+
* One-time simulated balance granted on first paper use, in dollars.
|
|
2031
|
+
* Interpolate this into paper copy rather than hardcoding a figure.
|
|
2032
|
+
*/
|
|
2033
|
+
paperStartingBalance: number;
|
|
2029
2034
|
}
|
|
2030
2035
|
interface VenueGeoPolicyEntry {
|
|
2031
2036
|
venue: Venue;
|
|
@@ -3631,6 +3636,10 @@ interface SmartRouteFill {
|
|
|
3631
3636
|
}
|
|
3632
3637
|
/** Per-venue routing result with fills and chain info. */
|
|
3633
3638
|
interface SmartRouteVenueFill {
|
|
3639
|
+
/** CH executable price and normalized input, in micro-USDC. */
|
|
3640
|
+
limitPriceMicroUsdc?: string;
|
|
3641
|
+
inAmount?: string;
|
|
3642
|
+
outAmount?: string;
|
|
3634
3643
|
venue: string;
|
|
3635
3644
|
venueMarketId: string;
|
|
3636
3645
|
venueMarketOutcomeId: string;
|
|
@@ -3640,6 +3649,9 @@ interface SmartRouteVenueFill {
|
|
|
3640
3649
|
noPrice: number;
|
|
3641
3650
|
fills: SmartRouteFill[];
|
|
3642
3651
|
venueQty: number;
|
|
3652
|
+
/** Inclusive fee/reserve funding budget. For fee display, use the route's
|
|
3653
|
+
* feeBreakdown.venueFees and executionReserve instead. */
|
|
3654
|
+
venueFee?: number;
|
|
3643
3655
|
}
|
|
3644
3656
|
interface SmartRouteAllocation {
|
|
3645
3657
|
sourceChainId: string;
|
|
@@ -3774,6 +3786,10 @@ interface SmartRouteSetupCostLine {
|
|
|
3774
3786
|
interface SmartRouteFeeBreakdown {
|
|
3775
3787
|
rawExecCost: number;
|
|
3776
3788
|
venueFees: number;
|
|
3789
|
+
/** Additional CH funding reserve for slippage or possible venue charges.
|
|
3790
|
+
* Excluded from venueFees and totalCost; included in funding allocations.
|
|
3791
|
+
* Only the unused portion is released after execution. */
|
|
3792
|
+
executionReserve?: number;
|
|
3777
3793
|
bridgeFees: number;
|
|
3778
3794
|
executionGas: number;
|
|
3779
3795
|
totalCost: number;
|
|
@@ -3913,6 +3929,12 @@ interface RedeemLegResult {
|
|
|
3913
3929
|
}
|
|
3914
3930
|
interface RedeemRequest {
|
|
3915
3931
|
venueMarketOutcomeIds: string[];
|
|
3932
|
+
/**
|
|
3933
|
+
* Trading mode. Defaults to live, matching the other execution methods.
|
|
3934
|
+
* Honoured on a live app; ignored on a paper app, which has no real-money
|
|
3935
|
+
* path and always settles on paper.
|
|
3936
|
+
*/
|
|
3937
|
+
mode?: ExecutionMode;
|
|
3916
3938
|
}
|
|
3917
3939
|
interface RedeemResponse {
|
|
3918
3940
|
redeemId: string;
|
|
@@ -4185,7 +4207,7 @@ type UserAuthResult = {
|
|
|
4185
4207
|
user: UserProfile;
|
|
4186
4208
|
};
|
|
4187
4209
|
declare class AggClient {
|
|
4188
|
-
private
|
|
4210
|
+
private _appId?;
|
|
4189
4211
|
private adminKey?;
|
|
4190
4212
|
private apiKey?;
|
|
4191
4213
|
private baseUrl;
|
|
@@ -4243,6 +4265,12 @@ declare class AggClient {
|
|
|
4243
4265
|
/** Clear the user access token, refresh token, and user info. Broadcasts cross-tab logout. */
|
|
4244
4266
|
clearAccessToken(): void;
|
|
4245
4267
|
private broadcastAuth;
|
|
4268
|
+
/**
|
|
4269
|
+
* The App this client speaks for, or `undefined` for an admin-key-only
|
|
4270
|
+
* client. Exposed so callers can scope per-app caches by it — app config is
|
|
4271
|
+
* app-scoped data, and two clients sharing one cache must not share entries.
|
|
4272
|
+
*/
|
|
4273
|
+
get appId(): string | undefined;
|
|
4246
4274
|
/** Current auth lifecycle status. */
|
|
4247
4275
|
get authStatus(): AuthStatus;
|
|
4248
4276
|
/** Whether a user access token is currently set. */
|
|
@@ -4677,7 +4705,11 @@ declare class AggClient {
|
|
|
4677
4705
|
getRampQuotes(params: RampQuoteRequest): Promise<RampQuote[]>;
|
|
4678
4706
|
/** Create a ramp widget session for checkout. */
|
|
4679
4707
|
createRampSession(params: RampSessionRequest): Promise<RampWidgetSession>;
|
|
4680
|
-
/**
|
|
4708
|
+
/** Authoritative shared Novig/ProphetX KYC status for the current managed wallet. */
|
|
4709
|
+
getSharedKycStatus(): Promise<{
|
|
4710
|
+
verified: boolean;
|
|
4711
|
+
}>;
|
|
4712
|
+
/** Start shared KYC; already-verified wallets need no redirect. Kalshi v2 is not applicable. */
|
|
4681
4713
|
initiateKyc(venue: string, redirectUri: string): Promise<{
|
|
4682
4714
|
status: string;
|
|
4683
4715
|
kycUrl?: string;
|
|
@@ -4808,4 +4840,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
|
|
|
4808
4840
|
|
|
4809
4841
|
declare function createAggClient(options: AggClientOptions): AggClient;
|
|
4810
4842
|
|
|
4811
|
-
export { ACTIVE_VENUES, type Account, AccountProvider, AccountType, AggApiError, type AggApiErrorInit, type AggApiFieldError, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggLinkAccountWalletConfirmBody, 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 BalanceRefillAttempt, type BalanceRefillAttemptStatus, type BalanceRefillPolicy, type BalanceRefillPolicyStatus, 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 CreateBalanceRefillPolicyParams, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, 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 ExecutionDisplayGroupStatus, type ExecutionDisplayStepKind, 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, LIMIT_PRICE_RAW_SCALE, type LimitOrderTimeInForce, type LimitPriceSide, type LimitPriceTickAdjustment, 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 QuoteError, type QuoteErrorCode, 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, SELF_CUSTODY_FILL_TIMEOUT_MS, SELF_CUSTODY_POLL_INTERVAL_MS, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SetPaperTradingBalanceParams, type SettlementDiff, type SettlementDifference, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SignatureRequest, type SignatureRequestType, type SignerFn, 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 SportsGameStatus, type SportsLiveParticipant, type SportsLiveResponse, type SportsLiveState, type SyncBalancesResponse, TERMINAL_EXECUTION_STATES, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateBalanceRefillPolicyParams, 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, VENUE_CHAIN_IDS, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueGeoPolicyEntry, type VenueGeoPolicyResponse, type VenueKeyStatus, 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, adjustLimitPriceRawToTick, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getBalanceRefillMaximumRaw, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isAggApiError, isBalanceRefillWithinDailyCap, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isVenueActive, isVenueDataVisible, isVenueInactive, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues, toChecksumAddress };
|
|
4843
|
+
export { ACTIVE_VENUES, type Account, AccountProvider, AccountType, AggApiError, type AggApiErrorInit, type AggApiFieldError, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggLinkAccountWalletConfirmBody, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AppTradingMode, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BalanceRefillAttempt, type BalanceRefillAttemptStatus, type BalanceRefillPolicy, type BalanceRefillPolicyStatus, 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 CreateBalanceRefillPolicyParams, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, 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 ExecutionDisplayGroupStatus, type ExecutionDisplayStepKind, 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, LIMIT_PRICE_RAW_SCALE, type LimitOrderTimeInForce, type LimitPriceSide, type LimitPriceTickAdjustment, 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 QuoteError, type QuoteErrorCode, 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, SELF_CUSTODY_FILL_TIMEOUT_MS, SELF_CUSTODY_POLL_INTERVAL_MS, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SetPaperTradingBalanceParams, type SettlementDiff, type SettlementDifference, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SignatureRequest, type SignatureRequestType, type SignerFn, 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 SportsGameStatus, type SportsLiveParticipant, type SportsLiveResponse, type SportsLiveState, type SyncBalancesResponse, TERMINAL_EXECUTION_STATES, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateBalanceRefillPolicyParams, 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, VENUE_CHAIN_IDS, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueGeoPolicyEntry, type VenueGeoPolicyResponse, type VenueKeyStatus, 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, adjustLimitPriceRawToTick, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getBalanceRefillMaximumRaw, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isAggApiError, isBalanceRefillWithinDailyCap, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isVenueActive, isVenueDataVisible, isVenueInactive, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues, toChecksumAddress };
|
package/dist/index.js
CHANGED
|
@@ -170,7 +170,8 @@ var VENUE_CHAIN_IDS = {
|
|
|
170
170
|
["predict" /* predict */]: 56,
|
|
171
171
|
["myriad" /* myriad */]: 56,
|
|
172
172
|
["hyperliquid" /* hyperliquid */]: 1337,
|
|
173
|
-
["novig" /* novig */]: 792703809
|
|
173
|
+
["novig" /* novig */]: 792703809,
|
|
174
|
+
["prophetx" /* prophetx */]: 792703809
|
|
174
175
|
};
|
|
175
176
|
var ACTIVE_VENUES = [
|
|
176
177
|
"kalshi" /* kalshi */,
|
|
@@ -181,9 +182,10 @@ var ACTIVE_VENUES = [
|
|
|
181
182
|
"probable" /* probable */,
|
|
182
183
|
"myriad" /* myriad */,
|
|
183
184
|
"hyperliquid" /* hyperliquid */,
|
|
184
|
-
"novig" /* novig
|
|
185
|
+
"novig" /* novig */,
|
|
186
|
+
"prophetx" /* prophetx */
|
|
185
187
|
];
|
|
186
|
-
var INACTIVE_VENUES = [
|
|
188
|
+
var INACTIVE_VENUES = [];
|
|
187
189
|
var DEFAULT_DISABLED_VENUES = ["novig" /* novig */, "prophetx" /* prophetx */];
|
|
188
190
|
var ACTIVE_VENUE_SET = new Set(ACTIVE_VENUES);
|
|
189
191
|
var INACTIVE_VENUE_SET = new Set(INACTIVE_VENUES);
|
|
@@ -1990,21 +1992,21 @@ var AggClient = class {
|
|
|
1990
1992
|
if (!options.appId && !options.adminKey) {
|
|
1991
1993
|
throw new Error("AggClient requires at least one of appId or adminKey");
|
|
1992
1994
|
}
|
|
1993
|
-
this.
|
|
1995
|
+
this._appId = options.appId;
|
|
1994
1996
|
this.adminKey = options.adminKey;
|
|
1995
1997
|
this.apiKey = options.apiKey;
|
|
1996
1998
|
this.signer = options.signer;
|
|
1997
1999
|
this.baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
1998
2000
|
this.wsUrl = options.wsUrl;
|
|
1999
2001
|
this.authOptions = options.auth;
|
|
2000
|
-
this.storageKey = `agg_auth_${(_a = this.
|
|
2002
|
+
this.storageKey = `agg_auth_${(_a = this._appId) != null ? _a : "default"}`;
|
|
2001
2003
|
this.authDelivery = (_b = options.authDelivery) != null ? _b : "body";
|
|
2002
2004
|
this.shouldPersistSession = options.persistSession !== false;
|
|
2003
2005
|
this.restoreSession();
|
|
2004
2006
|
this.initAuthChannel();
|
|
2005
2007
|
}
|
|
2006
2008
|
resolvePaperTradingAppId(appId) {
|
|
2007
|
-
const resolvedAppId = appId != null ? appId : this.
|
|
2009
|
+
const resolvedAppId = appId != null ? appId : this._appId;
|
|
2008
2010
|
if (!resolvedAppId) {
|
|
2009
2011
|
throw new Error(
|
|
2010
2012
|
"Paper trading account methods require appId in client options or method options"
|
|
@@ -2092,7 +2094,7 @@ var AggClient = class {
|
|
|
2092
2094
|
var _a;
|
|
2093
2095
|
if (typeof globalThis.BroadcastChannel === "undefined") return;
|
|
2094
2096
|
try {
|
|
2095
|
-
this.authChannel = new BroadcastChannel(`agg_auth_${(_a = this.
|
|
2097
|
+
this.authChannel = new BroadcastChannel(`agg_auth_${(_a = this._appId) != null ? _a : "default"}`);
|
|
2096
2098
|
this.authChannel.onmessage = (event) => {
|
|
2097
2099
|
var _a2;
|
|
2098
2100
|
const { type } = (_a2 = event.data) != null ? _a2 : {};
|
|
@@ -2153,8 +2155,8 @@ var AggClient = class {
|
|
|
2153
2155
|
rawFetch(path, init) {
|
|
2154
2156
|
return __async(this, null, function* () {
|
|
2155
2157
|
const headers = (init == null ? void 0 : init.body) != null ? { "Content-Type": "application/json" } : {};
|
|
2156
|
-
if (this.
|
|
2157
|
-
headers["x-app-id"] = this.
|
|
2158
|
+
if (this._appId) {
|
|
2159
|
+
headers["x-app-id"] = this._appId;
|
|
2158
2160
|
}
|
|
2159
2161
|
if (this.adminKey) {
|
|
2160
2162
|
headers["x-admin-key"] = this.adminKey;
|
|
@@ -2293,6 +2295,14 @@ var AggClient = class {
|
|
|
2293
2295
|
} catch (e) {
|
|
2294
2296
|
}
|
|
2295
2297
|
}
|
|
2298
|
+
/**
|
|
2299
|
+
* The App this client speaks for, or `undefined` for an admin-key-only
|
|
2300
|
+
* client. Exposed so callers can scope per-app caches by it — app config is
|
|
2301
|
+
* app-scoped data, and two clients sharing one cache must not share entries.
|
|
2302
|
+
*/
|
|
2303
|
+
get appId() {
|
|
2304
|
+
return this._appId;
|
|
2305
|
+
}
|
|
2296
2306
|
/** Current auth lifecycle status. */
|
|
2297
2307
|
get authStatus() {
|
|
2298
2308
|
return this._authStatus;
|
|
@@ -3305,7 +3315,7 @@ Issued At: ${issuedAt}`;
|
|
|
3305
3315
|
throw new Error("AggClient.createWebSocket() requires wsUrl to be set in client options");
|
|
3306
3316
|
}
|
|
3307
3317
|
const url = new URL(this.wsUrl);
|
|
3308
|
-
if (this.
|
|
3318
|
+
if (this._appId) url.searchParams.set("appId", this._appId);
|
|
3309
3319
|
return new AggWebSocket({
|
|
3310
3320
|
url: url.toString(),
|
|
3311
3321
|
callbacks,
|
|
@@ -3582,7 +3592,13 @@ Issued At: ${issuedAt}`;
|
|
|
3582
3592
|
});
|
|
3583
3593
|
});
|
|
3584
3594
|
}
|
|
3585
|
-
/**
|
|
3595
|
+
/** Authoritative shared Novig/ProphetX KYC status for the current managed wallet. */
|
|
3596
|
+
getSharedKycStatus() {
|
|
3597
|
+
return __async(this, null, function* () {
|
|
3598
|
+
return this.request("/kyc/status");
|
|
3599
|
+
});
|
|
3600
|
+
}
|
|
3601
|
+
/** Start shared KYC; already-verified wallets need no redirect. Kalshi v2 is not applicable. */
|
|
3586
3602
|
initiateKyc(venue, redirectUri) {
|
|
3587
3603
|
return __async(this, null, function* () {
|
|
3588
3604
|
return this.request(`/kyc/${venue}`, {
|
package/dist/index.mjs
CHANGED
|
@@ -38,7 +38,8 @@ var VENUE_CHAIN_IDS = {
|
|
|
38
38
|
["predict" /* predict */]: 56,
|
|
39
39
|
["myriad" /* myriad */]: 56,
|
|
40
40
|
["hyperliquid" /* hyperliquid */]: 1337,
|
|
41
|
-
["novig" /* novig */]: 792703809
|
|
41
|
+
["novig" /* novig */]: 792703809,
|
|
42
|
+
["prophetx" /* prophetx */]: 792703809
|
|
42
43
|
};
|
|
43
44
|
var ACTIVE_VENUES = [
|
|
44
45
|
"kalshi" /* kalshi */,
|
|
@@ -49,9 +50,10 @@ var ACTIVE_VENUES = [
|
|
|
49
50
|
"probable" /* probable */,
|
|
50
51
|
"myriad" /* myriad */,
|
|
51
52
|
"hyperliquid" /* hyperliquid */,
|
|
52
|
-
"novig" /* novig
|
|
53
|
+
"novig" /* novig */,
|
|
54
|
+
"prophetx" /* prophetx */
|
|
53
55
|
];
|
|
54
|
-
var INACTIVE_VENUES = [
|
|
56
|
+
var INACTIVE_VENUES = [];
|
|
55
57
|
var DEFAULT_DISABLED_VENUES = ["novig" /* novig */, "prophetx" /* prophetx */];
|
|
56
58
|
var ACTIVE_VENUE_SET = new Set(ACTIVE_VENUES);
|
|
57
59
|
var INACTIVE_VENUE_SET = new Set(INACTIVE_VENUES);
|
|
@@ -1858,21 +1860,21 @@ var AggClient = class {
|
|
|
1858
1860
|
if (!options.appId && !options.adminKey) {
|
|
1859
1861
|
throw new Error("AggClient requires at least one of appId or adminKey");
|
|
1860
1862
|
}
|
|
1861
|
-
this.
|
|
1863
|
+
this._appId = options.appId;
|
|
1862
1864
|
this.adminKey = options.adminKey;
|
|
1863
1865
|
this.apiKey = options.apiKey;
|
|
1864
1866
|
this.signer = options.signer;
|
|
1865
1867
|
this.baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
1866
1868
|
this.wsUrl = options.wsUrl;
|
|
1867
1869
|
this.authOptions = options.auth;
|
|
1868
|
-
this.storageKey = `agg_auth_${(_a = this.
|
|
1870
|
+
this.storageKey = `agg_auth_${(_a = this._appId) != null ? _a : "default"}`;
|
|
1869
1871
|
this.authDelivery = (_b = options.authDelivery) != null ? _b : "body";
|
|
1870
1872
|
this.shouldPersistSession = options.persistSession !== false;
|
|
1871
1873
|
this.restoreSession();
|
|
1872
1874
|
this.initAuthChannel();
|
|
1873
1875
|
}
|
|
1874
1876
|
resolvePaperTradingAppId(appId) {
|
|
1875
|
-
const resolvedAppId = appId != null ? appId : this.
|
|
1877
|
+
const resolvedAppId = appId != null ? appId : this._appId;
|
|
1876
1878
|
if (!resolvedAppId) {
|
|
1877
1879
|
throw new Error(
|
|
1878
1880
|
"Paper trading account methods require appId in client options or method options"
|
|
@@ -1960,7 +1962,7 @@ var AggClient = class {
|
|
|
1960
1962
|
var _a;
|
|
1961
1963
|
if (typeof globalThis.BroadcastChannel === "undefined") return;
|
|
1962
1964
|
try {
|
|
1963
|
-
this.authChannel = new BroadcastChannel(`agg_auth_${(_a = this.
|
|
1965
|
+
this.authChannel = new BroadcastChannel(`agg_auth_${(_a = this._appId) != null ? _a : "default"}`);
|
|
1964
1966
|
this.authChannel.onmessage = (event) => {
|
|
1965
1967
|
var _a2;
|
|
1966
1968
|
const { type } = (_a2 = event.data) != null ? _a2 : {};
|
|
@@ -2021,8 +2023,8 @@ var AggClient = class {
|
|
|
2021
2023
|
rawFetch(path, init) {
|
|
2022
2024
|
return __async(this, null, function* () {
|
|
2023
2025
|
const headers = (init == null ? void 0 : init.body) != null ? { "Content-Type": "application/json" } : {};
|
|
2024
|
-
if (this.
|
|
2025
|
-
headers["x-app-id"] = this.
|
|
2026
|
+
if (this._appId) {
|
|
2027
|
+
headers["x-app-id"] = this._appId;
|
|
2026
2028
|
}
|
|
2027
2029
|
if (this.adminKey) {
|
|
2028
2030
|
headers["x-admin-key"] = this.adminKey;
|
|
@@ -2161,6 +2163,14 @@ var AggClient = class {
|
|
|
2161
2163
|
} catch (e) {
|
|
2162
2164
|
}
|
|
2163
2165
|
}
|
|
2166
|
+
/**
|
|
2167
|
+
* The App this client speaks for, or `undefined` for an admin-key-only
|
|
2168
|
+
* client. Exposed so callers can scope per-app caches by it — app config is
|
|
2169
|
+
* app-scoped data, and two clients sharing one cache must not share entries.
|
|
2170
|
+
*/
|
|
2171
|
+
get appId() {
|
|
2172
|
+
return this._appId;
|
|
2173
|
+
}
|
|
2164
2174
|
/** Current auth lifecycle status. */
|
|
2165
2175
|
get authStatus() {
|
|
2166
2176
|
return this._authStatus;
|
|
@@ -3173,7 +3183,7 @@ Issued At: ${issuedAt}`;
|
|
|
3173
3183
|
throw new Error("AggClient.createWebSocket() requires wsUrl to be set in client options");
|
|
3174
3184
|
}
|
|
3175
3185
|
const url = new URL(this.wsUrl);
|
|
3176
|
-
if (this.
|
|
3186
|
+
if (this._appId) url.searchParams.set("appId", this._appId);
|
|
3177
3187
|
return new AggWebSocket({
|
|
3178
3188
|
url: url.toString(),
|
|
3179
3189
|
callbacks,
|
|
@@ -3450,7 +3460,13 @@ Issued At: ${issuedAt}`;
|
|
|
3450
3460
|
});
|
|
3451
3461
|
});
|
|
3452
3462
|
}
|
|
3453
|
-
/**
|
|
3463
|
+
/** Authoritative shared Novig/ProphetX KYC status for the current managed wallet. */
|
|
3464
|
+
getSharedKycStatus() {
|
|
3465
|
+
return __async(this, null, function* () {
|
|
3466
|
+
return this.request("/kyc/status");
|
|
3467
|
+
});
|
|
3468
|
+
}
|
|
3469
|
+
/** Start shared KYC; already-verified wallets need no redirect. Kalshi v2 is not applicable. */
|
|
3454
3470
|
initiateKyc(venue, redirectUri) {
|
|
3455
3471
|
return __async(this, null, function* () {
|
|
3456
3472
|
return this.request(`/kyc/${venue}`, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agg-build/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.2",
|
|
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",
|