@0xmonaco/types 1.0.28 → 1.0.31
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.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/market/index.d.ts +54 -0
- package/dist/portfolio/index.d.ts +7 -0
- package/dist/positions/index.d.ts +33 -2
- package/dist/profile/index.d.ts +45 -9
- 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 +10 -6
- package/dist/trading/orders.d.ts +8 -0
- package/dist/trading/responses.d.ts +33 -12
- package/dist/validation/positions.d.ts +1 -0
- package/dist/validation/positions.js +5 -2
- package/dist/validation/profile.js +16 -2
- package/dist/validation/trading.d.ts +13 -4
- package/dist/validation/trading.js +31 -9
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +2 -0
- package/dist/wire/schema.d.ts +334 -14
- package/package.json +2 -2
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)
|
|
@@ -342,14 +353,34 @@ export interface FundingState {
|
|
|
342
353
|
}
|
|
343
354
|
export interface FundingRecord {
|
|
344
355
|
tradingPairId: string;
|
|
356
|
+
/** Sequential settlement-window index (serialized as a JSON number). */
|
|
357
|
+
epoch: number;
|
|
358
|
+
/** Capped settled rate for the window, as a decimal-string fraction per funding interval (e.g. "0.0001" = 0.01%). */
|
|
345
359
|
fundingRate: string;
|
|
360
|
+
/** Quote charged per unit of base position for this window (fundingRate × referencePrice; positive means longs paid shorts). */
|
|
361
|
+
fundingDeltaPerUnit: string;
|
|
362
|
+
/** Running sum of fundingDeltaPerUnit across settled windows; position payments settle against deltas of this value. */
|
|
346
363
|
cumulativeFundingPerUnit?: string;
|
|
364
|
+
/** Mark price at the window boundary — the payment basis for every position settled in the window. */
|
|
365
|
+
referencePrice: string;
|
|
366
|
+
/** Number of premium samples that fed the window's settled rate. */
|
|
367
|
+
sampleCount: number;
|
|
368
|
+
/** Window open time (ISO 8601). */
|
|
369
|
+
windowStartedAt: string;
|
|
370
|
+
/** Window close time (ISO 8601). */
|
|
371
|
+
windowClosedAt: string;
|
|
372
|
+
/** Settlement time (ISO 8601); the sort key for `listAllFundingHistory`. */
|
|
373
|
+
settledAt: string;
|
|
374
|
+
/** True when the window settled at the carried last rate (sparse-sample rule). */
|
|
375
|
+
carried?: boolean;
|
|
347
376
|
}
|
|
348
377
|
export interface ListFundingHistoryParams {
|
|
349
378
|
startTime?: string;
|
|
350
379
|
endTime?: string;
|
|
351
380
|
page?: number;
|
|
352
381
|
pageSize?: number;
|
|
382
|
+
/** Sort direction for epoch: "ASC" or "DESC" (default DESC). */
|
|
383
|
+
orderBy?: "ASC" | "DESC";
|
|
353
384
|
}
|
|
354
385
|
export interface ListFundingHistoryResponse {
|
|
355
386
|
records: FundingRecord[];
|
|
@@ -357,6 +388,20 @@ export interface ListFundingHistoryResponse {
|
|
|
357
388
|
page: number;
|
|
358
389
|
pageSize: number;
|
|
359
390
|
}
|
|
391
|
+
export interface ListAllFundingHistoryParams {
|
|
392
|
+
startTime?: string;
|
|
393
|
+
endTime?: string;
|
|
394
|
+
page?: number;
|
|
395
|
+
pageSize?: number;
|
|
396
|
+
/** Sort direction for settledAt (default DESC). */
|
|
397
|
+
orderBy?: "ASC" | "DESC";
|
|
398
|
+
}
|
|
399
|
+
export interface ListAllFundingHistoryResponse {
|
|
400
|
+
records: FundingRecord[];
|
|
401
|
+
total: number;
|
|
402
|
+
page: number;
|
|
403
|
+
pageSize: number;
|
|
404
|
+
}
|
|
360
405
|
export interface OpenInterest {
|
|
361
406
|
tradingPairId: string;
|
|
362
407
|
openInterest?: string;
|
|
@@ -431,5 +476,14 @@ export interface MarketAPI extends BaseAPI {
|
|
|
431
476
|
getIndexPrice(tradingPairId: string): Promise<IndexPrice>;
|
|
432
477
|
getFundingState(tradingPairId: string): Promise<FundingState>;
|
|
433
478
|
listFundingHistory(tradingPairId: string, params?: ListFundingHistoryParams): Promise<ListFundingHistoryResponse>;
|
|
479
|
+
/**
|
|
480
|
+
* Fetch settled funding history across every market in one call, so clients
|
|
481
|
+
* don't have to fan out one listFundingHistory request per trading pair.
|
|
482
|
+
* Each record carries its tradingPairId; sorted by settledAt (default DESC).
|
|
483
|
+
* @param params - Optional time bounds (ms-epoch strings, inclusive on
|
|
484
|
+
* settledAt), pagination, and orderBy (ASC or DESC)
|
|
485
|
+
* @returns Promise resolving to the paginated all-markets funding history
|
|
486
|
+
*/
|
|
487
|
+
listAllFundingHistory(params?: ListAllFundingHistoryParams): Promise<ListAllFundingHistoryResponse>;
|
|
434
488
|
getOpenInterest(tradingPairId: string): Promise<OpenInterest>;
|
|
435
489
|
}
|
|
@@ -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 {
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import type { BaseAPI } from "../api";
|
|
2
2
|
import type { MarginMode } from "../margin-accounts";
|
|
3
3
|
import type { OrderType, PositionSide, TimeInForce } from "../trading";
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Position lifecycle statuses the API returns. `CLOSED`, `LIQUIDATED`, and
|
|
6
|
+
* `EXPIRED` are terminal; `LIQUIDATING` is transient.
|
|
7
|
+
*/
|
|
8
|
+
export type PositionStatus = "OPEN" | "CLOSED" | "LIQUIDATING" | "LIQUIDATED" | "EXPIRED";
|
|
9
|
+
/**
|
|
10
|
+
* Accepted `status` filter values for {@link ListPositionsParams}. Narrower than
|
|
11
|
+
* {@link PositionStatus}: the backend folds `EXPIRED` positions under a `CLOSED`
|
|
12
|
+
* filter, so `EXPIRED` is not an accepted filter value.
|
|
13
|
+
*/
|
|
14
|
+
export type PositionStatusFilter = "OPEN" | "CLOSED" | "LIQUIDATING" | "LIQUIDATED";
|
|
5
15
|
export type ClosePositionType = "MARKET" | "LIMIT" | "IOC";
|
|
6
16
|
export interface Position {
|
|
7
17
|
positionId: string;
|
|
@@ -10,12 +20,23 @@ export interface Position {
|
|
|
10
20
|
marginMode?: MarginMode;
|
|
11
21
|
tradingPairId: string;
|
|
12
22
|
side: PositionSide;
|
|
23
|
+
/**
|
|
24
|
+
* Open rows: current absolute position quantity. Terminal rows
|
|
25
|
+
* (CLOSED/LIQUIDATED/EXPIRED): total quantity closed over the position's
|
|
26
|
+
* life, summed from its reducing executions when available.
|
|
27
|
+
*/
|
|
13
28
|
size: string;
|
|
14
29
|
entryPrice: string;
|
|
15
30
|
markPrice: string;
|
|
16
31
|
indexPrice?: string;
|
|
17
32
|
unrealizedPnl: string;
|
|
18
33
|
realizedPnl: string;
|
|
34
|
+
/**
|
|
35
|
+
* Open rows: current isolated collateral for this position's risk bucket.
|
|
36
|
+
* Terminal rows: total initial margin allocated across the position's
|
|
37
|
+
* reducing executions when available — the margin basis for lifetime
|
|
38
|
+
* realized return.
|
|
39
|
+
*/
|
|
19
40
|
isolatedMargin: string;
|
|
20
41
|
leverage?: string;
|
|
21
42
|
/**
|
|
@@ -39,11 +60,21 @@ export interface Position {
|
|
|
39
60
|
liquidationPrice: string;
|
|
40
61
|
status: PositionStatus;
|
|
41
62
|
updatedAt: string;
|
|
63
|
+
/**
|
|
64
|
+
* Lifetime realized PnL net of trading fees and funding. Terminal rows
|
|
65
|
+
* only; absent when the position's reducing executions are unavailable.
|
|
66
|
+
*/
|
|
67
|
+
netRealizedPnl?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Lifetime realized return on the total allocated initial margin, as a
|
|
70
|
+
* percentage. Terminal rows only; absent when unavailable.
|
|
71
|
+
*/
|
|
72
|
+
realizedRoe?: string;
|
|
42
73
|
}
|
|
43
74
|
export interface ListPositionsParams {
|
|
44
75
|
marginAccountId?: string;
|
|
45
76
|
tradingPairId?: string;
|
|
46
|
-
status?:
|
|
77
|
+
status?: PositionStatusFilter;
|
|
47
78
|
page?: number;
|
|
48
79
|
pageSize?: number;
|
|
49
80
|
}
|
package/dist/profile/index.d.ts
CHANGED
|
@@ -231,16 +231,24 @@ export interface UserTrade {
|
|
|
231
231
|
* Query parameters for getting user trades
|
|
232
232
|
*/
|
|
233
233
|
export interface GetUserTradesParams {
|
|
234
|
-
/**
|
|
234
|
+
/**
|
|
235
|
+
* Page number for legacy offset pagination (starts from 1).
|
|
236
|
+
*
|
|
237
|
+
* @deprecated Use cursor pagination (`pageToken`) instead. Passing `page`
|
|
238
|
+
* selects legacy page-number mode, which only ever sees recent (hot)
|
|
239
|
+
* history; omitting both `page` and `pageToken` now drives cursor mode.
|
|
240
|
+
*/
|
|
235
241
|
page?: number;
|
|
236
|
-
/** Number of items per page (max 100) */
|
|
242
|
+
/** Number of items per page (max 100 in page-number mode, up to 1000 when `pageToken` is present) */
|
|
237
243
|
pageSize?: number;
|
|
238
244
|
/** Filter by trading pair ID (UUID) */
|
|
239
245
|
tradingPairId?: string;
|
|
240
246
|
/**
|
|
241
247
|
* Pagination cursor with three distinct states:
|
|
242
|
-
* - Omitted (`undefined`):
|
|
243
|
-
*
|
|
248
|
+
* - Omitted (`undefined`): the SDK starts a cursor walk (it sends
|
|
249
|
+
* `pageToken=""`) unless the deprecated `page` param was passed, in
|
|
250
|
+
* which case the request uses legacy page-number pagination, limited to
|
|
251
|
+
* recent history once the archive window is enabled.
|
|
244
252
|
* - Empty string (`""`): start a cursor walk with no prior position, from
|
|
245
253
|
* the newest row (this endpoint always sorts newest-first).
|
|
246
254
|
* - Non-empty: an opaque cursor from a previous response's
|
|
@@ -261,13 +269,28 @@ export interface GetUserTradesParams {
|
|
|
261
269
|
export interface GetUserTradesResponse {
|
|
262
270
|
/** List of user trades */
|
|
263
271
|
trades: UserTrade[];
|
|
264
|
-
/**
|
|
272
|
+
/**
|
|
273
|
+
* Current page number.
|
|
274
|
+
*
|
|
275
|
+
* @deprecated Only populated by legacy page-number (offset) responses; 0 in
|
|
276
|
+
* cursor mode. Use `pageToken`/`nextPageToken` pagination instead.
|
|
277
|
+
*/
|
|
265
278
|
page: number;
|
|
266
279
|
/** Items per page */
|
|
267
280
|
pageSize: number;
|
|
268
|
-
/**
|
|
281
|
+
/**
|
|
282
|
+
* Total number of trades.
|
|
283
|
+
*
|
|
284
|
+
* @deprecated Only populated by legacy page-number (offset) responses; 0 in
|
|
285
|
+
* cursor mode, which has no exact total. Walk `nextPageToken` instead.
|
|
286
|
+
*/
|
|
269
287
|
total: number;
|
|
270
|
-
/**
|
|
288
|
+
/**
|
|
289
|
+
* Total number of pages.
|
|
290
|
+
*
|
|
291
|
+
* @deprecated Only populated by legacy page-number (offset) responses; 0 in
|
|
292
|
+
* cursor mode, which has no exact total. Walk `nextPageToken` instead.
|
|
293
|
+
*/
|
|
271
294
|
totalPages: number;
|
|
272
295
|
/**
|
|
273
296
|
* Cursor for the next page. Empty on every page-number (legacy) response —
|
|
@@ -427,7 +450,12 @@ export interface PortfolioStats {
|
|
|
427
450
|
totalTrades: number;
|
|
428
451
|
/** Total fees paid */
|
|
429
452
|
feesPaid: string;
|
|
430
|
-
/**
|
|
453
|
+
/**
|
|
454
|
+
* Position-level win rate: winning positions over winning + losing positions
|
|
455
|
+
* (break-even excluded). Each position (one flat→open→flat round-trip) is
|
|
456
|
+
* classified once by its net realized PnL after all fees, not per fill. Null
|
|
457
|
+
* when the period has no closed positions.
|
|
458
|
+
*/
|
|
431
459
|
winLossRatio: number | null;
|
|
432
460
|
/** Total equity in USDC terms (spot balances plus perps account equity) */
|
|
433
461
|
totalEquity: string;
|
|
@@ -541,12 +569,20 @@ export interface ProfileAPI extends BaseAPI {
|
|
|
541
569
|
*
|
|
542
570
|
* @param params - Optional query parameters for pagination and filtering
|
|
543
571
|
* @param params.page - Page number (starts from 1)
|
|
544
|
-
* @param params.limit - Number of items per page (max 100)
|
|
572
|
+
* @param params.limit - Number of items per page (max 100 in page-number mode, up to 1000 when `pageToken` is present)
|
|
545
573
|
* @param params.tradingPairId - Filter by trading pair ID (UUID)
|
|
546
574
|
* @returns Promise resolving to paginated trades response
|
|
547
575
|
* @throws ValidationError If pagination params (page/limit) are invalid or tradingPairId is not a valid UUID; this may occur before any network request.
|
|
548
576
|
*/
|
|
549
577
|
getUserTrades(params?: GetUserTradesParams): Promise<GetUserTradesResponse>;
|
|
578
|
+
/**
|
|
579
|
+
* Walks the user's full trade history with cursor pagination, yielding one
|
|
580
|
+
* trade at a time. Follows each response's `nextPageToken` until the walk
|
|
581
|
+
* is exhausted; covers hot and archived history.
|
|
582
|
+
* @param params - Optional filters and page size; the cursor is managed internally
|
|
583
|
+
* @returns Async generator yielding trades
|
|
584
|
+
*/
|
|
585
|
+
iterateUserTrades(params?: Omit<GetUserTradesParams, "page" | "pageToken">): AsyncGenerator<UserTrade, void, undefined>;
|
|
550
586
|
/**
|
|
551
587
|
* List the current user's funding payment history with pagination and filters.
|
|
552
588
|
*
|
|
@@ -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
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { BaseAPI } from "../api/index";
|
|
7
7
|
import type { MarginMode } from "../margin-accounts";
|
|
8
|
-
import type { OrderSide, PositionSide, TimeInForce, TradingMode } from "./orders";
|
|
8
|
+
import type { Order, OrderSide, PositionSide, TimeInForce, TradingMode } from "./orders";
|
|
9
9
|
import type { BatchCancelOrdersResponse, BatchCreateOrderParams, BatchCreateOrdersResponse, BatchReplaceOrderParams, BatchReplaceOrdersResponse, CancelConditionalOrderResponse, CancelOrderResponse, ConditionalOrder, CreateOrderResponse, GetOrderResponse, GetPaginatedOrdersParams, GetPaginatedOrdersResponse, ListConditionalOrdersParams, ListConditionalOrdersResponse, ParentTpSlLegParams, ReplaceOrderResponse } from "./responses";
|
|
10
10
|
/**
|
|
11
11
|
* Trading API interface.
|
|
@@ -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
|
/**
|
|
@@ -139,6 +135,14 @@ export interface TradingAPI extends BaseAPI {
|
|
|
139
135
|
* @returns Promise resolving to the paginated orders result
|
|
140
136
|
*/
|
|
141
137
|
getPaginatedOrders(params?: GetPaginatedOrdersParams): Promise<GetPaginatedOrdersResponse>;
|
|
138
|
+
/**
|
|
139
|
+
* Walks the user's full order history with cursor pagination, yielding one
|
|
140
|
+
* order at a time. Follows each response's `nextPageToken` until the walk
|
|
141
|
+
* is exhausted; covers hot and archived history.
|
|
142
|
+
* @param params - Optional filters and page size; the cursor is managed internally
|
|
143
|
+
* @returns Async generator yielding orders
|
|
144
|
+
*/
|
|
145
|
+
iterateOrders(params?: Omit<GetPaginatedOrdersParams, "page" | "pageToken">): AsyncGenerator<Order, void, undefined>;
|
|
142
146
|
/**
|
|
143
147
|
* Gets a single order by its ID.
|
|
144
148
|
* @param orderId - ID of the order to retrieve
|
|
@@ -146,6 +150,6 @@ export interface TradingAPI extends BaseAPI {
|
|
|
146
150
|
*/
|
|
147
151
|
getOrder(orderId: string): Promise<GetOrderResponse>;
|
|
148
152
|
}
|
|
149
|
-
export type { ConditionalOrderConditionType, ConditionalOrderState, ConditionalOrderTriggerSource, Order, OrderRole, OrderSide, OrderStatus, OrderTerminalReason, OrderType, PositionSide, TimeInForce, TradingMode, } from "./orders";
|
|
153
|
+
export type { ConditionalOrderConditionType, ConditionalOrderState, ConditionalOrderTriggerSource, Order, OrderRole, OrderSide, OrderStatus, OrderStatusFilter, OrderTerminalReason, OrderType, PositionSide, TimeInForce, TradingMode, } from "./orders";
|
|
150
154
|
export { ORDER_STATUS_VALUES } from "./orders";
|
|
151
155
|
export type { BatchCancelError, BatchCancelOrdersResponse, BatchCancelResult, BatchCreateOrderParams, BatchCreateOrdersResponse, BatchCreateResult, BatchError, BatchReplaceOrderParams, BatchReplaceOrdersResponse, BatchReplaceResult, CancelConditionalOrderResponse, CancelOrderResponse, ConditionalOrder, CreateOrderResponse, GetOrderResponse, GetPaginatedOrdersParams, GetPaginatedOrdersResponse, ListConditionalOrdersParams, ListConditionalOrdersResponse, MatchResult, ParentTpSlLegParams, ReplaceOrderResponse, UpdatedFields, } from "./responses";
|
package/dist/trading/orders.d.ts
CHANGED
|
@@ -115,6 +115,14 @@ export declare const ORDER_STATUS_VALUES: readonly ["SUBMITTED", "PARTIALLY_FILL
|
|
|
115
115
|
* - EXPIRED: Order expired based on time constraints
|
|
116
116
|
*/
|
|
117
117
|
export type OrderStatus = (typeof ORDER_STATUS_VALUES)[number];
|
|
118
|
+
/**
|
|
119
|
+
* Order status filter accepted by the order listing endpoints.
|
|
120
|
+
*
|
|
121
|
+
* A single status matches only that status; an array matches any of the listed
|
|
122
|
+
* statuses (sent to the API as a comma-separated `status` query parameter), so
|
|
123
|
+
* several statuses can be fetched in one request instead of one per status.
|
|
124
|
+
*/
|
|
125
|
+
export type OrderStatusFilter = OrderStatus | readonly OrderStatus[];
|
|
118
126
|
/**
|
|
119
127
|
* Trading mode
|
|
120
128
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Response types for trading operations.
|
|
5
5
|
*/
|
|
6
6
|
import type { MarginMode } from "../margin-accounts";
|
|
7
|
-
import type { ConditionalOrderConditionType, ConditionalOrderState, ConditionalOrderTriggerSource, Order, OrderSide, OrderStatus, OrderType, PositionSide, TimeInForce, TradingMode } from "./orders";
|
|
7
|
+
import type { ConditionalOrderConditionType, ConditionalOrderState, ConditionalOrderTriggerSource, Order, OrderSide, OrderStatus, OrderStatusFilter, OrderType, PositionSide, TimeInForce, TradingMode } from "./orders";
|
|
8
8
|
/**
|
|
9
9
|
* Match result information for order execution.
|
|
10
10
|
* Contains detailed information about trades, fills, and execution quality.
|
|
@@ -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
|
*/
|
|
@@ -127,22 +125,30 @@ export interface UpdatedFields {
|
|
|
127
125
|
* Query parameters for getting paginated orders
|
|
128
126
|
*/
|
|
129
127
|
export interface GetPaginatedOrdersParams {
|
|
130
|
-
/** Filter by order status */
|
|
131
|
-
status?:
|
|
128
|
+
/** Filter by order status, or by any of several statuses when given an array */
|
|
129
|
+
status?: OrderStatusFilter;
|
|
132
130
|
/** Filter by trading pair UUID */
|
|
133
131
|
tradingPairId?: string;
|
|
134
132
|
/** Filter by trading mode */
|
|
135
133
|
tradingMode?: TradingMode;
|
|
136
134
|
/** Filter by margin account UUID */
|
|
137
135
|
marginAccountId?: string;
|
|
138
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* Page number for legacy offset pagination.
|
|
138
|
+
*
|
|
139
|
+
* @deprecated Use cursor pagination (`pageToken`) instead. Passing `page`
|
|
140
|
+
* selects legacy page-number mode, which only ever sees recent (hot)
|
|
141
|
+
* history; omitting both `page` and `pageToken` now drives cursor mode.
|
|
142
|
+
*/
|
|
139
143
|
page?: number;
|
|
140
|
-
/** Number of orders per page (default: 10
|
|
144
|
+
/** Number of orders per page (default: 10; max 100 in page-number mode, up to 1000 when `pageToken` is present) */
|
|
141
145
|
pageSize?: number;
|
|
142
146
|
/**
|
|
143
147
|
* Pagination cursor with three distinct states:
|
|
144
|
-
* - Omitted (`undefined`):
|
|
145
|
-
*
|
|
148
|
+
* - Omitted (`undefined`): the SDK starts a cursor walk (it sends
|
|
149
|
+
* `pageToken=""`) unless the deprecated `page` param was passed, in
|
|
150
|
+
* which case the request uses legacy page-number pagination, limited to
|
|
151
|
+
* recent history once the archive window is enabled.
|
|
146
152
|
* - Empty string (`""`): start a cursor walk with no prior position, from
|
|
147
153
|
* the newest row (or the oldest, when `orderBy` is `"ASC"`).
|
|
148
154
|
* - Non-empty: an opaque cursor from a previous response's
|
|
@@ -168,13 +174,28 @@ export interface GetPaginatedOrdersResponse {
|
|
|
168
174
|
latest_orders?: Order[];
|
|
169
175
|
/** Array of historical orders from PostgreSQL (paginated) */
|
|
170
176
|
orders: Order[];
|
|
171
|
-
/**
|
|
177
|
+
/**
|
|
178
|
+
* Total number of orders matching the query.
|
|
179
|
+
*
|
|
180
|
+
* @deprecated Only populated by legacy page-number (offset) responses; 0 in
|
|
181
|
+
* cursor mode, which has no exact total. Walk `nextPageToken` instead.
|
|
182
|
+
*/
|
|
172
183
|
total: number;
|
|
173
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* Current page number.
|
|
186
|
+
*
|
|
187
|
+
* @deprecated Only populated by legacy page-number (offset) responses; 0 in
|
|
188
|
+
* cursor mode. Use `pageToken`/`nextPageToken` pagination instead.
|
|
189
|
+
*/
|
|
174
190
|
page: number;
|
|
175
191
|
/** Number of orders per page */
|
|
176
192
|
pageSize: number;
|
|
177
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* Total number of pages.
|
|
195
|
+
*
|
|
196
|
+
* @deprecated Only populated by legacy page-number (offset) responses; 0 in
|
|
197
|
+
* cursor mode, which has no exact total. Walk `nextPageToken` instead.
|
|
198
|
+
*/
|
|
178
199
|
totalPages: number;
|
|
179
200
|
/**
|
|
180
201
|
* Cursor for the next page. Empty on every page-number (legacy) response —
|
|
@@ -7,8 +7,11 @@ const PaginationSchema = z.object({
|
|
|
7
7
|
page: z.number().int().min(1, "Page must be at least 1").optional(),
|
|
8
8
|
pageSize: z.number().int().min(1, "Page size must be at least 1").max(100, "Page size cannot exceed 100").optional(),
|
|
9
9
|
});
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
// Filter values accepted by the list-positions endpoint. Narrower than the
|
|
11
|
+
// returned PositionStatus: the backend folds EXPIRED positions under CLOSED, so
|
|
12
|
+
// EXPIRED is not an accepted filter value.
|
|
13
|
+
const PositionStatusSchema = z.enum(["OPEN", "CLOSED", "LIQUIDATING", "LIQUIDATED"], {
|
|
14
|
+
message: 'Position status must be "OPEN", "CLOSED", "LIQUIDATING", or "LIQUIDATED"',
|
|
12
15
|
});
|
|
13
16
|
const ClosePositionTypeSchema = z.enum(["MARKET", "LIMIT", "IOC"], {
|
|
14
17
|
message: 'Close type must be "MARKET", "LIMIT", or "IOC"',
|
|
@@ -37,11 +37,25 @@ export const GetUserMovementsSchema = z.object({
|
|
|
37
37
|
* Validates parameters for fetching paginated user trades.
|
|
38
38
|
* All fields are optional — an empty object or undefined is valid.
|
|
39
39
|
*/
|
|
40
|
-
export const GetUserTradesSchema = z
|
|
40
|
+
export const GetUserTradesSchema = z
|
|
41
|
+
.object({
|
|
41
42
|
page: z.number().int("Page must be an integer").min(1, "Page must be at least 1").optional(),
|
|
42
|
-
pageSize: z.number().int("Page size must be an integer").min(1, "Page size must be at least 1").max(
|
|
43
|
+
pageSize: z.number().int("Page size must be an integer").min(1, "Page size must be at least 1").max(1000, "Page size cannot exceed 1000").optional(),
|
|
43
44
|
tradingPairId: UUIDSchema.optional(),
|
|
44
45
|
pageToken: z.string().optional(),
|
|
46
|
+
})
|
|
47
|
+
.superRefine((params, ctx) => {
|
|
48
|
+
// The higher 1000 cap only applies to cursor (pageToken) requests; the
|
|
49
|
+
// server keeps the 100 cap for page-number requests (offset scans).
|
|
50
|
+
// Legacy page-number mode is selected only by passing `page` without
|
|
51
|
+
// `pageToken` — omitting both starts a cursor walk.
|
|
52
|
+
if (params.page !== undefined && params.pageToken === undefined && params.pageSize !== undefined && params.pageSize > 100) {
|
|
53
|
+
ctx.addIssue({
|
|
54
|
+
code: z.ZodIssueCode.custom,
|
|
55
|
+
message: "Page size cannot exceed 100 in page-number mode (page without pageToken)",
|
|
56
|
+
path: ["pageSize"],
|
|
57
|
+
});
|
|
58
|
+
}
|
|
45
59
|
});
|
|
46
60
|
export const ListFundingPaymentsSchema = z.object({
|
|
47
61
|
page: z.number().int("Page must be an integer").min(1, "Page must be at least 1").optional(),
|
|
@@ -237,13 +237,13 @@ export declare const ReplaceOrderSchema: z.ZodObject<{
|
|
|
237
237
|
*
|
|
238
238
|
* Validates parameters for fetching paginated orders.
|
|
239
239
|
* Matches the getPaginatedOrders method signature which accepts:
|
|
240
|
-
* - status: OrderStatus (optional filter)
|
|
240
|
+
* - status: OrderStatus, or a non-empty array of them (optional filter)
|
|
241
241
|
* - tradingPairId: trading pair UUID (optional filter)
|
|
242
242
|
* - page: number (default: 1)
|
|
243
|
-
* - pageSize: number (default: 10, max: 100)
|
|
243
|
+
* - pageSize: number (default: 10, max: 100 in page-number mode, 1000 when pageToken is present)
|
|
244
244
|
*/
|
|
245
245
|
export declare const GetPaginatedOrdersSchema: z.ZodObject<{
|
|
246
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
246
|
+
status: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
247
247
|
SUBMITTED: "SUBMITTED";
|
|
248
248
|
PARTIALLY_FILLED: "PARTIALLY_FILLED";
|
|
249
249
|
FILLED: "FILLED";
|
|
@@ -252,7 +252,16 @@ export declare const GetPaginatedOrdersSchema: z.ZodObject<{
|
|
|
252
252
|
CANCELLED: "CANCELLED";
|
|
253
253
|
REJECTED: "REJECTED";
|
|
254
254
|
EXPIRED: "EXPIRED";
|
|
255
|
-
}
|
|
255
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
256
|
+
SUBMITTED: "SUBMITTED";
|
|
257
|
+
PARTIALLY_FILLED: "PARTIALLY_FILLED";
|
|
258
|
+
FILLED: "FILLED";
|
|
259
|
+
SETTLED_ON_CHAIN: "SETTLED_ON_CHAIN";
|
|
260
|
+
SETTLED: "SETTLED";
|
|
261
|
+
CANCELLED: "CANCELLED";
|
|
262
|
+
REJECTED: "REJECTED";
|
|
263
|
+
EXPIRED: "EXPIRED";
|
|
264
|
+
}>>]>>;
|
|
256
265
|
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
257
266
|
tradingMode: z.ZodOptional<z.ZodEnum<{
|
|
258
267
|
SPOT: "SPOT";
|
|
@@ -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", {
|
|
@@ -273,19 +281,33 @@ export const ReplaceOrderSchema = z.object({
|
|
|
273
281
|
*
|
|
274
282
|
* Validates parameters for fetching paginated orders.
|
|
275
283
|
* Matches the getPaginatedOrders method signature which accepts:
|
|
276
|
-
* - status: OrderStatus (optional filter)
|
|
284
|
+
* - status: OrderStatus, or a non-empty array of them (optional filter)
|
|
277
285
|
* - tradingPairId: trading pair UUID (optional filter)
|
|
278
286
|
* - page: number (default: 1)
|
|
279
|
-
* - pageSize: number (default: 10, max: 100)
|
|
287
|
+
* - pageSize: number (default: 10, max: 100 in page-number mode, 1000 when pageToken is present)
|
|
280
288
|
*/
|
|
281
|
-
export const GetPaginatedOrdersSchema = z
|
|
282
|
-
|
|
289
|
+
export const GetPaginatedOrdersSchema = z
|
|
290
|
+
.object({
|
|
291
|
+
status: z.union([z.enum(ORDER_STATUS_VALUES), z.array(z.enum(ORDER_STATUS_VALUES)).min(1, "Status filter must list at least one status")]).optional(),
|
|
283
292
|
tradingPairId: UUIDSchema.optional(),
|
|
284
293
|
tradingMode: TradingModeSchema.optional(),
|
|
285
294
|
marginAccountId: UUIDSchema.optional(),
|
|
286
295
|
page: z.number().int().min(1, "Page must be at least 1").optional(),
|
|
287
|
-
pageSize: z.number().int().min(1, "Page size must be at least 1").max(
|
|
296
|
+
pageSize: z.number().int().min(1, "Page size must be at least 1").max(1000, "Page size cannot exceed 1000").optional(),
|
|
288
297
|
pageToken: z.string().optional(),
|
|
298
|
+
})
|
|
299
|
+
.superRefine((params, ctx) => {
|
|
300
|
+
// The higher 1000 cap only applies to cursor (pageToken) requests; the
|
|
301
|
+
// server keeps the 100 cap for page-number requests (offset scans).
|
|
302
|
+
// Legacy page-number mode is selected only by passing `page` without
|
|
303
|
+
// `pageToken` — omitting both starts a cursor walk.
|
|
304
|
+
if (params.page !== undefined && params.pageToken === undefined && params.pageSize !== undefined && params.pageSize > 100) {
|
|
305
|
+
ctx.addIssue({
|
|
306
|
+
code: z.ZodIssueCode.custom,
|
|
307
|
+
message: "Page size cannot exceed 100 in page-number mode (page without pageToken)",
|
|
308
|
+
path: ["pageSize"],
|
|
309
|
+
});
|
|
310
|
+
}
|
|
289
311
|
});
|
|
290
312
|
export const ConditionalOrderConditionTypeSchema = z.enum(["STOP_LOSS", "TAKE_PROFIT"], {
|
|
291
313
|
message: 'conditionType must be "STOP_LOSS" or "TAKE_PROFIT"',
|
|
@@ -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",
|
package/dist/wire/schema.d.ts
CHANGED
|
@@ -1052,6 +1052,26 @@ export interface paths {
|
|
|
1052
1052
|
patch?: never;
|
|
1053
1053
|
trace?: never;
|
|
1054
1054
|
};
|
|
1055
|
+
"/api/v1/market/funding/history": {
|
|
1056
|
+
parameters: {
|
|
1057
|
+
query?: never;
|
|
1058
|
+
header?: never;
|
|
1059
|
+
path?: never;
|
|
1060
|
+
cookie?: never;
|
|
1061
|
+
};
|
|
1062
|
+
/**
|
|
1063
|
+
* @description Historical funding settlements across all perp markets in one call, so
|
|
1064
|
+
* clients don't have to fan out one request per trading pair.
|
|
1065
|
+
*/
|
|
1066
|
+
get: operations["list_all_funding_history"];
|
|
1067
|
+
put?: never;
|
|
1068
|
+
post?: never;
|
|
1069
|
+
delete?: never;
|
|
1070
|
+
options?: never;
|
|
1071
|
+
head?: never;
|
|
1072
|
+
patch?: never;
|
|
1073
|
+
trace?: never;
|
|
1074
|
+
};
|
|
1055
1075
|
"/api/v1/market/pairs": {
|
|
1056
1076
|
parameters: {
|
|
1057
1077
|
query?: never;
|
|
@@ -1854,6 +1874,33 @@ export interface paths {
|
|
|
1854
1874
|
patch?: never;
|
|
1855
1875
|
trace?: never;
|
|
1856
1876
|
};
|
|
1877
|
+
"/api/v1/pulse": {
|
|
1878
|
+
parameters: {
|
|
1879
|
+
query?: never;
|
|
1880
|
+
header?: never;
|
|
1881
|
+
path?: never;
|
|
1882
|
+
cookie?: never;
|
|
1883
|
+
};
|
|
1884
|
+
/**
|
|
1885
|
+
* Get the market pulse news feed
|
|
1886
|
+
* @description Get the market pulse news feed.
|
|
1887
|
+
*
|
|
1888
|
+
* Returns the latest cached snapshot of AI-synthesized, per-asset news
|
|
1889
|
+
* headlines with sentiment tags, refreshed hourly from the upstream
|
|
1890
|
+
* pipeline by a background poller. The request path never calls the
|
|
1891
|
+
* upstream. Public endpoint — no authentication required. Responses carry
|
|
1892
|
+
* an ETag (the snapshot's generatedAt); clients may send If-None-Match to
|
|
1893
|
+
* receive 304 when unchanged.
|
|
1894
|
+
*/
|
|
1895
|
+
get: operations["get_pulse"];
|
|
1896
|
+
put?: never;
|
|
1897
|
+
post?: never;
|
|
1898
|
+
delete?: never;
|
|
1899
|
+
options?: never;
|
|
1900
|
+
head?: never;
|
|
1901
|
+
patch?: never;
|
|
1902
|
+
trace?: never;
|
|
1903
|
+
};
|
|
1857
1904
|
"/api/v1/trades/by-id/{tradeId}": {
|
|
1858
1905
|
parameters: {
|
|
1859
1906
|
query?: never;
|
|
@@ -3270,19 +3317,48 @@ export interface components {
|
|
|
3270
3317
|
*/
|
|
3271
3318
|
createdAt?: string | null;
|
|
3272
3319
|
};
|
|
3320
|
+
/**
|
|
3321
|
+
* @description One settled funding window. Windows are fixed and epoch-aligned (hourly);
|
|
3322
|
+
* a boundary the engine was down for is skipped, never settled retroactively,
|
|
3323
|
+
* so consecutive records can legitimately be more than one interval apart.
|
|
3324
|
+
*/
|
|
3273
3325
|
FundingRecord: {
|
|
3274
3326
|
/** Format: uuid */
|
|
3275
3327
|
tradingPairId?: string | null;
|
|
3276
3328
|
epoch?: string | null;
|
|
3329
|
+
/**
|
|
3330
|
+
* @description Final settled rate for the window as a decimal-string fraction per
|
|
3331
|
+
* funding interval (e.g. "0.0001" = 0.01%). The ±max-rate cap is applied
|
|
3332
|
+
* once to the window average at settlement; this is the capped value that
|
|
3333
|
+
* payments used.
|
|
3334
|
+
*/
|
|
3277
3335
|
fundingRate?: string | null;
|
|
3336
|
+
/**
|
|
3337
|
+
* @description Quote currency charged per unit of base position for this window:
|
|
3338
|
+
* funding_rate x reference_price. Positive means longs paid shorts.
|
|
3339
|
+
*/
|
|
3278
3340
|
fundingDeltaPerUnit?: string | null;
|
|
3341
|
+
/**
|
|
3342
|
+
* @description Running sum of funding_delta_per_unit across all settled windows;
|
|
3343
|
+
* position payments settle against deltas of this value.
|
|
3344
|
+
*/
|
|
3279
3345
|
cumulativeFundingPerUnit?: string | null;
|
|
3346
|
+
/**
|
|
3347
|
+
* @description Mark price at the window boundary — the payment basis for every
|
|
3348
|
+
* position settled in this window.
|
|
3349
|
+
*/
|
|
3280
3350
|
referencePrice?: string | null;
|
|
3281
3351
|
/** Format: uint32 */
|
|
3282
3352
|
sampleCount?: number | null;
|
|
3283
3353
|
windowStartedAt?: string | null;
|
|
3284
3354
|
windowClosedAt?: string | null;
|
|
3285
3355
|
settledAt?: string | null;
|
|
3356
|
+
/**
|
|
3357
|
+
* @description True when the window held fewer than the minimum accepted samples and
|
|
3358
|
+
* settled at the carried last settled rate (zero if no rate was ever
|
|
3359
|
+
* settled) instead of a freshly computed average.
|
|
3360
|
+
*/
|
|
3361
|
+
carried?: boolean | null;
|
|
3286
3362
|
};
|
|
3287
3363
|
GetAppStatsResponse: {
|
|
3288
3364
|
/**
|
|
@@ -3459,11 +3535,31 @@ export interface components {
|
|
|
3459
3535
|
GetFundingStateResponse: {
|
|
3460
3536
|
/** Format: uuid */
|
|
3461
3537
|
tradingPairId?: string | null;
|
|
3538
|
+
/**
|
|
3539
|
+
* @description Most recently SETTLED funding rate as a decimal-string fraction per funding interval; "0" when nothing has settled yet
|
|
3540
|
+
* @example 0.0001
|
|
3541
|
+
*/
|
|
3462
3542
|
currentFundingRate?: string | null;
|
|
3543
|
+
/**
|
|
3544
|
+
* @description Implied rate for the in-progress window. An estimate refreshed on each accepted premium sample (roughly every sample interval plus persistence lag), not a real-time stream; absent when the window has no samples
|
|
3545
|
+
* @example 0.00012
|
|
3546
|
+
*/
|
|
3463
3547
|
estimatedNextFundingRate?: string | null;
|
|
3548
|
+
/**
|
|
3549
|
+
* @description Scheduled end of the current funding window (ms epoch string). An estimate, not a guarantee: settlement lands at or shortly after this boundary when the market is alive, and boundaries that pass while the engine is down are skipped, never settled retroactively
|
|
3550
|
+
* @example 1754006400000
|
|
3551
|
+
*/
|
|
3464
3552
|
nextFundingTime?: string | null;
|
|
3465
|
-
/**
|
|
3553
|
+
/**
|
|
3554
|
+
* Format: uint32
|
|
3555
|
+
* @description Length of a funding window in seconds, inferred from settlement history and market configuration
|
|
3556
|
+
* @example 3600
|
|
3557
|
+
*/
|
|
3466
3558
|
fundingIntervalSeconds?: number | null;
|
|
3559
|
+
/**
|
|
3560
|
+
* @description Close of the most recently settled window (ms epoch string); absent before the first settlement
|
|
3561
|
+
* @example 1754002800000
|
|
3562
|
+
*/
|
|
3467
3563
|
lastFundingTime?: string | null;
|
|
3468
3564
|
updatedAt?: string | null;
|
|
3469
3565
|
};
|
|
@@ -4114,7 +4210,7 @@ export interface components {
|
|
|
4114
4210
|
perpsEquity?: string | null;
|
|
4115
4211
|
/**
|
|
4116
4212
|
* Format: double
|
|
4117
|
-
* @description
|
|
4213
|
+
* @description Position-level win rate: winning positions over winning + losing positions (break-even excluded). Each position (one flat->open->flat round-trip) is classified once by its net realized PnL after all fees, not per fill. Null when the period has no closed positions.
|
|
4118
4214
|
* @example 0.65
|
|
4119
4215
|
*/
|
|
4120
4216
|
winLossRatio?: number | null;
|
|
@@ -4163,13 +4259,23 @@ export interface components {
|
|
|
4163
4259
|
/** Format: uuid */
|
|
4164
4260
|
tradingPairId?: string | null;
|
|
4165
4261
|
side?: string | null;
|
|
4262
|
+
/**
|
|
4263
|
+
* @description Open rows: current absolute position quantity. Terminal rows
|
|
4264
|
+
* (CLOSED/LIQUIDATED/EXPIRED): total quantity closed over the position's
|
|
4265
|
+
* life, summed from its reducing executions when available.
|
|
4266
|
+
*/
|
|
4166
4267
|
size?: string | null;
|
|
4167
4268
|
entryPrice?: string | null;
|
|
4168
4269
|
markPrice?: string | null;
|
|
4169
4270
|
indexPrice?: string | null;
|
|
4170
4271
|
unrealizedPnl?: string | null;
|
|
4171
4272
|
realizedPnl?: string | null;
|
|
4172
|
-
/**
|
|
4273
|
+
/**
|
|
4274
|
+
* @description Open rows: current isolated collateral for this position's risk bucket.
|
|
4275
|
+
* Terminal rows: total initial margin allocated across the position's
|
|
4276
|
+
* reducing executions when available — the margin basis for lifetime
|
|
4277
|
+
* realized return.
|
|
4278
|
+
*/
|
|
4173
4279
|
isolatedMargin?: string | null;
|
|
4174
4280
|
leverage?: string | null;
|
|
4175
4281
|
/**
|
|
@@ -4196,6 +4302,21 @@ export interface components {
|
|
|
4196
4302
|
updatedAt?: string | null;
|
|
4197
4303
|
riskBucketId?: string | null;
|
|
4198
4304
|
marginMode?: string | null;
|
|
4305
|
+
/**
|
|
4306
|
+
* @description Lifetime realized PnL net of trading fees and funding. Terminal rows
|
|
4307
|
+
* only; absent when the position's reducing executions are unavailable.
|
|
4308
|
+
*/
|
|
4309
|
+
netRealizedPnl?: string | null;
|
|
4310
|
+
/**
|
|
4311
|
+
* @description Lifetime realized return on the total allocated initial margin, as a
|
|
4312
|
+
* percentage, computed from NET realized PnL (after trading fees and
|
|
4313
|
+
* funding). The denominator is initial margin only: fees and funding are
|
|
4314
|
+
* costs rather than posted collateral, and funding is signed, so folding it
|
|
4315
|
+
* into the denominator could drive it to zero or negative. Terminal rows
|
|
4316
|
+
* only; absent when unavailable, including when the position's reducing
|
|
4317
|
+
* executions do not account for its whole lifetime.
|
|
4318
|
+
*/
|
|
4319
|
+
realizedRoe?: string | null;
|
|
4199
4320
|
};
|
|
4200
4321
|
GetPositionRiskResponse: {
|
|
4201
4322
|
positionId?: string | null;
|
|
@@ -4284,6 +4405,26 @@ export interface components {
|
|
|
4284
4405
|
*/
|
|
4285
4406
|
applicationMakerFeeBps?: number | null;
|
|
4286
4407
|
};
|
|
4408
|
+
GetPulseResponse: {
|
|
4409
|
+
/**
|
|
4410
|
+
* @description When this snapshot was produced upstream, ISO-8601 UTC; also serves as the response ETag value
|
|
4411
|
+
* @example 2026-07-22T15:17:14Z
|
|
4412
|
+
*/
|
|
4413
|
+
generatedAt?: string | null;
|
|
4414
|
+
/**
|
|
4415
|
+
* @description Asset universe this snapshot was synthesized against
|
|
4416
|
+
* @example [
|
|
4417
|
+
* "BTC",
|
|
4418
|
+
* "ETH",
|
|
4419
|
+
* "SOL",
|
|
4420
|
+
* "SEI",
|
|
4421
|
+
* "HYPE"
|
|
4422
|
+
* ]
|
|
4423
|
+
*/
|
|
4424
|
+
watchlist?: string[] | null;
|
|
4425
|
+
/** @description Pulse items, pre-sorted: watchlist order first, MARKET last, most-recent-first within each asset. Items with unverified figures are removed server-side. */
|
|
4426
|
+
items?: components["schemas"]["PulseItem"][] | null;
|
|
4427
|
+
};
|
|
4287
4428
|
GetRewardsBalanceResponse: {
|
|
4288
4429
|
/** @description One entry per reward token that has a non-zero available balance. */
|
|
4289
4430
|
balances?: components["schemas"]["RewardsBalanceEntry"][] | null;
|
|
@@ -4366,7 +4507,8 @@ export interface components {
|
|
|
4366
4507
|
GetUserTradesResponse: {
|
|
4367
4508
|
trades?: components["schemas"]["UserTrade"][] | null;
|
|
4368
4509
|
/**
|
|
4369
|
-
* @
|
|
4510
|
+
* @deprecated
|
|
4511
|
+
* @description Deprecated: current page number (legacy offset mode only; 0 in cursor mode)
|
|
4370
4512
|
* @example 1
|
|
4371
4513
|
*/
|
|
4372
4514
|
page?: string | null;
|
|
@@ -4376,12 +4518,14 @@ export interface components {
|
|
|
4376
4518
|
*/
|
|
4377
4519
|
pageSize?: string | null;
|
|
4378
4520
|
/**
|
|
4379
|
-
* @
|
|
4521
|
+
* @deprecated
|
|
4522
|
+
* @description Deprecated: total number of trades (legacy offset mode only; 0 in cursor mode)
|
|
4380
4523
|
* @example 150
|
|
4381
4524
|
*/
|
|
4382
4525
|
total?: string | null;
|
|
4383
4526
|
/**
|
|
4384
|
-
* @
|
|
4527
|
+
* @deprecated
|
|
4528
|
+
* @description Deprecated: total number of pages (legacy offset mode only; 0 in cursor mode)
|
|
4385
4529
|
* @example 8
|
|
4386
4530
|
*/
|
|
4387
4531
|
totalPages?: string | null;
|
|
@@ -4563,6 +4707,15 @@ export interface components {
|
|
|
4563
4707
|
*/
|
|
4564
4708
|
balanceId?: string | null;
|
|
4565
4709
|
};
|
|
4710
|
+
ListAllFundingHistoryResponse: {
|
|
4711
|
+
records?: components["schemas"]["FundingRecord"][] | null;
|
|
4712
|
+
/** Format: uint32 */
|
|
4713
|
+
total?: number | null;
|
|
4714
|
+
/** Format: uint32 */
|
|
4715
|
+
page?: number | null;
|
|
4716
|
+
/** Format: uint32 */
|
|
4717
|
+
pageSize?: number | null;
|
|
4718
|
+
};
|
|
4566
4719
|
ListAppBalancesResponse: {
|
|
4567
4720
|
balances?: components["schemas"]["ApplicationBalance"][] | null;
|
|
4568
4721
|
/**
|
|
@@ -4737,13 +4890,15 @@ export interface components {
|
|
|
4737
4890
|
orders?: components["schemas"]["GetOrderResponse"][] | null;
|
|
4738
4891
|
/**
|
|
4739
4892
|
* Format: uint32
|
|
4740
|
-
* @
|
|
4893
|
+
* @deprecated
|
|
4894
|
+
* @description Deprecated: total number of orders matching the filter (legacy offset mode only; 0 in cursor mode)
|
|
4741
4895
|
* @example 150
|
|
4742
4896
|
*/
|
|
4743
4897
|
total?: number | null;
|
|
4744
4898
|
/**
|
|
4745
4899
|
* Format: uint32
|
|
4746
|
-
* @
|
|
4900
|
+
* @deprecated
|
|
4901
|
+
* @description Deprecated: current page number (legacy offset mode only; 0 in cursor mode)
|
|
4747
4902
|
* @example 1
|
|
4748
4903
|
*/
|
|
4749
4904
|
page?: number | null;
|
|
@@ -4755,7 +4910,8 @@ export interface components {
|
|
|
4755
4910
|
pageSize?: number | null;
|
|
4756
4911
|
/**
|
|
4757
4912
|
* Format: uint32
|
|
4758
|
-
* @
|
|
4913
|
+
* @deprecated
|
|
4914
|
+
* @description Deprecated: total number of pages (legacy offset mode only; 0 in cursor mode)
|
|
4759
4915
|
* @example 8
|
|
4760
4916
|
*/
|
|
4761
4917
|
totalPages?: number | null;
|
|
@@ -5133,12 +5289,23 @@ export interface components {
|
|
|
5133
5289
|
date?: string | null;
|
|
5134
5290
|
netRealizedPnl?: string | null;
|
|
5135
5291
|
};
|
|
5292
|
+
/**
|
|
5293
|
+
* @description Win rate is position-level: winners/losers/break_even and win_rate_pct count
|
|
5294
|
+
* each position (one flat -> open -> flat round-trip) once, classified by its
|
|
5295
|
+
* net realized PnL after all fees. `count` stays fill-based (each partial
|
|
5296
|
+
* closing fill is counted).
|
|
5297
|
+
*/
|
|
5136
5298
|
PortfolioClosedTradeStats: {
|
|
5137
5299
|
count?: string | null;
|
|
5138
5300
|
winners?: string | null;
|
|
5139
5301
|
losers?: string | null;
|
|
5140
5302
|
breakEven?: string | null;
|
|
5141
5303
|
winRatePct?: string | null;
|
|
5304
|
+
/**
|
|
5305
|
+
* @description Total classified positions (= winners + losers + break_even): the
|
|
5306
|
+
* position-level denominator, distinct from the fill-based `count`.
|
|
5307
|
+
*/
|
|
5308
|
+
positions?: string | null;
|
|
5142
5309
|
};
|
|
5143
5310
|
PortfolioMarginPositionCounts: {
|
|
5144
5311
|
total?: string | null;
|
|
@@ -5258,13 +5425,23 @@ export interface components {
|
|
|
5258
5425
|
/** Format: uuid */
|
|
5259
5426
|
tradingPairId?: string | null;
|
|
5260
5427
|
side?: string | null;
|
|
5428
|
+
/**
|
|
5429
|
+
* @description Open rows: current absolute position quantity. Terminal rows
|
|
5430
|
+
* (CLOSED/LIQUIDATED/EXPIRED): total quantity closed over the position's
|
|
5431
|
+
* life, summed from its reducing executions when available.
|
|
5432
|
+
*/
|
|
5261
5433
|
size?: string | null;
|
|
5262
5434
|
entryPrice?: string | null;
|
|
5263
5435
|
markPrice?: string | null;
|
|
5264
5436
|
indexPrice?: string | null;
|
|
5265
5437
|
unrealizedPnl?: string | null;
|
|
5266
5438
|
realizedPnl?: string | null;
|
|
5267
|
-
/**
|
|
5439
|
+
/**
|
|
5440
|
+
* @description Open rows: current isolated collateral for this position's risk bucket.
|
|
5441
|
+
* Terminal rows: total initial margin allocated across the position's
|
|
5442
|
+
* reducing executions when available — the margin basis for lifetime
|
|
5443
|
+
* realized return.
|
|
5444
|
+
*/
|
|
5268
5445
|
isolatedMargin?: string | null;
|
|
5269
5446
|
leverage?: string | null;
|
|
5270
5447
|
/**
|
|
@@ -5291,6 +5468,21 @@ export interface components {
|
|
|
5291
5468
|
updatedAt?: string | null;
|
|
5292
5469
|
riskBucketId?: string | null;
|
|
5293
5470
|
marginMode?: string | null;
|
|
5471
|
+
/**
|
|
5472
|
+
* @description Lifetime realized PnL net of trading fees and funding. Terminal rows
|
|
5473
|
+
* only; absent when the position's reducing executions are unavailable.
|
|
5474
|
+
*/
|
|
5475
|
+
netRealizedPnl?: string | null;
|
|
5476
|
+
/**
|
|
5477
|
+
* @description Lifetime realized return on the total allocated initial margin, as a
|
|
5478
|
+
* percentage, computed from NET realized PnL (after trading fees and
|
|
5479
|
+
* funding). The denominator is initial margin only: fees and funding are
|
|
5480
|
+
* costs rather than posted collateral, and funding is signed, so folding it
|
|
5481
|
+
* into the denominator could drive it to zero or negative. Terminal rows
|
|
5482
|
+
* only; absent when unavailable, including when the position's reducing
|
|
5483
|
+
* executions do not account for its whole lifetime.
|
|
5484
|
+
*/
|
|
5485
|
+
realizedRoe?: string | null;
|
|
5294
5486
|
};
|
|
5295
5487
|
PositionHistoryEvent: {
|
|
5296
5488
|
id?: string | null;
|
|
@@ -5444,6 +5636,58 @@ export interface components {
|
|
|
5444
5636
|
*/
|
|
5445
5637
|
tradingMode?: string | null;
|
|
5446
5638
|
};
|
|
5639
|
+
PulseItem: {
|
|
5640
|
+
/**
|
|
5641
|
+
* @description Watchlist ticker (e.g. "BTC") or "MARKET" for a cross-asset story
|
|
5642
|
+
* @example SEI
|
|
5643
|
+
*/
|
|
5644
|
+
asset?: string | null;
|
|
5645
|
+
/**
|
|
5646
|
+
* @description Sentiment tag: "Bullish", "Neutral", or "Bearish"
|
|
5647
|
+
* @example Bullish
|
|
5648
|
+
*/
|
|
5649
|
+
sentiment?: string | null;
|
|
5650
|
+
/**
|
|
5651
|
+
* @description Synthesized 1-2 sentence summary, at most 240 characters
|
|
5652
|
+
* @example SEI gained 4% amid ecosystem growth.
|
|
5653
|
+
*/
|
|
5654
|
+
summary?: string | null;
|
|
5655
|
+
/**
|
|
5656
|
+
* @description Timestamp of the most recent source in the cluster, ISO-8601; render relative time client-side
|
|
5657
|
+
* @example 2026-07-21T02:15:19
|
|
5658
|
+
*/
|
|
5659
|
+
updatedAt?: string | null;
|
|
5660
|
+
/** @description Provenance for the item, for attribution links */
|
|
5661
|
+
sources?: components["schemas"]["PulseSource"][] | null;
|
|
5662
|
+
};
|
|
5663
|
+
PulseSource: {
|
|
5664
|
+
/**
|
|
5665
|
+
* @description Source article or post URL
|
|
5666
|
+
* @example https://coinmarketcap.com/top-stories/6a5f0c340787ae5558351f0f/
|
|
5667
|
+
*/
|
|
5668
|
+
url?: string | null;
|
|
5669
|
+
/**
|
|
5670
|
+
* @description Source author or publication name
|
|
5671
|
+
* @example CoinMarketCap
|
|
5672
|
+
*/
|
|
5673
|
+
author?: string | null;
|
|
5674
|
+
/**
|
|
5675
|
+
* @description Source channel: "twitter" or "news"
|
|
5676
|
+
* @example news
|
|
5677
|
+
*/
|
|
5678
|
+
source?: string | null;
|
|
5679
|
+
/**
|
|
5680
|
+
* @description Source publication time, ISO-8601
|
|
5681
|
+
* @example 2026-07-21T02:15:19
|
|
5682
|
+
*/
|
|
5683
|
+
createdAt?: string | null;
|
|
5684
|
+
/**
|
|
5685
|
+
* Format: uint32
|
|
5686
|
+
* @description Relevance score, 1 (low) to 5 (high)
|
|
5687
|
+
* @example 4
|
|
5688
|
+
*/
|
|
5689
|
+
relevance?: number | null;
|
|
5690
|
+
};
|
|
5447
5691
|
ReducePositionMarginRequest: {
|
|
5448
5692
|
amount?: string | null;
|
|
5449
5693
|
};
|
|
@@ -5625,6 +5869,16 @@ export interface components {
|
|
|
5625
5869
|
* @example 482931
|
|
5626
5870
|
*/
|
|
5627
5871
|
totalTradeCountLtd?: string | null;
|
|
5872
|
+
/**
|
|
5873
|
+
* @description Latest settled funding rate as a decimal fraction per funding window (the capped settled value); null for spot pairs and margin pairs with no settled funding window yet
|
|
5874
|
+
* @example 0.000125
|
|
5875
|
+
*/
|
|
5876
|
+
latestFundingRate?: string | null;
|
|
5877
|
+
/**
|
|
5878
|
+
* @description Close time of the latest settled funding window (ms since epoch); null for spot pairs and margin pairs with no settled funding window yet
|
|
5879
|
+
* @example 1745308800000
|
|
5880
|
+
*/
|
|
5881
|
+
lastFundingTime?: string | null;
|
|
5628
5882
|
};
|
|
5629
5883
|
/** @description One UTC-day bucket in a pair's 7-day snapshot. */
|
|
5630
5884
|
ScreenerSnapshotPoint: {
|
|
@@ -7322,9 +7576,12 @@ export interface operations {
|
|
|
7322
7576
|
get_user_trades: {
|
|
7323
7577
|
parameters: {
|
|
7324
7578
|
query?: {
|
|
7325
|
-
/**
|
|
7579
|
+
/**
|
|
7580
|
+
* @deprecated
|
|
7581
|
+
* @description Deprecated: page number for legacy offset pagination (1-indexed). Use pageToken cursor pagination instead.
|
|
7582
|
+
*/
|
|
7326
7583
|
page?: number;
|
|
7327
|
-
/** @description Items per page (max 100) */
|
|
7584
|
+
/** @description Items per page (max: 100 in page-number mode; up to 1000 when pageToken is present) */
|
|
7328
7585
|
pageSize?: number;
|
|
7329
7586
|
/** @description Trading pair identifier (UUID) */
|
|
7330
7587
|
tradingPairId?: string;
|
|
@@ -8720,6 +8977,37 @@ export interface operations {
|
|
|
8720
8977
|
};
|
|
8721
8978
|
};
|
|
8722
8979
|
};
|
|
8980
|
+
list_all_funding_history: {
|
|
8981
|
+
parameters: {
|
|
8982
|
+
query?: {
|
|
8983
|
+
/** @description Start time as Unix timestamp (milliseconds) */
|
|
8984
|
+
startTime?: number;
|
|
8985
|
+
/** @description End time as Unix timestamp (milliseconds) */
|
|
8986
|
+
endTime?: number;
|
|
8987
|
+
/** @description Page number (1-indexed) */
|
|
8988
|
+
page?: number;
|
|
8989
|
+
/** @description Items per page (max 100) */
|
|
8990
|
+
pageSize?: number;
|
|
8991
|
+
/** @description Sort direction for settledAt */
|
|
8992
|
+
orderBy?: "ASC" | "DESC";
|
|
8993
|
+
};
|
|
8994
|
+
header?: never;
|
|
8995
|
+
path?: never;
|
|
8996
|
+
cookie?: never;
|
|
8997
|
+
};
|
|
8998
|
+
requestBody?: never;
|
|
8999
|
+
responses: {
|
|
9000
|
+
/** @description OK */
|
|
9001
|
+
200: {
|
|
9002
|
+
headers: {
|
|
9003
|
+
[name: string]: unknown;
|
|
9004
|
+
};
|
|
9005
|
+
content: {
|
|
9006
|
+
"application/json": components["schemas"]["ListAllFundingHistoryResponse"];
|
|
9007
|
+
};
|
|
9008
|
+
};
|
|
9009
|
+
};
|
|
9010
|
+
};
|
|
8723
9011
|
list_trading_pairs: {
|
|
8724
9012
|
parameters: {
|
|
8725
9013
|
query?: {
|
|
@@ -8889,6 +9177,8 @@ export interface operations {
|
|
|
8889
9177
|
page?: number;
|
|
8890
9178
|
/** @description Items per page (max 100) */
|
|
8891
9179
|
pageSize?: number;
|
|
9180
|
+
/** @description Sort direction for createdAt */
|
|
9181
|
+
orderBy?: "ASC" | "DESC";
|
|
8892
9182
|
};
|
|
8893
9183
|
header?: never;
|
|
8894
9184
|
path: {
|
|
@@ -9202,9 +9492,12 @@ export interface operations {
|
|
|
9202
9492
|
get_orders: {
|
|
9203
9493
|
parameters: {
|
|
9204
9494
|
query?: {
|
|
9205
|
-
/**
|
|
9495
|
+
/**
|
|
9496
|
+
* @deprecated
|
|
9497
|
+
* @description Deprecated: page number for legacy offset pagination (1-indexed). Use pageToken cursor pagination instead.
|
|
9498
|
+
*/
|
|
9206
9499
|
page?: number;
|
|
9207
|
-
/** @description Items per page (max 100) */
|
|
9500
|
+
/** @description Items per page (max 100 in page-number mode; up to 1000 when pageToken is present) */
|
|
9208
9501
|
pageSize?: number;
|
|
9209
9502
|
/** @description Order status (single value or comma-separated list) */
|
|
9210
9503
|
status?: string;
|
|
@@ -10245,6 +10538,33 @@ export interface operations {
|
|
|
10245
10538
|
};
|
|
10246
10539
|
};
|
|
10247
10540
|
};
|
|
10541
|
+
get_pulse: {
|
|
10542
|
+
parameters: {
|
|
10543
|
+
query?: never;
|
|
10544
|
+
header?: never;
|
|
10545
|
+
path?: never;
|
|
10546
|
+
cookie?: never;
|
|
10547
|
+
};
|
|
10548
|
+
requestBody?: never;
|
|
10549
|
+
responses: {
|
|
10550
|
+
/** @description OK */
|
|
10551
|
+
200: {
|
|
10552
|
+
headers: {
|
|
10553
|
+
[name: string]: unknown;
|
|
10554
|
+
};
|
|
10555
|
+
content: {
|
|
10556
|
+
"application/json": components["schemas"]["GetPulseResponse"];
|
|
10557
|
+
};
|
|
10558
|
+
};
|
|
10559
|
+
/** @description Pulse feed not yet available */
|
|
10560
|
+
503: {
|
|
10561
|
+
headers: {
|
|
10562
|
+
[name: string]: unknown;
|
|
10563
|
+
};
|
|
10564
|
+
content?: never;
|
|
10565
|
+
};
|
|
10566
|
+
};
|
|
10567
|
+
};
|
|
10248
10568
|
get_trade_by_id: {
|
|
10249
10569
|
parameters: {
|
|
10250
10570
|
query?: never;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"lint": "biome lint ."
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@0xmonaco/contracts": "1.0.
|
|
23
|
+
"@0xmonaco/contracts": "1.0.31",
|
|
24
24
|
"zod": "^4.1.12"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|