@0xmonaco/types 1.0.25-develop.1fab96c → 1.0.26-develop.aeb6d5b
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/faucet/index.d.ts +8 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/market/index.d.ts +38 -0
- package/dist/portfolio/index.d.ts +7 -0
- package/dist/positions/index.d.ts +21 -0
- package/dist/profile/index.d.ts +38 -1
- package/dist/pulse/index.d.ts +61 -0
- package/dist/pulse/index.js +9 -0
- package/dist/sdk/index.d.ts +3 -0
- package/dist/trading/index.d.ts +0 -4
- package/dist/trading/responses.d.ts +32 -2
- package/dist/validation/profile.d.ts +1 -0
- package/dist/validation/profile.js +1 -0
- package/dist/validation/trading.d.ts +1 -0
- package/dist/validation/trading.js +17 -4
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +2 -0
- package/dist/wire/schema.d.ts +451 -17
- package/package.json +2 -2
package/dist/faucet/index.d.ts
CHANGED
|
@@ -61,14 +61,18 @@ export interface FaucetMintRecord {
|
|
|
61
61
|
*/
|
|
62
62
|
txHash?: string;
|
|
63
63
|
}
|
|
64
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Past faucet mints grouped by clock minute for display. A group can span
|
|
66
|
+
* several endpoint calls made in the same minute; the daily quota counts
|
|
67
|
+
* each call individually.
|
|
68
|
+
*/
|
|
65
69
|
export interface FaucetRequestRecord {
|
|
66
70
|
/**
|
|
67
|
-
* Timestamp (ISO 8601) of the request, truncated to the minute (
|
|
68
|
-
* quota
|
|
71
|
+
* Timestamp (ISO 8601) of the request, truncated to the minute (display
|
|
72
|
+
* grouping; the daily quota counts every call)
|
|
69
73
|
*/
|
|
70
74
|
requestedAt: string;
|
|
71
|
-
/** Tokens minted
|
|
75
|
+
/** Tokens minted in the group, oldest first */
|
|
72
76
|
minted: FaucetMintRecord[];
|
|
73
77
|
}
|
|
74
78
|
/** Result of a faucet info request. */
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/market/index.d.ts
CHANGED
|
@@ -213,6 +213,17 @@ export interface ScreenerItem {
|
|
|
213
213
|
totalQuoteVolumeLtd: string;
|
|
214
214
|
/** Life-to-date cumulative number of trades since inception (0 if no trades yet) */
|
|
215
215
|
totalTradeCountLtd: number;
|
|
216
|
+
/**
|
|
217
|
+
* Latest settled funding rate as a decimal fraction per funding window (the
|
|
218
|
+
* capped settled value); null for spot pairs and margin pairs with no
|
|
219
|
+
* settled funding window yet
|
|
220
|
+
*/
|
|
221
|
+
latestFundingRate: string | null;
|
|
222
|
+
/**
|
|
223
|
+
* Close time of the latest settled funding window (ms since epoch, as string);
|
|
224
|
+
* null for spot pairs and margin pairs with no settled funding window yet
|
|
225
|
+
*/
|
|
226
|
+
lastFundingTime: string | null;
|
|
216
227
|
}
|
|
217
228
|
/**
|
|
218
229
|
* Paginated screener response, sorted by quoteVolume24h desc (nulls last)
|
|
@@ -344,12 +355,16 @@ export interface FundingRecord {
|
|
|
344
355
|
tradingPairId: string;
|
|
345
356
|
fundingRate: string;
|
|
346
357
|
cumulativeFundingPerUnit?: string;
|
|
358
|
+
/** True when the window settled at the carried last rate (sparse-sample rule). */
|
|
359
|
+
carried?: boolean;
|
|
347
360
|
}
|
|
348
361
|
export interface ListFundingHistoryParams {
|
|
349
362
|
startTime?: string;
|
|
350
363
|
endTime?: string;
|
|
351
364
|
page?: number;
|
|
352
365
|
pageSize?: number;
|
|
366
|
+
/** Sort direction for epoch: "ASC" or "DESC" (default DESC). */
|
|
367
|
+
orderBy?: "ASC" | "DESC";
|
|
353
368
|
}
|
|
354
369
|
export interface ListFundingHistoryResponse {
|
|
355
370
|
records: FundingRecord[];
|
|
@@ -357,6 +372,20 @@ export interface ListFundingHistoryResponse {
|
|
|
357
372
|
page: number;
|
|
358
373
|
pageSize: number;
|
|
359
374
|
}
|
|
375
|
+
export interface ListAllFundingHistoryParams {
|
|
376
|
+
startTime?: string;
|
|
377
|
+
endTime?: string;
|
|
378
|
+
page?: number;
|
|
379
|
+
pageSize?: number;
|
|
380
|
+
/** Sort direction for settledAt (default DESC). */
|
|
381
|
+
orderBy?: "ASC" | "DESC";
|
|
382
|
+
}
|
|
383
|
+
export interface ListAllFundingHistoryResponse {
|
|
384
|
+
records: FundingRecord[];
|
|
385
|
+
total: number;
|
|
386
|
+
page: number;
|
|
387
|
+
pageSize: number;
|
|
388
|
+
}
|
|
360
389
|
export interface OpenInterest {
|
|
361
390
|
tradingPairId: string;
|
|
362
391
|
openInterest?: string;
|
|
@@ -431,5 +460,14 @@ export interface MarketAPI extends BaseAPI {
|
|
|
431
460
|
getIndexPrice(tradingPairId: string): Promise<IndexPrice>;
|
|
432
461
|
getFundingState(tradingPairId: string): Promise<FundingState>;
|
|
433
462
|
listFundingHistory(tradingPairId: string, params?: ListFundingHistoryParams): Promise<ListFundingHistoryResponse>;
|
|
463
|
+
/**
|
|
464
|
+
* Fetch settled funding history across every market in one call, so clients
|
|
465
|
+
* don't have to fan out one listFundingHistory request per trading pair.
|
|
466
|
+
* Each record carries its tradingPairId; sorted by settledAt (default DESC).
|
|
467
|
+
* @param params - Optional time bounds (ms-epoch strings, inclusive on
|
|
468
|
+
* settledAt), pagination, and orderBy (ASC or DESC)
|
|
469
|
+
* @returns Promise resolving to the paginated all-markets funding history
|
|
470
|
+
*/
|
|
471
|
+
listAllFundingHistory(params?: ListAllFundingHistoryParams): Promise<ListAllFundingHistoryResponse>;
|
|
434
472
|
getOpenInterest(tradingPairId: string): Promise<OpenInterest>;
|
|
435
473
|
}
|
|
@@ -77,10 +77,17 @@ export interface PortfolioRealizedTotals {
|
|
|
77
77
|
netRealizedPnl: string;
|
|
78
78
|
}
|
|
79
79
|
export interface PortfolioClosedTradeStats {
|
|
80
|
+
/** Fill-based: closing fills in the window (partial fills each counted). */
|
|
80
81
|
count: number;
|
|
82
|
+
/**
|
|
83
|
+
* Position-level: each position (one flat -> open -> flat round-trip) is
|
|
84
|
+
* classified once by its net realized PnL after all fees.
|
|
85
|
+
*/
|
|
81
86
|
winners: number;
|
|
82
87
|
losers: number;
|
|
83
88
|
breakEven: number;
|
|
89
|
+
/** Total classified positions (= winners + losers + breakEven). */
|
|
90
|
+
positions: number;
|
|
84
91
|
winRatePct?: string;
|
|
85
92
|
}
|
|
86
93
|
export interface PortfolioBestDay {
|
|
@@ -10,12 +10,23 @@ export interface Position {
|
|
|
10
10
|
marginMode?: MarginMode;
|
|
11
11
|
tradingPairId: string;
|
|
12
12
|
side: PositionSide;
|
|
13
|
+
/**
|
|
14
|
+
* Open rows: current absolute position quantity. Terminal rows
|
|
15
|
+
* (CLOSED/LIQUIDATED/EXPIRED): total quantity closed over the position's
|
|
16
|
+
* life, summed from its reducing executions when available.
|
|
17
|
+
*/
|
|
13
18
|
size: string;
|
|
14
19
|
entryPrice: string;
|
|
15
20
|
markPrice: string;
|
|
16
21
|
indexPrice?: string;
|
|
17
22
|
unrealizedPnl: string;
|
|
18
23
|
realizedPnl: string;
|
|
24
|
+
/**
|
|
25
|
+
* Open rows: current isolated collateral for this position's risk bucket.
|
|
26
|
+
* Terminal rows: total initial margin allocated across the position's
|
|
27
|
+
* reducing executions when available — the margin basis for lifetime
|
|
28
|
+
* realized return.
|
|
29
|
+
*/
|
|
19
30
|
isolatedMargin: string;
|
|
20
31
|
leverage?: string;
|
|
21
32
|
/**
|
|
@@ -39,6 +50,16 @@ export interface Position {
|
|
|
39
50
|
liquidationPrice: string;
|
|
40
51
|
status: PositionStatus;
|
|
41
52
|
updatedAt: string;
|
|
53
|
+
/**
|
|
54
|
+
* Lifetime realized PnL net of trading fees and funding. Terminal rows
|
|
55
|
+
* only; absent when the position's reducing executions are unavailable.
|
|
56
|
+
*/
|
|
57
|
+
netRealizedPnl?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Lifetime realized return on the total allocated initial margin, as a
|
|
60
|
+
* percentage. Terminal rows only; absent when unavailable.
|
|
61
|
+
*/
|
|
62
|
+
realizedRoe?: string;
|
|
42
63
|
}
|
|
43
64
|
export interface ListPositionsParams {
|
|
44
65
|
marginAccountId?: string;
|
package/dist/profile/index.d.ts
CHANGED
|
@@ -237,6 +237,23 @@ export interface GetUserTradesParams {
|
|
|
237
237
|
pageSize?: number;
|
|
238
238
|
/** Filter by trading pair ID (UUID) */
|
|
239
239
|
tradingPairId?: string;
|
|
240
|
+
/**
|
|
241
|
+
* Pagination cursor with three distinct states:
|
|
242
|
+
* - Omitted (`undefined`): legacy page-number pagination via `page`,
|
|
243
|
+
* limited to recent history once the archive window is enabled.
|
|
244
|
+
* - Empty string (`""`): start a cursor walk with no prior position, from
|
|
245
|
+
* the newest row (this endpoint always sorts newest-first).
|
|
246
|
+
* - Non-empty: an opaque cursor from a previous response's
|
|
247
|
+
* `nextPageToken`; results resume immediately after that position.
|
|
248
|
+
*
|
|
249
|
+
* In either cursor-walk state (empty or non-empty), `page` is ignored, the
|
|
250
|
+
* response omits exact totals (`total`/`totalPages`/`page` are 0), and
|
|
251
|
+
* results cover full trade history — hot and archived rows merged —
|
|
252
|
+
* unlike page-number mode, which only ever sees recent history. Clients
|
|
253
|
+
* that need complete trade history must use the cursor form (pass `""` to
|
|
254
|
+
* start, then follow `nextPageToken`) rather than `page`.
|
|
255
|
+
*/
|
|
256
|
+
pageToken?: string;
|
|
240
257
|
}
|
|
241
258
|
/**
|
|
242
259
|
* Response from getting user trades
|
|
@@ -252,6 +269,21 @@ export interface GetUserTradesResponse {
|
|
|
252
269
|
total: number;
|
|
253
270
|
/** Total number of pages */
|
|
254
271
|
totalPages: number;
|
|
272
|
+
/**
|
|
273
|
+
* Cursor for the next page. Empty on every page-number (legacy) response —
|
|
274
|
+
* page-number mode never mints a token, full page or not, since resuming
|
|
275
|
+
* from a legacy-minted position could silently strand archived history
|
|
276
|
+
* newer than wherever that page happened to end.
|
|
277
|
+
*
|
|
278
|
+
* To walk full history, start a cursor-mode request with `pageToken`
|
|
279
|
+
* present but empty (`""`); from then on the token is present whenever
|
|
280
|
+
* that page returned any rows (AIP-158 "maybe more" semantics), not only
|
|
281
|
+
* when the page is exactly full. Empty only when a cursor-mode page
|
|
282
|
+
* returned zero rows, which is the sole proof the walk is exhausted. The
|
|
283
|
+
* two modes never bridge — page-number pagination is deprecated for deep
|
|
284
|
+
* history.
|
|
285
|
+
*/
|
|
286
|
+
nextPageToken: string;
|
|
255
287
|
}
|
|
256
288
|
/**
|
|
257
289
|
* Direction of a funding payment from the user's perspective.
|
|
@@ -395,7 +427,12 @@ export interface PortfolioStats {
|
|
|
395
427
|
totalTrades: number;
|
|
396
428
|
/** Total fees paid */
|
|
397
429
|
feesPaid: string;
|
|
398
|
-
/**
|
|
430
|
+
/**
|
|
431
|
+
* Position-level win rate: winning positions over winning + losing positions
|
|
432
|
+
* (break-even excluded). Each position (one flat→open→flat round-trip) is
|
|
433
|
+
* classified once by its net realized PnL after all fees, not per fill. Null
|
|
434
|
+
* when the period has no closed positions.
|
|
435
|
+
*/
|
|
399
436
|
winLossRatio: number | null;
|
|
400
437
|
/** Total equity in USDC terms (spot balances plus perps account equity) */
|
|
401
438
|
totalEquity: string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pulse Types
|
|
3
|
+
*
|
|
4
|
+
* Types for the public market-pulse news feed: AI-synthesized, per-asset
|
|
5
|
+
* headlines served from the backend's hourly-refreshed cache.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This endpoint is **public (unauthenticated)** and ETag-cacheable.
|
|
8
|
+
* It returns 503 while the backend cache is cold.
|
|
9
|
+
*/
|
|
10
|
+
import type { BaseAPI } from "../api";
|
|
11
|
+
/** Provenance for one pulse item, for attribution links. */
|
|
12
|
+
export interface PulseSource {
|
|
13
|
+
/** Source article or post URL. */
|
|
14
|
+
url: string;
|
|
15
|
+
/** Source author or publication name. */
|
|
16
|
+
author: string;
|
|
17
|
+
/** Source channel: "twitter" or "news". */
|
|
18
|
+
source: string;
|
|
19
|
+
/** Source publication time, ISO-8601. */
|
|
20
|
+
createdAt: string;
|
|
21
|
+
/** Relevance score, 1 (low) to 5 (high). */
|
|
22
|
+
relevance: number;
|
|
23
|
+
}
|
|
24
|
+
/** One synthesized market-pulse headline. */
|
|
25
|
+
export interface PulseItem {
|
|
26
|
+
/** Watchlist ticker (e.g. "BTC") or "MARKET" for a cross-asset story. */
|
|
27
|
+
asset: string;
|
|
28
|
+
/** Sentiment tag: "Bullish", "Neutral", or "Bearish". */
|
|
29
|
+
sentiment: string;
|
|
30
|
+
/** Synthesized 1-2 sentence summary (at most 240 characters). */
|
|
31
|
+
summary: string;
|
|
32
|
+
/** Timestamp of the most recent source; render relative time client-side. */
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
/** Provenance for the item. */
|
|
35
|
+
sources: PulseSource[];
|
|
36
|
+
}
|
|
37
|
+
/** The latest pulse snapshot. */
|
|
38
|
+
export interface GetPulseResponse {
|
|
39
|
+
/** When this snapshot was produced upstream (ISO-8601 UTC); also the ETag value. */
|
|
40
|
+
generatedAt: string;
|
|
41
|
+
/** Asset universe the snapshot was synthesized against. */
|
|
42
|
+
watchlist: string[];
|
|
43
|
+
/** Pulse items, pre-sorted (watchlist order, MARKET last, newest first per asset). */
|
|
44
|
+
items: PulseItem[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Pulse API interface. The endpoint is public (no auth required).
|
|
48
|
+
*/
|
|
49
|
+
export interface PulseAPI extends BaseAPI {
|
|
50
|
+
/**
|
|
51
|
+
* Get the latest market pulse news feed snapshot.
|
|
52
|
+
*
|
|
53
|
+
* Public/unauthenticated; served from the backend cache (refreshed hourly).
|
|
54
|
+
* Items whose figures could not be verified upstream are removed
|
|
55
|
+
* server-side before caching.
|
|
56
|
+
*
|
|
57
|
+
* @returns Promise resolving to the latest snapshot
|
|
58
|
+
* @throws 503 while the backend cache is cold
|
|
59
|
+
*/
|
|
60
|
+
getPulse(): Promise<GetPulseResponse>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pulse Types
|
|
3
|
+
*
|
|
4
|
+
* Types for the public market-pulse news feed: AI-synthesized, per-asset
|
|
5
|
+
* headlines served from the backend's hourly-refreshed cache.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This endpoint is **public (unauthenticated)** and ETag-cacheable.
|
|
8
|
+
* It returns 503 while the backend cache is cold.
|
|
9
|
+
*/
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { PitpassAPI } from "../pitpass";
|
|
|
10
10
|
import type { PortfolioAPI } from "../portfolio";
|
|
11
11
|
import type { PositionsAPI } from "../positions";
|
|
12
12
|
import type { ProfileAPI } from "../profile";
|
|
13
|
+
import type { PulseAPI } from "../pulse";
|
|
13
14
|
import type { SubAccountsAPI } from "../sub-accounts";
|
|
14
15
|
import type { TradingAPI, TradingMode } from "../trading";
|
|
15
16
|
import type { VaultAPI } from "../vault";
|
|
@@ -101,6 +102,8 @@ export interface MonacoSDK {
|
|
|
101
102
|
whitelist: WhitelistAPI;
|
|
102
103
|
/** Profile operations API */
|
|
103
104
|
profile: ProfileAPI;
|
|
105
|
+
/** Public market-pulse news feed API (cached, hourly-refreshed) */
|
|
106
|
+
pulse: PulseAPI;
|
|
104
107
|
/** Orderbook REST API for fetching orderbook snapshots */
|
|
105
108
|
orderbook: {
|
|
106
109
|
getOrderbook: (tradingPairId: string, options?: {
|
package/dist/trading/index.d.ts
CHANGED
|
@@ -38,9 +38,7 @@ export interface TradingAPI extends BaseAPI {
|
|
|
38
38
|
positionSide?: PositionSide;
|
|
39
39
|
leverage?: string;
|
|
40
40
|
reduceOnly?: boolean;
|
|
41
|
-
/** @deprecated Entry-attached TP/SL is rejected; use position TP/SL. */
|
|
42
41
|
takeProfit?: ParentTpSlLegParams;
|
|
43
|
-
/** @deprecated Entry-attached TP/SL is rejected; use position TP/SL. */
|
|
44
42
|
stopLoss?: ParentTpSlLegParams;
|
|
45
43
|
}): Promise<CreateOrderResponse>;
|
|
46
44
|
/**
|
|
@@ -65,9 +63,7 @@ export interface TradingAPI extends BaseAPI {
|
|
|
65
63
|
positionSide?: PositionSide;
|
|
66
64
|
leverage?: string;
|
|
67
65
|
reduceOnly?: boolean;
|
|
68
|
-
/** @deprecated Entry-attached TP/SL is rejected; use position TP/SL. */
|
|
69
66
|
takeProfit?: ParentTpSlLegParams;
|
|
70
|
-
/** @deprecated Entry-attached TP/SL is rejected; use position TP/SL. */
|
|
71
67
|
stopLoss?: ParentTpSlLegParams;
|
|
72
68
|
}): Promise<CreateOrderResponse>;
|
|
73
69
|
/**
|
|
@@ -38,8 +38,6 @@ export interface MatchResult {
|
|
|
38
38
|
} | null;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* @deprecated Entry-attached TP/SL is rejected. Use position-associated TP/SL.
|
|
42
|
-
*
|
|
43
41
|
* Parent TP/SL follows the parent order quantity and becomes active once the
|
|
44
42
|
* parent order creates or extends a position.
|
|
45
43
|
*/
|
|
@@ -139,6 +137,23 @@ export interface GetPaginatedOrdersParams {
|
|
|
139
137
|
page?: number;
|
|
140
138
|
/** Number of orders per page (default: 10, max: 100) */
|
|
141
139
|
pageSize?: number;
|
|
140
|
+
/**
|
|
141
|
+
* Pagination cursor with three distinct states:
|
|
142
|
+
* - Omitted (`undefined`): legacy page-number pagination via `page`,
|
|
143
|
+
* limited to recent history once the archive window is enabled.
|
|
144
|
+
* - Empty string (`""`): start a cursor walk with no prior position, from
|
|
145
|
+
* the newest row (or the oldest, when `orderBy` is `"ASC"`).
|
|
146
|
+
* - Non-empty: an opaque cursor from a previous response's
|
|
147
|
+
* `nextPageToken`; results resume immediately after that position.
|
|
148
|
+
*
|
|
149
|
+
* In either cursor-walk state (empty or non-empty), `page` is ignored, the
|
|
150
|
+
* response omits exact totals (`total`/`totalPages`/`page` are 0), and
|
|
151
|
+
* results cover full order history — hot and archived rows merged —
|
|
152
|
+
* unlike page-number mode, which only ever sees recent history. Clients
|
|
153
|
+
* that need complete order history must use the cursor form (pass `""` to
|
|
154
|
+
* start, then follow `nextPageToken`) rather than `page`.
|
|
155
|
+
*/
|
|
156
|
+
pageToken?: string;
|
|
142
157
|
}
|
|
143
158
|
/**
|
|
144
159
|
* Response from getting paginated orders
|
|
@@ -159,6 +174,21 @@ export interface GetPaginatedOrdersResponse {
|
|
|
159
174
|
pageSize: number;
|
|
160
175
|
/** Total number of pages */
|
|
161
176
|
totalPages: number;
|
|
177
|
+
/**
|
|
178
|
+
* Cursor for the next page. Empty on every page-number (legacy) response —
|
|
179
|
+
* page-number mode never mints a token, full page or not, since resuming
|
|
180
|
+
* from a legacy-minted position could silently strand archived history
|
|
181
|
+
* newer than wherever that page happened to end.
|
|
182
|
+
*
|
|
183
|
+
* To walk full history, start a cursor-mode request with `pageToken`
|
|
184
|
+
* present but empty (`""`); from then on the token is present whenever
|
|
185
|
+
* that page returned any rows (AIP-158 "maybe more" semantics), not only
|
|
186
|
+
* when the page is exactly full. Empty only when a cursor-mode page
|
|
187
|
+
* returned zero rows, which is the sole proof the walk is exhausted. The
|
|
188
|
+
* two modes never bridge — page-number pagination is deprecated for deep
|
|
189
|
+
* history.
|
|
190
|
+
*/
|
|
191
|
+
nextPageToken: string;
|
|
162
192
|
}
|
|
163
193
|
/**
|
|
164
194
|
* Response from getting a single order by ID
|
|
@@ -66,6 +66,7 @@ export declare const GetUserTradesSchema: z.ZodObject<{
|
|
|
66
66
|
page: z.ZodOptional<z.ZodNumber>;
|
|
67
67
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
68
68
|
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
69
|
+
pageToken: z.ZodOptional<z.ZodString>;
|
|
69
70
|
}, z.core.$strip>;
|
|
70
71
|
export declare const ListFundingPaymentsSchema: z.ZodObject<{
|
|
71
72
|
page: z.ZodOptional<z.ZodNumber>;
|
|
@@ -41,6 +41,7 @@ export const GetUserTradesSchema = z.object({
|
|
|
41
41
|
page: z.number().int("Page must be an integer").min(1, "Page must be at least 1").optional(),
|
|
42
42
|
pageSize: z.number().int("Page size must be an integer").min(1, "Page size must be at least 1").max(100, "Page size cannot exceed 100").optional(),
|
|
43
43
|
tradingPairId: UUIDSchema.optional(),
|
|
44
|
+
pageToken: z.string().optional(),
|
|
44
45
|
});
|
|
45
46
|
export const ListFundingPaymentsSchema = z.object({
|
|
46
47
|
page: z.number().int("Page must be an integer").min(1, "Page must be at least 1").optional(),
|
|
@@ -261,6 +261,7 @@ export declare const GetPaginatedOrdersSchema: z.ZodObject<{
|
|
|
261
261
|
marginAccountId: z.ZodOptional<z.ZodUUID>;
|
|
262
262
|
page: z.ZodOptional<z.ZodNumber>;
|
|
263
263
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
264
|
+
pageToken: z.ZodOptional<z.ZodString>;
|
|
264
265
|
}, z.core.$strip>;
|
|
265
266
|
export declare const ConditionalOrderConditionTypeSchema: z.ZodEnum<{
|
|
266
267
|
STOP_LOSS: "STOP_LOSS";
|
|
@@ -141,8 +141,12 @@ export const PlaceLimitOrderSchema = z
|
|
|
141
141
|
message: "leverage is required for normal MARGIN orders",
|
|
142
142
|
path: ["options", "leverage"],
|
|
143
143
|
})
|
|
144
|
-
.refine((data) => !hasParentTpSl(data.options), {
|
|
145
|
-
message: "
|
|
144
|
+
.refine((data) => !hasParentTpSl(data.options) || data.options?.tradingMode === "MARGIN", {
|
|
145
|
+
message: "takeProfit/stopLoss are only supported for MARGIN orders",
|
|
146
|
+
path: ["options"],
|
|
147
|
+
})
|
|
148
|
+
.refine((data) => !hasParentTpSl(data.options) || data.options?.reduceOnly !== true, {
|
|
149
|
+
message: "takeProfit/stopLoss cannot be attached to reduce-only orders",
|
|
146
150
|
path: ["options"],
|
|
147
151
|
})
|
|
148
152
|
.refine((data) => data.options?.riskBucketCollateral === undefined || data.options?.tradingMode === "MARGIN", {
|
|
@@ -210,8 +214,12 @@ export const PlaceMarketOrderSchema = z
|
|
|
210
214
|
message: "leverage is required for normal MARGIN orders",
|
|
211
215
|
path: ["options", "leverage"],
|
|
212
216
|
})
|
|
213
|
-
.refine((data) => !hasParentTpSl(data.options), {
|
|
214
|
-
message: "
|
|
217
|
+
.refine((data) => !hasParentTpSl(data.options) || data.options?.tradingMode === "MARGIN", {
|
|
218
|
+
message: "takeProfit/stopLoss are only supported for MARGIN orders",
|
|
219
|
+
path: ["options"],
|
|
220
|
+
})
|
|
221
|
+
.refine((data) => !hasParentTpSl(data.options) || data.options?.reduceOnly !== true, {
|
|
222
|
+
message: "takeProfit/stopLoss cannot be attached to reduce-only orders",
|
|
215
223
|
path: ["options"],
|
|
216
224
|
})
|
|
217
225
|
.refine((data) => data.options?.riskBucketCollateral === undefined || data.options?.tradingMode === "MARGIN", {
|
|
@@ -285,6 +293,7 @@ export const GetPaginatedOrdersSchema = z.object({
|
|
|
285
293
|
marginAccountId: UUIDSchema.optional(),
|
|
286
294
|
page: z.number().int().min(1, "Page must be at least 1").optional(),
|
|
287
295
|
pageSize: z.number().int().min(1, "Page size must be at least 1").max(100, "Page size cannot exceed 100").optional(),
|
|
296
|
+
pageToken: z.string().optional(),
|
|
288
297
|
});
|
|
289
298
|
export const ConditionalOrderConditionTypeSchema = z.enum(["STOP_LOSS", "TAKE_PROFIT"], {
|
|
290
299
|
message: 'conditionType must be "STOP_LOSS" or "TAKE_PROFIT"',
|
|
@@ -343,6 +352,10 @@ export const BatchCreateOrderItemSchema = z
|
|
|
343
352
|
.refine((data) => data.orderType !== "MARKET" || data.price === undefined, {
|
|
344
353
|
message: "Price must not be provided for MARKET orders",
|
|
345
354
|
path: ["price"],
|
|
355
|
+
})
|
|
356
|
+
.refine((data) => data.orderType !== "MARKET" || data.timeInForce === undefined, {
|
|
357
|
+
message: "timeInForce must not be provided for MARKET orders",
|
|
358
|
+
path: ["timeInForce"],
|
|
346
359
|
})
|
|
347
360
|
.refine((data) => data.riskBucketCollateral === undefined || data.tradingMode === "MARGIN", {
|
|
348
361
|
message: "riskBucketCollateral is only supported for MARGIN orders",
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
* hand-written SDK surface. CI regenerates it and fails on a diff, identical to
|
|
11
11
|
* the `schema.ts` wire-types tripwire (MON-1476), so it can never go stale.
|
|
12
12
|
*/
|
|
13
|
-
export declare const OPERATION_IDS: readonly ["add_position_margin", "attach_position_tp_sl", "batch_cancel_all", "batch_cancel_all_by_pair", "batch_cancel_orders", "batch_close_all_positions", "batch_create_orders", "batch_replace_orders", "cancel_conditional_order", "cancel_order", "close_position", "create_challenge", "create_delegated_session", "create_order", "create_sub_account_limit", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "get_candles", "get_conditional_order", "get_faucet_info", "get_funding_state", "get_index_price", "get_margin_account_movements", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "get_my_trader_code", "get_open_interest", "get_order_by_id", "get_orderbook_snapshot", "get_orders", "get_parent_margin_account_movements", "get_parent_margin_account_summary", "get_perp_market_config", "get_perp_market_summary", "get_portfolio_assets", "get_portfolio_chart", "get_portfolio_margin", "get_portfolio_performance", "get_portfolio_realized_pnl", "get_portfolio_stats", "get_portfolio_summary", "get_position", "get_position_pnl_history", "get_position_risk", "get_rewards_balance", "get_screener", "get_sub_account_limits", "get_trade_by_id", "get_trader_code_info", "get_trades", "get_trading_pair_by_id", "get_user_balance_by_asset", "get_user_balances", "get_user_movements", "get_user_profile", "get_user_trades", "get_withdrawal", "health_check", "initiate_withdrawal", "list_application_balances", "list_application_movements", "list_application_orders", "list_application_users", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_funding_history", "list_funding_payments", "list_margin_accounts", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_trading_pairs", "mint_tokens", "reduce_position_margin", "refresh_session", "replace_order", "revoke_delegated_agent", "revoke_session", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "submit_whitelist", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "verify_signature"];
|
|
13
|
+
export declare const OPERATION_IDS: readonly ["add_position_margin", "attach_position_tp_sl", "batch_cancel_all", "batch_cancel_all_by_pair", "batch_cancel_orders", "batch_close_all_positions", "batch_create_orders", "batch_replace_orders", "cancel_conditional_order", "cancel_order", "close_position", "create_challenge", "create_delegated_session", "create_order", "create_sub_account_limit", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "get_candles", "get_conditional_order", "get_faucet_info", "get_funding_state", "get_index_price", "get_margin_account_movements", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "get_my_trader_code", "get_open_interest", "get_order_by_id", "get_orderbook_snapshot", "get_orders", "get_parent_margin_account_movements", "get_parent_margin_account_summary", "get_perp_market_config", "get_perp_market_summary", "get_portfolio_assets", "get_portfolio_chart", "get_portfolio_margin", "get_portfolio_performance", "get_portfolio_realized_pnl", "get_portfolio_stats", "get_portfolio_summary", "get_position", "get_position_pnl_history", "get_position_risk", "get_pulse", "get_rewards_balance", "get_screener", "get_sub_account_limits", "get_trade_by_id", "get_trader_code_info", "get_trades", "get_trading_pair_by_id", "get_user_balance_by_asset", "get_user_balances", "get_user_movements", "get_user_profile", "get_user_trades", "get_withdrawal", "health_check", "initiate_withdrawal", "list_all_funding_history", "list_application_balances", "list_application_movements", "list_application_orders", "list_application_users", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_funding_history", "list_funding_payments", "list_margin_accounts", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_trading_pairs", "mint_tokens", "reduce_position_margin", "refresh_session", "replace_order", "revoke_delegated_agent", "revoke_session", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "submit_whitelist", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "verify_signature"];
|
|
14
14
|
/** Union of every OpenAPI operationId in the spec. */
|
|
15
15
|
export type OperationId = (typeof OPERATION_IDS)[number];
|
package/dist/wire/operations.js
CHANGED
|
@@ -60,6 +60,7 @@ export const OPERATION_IDS = [
|
|
|
60
60
|
"get_position",
|
|
61
61
|
"get_position_pnl_history",
|
|
62
62
|
"get_position_risk",
|
|
63
|
+
"get_pulse",
|
|
63
64
|
"get_rewards_balance",
|
|
64
65
|
"get_screener",
|
|
65
66
|
"get_sub_account_limits",
|
|
@@ -75,6 +76,7 @@ export const OPERATION_IDS = [
|
|
|
75
76
|
"get_withdrawal",
|
|
76
77
|
"health_check",
|
|
77
78
|
"initiate_withdrawal",
|
|
79
|
+
"list_all_funding_history",
|
|
78
80
|
"list_application_balances",
|
|
79
81
|
"list_application_movements",
|
|
80
82
|
"list_application_orders",
|