@agg-build/sdk 4.25.0 → 4.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/agg-websocket-BstVWtLA.d.mts +6004 -0
  2. package/dist/agg-websocket-BstVWtLA.d.mts.map +1 -0
  3. package/dist/agg-websocket-BstVWtLA.d.ts +6004 -0
  4. package/dist/agg-websocket-BstVWtLA.d.ts.map +1 -0
  5. package/dist/agg-websocket-CK2iXfti.mjs +1427 -0
  6. package/dist/agg-websocket-CK2iXfti.mjs.map +1 -0
  7. package/dist/agg-websocket-DJbIfxKb.js +1478 -0
  8. package/dist/browser.d.mts +67 -66
  9. package/dist/browser.d.mts.map +1 -0
  10. package/dist/browser.d.ts +67 -66
  11. package/dist/browser.d.ts.map +1 -0
  12. package/dist/browser.js +720 -2047
  13. package/dist/browser.mjs +423 -799
  14. package/dist/browser.mjs.map +1 -0
  15. package/dist/candle-builder-BNewIe9K.mjs +148 -0
  16. package/dist/candle-builder-BNewIe9K.mjs.map +1 -0
  17. package/dist/candle-builder-BULYdxB4.js +151 -0
  18. package/dist/index.d.mts +2 -1342
  19. package/dist/index.d.ts +2 -1342
  20. package/dist/index.js +2794 -4656
  21. package/dist/index.mjs +2788 -2486
  22. package/dist/index.mjs.map +1 -0
  23. package/dist/market-data.d.mts +6 -6
  24. package/dist/market-data.d.mts.map +1 -0
  25. package/dist/market-data.d.ts +6 -6
  26. package/dist/market-data.d.ts.map +1 -0
  27. package/dist/market-data.js +314 -1774
  28. package/dist/market-data.mjs +314 -350
  29. package/dist/market-data.mjs.map +1 -0
  30. package/dist/server.d.mts +235 -234
  31. package/dist/server.d.mts.map +1 -0
  32. package/dist/server.d.ts +235 -234
  33. package/dist/server.d.ts.map +1 -0
  34. package/dist/server.js +168 -296
  35. package/dist/server.mjs +163 -234
  36. package/dist/server.mjs.map +1 -0
  37. package/package.json +4 -4
  38. package/dist/agg-websocket-Bxt9PzTz.d.mts +0 -4479
  39. package/dist/agg-websocket-Bxt9PzTz.d.ts +0 -4479
  40. package/dist/chunk-QXBVA5TW.mjs +0 -2073
  41. package/dist/chunk-VD5UTAVD.mjs +0 -158
  42. package/dist/chunk-WNQUEZJF.mjs +0 -58
package/dist/index.d.ts CHANGED
@@ -1,1342 +1,2 @@
1
- import { V as Venue, U as UserProfile, T as TradeSplit, g as VenueMarket, h as VenueMarketOutcome, i as Orderbook, j as TradeSide, k as AggClientOptions, l as AggClientSessionInput, m as AuthStatus, S as SiweMessageParams, n as SiwsMessageParams, o as AggAuthVerifyBody, p as AggAuthStartBody, q as AggAuthStartResult, r as AggLinkAccountBody, s as AggLinkAccountResult, t as AggLinkAccountWalletConfirmBody, u as AggLinkAccountConfirmResult, v as UpdateUserBody, P as PaginatedResponse, w as UserHolding, x as OrderListQuery, y as TradeExecutorOrderListResponse, E as ExecutionOrdersQuery, z as ExecutionOrderItem, B as ExecutionStatusQuery, D as ExecutionStatusResponse, F as UserActivityQuery, G as UserActivityItem, L as LeaderboardQuery, H as LeaderboardRow, I as LeaderboardSeriesQuery, J as LeaderboardSeries, K as ExecutionPositionsQuery, N as ExecutionPositionGroup, Q as ManagedBalancesParams, R as UnifiedBalanceResponse, X as UpsertVenueKey, Y as VenueKeySummary, Z as VenueKeyStatus, _ as CreatePaperTradingAccountParams, $ as PaperTradingAppOptions, a0 as PaperTradingAccount, a1 as PaperTradingAccountListParams, a2 as PaperTradingAccountsPage, a3 as SetPaperTradingBalanceParams, a4 as PaperTradingBalanceResponse, a5 as ResetPaperTradingAccountParams, a6 as PlacePaperTradingOrderParams, a7 as PaperTradingOrder, a8 as PaperTradingListParams, a9 as PaperTradingPositionsPage, aa as PaperTradingOrdersPage, ab as PaperTradingPortfolio, ac as CancelOrderSignature, ad as CancelManagedExecutionResponse, ae as CancelVenueOrderParams, af as MatchStatus, ag as MarketStatus, ah as RecurrenceFilter, ai as VenueEvent, aj as EventBootstrapResponse, ak as SportsLiveResponse, al as ListRecurringCryptoMarketsOptions, am as RecurringCryptoMarketsResponse, an as GetCryptoReferencePricesOptions, ao as CryptoReferencePricesResponse, ap as Category, aq as AppClientConfigResponse, ar as VenueGeoPolicyResponse, as as RpcTokenResponse, at as NewsFeedListResponse, au as NewsFeedPageOptions, av as NewsFeedArticleFeedResponse, aw as NewsFeedMarketFeedResponse, ax as NewsFeedStatusResponse, ay as NewsFeedMarketNewsParams, az as NewsFeedMarketNewsResponse, aA as SearchParams, aB as SearchResponse, aC as CorrelatedMarketsStatus, aD as CorrelatedMarketSignalBatch, aE as CorrelatedMarketQueryResult, aF as CorrelatedMarketCascadeResponse, aG as ResolveCorrelatedMarketsParams, aH as ResolveCorrelatedMarketsResponse, aI as ChartResolution, C as ChartBarsResponse, b as ChartHistoryManifest, aJ as BatchOrderbooksResponse, aK as BatchMidpointsResponse, aL as OutcomeOrderbookResponse, aM as SmartRouteParams, aN as SmartRouteResponse, f as AggWebSocketCallbacks, A as AggWebSocket, aO as ExecuteManagedParams, aP as ExecuteManagedResponse, aQ as PlaceLimitOrderParams, aR as PlaceLimitOrderResponse, aS as PlaceOrderParams, aT as PlaceOrderResponse, aU as RedeemRequest, aV as RedeemResponse, aW as BalanceRefillPolicy, aX as CreateBalanceRefillPolicyParams, aY as UpdateBalanceRefillPolicyParams, aZ as BalanceRefillAttempt, a_ as WithdrawManagedParams, a$ as WithdrawManagedResponse, b0 as WithdrawPreviewParams, b1 as WithdrawPreviewResponse, b2 as WithdrawalQuoteParams, b3 as WithdrawalQuoteResponse, b4 as SyncBalancesResponse, b5 as DepositAddressesResponse, b6 as GetPositionsParams, b7 as PositionGroup, b8 as RampQuoteRequest, b9 as RampQuote, ba as RampSessionRequest, bb as RampWidgetSession, bc as Candle, c as ChartCandle } from './agg-websocket-Bxt9PzTz.js';
2
- export { bd as ACTIVE_VENUES, be as Account, bf as AccountProvider, bg as AccountType, bh as AggAuthDeliveryMode, bi as AggAuthPrivyVerifyBody, bj as AggAuthProviderType, bk as AggAuthWalletVerifyBody, bl as AggClientAuthOptions, bm as AggSessionUser, d as AggWebSocketDiagnostics, a as AggWebSocketOptions, bn as AggregatedOrderbookLevel, bo as AggregatedOrderbookResponse, bp as App, bq as AppTradingMode, br as AttributedOrderbook, bs as AttributedOrderbookLevel, bt as AuthCodeResponse, bu as AuthTokenResponse, bv as AuthUser, bw as BalanceCustody, bx as BalanceRefillAttemptStatus, by as BalanceRefillPolicyStatus, bz as BookQuality, bA as CONFIRMED_MATCH_STATUSES, bB as CandleBuilder, bC as CandleInterval, bD as CandleTail, bE as Chain, bF as ChartBarsMeta, bG as ChartVenueCandles, bH as ComputeSplitsRequest, bI as ComputeSplitsResponse, bJ as ComputeSplitsSelection, bK as CorrelatedMarketCascadeItem, bL as CorrelatedMarketSide, bM as CorrelatedMarketSignal, bN as CorrelatedMarketSignalDirection, bO as CreateApp, bP as CryptoReferencePriceError, bQ as CryptoReferencePriceExternalMarketInput, bR as CryptoReferencePriceMarketInput, bS as CryptoReferencePriceResult, bT as CryptoReferencePriceSource, bU as CryptoReferencePriceTarget, bV as DepositAddressesPendingResponse, bW as DepositAddressesReadyResponse, bX as DepositAddressesSupportedChain, bY as DepositAddressesToken, bZ as DepositStep, b_ as DiagnosticCallback, b$ as DiagnosticEvent, c0 as ExecuteManagedRequest, c1 as ExecuteTradeRequest, c2 as ExecuteTradeResponse, c3 as ExecutionDagProgress, c4 as ExecutionDisplayGroupStatus, c5 as ExecutionDisplayStepKind, c6 as ExecutionMode, c7 as ExecutionOverallState, c8 as ExecutionStatusOrder, c9 as ExecutionStatusStep, ca as GetBalanceQuery, cb as GetBalanceResponse, cc as GetHoldingsQuery, cd as GetHoldingsResponse, ce as GetOrdersParams, cf as GetOrdersQuery, cg as GetPositionsQuery, ch as HelloResponse, ci as HistoryRangeRequest, cj as INACTIVE_VENUES, ck as LeaderboardMetric, cl as LeaderboardSeriesPoint, cm as LimitOrderTimeInForce, cn as MarkSource, co as MarketPriceHistory, cp as MarketView, cq as MarketViewBatch, cr as MatchType, cs as MatchedMidpoint, ct as MatchedMidpointOutcome, cu as MatchedOrderbookMarket, cv as MatchedVenueMarketOutcomeRef, cw as MidpointItem, cx as MidpointRow, cy as NewsFeedArticleFeedItem, cz as NewsFeedArticleWithSummary, cA as NewsFeedLinkedMarket, cB as NewsFeedMarketFeedArticle, cC as NewsFeedMarketFeedItem, cD as NewsFeedMarketNewsResult, cE as NonceResponse, cF as NovigExecutionMode, cG as OPTIONAL_SIGNATURE_TIMEOUT_MS, cH as OrderListItem, cI as OrderStatus, cJ as OrderType, cK as OrderbookBatchItemError, cL as OrderbookBatchItemErrorCode, cM as OrderbookBatchItemStatus, cN as OrderbookHistoryPoint, cO as OrderbookHistoryResponse, cP as OrderbookLevel, cQ as OrderbookQuoteFill, cR as OrderbookQuoteParams, cS as OrderbookQuoteResponse, cT as OrderbookServiceUnavailableError, O as OrderbookState, cU as OrderbooksOnlyError, cV as OutcomeMidpoint, cW as OutcomeMidpointRow, cX as PaperTradingBalanceAdjustment, cY as PaperTradingLiquidityStatus, cZ as PaperTradingMarkSource, c_ as PaperTradingPosition, c$ as PersistedAuthSnapshot, d0 as PositionRedeemStatus, d1 as PricePoint, d2 as PriceSource, d3 as PricesHistoryResponse, d4 as ProphetxExecutionMode, d5 as RECURRENCE_CADENCES, d6 as RecurrenceCadence, d7 as RecurringCryptoComparisonPoint, d8 as RecurringCryptoComparisonPriceSource, d9 as RecurringCryptoDuration, da as RecurringCryptoDurationInput, db as RecurringCryptoMarketMetrics, dc as RecurringCryptoOrderbookDepthLevel, dd as RecurringCryptoOrderbookDepthSide, de as RecurringCryptoOutcome, df as RecurringCryptoOutcomeOrderbookDepth, dg as RecurringCryptoPriceComparison, dh as RecurringCryptoReferencePrice, di as RecurringCryptoResolution, dj as RecurringCryptoSourceConfidence, dk as RecurringCryptoVenueMarket, dl as RecurringCryptoWindowComparisons, dm as RecurringCryptoWindowMarket, dn as RedeemLegResult, dp as RedeemLegStatus, dq as RequestedOrderbookMarket, dr as ResolvedCorrelatedMarketsResponse, ds as SELF_CUSTODY_FILL_TIMEOUT_MS, dt as SELF_CUSTODY_POLL_INTERVAL_MS, du as ServerWallet, dv as SettlementDiff, dw as SettlementDifference, dx as SettlementSource, dy as SetupDepositAddressStep, dz as SetupVenueKeyStep, dA as SignatureRequest, dB as SignatureRequestType, dC as SignerFn, dD as SimpleOrderbookLevel, dE as SmartRouteAllocation, dF as SmartRouteBridgeStep, dG as SmartRouteFeeBreakdown, dH as SmartRouteFill, dI as SmartRouteSettlementLeg, dJ as SmartRouteSettlementPlan, dK as SmartRouteSetupCostLine, dL as SmartRouteSide, dM as SmartRouteStatus, dN as SmartRouteVenueFill, dO as SportsGameStatus, dP as SportsLiveParticipant, dQ as SportsLiveState, dR as TERMINAL_EXECUTION_STATES, dS as TimeInForce, dT as TradeExecutorOrder, dU as TradeStep, dV as UserActivityBridge, dW as UserActivityDeposit, dX as UserActivityRedeem, dY as UserActivityRedeemLeg, dZ as UserActivityTrade, d_ as UserActivityType, d$ as UserActivityUserOp, e0 as UserActivityWithdrawal, e1 as VENUES, e2 as VENUE_CHAIN_IDS, e3 as ValidateBalanceOnClientStep, e4 as ValidateManagedParams, e5 as ValidateManagedRequest, e6 as ValidateManagedResponse, e7 as ValidateTradeRequest, e8 as ValidateTradeResponse, e9 as VenueEventListItem, ea as VenueEventWithMarkets, eb as VenueGeoPolicyEntry, ec as VenueMarketListItem, ed as VenueMarketRef, ee as VenueOrderbookEntry, ef as VenueOrderbookLevel, eg as VenuePositionBalance, eh as VenuePriceInfo, ei as VenueSoloQuote, ej as VerifyBody, ek as VerifyResponse, el as WalletChainBalance, em as WalletTokenBalance, en as WithdrawManagedRequest, eo as WithdrawManagedSourceItem, ep as WithdrawTokenSymbol, eq as WithdrawalExpected, er as WithdrawalLeg, es as WithdrawalLegStatus, et as WithdrawalLegType, eu as WithdrawalLifecycleStatus, ev as WithdrawalSource, ew as WithdrawalSourceItem, ex as WithdrawalSourceStatus, ey as WithdrawalSourceTokenSymbol, e as WsArbFeedBatch, ez as WsArbFeedEntry, W as WsArbMarketUpdate, eA as WsAttributedLevel, eB as WsAuthenticated, eC as WsBalanceUpdate, eD as WsCandleInterval, eE as WsClientMessage, eF as WsConnected, eG as WsError, eH as WsHeartbeat, eI as WsMarkSource, eJ as WsMarketResolved, eK as WsOrderEvent, eL as WsOrderEventType, eM as WsOrderSubmitted, eN as WsOrderbookDelta, eO as WsOrderbookSnapshot, eP as WsRedeemEvent, eQ as WsServerMessage, eR as WsSubscribed, eS as WsTrade, eT as WsUnsubscribed, eU as WsVenueBook, eV as WsVenueInfo, eW as WsVenueLevel, eX as WsWithdrawalLegStatus, eY as WsWithdrawalLifecycleEvent, eZ as WsWithdrawalLifecycleLeg, e_ as WsWithdrawalLifecycleStatus, e$ as applyOrderbookDelta, f0 as computeChecksum, f1 as getEffectiveDisabledVenues, f2 as isVenueActive, f3 as isVenueDataVisible, f4 as isVenueInactive, f5 as snapshotToOrderbook } from './agg-websocket-Bxt9PzTz.js';
3
-
4
- declare enum ImageSize {
5
- sm = 44,
6
- md = 48,
7
- lg = 60,
8
- xl = 80,
9
- xxl = 96,
10
- xxxl = 120,
11
- original = 0
12
- }
13
- declare const IMAGE_SIZES: readonly [ImageSize.sm, ImageSize.md, ImageSize.lg, ImageSize.xl, ImageSize.xxl, ImageSize.xxxl];
14
- /** Variants sized for 2x displays. */
15
- declare const RETINA_IMAGE_SIZES: readonly [ImageSize.xl, ImageSize.xxl, ImageSize.xxxl];
16
-
17
- /** Symbol key applied to readonly types */
18
- declare const ReadonlyKind: unique symbol;
19
- /** Symbol key applied to optional types */
20
- declare const OptionalKind: unique symbol;
21
- /** Symbol key applied to types */
22
- declare const Hint: unique symbol;
23
- /** Symbol key applied to types */
24
- declare const Kind: unique symbol;
25
-
26
- type TReadonly<T extends TSchema> = T & {
27
- [ReadonlyKind]: 'Readonly';
28
- };
29
-
30
- type TLiteralValue = boolean | number | string;
31
- interface TLiteral<T extends TLiteralValue = TLiteralValue> extends TSchema {
32
- [Kind]: 'Literal';
33
- static: T;
34
- const: T;
35
- }
36
-
37
- type UnionStatic<T extends TSchema[], P extends unknown[]> = {
38
- [K in keyof T]: T[K] extends TSchema ? Static<T[K], P> : never;
39
- }[number];
40
- interface TUnion<T extends TSchema[] = TSchema[]> extends TSchema {
41
- [Kind]: 'Union';
42
- static: UnionStatic<T, this['params']>;
43
- anyOf: T;
44
- }
45
-
46
- type StringFormatOption = 'date-time' | 'time' | 'date' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'iri' | 'uuid' | 'iri-reference' | 'uri-template' | 'json-pointer' | 'relative-json-pointer' | 'regex' | ({} & string);
47
- type StringContentEncodingOption = '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64' | ({} & string);
48
- interface StringOptions extends SchemaOptions {
49
- /** The maximum string length */
50
- maxLength?: number;
51
- /** The minimum string length */
52
- minLength?: number;
53
- /** A regular expression pattern this string should match */
54
- pattern?: string;
55
- /** A format this string should match */
56
- format?: StringFormatOption;
57
- /** The content encoding for this string */
58
- contentEncoding?: StringContentEncodingOption;
59
- /** The content media type for this string */
60
- contentMediaType?: string;
61
- }
62
- interface TString extends TSchema, StringOptions {
63
- [Kind]: 'String';
64
- static: string;
65
- type: 'string';
66
- }
67
-
68
- interface TBoolean extends TSchema {
69
- [Kind]: 'Boolean';
70
- static: boolean;
71
- type: 'boolean';
72
- }
73
-
74
- interface NumberOptions extends SchemaOptions {
75
- exclusiveMaximum?: number;
76
- exclusiveMinimum?: number;
77
- maximum?: number;
78
- minimum?: number;
79
- multipleOf?: number;
80
- }
81
- interface TNumber extends TSchema, NumberOptions {
82
- [Kind]: 'Number';
83
- static: number;
84
- type: 'number';
85
- }
86
-
87
- interface IntegerOptions extends SchemaOptions {
88
- exclusiveMaximum?: number;
89
- exclusiveMinimum?: number;
90
- maximum?: number;
91
- minimum?: number;
92
- multipleOf?: number;
93
- }
94
- interface TInteger extends TSchema, IntegerOptions {
95
- [Kind]: 'Integer';
96
- static: number;
97
- type: 'integer';
98
- }
99
-
100
- type TOptional<T extends TSchema> = T & {
101
- [OptionalKind]: 'Optional';
102
- };
103
-
104
- interface TNull extends TSchema {
105
- [Kind]: 'Null';
106
- static: null;
107
- type: 'null';
108
- }
109
-
110
- /** Creates a static type from a TypeBox type */
111
- type Static<Type extends TSchema, Params extends unknown[] = [], Result = (Type & {
112
- params: Params;
113
- })['static']> = Result;
114
-
115
- type ReadonlyOptionalPropertyKeys<T extends TProperties> = {
116
- [K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? K : never) : never;
117
- }[keyof T];
118
- type ReadonlyPropertyKeys<T extends TProperties> = {
119
- [K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? never : K) : never;
120
- }[keyof T];
121
- type OptionalPropertyKeys<T extends TProperties> = {
122
- [K in keyof T]: T[K] extends TOptional<TSchema> ? (T[K] extends TReadonly<T[K]> ? never : K) : never;
123
- }[keyof T];
124
- type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
125
- type ObjectStaticProperties<T extends TProperties, R extends Record<keyof any, unknown>> = Evaluate<(Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>)>;
126
- type ObjectStatic<T extends TProperties, P extends unknown[]> = ObjectStaticProperties<T, {
127
- [K in keyof T]: Static<T[K], P>;
128
- }>;
129
- type TPropertyKey = string | number;
130
- type TProperties = Record<TPropertyKey, TSchema>;
131
- type TIsLiteralString<Type extends string> = ([
132
- Type
133
- ] extends [string] ? [string] extends [Type] ? false : true : false);
134
- type IsRequiredArrayLiteralConstant<RequiredTuple extends string[]> = (RequiredTuple extends [infer Left extends string, ...infer _ extends string[]] ? TIsLiteralString<Left> : false);
135
- type TRequiredArray<Properties extends TProperties, RequiredProperties extends TProperties = {
136
- [Key in keyof Properties as Properties[Key] extends TOptional<Properties[Key]> ? never : Key]: Properties[Key];
137
- }, RequiredUnion extends string = Extract<keyof RequiredProperties, string>, RequiredTuple extends string[] = UnionToTuple<RequiredUnion>, Result extends string[] | undefined = (IsRequiredArrayLiteralConstant<RequiredTuple> extends true ? RequiredTuple : string[] | undefined)> = Result;
138
- type TAdditionalProperties = undefined | TSchema | boolean;
139
- interface ObjectOptions extends SchemaOptions {
140
- /** Additional property constraints for this object */
141
- additionalProperties?: TAdditionalProperties;
142
- /** The minimum number of properties allowed on this object */
143
- minProperties?: number;
144
- /** The maximum number of properties allowed on this object */
145
- maxProperties?: number;
146
- }
147
- interface TObject<T extends TProperties = TProperties> extends TSchema, ObjectOptions {
148
- [Kind]: 'Object';
149
- static: ObjectStatic<T, this['params']>;
150
- additionalProperties?: TAdditionalProperties;
151
- type: 'object';
152
- properties: T;
153
- required: TRequiredArray<T>;
154
- }
155
-
156
- type UnionToIntersect<U> = (U extends unknown ? (arg: U) => 0 : never) extends (arg: infer I) => 0 ? I : never;
157
- type UnionLast<U> = UnionToIntersect<U extends unknown ? (x: U) => 0 : never> extends (x: infer L) => 0 ? L : never;
158
- type UnionToTuple<U, Acc extends unknown[] = [], R = UnionLast<U>> = [U] extends [never] ? Acc : UnionToTuple<Exclude<U, R>, [Extract<U, R>, ...Acc]>;
159
- type Evaluate<T> = T extends infer O ? {
160
- [K in keyof O]: O[K];
161
- } : never;
162
- type Ensure<T> = T extends infer U ? U : never;
163
-
164
- interface ArrayOptions extends SchemaOptions {
165
- /** The minimum number of items in this array */
166
- minItems?: number;
167
- /** The maximum number of items in this array */
168
- maxItems?: number;
169
- /** Should this schema contain unique items */
170
- uniqueItems?: boolean;
171
- /** A schema for which some elements should match */
172
- contains?: TSchema;
173
- /** A minimum number of contains schema matches */
174
- minContains?: number;
175
- /** A maximum number of contains schema matches */
176
- maxContains?: number;
177
- }
178
- type ArrayStatic<T extends TSchema, P extends unknown[]> = Ensure<Static<T, P>[]>;
179
- interface TArray<T extends TSchema = TSchema> extends TSchema, ArrayOptions {
180
- [Kind]: 'Array';
181
- static: ArrayStatic<T, this['params']>;
182
- type: 'array';
183
- items: T;
184
- }
185
-
186
- interface SchemaOptions {
187
- $schema?: string;
188
- /** Id for this schema */
189
- $id?: string;
190
- /** Title of this schema */
191
- title?: string;
192
- /** Description of this schema */
193
- description?: string;
194
- /** Default value for this schema */
195
- default?: any;
196
- /** Example values matching this schema */
197
- examples?: any;
198
- /** Optional annotation for readOnly */
199
- readOnly?: boolean;
200
- /** Optional annotation for writeOnly */
201
- writeOnly?: boolean;
202
- [prop: string]: any;
203
- }
204
- interface TKind {
205
- [Kind]: string;
206
- }
207
- interface TSchema extends TKind, SchemaOptions {
208
- [ReadonlyKind]?: string;
209
- [OptionalKind]?: string;
210
- [Hint]?: string;
211
- params: unknown[];
212
- static: unknown;
213
- }
214
-
215
- /**
216
- * Stable machine-readable codes for `/execution/fill` and `/orderbook/.../route`
217
- * 400 responses. The frontend branches on this to decide whether a rejection
218
- * is recoverable (silently re-quote and retry) vs. terminal (surface to user).
219
- *
220
- * Always carry a human-readable `message` alongside; the code is additive and
221
- * may be absent on rejections that pre-date this addition.
222
- */
223
- declare const QuoteErrorCodeTB: TUnion<[TLiteral<"quote_not_found">, TLiteral<"quote_expired">, TLiteral<"quote_already_executed">, TLiteral<"quote_cancelled">, TLiteral<"quote_user_mismatch">, TLiteral<"quote_app_blocked">, TLiteral<"quote_unfillable">, TLiteral<"quote_min_order_size">, TLiteral<"quote_stale_status">, TLiteral<"quote_stale_price">, TLiteral<"quote_insufficient_balance">, TLiteral<"quote_market_inactive">, TLiteral<"quote_self_custody_unsupported_venue">, TLiteral<"quote_self_custody_app_fee">, TLiteral<"quote_self_custody_redeem_unsupported">, TLiteral<"venue_not_executable">, TLiteral<"outcome_ambiguous">]>;
224
- type QuoteErrorCode = Static<typeof QuoteErrorCodeTB>;
225
- declare const QuoteErrorTB: TObject<{
226
- message: TString;
227
- code: TOptional<TUnion<[TLiteral<"quote_not_found">, TLiteral<"quote_expired">, TLiteral<"quote_already_executed">, TLiteral<"quote_cancelled">, TLiteral<"quote_user_mismatch">, TLiteral<"quote_app_blocked">, TLiteral<"quote_unfillable">, TLiteral<"quote_min_order_size">, TLiteral<"quote_stale_status">, TLiteral<"quote_stale_price">, TLiteral<"quote_insufficient_balance">, TLiteral<"quote_market_inactive">, TLiteral<"quote_self_custody_unsupported_venue">, TLiteral<"quote_self_custody_app_fee">, TLiteral<"quote_self_custody_redeem_unsupported">, TLiteral<"venue_not_executable">, TLiteral<"outcome_ambiguous">]>>;
228
- }>;
229
- type QuoteError = Static<typeof QuoteErrorTB>;
230
-
231
- /** Hosted ledger balances are not on-chain signing-wallet balances. */
232
- declare const HostedVenueBalanceTB: TObject<{
233
- asset: TLiteral<"USDC">;
234
- decimals: TLiteral<6>;
235
- totalRaw: TString;
236
- availableRaw: TString;
237
- unmatchedExposureRaw: TString;
238
- updatedAt: TString;
239
- }>;
240
- type HostedVenueBalance = Static<typeof HostedVenueBalanceTB>;
241
- declare const HostedVenueAccountTB: TObject<{
242
- venue: TLiteral<Venue.betdex>;
243
- accountModel: TLiteral<"platform-hosted">;
244
- /** Agg account ID only. Provider wallet/app identities and keys stay private. */
245
- accountId: TUnion<[TString, TNull]>;
246
- environment: TUnion<[TLiteral<"sandbox">, TLiteral<"production">, TNull]>;
247
- status: TUnion<[TLiteral<"not_created">, TLiteral<"provisioning">, TLiteral<"active">, TLiteral<"suspended">, TLiteral<"unavailable">, TLiteral<"disabled">]>;
248
- provisioningEnabled: TBoolean;
249
- fundingNetwork: TLiteral<"solana">;
250
- balanceStatus: TUnion<[TLiteral<"available">, TLiteral<"unavailable">, TLiteral<"not_applicable">]>;
251
- balance: TUnion<[TObject<{
252
- asset: TLiteral<"USDC">;
253
- decimals: TLiteral<6>;
254
- totalRaw: TString;
255
- availableRaw: TString;
256
- unmatchedExposureRaw: TString;
257
- updatedAt: TString;
258
- }>, TNull]>;
259
- }>;
260
- type HostedVenueAccount = Static<typeof HostedVenueAccountTB>;
261
- declare const HOSTED_VENUE_ACTIVITY_CODES: readonly ["Deposit", "Withdrawal", "TradeCreation", "TradeVoid", "TradeWin", "WalletToWallet", "Commission", "MarketPositionVoid", "MarketPositionPayout", "MarketPositionRefund", "ManualDebit", "ManualCredit", "SettlementResidual"];
262
- type HostedVenueActivityCode = (typeof HOSTED_VENUE_ACTIVITY_CODES)[number];
263
- declare const HostedVenueActivityTB: TObject<{
264
- venue: TLiteral<Venue.betdex>;
265
- accountId: TString;
266
- environment: TUnion<[TLiteral<"sandbox">, TLiteral<"production">]>;
267
- asset: TLiteral<"USDC">;
268
- /** Native ledger precision, not token-transfer or trade authorization units. */
269
- decimals: TLiteral<18>;
270
- page: TInteger;
271
- nextPage: TUnion<[TInteger, TNull]>;
272
- observedAt: TString;
273
- items: TArray<TObject<{
274
- id: TString;
275
- code: TUnion<TLiteral<"Deposit" | "Withdrawal" | "TradeCreation" | "TradeVoid" | "TradeWin" | "WalletToWallet" | "Commission" | "MarketPositionVoid" | "MarketPositionPayout" | "MarketPositionRefund" | "ManualDebit" | "ManualCredit" | "SettlementResidual">[]>;
276
- amountRaw: TString;
277
- createdAt: TString;
278
- }>>;
279
- }>;
280
- type HostedVenueActivity = Static<typeof HostedVenueActivityTB>;
281
- declare const HostedVenueActivityQueryTB: TObject<{
282
- mode: TOptional<TUnion<[TLiteral<"live">, TLiteral<"paper">]>>;
283
- page: TOptional<TNumber>;
284
- }>;
285
- type HostedVenueActivityQuery = Static<typeof HostedVenueActivityQueryTB>;
286
- declare const HostedVenueDepositAddressTB: TObject<{
287
- venue: TLiteral<Venue.betdex>;
288
- accountId: TString;
289
- environment: TUnion<[TLiteral<"sandbox">, TLiteral<"production">]>;
290
- asset: TLiteral<"USDC">;
291
- network: TLiteral<"solana">;
292
- address: TString;
293
- observedAt: TString;
294
- }>;
295
- type HostedVenueDepositAddress = Static<typeof HostedVenueDepositAddressTB>;
296
- declare const HostedVenueWithdrawalRequestTB: TObject<{
297
- mode: TLiteral<"live">;
298
- /** Caller-owned idempotency key. Ambiguous native submissions are never replayed. */
299
- requestId: TString;
300
- /** Exact six-decimal USDC atoms; an omitted amount never means withdraw-all. */
301
- amountRaw: TString;
302
- destinationAddress: TString;
303
- }>;
304
- type HostedVenueWithdrawalRequest = Static<typeof HostedVenueWithdrawalRequestTB>;
305
- declare const HostedVenueWithdrawalTB: TObject<{
306
- id: TString;
307
- venue: TLiteral<Venue.betdex>;
308
- accountId: TString;
309
- environment: TUnion<[TLiteral<"sandbox">, TLiteral<"production">]>;
310
- asset: TLiteral<"USDC">;
311
- decimals: TLiteral<6>;
312
- network: TLiteral<"solana">;
313
- amountRaw: TString;
314
- destinationAddress: TString;
315
- status: TUnion<[TLiteral<"processing">, TLiteral<"confirmed">, TLiteral<"failed">, TLiteral<"flagged">, TLiteral<"review_required">]>;
316
- createdAt: TString;
317
- updatedAt: TString;
318
- }>;
319
- type HostedVenueWithdrawal = Static<typeof HostedVenueWithdrawalTB>;
320
- declare const ProvisionHostedVenueAccountBodyTB: TObject<{
321
- mode: TLiteral<"live">;
322
- }>;
323
- type ProvisionHostedVenueAccountBody = Static<typeof ProvisionHostedVenueAccountBodyTB>;
324
-
325
- /**
326
- * API response-boundary formatters for market display fields.
327
- *
328
- * Called by the response mappers (mapVenueMarketRow, toVenueEventDto) to
329
- * produce display-ready text before it reaches the client. Internal code
330
- * (matching, sorting, DB) uses the raw DB values.
331
- */
332
- /**
333
- * Resolve the display label for a VenueMarketOutcome.
334
- *
335
- * - **Kalshi:** Always return `label`. Kalshi's label IS the canonical
336
- * display text ("Yes"/"No"); `title` is a subtitle shown elsewhere.
337
- * - **All other venues:** Return `title` if present and non-empty,
338
- * otherwise `label`. Polymarket normalizes binary outcomes to
339
- * "Yes"/"No" labels and stores the original descriptive text in `title`
340
- * (e.g. label="Yes", title="Trump Wins").
341
- *
342
- * When `market` context is provided and the outcome's `title` duplicates
343
- * the market's `question` (a known Limitless group-sub-market quirk where
344
- * the driver name lands on every outcome's title), fall back to `label`
345
- * so "Yes"/"No" remain distinguishable instead of both collapsing to the
346
- * market subject.
347
- */
348
- declare function formatOutcomeLabel(venue: Venue, outcome: {
349
- label: string;
350
- title?: string | null;
351
- }, _market?: {
352
- question?: string | null;
353
- }): string;
354
- /**
355
- * Resolve the display question for a VenueMarket.
356
- *
357
- * - **Kalshi:** Return the first outcome's `title` if available. Kalshi
358
- * market tickers (e.g. "INXD-26APR08-T7563.43") are stored in
359
- * `question` but the human-readable text is in the outcome's `title`
360
- * (e.g. "S&P 500 closes above 7,563.43"). Falls back to `question` if
361
- * no outcome title exists.
362
- * - **All other venues:** Return `question` as-is (already human-readable).
363
- */
364
- declare function formatMarketQuestion(venue: Venue, market: {
365
- question: string;
366
- shortTitle?: string | null;
367
- venueMarketOutcomes?: Array<{
368
- label: string;
369
- title?: string | null;
370
- }>;
371
- }): string;
372
- /**
373
- * Resolve the display title for a VenueMarketOutcome.
374
- *
375
- * Returns `null` when every outcome on the market shares the same `title`
376
- * (Kalshi binary markets often store the same human-readable phrase on
377
- * both Yes/No outcomes — repeating it on each option is redundant). The
378
- * frontend should fall back to `label` in that case.
379
- *
380
- * Otherwise returns the outcome's stored `title` verbatim (or `null` when
381
- * unset). The DB `label` is always returned untouched by this helper.
382
- *
383
- * Polymarket player-prop fallback: when a binary Yes/No outcome has no
384
- * stored title (Gamma sends `outcomes=["Yes","No"]` for these markets,
385
- * e.g. *"Mikal Bridges: Rebounds O/U 2.5"*), derive `Over`/`Under` from
386
- * the question's `O/U <n>` token so the FE has something meaningful to
387
- * show. Sports-totals (`["Over","Under"]`) and spread markets
388
- * (`["<TeamA>","<TeamB>"]`) already get titles from upstream and are
389
- * unaffected.
390
- */
391
- declare function formatOutcomeTitle(_venue: Venue, outcome: {
392
- label: string;
393
- title?: string | null;
394
- }, market: {
395
- question?: string | null;
396
- venueMarketOutcomes?: Array<{
397
- label: string;
398
- title?: string | null;
399
- }>;
400
- }): string | null;
401
-
402
- declare function getWalletAddressFromUserProfile(user: UserProfile | undefined): string | undefined;
403
-
404
- /**
405
- * Lightweight runtime validation utilities — zero dependencies.
406
- * Replaces Zod's safeParse/parse for simple type-guard-based validation.
407
- */
408
- type SafeParseSuccess<T> = {
409
- success: true;
410
- data: T;
411
- };
412
- type SafeParseFailure = {
413
- success: false;
414
- error?: {
415
- issues: Array<{
416
- message: string;
417
- }>;
418
- };
419
- };
420
- type SafeParseResult<T> = SafeParseSuccess<T> | SafeParseFailure;
421
- /** Generic safeParse — drop-in replacement for zod's schema.safeParse(). */
422
- declare function safeParse<T>(value: unknown, guard: (v: unknown) => v is T): SafeParseResult<T>;
423
- /** Throwing parse — drop-in replacement for zod's schema.parse(). */
424
- declare function parse<T>(value: unknown, guard: (v: unknown) => v is T, message?: string): T;
425
- /** Creates a type guard for a set of string values (enums, string unions). */
426
- declare function isEnum<T extends string>(values: ReadonlySet<string>): (v: unknown) => v is T;
427
- /** Creates a type guard for a set of string values from an enum or array. */
428
- declare function enumGuard<T extends string>(source: Record<string, T> | readonly T[]): (v: unknown) => v is T;
429
- /** Finite, non-negative number. */
430
- declare function isFiniteNonNeg(v: unknown): v is number;
431
- /** Non-empty string. */
432
- declare function isNonEmptyString(v: unknown): v is string;
433
- /** Object with specific keys present and of the right primitive type. */
434
- declare function hasShape<T>(v: unknown, checks: Record<string, (val: unknown) => boolean>): v is T;
435
- /**
436
- * Linear-scan email check matching /^[^\s@]+@[^\s@]+\.[^\s@]+$/ semantics
437
- * without polynomial-regex backtracking. Exported so the API's TypeBox
438
- * FormatRegistry can share the same implementation.
439
- */
440
- declare function isEmail(v: string): boolean;
441
- /** Validates + trims email. Returns safeParse-compatible result with error.issues shape. */
442
- declare function parseEmail(raw: string): SafeParseResult<{
443
- email: string;
444
- }>;
445
- /** Strict email parse — throws with .issues for catch-block compat. */
446
- declare function parseEmailStrict(raw: string): {
447
- email: string;
448
- };
449
-
450
- interface SplitsByAmountResult {
451
- splits: TradeSplit[];
452
- totalSize: number;
453
- totalCost: number;
454
- }
455
- declare function computeBestSplitsByAmount$1(selections: Array<{
456
- market: VenueMarket;
457
- outcome: VenueMarketOutcome;
458
- orderbook: Orderbook;
459
- }>, side: TradeSide, maxDollarAmount: number): SplitsByAmountResult;
460
-
461
- /**
462
- * Rewrite a CDN image URL to use the pre-processed variant closest to `maxPx`.
463
- *
464
- * - CDN URLs ending in `/original.webp` or `/{size}.webp` are rewritten.
465
- * - External URLs (venue logos, non-CDN) pass through unchanged.
466
- * - Falsy inputs return `undefined`.
467
- *
468
- * @param url Full image URL from the API (e.g. `https://assets.agg.market/users/.../original.webp`)
469
- * @param maxPx Largest dimension the image will be rendered at, in CSS pixels.
470
- * Pass the **largest** responsive breakpoint size (e.g. 60 for `size-10 md:size-[60px]`).
471
- */
472
- declare function optimizedImageUrl(url: string | null | undefined, maxPx: number): string | undefined;
473
- /**
474
- * Rewrite a CDN image URL to the retina variant covering `maxPx` at 2x density,
475
- * for use as the `2x` candidate beside {@link optimizedImageUrl}.
476
- *
477
- * Returns `undefined` for external URLs, falsy inputs, or when `maxPx * 2`
478
- * exceeds the largest retina variant (the 1x URL is then the only candidate).
479
- * Assets processed before 2026-07-31 may not have retina variants yet, so
480
- * callers must fall back to the 1x URL when this one fails to load.
481
- */
482
- declare function retinaImageUrl(url: string | null | undefined, maxPx: number): string | undefined;
483
-
484
- type VenueMarketClusterNode<TMarket = unknown> = {
485
- id: string;
486
- venue: string;
487
- matchedVenueMarkets?: readonly TMarket[] | null;
488
- matchEntry?: {
489
- targetVenueMarketId?: string | null;
490
- targetVenueMarket?: TMarket | null;
491
- } | null | undefined;
492
- venues?: readonly string[] | null;
493
- venueCount?: number | null;
494
- };
495
- declare const normalizeVenueMarketCluster: <TMarket extends VenueMarketClusterNode<TMarket>>(markets: readonly TMarket[], selectedMarketId?: string | null) => TMarket[];
496
-
497
- declare const sortVenues: <T extends string>(venues: readonly T[]) => T[];
498
-
499
- /**
500
- * Build an external URL to a venue's event/market page.
501
- *
502
- * Single source of truth — used by API services AND by the admin Matched
503
- * Events page to deep-link rows out to the venue's UI.
504
- *
505
- * Returns `null` when there isn't enough data to construct a working URL.
506
- * Callers should hide the link button rather than render a broken href.
507
- *
508
- * Per-venue URL conventions are kept here so any future change (e.g.
509
- * Kalshi moves to a new path, Polymarket rebrands) is a one-file edit.
510
- */
511
- interface BuildVenueUrlOpts {
512
- /** VenueEvent.slug — preferred input for venues that use slug-style URLs. */
513
- eventSlug?: string | null;
514
- /** VenueEvent.externalIdentifier — used by Kalshi (with series) and as a fallback. */
515
- eventExternalId?: string | null;
516
- /** VenueEvent.series.externalIdentifier — required for Kalshi's canonical URL. */
517
- seriesExternalId?: string | null;
518
- /** VenueMarket.conditionId — used as a fallback for Polymarket when slug is missing. */
519
- conditionId?: string | null;
520
- /**
521
- * Novig outcome id — the per-side (Yes/No) id, e.g.
522
- * `DiscoveredOutcome.external_identifier` / `o.id` in
523
- * agg-venue-novig/src/convert.rs. NOT the same id as `eventExternalId`
524
- * (Novig's event id, `ev.id`) or a market id (`m.id`) — Novig's deeplink
525
- * template takes the outcome, one level more specific than either. Not
526
- * currently plumbed from any caller.
527
- */
528
- outcomeExternalId?: string | null;
529
- /**
530
- * Novig-issued partner id, required by Novig's deeplink URL structure for
531
- * attribution tracking (https://docs.novig.com/llms-full.txt,
532
- * "Deeplinking"). Not currently plumbed from any caller — no Novig case
533
- * builds a URL without it, so pass it explicitly once we have one.
534
- */
535
- partnerId?: string | null;
536
- /**
537
- * Which of Novig's two documented deeplink schemes to build — Novig's docs
538
- * say to detect the caller's platform via User-Agent and pick accordingly.
539
- * Defaults to `"web"`. Ignored by every other venue.
540
- */
541
- platform?: "web" | "native";
542
- }
543
- declare function buildVenueUrl(venue: string, opts: BuildVenueUrlOpts): string | null;
544
-
545
- declare const LIMIT_PRICE_RAW_SCALE: bigint;
546
- type LimitPriceSide = "buy" | "sell";
547
- type LimitPriceTickAdjustment = {
548
- adjusted: boolean;
549
- adjustedPriceRaw: string;
550
- originalPriceRaw: string;
551
- tickSizeRaw: string | null;
552
- };
553
- /**
554
- * Aligns a six-decimal limit price to a venue tick in the user's favor.
555
- * All rounding is performed with integers after the venue tick is scaled.
556
- */
557
- declare const adjustLimitPriceRawToTick: ({ limitPriceRaw, side, tickSize, }: {
558
- limitPriceRaw: string;
559
- side: LimitPriceSide;
560
- tickSize?: number | null;
561
- }) => LimitPriceTickAdjustment;
562
-
563
- declare const DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW = "1002000000";
564
- declare const DEFAULT_BALANCE_REFILL_MAX_FEE_RAW = "2000000";
565
- declare const getBalanceRefillMaximumRaw: (dailyCapRaw: string, maxFeeRaw: string) => string;
566
- declare const isBalanceRefillWithinDailyCap: (minimumRaw: string, refillAmountRaw: string, dailyCapRaw: string, maxFeeRaw: string) => boolean;
567
-
568
- /** IEEE CRC32 used by the existing orderbook protocol. */
569
- declare function orderbookCrc32(value: string): number;
570
- /** Checksum of exactly the supplied levels, independent of depth/venue attribution. */
571
- declare function projectedOrderbookChecksum(book: {
572
- bids: ReadonlyArray<{
573
- price: number;
574
- size: number;
575
- }>;
576
- asks: ReadonlyArray<{
577
- price: number;
578
- size: number;
579
- }>;
580
- }): number;
581
-
582
- type AuthStateListener = (authenticated: boolean) => void;
583
- type UserAuthResult = {
584
- accessToken: string;
585
- refreshToken?: string;
586
- user: UserProfile;
587
- };
588
- declare class AggClient {
589
- private _appId?;
590
- private adminKey?;
591
- private apiKey?;
592
- private baseUrl;
593
- private accessToken?;
594
- private refreshTokenValue?;
595
- private currentUser?;
596
- private listeners;
597
- private storageKey;
598
- private shouldPersistSession;
599
- private authDelivery;
600
- private wsUrl?;
601
- readonly preferImmutableHistory: boolean;
602
- private readonly webSocketFactory?;
603
- private _authStatus;
604
- private authChannel;
605
- private authOptions?;
606
- /** In-flight refresh promise — serializes concurrent 401 retries so only one refresh runs. */
607
- private pendingRefresh;
608
- /** Partner-supplied signature callback for self-custodial fills. The SDK never sees a key. */
609
- private readonly signer?;
610
- constructor(options: AggClientOptions);
611
- private resolvePaperTradingAppId;
612
- private paperTradingAccountsPath;
613
- private paperTradingAccountPath;
614
- private paperTradingListQuery;
615
- private paperTradingAccountListQuery;
616
- private withAuthPayload;
617
- private restoreSession;
618
- private persistSession;
619
- private initAuthChannel;
620
- /** Release resources (BroadcastChannel, etc.). Safe to call multiple times. */
621
- destroy(): void;
622
- /**
623
- * Generic HTTP method with automatic header injection and 401 retry.
624
- * Attaches `x-app-id`, `Authorization: Bearer`, and `x-admin-key` headers as appropriate.
625
- * On 401, attempts a single token refresh and retries the request.
626
- * @param path - API path (e.g. `/venue-events`)
627
- * @param init - Fetch init options, plus optional `query` object for URL search params
628
- */
629
- request<T>(path: string, init?: RequestInit & {
630
- query?: Record<string, string | string[]>;
631
- }, decode?: (response: Response) => Promise<T>): Promise<T>;
632
- private rawFetch;
633
- private throwResponseError;
634
- /**
635
- * Deduplicates concurrent refresh attempts — if multiple requests hit 401 at the same time,
636
- * only one refresh call is made and the rest wait for it.
637
- */
638
- private refreshWithDedup;
639
- private buildAuthRequestInit;
640
- private buildUserAuthResult;
641
- private performSignOutRequest;
642
- /** Set the user access token (for future user-tier auth). */
643
- setAccessToken(token: string): void;
644
- /** Set the current auth session tokens and optionally seed the user profile. */
645
- setSession(session: AggClientSessionInput): void;
646
- /** Clear the user access token, refresh token, and user info. Broadcasts cross-tab logout. */
647
- clearAccessToken(): void;
648
- private broadcastAuth;
649
- /**
650
- * The App this client speaks for, or `undefined` for an admin-key-only
651
- * client. Exposed so callers can scope per-app caches by it — app config is
652
- * app-scoped data, and two clients sharing one cache must not share entries.
653
- */
654
- get appId(): string | undefined;
655
- /** Current auth lifecycle status. */
656
- get authStatus(): AuthStatus;
657
- /** Whether a user access token is currently set. */
658
- get isAuthenticated(): boolean;
659
- /** Primary wallet address derived from the current user profile. */
660
- get address(): string | undefined;
661
- /** Subscribe to auth state changes. Returns an unsubscribe function. */
662
- onAuthStateChange(listener: AuthStateListener): () => void;
663
- private notifyListeners;
664
- /** Get the currently authenticated user, if any. */
665
- get user(): UserProfile | undefined;
666
- /**
667
- * Build an EIP-4361 SIWE message string.
668
- *
669
- * `params.address` is accepted in any casing. EIP-4361 requires the address
670
- * line to be EIP-55 checksummed, and wallets commonly return a lowercase one
671
- * — `eth_requestAccounts` does — so the checksum is applied here, the way
672
- * viem, ethers and `siwe` do inside their own message builders. An address
673
- * that is not 20 bytes of hex throws: no message we could build from it
674
- * would verify.
675
- */
676
- buildSiweMessage(params: SiweMessageParams): string;
677
- /** Build a SIWS message string for Solana wallet sign-in (pure formatting, no crypto). */
678
- buildSiwsMessage(params: SiwsMessageParams): string;
679
- /** Verify a SIWE/SIWS signature or a Privy access token with the API, store the token + user. */
680
- verify(args: AggAuthVerifyBody): Promise<UserAuthResult>;
681
- /** Backwards-compatible alias for `verify()`. */
682
- verifySignIn(args: AggAuthVerifyBody): Promise<UserAuthResult>;
683
- /** Initiate an auth flow (SIWE nonce, OAuth redirect URL, or magic link). */
684
- authStart(body: AggAuthStartBody): Promise<AggAuthStartResult>;
685
- /** Backwards-compatible alias for `authStart()`. */
686
- startAuth(body: AggAuthStartBody): Promise<AggAuthStartResult>;
687
- /**
688
- * Start an account-link flow. Requires the caller to already be signed in — sends
689
- * the bearer automatically. Response shape:
690
- * - OAuth providers → `{ type: "redirect", url }`; redirect the browser to `url`.
691
- * - Email → `{ type: "magic_link", success: true }`; check the destination inbox.
692
- * - Wallet providers (siwe/siws) → `{ type: "wallet_challenge", message }`; have the
693
- * user sign `message` VERBATIM, then submit it to `linkAccountConfirm()` as
694
- * `{ kind: "wallet_signature", message, signature }`.
695
- *
696
- * After the OAuth/email callback runs, the browser lands back on the app's `redirectUrl`
697
- * with a `link_confirm_token` query param. Feed that token to `linkAccountConfirm()`
698
- * to persist the Account row.
699
- */
700
- linkAccount(body: AggLinkAccountBody): Promise<AggLinkAccountResult>;
701
- /**
702
- * Finalize an account link.
703
- *
704
- * - Pass a `link_confirm_token` string (OAuth/email) to exchange it for a linked
705
- * `Account` row.
706
- * - Pass `{ kind: "wallet_signature", message, signature }` (wallet providers) to
707
- * verify the signature over the `wallet_challenge` `message` returned by
708
- * `linkAccount()`.
709
- *
710
- * The server matches the current bearer's `principalId` to the challenge/token's
711
- * `principalId` before writing — this is the final ownership check. A wallet already
712
- * linked to a DIFFERENT principal rejects with HTTP 409.
713
- */
714
- linkAccountConfirm(input: string | AggLinkAccountWalletConfirmBody): Promise<AggLinkAccountConfirmResult>;
715
- /** Exchange a one-time auth code (from OAuth/magic-link callback) for tokens. */
716
- exchangeAuthCode(code: string): Promise<UserAuthResult>;
717
- /** Refresh the access token using the stored refresh token. */
718
- refreshAccessToken(): Promise<string>;
719
- /** Get the current user's profile. */
720
- getCurrentUser(): Promise<UserProfile>;
721
- /** Update the current user (e.g. username). Requires currentUser.id; call getCurrentUser() first if needed. */
722
- updateUser(data: UpdateUserBody): Promise<UserProfile>;
723
- /** Link a partner-provided external user ID assertion to the current user. */
724
- linkExternalId(params: {
725
- externalId: string;
726
- timestamp: number;
727
- hmac: string;
728
- }): Promise<UserProfile>;
729
- /** Create a presigned avatar upload URL for the current user. */
730
- createAvatarUploadUrl(contentType: string): Promise<{
731
- uploadUrl: string;
732
- assetKey: string;
733
- cdnUrl: string;
734
- }>;
735
- /** Disconnect a linked auth provider from the current user. */
736
- disconnectAccount(provider: "wallet" | "solana_wallet" | "google" | "twitter" | "apple" | "email"): Promise<{
737
- success: true;
738
- }>;
739
- /** Sign out — revoke all tokens server-side and clear local session. */
740
- signOut(): Promise<void>;
741
- /** Get user holdings (positions) for a venue. Uses backend to resolve venue-specific identifiers. */
742
- getUserHoldings(params: {
743
- venue: Venue;
744
- venueMarketId?: string;
745
- venueEventId?: string;
746
- cursor?: string;
747
- }): Promise<PaginatedResponse<UserHolding>>;
748
- /** List trade-executor orders for the authenticated user. */
749
- getOrders(params?: OrderListQuery): Promise<TradeExecutorOrderListResponse>;
750
- /**
751
- * List execution orders for the authenticated user (cursor pagination).
752
- *
753
- * Pass `quoteId` to fetch every leg of a multi-venue split route in
754
- * one call — `useQuoteSummary(quoteId)` reduces the list into a
755
- * rollup (total cost, share-weighted avg price, to-win). Pass
756
- * `venueMarketIds` to narrow to the orders on those markets. Sent as
757
- * repeated params in one request; batch long lists yourself (or use
758
- * `useExecutionOrdersForMarkets`) to keep the URL short.
759
- */
760
- getExecutionOrders(params?: ExecutionOrdersQuery): Promise<PaginatedResponse<ExecutionOrderItem>>;
761
- /**
762
- * Get quote-scoped execution progress, DAG step state, and order leg
763
- * terminal status. Also carries `pendingSignatures` — this is the route
764
- * `fillSelfCustody` polls while an on-chain step is in flight, so a caller
765
- * already polling this for progress learns about newly-parked steps here
766
- * too, not just from the signatures endpoint.
767
- */
768
- getExecutionStatus(params: ExecutionStatusQuery): Promise<ExecutionStatusResponse>;
769
- /** Unified user activity feed (trades, deposits, withdrawals, bridges, wallet ops). */
770
- getUserActivity(params?: UserActivityQuery): Promise<PaginatedResponse<UserActivityItem>>;
771
- /**
772
- * Per-app trader leaderboard ranked by realized P&L or volume over an
773
- * inclusive UTC day range. `rank` is exact within the top 100.
774
- */
775
- getLeaderboard(params?: LeaderboardQuery): Promise<PaginatedResponse<LeaderboardRow>>;
776
- /**
777
- * One user's leaderboard stats per UTC day (default the last 30 days, at
778
- * most 366) with a running cumulative realized P&L. Gross of fees;
779
- * unrealized P&L is not included.
780
- */
781
- getLeaderboardSeries(params: LeaderboardSeriesQuery): Promise<LeaderboardSeries>;
782
- /** List execution positions for the authenticated user (cursor pagination). */
783
- getExecutionPositions(params?: ExecutionPositionsQuery): Promise<PaginatedResponse<ExecutionPositionGroup>>;
784
- /**
785
- * Get cash balances and per-venue position balances.
786
- *
787
- * `custody: "self"` returns the wallets linked to this account — plus their
788
- * Polymarket deposit and legacy wallets — instead of the managed wallet. Each
789
- * chain row then carries `address` and `custodyKind`; `positions` is
790
- * account-wide either way.
791
- *
792
- * Caveat on the headline number: a chain row with `custodyKind:
793
- * "POLYMARKET_LEGACY"` and `legacyKind: "proxy"` holds funds that can only
794
- * be spent on Polymarket, but it still counts towards its token's
795
- * `totalRaw`/`availableRaw` (a token's totals are always the sum of its
796
- * chain rows). If you show "spendable anywhere", subtract those rows.
797
- */
798
- getManagedBalances(params?: ManagedBalancesParams): Promise<UnifiedBalanceResponse>;
799
- /** Read hosted custody status without creating a signing wallet or account. */
800
- getHostedVenueAccount(venue: "betdex", params?: ManagedBalancesParams): Promise<HostedVenueAccount>;
801
- /** Owned exact ledger entries; not balances, fill fees or withdrawal finality. */
802
- getHostedVenueActivity(venue: "betdex", params?: HostedVenueActivityQuery): Promise<HostedVenueActivity>;
803
- /** Explicit hosted-account creation; no signing wallet or credential upload. */
804
- provisionHostedVenueAccount(venue: "betdex", body: ProvisionHostedVenueAccountBody): Promise<HostedVenueAccount>;
805
- /** Fetch the owned hosted account's verified Solana USDC deposit address. */
806
- getHostedVenueDepositAddress(venue: "betdex", params?: ManagedBalancesParams): Promise<HostedVenueDepositAddress>;
807
- /** Submit exactly one explicit hosted withdrawal under a caller idempotency key. */
808
- withdrawHostedVenue(venue: "betdex", body: HostedVenueWithdrawalRequest): Promise<HostedVenueWithdrawal>;
809
- /** Read only Agg's persisted withdrawal state; this never replays a native request. */
810
- getHostedVenueWithdrawal(venue: "betdex", withdrawalId: string, params?: ManagedBalancesParams): Promise<HostedVenueWithdrawal>;
811
- /** Store or replace encrypted credentials for a venue. Secrets are never returned. */
812
- upsertVenueKey(body: UpsertVenueKey): Promise<VenueKeySummary>;
813
- /** List venues with stored credentials. */
814
- listVenueKeys(): Promise<VenueKeySummary[]>;
815
- /** Fetch connection and verification status for stored venue credentials. */
816
- getVenueKeyStatus(venue: Venue): Promise<VenueKeyStatus>;
817
- /** Remove stored credentials for a venue. */
818
- deleteVenueKey(venue: Venue): Promise<void>;
819
- /** Create a server-managed paper trading account for an app. Requires adminKey or apiKey. */
820
- createPaperTradingAccount(params: CreatePaperTradingAccountParams, options?: PaperTradingAppOptions): Promise<PaperTradingAccount>;
821
- /** List server-managed paper trading accounts for an app. Requires adminKey or apiKey. */
822
- listPaperTradingAccounts(params?: PaperTradingAccountListParams & PaperTradingAppOptions): Promise<PaperTradingAccountsPage>;
823
- /** Fetch a server-managed paper trading account. Requires adminKey or apiKey. */
824
- getPaperTradingAccount(accountId: string, options?: PaperTradingAppOptions): Promise<PaperTradingAccount>;
825
- /** Set a paper trading account cash balance. Requires adminKey or apiKey. */
826
- setPaperTradingBalance(accountId: string, params: SetPaperTradingBalanceParams, options?: PaperTradingAppOptions): Promise<PaperTradingBalanceResponse>;
827
- /** Clear positions and reset cash for a paper trading account. Requires adminKey or apiKey. */
828
- resetPaperTradingAccount(accountId: string, params?: ResetPaperTradingAccountParams, options?: PaperTradingAppOptions): Promise<PaperTradingBalanceResponse>;
829
- /** Place a direct simulated order in a paper trading account. Requires adminKey or apiKey. */
830
- placePaperTradingOrder(accountId: string, params: PlacePaperTradingOrderParams, options?: PaperTradingAppOptions): Promise<PaperTradingOrder>;
831
- /** List positions for a server-managed paper trading account. Requires adminKey or apiKey. */
832
- listPaperTradingPositions(accountId: string, params?: PaperTradingListParams & PaperTradingAppOptions): Promise<PaperTradingPositionsPage>;
833
- /** List orders for a server-managed paper trading account. Requires adminKey or apiKey. */
834
- listPaperTradingOrders(accountId: string, params?: PaperTradingListParams & PaperTradingAppOptions): Promise<PaperTradingOrdersPage>;
835
- /** Fetch account-level paper trading equity, P&L, and marked positions. Requires adminKey or apiKey. */
836
- getPaperTradingPortfolio(accountId: string, options?: PaperTradingAppOptions): Promise<PaperTradingPortfolio>;
837
- /**
838
- * Cancel an agg order by id. Self-custody needs Polymarket ClobAuth
839
- * or a fresh Hyperliquid cancel action signed by the EOA/client-held agent.
840
- */
841
- cancelManagedOrder(orderId: string, options?: {
842
- signal?: AbortSignal;
843
- cancelSignature?: CancelOrderSignature;
844
- }): Promise<CancelManagedExecutionResponse>;
845
- /**
846
- * Cancel a Polymarket or Hyperliquid limit order that one of the user's
847
- * linked self-custody wallets placed outside AGG. `signerAddress` must be
848
- * that wallet and must have produced `cancelSignature`.
849
- */
850
- cancelVenueOrder(params: CancelVenueOrderParams, options?: {
851
- signal?: AbortSignal;
852
- }): Promise<CancelManagedExecutionResponse>;
853
- /** List venue events with optional filters. Requires appId or admin auth. Supports cursor-based pagination. */
854
- getVenueEvents(options?: {
855
- venues?: Venue[];
856
- search?: string;
857
- categoryIds?: string[];
858
- matchStatus?: MatchStatus[];
859
- status?: MarketStatus[];
860
- sortBy?: string;
861
- sortDir?: string;
862
- aggKey?: string | string[];
863
- recurrence?: RecurrenceFilter | RecurrenceFilter[];
864
- limit?: number;
865
- cursor?: string;
866
- minYesPrice?: number;
867
- maxYesPrice?: number;
868
- /** Lifetime-volume floor (USD). Hides events/markets below it. Omit or 0 = no filter. */
869
- minVolume?: number;
870
- /** ISO-8601 timestamp. Hides events with endDate <= this value. NULL-endDate events are kept. */
871
- endDateFrom?: string;
872
- signal?: AbortSignal;
873
- /**
874
- * When true, fold same-venue companion events into one tile per game
875
- * (`groupParentId IS NULL`). Sent as `grouped=true`; omitted when false/absent
876
- * (default = ungrouped). Consumers showing one tile per game need a detail
877
- * view that loads the folded companions via aggKey.
878
- */
879
- grouped?: boolean;
880
- }): Promise<PaginatedResponse<VenueEvent>>;
881
- /** Get a single venue event by ID. Requires appId or admin auth. */
882
- getEventBootstrap(eventId: string, options?: {
883
- limit?: number;
884
- minVolume?: number;
885
- signal?: AbortSignal;
886
- }): Promise<EventBootstrapResponse>;
887
- getVenueEventById(id: string, options?: {
888
- signal?: AbortSignal;
889
- /**
890
- * Scope `marketCount` and the rolled-up `volume` to the whole matched
891
- * cluster (default, `true`) or to this one venue event (`false`). Pair it
892
- * with the same value on {@link getVenueMarkets} so the count matches the
893
- * market list you render.
894
- */
895
- cluster?: boolean;
896
- /**
897
- * Lifetime-volume floor (USD). Scopes `marketCount` to the markets
898
- * {@link getVenueMarkets} returns with the same `minVolume`. Omit or 0 = no filter.
899
- */
900
- minVolume?: number;
901
- }): Promise<VenueEvent>;
902
- /** Get normalized live score state for sports events. Requires appId or admin auth. */
903
- getSportsLive(eventIds: string[], options?: {
904
- signal?: AbortSignal;
905
- }): Promise<SportsLiveResponse>;
906
- /** List deterministic recurring crypto window markets across venues. Requires appId or admin auth. */
907
- listRecurringCryptoMarkets(options?: ListRecurringCryptoMarketsOptions & {
908
- signal?: AbortSignal;
909
- }): Promise<RecurringCryptoMarketsResponse>;
910
- /** Poll fresh reference prices for recurring crypto markets. Requires appId or admin auth. */
911
- getCryptoReferencePrices(options: GetCryptoReferencePricesOptions): Promise<CryptoReferencePricesResponse>;
912
- /** List venue markets with optional filters. Requires appId or admin auth. Supports cursor-based pagination. */
913
- getVenueMarkets(options?: {
914
- venue?: Venue;
915
- venueEventId?: string;
916
- /** Exact venue-native identifiers; requires venue, at most 20. */
917
- externalIdentifier?: string[];
918
- /**
919
- * Scope `venueEventId` to the whole matched cluster (default, `true`) or to
920
- * that one venue event (`false`). Under the default, naming any member of a
921
- * cluster returns every venue's markets for that real-world event with
922
- * matched siblings folded into their anchor. Ignored without `venueEventId`.
923
- */
924
- cluster?: boolean;
925
- search?: string;
926
- matchStatus?: MatchStatus;
927
- status?: MarketStatus;
928
- aggKey?: string[];
929
- sportsMarketType?: string[];
930
- period?: string[];
931
- marketCategory?: string[];
932
- marketGroup?: string[];
933
- limit?: number;
934
- cursor?: string;
935
- sortBy?: "volume" | "volume24hr" | "createdAt" | "updatedAt";
936
- sortDir?: "asc" | "desc";
937
- context?: "list" | "detail";
938
- /** Lifetime-volume floor (USD). Omit or 0 = no filter. */
939
- minVolume?: number;
940
- }, requestOptions?: {
941
- signal?: AbortSignal;
942
- }): Promise<PaginatedResponse<VenueMarket>>;
943
- /** Get categories with cursor-based pagination. Requires appId. */
944
- getCategories(options?: {
945
- limit?: number;
946
- cursor?: string;
947
- parentId?: string;
948
- }): Promise<PaginatedResponse<Category>>;
949
- /** Get per-app UI config (disabled venues + category presets). Requires appId. */
950
- getAppConfig(init?: RequestInit): Promise<AppClientConfigResponse>;
951
- /**
952
- * Get the per-venue blocked-country lists (ISO 3166-1 alpha-2). Requires appId.
953
- *
954
- * This is the raw venue policy, not per-user eligibility — to gate a fill,
955
- * read the `warnings` array on the quote response instead.
956
- */
957
- getVenueGeoPolicy(init?: RequestInit): Promise<VenueGeoPolicyResponse>;
958
- /** Get a temporary Alchemy JWT token for RPC connections. */
959
- getRpcToken(init?: RequestInit): Promise<RpcTokenResponse>;
960
- private buildNewsFeedQuery;
961
- /** List available market news feeds and item counts. */
962
- getNewsFeeds(options?: {
963
- signal?: AbortSignal;
964
- }): Promise<NewsFeedListResponse>;
965
- /** Get the article-centric market news feed for a category. */
966
- getNewsFeed(category: string, options?: NewsFeedPageOptions & {
967
- signal?: AbortSignal;
968
- }): Promise<NewsFeedArticleFeedResponse>;
969
- /** Get the market-centric market news feed for a category. */
970
- getNewsFeedMarkets(category: string, options?: NewsFeedPageOptions & {
971
- signal?: AbortSignal;
972
- }): Promise<NewsFeedMarketFeedResponse>;
973
- /** Get news feed coverage and per-category counts. */
974
- getNewsFeedStatus(options?: {
975
- signal?: AbortSignal;
976
- }): Promise<NewsFeedStatusResponse>;
977
- /** Search recent news for specific markets and return market impact summaries. */
978
- getMarketNews(params: NewsFeedMarketNewsParams, options?: {
979
- signal?: AbortSignal;
980
- }): Promise<NewsFeedMarketNewsResponse>;
981
- /**
982
- * Search events or markets by query string. Supports cursor-based pagination.
983
- *
984
- * Pass `deep: true` on submit (Enter / Search button) to opt in to the
985
- * server-side reranker. Leave it off for debounced typeahead — the wire
986
- * format intentionally omits the param so the server hits the cheaper
987
- * (and longer-TTL) light cache slot.
988
- */
989
- search<T = VenueEvent>(params: SearchParams, options?: {
990
- signal?: AbortSignal;
991
- }): Promise<SearchResponse<T>>;
992
- /** Get Correlated Markets processing and embedding coverage. */
993
- getCorrelatedMarketsStatus(options?: {
994
- signal?: AbortSignal;
995
- }): Promise<CorrelatedMarketsStatus>;
996
- /** Get the generated correlated market signals for a market. */
997
- getMarketCorrelatedSignals(venueMarketId: string, options?: {
998
- signal?: AbortSignal;
999
- includeResolved?: boolean;
1000
- }): Promise<CorrelatedMarketSignalBatch>;
1001
- /** Search markets by Correlated Markets signal similarity. */
1002
- queryCorrelatedMarkets(params: {
1003
- text: string;
1004
- limit?: number;
1005
- includeResolved?: boolean;
1006
- direction?: "more_likely" | "less_likely";
1007
- balanced?: boolean;
1008
- }, options?: {
1009
- signal?: AbortSignal;
1010
- }): Promise<{
1011
- results: CorrelatedMarketQueryResult[];
1012
- }>;
1013
- /** Get expansion and hedge candidates for an already-processed market. */
1014
- getCorrelatedMarketCascade(params: {
1015
- venueMarketId: string;
1016
- side?: "yes" | "no";
1017
- mode?: "expand" | "hedge";
1018
- limit?: number;
1019
- cursor?: string;
1020
- includeResolved?: boolean;
1021
- }, options?: {
1022
- signal?: AbortSignal;
1023
- }): Promise<CorrelatedMarketCascadeResponse>;
1024
- /** Resolve a market by ID, venue identifier, slug, conditionId, or text, then return candidates. */
1025
- resolveCorrelatedMarkets(params: ResolveCorrelatedMarketsParams, options?: {
1026
- signal?: AbortSignal;
1027
- }): Promise<ResolveCorrelatedMarketsResponse>;
1028
- /** Get the canonical TradingView-style bar series for a single venue market outcome. */
1029
- getChartBars(params: {
1030
- venueMarketOutcomeId: string;
1031
- resolution?: ChartResolution;
1032
- from?: number;
1033
- to: number;
1034
- countBack?: number;
1035
- }, options?: {
1036
- signal?: AbortSignal;
1037
- decode?: (payload: string) => Promise<ChartBarsResponse>;
1038
- }): Promise<ChartBarsResponse>;
1039
- getChartHistoryManifest(params: {
1040
- venueMarketOutcomeId: string;
1041
- resolution?: ChartResolution;
1042
- from?: number;
1043
- to: number;
1044
- countBack?: number;
1045
- }, options?: {
1046
- signal?: AbortSignal;
1047
- }): Promise<ChartHistoryManifest>;
1048
- /** Get live per-venue orderbooks for the explicit venueMarketIds requested. */
1049
- getOrderbooks(params: {
1050
- venueMarketIds: string[];
1051
- depth?: number;
1052
- }, options?: {
1053
- signal?: AbortSignal;
1054
- }): Promise<BatchOrderbooksResponse>;
1055
- /** Get live midpoints for the explicit venueMarketIds requested. */
1056
- getMidpoints(params: {
1057
- venueMarketIds: string[];
1058
- bestPrice?: boolean;
1059
- maxMidpointIdsPerRequest?: number;
1060
- }, options?: {
1061
- signal?: AbortSignal;
1062
- maxMidpointIdsPerRequest?: number;
1063
- }): Promise<BatchMidpointsResponse>;
1064
- getMidpoints(venueMarketIds: string[], options?: {
1065
- signal?: AbortSignal;
1066
- bestPrice?: boolean;
1067
- maxMidpointIdsPerRequest?: number;
1068
- }): Promise<BatchMidpointsResponse>;
1069
- /** Get a single outcome-level orderbook from the engine. */
1070
- getOutcomeOrderbook(outcomeId: string, options?: {
1071
- depth?: number;
1072
- signal?: AbortSignal;
1073
- }): Promise<OutcomeOrderbookResponse | null>;
1074
- /**
1075
- * Compute optimal order routing across venues via the MILP solver.
1076
- * Returns a user-scoped quote with per-venue fills and verification timing.
1077
- * Deprecated aliases are accepted for source compatibility during the
1078
- * outcome-level migration window.
1079
- */
1080
- getSmartRoute(params: SmartRouteParams, options?: {
1081
- signal?: AbortSignal;
1082
- }): Promise<SmartRouteResponse>;
1083
- /** Seed subscribed outcomes with one bounded batch of compatible snapshots. */
1084
- getOutcomeOrderbooks(params: {
1085
- venueMarketOutcomeIds: string[];
1086
- depth?: number;
1087
- }, options?: {
1088
- signal?: AbortSignal;
1089
- }): Promise<{
1090
- data: (OutcomeOrderbookResponse | null)[];
1091
- }>;
1092
- /**
1093
- * Create an AggWebSocket instance configured with this client's appId and optional auth token.
1094
- * Requires `wsUrl` to be set in the client options.
1095
- */
1096
- createWebSocket(callbacks?: AggWebSocketCallbacks, options?: {
1097
- enableLogs?: boolean;
1098
- }): AggWebSocket;
1099
- /** Execute a previously quoted managed trade. Returns pending order IDs. */
1100
- executeManaged(params: ExecuteManagedParams): Promise<ExecuteManagedResponse>;
1101
- /** Submit signatures for a parked fill. Returns whatever is still outstanding. */
1102
- submitFillSignatures(quoteId: string, signatures: Array<{
1103
- stepId: string;
1104
- signature?: string;
1105
- txHash?: string;
1106
- }>): Promise<ExecuteManagedResponse & {
1107
- accepted?: number;
1108
- }>;
1109
- /**
1110
- * Execute a quote in self-custodial mode.
1111
- *
1112
- * Identical to `executeManaged` when the server can sign for the user. When
1113
- * it cannot, the DAG parks on a signature request instead — but that park
1114
- * always happens asynchronously, in the trade-executor process, so it can
1115
- * never show up on this `POST /execution/fill` response itself. This
1116
- * drives the round trip from there: poll `getExecutionStatus` while an
1117
- * on-chain step is in flight, sign whatever it hands back with the
1118
- * configured `signer`, post the signatures back, and repeat until the
1119
- * server reports nothing outstanding and the run reaches a terminal state.
1120
- */
1121
- fillSelfCustody(params: ExecuteManagedParams): Promise<ExecuteManagedResponse>;
1122
- /**
1123
- * Enqueue a limit order. For self-custody, poll getExecutionStatus with the
1124
- * returned quoteId and answer pending requests through submitFillSignatures.
1125
- * A pending response does not mean the order has reached the venue.
1126
- */
1127
- placeLimitOrder(params: PlaceLimitOrderParams): Promise<PlaceLimitOrderResponse>;
1128
- /**
1129
- * Place a market order directly on a named venue — no prior quote needed.
1130
- * Always produces exactly one order. `externalId` is required and unique
1131
- * within your app — two different users of the same app cannot share one —
1132
- * so retrying a timed-out call with the same value is safe.
1133
- */
1134
- placeOrder(params: PlaceOrderParams): Promise<PlaceOrderResponse>;
1135
- /** Redeem resolved winning positions by venue market outcome ids. */
1136
- redeem(body: RedeemRequest): Promise<RedeemResponse>;
1137
- /** List the authenticated user's managed balance refill policies. */
1138
- getBalanceRefillPolicies(): Promise<BalanceRefillPolicy[]>;
1139
- /** Create a managed-USDC refill policy for a target chain. */
1140
- createBalanceRefillPolicy(params: CreateBalanceRefillPolicyParams): Promise<BalanceRefillPolicy>;
1141
- /** Update thresholds or pause/resume an existing balance refill policy. */
1142
- updateBalanceRefillPolicy(policyId: string, params: UpdateBalanceRefillPolicyParams): Promise<BalanceRefillPolicy>;
1143
- /** Return the 25 most recent attempts for a refill policy. */
1144
- getBalanceRefillAttempts(policyId: string): Promise<BalanceRefillAttempt[]>;
1145
- /** Withdraw funds from managed wallets to an external address. */
1146
- withdrawManaged(params: WithdrawManagedParams): Promise<WithdrawManagedResponse>;
1147
- /**
1148
- * Preview a withdrawal — real fee + receive estimate without creating one.
1149
- * Optional: `withdrawManaged` does NOT require a prior preview, so partners
1150
- * integrating against the SDK can ignore this entirely.
1151
- */
1152
- withdrawPreview(params: WithdrawPreviewParams): Promise<WithdrawPreviewResponse>;
1153
- /** Quote maximum deliverable withdrawal amount for a token and destination chain. */
1154
- getWithdrawalQuote(params: WithdrawalQuoteParams): Promise<WithdrawalQuoteResponse>;
1155
- /**
1156
- * Read the current persisted state of a withdrawal. Used as a backfill for
1157
- * the WS lifecycle channel: the client polls this on hook mount and on WS
1158
- * reconnect to recover events that fired before the listener was attached
1159
- * or while the socket was disconnected. Same response shape as
1160
- * `withdrawManaged`.
1161
- */
1162
- getWithdrawalStatus(withdrawalId: string): Promise<WithdrawManagedResponse>;
1163
- /** Trigger an on-chain balance sync for all tracked tokens across all chains. */
1164
- syncManagedBalances(): Promise<SyncBalancesResponse>;
1165
- /** Get managed wallet deposit addresses (EVM + Solana). Returns 202 shape while provisioning. */
1166
- getDepositAddresses(): Promise<DepositAddressesResponse>;
1167
- /**
1168
- * Internal: record that a deposit tx was initiated via the in-app
1169
- * connected-wallet flow, so the activity feed can label it correctly.
1170
- * Best-effort — callers should not block the UX on this.
1171
- */
1172
- recordDepositIntent(body: {
1173
- chainId: number;
1174
- txHash: string;
1175
- }): Promise<void>;
1176
- /** Get open positions grouped by matched market with per-venue breakdown. */
1177
- getPositions(params?: GetPositionsParams): Promise<PaginatedResponse<PositionGroup>>;
1178
- /** Get crypto purchase quotes. */
1179
- getRampQuotes(params: RampQuoteRequest): Promise<RampQuote[]>;
1180
- /** Create a ramp widget session for checkout. */
1181
- createRampSession(params: RampSessionRequest): Promise<RampWidgetSession>;
1182
- /** Authoritative shared Novig/ProphetX KYC status for the current managed wallet. */
1183
- getSharedKycStatus(): Promise<{
1184
- verified: boolean;
1185
- }>;
1186
- /** Start shared KYC; already-verified wallets need no redirect. Kalshi v2 is not applicable. */
1187
- initiateKyc(venue: string, redirectUri: string): Promise<{
1188
- status: string;
1189
- kycUrl?: string;
1190
- }>;
1191
- }
1192
-
1193
- declare const computeBestSplitsByAmount: typeof computeBestSplitsByAmount$1;
1194
-
1195
- /**
1196
- * Thrown when the server returns `challenge_required` during auth start.
1197
- * The client should render a Cloudflare Turnstile widget using `siteKey`,
1198
- * then retry the auth flow with the resulting `turnstileToken`.
1199
- */
1200
- declare class TurnstileChallengeError extends Error {
1201
- readonly siteKey: string;
1202
- constructor(siteKey: string);
1203
- }
1204
- /** Public 429 body. Optional fields preserve compatibility with message-only rate limiters. */
1205
- interface AggRateLimitResponse {
1206
- message: string;
1207
- statusCode?: 429;
1208
- code?: "rate_limited";
1209
- /** Retry delay in seconds; the SDK exposes parsed error hints as retryAfterMs. */
1210
- retryAfter?: number;
1211
- }
1212
- /** Field-level validation detail returned by the API on 400 responses. */
1213
- interface AggApiFieldError {
1214
- field: string;
1215
- message: string;
1216
- }
1217
- interface AggApiErrorInit {
1218
- code?: string;
1219
- retryable?: boolean;
1220
- /** Server-requested delay before a retry, in milliseconds. Does not enable automatic SDK retries. */
1221
- retryAfterMs?: number;
1222
- errors?: AggApiFieldError[];
1223
- }
1224
- /**
1225
- * Thrown for every non-2xx response from the AGG API.
1226
- *
1227
- * Branch on `status` and `code` rather than matching `message` text —
1228
- * messages are human-facing and may be reworded without a major bump.
1229
- *
1230
- * ```ts
1231
- * try {
1232
- * await client.getPositions();
1233
- * } catch (err) {
1234
- * if (isAggApiError(err) && err.status === 401) {
1235
- * // session lapsed — prompt reconnect
1236
- * }
1237
- * }
1238
- * ```
1239
- */
1240
- declare class AggApiError extends Error {
1241
- readonly status: number;
1242
- readonly code?: string;
1243
- readonly retryable?: boolean;
1244
- readonly retryAfterMs?: number;
1245
- readonly errors?: AggApiFieldError[];
1246
- constructor(message: string, status: number, init?: AggApiErrorInit);
1247
- }
1248
- /** Type guard for {@link AggApiError}, safe across bundle boundaries. */
1249
- declare function isAggApiError(value: unknown): value is AggApiError;
1250
-
1251
- /**
1252
- * EIP-55 checksum an EVM address.
1253
- *
1254
- * Accepts any casing — lowercase, uppercase, or an already-checksummed
1255
- * address — and returns the canonical mixed-case form. A mixed-case input
1256
- * with a WRONG checksum is corrected, not rejected: this is a message
1257
- * builder, and the wallet's signature is what authenticates the address
1258
- * downstream. Throws only when the input is not a 20-byte hex address at all.
1259
- */
1260
- declare function toChecksumAddress(address: string): string;
1261
-
1262
- /**
1263
- * Merge forming candles from matched venues into one aggregate.
1264
- * Open/Close: volume-weighted average (simple average if all v=0).
1265
- * High: max across venues. Low: min across venues. Volume: sum.
1266
- */
1267
- declare function mergeCandles(candles: (Candle | null | undefined)[]): Candle | null;
1268
- /**
1269
- * Merge arrays of closed candles from multiple venues, aligned by openTime.
1270
- * For each openTime present in ANY venue, produces one merged candle.
1271
- */
1272
- declare function mergeClosedCandles(candleArrays: Candle[][]): Candle[];
1273
- /** Simple average of available midpoints. */
1274
- declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): number | null;
1275
-
1276
- type LoadImmutableHistoryOptions = {
1277
- manifest: ChartHistoryManifest;
1278
- fetch?: typeof globalThis.fetch;
1279
- signal?: AbortSignal;
1280
- /** Runtimes without WebCrypto can supply SHA-256 without adding a browser dependency. */
1281
- digest?: (bytes: Uint8Array) => Promise<string>;
1282
- };
1283
- /** Download immutable CDN objects directly. Safe to run in the browser Worker or Node. */
1284
- declare function loadImmutableHistory({ manifest, fetch: fetcher, signal, digest, }: LoadImmutableHistoryOptions): Promise<ChartCandle[]>;
1285
-
1286
- /** An exact transfer intent survives a page reload before its response arrives.
1287
- * The normal withdrawal service owns dispatch, bridging and reconciliation. */
1288
- interface HostedVenueFundingIntent {
1289
- version: 1;
1290
- accountId: string;
1291
- environment: "production";
1292
- request: WithdrawManagedParams & {
1293
- requestId: string;
1294
- };
1295
- balanceBeforeRaw: string;
1296
- estimatedFeeRaw: string;
1297
- withdrawalId?: string;
1298
- terminal?: boolean;
1299
- }
1300
- interface HostedVenueFundingOptions {
1301
- venue: "betdex";
1302
- requiredRaw: string;
1303
- /** Scope this store to the current application/user/venue. */
1304
- journal: {
1305
- load(): HostedVenueFundingIntent | null;
1306
- save(intent: HostedVenueFundingIntent | null): void;
1307
- };
1308
- createRequestId(): string;
1309
- /** Called around every await and before every write. Abort on sign-out/user change. */
1310
- assertActive(): void;
1311
- onProgress?: (phase: "preparing" | "transferring" | "confirming") => void;
1312
- timeoutMs?: number;
1313
- }
1314
- type FundingClient = Pick<AggClient, "getHostedVenueAccount" | "provisionHostedVenueAccount" | "getHostedVenueDepositAddress" | "withdrawPreview" | "withdrawManaged" | "getWithdrawalStatus">;
1315
- /** Prepare the cash required by an order using the existing managed transfer
1316
- * planner. It selects same-chain cash or bridges supported wallet sources to
1317
- * the user's verified venue address. No venue order is placed here: callers
1318
- * obtain a fresh executable quote after native credit and keep their normal
1319
- * slippage, admission and fill workflow.
1320
- *
1321
- * The currently supported hosted-account API is BETDEX; future hosted venues
1322
- * use the same account/deposit contract and this transfer lifecycle. On-chain
1323
- * venues retain their existing execution-DAG funding.
1324
- */
1325
- declare function prepareHostedVenueFunding(client: FundingClient, options: HostedVenueFundingOptions): Promise<{
1326
- availableRaw: string;
1327
- feeRaw: string;
1328
- withdrawalId?: string;
1329
- }>;
1330
- /** Keep the normal priced order flow after preparing native cash. Requotes
1331
- * may use only the outcomes the user selected, within the accepted price and
1332
- * total spend. Transfer fees reduce order spend rather than increasing it. */
1333
- declare function prepareHostedVenueRoute(client: FundingClient & Pick<AggClient, "getSmartRoute">, options: Omit<HostedVenueFundingOptions, "requiredRaw"> & {
1334
- quote: SmartRouteResponse;
1335
- venueMarketOutcomeId: string;
1336
- maxSpend: number;
1337
- slipCapBps: number;
1338
- }): Promise<SmartRouteResponse>;
1339
-
1340
- declare function createAggClient(options: AggClientOptions): AggClient;
1341
-
1342
- export { AggApiError, type AggApiErrorInit, type AggApiFieldError, AggAuthStartBody, AggAuthStartResult, AggAuthVerifyBody, AggClient, AggClientOptions, AggClientSessionInput, AggLinkAccountBody, AggLinkAccountConfirmResult, AggLinkAccountResult, AggLinkAccountWalletConfirmBody, type AggRateLimitResponse, AggWebSocket, AggWebSocketCallbacks, AppClientConfigResponse, AuthStatus, BalanceRefillAttempt, BalanceRefillPolicy, BatchMidpointsResponse, BatchOrderbooksResponse, type BuildVenueUrlOpts, CancelManagedExecutionResponse, CancelOrderSignature, CancelVenueOrderParams, Candle, Category, ChartBarsResponse, ChartCandle, ChartHistoryManifest, ChartResolution, CorrelatedMarketCascadeResponse, CorrelatedMarketQueryResult, CorrelatedMarketSignalBatch, CorrelatedMarketsStatus, CreateBalanceRefillPolicyParams, CreatePaperTradingAccountParams, CryptoReferencePricesResponse, DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, DepositAddressesResponse, EventBootstrapResponse, ExecuteManagedParams, ExecuteManagedResponse, ExecutionOrderItem, ExecutionOrdersQuery, ExecutionPositionGroup, ExecutionPositionsQuery, ExecutionStatusQuery, ExecutionStatusResponse, GetCryptoReferencePricesOptions, GetPositionsParams, type HostedVenueAccount, type HostedVenueActivity, type HostedVenueActivityCode, type HostedVenueActivityQuery, type HostedVenueBalance, type HostedVenueDepositAddress, type HostedVenueFundingIntent, type HostedVenueFundingOptions, type HostedVenueWithdrawal, type HostedVenueWithdrawalRequest, IMAGE_SIZES, ImageSize, LIMIT_PRICE_RAW_SCALE, LeaderboardQuery, LeaderboardRow, LeaderboardSeries, LeaderboardSeriesQuery, type LimitPriceSide, type LimitPriceTickAdjustment, ListRecurringCryptoMarketsOptions, type LoadImmutableHistoryOptions, ManagedBalancesParams, MarketStatus, MatchStatus, NewsFeedArticleFeedResponse, NewsFeedListResponse, NewsFeedMarketFeedResponse, NewsFeedMarketNewsParams, NewsFeedMarketNewsResponse, NewsFeedPageOptions, NewsFeedStatusResponse, OrderListQuery, Orderbook, OutcomeOrderbookResponse, PaginatedResponse, PaperTradingAccount, PaperTradingAccountsPage, PaperTradingAppOptions, PaperTradingBalanceResponse, PaperTradingListParams, PaperTradingOrder, PaperTradingOrdersPage, PaperTradingPortfolio, PaperTradingPositionsPage, PlaceLimitOrderParams, PlaceLimitOrderResponse, PlacePaperTradingOrderParams, PositionGroup, type ProvisionHostedVenueAccountBody, type QuoteError, type QuoteErrorCode, RETINA_IMAGE_SIZES, RampQuote, RampQuoteRequest, RampSessionRequest, RampWidgetSession, RecurrenceFilter, RecurringCryptoMarketsResponse, RedeemRequest, RedeemResponse, ResetPaperTradingAccountParams, ResolveCorrelatedMarketsParams, ResolveCorrelatedMarketsResponse, RpcTokenResponse, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, SearchParams, SearchResponse, SetPaperTradingBalanceParams, SmartRouteParams, SmartRouteResponse, type SplitsByAmountResult, SportsLiveResponse, SyncBalancesResponse, TradeExecutorOrderListResponse, TradeSide, TradeSplit, TurnstileChallengeError, UnifiedBalanceResponse, UpdateBalanceRefillPolicyParams, UpdateUserBody, UpsertVenueKey, UserActivityItem, UserActivityQuery, UserHolding, UserProfile, Venue, VenueEvent, VenueGeoPolicyResponse, VenueKeyStatus, VenueKeySummary, VenueMarket, type VenueMarketClusterNode, VenueMarketOutcome, WithdrawManagedParams, WithdrawManagedResponse, WithdrawPreviewParams, WithdrawPreviewResponse, WithdrawalQuoteParams, WithdrawalQuoteResponse, adjustLimitPriceRawToTick, aggregateMidpoint, buildVenueUrl, computeBestSplitsByAmount, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getBalanceRefillMaximumRaw, getWalletAddressFromUserProfile, hasShape, isAggApiError, isBalanceRefillWithinDailyCap, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, loadImmutableHistory, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, orderbookCrc32, parse, parseEmail, parseEmailStrict, prepareHostedVenueFunding, prepareHostedVenueRoute, projectedOrderbookChecksum, retinaImageUrl, safeParse, sortVenues, toChecksumAddress };
1
+ import { $ as WsOrderEventType, $a as hasShape, $i as UserActivityDeposit, $n as NewsFeedArticleFeedItem, $o as NovigExecutionMode, $r as RecurringCryptoDurationInput, $s as AccountProvider, $t as CorrelatedMarketCascadeItem, A as isAggApiError, Aa as WithdrawalSourceTokenSymbol, Ai as SignerFn, An as ExecutionOverallState, Ao as BookQuality, Ar as PaperTradingLiquidityStatus, As as VenueEventWithMarkets, At as AggLinkAccountWalletConfirmBody, B as WsArbFeedEntry, Ba as adjustLimitPriceRawToTick, Bi as SmartRouteSetupCostLine, Bn as LeaderboardMetric, Bo as GetBalanceQuery, Br as PlaceLimitOrderResponse, Bs as WalletTokenBalance, Bt as BalanceRefillPolicy, C as CandleBuilder, Ca as WithdrawalLeg, Ci as SELF_CUSTODY_FILL_TIMEOUT_MS, Cn as ExecuteManagedResponse, Co as Account, Cr as OutcomeOrderbookResponse, Cs as UserProfile, Ct as AggAuthWalletVerifyBody, D as AggApiFieldError, Da as WithdrawalQuoteParams, Di as SetPaperTradingBalanceParams, Dn as ExecutionMode, Do as AuthCodeResponse, Dr as PaperTradingAppOptions, Ds as ValidateTradeResponse, Dt as AggLinkAccountBody, E as AggApiErrorInit, Ea as WithdrawalLifecycleStatus, Ei as SearchResponse, En as ExecutionDisplayStepKind, Eo as AttributedOrderbookLevel, Er as PaperTradingAccountsPage, Es as ValidateTradeRequest, Et as AggClientSessionInput, F as computeChecksum, Fa as getBalanceRefillMaximumRaw, Fi as SmartRouteFill, Fn as ExecutionStatusResponse, Fo as CreateApp, Fr as PaperTradingPortfolio, Fs as VenueMarketOutcome, Ft as AppTradingMode, G as WsCandleInterval, Ga as normalizeVenueMarketCluster, Gi as SportsLiveParticipant, Gn as LeaderboardSeriesQuery, Go as GetPositionsQuery, Gr as RampQuoteRequest, Gs as OrderType, Gt as CancelOrderSignature, H as WsAttributedLevel, Ha as buildVenueUrl, Hi as SmartRouteStatus, Hn as LeaderboardRow, Ho as GetHoldingsQuery, Hr as PositionRedeemStatus, Hs as WithdrawalSource, Ht as BatchMidpointsResponse, I as snapshotToOrderbook, Ia as isBalanceRefillWithinDailyCap, Ii as SmartRouteParams, In as ExecutionStatusStep, Io as DepositStep, Ir as PaperTradingPosition, Is as VenuePositionBalance, It as AuthStatus, J as WsError, Ja as SplitsByAmountResult, Ji as TERMINAL_EXECUTION_STATES, Jn as ListRecurringCryptoMarketsOptions, Jo as MatchedMidpoint, Jr as RecurrenceCadence, Js as CONFIRMED_MATCH_STATUSES, Jt as ChartBarsResponse, K as WsClientMessage, Ka as optimizedImageUrl, Ki as SportsLiveResponse, Kn as LeaderboardStats, Ko as HelloResponse, Kr as RampSessionRequest, Ks as TimeInForce, Kt as CancelVenueOrderParams, L as DiagnosticCallback, La as LIMIT_PRICE_RAW_SCALE, Li as SmartRouteResponse, Ln as GetCryptoReferencePricesOptions, Lo as ExecuteManagedRequest, Lr as PaperTradingPositionsPage, Ls as VerifyBody, Lt as BalanceCustody, M as OrderbookState, Ma as projectedOrderbookChecksum, Mi as SmartRouteAllocation, Mn as ExecutionPositionsQuery, Mo as ComputeSplitsRequest, Mr as PaperTradingMarkSource, Ms as VenueKeySummary, Mt as AggregatedOrderbookLevel, N as VenueOrderbookLevel, Na as DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, Ni as SmartRouteBridgeStep, Nn as ExecutionStatusOrder, No as ComputeSplitsResponse, Nr as PaperTradingOrder, Ns as VenueMarket, Nt as AggregatedOrderbookResponse, O as AggRateLimitResponse, Oa as WithdrawalQuoteResponse, Oi as SignatureRequest, On as ExecutionOrderItem, Oo as AuthTokenResponse, Or as PaperTradingBalanceAdjustment, Os as VenueEvent, Ot as AggLinkAccountConfirmResult, P as applyOrderbookDelta, Pa as DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, Pi as SmartRouteFeeBreakdown, Pn as ExecutionStatusQuery, Po as ComputeSplitsSelection, Pr as PaperTradingOrdersPage, Ps as VenueMarketListItem, Pt as AppClientConfigResponse, Q as WsOrderEvent, Qa as enumGuard, Qi as UserActivityBridge, Qn as MidpointRow, Qo as NonceResponse, Qr as RecurringCryptoDuration, Qs as Chain, Qt as ChartVenueCandles, R as DiagnosticEvent, Ra as LimitPriceSide, Ri as SmartRouteSettlementLeg, Rn as GetOrdersParams, Ro as ExecuteTradeRequest, Rr as PersistedAuthSnapshot, Rs as VerifyResponse, Rt as BalanceRefillAttempt, S as Candle, Sa as WithdrawalExpected, Si as RpcTokenResponse, Sn as ExecuteManagedParams, So as QuoteErrorCode, Sr as OutcomeMidpointRow, Ss as UserHolding, St as AggAuthVerifyBody, T as AggApiError, Ta as WithdrawalLegType, Ti as SearchParams, Tn as ExecutionDisplayGroupStatus, To as AttributedOrderbook, Tr as PaperTradingAccount, Ts as ValidateManagedRequest, Tt as AggClientOptions, U as WsAuthenticated, Ua as sortVenues, Ui as SmartRouteVenueFill, Un as LeaderboardSeries, Uo as GetHoldingsResponse, Ur as RECURRENCE_CADENCES, Us as WithdrawalSourceItem, Ut as BatchOrderbooksResponse, V as WsArbMarketUpdate, Va as BuildVenueUrlOpts, Vi as SmartRouteSide, Vn as LeaderboardQuery, Vo as GetBalanceResponse, Vr as PlacePaperTradingOrderParams, Vs as WithdrawManagedRequest, Vt as BalanceRefillPolicyStatus, W as WsBalanceUpdate, Wa as VenueMarketClusterNode, Wi as SportsGameStatus, Wn as LeaderboardSeriesPoint, Wo as GetOrdersQuery, Wr as RampQuote, Ws as OrderStatus, Wt as CancelManagedExecutionResponse, X as WsMarkSource, Xa as SafeParseResult, Xi as TradeExecutorOrderListResponse, Xn as MarkSource, Xo as MatchedVenueMarketOutcomeRef, Xr as RecurringCryptoComparisonPoint, Xs as MatchStatus, Xt as ChartHistoryManifest, Y as WsHeartbeat, Ya as SafeParseFailure, Yi as TradeExecutorOrder, Yn as ManagedBalancesParams, Yo as MatchedMidpointOutcome, Yr as RecurrenceFilter, Ys as MarketStatus, Yt as ChartCandle, Z as WsMarketResolved, Za as SafeParseSuccess, Zi as UpdateBalanceRefillPolicyParams, Zn as MatchedOrderbookMarket, Zo as MidpointItem, Zr as RecurringCryptoComparisonPriceSource, Zs as MatchType, Zt as ChartResolution, _ as loadImmutableHistory, _a as WithdrawManagedResponse, _i as RequestedOrderbookMarket, _n as DepositAddressesReadyResponse, _o as HostedVenueDepositAddress, _r as OrderbookQuoteFill, _s as TradeSplit, _t as AggAuthDeliveryMode, a as BookWatchdogOptions, aa as UserActivityType, ac as INACTIVE_VENUES, ai as RecurringCryptoOutcomeOrderbookDepth, an as CorrelatedMarketSignalDirection, ao as parseEmail, ar as NewsFeedMarketFeedItem, as as PositionGroup, at as WsSubscribed, b as mergeClosedCandles, ba as WithdrawPreviewResponse, bi as ResolveCorrelatedMarketsResponse, bn as DepositAddressesToken, bo as ProvisionHostedVenueAccountBody, br as OrderbookServiceUnavailableError, bs as UpdateUserBody, bt as AggAuthStartBody, ca as ValidateManagedParams, cc as Venue, ci as RecurringCryptoResolution, cn as CreatePaperTradingAccountParams, co as getWalletAddressFromUserProfile, cr as NewsFeedMarketNewsResponse, cs as PricesHistoryResponse, ct as WsVenueBook, d as createAggClient, da as VenueGeoPolicyResponse, dc as isVenueDataVisible, di as RecurringCryptoWindowComparisons, dn as CryptoReferencePriceMarketInput, do as formatOutcomeTitle, dr as NewsFeedStatusResponse, ds as SettlementDiff, dt as WsWithdrawalLegStatus, ea as UserActivityItem, ec as AccountType, ei as RecurringCryptoMarketMetrics, en as CorrelatedMarketCascadeResponse, eo as isEmail, er as NewsFeedArticleFeedResponse, es as OrderListItem, et as WsOrderSubmitted, f as HostedVenueFundingIntent, fa as VenueMarketRef, fc as isVenueInactive, fi as RecurringCryptoWindowMarket, fn as CryptoReferencePriceResult, fo as HostedVenueAccount, fr as OPTIONAL_SIGNATURE_TIMEOUT_MS, fs as SettlementDifference, ft as WsWithdrawalLifecycleEvent, g as LoadImmutableHistoryOptions, ga as WithdrawManagedParams, gi as RedeemResponse, gn as DepositAddressesPendingResponse, go as HostedVenueBalance, gr as OrderbookBatchItemStatus, gs as SyncBalancesResponse, gt as AggClient, h as prepareHostedVenueRoute, ha as VenueSoloQuote, hi as RedeemRequest, hn as CryptoReferencePricesResponse, ho as HostedVenueActivityQuery, hr as OrderbookBatchItemErrorCode, hs as SetupVenueKeyStep, ht as computeBestSplitsByAmount, i as AggWebSocketOptions, ia as UserActivityTrade, ic as ACTIVE_VENUES, ii as RecurringCryptoOutcome, in as CorrelatedMarketSignalBatch, io as parse, ir as NewsFeedMarketFeedArticle, is as OutcomeMidpoint, it as WsServerMessage, j as OrderbookLevel, ja as orderbookCrc32, ji as SimpleOrderbookLevel, jn as ExecutionPositionGroup, jo as Category, jr as PaperTradingListParams, js as VenueKeyStatus, jt as AggSessionUser, k as TurnstileChallengeError, ka as WithdrawalSourceStatus, ki as SignatureRequestType, kn as ExecutionOrdersQuery, ko as AuthUser, kr as PaperTradingBalanceResponse, ks as VenueEventListItem, kt as AggLinkAccountResult, l as MarketView, la as ValidateManagedResponse, lc as getEffectiveDisabledVenues, li as RecurringCryptoSourceConfidence, ln as CryptoReferencePriceError, lo as formatMarketQuestion, lr as NewsFeedMarketNewsResult, ls as ProphetxExecutionMode, lt as WsVenueInfo, m as prepareHostedVenueFunding, ma as VenuePriceInfo, mi as RedeemLegStatus, mn as CryptoReferencePriceTarget, mo as HostedVenueActivityCode, mr as OrderbookBatchItemError, ms as SetupDepositAddressStep, mt as WsWithdrawalLifecycleStatus, n as AggWebSocketCallbacks, na as UserActivityRedeem, nc as ImageSize, ni as RecurringCryptoOrderbookDepthLevel, nn as CorrelatedMarketSide, no as isFiniteNonNeg, nr as NewsFeedLinkedMarket, ns as OrderbookHistoryPoint, nt as WsOrderbookSnapshot, o as CandleTail, oa as UserActivityUserOp, oc as VENUES, oi as RecurringCryptoPriceComparison, on as CorrelatedMarketsStatus, oo as parseEmailStrict, or as NewsFeedMarketFeedResponse, os as PricePoint, ot as WsTrade, p as HostedVenueFundingOptions, pa as VenueOrderbookEntry, pi as RedeemLegResult, pn as CryptoReferencePriceSource, po as HostedVenueActivity, pr as OrderListQuery, ps as SettlementSource, pt as WsWithdrawalLifecycleLeg, q as WsConnected, qa as retinaImageUrl, qi as SportsLiveState, qn as LimitOrderTimeInForce, qo as MarketPriceHistory, qr as RampWidgetSession, qs as TradeSide, qt as ChartBarsMeta, r as AggWebSocketDiagnostics, ra as UserActivityRedeemLeg, rc as RETINA_IMAGE_SIZES, ri as RecurringCryptoOrderbookDepthSide, rn as CorrelatedMarketSignal, ro as isNonEmptyString, rr as NewsFeedListResponse, rs as OrderbookHistoryResponse, rt as WsRedeemEvent, s as HistoryRangeRequest, sa as UserActivityWithdrawal, sc as VENUE_CHAIN_IDS, si as RecurringCryptoReferencePrice, sn as CreateBalanceRefillPolicyParams, so as safeParse, sr as NewsFeedMarketNewsParams, ss as PriceSource, st as WsUnsubscribed, t as AggWebSocket, ta as UserActivityQuery, tc as IMAGE_SIZES, ti as RecurringCryptoMarketsResponse, tn as CorrelatedMarketQueryResult, to as isEnum, tr as NewsFeedArticleWithSummary, ts as Orderbook, tt as WsOrderbookDelta, u as MarketViewBatch, ua as VenueGeoPolicyEntry, uc as isVenueActive, ui as RecurringCryptoVenueMarket, un as CryptoReferencePriceExternalMarketInput, uo as formatOutcomeLabel, ur as NewsFeedPageOptions, us as ServerWallet, ut as WsVenueLevel, v as aggregateMidpoint, va as WithdrawManagedSourceItem, vi as ResetPaperTradingAccountParams, vn as DepositAddressesResponse, vo as HostedVenueWithdrawal, vr as OrderbookQuoteParams, vs as TradeStep, vt as AggAuthPrivyVerifyBody, w as CandleInterval, wa as WithdrawalLegStatus, wi as SELF_CUSTODY_POLL_INTERVAL_MS, wn as ExecutionDagProgress, wo as App, wr as PaginatedResponse, ws as ValidateBalanceOnClientStep, wt as AggClientAuthOptions, x as toChecksumAddress, xa as WithdrawTokenSymbol, xi as ResolvedCorrelatedMarketsResponse, xn as EventBootstrapResponse, xo as QuoteError, xr as OrderbooksOnlyError, xs as UpsertVenueKey, xt as AggAuthStartResult, y as mergeCandles, ya as WithdrawPreviewParams, yi as ResolveCorrelatedMarketsParams, yn as DepositAddressesSupportedChain, yo as HostedVenueWithdrawalRequest, yr as OrderbookQuoteResponse, ys as UnifiedBalanceResponse, yt as AggAuthProviderType, z as WsArbFeedBatch, za as LimitPriceTickAdjustment, zi as SmartRouteSettlementPlan, zn as GetPositionsParams, zo as ExecuteTradeResponse, zr as PlaceLimitOrderParams, zs as WalletChainBalance, zt as BalanceRefillAttemptStatus } from "./agg-websocket-BstVWtLA.js";
2
+ export { ACTIVE_VENUES, Account, AccountProvider, AccountType, AggApiError, type AggApiErrorInit, type AggApiFieldError, type AggAuthDeliveryMode, type AggAuthPrivyVerifyBody, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, type AggAuthWalletVerifyBody, AggClient, type AggClientAuthOptions, type AggClientOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggLinkAccountWalletConfirmBody, type AggRateLimitResponse, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketDiagnostics, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, App, type AppClientConfigResponse, type AppTradingMode, AttributedOrderbook, AttributedOrderbookLevel, AuthCodeResponse, type AuthStatus, AuthTokenResponse, AuthUser, type BalanceCustody, type BalanceRefillAttempt, type BalanceRefillAttemptStatus, type BalanceRefillPolicy, type BalanceRefillPolicyStatus, type BatchMidpointsResponse, type BatchOrderbooksResponse, BookQuality, type BookWatchdogOptions, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type CancelOrderSignature, type CancelVenueOrderParams, type Candle, CandleBuilder, type CandleInterval, type CandleTail, Category, Chain, type ChartBarsMeta, type ChartBarsResponse, type ChartCandle, type ChartHistoryManifest, type ChartResolution, type ChartVenueCandles, ComputeSplitsRequest, ComputeSplitsResponse, ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, 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, DepositAddressesPendingResponse, DepositAddressesReadyResponse, type DepositAddressesResponse, DepositAddressesSupportedChain, type DepositAddressesToken, DepositStep, type DiagnosticCallback, type DiagnosticEvent, type EventBootstrapResponse, type ExecuteManagedParams, ExecuteManagedRequest, ExecuteManagedResponse, ExecuteTradeRequest, 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, GetBalanceQuery, GetBalanceResponse, type GetCryptoReferencePricesOptions, GetHoldingsQuery, GetHoldingsResponse, type GetOrdersParams, GetOrdersQuery, type GetPositionsParams, GetPositionsQuery, HelloResponse, type HistoryRangeRequest, type HostedVenueAccount, type HostedVenueActivity, type HostedVenueActivityCode, type HostedVenueActivityQuery, type HostedVenueBalance, type HostedVenueDepositAddress, type HostedVenueFundingIntent, type HostedVenueFundingOptions, type HostedVenueWithdrawal, type HostedVenueWithdrawalRequest, IMAGE_SIZES, INACTIVE_VENUES, ImageSize, LIMIT_PRICE_RAW_SCALE, type LeaderboardMetric, type LeaderboardQuery, type LeaderboardRow, type LeaderboardSeries, type LeaderboardSeriesPoint, type LeaderboardSeriesQuery, type LeaderboardStats, type LimitOrderTimeInForce, type LimitPriceSide, type LimitPriceTickAdjustment, type ListRecurringCryptoMarketsOptions, type LoadImmutableHistoryOptions, type ManagedBalancesParams, type MarkSource, MarketPriceHistory, MarketStatus, type MarketView, type MarketViewBatch, MatchStatus, MatchType, MatchedMidpoint, MatchedMidpointOutcome, type MatchedOrderbookMarket, MatchedVenueMarketOutcomeRef, 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, NonceResponse, NovigExecutionMode, OPTIONAL_SIGNATURE_TIMEOUT_MS, OrderListItem, type OrderListQuery, OrderStatus, OrderType, Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, OrderbookHistoryPoint, OrderbookHistoryResponse, OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, 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, PositionGroup, type PositionRedeemStatus, PricePoint, PriceSource, PricesHistoryResponse, ProphetxExecutionMode, type ProvisionHostedVenueAccountBody, type QuoteError, type QuoteErrorCode, RECURRENCE_CADENCES, RETINA_IMAGE_SIZES, 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 SearchParams, type SearchResponse, ServerWallet, type SetPaperTradingBalanceParams, SettlementDiff, SettlementDifference, SettlementSource, SetupDepositAddressStep, 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, SyncBalancesResponse, TERMINAL_EXECUTION_STATES, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide, TradeSplit, TradeStep, TurnstileChallengeError, UnifiedBalanceResponse, type UpdateBalanceRefillPolicyParams, UpdateUserBody, UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, UserHolding, UserProfile, VENUES, VENUE_CHAIN_IDS, ValidateBalanceOnClientStep, type ValidateManagedParams, ValidateManagedRequest, ValidateManagedResponse, ValidateTradeRequest, ValidateTradeResponse, Venue, VenueEvent, VenueEventListItem, VenueEventWithMarkets, type VenueGeoPolicyEntry, type VenueGeoPolicyResponse, VenueKeyStatus, VenueKeySummary, VenueMarket, type VenueMarketClusterNode, VenueMarketListItem, VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, VerifyBody, VerifyResponse, WalletChainBalance, WalletTokenBalance, type WithdrawManagedParams, WithdrawManagedRequest, WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawPreviewParams, type WithdrawPreviewResponse, WithdrawTokenSymbol, WithdrawalExpected, WithdrawalLeg, WithdrawalLegStatus, WithdrawalLegType, WithdrawalLifecycleStatus, type WithdrawalQuoteParams, type WithdrawalQuoteResponse, WithdrawalSource, WithdrawalSourceItem, WithdrawalSourceStatus, 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, loadImmutableHistory, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, orderbookCrc32, parse, parseEmail, parseEmailStrict, prepareHostedVenueFunding, prepareHostedVenueRoute, projectedOrderbookChecksum, retinaImageUrl, safeParse, snapshotToOrderbook, sortVenues, toChecksumAddress };