@agg-build/sdk 1.3.0 → 2.0.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.
- package/dist/index.d.mts +248 -5
- package/dist/index.d.ts +248 -5
- package/dist/index.js +124 -0
- package/dist/index.mjs +121 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -68,13 +68,31 @@ declare enum OrderStatus {
|
|
|
68
68
|
pending_bridge = "pending_bridge",
|
|
69
69
|
submitting = "submitting",
|
|
70
70
|
submitted = "submitted",
|
|
71
|
+
open = "open",
|
|
72
|
+
partially_filled_open = "partially_filled_open",
|
|
73
|
+
cancel_pending = "cancel_pending",
|
|
71
74
|
filled = "filled",
|
|
72
|
-
partial_fill = "partial_fill"
|
|
75
|
+
partial_fill = "partial_fill",
|
|
76
|
+
failed = "failed",
|
|
77
|
+
expired = "expired",
|
|
78
|
+
cancelled = "cancelled"
|
|
73
79
|
}
|
|
74
80
|
declare enum TradeSide$1 {
|
|
75
81
|
Buy = "buy",
|
|
76
82
|
Sell = "sell"
|
|
77
83
|
}
|
|
84
|
+
declare enum OrderType {
|
|
85
|
+
Market = "market",
|
|
86
|
+
Limit = "limit"
|
|
87
|
+
}
|
|
88
|
+
declare enum TimeInForce {
|
|
89
|
+
GTC = "GTC",
|
|
90
|
+
GTD = "GTD",
|
|
91
|
+
FOK = "FOK",
|
|
92
|
+
FAK = "FAK",
|
|
93
|
+
IOC = "IOC",
|
|
94
|
+
ALO = "ALO"
|
|
95
|
+
}
|
|
78
96
|
|
|
79
97
|
/**
|
|
80
98
|
* Standalone type definitions — no Zod dependency.
|
|
@@ -375,6 +393,8 @@ type WalletChainBalance = {
|
|
|
375
393
|
chainId: number;
|
|
376
394
|
tokenAddress: string;
|
|
377
395
|
balanceRaw: string;
|
|
396
|
+
heldRaw?: string | undefined;
|
|
397
|
+
availableRaw?: string | undefined;
|
|
378
398
|
decimals: number;
|
|
379
399
|
lastSyncedAt: string;
|
|
380
400
|
tokenSymbol?: string | undefined;
|
|
@@ -382,11 +402,15 @@ type WalletChainBalance = {
|
|
|
382
402
|
type WalletTokenBalance = {
|
|
383
403
|
tokenSymbol: string;
|
|
384
404
|
totalRaw: string;
|
|
405
|
+
availableRaw?: string | undefined;
|
|
406
|
+
reservedRaw?: string | undefined;
|
|
385
407
|
decimals: number;
|
|
386
408
|
chains: {
|
|
387
409
|
chainId: number;
|
|
388
410
|
tokenAddress: string;
|
|
389
411
|
balanceRaw: string;
|
|
412
|
+
heldRaw?: string | undefined;
|
|
413
|
+
availableRaw?: string | undefined;
|
|
390
414
|
decimals: number;
|
|
391
415
|
lastSyncedAt: string;
|
|
392
416
|
}[];
|
|
@@ -404,11 +428,15 @@ type UnifiedBalanceResponse = {
|
|
|
404
428
|
cash: {
|
|
405
429
|
tokenSymbol: string;
|
|
406
430
|
totalRaw: string;
|
|
431
|
+
availableRaw?: string | undefined;
|
|
432
|
+
reservedRaw?: string | undefined;
|
|
407
433
|
decimals: number;
|
|
408
434
|
chains: {
|
|
409
435
|
chainId: number;
|
|
410
436
|
tokenAddress: string;
|
|
411
437
|
balanceRaw: string;
|
|
438
|
+
heldRaw?: string | undefined;
|
|
439
|
+
availableRaw?: string | undefined;
|
|
412
440
|
decimals: number;
|
|
413
441
|
lastSyncedAt: string;
|
|
414
442
|
}[];
|
|
@@ -587,6 +615,10 @@ type VenueMarket = {
|
|
|
587
615
|
endDate?: string | null | undefined;
|
|
588
616
|
creationDate?: string | null | undefined;
|
|
589
617
|
resolutionDate?: string | null | undefined;
|
|
618
|
+
/** Sports market classification for type-aware sorting (moneyline, spread, total, etc.). */
|
|
619
|
+
sportsMarketType?: string | null | undefined;
|
|
620
|
+
/** Sort rank within a sports section (0=moneyline, 1=spread, 2=total, 3+=other). */
|
|
621
|
+
sectionRank?: number | null | undefined;
|
|
590
622
|
matchedVenueMarkets?: {
|
|
591
623
|
id: string;
|
|
592
624
|
venue: Venue;
|
|
@@ -646,10 +678,12 @@ type VenueEvent = {
|
|
|
646
678
|
/**
|
|
647
679
|
* ISO-8601 duration denormalized from Series.recurrence. `null` means
|
|
648
680
|
* the event has no recurring schedule (one-off). Use this value with
|
|
649
|
-
* the `?recurrence=` filter on /venue-events
|
|
650
|
-
* values
|
|
681
|
+
* the `?recurrence=` filter on /venue-events using public recurrence
|
|
682
|
+
* enum values.
|
|
651
683
|
*/
|
|
652
684
|
recurrence?: string | null | undefined;
|
|
685
|
+
/** Type-aware structure classification used to sort markets under this event. */
|
|
686
|
+
structureType?: "candidate" | "sport" | "axis" | "dates" | null | undefined;
|
|
653
687
|
};
|
|
654
688
|
type Orderbook = {
|
|
655
689
|
bids: {
|
|
@@ -1951,6 +1985,209 @@ interface MatchedOrderbookMarket extends VenueMarketRef {
|
|
|
1951
1985
|
* - `none` — no mark available
|
|
1952
1986
|
*/
|
|
1953
1987
|
type MarkSource = "local" | "local_merged" | "local_one_sided" | "sibling" | "local_boundary" | "none";
|
|
1988
|
+
declare const RECURRENCE_CADENCES: readonly ["PT5M", "PT10M", "PT15M", "PT1H", "P1D", "P1W", "P1M", "P1Y"];
|
|
1989
|
+
type RecurrenceCadence = (typeof RECURRENCE_CADENCES)[number];
|
|
1990
|
+
type RecurrenceFilter = RecurrenceCadence | "null";
|
|
1991
|
+
type RecurringCryptoDuration = "PT5M" | "PT15M" | "PT1H" | "P1D";
|
|
1992
|
+
type RecurringCryptoDurationInput = RecurringCryptoDuration | "5m" | "15m" | "1h" | "1d";
|
|
1993
|
+
type RecurringCryptoSourceConfidence = "verified" | "inferred" | "missing";
|
|
1994
|
+
interface ListRecurringCryptoMarketsOptions {
|
|
1995
|
+
assets?: string[];
|
|
1996
|
+
durations?: RecurringCryptoDurationInput[];
|
|
1997
|
+
interval?: RecurringCryptoDurationInput;
|
|
1998
|
+
window?: "current";
|
|
1999
|
+
venues?: Venue[];
|
|
2000
|
+
status?: MarketStatus[];
|
|
2001
|
+
windowStartFrom?: string;
|
|
2002
|
+
windowStartTo?: string;
|
|
2003
|
+
cursor?: string;
|
|
2004
|
+
limit?: number;
|
|
2005
|
+
includeOrderbookPrices?: boolean;
|
|
2006
|
+
includeReferencePrices?: boolean;
|
|
2007
|
+
includeDirectVenueMarkets?: boolean;
|
|
2008
|
+
}
|
|
2009
|
+
interface RecurringCryptoOutcome {
|
|
2010
|
+
/**
|
|
2011
|
+
* Canonical Agg outcome id. Null for direct live venue rows because those
|
|
2012
|
+
* rows are discovery data and cannot be passed to smart order routing.
|
|
2013
|
+
*/
|
|
2014
|
+
venueMarketOutcomeId: string | null;
|
|
2015
|
+
/** Venue-native outcome id or synthetic external id for direct live rows. */
|
|
2016
|
+
externalOutcomeId: string | null;
|
|
2017
|
+
/** False for this endpoint; live crypto markets are not smart-route inputs. */
|
|
2018
|
+
routeable: boolean;
|
|
2019
|
+
/** False for this endpoint; split-order routing is not supported here. */
|
|
2020
|
+
splitOrdersAllowed: boolean;
|
|
2021
|
+
label: string;
|
|
2022
|
+
title: string | null;
|
|
2023
|
+
midpoint: number | null;
|
|
2024
|
+
bestBid: number | null;
|
|
2025
|
+
bestAsk: number | null;
|
|
2026
|
+
markSource: MarkSource | string | null;
|
|
2027
|
+
lastKnownPrice: number | null;
|
|
2028
|
+
}
|
|
2029
|
+
interface RecurringCryptoMarketMetrics {
|
|
2030
|
+
volume: number | null;
|
|
2031
|
+
volume24h: number | null;
|
|
2032
|
+
openInterest: number | null;
|
|
2033
|
+
liquidity: number | null;
|
|
2034
|
+
spread: number | null;
|
|
2035
|
+
}
|
|
2036
|
+
interface RecurringCryptoResolution {
|
|
2037
|
+
sourceName: string | null;
|
|
2038
|
+
sourceUrl: string | null;
|
|
2039
|
+
sourceDomain: string | null;
|
|
2040
|
+
rawCriteria: unknown;
|
|
2041
|
+
confidence: RecurringCryptoSourceConfidence;
|
|
2042
|
+
}
|
|
2043
|
+
interface RecurringCryptoReferencePrice {
|
|
2044
|
+
asset: string;
|
|
2045
|
+
quoteAsset: "USD";
|
|
2046
|
+
raw: string | null;
|
|
2047
|
+
decimals: number | null;
|
|
2048
|
+
normalized: number | null;
|
|
2049
|
+
timestamp: string | null;
|
|
2050
|
+
provider: string | null;
|
|
2051
|
+
providerMarketId: string | null;
|
|
2052
|
+
confidence: RecurringCryptoSourceConfidence;
|
|
2053
|
+
fetchedAt?: string | null;
|
|
2054
|
+
ageMs?: number | null;
|
|
2055
|
+
refreshing?: boolean;
|
|
2056
|
+
stale?: boolean;
|
|
2057
|
+
}
|
|
2058
|
+
type CryptoReferencePriceTarget = {
|
|
2059
|
+
type: "venueMarket";
|
|
2060
|
+
venueMarketId: string;
|
|
2061
|
+
} | {
|
|
2062
|
+
type: "venueEvent";
|
|
2063
|
+
venueEventId: string;
|
|
2064
|
+
} | {
|
|
2065
|
+
type: "externalVenueMarket";
|
|
2066
|
+
venue: Venue;
|
|
2067
|
+
externalMarketId: string;
|
|
2068
|
+
} | {
|
|
2069
|
+
type: "market";
|
|
2070
|
+
venue: Venue;
|
|
2071
|
+
venueEventId?: string;
|
|
2072
|
+
venueMarketId: string;
|
|
2073
|
+
externalEventId?: string | null;
|
|
2074
|
+
externalMarketId?: string;
|
|
2075
|
+
asset: string;
|
|
2076
|
+
quoteAsset?: "USD";
|
|
2077
|
+
resolution: RecurringCryptoResolution;
|
|
2078
|
+
};
|
|
2079
|
+
interface CryptoReferencePriceExternalMarketInput {
|
|
2080
|
+
venue: Venue;
|
|
2081
|
+
externalMarketId: string;
|
|
2082
|
+
}
|
|
2083
|
+
interface CryptoReferencePriceMarketInput extends RecurringCryptoVenueMarket {
|
|
2084
|
+
asset: string;
|
|
2085
|
+
quoteAsset?: "USD";
|
|
2086
|
+
}
|
|
2087
|
+
interface GetCryptoReferencePricesOptions {
|
|
2088
|
+
targets?: CryptoReferencePriceTarget[];
|
|
2089
|
+
venueMarketIds?: string[];
|
|
2090
|
+
venueEventIds?: string[];
|
|
2091
|
+
externalMarkets?: CryptoReferencePriceExternalMarketInput[];
|
|
2092
|
+
markets?: CryptoReferencePriceMarketInput[];
|
|
2093
|
+
windowMarkets?: RecurringCryptoWindowMarket[];
|
|
2094
|
+
signal?: AbortSignal;
|
|
2095
|
+
}
|
|
2096
|
+
interface CryptoReferencePriceError {
|
|
2097
|
+
code: "not_found" | "not_recurring_crypto" | "reference_feed_missing" | "price_unavailable" | "stale_price";
|
|
2098
|
+
message: string;
|
|
2099
|
+
}
|
|
2100
|
+
interface CryptoReferencePriceSource {
|
|
2101
|
+
provider: string | null;
|
|
2102
|
+
providerMarketId: string | null;
|
|
2103
|
+
confidence: RecurringCryptoSourceConfidence;
|
|
2104
|
+
}
|
|
2105
|
+
interface CryptoReferencePriceResult {
|
|
2106
|
+
target: CryptoReferencePriceTarget;
|
|
2107
|
+
venue: Venue | null;
|
|
2108
|
+
venueEventId: string | null;
|
|
2109
|
+
venueMarketId: string | null;
|
|
2110
|
+
externalEventId: string | null;
|
|
2111
|
+
externalMarketId: string | null;
|
|
2112
|
+
asset: string | null;
|
|
2113
|
+
quoteAsset: "USD" | null;
|
|
2114
|
+
raw: string | null;
|
|
2115
|
+
decimals: number | null;
|
|
2116
|
+
normalized: number | null;
|
|
2117
|
+
providerTimestamp: string | null;
|
|
2118
|
+
fetchedAt: string | null;
|
|
2119
|
+
ageMs: number | null;
|
|
2120
|
+
refreshing: boolean;
|
|
2121
|
+
stale: boolean;
|
|
2122
|
+
source: CryptoReferencePriceSource;
|
|
2123
|
+
error: CryptoReferencePriceError | null;
|
|
2124
|
+
}
|
|
2125
|
+
interface CryptoReferencePricesResponse {
|
|
2126
|
+
data: CryptoReferencePriceResult[];
|
|
2127
|
+
softRefreshMs: number;
|
|
2128
|
+
hardMaxAgeMs: number;
|
|
2129
|
+
}
|
|
2130
|
+
type RecurringCryptoComparisonPriceSource = "referencePrice" | "midpoint" | "lastKnownPrice";
|
|
2131
|
+
interface RecurringCryptoComparisonPoint {
|
|
2132
|
+
venue: Venue;
|
|
2133
|
+
venueMarketId: string;
|
|
2134
|
+
value: number;
|
|
2135
|
+
label: string | null;
|
|
2136
|
+
source: RecurringCryptoComparisonPriceSource;
|
|
2137
|
+
provider: string | null;
|
|
2138
|
+
providerMarketId: string | null;
|
|
2139
|
+
timestamp: string | null;
|
|
2140
|
+
confidence: RecurringCryptoSourceConfidence | null;
|
|
2141
|
+
}
|
|
2142
|
+
interface RecurringCryptoPriceComparison {
|
|
2143
|
+
count: number;
|
|
2144
|
+
min: RecurringCryptoComparisonPoint | null;
|
|
2145
|
+
max: RecurringCryptoComparisonPoint | null;
|
|
2146
|
+
spread: number | null;
|
|
2147
|
+
spreadBps: number | null;
|
|
2148
|
+
byVenue: RecurringCryptoComparisonPoint[];
|
|
2149
|
+
}
|
|
2150
|
+
interface RecurringCryptoWindowComparisons {
|
|
2151
|
+
referencePrice: RecurringCryptoPriceComparison;
|
|
2152
|
+
outcomePrices: {
|
|
2153
|
+
up: RecurringCryptoPriceComparison;
|
|
2154
|
+
down: RecurringCryptoPriceComparison;
|
|
2155
|
+
};
|
|
2156
|
+
}
|
|
2157
|
+
interface RecurringCryptoVenueMarket {
|
|
2158
|
+
venue: Venue;
|
|
2159
|
+
venueEventId: string;
|
|
2160
|
+
venueMarketId: string;
|
|
2161
|
+
externalEventId: string | null;
|
|
2162
|
+
externalMarketId: string;
|
|
2163
|
+
question: string;
|
|
2164
|
+
status: MarketStatus;
|
|
2165
|
+
priceSource: "snag" | "direct";
|
|
2166
|
+
/** False for this endpoint; live crypto markets are not smart-route inputs. */
|
|
2167
|
+
routeable: boolean;
|
|
2168
|
+
/** False for this endpoint; split-order routing is not supported here. */
|
|
2169
|
+
splitOrdersAllowed: boolean;
|
|
2170
|
+
outcomes: RecurringCryptoOutcome[];
|
|
2171
|
+
metrics: RecurringCryptoMarketMetrics;
|
|
2172
|
+
resolution: RecurringCryptoResolution;
|
|
2173
|
+
referencePrice: RecurringCryptoReferencePrice;
|
|
2174
|
+
}
|
|
2175
|
+
interface RecurringCryptoWindowMarket {
|
|
2176
|
+
id: string;
|
|
2177
|
+
asset: string;
|
|
2178
|
+
quoteAsset: "USD";
|
|
2179
|
+
duration: RecurringCryptoDuration;
|
|
2180
|
+
windowStart: string;
|
|
2181
|
+
windowEnd: string;
|
|
2182
|
+
status: MarketStatus;
|
|
2183
|
+
markets: RecurringCryptoVenueMarket[];
|
|
2184
|
+
comparisons: RecurringCryptoWindowComparisons;
|
|
2185
|
+
}
|
|
2186
|
+
interface RecurringCryptoMarketsResponse {
|
|
2187
|
+
data: RecurringCryptoWindowMarket[];
|
|
2188
|
+
nextCursor: string | null;
|
|
2189
|
+
hasMore: boolean;
|
|
2190
|
+
}
|
|
1954
2191
|
/** Per-venue orderbook entry with native tick spacing. */
|
|
1955
2192
|
interface VenueOrderbookEntry {
|
|
1956
2193
|
venueMarketId: string;
|
|
@@ -2981,7 +3218,7 @@ declare class AggClient {
|
|
|
2981
3218
|
status?: MarketStatus[];
|
|
2982
3219
|
sortBy?: string;
|
|
2983
3220
|
sortDir?: string;
|
|
2984
|
-
recurrence?:
|
|
3221
|
+
recurrence?: RecurrenceFilter | RecurrenceFilter[];
|
|
2985
3222
|
limit?: number;
|
|
2986
3223
|
cursor?: string;
|
|
2987
3224
|
minYesPrice?: number;
|
|
@@ -2993,6 +3230,12 @@ declare class AggClient {
|
|
|
2993
3230
|
getVenueEventById(id: string, options?: {
|
|
2994
3231
|
signal?: AbortSignal;
|
|
2995
3232
|
}): Promise<VenueEvent>;
|
|
3233
|
+
/** List deterministic recurring crypto window markets across venues. Requires appId or admin auth. */
|
|
3234
|
+
listRecurringCryptoMarkets(options?: ListRecurringCryptoMarketsOptions & {
|
|
3235
|
+
signal?: AbortSignal;
|
|
3236
|
+
}): Promise<RecurringCryptoMarketsResponse>;
|
|
3237
|
+
/** Poll fresh reference prices for recurring crypto markets. Requires appId or admin auth. */
|
|
3238
|
+
getCryptoReferencePrices(options: GetCryptoReferencePricesOptions): Promise<CryptoReferencePricesResponse>;
|
|
2996
3239
|
/** List venue markets with optional filters. Requires appId or admin auth. Supports cursor-based pagination. */
|
|
2997
3240
|
getVenueMarkets(options?: {
|
|
2998
3241
|
venue?: Venue;
|
|
@@ -3217,4 +3460,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
|
|
|
3217
3460
|
|
|
3218
3461
|
declare function createAggClient(options: AggClientOptions): AggClient;
|
|
3219
3462
|
|
|
3220
|
-
export { type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionPositionGroup, type ExecutionPositionsQuery, type GetBalanceQuery, type GetBalanceResponse, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, ImageSize, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type MatchingReport, type MidpointItem, type MidpointRow, type NonceResponse, type OrderListItem, type OrderListQuery, OrderStatus, type Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, type OrderbookHistoryPoint, type OrderbookHistoryResponse, type OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, type OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PersistedAuthSnapshot, type PositionGroup, type PositionRedeemStatus, type PricePoint, type PriceSource, type PricesHistoryResponse, type QuoteManagedParams, type QuoteManagedRequest, type QuoteManagedResponse, type QuoteManagedSplit, type QuoteManagedStep, type QuoteSplit, type QuoteStep, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RequestedOrderbookMarket, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SyncBalancesResponse, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateUserBody, type UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, type UserHolding, type UserProfile, VENUES, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueKeySummary, type VenueMarket, type VenueMarketClusterNode, type VenueMarketListItem, type VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, type VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, type VerifyBody, type VerifyResponse, type WalletChainBalance, type WalletTokenBalance, type WithdrawManagedParams, type WithdrawManagedRequest, type WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawTokenSymbol, type WithdrawalExpected, type WithdrawalLeg, type WithdrawalLegStatus, type WithdrawalLegType, type WithdrawalLifecycleStatus, type WithdrawalSource, type WithdrawalSourceItem, type WithdrawalSourceStatus, type WithdrawalSourceTokenSymbol, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsClientMessage, type WsConnected, type WsError, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsServerMessage, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
|
|
3463
|
+
export { type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionPositionGroup, type ExecutionPositionsQuery, type GetBalanceQuery, type GetBalanceResponse, type GetCryptoReferencePricesOptions, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, ImageSize, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type MatchingReport, type MidpointItem, type MidpointRow, type NonceResponse, type OrderListItem, type OrderListQuery, OrderStatus, OrderType, type Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, type OrderbookHistoryPoint, type OrderbookHistoryResponse, type OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, type OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PersistedAuthSnapshot, type PositionGroup, type PositionRedeemStatus, type PricePoint, type PriceSource, type PricesHistoryResponse, type QuoteManagedParams, type QuoteManagedRequest, type QuoteManagedResponse, type QuoteManagedSplit, type QuoteManagedStep, type QuoteSplit, type QuoteStep, RECURRENCE_CADENCES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOutcome, 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 ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SyncBalancesResponse, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateUserBody, type UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, type UserHolding, type UserProfile, VENUES, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueKeySummary, type VenueMarket, type VenueMarketClusterNode, type VenueMarketListItem, type VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, type VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, type VerifyBody, type VerifyResponse, type WalletChainBalance, type WalletTokenBalance, type WithdrawManagedParams, type WithdrawManagedRequest, type WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawTokenSymbol, type WithdrawalExpected, type WithdrawalLeg, type WithdrawalLegStatus, type WithdrawalLegType, type WithdrawalLifecycleStatus, type WithdrawalSource, type WithdrawalSourceItem, type WithdrawalSourceStatus, type WithdrawalSourceTokenSymbol, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsClientMessage, type WsConnected, type WsError, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsServerMessage, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
|
package/dist/index.d.ts
CHANGED
|
@@ -68,13 +68,31 @@ declare enum OrderStatus {
|
|
|
68
68
|
pending_bridge = "pending_bridge",
|
|
69
69
|
submitting = "submitting",
|
|
70
70
|
submitted = "submitted",
|
|
71
|
+
open = "open",
|
|
72
|
+
partially_filled_open = "partially_filled_open",
|
|
73
|
+
cancel_pending = "cancel_pending",
|
|
71
74
|
filled = "filled",
|
|
72
|
-
partial_fill = "partial_fill"
|
|
75
|
+
partial_fill = "partial_fill",
|
|
76
|
+
failed = "failed",
|
|
77
|
+
expired = "expired",
|
|
78
|
+
cancelled = "cancelled"
|
|
73
79
|
}
|
|
74
80
|
declare enum TradeSide$1 {
|
|
75
81
|
Buy = "buy",
|
|
76
82
|
Sell = "sell"
|
|
77
83
|
}
|
|
84
|
+
declare enum OrderType {
|
|
85
|
+
Market = "market",
|
|
86
|
+
Limit = "limit"
|
|
87
|
+
}
|
|
88
|
+
declare enum TimeInForce {
|
|
89
|
+
GTC = "GTC",
|
|
90
|
+
GTD = "GTD",
|
|
91
|
+
FOK = "FOK",
|
|
92
|
+
FAK = "FAK",
|
|
93
|
+
IOC = "IOC",
|
|
94
|
+
ALO = "ALO"
|
|
95
|
+
}
|
|
78
96
|
|
|
79
97
|
/**
|
|
80
98
|
* Standalone type definitions — no Zod dependency.
|
|
@@ -375,6 +393,8 @@ type WalletChainBalance = {
|
|
|
375
393
|
chainId: number;
|
|
376
394
|
tokenAddress: string;
|
|
377
395
|
balanceRaw: string;
|
|
396
|
+
heldRaw?: string | undefined;
|
|
397
|
+
availableRaw?: string | undefined;
|
|
378
398
|
decimals: number;
|
|
379
399
|
lastSyncedAt: string;
|
|
380
400
|
tokenSymbol?: string | undefined;
|
|
@@ -382,11 +402,15 @@ type WalletChainBalance = {
|
|
|
382
402
|
type WalletTokenBalance = {
|
|
383
403
|
tokenSymbol: string;
|
|
384
404
|
totalRaw: string;
|
|
405
|
+
availableRaw?: string | undefined;
|
|
406
|
+
reservedRaw?: string | undefined;
|
|
385
407
|
decimals: number;
|
|
386
408
|
chains: {
|
|
387
409
|
chainId: number;
|
|
388
410
|
tokenAddress: string;
|
|
389
411
|
balanceRaw: string;
|
|
412
|
+
heldRaw?: string | undefined;
|
|
413
|
+
availableRaw?: string | undefined;
|
|
390
414
|
decimals: number;
|
|
391
415
|
lastSyncedAt: string;
|
|
392
416
|
}[];
|
|
@@ -404,11 +428,15 @@ type UnifiedBalanceResponse = {
|
|
|
404
428
|
cash: {
|
|
405
429
|
tokenSymbol: string;
|
|
406
430
|
totalRaw: string;
|
|
431
|
+
availableRaw?: string | undefined;
|
|
432
|
+
reservedRaw?: string | undefined;
|
|
407
433
|
decimals: number;
|
|
408
434
|
chains: {
|
|
409
435
|
chainId: number;
|
|
410
436
|
tokenAddress: string;
|
|
411
437
|
balanceRaw: string;
|
|
438
|
+
heldRaw?: string | undefined;
|
|
439
|
+
availableRaw?: string | undefined;
|
|
412
440
|
decimals: number;
|
|
413
441
|
lastSyncedAt: string;
|
|
414
442
|
}[];
|
|
@@ -587,6 +615,10 @@ type VenueMarket = {
|
|
|
587
615
|
endDate?: string | null | undefined;
|
|
588
616
|
creationDate?: string | null | undefined;
|
|
589
617
|
resolutionDate?: string | null | undefined;
|
|
618
|
+
/** Sports market classification for type-aware sorting (moneyline, spread, total, etc.). */
|
|
619
|
+
sportsMarketType?: string | null | undefined;
|
|
620
|
+
/** Sort rank within a sports section (0=moneyline, 1=spread, 2=total, 3+=other). */
|
|
621
|
+
sectionRank?: number | null | undefined;
|
|
590
622
|
matchedVenueMarkets?: {
|
|
591
623
|
id: string;
|
|
592
624
|
venue: Venue;
|
|
@@ -646,10 +678,12 @@ type VenueEvent = {
|
|
|
646
678
|
/**
|
|
647
679
|
* ISO-8601 duration denormalized from Series.recurrence. `null` means
|
|
648
680
|
* the event has no recurring schedule (one-off). Use this value with
|
|
649
|
-
* the `?recurrence=` filter on /venue-events
|
|
650
|
-
* values
|
|
681
|
+
* the `?recurrence=` filter on /venue-events using public recurrence
|
|
682
|
+
* enum values.
|
|
651
683
|
*/
|
|
652
684
|
recurrence?: string | null | undefined;
|
|
685
|
+
/** Type-aware structure classification used to sort markets under this event. */
|
|
686
|
+
structureType?: "candidate" | "sport" | "axis" | "dates" | null | undefined;
|
|
653
687
|
};
|
|
654
688
|
type Orderbook = {
|
|
655
689
|
bids: {
|
|
@@ -1951,6 +1985,209 @@ interface MatchedOrderbookMarket extends VenueMarketRef {
|
|
|
1951
1985
|
* - `none` — no mark available
|
|
1952
1986
|
*/
|
|
1953
1987
|
type MarkSource = "local" | "local_merged" | "local_one_sided" | "sibling" | "local_boundary" | "none";
|
|
1988
|
+
declare const RECURRENCE_CADENCES: readonly ["PT5M", "PT10M", "PT15M", "PT1H", "P1D", "P1W", "P1M", "P1Y"];
|
|
1989
|
+
type RecurrenceCadence = (typeof RECURRENCE_CADENCES)[number];
|
|
1990
|
+
type RecurrenceFilter = RecurrenceCadence | "null";
|
|
1991
|
+
type RecurringCryptoDuration = "PT5M" | "PT15M" | "PT1H" | "P1D";
|
|
1992
|
+
type RecurringCryptoDurationInput = RecurringCryptoDuration | "5m" | "15m" | "1h" | "1d";
|
|
1993
|
+
type RecurringCryptoSourceConfidence = "verified" | "inferred" | "missing";
|
|
1994
|
+
interface ListRecurringCryptoMarketsOptions {
|
|
1995
|
+
assets?: string[];
|
|
1996
|
+
durations?: RecurringCryptoDurationInput[];
|
|
1997
|
+
interval?: RecurringCryptoDurationInput;
|
|
1998
|
+
window?: "current";
|
|
1999
|
+
venues?: Venue[];
|
|
2000
|
+
status?: MarketStatus[];
|
|
2001
|
+
windowStartFrom?: string;
|
|
2002
|
+
windowStartTo?: string;
|
|
2003
|
+
cursor?: string;
|
|
2004
|
+
limit?: number;
|
|
2005
|
+
includeOrderbookPrices?: boolean;
|
|
2006
|
+
includeReferencePrices?: boolean;
|
|
2007
|
+
includeDirectVenueMarkets?: boolean;
|
|
2008
|
+
}
|
|
2009
|
+
interface RecurringCryptoOutcome {
|
|
2010
|
+
/**
|
|
2011
|
+
* Canonical Agg outcome id. Null for direct live venue rows because those
|
|
2012
|
+
* rows are discovery data and cannot be passed to smart order routing.
|
|
2013
|
+
*/
|
|
2014
|
+
venueMarketOutcomeId: string | null;
|
|
2015
|
+
/** Venue-native outcome id or synthetic external id for direct live rows. */
|
|
2016
|
+
externalOutcomeId: string | null;
|
|
2017
|
+
/** False for this endpoint; live crypto markets are not smart-route inputs. */
|
|
2018
|
+
routeable: boolean;
|
|
2019
|
+
/** False for this endpoint; split-order routing is not supported here. */
|
|
2020
|
+
splitOrdersAllowed: boolean;
|
|
2021
|
+
label: string;
|
|
2022
|
+
title: string | null;
|
|
2023
|
+
midpoint: number | null;
|
|
2024
|
+
bestBid: number | null;
|
|
2025
|
+
bestAsk: number | null;
|
|
2026
|
+
markSource: MarkSource | string | null;
|
|
2027
|
+
lastKnownPrice: number | null;
|
|
2028
|
+
}
|
|
2029
|
+
interface RecurringCryptoMarketMetrics {
|
|
2030
|
+
volume: number | null;
|
|
2031
|
+
volume24h: number | null;
|
|
2032
|
+
openInterest: number | null;
|
|
2033
|
+
liquidity: number | null;
|
|
2034
|
+
spread: number | null;
|
|
2035
|
+
}
|
|
2036
|
+
interface RecurringCryptoResolution {
|
|
2037
|
+
sourceName: string | null;
|
|
2038
|
+
sourceUrl: string | null;
|
|
2039
|
+
sourceDomain: string | null;
|
|
2040
|
+
rawCriteria: unknown;
|
|
2041
|
+
confidence: RecurringCryptoSourceConfidence;
|
|
2042
|
+
}
|
|
2043
|
+
interface RecurringCryptoReferencePrice {
|
|
2044
|
+
asset: string;
|
|
2045
|
+
quoteAsset: "USD";
|
|
2046
|
+
raw: string | null;
|
|
2047
|
+
decimals: number | null;
|
|
2048
|
+
normalized: number | null;
|
|
2049
|
+
timestamp: string | null;
|
|
2050
|
+
provider: string | null;
|
|
2051
|
+
providerMarketId: string | null;
|
|
2052
|
+
confidence: RecurringCryptoSourceConfidence;
|
|
2053
|
+
fetchedAt?: string | null;
|
|
2054
|
+
ageMs?: number | null;
|
|
2055
|
+
refreshing?: boolean;
|
|
2056
|
+
stale?: boolean;
|
|
2057
|
+
}
|
|
2058
|
+
type CryptoReferencePriceTarget = {
|
|
2059
|
+
type: "venueMarket";
|
|
2060
|
+
venueMarketId: string;
|
|
2061
|
+
} | {
|
|
2062
|
+
type: "venueEvent";
|
|
2063
|
+
venueEventId: string;
|
|
2064
|
+
} | {
|
|
2065
|
+
type: "externalVenueMarket";
|
|
2066
|
+
venue: Venue;
|
|
2067
|
+
externalMarketId: string;
|
|
2068
|
+
} | {
|
|
2069
|
+
type: "market";
|
|
2070
|
+
venue: Venue;
|
|
2071
|
+
venueEventId?: string;
|
|
2072
|
+
venueMarketId: string;
|
|
2073
|
+
externalEventId?: string | null;
|
|
2074
|
+
externalMarketId?: string;
|
|
2075
|
+
asset: string;
|
|
2076
|
+
quoteAsset?: "USD";
|
|
2077
|
+
resolution: RecurringCryptoResolution;
|
|
2078
|
+
};
|
|
2079
|
+
interface CryptoReferencePriceExternalMarketInput {
|
|
2080
|
+
venue: Venue;
|
|
2081
|
+
externalMarketId: string;
|
|
2082
|
+
}
|
|
2083
|
+
interface CryptoReferencePriceMarketInput extends RecurringCryptoVenueMarket {
|
|
2084
|
+
asset: string;
|
|
2085
|
+
quoteAsset?: "USD";
|
|
2086
|
+
}
|
|
2087
|
+
interface GetCryptoReferencePricesOptions {
|
|
2088
|
+
targets?: CryptoReferencePriceTarget[];
|
|
2089
|
+
venueMarketIds?: string[];
|
|
2090
|
+
venueEventIds?: string[];
|
|
2091
|
+
externalMarkets?: CryptoReferencePriceExternalMarketInput[];
|
|
2092
|
+
markets?: CryptoReferencePriceMarketInput[];
|
|
2093
|
+
windowMarkets?: RecurringCryptoWindowMarket[];
|
|
2094
|
+
signal?: AbortSignal;
|
|
2095
|
+
}
|
|
2096
|
+
interface CryptoReferencePriceError {
|
|
2097
|
+
code: "not_found" | "not_recurring_crypto" | "reference_feed_missing" | "price_unavailable" | "stale_price";
|
|
2098
|
+
message: string;
|
|
2099
|
+
}
|
|
2100
|
+
interface CryptoReferencePriceSource {
|
|
2101
|
+
provider: string | null;
|
|
2102
|
+
providerMarketId: string | null;
|
|
2103
|
+
confidence: RecurringCryptoSourceConfidence;
|
|
2104
|
+
}
|
|
2105
|
+
interface CryptoReferencePriceResult {
|
|
2106
|
+
target: CryptoReferencePriceTarget;
|
|
2107
|
+
venue: Venue | null;
|
|
2108
|
+
venueEventId: string | null;
|
|
2109
|
+
venueMarketId: string | null;
|
|
2110
|
+
externalEventId: string | null;
|
|
2111
|
+
externalMarketId: string | null;
|
|
2112
|
+
asset: string | null;
|
|
2113
|
+
quoteAsset: "USD" | null;
|
|
2114
|
+
raw: string | null;
|
|
2115
|
+
decimals: number | null;
|
|
2116
|
+
normalized: number | null;
|
|
2117
|
+
providerTimestamp: string | null;
|
|
2118
|
+
fetchedAt: string | null;
|
|
2119
|
+
ageMs: number | null;
|
|
2120
|
+
refreshing: boolean;
|
|
2121
|
+
stale: boolean;
|
|
2122
|
+
source: CryptoReferencePriceSource;
|
|
2123
|
+
error: CryptoReferencePriceError | null;
|
|
2124
|
+
}
|
|
2125
|
+
interface CryptoReferencePricesResponse {
|
|
2126
|
+
data: CryptoReferencePriceResult[];
|
|
2127
|
+
softRefreshMs: number;
|
|
2128
|
+
hardMaxAgeMs: number;
|
|
2129
|
+
}
|
|
2130
|
+
type RecurringCryptoComparisonPriceSource = "referencePrice" | "midpoint" | "lastKnownPrice";
|
|
2131
|
+
interface RecurringCryptoComparisonPoint {
|
|
2132
|
+
venue: Venue;
|
|
2133
|
+
venueMarketId: string;
|
|
2134
|
+
value: number;
|
|
2135
|
+
label: string | null;
|
|
2136
|
+
source: RecurringCryptoComparisonPriceSource;
|
|
2137
|
+
provider: string | null;
|
|
2138
|
+
providerMarketId: string | null;
|
|
2139
|
+
timestamp: string | null;
|
|
2140
|
+
confidence: RecurringCryptoSourceConfidence | null;
|
|
2141
|
+
}
|
|
2142
|
+
interface RecurringCryptoPriceComparison {
|
|
2143
|
+
count: number;
|
|
2144
|
+
min: RecurringCryptoComparisonPoint | null;
|
|
2145
|
+
max: RecurringCryptoComparisonPoint | null;
|
|
2146
|
+
spread: number | null;
|
|
2147
|
+
spreadBps: number | null;
|
|
2148
|
+
byVenue: RecurringCryptoComparisonPoint[];
|
|
2149
|
+
}
|
|
2150
|
+
interface RecurringCryptoWindowComparisons {
|
|
2151
|
+
referencePrice: RecurringCryptoPriceComparison;
|
|
2152
|
+
outcomePrices: {
|
|
2153
|
+
up: RecurringCryptoPriceComparison;
|
|
2154
|
+
down: RecurringCryptoPriceComparison;
|
|
2155
|
+
};
|
|
2156
|
+
}
|
|
2157
|
+
interface RecurringCryptoVenueMarket {
|
|
2158
|
+
venue: Venue;
|
|
2159
|
+
venueEventId: string;
|
|
2160
|
+
venueMarketId: string;
|
|
2161
|
+
externalEventId: string | null;
|
|
2162
|
+
externalMarketId: string;
|
|
2163
|
+
question: string;
|
|
2164
|
+
status: MarketStatus;
|
|
2165
|
+
priceSource: "snag" | "direct";
|
|
2166
|
+
/** False for this endpoint; live crypto markets are not smart-route inputs. */
|
|
2167
|
+
routeable: boolean;
|
|
2168
|
+
/** False for this endpoint; split-order routing is not supported here. */
|
|
2169
|
+
splitOrdersAllowed: boolean;
|
|
2170
|
+
outcomes: RecurringCryptoOutcome[];
|
|
2171
|
+
metrics: RecurringCryptoMarketMetrics;
|
|
2172
|
+
resolution: RecurringCryptoResolution;
|
|
2173
|
+
referencePrice: RecurringCryptoReferencePrice;
|
|
2174
|
+
}
|
|
2175
|
+
interface RecurringCryptoWindowMarket {
|
|
2176
|
+
id: string;
|
|
2177
|
+
asset: string;
|
|
2178
|
+
quoteAsset: "USD";
|
|
2179
|
+
duration: RecurringCryptoDuration;
|
|
2180
|
+
windowStart: string;
|
|
2181
|
+
windowEnd: string;
|
|
2182
|
+
status: MarketStatus;
|
|
2183
|
+
markets: RecurringCryptoVenueMarket[];
|
|
2184
|
+
comparisons: RecurringCryptoWindowComparisons;
|
|
2185
|
+
}
|
|
2186
|
+
interface RecurringCryptoMarketsResponse {
|
|
2187
|
+
data: RecurringCryptoWindowMarket[];
|
|
2188
|
+
nextCursor: string | null;
|
|
2189
|
+
hasMore: boolean;
|
|
2190
|
+
}
|
|
1954
2191
|
/** Per-venue orderbook entry with native tick spacing. */
|
|
1955
2192
|
interface VenueOrderbookEntry {
|
|
1956
2193
|
venueMarketId: string;
|
|
@@ -2981,7 +3218,7 @@ declare class AggClient {
|
|
|
2981
3218
|
status?: MarketStatus[];
|
|
2982
3219
|
sortBy?: string;
|
|
2983
3220
|
sortDir?: string;
|
|
2984
|
-
recurrence?:
|
|
3221
|
+
recurrence?: RecurrenceFilter | RecurrenceFilter[];
|
|
2985
3222
|
limit?: number;
|
|
2986
3223
|
cursor?: string;
|
|
2987
3224
|
minYesPrice?: number;
|
|
@@ -2993,6 +3230,12 @@ declare class AggClient {
|
|
|
2993
3230
|
getVenueEventById(id: string, options?: {
|
|
2994
3231
|
signal?: AbortSignal;
|
|
2995
3232
|
}): Promise<VenueEvent>;
|
|
3233
|
+
/** List deterministic recurring crypto window markets across venues. Requires appId or admin auth. */
|
|
3234
|
+
listRecurringCryptoMarkets(options?: ListRecurringCryptoMarketsOptions & {
|
|
3235
|
+
signal?: AbortSignal;
|
|
3236
|
+
}): Promise<RecurringCryptoMarketsResponse>;
|
|
3237
|
+
/** Poll fresh reference prices for recurring crypto markets. Requires appId or admin auth. */
|
|
3238
|
+
getCryptoReferencePrices(options: GetCryptoReferencePricesOptions): Promise<CryptoReferencePricesResponse>;
|
|
2996
3239
|
/** List venue markets with optional filters. Requires appId or admin auth. Supports cursor-based pagination. */
|
|
2997
3240
|
getVenueMarkets(options?: {
|
|
2998
3241
|
venue?: Venue;
|
|
@@ -3217,4 +3460,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
|
|
|
3217
3460
|
|
|
3218
3461
|
declare function createAggClient(options: AggClientOptions): AggClient;
|
|
3219
3462
|
|
|
3220
|
-
export { type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionPositionGroup, type ExecutionPositionsQuery, type GetBalanceQuery, type GetBalanceResponse, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, ImageSize, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type MatchingReport, type MidpointItem, type MidpointRow, type NonceResponse, type OrderListItem, type OrderListQuery, OrderStatus, type Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, type OrderbookHistoryPoint, type OrderbookHistoryResponse, type OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, type OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PersistedAuthSnapshot, type PositionGroup, type PositionRedeemStatus, type PricePoint, type PriceSource, type PricesHistoryResponse, type QuoteManagedParams, type QuoteManagedRequest, type QuoteManagedResponse, type QuoteManagedSplit, type QuoteManagedStep, type QuoteSplit, type QuoteStep, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RequestedOrderbookMarket, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SyncBalancesResponse, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateUserBody, type UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, type UserHolding, type UserProfile, VENUES, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueKeySummary, type VenueMarket, type VenueMarketClusterNode, type VenueMarketListItem, type VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, type VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, type VerifyBody, type VerifyResponse, type WalletChainBalance, type WalletTokenBalance, type WithdrawManagedParams, type WithdrawManagedRequest, type WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawTokenSymbol, type WithdrawalExpected, type WithdrawalLeg, type WithdrawalLegStatus, type WithdrawalLegType, type WithdrawalLifecycleStatus, type WithdrawalSource, type WithdrawalSourceItem, type WithdrawalSourceStatus, type WithdrawalSourceTokenSymbol, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsClientMessage, type WsConnected, type WsError, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsServerMessage, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
|
|
3463
|
+
export { type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionPositionGroup, type ExecutionPositionsQuery, type GetBalanceQuery, type GetBalanceResponse, type GetCryptoReferencePricesOptions, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, ImageSize, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type MatchingReport, type MidpointItem, type MidpointRow, type NonceResponse, type OrderListItem, type OrderListQuery, OrderStatus, OrderType, type Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, type OrderbookHistoryPoint, type OrderbookHistoryResponse, type OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, type OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PersistedAuthSnapshot, type PositionGroup, type PositionRedeemStatus, type PricePoint, type PriceSource, type PricesHistoryResponse, type QuoteManagedParams, type QuoteManagedRequest, type QuoteManagedResponse, type QuoteManagedSplit, type QuoteManagedStep, type QuoteSplit, type QuoteStep, RECURRENCE_CADENCES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOutcome, 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 ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SyncBalancesResponse, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateUserBody, type UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, type UserHolding, type UserProfile, VENUES, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueKeySummary, type VenueMarket, type VenueMarketClusterNode, type VenueMarketListItem, type VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, type VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, type VerifyBody, type VerifyResponse, type WalletChainBalance, type WalletTokenBalance, type WithdrawManagedParams, type WithdrawManagedRequest, type WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawTokenSymbol, type WithdrawalExpected, type WithdrawalLeg, type WithdrawalLegStatus, type WithdrawalLegType, type WithdrawalLifecycleStatus, type WithdrawalSource, type WithdrawalSourceItem, type WithdrawalSourceStatus, type WithdrawalSourceTokenSymbol, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsClientMessage, type WsConnected, type WsError, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsServerMessage, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
|
package/dist/index.js
CHANGED
|
@@ -70,6 +70,9 @@ __export(index_exports, {
|
|
|
70
70
|
MatchStatus: () => MatchStatus,
|
|
71
71
|
MatchType: () => MatchType,
|
|
72
72
|
OrderStatus: () => OrderStatus,
|
|
73
|
+
OrderType: () => OrderType,
|
|
74
|
+
RECURRENCE_CADENCES: () => RECURRENCE_CADENCES,
|
|
75
|
+
TimeInForce: () => TimeInForce,
|
|
73
76
|
TradeSide: () => TradeSide,
|
|
74
77
|
TurnstileChallengeError: () => TurnstileChallengeError,
|
|
75
78
|
VENUES: () => VENUES,
|
|
@@ -193,8 +196,14 @@ var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
|
|
|
193
196
|
OrderStatus2["pending_bridge"] = "pending_bridge";
|
|
194
197
|
OrderStatus2["submitting"] = "submitting";
|
|
195
198
|
OrderStatus2["submitted"] = "submitted";
|
|
199
|
+
OrderStatus2["open"] = "open";
|
|
200
|
+
OrderStatus2["partially_filled_open"] = "partially_filled_open";
|
|
201
|
+
OrderStatus2["cancel_pending"] = "cancel_pending";
|
|
196
202
|
OrderStatus2["filled"] = "filled";
|
|
197
203
|
OrderStatus2["partial_fill"] = "partial_fill";
|
|
204
|
+
OrderStatus2["failed"] = "failed";
|
|
205
|
+
OrderStatus2["expired"] = "expired";
|
|
206
|
+
OrderStatus2["cancelled"] = "cancelled";
|
|
198
207
|
return OrderStatus2;
|
|
199
208
|
})(OrderStatus || {});
|
|
200
209
|
var TradeSide = /* @__PURE__ */ ((TradeSide2) => {
|
|
@@ -202,6 +211,20 @@ var TradeSide = /* @__PURE__ */ ((TradeSide2) => {
|
|
|
202
211
|
TradeSide2["Sell"] = "sell";
|
|
203
212
|
return TradeSide2;
|
|
204
213
|
})(TradeSide || {});
|
|
214
|
+
var OrderType = /* @__PURE__ */ ((OrderType2) => {
|
|
215
|
+
OrderType2["Market"] = "market";
|
|
216
|
+
OrderType2["Limit"] = "limit";
|
|
217
|
+
return OrderType2;
|
|
218
|
+
})(OrderType || {});
|
|
219
|
+
var TimeInForce = /* @__PURE__ */ ((TimeInForce2) => {
|
|
220
|
+
TimeInForce2["GTC"] = "GTC";
|
|
221
|
+
TimeInForce2["GTD"] = "GTD";
|
|
222
|
+
TimeInForce2["FOK"] = "FOK";
|
|
223
|
+
TimeInForce2["FAK"] = "FAK";
|
|
224
|
+
TimeInForce2["IOC"] = "IOC";
|
|
225
|
+
TimeInForce2["ALO"] = "ALO";
|
|
226
|
+
return TimeInForce2;
|
|
227
|
+
})(TimeInForce || {});
|
|
205
228
|
|
|
206
229
|
// ../common/src/utils/format-market-display.ts
|
|
207
230
|
function formatOutcomeLabel(venue, outcome, _market) {
|
|
@@ -2310,6 +2333,92 @@ Issued At: ${issuedAt}`;
|
|
|
2310
2333
|
});
|
|
2311
2334
|
});
|
|
2312
2335
|
}
|
|
2336
|
+
/** List deterministic recurring crypto window markets across venues. Requires appId or admin auth. */
|
|
2337
|
+
listRecurringCryptoMarkets(options) {
|
|
2338
|
+
return __async(this, null, function* () {
|
|
2339
|
+
const query = {};
|
|
2340
|
+
if ((options == null ? void 0 : options.assets) && options.assets.length > 0) query.assets = options.assets;
|
|
2341
|
+
if ((options == null ? void 0 : options.durations) && options.durations.length > 0) query.durations = options.durations;
|
|
2342
|
+
if (options == null ? void 0 : options.interval) query.interval = options.interval;
|
|
2343
|
+
if (options == null ? void 0 : options.window) query.window = options.window;
|
|
2344
|
+
if ((options == null ? void 0 : options.venues) && options.venues.length > 0) query.venues = options.venues;
|
|
2345
|
+
if ((options == null ? void 0 : options.status) && options.status.length > 0) query.status = options.status;
|
|
2346
|
+
if (options == null ? void 0 : options.windowStartFrom) query.windowStartFrom = options.windowStartFrom;
|
|
2347
|
+
if (options == null ? void 0 : options.windowStartTo) query.windowStartTo = options.windowStartTo;
|
|
2348
|
+
if (options == null ? void 0 : options.cursor) query.cursor = options.cursor;
|
|
2349
|
+
if ((options == null ? void 0 : options.limit) != null) query.limit = String(options.limit);
|
|
2350
|
+
if ((options == null ? void 0 : options.includeOrderbookPrices) != null) {
|
|
2351
|
+
query.includeOrderbookPrices = String(options.includeOrderbookPrices);
|
|
2352
|
+
}
|
|
2353
|
+
if ((options == null ? void 0 : options.includeReferencePrices) != null) {
|
|
2354
|
+
query.includeReferencePrices = String(options.includeReferencePrices);
|
|
2355
|
+
}
|
|
2356
|
+
if ((options == null ? void 0 : options.includeDirectVenueMarkets) != null) {
|
|
2357
|
+
query.includeDirectVenueMarkets = String(options.includeDirectVenueMarkets);
|
|
2358
|
+
}
|
|
2359
|
+
return this.request("/crypto/recurring-markets", {
|
|
2360
|
+
query: Object.keys(query).length > 0 ? query : void 0,
|
|
2361
|
+
signal: options == null ? void 0 : options.signal
|
|
2362
|
+
});
|
|
2363
|
+
});
|
|
2364
|
+
}
|
|
2365
|
+
/** Poll fresh reference prices for recurring crypto markets. Requires appId or admin auth. */
|
|
2366
|
+
getCryptoReferencePrices(options) {
|
|
2367
|
+
return __async(this, null, function* () {
|
|
2368
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2369
|
+
const targets = [
|
|
2370
|
+
...(_a = options.targets) != null ? _a : [],
|
|
2371
|
+
...((_b = options.venueMarketIds) != null ? _b : []).map((venueMarketId) => ({
|
|
2372
|
+
type: "venueMarket",
|
|
2373
|
+
venueMarketId
|
|
2374
|
+
})),
|
|
2375
|
+
...((_c = options.venueEventIds) != null ? _c : []).map((venueEventId) => ({
|
|
2376
|
+
type: "venueEvent",
|
|
2377
|
+
venueEventId
|
|
2378
|
+
})),
|
|
2379
|
+
...((_d = options.externalMarkets) != null ? _d : []).map((market) => ({
|
|
2380
|
+
type: "externalVenueMarket",
|
|
2381
|
+
venue: market.venue,
|
|
2382
|
+
externalMarketId: market.externalMarketId
|
|
2383
|
+
})),
|
|
2384
|
+
...((_e = options.markets) != null ? _e : []).map((market) => {
|
|
2385
|
+
var _a2;
|
|
2386
|
+
return {
|
|
2387
|
+
type: "market",
|
|
2388
|
+
venue: market.venue,
|
|
2389
|
+
venueEventId: market.venueEventId,
|
|
2390
|
+
venueMarketId: market.venueMarketId,
|
|
2391
|
+
externalEventId: market.externalEventId,
|
|
2392
|
+
externalMarketId: market.externalMarketId,
|
|
2393
|
+
asset: market.asset,
|
|
2394
|
+
quoteAsset: (_a2 = market.quoteAsset) != null ? _a2 : "USD",
|
|
2395
|
+
resolution: market.resolution
|
|
2396
|
+
};
|
|
2397
|
+
}),
|
|
2398
|
+
...((_f = options.windowMarkets) != null ? _f : []).flatMap(
|
|
2399
|
+
(windowMarket) => windowMarket.markets.map((market) => ({
|
|
2400
|
+
type: "market",
|
|
2401
|
+
venue: market.venue,
|
|
2402
|
+
venueEventId: market.venueEventId,
|
|
2403
|
+
venueMarketId: market.venueMarketId,
|
|
2404
|
+
externalEventId: market.externalEventId,
|
|
2405
|
+
externalMarketId: market.externalMarketId,
|
|
2406
|
+
asset: windowMarket.asset,
|
|
2407
|
+
quoteAsset: windowMarket.quoteAsset,
|
|
2408
|
+
resolution: market.resolution
|
|
2409
|
+
}))
|
|
2410
|
+
)
|
|
2411
|
+
];
|
|
2412
|
+
if (targets.length === 0) {
|
|
2413
|
+
throw new Error("getCryptoReferencePrices requires at least one target");
|
|
2414
|
+
}
|
|
2415
|
+
return this.request("/crypto/reference-prices", {
|
|
2416
|
+
method: "POST",
|
|
2417
|
+
body: JSON.stringify({ targets }),
|
|
2418
|
+
signal: options.signal
|
|
2419
|
+
});
|
|
2420
|
+
});
|
|
2421
|
+
}
|
|
2313
2422
|
/** List venue markets with optional filters. Requires appId or admin auth. Supports cursor-based pagination. */
|
|
2314
2423
|
getVenueMarkets(options) {
|
|
2315
2424
|
return __async(this, null, function* () {
|
|
@@ -2649,6 +2758,18 @@ Issued At: ${issuedAt}`;
|
|
|
2649
2758
|
// src/best-split.ts
|
|
2650
2759
|
var computeBestSplitsByAmount2 = computeBestSplitsByAmount;
|
|
2651
2760
|
|
|
2761
|
+
// src/types.ts
|
|
2762
|
+
var RECURRENCE_CADENCES = [
|
|
2763
|
+
"PT5M",
|
|
2764
|
+
"PT10M",
|
|
2765
|
+
"PT15M",
|
|
2766
|
+
"PT1H",
|
|
2767
|
+
"P1D",
|
|
2768
|
+
"P1W",
|
|
2769
|
+
"P1M",
|
|
2770
|
+
"P1Y"
|
|
2771
|
+
];
|
|
2772
|
+
|
|
2652
2773
|
// src/errors.ts
|
|
2653
2774
|
var TurnstileChallengeError = class extends Error {
|
|
2654
2775
|
constructor(siteKey) {
|
|
@@ -2861,6 +2982,9 @@ function createAggClient(options) {
|
|
|
2861
2982
|
MatchStatus,
|
|
2862
2983
|
MatchType,
|
|
2863
2984
|
OrderStatus,
|
|
2985
|
+
OrderType,
|
|
2986
|
+
RECURRENCE_CADENCES,
|
|
2987
|
+
TimeInForce,
|
|
2864
2988
|
TradeSide,
|
|
2865
2989
|
TurnstileChallengeError,
|
|
2866
2990
|
VENUES,
|
package/dist/index.mjs
CHANGED
|
@@ -94,8 +94,14 @@ var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
|
|
|
94
94
|
OrderStatus2["pending_bridge"] = "pending_bridge";
|
|
95
95
|
OrderStatus2["submitting"] = "submitting";
|
|
96
96
|
OrderStatus2["submitted"] = "submitted";
|
|
97
|
+
OrderStatus2["open"] = "open";
|
|
98
|
+
OrderStatus2["partially_filled_open"] = "partially_filled_open";
|
|
99
|
+
OrderStatus2["cancel_pending"] = "cancel_pending";
|
|
97
100
|
OrderStatus2["filled"] = "filled";
|
|
98
101
|
OrderStatus2["partial_fill"] = "partial_fill";
|
|
102
|
+
OrderStatus2["failed"] = "failed";
|
|
103
|
+
OrderStatus2["expired"] = "expired";
|
|
104
|
+
OrderStatus2["cancelled"] = "cancelled";
|
|
99
105
|
return OrderStatus2;
|
|
100
106
|
})(OrderStatus || {});
|
|
101
107
|
var TradeSide = /* @__PURE__ */ ((TradeSide2) => {
|
|
@@ -103,6 +109,20 @@ var TradeSide = /* @__PURE__ */ ((TradeSide2) => {
|
|
|
103
109
|
TradeSide2["Sell"] = "sell";
|
|
104
110
|
return TradeSide2;
|
|
105
111
|
})(TradeSide || {});
|
|
112
|
+
var OrderType = /* @__PURE__ */ ((OrderType2) => {
|
|
113
|
+
OrderType2["Market"] = "market";
|
|
114
|
+
OrderType2["Limit"] = "limit";
|
|
115
|
+
return OrderType2;
|
|
116
|
+
})(OrderType || {});
|
|
117
|
+
var TimeInForce = /* @__PURE__ */ ((TimeInForce2) => {
|
|
118
|
+
TimeInForce2["GTC"] = "GTC";
|
|
119
|
+
TimeInForce2["GTD"] = "GTD";
|
|
120
|
+
TimeInForce2["FOK"] = "FOK";
|
|
121
|
+
TimeInForce2["FAK"] = "FAK";
|
|
122
|
+
TimeInForce2["IOC"] = "IOC";
|
|
123
|
+
TimeInForce2["ALO"] = "ALO";
|
|
124
|
+
return TimeInForce2;
|
|
125
|
+
})(TimeInForce || {});
|
|
106
126
|
|
|
107
127
|
// ../common/src/utils/format-market-display.ts
|
|
108
128
|
function formatOutcomeLabel(venue, outcome, _market) {
|
|
@@ -2211,6 +2231,92 @@ Issued At: ${issuedAt}`;
|
|
|
2211
2231
|
});
|
|
2212
2232
|
});
|
|
2213
2233
|
}
|
|
2234
|
+
/** List deterministic recurring crypto window markets across venues. Requires appId or admin auth. */
|
|
2235
|
+
listRecurringCryptoMarkets(options) {
|
|
2236
|
+
return __async(this, null, function* () {
|
|
2237
|
+
const query = {};
|
|
2238
|
+
if ((options == null ? void 0 : options.assets) && options.assets.length > 0) query.assets = options.assets;
|
|
2239
|
+
if ((options == null ? void 0 : options.durations) && options.durations.length > 0) query.durations = options.durations;
|
|
2240
|
+
if (options == null ? void 0 : options.interval) query.interval = options.interval;
|
|
2241
|
+
if (options == null ? void 0 : options.window) query.window = options.window;
|
|
2242
|
+
if ((options == null ? void 0 : options.venues) && options.venues.length > 0) query.venues = options.venues;
|
|
2243
|
+
if ((options == null ? void 0 : options.status) && options.status.length > 0) query.status = options.status;
|
|
2244
|
+
if (options == null ? void 0 : options.windowStartFrom) query.windowStartFrom = options.windowStartFrom;
|
|
2245
|
+
if (options == null ? void 0 : options.windowStartTo) query.windowStartTo = options.windowStartTo;
|
|
2246
|
+
if (options == null ? void 0 : options.cursor) query.cursor = options.cursor;
|
|
2247
|
+
if ((options == null ? void 0 : options.limit) != null) query.limit = String(options.limit);
|
|
2248
|
+
if ((options == null ? void 0 : options.includeOrderbookPrices) != null) {
|
|
2249
|
+
query.includeOrderbookPrices = String(options.includeOrderbookPrices);
|
|
2250
|
+
}
|
|
2251
|
+
if ((options == null ? void 0 : options.includeReferencePrices) != null) {
|
|
2252
|
+
query.includeReferencePrices = String(options.includeReferencePrices);
|
|
2253
|
+
}
|
|
2254
|
+
if ((options == null ? void 0 : options.includeDirectVenueMarkets) != null) {
|
|
2255
|
+
query.includeDirectVenueMarkets = String(options.includeDirectVenueMarkets);
|
|
2256
|
+
}
|
|
2257
|
+
return this.request("/crypto/recurring-markets", {
|
|
2258
|
+
query: Object.keys(query).length > 0 ? query : void 0,
|
|
2259
|
+
signal: options == null ? void 0 : options.signal
|
|
2260
|
+
});
|
|
2261
|
+
});
|
|
2262
|
+
}
|
|
2263
|
+
/** Poll fresh reference prices for recurring crypto markets. Requires appId or admin auth. */
|
|
2264
|
+
getCryptoReferencePrices(options) {
|
|
2265
|
+
return __async(this, null, function* () {
|
|
2266
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2267
|
+
const targets = [
|
|
2268
|
+
...(_a = options.targets) != null ? _a : [],
|
|
2269
|
+
...((_b = options.venueMarketIds) != null ? _b : []).map((venueMarketId) => ({
|
|
2270
|
+
type: "venueMarket",
|
|
2271
|
+
venueMarketId
|
|
2272
|
+
})),
|
|
2273
|
+
...((_c = options.venueEventIds) != null ? _c : []).map((venueEventId) => ({
|
|
2274
|
+
type: "venueEvent",
|
|
2275
|
+
venueEventId
|
|
2276
|
+
})),
|
|
2277
|
+
...((_d = options.externalMarkets) != null ? _d : []).map((market) => ({
|
|
2278
|
+
type: "externalVenueMarket",
|
|
2279
|
+
venue: market.venue,
|
|
2280
|
+
externalMarketId: market.externalMarketId
|
|
2281
|
+
})),
|
|
2282
|
+
...((_e = options.markets) != null ? _e : []).map((market) => {
|
|
2283
|
+
var _a2;
|
|
2284
|
+
return {
|
|
2285
|
+
type: "market",
|
|
2286
|
+
venue: market.venue,
|
|
2287
|
+
venueEventId: market.venueEventId,
|
|
2288
|
+
venueMarketId: market.venueMarketId,
|
|
2289
|
+
externalEventId: market.externalEventId,
|
|
2290
|
+
externalMarketId: market.externalMarketId,
|
|
2291
|
+
asset: market.asset,
|
|
2292
|
+
quoteAsset: (_a2 = market.quoteAsset) != null ? _a2 : "USD",
|
|
2293
|
+
resolution: market.resolution
|
|
2294
|
+
};
|
|
2295
|
+
}),
|
|
2296
|
+
...((_f = options.windowMarkets) != null ? _f : []).flatMap(
|
|
2297
|
+
(windowMarket) => windowMarket.markets.map((market) => ({
|
|
2298
|
+
type: "market",
|
|
2299
|
+
venue: market.venue,
|
|
2300
|
+
venueEventId: market.venueEventId,
|
|
2301
|
+
venueMarketId: market.venueMarketId,
|
|
2302
|
+
externalEventId: market.externalEventId,
|
|
2303
|
+
externalMarketId: market.externalMarketId,
|
|
2304
|
+
asset: windowMarket.asset,
|
|
2305
|
+
quoteAsset: windowMarket.quoteAsset,
|
|
2306
|
+
resolution: market.resolution
|
|
2307
|
+
}))
|
|
2308
|
+
)
|
|
2309
|
+
];
|
|
2310
|
+
if (targets.length === 0) {
|
|
2311
|
+
throw new Error("getCryptoReferencePrices requires at least one target");
|
|
2312
|
+
}
|
|
2313
|
+
return this.request("/crypto/reference-prices", {
|
|
2314
|
+
method: "POST",
|
|
2315
|
+
body: JSON.stringify({ targets }),
|
|
2316
|
+
signal: options.signal
|
|
2317
|
+
});
|
|
2318
|
+
});
|
|
2319
|
+
}
|
|
2214
2320
|
/** List venue markets with optional filters. Requires appId or admin auth. Supports cursor-based pagination. */
|
|
2215
2321
|
getVenueMarkets(options) {
|
|
2216
2322
|
return __async(this, null, function* () {
|
|
@@ -2550,6 +2656,18 @@ Issued At: ${issuedAt}`;
|
|
|
2550
2656
|
// src/best-split.ts
|
|
2551
2657
|
var computeBestSplitsByAmount2 = computeBestSplitsByAmount;
|
|
2552
2658
|
|
|
2659
|
+
// src/types.ts
|
|
2660
|
+
var RECURRENCE_CADENCES = [
|
|
2661
|
+
"PT5M",
|
|
2662
|
+
"PT10M",
|
|
2663
|
+
"PT15M",
|
|
2664
|
+
"PT1H",
|
|
2665
|
+
"P1D",
|
|
2666
|
+
"P1W",
|
|
2667
|
+
"P1M",
|
|
2668
|
+
"P1Y"
|
|
2669
|
+
];
|
|
2670
|
+
|
|
2553
2671
|
// src/errors.ts
|
|
2554
2672
|
var TurnstileChallengeError = class extends Error {
|
|
2555
2673
|
constructor(siteKey) {
|
|
@@ -2761,6 +2879,9 @@ export {
|
|
|
2761
2879
|
MatchStatus,
|
|
2762
2880
|
MatchType,
|
|
2763
2881
|
OrderStatus,
|
|
2882
|
+
OrderType,
|
|
2883
|
+
RECURRENCE_CADENCES,
|
|
2884
|
+
TimeInForce,
|
|
2764
2885
|
TradeSide,
|
|
2765
2886
|
TurnstileChallengeError,
|
|
2766
2887
|
VENUES,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agg-build/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Vanilla TypeScript client for the AGG prediction market aggregator (auth, markets, orderbooks, charts, trading, managed execution, WebSockets). Works in browsers, Node.js, and React Native.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|