@agg-build/sdk 2.5.0 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +143 -97
- package/dist/index.d.ts +143 -97
- package/dist/index.js +83 -5
- package/dist/index.mjs +82 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -27,10 +27,19 @@ declare function isVenueActive(venue: string): boolean;
|
|
|
27
27
|
/** Whether a venue is intentionally retained only for wind-down/history flows. */
|
|
28
28
|
declare function isVenueInactive(venue: string): boolean;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
30
|
+
* Data-plane visibility (listings/search/orderbook DISPLAY). Distinct from
|
|
31
|
+
* {@link isVenueActive} (execution/routing) — this predicate never affects
|
|
32
|
+
* whether a venue can trade. `dataVisibleOverride` un-hides specific venues
|
|
33
|
+
* for DATA surfaces only; callers pass an env-derived list.
|
|
32
34
|
*/
|
|
33
|
-
declare function
|
|
35
|
+
declare function isVenueDataVisible(venue: string, dataVisibleOverride?: readonly Venue[]): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Merge app-specific disabled venues with the compile-time retired set, then
|
|
38
|
+
* remove any venue explicitly opted into data visibility via
|
|
39
|
+
* `dataVisibleVenues` (see {@link isVenueDataVisible}). Results use the
|
|
40
|
+
* canonical {@link VENUES} order and ignore unknown values.
|
|
41
|
+
*/
|
|
42
|
+
declare function getEffectiveDisabledVenues(disabledVenues?: readonly (Venue | string)[], dataVisibleVenues?: readonly Venue[]): Venue[];
|
|
34
43
|
|
|
35
44
|
declare enum ImageSize {
|
|
36
45
|
sm = 44,
|
|
@@ -222,6 +231,12 @@ type VenueKeySummary = {
|
|
|
222
231
|
updatedAt: string;
|
|
223
232
|
venue: Venue;
|
|
224
233
|
};
|
|
234
|
+
type VenueKeyStatus = {
|
|
235
|
+
venue: Venue;
|
|
236
|
+
connected: boolean;
|
|
237
|
+
validatedAt: string | null;
|
|
238
|
+
kycStatus: string;
|
|
239
|
+
};
|
|
225
240
|
type TradeSplit = {
|
|
226
241
|
venue: Venue;
|
|
227
242
|
venueMarketOutcomeId: string;
|
|
@@ -482,6 +497,12 @@ type UnifiedBalanceResponse = {
|
|
|
482
497
|
unrealizedPnl: number;
|
|
483
498
|
realizedPnl: number;
|
|
484
499
|
}[];
|
|
500
|
+
venueCash?: {
|
|
501
|
+
venue: Venue;
|
|
502
|
+
balanceCents: number;
|
|
503
|
+
portfolioValueCents?: number | undefined;
|
|
504
|
+
updatedAt: string;
|
|
505
|
+
}[];
|
|
485
506
|
};
|
|
486
507
|
type UserHolding = {
|
|
487
508
|
venue: Venue;
|
|
@@ -542,6 +563,20 @@ type OrderListItem = {
|
|
|
542
563
|
venue: Venue;
|
|
543
564
|
side: string;
|
|
544
565
|
amountRaw: string;
|
|
566
|
+
orderType?: "market" | "limit" | undefined;
|
|
567
|
+
limitPriceRaw: string | null;
|
|
568
|
+
limitSizeRaw?: string | null | undefined;
|
|
569
|
+
timeInForce: TimeInForce | null;
|
|
570
|
+
postOnly?: boolean | undefined;
|
|
571
|
+
expiresAt: Date | string | null;
|
|
572
|
+
reservedCostRaw?: string | null | undefined;
|
|
573
|
+
filledSizeRaw?: string | null | undefined;
|
|
574
|
+
filledCostRaw?: string | null | undefined;
|
|
575
|
+
remainingSizeRaw?: string | null | undefined;
|
|
576
|
+
averageFillPriceRaw?: string | null | undefined;
|
|
577
|
+
venueOrderId?: string | null | undefined;
|
|
578
|
+
cancelRequestedAt?: Date | string | null | undefined;
|
|
579
|
+
cancelledAt?: Date | string | null | undefined;
|
|
545
580
|
slippageBps: number | null;
|
|
546
581
|
quotedPriceRaw: string | null;
|
|
547
582
|
quotedCostRaw: string | null;
|
|
@@ -985,7 +1020,7 @@ type ValidateManagedRequest = {
|
|
|
985
1020
|
amount: number;
|
|
986
1021
|
};
|
|
987
1022
|
type WithdrawTokenSymbol$1 = "USDC" | "USDC.e" | "USDT";
|
|
988
|
-
type WithdrawalSourceTokenSymbol$1 = WithdrawTokenSymbol$1 | "pUSD";
|
|
1023
|
+
type WithdrawalSourceTokenSymbol$1 = WithdrawTokenSymbol$1 | "pUSD" | "USD1";
|
|
989
1024
|
type WithdrawManagedRequest = {
|
|
990
1025
|
/** Positive integer string in the token's native decimals (e.g. "100000" = 0.1 USDC). */
|
|
991
1026
|
amountRaw: string;
|
|
@@ -1023,92 +1058,6 @@ type WithdrawalSource = {
|
|
|
1023
1058
|
type SyncBalancesResponse = {
|
|
1024
1059
|
synced: true;
|
|
1025
1060
|
};
|
|
1026
|
-
type MatchingReport = {
|
|
1027
|
-
summary: {
|
|
1028
|
-
events: {
|
|
1029
|
-
pending: number;
|
|
1030
|
-
total: number;
|
|
1031
|
-
unmatched: number;
|
|
1032
|
-
review: number;
|
|
1033
|
-
matched: number;
|
|
1034
|
-
verified: number;
|
|
1035
|
-
rejected: number;
|
|
1036
|
-
};
|
|
1037
|
-
markets: {
|
|
1038
|
-
pending: number;
|
|
1039
|
-
total: number;
|
|
1040
|
-
unmatched: number;
|
|
1041
|
-
review: number;
|
|
1042
|
-
matched: number;
|
|
1043
|
-
verified: number;
|
|
1044
|
-
rejected: number;
|
|
1045
|
-
};
|
|
1046
|
-
crossVenue: {
|
|
1047
|
-
events: number;
|
|
1048
|
-
markets: number;
|
|
1049
|
-
};
|
|
1050
|
-
matchTypes: {
|
|
1051
|
-
manual: number;
|
|
1052
|
-
llm: number;
|
|
1053
|
-
dome: number;
|
|
1054
|
-
};
|
|
1055
|
-
llm: {
|
|
1056
|
-
pending: number;
|
|
1057
|
-
total: number;
|
|
1058
|
-
matched: number;
|
|
1059
|
-
rejected: number;
|
|
1060
|
-
resolved: number;
|
|
1061
|
-
failed: number;
|
|
1062
|
-
avgConfidenceMatched: number | null;
|
|
1063
|
-
avgConfidenceRelated: number | null;
|
|
1064
|
-
avgConfidenceNoMatch: number | null;
|
|
1065
|
-
avgLatencyMs: number | null;
|
|
1066
|
-
};
|
|
1067
|
-
};
|
|
1068
|
-
matchDistribution: {
|
|
1069
|
-
events: {
|
|
1070
|
-
min: number;
|
|
1071
|
-
max: number;
|
|
1072
|
-
avg: number;
|
|
1073
|
-
};
|
|
1074
|
-
markets: {
|
|
1075
|
-
min: number;
|
|
1076
|
-
max: number;
|
|
1077
|
-
avg: number;
|
|
1078
|
-
};
|
|
1079
|
-
};
|
|
1080
|
-
byCategory: {
|
|
1081
|
-
total: number;
|
|
1082
|
-
unmatched: number;
|
|
1083
|
-
matched: number;
|
|
1084
|
-
categoryId: string;
|
|
1085
|
-
categoryName: string;
|
|
1086
|
-
byVenue: Record<string, number>;
|
|
1087
|
-
}[];
|
|
1088
|
-
byVenue: {
|
|
1089
|
-
venue: string;
|
|
1090
|
-
events: {
|
|
1091
|
-
total: number;
|
|
1092
|
-
matched: number;
|
|
1093
|
-
verified: number;
|
|
1094
|
-
rejected: number;
|
|
1095
|
-
};
|
|
1096
|
-
markets: {
|
|
1097
|
-
total: number;
|
|
1098
|
-
matched: number;
|
|
1099
|
-
verified: number;
|
|
1100
|
-
rejected: number;
|
|
1101
|
-
};
|
|
1102
|
-
}[];
|
|
1103
|
-
timeSeries: {
|
|
1104
|
-
date: string;
|
|
1105
|
-
matchedEvents: number;
|
|
1106
|
-
matchedMarkets: number;
|
|
1107
|
-
llmTotal: number;
|
|
1108
|
-
llmMatched: number;
|
|
1109
|
-
llmRejected: number;
|
|
1110
|
-
}[];
|
|
1111
|
-
};
|
|
1112
1061
|
|
|
1113
1062
|
/**
|
|
1114
1063
|
* API response-boundary formatters for market display fields.
|
|
@@ -1277,9 +1226,8 @@ declare const sortVenues: <T extends string>(venues: readonly T[]) => T[];
|
|
|
1277
1226
|
/**
|
|
1278
1227
|
* Build an external URL to a venue's event/market page.
|
|
1279
1228
|
*
|
|
1280
|
-
* Single source of truth — used by API services
|
|
1281
|
-
*
|
|
1282
|
-
* to the venue's UI.
|
|
1229
|
+
* Single source of truth — used by API services AND by the admin Matched
|
|
1230
|
+
* Events page to deep-link rows out to the venue's UI.
|
|
1283
1231
|
*
|
|
1284
1232
|
* Returns `null` when there isn't enough data to construct a working URL.
|
|
1285
1233
|
* Callers should hide the link button rather than render a broken href.
|
|
@@ -2581,6 +2529,29 @@ interface ExecuteManagedResponse {
|
|
|
2581
2529
|
redeemId?: string;
|
|
2582
2530
|
message?: string;
|
|
2583
2531
|
}
|
|
2532
|
+
type LimitOrderTimeInForce = "GTC" | "GTD" | "FOK" | "FAK" | "IOC" | "ALO";
|
|
2533
|
+
interface PlaceLimitOrderParams {
|
|
2534
|
+
venue: Venue;
|
|
2535
|
+
venueMarketOutcomeId: string;
|
|
2536
|
+
side: "buy" | "sell";
|
|
2537
|
+
limitPriceRaw: string;
|
|
2538
|
+
sizeRaw: string;
|
|
2539
|
+
timeInForce: LimitOrderTimeInForce;
|
|
2540
|
+
postOnly?: boolean;
|
|
2541
|
+
expiresAt?: string;
|
|
2542
|
+
clientOrderId?: string;
|
|
2543
|
+
}
|
|
2544
|
+
interface PlaceLimitOrderResponse {
|
|
2545
|
+
orderId: string;
|
|
2546
|
+
status: "pending" | "open" | "partially_filled_open" | "filled" | "cancelled" | "expired" | "failed";
|
|
2547
|
+
venue: Venue;
|
|
2548
|
+
venueOrderId?: string | null;
|
|
2549
|
+
reservedCostRaw?: string | null;
|
|
2550
|
+
limitPriceRaw: string;
|
|
2551
|
+
limitSizeRaw: string;
|
|
2552
|
+
filledSizeRaw: string;
|
|
2553
|
+
remainingSizeRaw: string;
|
|
2554
|
+
}
|
|
2584
2555
|
interface ValidateManagedParams {
|
|
2585
2556
|
venueMarketOutcomeIds: string[];
|
|
2586
2557
|
side: "buy" | "sell";
|
|
@@ -2593,8 +2564,65 @@ interface ValidateManagedResponse {
|
|
|
2593
2564
|
bridgeSourceChainId?: number;
|
|
2594
2565
|
bridgeAmountRaw?: string;
|
|
2595
2566
|
}
|
|
2567
|
+
type BalanceRefillPolicyStatus = "enabled" | "paused";
|
|
2568
|
+
type BalanceRefillAttemptStatus = "reserved" | "executing" | "completed" | "failed";
|
|
2569
|
+
interface BalanceRefillAttempt {
|
|
2570
|
+
id: string;
|
|
2571
|
+
policyId: string;
|
|
2572
|
+
status: BalanceRefillAttemptStatus;
|
|
2573
|
+
/** Target-chain balance when the threshold was crossed, in 6-decimal USD units. */
|
|
2574
|
+
triggerBalanceRaw: string;
|
|
2575
|
+
/** Minimum amount the refill must deliver, in 6-decimal USD units. */
|
|
2576
|
+
requestedDeliveryRaw: string;
|
|
2577
|
+
/** Reserved source amount, in 6-decimal USD units. */
|
|
2578
|
+
sourceAmountRaw: string;
|
|
2579
|
+
completedAmountRaw: string | null;
|
|
2580
|
+
sourceChainId: number;
|
|
2581
|
+
targetChainId: number;
|
|
2582
|
+
feeRaw: string | null;
|
|
2583
|
+
errorMessage: string | null;
|
|
2584
|
+
startedAt: string | null;
|
|
2585
|
+
completedAt: string | null;
|
|
2586
|
+
createdAt: string;
|
|
2587
|
+
}
|
|
2588
|
+
interface BalanceRefillPolicy {
|
|
2589
|
+
id: string;
|
|
2590
|
+
targetChainId: number;
|
|
2591
|
+
targetTokenAddress: string;
|
|
2592
|
+
targetTokenSymbol: "USDC";
|
|
2593
|
+
/** Balance floor, in 6-decimal USD units. */
|
|
2594
|
+
minimumRaw: string;
|
|
2595
|
+
/** Minimum delivered amount per refill, in 6-decimal USD units. */
|
|
2596
|
+
refillAmountRaw: string;
|
|
2597
|
+
dailyCapRaw: string;
|
|
2598
|
+
maxFeeRaw: string;
|
|
2599
|
+
status: BalanceRefillPolicyStatus;
|
|
2600
|
+
cooldownSeconds: number;
|
|
2601
|
+
lastObservedRaw: string | null;
|
|
2602
|
+
lastEvaluatedAt: string | null;
|
|
2603
|
+
nextEligibleAt: string | null;
|
|
2604
|
+
consentedAt: string;
|
|
2605
|
+
createdAt: string;
|
|
2606
|
+
updatedAt: string;
|
|
2607
|
+
latestAttempt: BalanceRefillAttempt | null;
|
|
2608
|
+
}
|
|
2609
|
+
interface CreateBalanceRefillPolicyParams {
|
|
2610
|
+
targetChainId: number;
|
|
2611
|
+
targetTokenSymbol?: "USDC";
|
|
2612
|
+
minimumRaw: string;
|
|
2613
|
+
refillAmountRaw: string;
|
|
2614
|
+
dailyCapRaw: string;
|
|
2615
|
+
maxFeeRaw: string;
|
|
2616
|
+
}
|
|
2617
|
+
interface UpdateBalanceRefillPolicyParams {
|
|
2618
|
+
minimumRaw?: string;
|
|
2619
|
+
refillAmountRaw?: string;
|
|
2620
|
+
dailyCapRaw?: string;
|
|
2621
|
+
maxFeeRaw?: string;
|
|
2622
|
+
status?: BalanceRefillPolicyStatus;
|
|
2623
|
+
}
|
|
2596
2624
|
type WithdrawTokenSymbol = "USDC" | "USDC.e" | "USDT";
|
|
2597
|
-
type WithdrawalSourceTokenSymbol = WithdrawTokenSymbol | "pUSD";
|
|
2625
|
+
type WithdrawalSourceTokenSymbol = WithdrawTokenSymbol | "pUSD" | "USD1";
|
|
2598
2626
|
interface WithdrawManagedParams {
|
|
2599
2627
|
/** Positive integer string in the token's native decimals (e.g. "100000" = 0.1 USDC). */
|
|
2600
2628
|
amountRaw: string;
|
|
@@ -3365,9 +3393,9 @@ interface SmartRouteResponse {
|
|
|
3365
3393
|
side?: SmartRouteSide;
|
|
3366
3394
|
}
|
|
3367
3395
|
interface CancelManagedExecutionResponse {
|
|
3368
|
-
quoteId: string;
|
|
3396
|
+
quoteId: string | null;
|
|
3369
3397
|
orderIds: string[];
|
|
3370
|
-
status: "cancelled";
|
|
3398
|
+
status: "cancelled" | "cancel_pending";
|
|
3371
3399
|
}
|
|
3372
3400
|
type PositionRedeemStatus = "eligible" | "pending" | "redeemed" | "ineligible";
|
|
3373
3401
|
type RedeemLegStatus = "submitted" | "confirmed" | "ineligible" | "rejected";
|
|
@@ -3803,6 +3831,14 @@ declare class AggClient {
|
|
|
3803
3831
|
getExecutionPositions(params?: ExecutionPositionsQuery): Promise<PaginatedResponse<ExecutionPositionGroup>>;
|
|
3804
3832
|
/** Get managed wallet balances, including per-chain cash balances and per-venue position balances. */
|
|
3805
3833
|
getManagedBalances(params?: ManagedBalancesParams): Promise<UnifiedBalanceResponse>;
|
|
3834
|
+
/** Store or replace encrypted credentials for a venue. Secrets are never returned. */
|
|
3835
|
+
upsertVenueKey(body: UpsertVenueKey): Promise<VenueKeySummary>;
|
|
3836
|
+
/** List venues with stored credentials. */
|
|
3837
|
+
listVenueKeys(): Promise<VenueKeySummary[]>;
|
|
3838
|
+
/** Fetch connection and verification status for stored venue credentials. */
|
|
3839
|
+
getVenueKeyStatus(venue: Venue): Promise<VenueKeyStatus>;
|
|
3840
|
+
/** Remove stored credentials for a venue. */
|
|
3841
|
+
deleteVenueKey(venue: Venue): Promise<void>;
|
|
3806
3842
|
/** Create a server-managed paper trading account for an app. Requires adminKey or apiKey. */
|
|
3807
3843
|
createPaperTradingAccount(params: CreatePaperTradingAccountParams, options?: PaperTradingAppOptions): Promise<PaperTradingAccount>;
|
|
3808
3844
|
/** List server-managed paper trading accounts for an app. Requires adminKey or apiKey. */
|
|
@@ -4010,8 +4046,18 @@ declare class AggClient {
|
|
|
4010
4046
|
quoteManaged(params: QuoteManagedParams): Promise<QuoteManagedResponse>;
|
|
4011
4047
|
/** Execute a previously quoted managed trade. Returns pending order IDs. */
|
|
4012
4048
|
executeManaged(params: ExecuteManagedParams): Promise<ExecuteManagedResponse>;
|
|
4049
|
+
/** Place a managed limit order. Returns the venue-backed order state. */
|
|
4050
|
+
placeLimitOrder(params: PlaceLimitOrderParams): Promise<PlaceLimitOrderResponse>;
|
|
4013
4051
|
/** Redeem resolved winning positions by venue market outcome ids. */
|
|
4014
4052
|
redeem(body: RedeemRequest): Promise<RedeemResponse>;
|
|
4053
|
+
/** List the authenticated user's managed balance refill policies. */
|
|
4054
|
+
getBalanceRefillPolicies(): Promise<BalanceRefillPolicy[]>;
|
|
4055
|
+
/** Create a managed-USDC refill policy for a target chain. */
|
|
4056
|
+
createBalanceRefillPolicy(params: CreateBalanceRefillPolicyParams): Promise<BalanceRefillPolicy>;
|
|
4057
|
+
/** Update thresholds or pause/resume an existing balance refill policy. */
|
|
4058
|
+
updateBalanceRefillPolicy(policyId: string, params: UpdateBalanceRefillPolicyParams): Promise<BalanceRefillPolicy>;
|
|
4059
|
+
/** Return the 25 most recent attempts for a refill policy. */
|
|
4060
|
+
getBalanceRefillAttempts(policyId: string): Promise<BalanceRefillAttempt[]>;
|
|
4015
4061
|
/** Withdraw funds from managed wallets to an external address. */
|
|
4016
4062
|
withdrawManaged(params: WithdrawManagedParams): Promise<WithdrawManagedResponse>;
|
|
4017
4063
|
/**
|
|
@@ -4134,4 +4180,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
|
|
|
4134
4180
|
|
|
4135
4181
|
declare function createAggClient(options: AggClientOptions): AggClient;
|
|
4136
4182
|
|
|
4137
|
-
export { ACTIVE_VENUES, type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BookQuality, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionDagProgress, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionOverallState, type ExecutionPositionGroup, type ExecutionPositionsQuery, type ExecutionStatusOrder, type ExecutionStatusQuery, type ExecutionStatusResponse, type ExecutionStatusStep, type GetBalanceQuery, type GetBalanceResponse, type GetCryptoReferencePricesOptions, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, INACTIVE_VENUES, ImageSize, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type
|
|
4183
|
+
export { ACTIVE_VENUES, type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BalanceRefillAttempt, type BalanceRefillAttemptStatus, type BalanceRefillPolicy, type BalanceRefillPolicyStatus, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BookQuality, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type CreateBalanceRefillPolicyParams, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionDagProgress, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionOverallState, type ExecutionPositionGroup, type ExecutionPositionsQuery, type ExecutionStatusOrder, type ExecutionStatusQuery, type ExecutionStatusResponse, type ExecutionStatusStep, type GetBalanceQuery, type GetBalanceResponse, type GetCryptoReferencePricesOptions, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, INACTIVE_VENUES, ImageSize, type LimitOrderTimeInForce, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type MidpointItem, type MidpointRow, type NewsFeedArticleFeedItem, type NewsFeedArticleFeedResponse, type NewsFeedArticleWithSummary, type NewsFeedLinkedMarket, type NewsFeedListResponse, type NewsFeedMarketFeedArticle, type NewsFeedMarketFeedItem, type NewsFeedMarketFeedResponse, type NewsFeedMarketNewsParams, type NewsFeedMarketNewsResponse, type NewsFeedMarketNewsResult, type NewsFeedPageOptions, type NewsFeedStatusResponse, type NonceResponse, type OrderListItem, type OrderListQuery, OrderStatus, OrderType, type Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, type OrderbookHistoryPoint, type OrderbookHistoryResponse, type OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, type OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PaperTradingAccount, type PaperTradingAccountsPage, type PaperTradingAppOptions, type PaperTradingBalanceAdjustment, type PaperTradingBalanceResponse, type PaperTradingLiquidityStatus, type PaperTradingListParams, type PaperTradingMarkSource, type PaperTradingOrder, type PaperTradingOrdersPage, type PaperTradingPortfolio, type PaperTradingPosition, type PaperTradingPositionsPage, type PersistedAuthSnapshot, type PlaceLimitOrderParams, type PlaceLimitOrderResponse, type PlacePaperTradingOrderParams, type PositionGroup, type PositionRedeemStatus, type PricePoint, type PriceSource, type PricesHistoryResponse, type QuoteManagedParams, type QuoteManagedRequest, type QuoteManagedResponse, type QuoteManagedSplit, type QuoteManagedStep, type QuoteSplit, type QuoteStep, RECURRENCE_CADENCES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOrderbookDepthLevel, type RecurringCryptoOrderbookDepthSide, type RecurringCryptoOutcome, type RecurringCryptoOutcomeOrderbookDepth, type RecurringCryptoPriceComparison, type RecurringCryptoReferencePrice, type RecurringCryptoResolution, type RecurringCryptoSourceConfidence, type RecurringCryptoVenueMarket, type RecurringCryptoWindowComparisons, type RecurringCryptoWindowMarket, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RequestedOrderbookMarket, type ResetPaperTradingAccountParams, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type RpcTokenResponse, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SetPaperTradingBalanceParams, type SettlementDiff, type SettlementDifference, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSettlementLeg, type SmartRouteSettlementPlan, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SyncBalancesResponse, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateBalanceRefillPolicyParams, type UpdateUserBody, type UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, type UserHolding, type UserProfile, VENUES, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueKeyStatus, type VenueKeySummary, type VenueMarket, type VenueMarketClusterNode, type VenueMarketListItem, type VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, type VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, type VerifyBody, type VerifyResponse, type WalletChainBalance, type WalletTokenBalance, type WithdrawManagedParams, type WithdrawManagedRequest, type WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawPreviewParams, type WithdrawPreviewResponse, type WithdrawTokenSymbol, type WithdrawalExpected, type WithdrawalLeg, type WithdrawalLegStatus, type WithdrawalLegType, type WithdrawalLifecycleStatus, type WithdrawalQuoteParams, type WithdrawalQuoteResponse, type WithdrawalSource, type WithdrawalSourceItem, type WithdrawalSourceStatus, type WithdrawalSourceTokenSymbol, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsClientMessage, type WsConnected, type WsError, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsServerMessage, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isVenueActive, isVenueDataVisible, isVenueInactive, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
|
package/dist/index.d.ts
CHANGED
|
@@ -27,10 +27,19 @@ declare function isVenueActive(venue: string): boolean;
|
|
|
27
27
|
/** Whether a venue is intentionally retained only for wind-down/history flows. */
|
|
28
28
|
declare function isVenueInactive(venue: string): boolean;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
30
|
+
* Data-plane visibility (listings/search/orderbook DISPLAY). Distinct from
|
|
31
|
+
* {@link isVenueActive} (execution/routing) — this predicate never affects
|
|
32
|
+
* whether a venue can trade. `dataVisibleOverride` un-hides specific venues
|
|
33
|
+
* for DATA surfaces only; callers pass an env-derived list.
|
|
32
34
|
*/
|
|
33
|
-
declare function
|
|
35
|
+
declare function isVenueDataVisible(venue: string, dataVisibleOverride?: readonly Venue[]): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Merge app-specific disabled venues with the compile-time retired set, then
|
|
38
|
+
* remove any venue explicitly opted into data visibility via
|
|
39
|
+
* `dataVisibleVenues` (see {@link isVenueDataVisible}). Results use the
|
|
40
|
+
* canonical {@link VENUES} order and ignore unknown values.
|
|
41
|
+
*/
|
|
42
|
+
declare function getEffectiveDisabledVenues(disabledVenues?: readonly (Venue | string)[], dataVisibleVenues?: readonly Venue[]): Venue[];
|
|
34
43
|
|
|
35
44
|
declare enum ImageSize {
|
|
36
45
|
sm = 44,
|
|
@@ -222,6 +231,12 @@ type VenueKeySummary = {
|
|
|
222
231
|
updatedAt: string;
|
|
223
232
|
venue: Venue;
|
|
224
233
|
};
|
|
234
|
+
type VenueKeyStatus = {
|
|
235
|
+
venue: Venue;
|
|
236
|
+
connected: boolean;
|
|
237
|
+
validatedAt: string | null;
|
|
238
|
+
kycStatus: string;
|
|
239
|
+
};
|
|
225
240
|
type TradeSplit = {
|
|
226
241
|
venue: Venue;
|
|
227
242
|
venueMarketOutcomeId: string;
|
|
@@ -482,6 +497,12 @@ type UnifiedBalanceResponse = {
|
|
|
482
497
|
unrealizedPnl: number;
|
|
483
498
|
realizedPnl: number;
|
|
484
499
|
}[];
|
|
500
|
+
venueCash?: {
|
|
501
|
+
venue: Venue;
|
|
502
|
+
balanceCents: number;
|
|
503
|
+
portfolioValueCents?: number | undefined;
|
|
504
|
+
updatedAt: string;
|
|
505
|
+
}[];
|
|
485
506
|
};
|
|
486
507
|
type UserHolding = {
|
|
487
508
|
venue: Venue;
|
|
@@ -542,6 +563,20 @@ type OrderListItem = {
|
|
|
542
563
|
venue: Venue;
|
|
543
564
|
side: string;
|
|
544
565
|
amountRaw: string;
|
|
566
|
+
orderType?: "market" | "limit" | undefined;
|
|
567
|
+
limitPriceRaw: string | null;
|
|
568
|
+
limitSizeRaw?: string | null | undefined;
|
|
569
|
+
timeInForce: TimeInForce | null;
|
|
570
|
+
postOnly?: boolean | undefined;
|
|
571
|
+
expiresAt: Date | string | null;
|
|
572
|
+
reservedCostRaw?: string | null | undefined;
|
|
573
|
+
filledSizeRaw?: string | null | undefined;
|
|
574
|
+
filledCostRaw?: string | null | undefined;
|
|
575
|
+
remainingSizeRaw?: string | null | undefined;
|
|
576
|
+
averageFillPriceRaw?: string | null | undefined;
|
|
577
|
+
venueOrderId?: string | null | undefined;
|
|
578
|
+
cancelRequestedAt?: Date | string | null | undefined;
|
|
579
|
+
cancelledAt?: Date | string | null | undefined;
|
|
545
580
|
slippageBps: number | null;
|
|
546
581
|
quotedPriceRaw: string | null;
|
|
547
582
|
quotedCostRaw: string | null;
|
|
@@ -985,7 +1020,7 @@ type ValidateManagedRequest = {
|
|
|
985
1020
|
amount: number;
|
|
986
1021
|
};
|
|
987
1022
|
type WithdrawTokenSymbol$1 = "USDC" | "USDC.e" | "USDT";
|
|
988
|
-
type WithdrawalSourceTokenSymbol$1 = WithdrawTokenSymbol$1 | "pUSD";
|
|
1023
|
+
type WithdrawalSourceTokenSymbol$1 = WithdrawTokenSymbol$1 | "pUSD" | "USD1";
|
|
989
1024
|
type WithdrawManagedRequest = {
|
|
990
1025
|
/** Positive integer string in the token's native decimals (e.g. "100000" = 0.1 USDC). */
|
|
991
1026
|
amountRaw: string;
|
|
@@ -1023,92 +1058,6 @@ type WithdrawalSource = {
|
|
|
1023
1058
|
type SyncBalancesResponse = {
|
|
1024
1059
|
synced: true;
|
|
1025
1060
|
};
|
|
1026
|
-
type MatchingReport = {
|
|
1027
|
-
summary: {
|
|
1028
|
-
events: {
|
|
1029
|
-
pending: number;
|
|
1030
|
-
total: number;
|
|
1031
|
-
unmatched: number;
|
|
1032
|
-
review: number;
|
|
1033
|
-
matched: number;
|
|
1034
|
-
verified: number;
|
|
1035
|
-
rejected: number;
|
|
1036
|
-
};
|
|
1037
|
-
markets: {
|
|
1038
|
-
pending: number;
|
|
1039
|
-
total: number;
|
|
1040
|
-
unmatched: number;
|
|
1041
|
-
review: number;
|
|
1042
|
-
matched: number;
|
|
1043
|
-
verified: number;
|
|
1044
|
-
rejected: number;
|
|
1045
|
-
};
|
|
1046
|
-
crossVenue: {
|
|
1047
|
-
events: number;
|
|
1048
|
-
markets: number;
|
|
1049
|
-
};
|
|
1050
|
-
matchTypes: {
|
|
1051
|
-
manual: number;
|
|
1052
|
-
llm: number;
|
|
1053
|
-
dome: number;
|
|
1054
|
-
};
|
|
1055
|
-
llm: {
|
|
1056
|
-
pending: number;
|
|
1057
|
-
total: number;
|
|
1058
|
-
matched: number;
|
|
1059
|
-
rejected: number;
|
|
1060
|
-
resolved: number;
|
|
1061
|
-
failed: number;
|
|
1062
|
-
avgConfidenceMatched: number | null;
|
|
1063
|
-
avgConfidenceRelated: number | null;
|
|
1064
|
-
avgConfidenceNoMatch: number | null;
|
|
1065
|
-
avgLatencyMs: number | null;
|
|
1066
|
-
};
|
|
1067
|
-
};
|
|
1068
|
-
matchDistribution: {
|
|
1069
|
-
events: {
|
|
1070
|
-
min: number;
|
|
1071
|
-
max: number;
|
|
1072
|
-
avg: number;
|
|
1073
|
-
};
|
|
1074
|
-
markets: {
|
|
1075
|
-
min: number;
|
|
1076
|
-
max: number;
|
|
1077
|
-
avg: number;
|
|
1078
|
-
};
|
|
1079
|
-
};
|
|
1080
|
-
byCategory: {
|
|
1081
|
-
total: number;
|
|
1082
|
-
unmatched: number;
|
|
1083
|
-
matched: number;
|
|
1084
|
-
categoryId: string;
|
|
1085
|
-
categoryName: string;
|
|
1086
|
-
byVenue: Record<string, number>;
|
|
1087
|
-
}[];
|
|
1088
|
-
byVenue: {
|
|
1089
|
-
venue: string;
|
|
1090
|
-
events: {
|
|
1091
|
-
total: number;
|
|
1092
|
-
matched: number;
|
|
1093
|
-
verified: number;
|
|
1094
|
-
rejected: number;
|
|
1095
|
-
};
|
|
1096
|
-
markets: {
|
|
1097
|
-
total: number;
|
|
1098
|
-
matched: number;
|
|
1099
|
-
verified: number;
|
|
1100
|
-
rejected: number;
|
|
1101
|
-
};
|
|
1102
|
-
}[];
|
|
1103
|
-
timeSeries: {
|
|
1104
|
-
date: string;
|
|
1105
|
-
matchedEvents: number;
|
|
1106
|
-
matchedMarkets: number;
|
|
1107
|
-
llmTotal: number;
|
|
1108
|
-
llmMatched: number;
|
|
1109
|
-
llmRejected: number;
|
|
1110
|
-
}[];
|
|
1111
|
-
};
|
|
1112
1061
|
|
|
1113
1062
|
/**
|
|
1114
1063
|
* API response-boundary formatters for market display fields.
|
|
@@ -1277,9 +1226,8 @@ declare const sortVenues: <T extends string>(venues: readonly T[]) => T[];
|
|
|
1277
1226
|
/**
|
|
1278
1227
|
* Build an external URL to a venue's event/market page.
|
|
1279
1228
|
*
|
|
1280
|
-
* Single source of truth — used by API services
|
|
1281
|
-
*
|
|
1282
|
-
* to the venue's UI.
|
|
1229
|
+
* Single source of truth — used by API services AND by the admin Matched
|
|
1230
|
+
* Events page to deep-link rows out to the venue's UI.
|
|
1283
1231
|
*
|
|
1284
1232
|
* Returns `null` when there isn't enough data to construct a working URL.
|
|
1285
1233
|
* Callers should hide the link button rather than render a broken href.
|
|
@@ -2581,6 +2529,29 @@ interface ExecuteManagedResponse {
|
|
|
2581
2529
|
redeemId?: string;
|
|
2582
2530
|
message?: string;
|
|
2583
2531
|
}
|
|
2532
|
+
type LimitOrderTimeInForce = "GTC" | "GTD" | "FOK" | "FAK" | "IOC" | "ALO";
|
|
2533
|
+
interface PlaceLimitOrderParams {
|
|
2534
|
+
venue: Venue;
|
|
2535
|
+
venueMarketOutcomeId: string;
|
|
2536
|
+
side: "buy" | "sell";
|
|
2537
|
+
limitPriceRaw: string;
|
|
2538
|
+
sizeRaw: string;
|
|
2539
|
+
timeInForce: LimitOrderTimeInForce;
|
|
2540
|
+
postOnly?: boolean;
|
|
2541
|
+
expiresAt?: string;
|
|
2542
|
+
clientOrderId?: string;
|
|
2543
|
+
}
|
|
2544
|
+
interface PlaceLimitOrderResponse {
|
|
2545
|
+
orderId: string;
|
|
2546
|
+
status: "pending" | "open" | "partially_filled_open" | "filled" | "cancelled" | "expired" | "failed";
|
|
2547
|
+
venue: Venue;
|
|
2548
|
+
venueOrderId?: string | null;
|
|
2549
|
+
reservedCostRaw?: string | null;
|
|
2550
|
+
limitPriceRaw: string;
|
|
2551
|
+
limitSizeRaw: string;
|
|
2552
|
+
filledSizeRaw: string;
|
|
2553
|
+
remainingSizeRaw: string;
|
|
2554
|
+
}
|
|
2584
2555
|
interface ValidateManagedParams {
|
|
2585
2556
|
venueMarketOutcomeIds: string[];
|
|
2586
2557
|
side: "buy" | "sell";
|
|
@@ -2593,8 +2564,65 @@ interface ValidateManagedResponse {
|
|
|
2593
2564
|
bridgeSourceChainId?: number;
|
|
2594
2565
|
bridgeAmountRaw?: string;
|
|
2595
2566
|
}
|
|
2567
|
+
type BalanceRefillPolicyStatus = "enabled" | "paused";
|
|
2568
|
+
type BalanceRefillAttemptStatus = "reserved" | "executing" | "completed" | "failed";
|
|
2569
|
+
interface BalanceRefillAttempt {
|
|
2570
|
+
id: string;
|
|
2571
|
+
policyId: string;
|
|
2572
|
+
status: BalanceRefillAttemptStatus;
|
|
2573
|
+
/** Target-chain balance when the threshold was crossed, in 6-decimal USD units. */
|
|
2574
|
+
triggerBalanceRaw: string;
|
|
2575
|
+
/** Minimum amount the refill must deliver, in 6-decimal USD units. */
|
|
2576
|
+
requestedDeliveryRaw: string;
|
|
2577
|
+
/** Reserved source amount, in 6-decimal USD units. */
|
|
2578
|
+
sourceAmountRaw: string;
|
|
2579
|
+
completedAmountRaw: string | null;
|
|
2580
|
+
sourceChainId: number;
|
|
2581
|
+
targetChainId: number;
|
|
2582
|
+
feeRaw: string | null;
|
|
2583
|
+
errorMessage: string | null;
|
|
2584
|
+
startedAt: string | null;
|
|
2585
|
+
completedAt: string | null;
|
|
2586
|
+
createdAt: string;
|
|
2587
|
+
}
|
|
2588
|
+
interface BalanceRefillPolicy {
|
|
2589
|
+
id: string;
|
|
2590
|
+
targetChainId: number;
|
|
2591
|
+
targetTokenAddress: string;
|
|
2592
|
+
targetTokenSymbol: "USDC";
|
|
2593
|
+
/** Balance floor, in 6-decimal USD units. */
|
|
2594
|
+
minimumRaw: string;
|
|
2595
|
+
/** Minimum delivered amount per refill, in 6-decimal USD units. */
|
|
2596
|
+
refillAmountRaw: string;
|
|
2597
|
+
dailyCapRaw: string;
|
|
2598
|
+
maxFeeRaw: string;
|
|
2599
|
+
status: BalanceRefillPolicyStatus;
|
|
2600
|
+
cooldownSeconds: number;
|
|
2601
|
+
lastObservedRaw: string | null;
|
|
2602
|
+
lastEvaluatedAt: string | null;
|
|
2603
|
+
nextEligibleAt: string | null;
|
|
2604
|
+
consentedAt: string;
|
|
2605
|
+
createdAt: string;
|
|
2606
|
+
updatedAt: string;
|
|
2607
|
+
latestAttempt: BalanceRefillAttempt | null;
|
|
2608
|
+
}
|
|
2609
|
+
interface CreateBalanceRefillPolicyParams {
|
|
2610
|
+
targetChainId: number;
|
|
2611
|
+
targetTokenSymbol?: "USDC";
|
|
2612
|
+
minimumRaw: string;
|
|
2613
|
+
refillAmountRaw: string;
|
|
2614
|
+
dailyCapRaw: string;
|
|
2615
|
+
maxFeeRaw: string;
|
|
2616
|
+
}
|
|
2617
|
+
interface UpdateBalanceRefillPolicyParams {
|
|
2618
|
+
minimumRaw?: string;
|
|
2619
|
+
refillAmountRaw?: string;
|
|
2620
|
+
dailyCapRaw?: string;
|
|
2621
|
+
maxFeeRaw?: string;
|
|
2622
|
+
status?: BalanceRefillPolicyStatus;
|
|
2623
|
+
}
|
|
2596
2624
|
type WithdrawTokenSymbol = "USDC" | "USDC.e" | "USDT";
|
|
2597
|
-
type WithdrawalSourceTokenSymbol = WithdrawTokenSymbol | "pUSD";
|
|
2625
|
+
type WithdrawalSourceTokenSymbol = WithdrawTokenSymbol | "pUSD" | "USD1";
|
|
2598
2626
|
interface WithdrawManagedParams {
|
|
2599
2627
|
/** Positive integer string in the token's native decimals (e.g. "100000" = 0.1 USDC). */
|
|
2600
2628
|
amountRaw: string;
|
|
@@ -3365,9 +3393,9 @@ interface SmartRouteResponse {
|
|
|
3365
3393
|
side?: SmartRouteSide;
|
|
3366
3394
|
}
|
|
3367
3395
|
interface CancelManagedExecutionResponse {
|
|
3368
|
-
quoteId: string;
|
|
3396
|
+
quoteId: string | null;
|
|
3369
3397
|
orderIds: string[];
|
|
3370
|
-
status: "cancelled";
|
|
3398
|
+
status: "cancelled" | "cancel_pending";
|
|
3371
3399
|
}
|
|
3372
3400
|
type PositionRedeemStatus = "eligible" | "pending" | "redeemed" | "ineligible";
|
|
3373
3401
|
type RedeemLegStatus = "submitted" | "confirmed" | "ineligible" | "rejected";
|
|
@@ -3803,6 +3831,14 @@ declare class AggClient {
|
|
|
3803
3831
|
getExecutionPositions(params?: ExecutionPositionsQuery): Promise<PaginatedResponse<ExecutionPositionGroup>>;
|
|
3804
3832
|
/** Get managed wallet balances, including per-chain cash balances and per-venue position balances. */
|
|
3805
3833
|
getManagedBalances(params?: ManagedBalancesParams): Promise<UnifiedBalanceResponse>;
|
|
3834
|
+
/** Store or replace encrypted credentials for a venue. Secrets are never returned. */
|
|
3835
|
+
upsertVenueKey(body: UpsertVenueKey): Promise<VenueKeySummary>;
|
|
3836
|
+
/** List venues with stored credentials. */
|
|
3837
|
+
listVenueKeys(): Promise<VenueKeySummary[]>;
|
|
3838
|
+
/** Fetch connection and verification status for stored venue credentials. */
|
|
3839
|
+
getVenueKeyStatus(venue: Venue): Promise<VenueKeyStatus>;
|
|
3840
|
+
/** Remove stored credentials for a venue. */
|
|
3841
|
+
deleteVenueKey(venue: Venue): Promise<void>;
|
|
3806
3842
|
/** Create a server-managed paper trading account for an app. Requires adminKey or apiKey. */
|
|
3807
3843
|
createPaperTradingAccount(params: CreatePaperTradingAccountParams, options?: PaperTradingAppOptions): Promise<PaperTradingAccount>;
|
|
3808
3844
|
/** List server-managed paper trading accounts for an app. Requires adminKey or apiKey. */
|
|
@@ -4010,8 +4046,18 @@ declare class AggClient {
|
|
|
4010
4046
|
quoteManaged(params: QuoteManagedParams): Promise<QuoteManagedResponse>;
|
|
4011
4047
|
/** Execute a previously quoted managed trade. Returns pending order IDs. */
|
|
4012
4048
|
executeManaged(params: ExecuteManagedParams): Promise<ExecuteManagedResponse>;
|
|
4049
|
+
/** Place a managed limit order. Returns the venue-backed order state. */
|
|
4050
|
+
placeLimitOrder(params: PlaceLimitOrderParams): Promise<PlaceLimitOrderResponse>;
|
|
4013
4051
|
/** Redeem resolved winning positions by venue market outcome ids. */
|
|
4014
4052
|
redeem(body: RedeemRequest): Promise<RedeemResponse>;
|
|
4053
|
+
/** List the authenticated user's managed balance refill policies. */
|
|
4054
|
+
getBalanceRefillPolicies(): Promise<BalanceRefillPolicy[]>;
|
|
4055
|
+
/** Create a managed-USDC refill policy for a target chain. */
|
|
4056
|
+
createBalanceRefillPolicy(params: CreateBalanceRefillPolicyParams): Promise<BalanceRefillPolicy>;
|
|
4057
|
+
/** Update thresholds or pause/resume an existing balance refill policy. */
|
|
4058
|
+
updateBalanceRefillPolicy(policyId: string, params: UpdateBalanceRefillPolicyParams): Promise<BalanceRefillPolicy>;
|
|
4059
|
+
/** Return the 25 most recent attempts for a refill policy. */
|
|
4060
|
+
getBalanceRefillAttempts(policyId: string): Promise<BalanceRefillAttempt[]>;
|
|
4015
4061
|
/** Withdraw funds from managed wallets to an external address. */
|
|
4016
4062
|
withdrawManaged(params: WithdrawManagedParams): Promise<WithdrawManagedResponse>;
|
|
4017
4063
|
/**
|
|
@@ -4134,4 +4180,4 @@ declare function aggregateMidpoint(midpoints: (number | null | undefined)[]): nu
|
|
|
4134
4180
|
|
|
4135
4181
|
declare function createAggClient(options: AggClientOptions): AggClient;
|
|
4136
4182
|
|
|
4137
|
-
export { ACTIVE_VENUES, type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BookQuality, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionDagProgress, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionOverallState, type ExecutionPositionGroup, type ExecutionPositionsQuery, type ExecutionStatusOrder, type ExecutionStatusQuery, type ExecutionStatusResponse, type ExecutionStatusStep, type GetBalanceQuery, type GetBalanceResponse, type GetCryptoReferencePricesOptions, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, INACTIVE_VENUES, ImageSize, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type
|
|
4183
|
+
export { ACTIVE_VENUES, type Account, AccountProvider, AccountType, type AggAuthDeliveryMode, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, AggClient, type AggClientAuthOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, type App, type AppClientConfigResponse, type AttributedOrderbook, type AttributedOrderbookLevel, type AuthCodeResponse, type AuthStatus, type AuthTokenResponse, type AuthUser, type BalanceRefillAttempt, type BalanceRefillAttemptStatus, type BalanceRefillPolicy, type BalanceRefillPolicyStatus, type BatchMidpointsResponse, type BatchOrderbooksResponse, type BookQuality, type BuildVenueUrlOpts, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type Candle, CandleBuilder, type CandleInterval, type Category, Chain, type ChartBarsResponse, type ChartCandle, type ChartResolution, type ChartVenueCandles, type ComputeSplitsRequest, type ComputeSplitsResponse, type ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, type CreateApp, type CreateBalanceRefillPolicyParams, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, type DepositAddressesPendingResponse, type DepositAddressesReadyResponse, type DepositAddressesResponse, type DepositAddressesSupportedChain, type DepositAddressesToken, type DepositStep, type DiagnosticCallback, type DiagnosticEvent, type ExecuteManagedParams, type ExecuteManagedRequest, type ExecuteManagedResponse, type ExecuteTradeRequest, type ExecuteTradeResponse, type ExecutionDagProgress, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionOverallState, type ExecutionPositionGroup, type ExecutionPositionsQuery, type ExecutionStatusOrder, type ExecutionStatusQuery, type ExecutionStatusResponse, type ExecutionStatusStep, type GetBalanceQuery, type GetBalanceResponse, type GetCryptoReferencePricesOptions, type GetHoldingsQuery, type GetHoldingsResponse, type GetOrdersParams, type GetOrdersQuery, type GetPositionsParams, type GetPositionsQuery, type HelloResponse, IMAGE_SIZES, INACTIVE_VENUES, ImageSize, type LimitOrderTimeInForce, type ListRecurringCryptoMarketsOptions, type ManagedBalancesParams, type MarkSource, type MarketPriceHistory, MarketStatus, MatchStatus, MatchType, type MatchedMidpoint, type MatchedMidpointOutcome, type MatchedOrderbookMarket, type MatchedVenueMarketOutcomeRef, type MidpointItem, type MidpointRow, type NewsFeedArticleFeedItem, type NewsFeedArticleFeedResponse, type NewsFeedArticleWithSummary, type NewsFeedLinkedMarket, type NewsFeedListResponse, type NewsFeedMarketFeedArticle, type NewsFeedMarketFeedItem, type NewsFeedMarketFeedResponse, type NewsFeedMarketNewsParams, type NewsFeedMarketNewsResponse, type NewsFeedMarketNewsResult, type NewsFeedPageOptions, type NewsFeedStatusResponse, type NonceResponse, type OrderListItem, type OrderListQuery, OrderStatus, OrderType, type Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, type OrderbookHistoryPoint, type OrderbookHistoryResponse, type OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, type OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PaperTradingAccount, type PaperTradingAccountsPage, type PaperTradingAppOptions, type PaperTradingBalanceAdjustment, type PaperTradingBalanceResponse, type PaperTradingLiquidityStatus, type PaperTradingListParams, type PaperTradingMarkSource, type PaperTradingOrder, type PaperTradingOrdersPage, type PaperTradingPortfolio, type PaperTradingPosition, type PaperTradingPositionsPage, type PersistedAuthSnapshot, type PlaceLimitOrderParams, type PlaceLimitOrderResponse, type PlacePaperTradingOrderParams, type PositionGroup, type PositionRedeemStatus, type PricePoint, type PriceSource, type PricesHistoryResponse, type QuoteManagedParams, type QuoteManagedRequest, type QuoteManagedResponse, type QuoteManagedSplit, type QuoteManagedStep, type QuoteSplit, type QuoteStep, RECURRENCE_CADENCES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOrderbookDepthLevel, type RecurringCryptoOrderbookDepthSide, type RecurringCryptoOutcome, type RecurringCryptoOutcomeOrderbookDepth, type RecurringCryptoPriceComparison, type RecurringCryptoReferencePrice, type RecurringCryptoResolution, type RecurringCryptoSourceConfidence, type RecurringCryptoVenueMarket, type RecurringCryptoWindowComparisons, type RecurringCryptoWindowMarket, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RequestedOrderbookMarket, type ResetPaperTradingAccountParams, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type RpcTokenResponse, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type ServerWallet, type SetPaperTradingBalanceParams, type SettlementDiff, type SettlementDifference, type SettlementSource, type SetupDepositAddressStep, type SetupVenueKeyStep, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSettlementLeg, type SmartRouteSettlementPlan, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SyncBalancesResponse, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide$1 as TradeSide, type TradeSplit, type TradeStep, TurnstileChallengeError, type UnifiedBalanceResponse, type UpdateBalanceRefillPolicyParams, type UpdateUserBody, type UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, type UserHolding, type UserProfile, VENUES, type ValidateBalanceOnClientStep, type ValidateManagedParams, type ValidateManagedRequest, type ValidateManagedResponse, type ValidateTradeRequest, type ValidateTradeResponse, Venue, type VenueEvent, type VenueEventListItem, type VenueEventWithMarkets, type VenueKeyStatus, type VenueKeySummary, type VenueMarket, type VenueMarketClusterNode, type VenueMarketListItem, type VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, type VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, type VerifyBody, type VerifyResponse, type WalletChainBalance, type WalletTokenBalance, type WithdrawManagedParams, type WithdrawManagedRequest, type WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawPreviewParams, type WithdrawPreviewResponse, type WithdrawTokenSymbol, type WithdrawalExpected, type WithdrawalLeg, type WithdrawalLegStatus, type WithdrawalLegType, type WithdrawalLifecycleStatus, type WithdrawalQuoteParams, type WithdrawalQuoteResponse, type WithdrawalSource, type WithdrawalSourceItem, type WithdrawalSourceStatus, type WithdrawalSourceTokenSymbol, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsClientMessage, type WsConnected, type WsError, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsServerMessage, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, aggregateMidpoint, applyOrderbookDelta, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isVenueActive, isVenueDataVisible, isVenueInactive, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, parse, parseEmail, parseEmailStrict, safeParse, snapshotToOrderbook, sortVenues };
|
package/dist/index.js
CHANGED
|
@@ -109,6 +109,7 @@ __export(index_exports, {
|
|
|
109
109
|
isFiniteNonNeg: () => isFiniteNonNeg,
|
|
110
110
|
isNonEmptyString: () => isNonEmptyString,
|
|
111
111
|
isVenueActive: () => isVenueActive,
|
|
112
|
+
isVenueDataVisible: () => isVenueDataVisible,
|
|
112
113
|
isVenueInactive: () => isVenueInactive,
|
|
113
114
|
mergeCandles: () => mergeCandles,
|
|
114
115
|
mergeClosedCandles: () => mergeClosedCandles,
|
|
@@ -170,10 +171,16 @@ function isVenueInactive(venue) {
|
|
|
170
171
|
if (ACTIVE_VENUE_SET.has(venue)) return false;
|
|
171
172
|
return INACTIVE_VENUE_SET.has(normalizeVenue(venue));
|
|
172
173
|
}
|
|
173
|
-
function
|
|
174
|
-
if (
|
|
174
|
+
function isVenueDataVisible(venue, dataVisibleOverride = []) {
|
|
175
|
+
if (isVenueActive(venue)) return true;
|
|
176
|
+
const n = normalizeVenue(venue);
|
|
177
|
+
return dataVisibleOverride.some((v) => normalizeVenue(v) === n);
|
|
178
|
+
}
|
|
179
|
+
function getEffectiveDisabledVenues(disabledVenues = [], dataVisibleVenues = []) {
|
|
180
|
+
if (disabledVenues.length === 0 && dataVisibleVenues.length === 0) return [...INACTIVE_VENUES];
|
|
175
181
|
const disabled = new Set(disabledVenues.map(normalizeVenue));
|
|
176
182
|
for (const venue of INACTIVE_VENUES) disabled.add(venue);
|
|
183
|
+
for (const venue of dataVisibleVenues) disabled.delete(normalizeVenue(venue));
|
|
177
184
|
return VENUES.filter((venue) => disabled.has(venue));
|
|
178
185
|
}
|
|
179
186
|
|
|
@@ -1862,6 +1869,7 @@ var AggClient = class {
|
|
|
1862
1869
|
if (!retryResponse.ok) {
|
|
1863
1870
|
return this.throwResponseError(retryResponse);
|
|
1864
1871
|
}
|
|
1872
|
+
if (retryResponse.status === 204) return void 0;
|
|
1865
1873
|
return retryResponse.json();
|
|
1866
1874
|
} catch (e) {
|
|
1867
1875
|
this.clearAccessToken();
|
|
@@ -1871,14 +1879,13 @@ var AggClient = class {
|
|
|
1871
1879
|
if (!response.ok) {
|
|
1872
1880
|
return this.throwResponseError(response);
|
|
1873
1881
|
}
|
|
1882
|
+
if (response.status === 204) return void 0;
|
|
1874
1883
|
return response.json();
|
|
1875
1884
|
});
|
|
1876
1885
|
}
|
|
1877
1886
|
rawFetch(path, init) {
|
|
1878
1887
|
return __async(this, null, function* () {
|
|
1879
|
-
const headers = {
|
|
1880
|
-
"Content-Type": "application/json"
|
|
1881
|
-
};
|
|
1888
|
+
const headers = (init == null ? void 0 : init.body) != null ? { "Content-Type": "application/json" } : {};
|
|
1882
1889
|
if (this.appId) {
|
|
1883
1890
|
headers["x-app-id"] = this.appId;
|
|
1884
1891
|
}
|
|
@@ -2400,6 +2407,33 @@ Issued At: ${issuedAt}`;
|
|
|
2400
2407
|
});
|
|
2401
2408
|
});
|
|
2402
2409
|
}
|
|
2410
|
+
/** Store or replace encrypted credentials for a venue. Secrets are never returned. */
|
|
2411
|
+
upsertVenueKey(body) {
|
|
2412
|
+
return __async(this, null, function* () {
|
|
2413
|
+
return this.request("/venue-keys", {
|
|
2414
|
+
method: "PUT",
|
|
2415
|
+
body: JSON.stringify(body)
|
|
2416
|
+
});
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
/** List venues with stored credentials. */
|
|
2420
|
+
listVenueKeys() {
|
|
2421
|
+
return __async(this, null, function* () {
|
|
2422
|
+
return this.request("/venue-keys");
|
|
2423
|
+
});
|
|
2424
|
+
}
|
|
2425
|
+
/** Fetch connection and verification status for stored venue credentials. */
|
|
2426
|
+
getVenueKeyStatus(venue) {
|
|
2427
|
+
return __async(this, null, function* () {
|
|
2428
|
+
return this.request(`/venue-keys/${encodeURIComponent(venue)}/status`);
|
|
2429
|
+
});
|
|
2430
|
+
}
|
|
2431
|
+
/** Remove stored credentials for a venue. */
|
|
2432
|
+
deleteVenueKey(venue) {
|
|
2433
|
+
return __async(this, null, function* () {
|
|
2434
|
+
yield this.request(`/venue-keys/${encodeURIComponent(venue)}`, { method: "DELETE" });
|
|
2435
|
+
});
|
|
2436
|
+
}
|
|
2403
2437
|
/** Create a server-managed paper trading account for an app. Requires adminKey or apiKey. */
|
|
2404
2438
|
createPaperTradingAccount(params, options) {
|
|
2405
2439
|
return __async(this, null, function* () {
|
|
@@ -2975,6 +3009,15 @@ Issued At: ${issuedAt}`;
|
|
|
2975
3009
|
});
|
|
2976
3010
|
});
|
|
2977
3011
|
}
|
|
3012
|
+
/** Place a managed limit order. Returns the venue-backed order state. */
|
|
3013
|
+
placeLimitOrder(params) {
|
|
3014
|
+
return __async(this, null, function* () {
|
|
3015
|
+
return this.request("/execution/limit-orders", {
|
|
3016
|
+
method: "POST",
|
|
3017
|
+
body: JSON.stringify(params)
|
|
3018
|
+
});
|
|
3019
|
+
});
|
|
3020
|
+
}
|
|
2978
3021
|
/** Redeem resolved winning positions by venue market outcome ids. */
|
|
2979
3022
|
redeem(body) {
|
|
2980
3023
|
return __async(this, null, function* () {
|
|
@@ -2984,6 +3027,40 @@ Issued At: ${issuedAt}`;
|
|
|
2984
3027
|
});
|
|
2985
3028
|
});
|
|
2986
3029
|
}
|
|
3030
|
+
/** List the authenticated user's managed balance refill policies. */
|
|
3031
|
+
getBalanceRefillPolicies() {
|
|
3032
|
+
return __async(this, null, function* () {
|
|
3033
|
+
return this.request("/execution/balance-refill-policies");
|
|
3034
|
+
});
|
|
3035
|
+
}
|
|
3036
|
+
/** Create a managed-USDC refill policy for a target chain. */
|
|
3037
|
+
createBalanceRefillPolicy(params) {
|
|
3038
|
+
return __async(this, null, function* () {
|
|
3039
|
+
return this.request("/execution/balance-refill-policies", {
|
|
3040
|
+
method: "POST",
|
|
3041
|
+
body: JSON.stringify(params)
|
|
3042
|
+
});
|
|
3043
|
+
});
|
|
3044
|
+
}
|
|
3045
|
+
/** Update thresholds or pause/resume an existing balance refill policy. */
|
|
3046
|
+
updateBalanceRefillPolicy(policyId, params) {
|
|
3047
|
+
return __async(this, null, function* () {
|
|
3048
|
+
if (!policyId) throw new Error("policyId is required");
|
|
3049
|
+
return this.request(
|
|
3050
|
+
`/execution/balance-refill-policies/${encodeURIComponent(policyId)}`,
|
|
3051
|
+
{ method: "PATCH", body: JSON.stringify(params) }
|
|
3052
|
+
);
|
|
3053
|
+
});
|
|
3054
|
+
}
|
|
3055
|
+
/** Return the 25 most recent attempts for a refill policy. */
|
|
3056
|
+
getBalanceRefillAttempts(policyId) {
|
|
3057
|
+
return __async(this, null, function* () {
|
|
3058
|
+
if (!policyId) throw new Error("policyId is required");
|
|
3059
|
+
return this.request(
|
|
3060
|
+
`/execution/balance-refill-policies/${encodeURIComponent(policyId)}/attempts`
|
|
3061
|
+
);
|
|
3062
|
+
});
|
|
3063
|
+
}
|
|
2987
3064
|
/** Withdraw funds from managed wallets to an external address. */
|
|
2988
3065
|
withdrawManaged(params) {
|
|
2989
3066
|
return __async(this, null, function* () {
|
|
@@ -3357,6 +3434,7 @@ function createAggClient(options) {
|
|
|
3357
3434
|
isFiniteNonNeg,
|
|
3358
3435
|
isNonEmptyString,
|
|
3359
3436
|
isVenueActive,
|
|
3437
|
+
isVenueDataVisible,
|
|
3360
3438
|
isVenueInactive,
|
|
3361
3439
|
mergeCandles,
|
|
3362
3440
|
mergeClosedCandles,
|
package/dist/index.mjs
CHANGED
|
@@ -52,10 +52,16 @@ function isVenueInactive(venue) {
|
|
|
52
52
|
if (ACTIVE_VENUE_SET.has(venue)) return false;
|
|
53
53
|
return INACTIVE_VENUE_SET.has(normalizeVenue(venue));
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
if (
|
|
55
|
+
function isVenueDataVisible(venue, dataVisibleOverride = []) {
|
|
56
|
+
if (isVenueActive(venue)) return true;
|
|
57
|
+
const n = normalizeVenue(venue);
|
|
58
|
+
return dataVisibleOverride.some((v) => normalizeVenue(v) === n);
|
|
59
|
+
}
|
|
60
|
+
function getEffectiveDisabledVenues(disabledVenues = [], dataVisibleVenues = []) {
|
|
61
|
+
if (disabledVenues.length === 0 && dataVisibleVenues.length === 0) return [...INACTIVE_VENUES];
|
|
57
62
|
const disabled = new Set(disabledVenues.map(normalizeVenue));
|
|
58
63
|
for (const venue of INACTIVE_VENUES) disabled.add(venue);
|
|
64
|
+
for (const venue of dataVisibleVenues) disabled.delete(normalizeVenue(venue));
|
|
59
65
|
return VENUES.filter((venue) => disabled.has(venue));
|
|
60
66
|
}
|
|
61
67
|
|
|
@@ -1744,6 +1750,7 @@ var AggClient = class {
|
|
|
1744
1750
|
if (!retryResponse.ok) {
|
|
1745
1751
|
return this.throwResponseError(retryResponse);
|
|
1746
1752
|
}
|
|
1753
|
+
if (retryResponse.status === 204) return void 0;
|
|
1747
1754
|
return retryResponse.json();
|
|
1748
1755
|
} catch (e) {
|
|
1749
1756
|
this.clearAccessToken();
|
|
@@ -1753,14 +1760,13 @@ var AggClient = class {
|
|
|
1753
1760
|
if (!response.ok) {
|
|
1754
1761
|
return this.throwResponseError(response);
|
|
1755
1762
|
}
|
|
1763
|
+
if (response.status === 204) return void 0;
|
|
1756
1764
|
return response.json();
|
|
1757
1765
|
});
|
|
1758
1766
|
}
|
|
1759
1767
|
rawFetch(path, init) {
|
|
1760
1768
|
return __async(this, null, function* () {
|
|
1761
|
-
const headers = {
|
|
1762
|
-
"Content-Type": "application/json"
|
|
1763
|
-
};
|
|
1769
|
+
const headers = (init == null ? void 0 : init.body) != null ? { "Content-Type": "application/json" } : {};
|
|
1764
1770
|
if (this.appId) {
|
|
1765
1771
|
headers["x-app-id"] = this.appId;
|
|
1766
1772
|
}
|
|
@@ -2282,6 +2288,33 @@ Issued At: ${issuedAt}`;
|
|
|
2282
2288
|
});
|
|
2283
2289
|
});
|
|
2284
2290
|
}
|
|
2291
|
+
/** Store or replace encrypted credentials for a venue. Secrets are never returned. */
|
|
2292
|
+
upsertVenueKey(body) {
|
|
2293
|
+
return __async(this, null, function* () {
|
|
2294
|
+
return this.request("/venue-keys", {
|
|
2295
|
+
method: "PUT",
|
|
2296
|
+
body: JSON.stringify(body)
|
|
2297
|
+
});
|
|
2298
|
+
});
|
|
2299
|
+
}
|
|
2300
|
+
/** List venues with stored credentials. */
|
|
2301
|
+
listVenueKeys() {
|
|
2302
|
+
return __async(this, null, function* () {
|
|
2303
|
+
return this.request("/venue-keys");
|
|
2304
|
+
});
|
|
2305
|
+
}
|
|
2306
|
+
/** Fetch connection and verification status for stored venue credentials. */
|
|
2307
|
+
getVenueKeyStatus(venue) {
|
|
2308
|
+
return __async(this, null, function* () {
|
|
2309
|
+
return this.request(`/venue-keys/${encodeURIComponent(venue)}/status`);
|
|
2310
|
+
});
|
|
2311
|
+
}
|
|
2312
|
+
/** Remove stored credentials for a venue. */
|
|
2313
|
+
deleteVenueKey(venue) {
|
|
2314
|
+
return __async(this, null, function* () {
|
|
2315
|
+
yield this.request(`/venue-keys/${encodeURIComponent(venue)}`, { method: "DELETE" });
|
|
2316
|
+
});
|
|
2317
|
+
}
|
|
2285
2318
|
/** Create a server-managed paper trading account for an app. Requires adminKey or apiKey. */
|
|
2286
2319
|
createPaperTradingAccount(params, options) {
|
|
2287
2320
|
return __async(this, null, function* () {
|
|
@@ -2857,6 +2890,15 @@ Issued At: ${issuedAt}`;
|
|
|
2857
2890
|
});
|
|
2858
2891
|
});
|
|
2859
2892
|
}
|
|
2893
|
+
/** Place a managed limit order. Returns the venue-backed order state. */
|
|
2894
|
+
placeLimitOrder(params) {
|
|
2895
|
+
return __async(this, null, function* () {
|
|
2896
|
+
return this.request("/execution/limit-orders", {
|
|
2897
|
+
method: "POST",
|
|
2898
|
+
body: JSON.stringify(params)
|
|
2899
|
+
});
|
|
2900
|
+
});
|
|
2901
|
+
}
|
|
2860
2902
|
/** Redeem resolved winning positions by venue market outcome ids. */
|
|
2861
2903
|
redeem(body) {
|
|
2862
2904
|
return __async(this, null, function* () {
|
|
@@ -2866,6 +2908,40 @@ Issued At: ${issuedAt}`;
|
|
|
2866
2908
|
});
|
|
2867
2909
|
});
|
|
2868
2910
|
}
|
|
2911
|
+
/** List the authenticated user's managed balance refill policies. */
|
|
2912
|
+
getBalanceRefillPolicies() {
|
|
2913
|
+
return __async(this, null, function* () {
|
|
2914
|
+
return this.request("/execution/balance-refill-policies");
|
|
2915
|
+
});
|
|
2916
|
+
}
|
|
2917
|
+
/** Create a managed-USDC refill policy for a target chain. */
|
|
2918
|
+
createBalanceRefillPolicy(params) {
|
|
2919
|
+
return __async(this, null, function* () {
|
|
2920
|
+
return this.request("/execution/balance-refill-policies", {
|
|
2921
|
+
method: "POST",
|
|
2922
|
+
body: JSON.stringify(params)
|
|
2923
|
+
});
|
|
2924
|
+
});
|
|
2925
|
+
}
|
|
2926
|
+
/** Update thresholds or pause/resume an existing balance refill policy. */
|
|
2927
|
+
updateBalanceRefillPolicy(policyId, params) {
|
|
2928
|
+
return __async(this, null, function* () {
|
|
2929
|
+
if (!policyId) throw new Error("policyId is required");
|
|
2930
|
+
return this.request(
|
|
2931
|
+
`/execution/balance-refill-policies/${encodeURIComponent(policyId)}`,
|
|
2932
|
+
{ method: "PATCH", body: JSON.stringify(params) }
|
|
2933
|
+
);
|
|
2934
|
+
});
|
|
2935
|
+
}
|
|
2936
|
+
/** Return the 25 most recent attempts for a refill policy. */
|
|
2937
|
+
getBalanceRefillAttempts(policyId) {
|
|
2938
|
+
return __async(this, null, function* () {
|
|
2939
|
+
if (!policyId) throw new Error("policyId is required");
|
|
2940
|
+
return this.request(
|
|
2941
|
+
`/execution/balance-refill-policies/${encodeURIComponent(policyId)}/attempts`
|
|
2942
|
+
);
|
|
2943
|
+
});
|
|
2944
|
+
}
|
|
2869
2945
|
/** Withdraw funds from managed wallets to an external address. */
|
|
2870
2946
|
withdrawManaged(params) {
|
|
2871
2947
|
return __async(this, null, function* () {
|
|
@@ -3238,6 +3314,7 @@ export {
|
|
|
3238
3314
|
isFiniteNonNeg,
|
|
3239
3315
|
isNonEmptyString,
|
|
3240
3316
|
isVenueActive,
|
|
3317
|
+
isVenueDataVisible,
|
|
3241
3318
|
isVenueInactive,
|
|
3242
3319
|
mergeCandles,
|
|
3243
3320
|
mergeClosedCandles,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agg-build/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.1",
|
|
4
4
|
"description": "Vanilla TypeScript client for the AGG prediction market aggregator (auth, markets, orderbooks, charts, trading, managed execution, WebSockets). Works in browsers, Node.js, and React Native.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|